Merge lp:~baratosha23/stellarium/stellarium into lp:stellarium

Proposed by Vladislav Bataron on 2014-10-07
Status: Needs review
Proposed branch: lp:~baratosha23/stellarium/stellarium
Merge into: lp:stellarium
Diff against target: 560 lines (+260/-10)
20 files modified
data/default_config.ini.cmake (+1/-0)
plugins/Oculars/src/gui/OcularDialog.cpp (+33/-0)
plugins/Oculars/src/gui/OcularDialog.hpp (+7/-0)
plugins/Satellites/src/gui/SatellitesDialog.cpp (+20/-0)
plugins/Satellites/src/gui/SatellitesDialog.hpp (+4/-0)
plugins/Satellites/src/gui/SatellitesImportDialog.cpp (+19/-0)
plugins/Satellites/src/gui/SatellitesImportDialog.hpp (+7/-0)
plugins/SolarSystemEditor/src/gui/MpcImportWindow.cpp (+22/-0)
plugins/SolarSystemEditor/src/gui/MpcImportWindow.hpp (+4/-0)
src/StelMainView.cpp (+3/-0)
src/core/StelCore.cpp (+2/-7)
src/gui/ConfigurationDialog.cpp (+21/-0)
src/gui/ConfigurationDialog.hpp (+4/-0)
src/gui/LocationDialog.cpp (+24/-0)
src/gui/LocationDialog.hpp (+4/-0)
src/gui/SearchDialog.cpp (+20/-3)
src/gui/ShortcutsDialog.cpp (+21/-0)
src/gui/ShortcutsDialog.hpp (+4/-0)
src/gui/StelDialog.cpp (+35/-0)
src/gui/StelDialog.hpp (+5/-0)
To merge this branch: bzr merge lp:~baratosha23/stellarium/stellarium
Reviewer Review Type Date Requested Status
Fabien Chéreau 2014-10-07 Needs Fixing on 2014-10-27
Alexander Wolf 2014-10-07 Needs Fixing on 2014-10-07
Review via email: mp+237364@code.launchpad.net

Description of the change

Show touch Keyboard for windows tablet pc. Fixed a bug when running widget LocationDialog before obtaining the coordinates of the location from ip.

To post a comment you must log in.
6997. By Vladislav Bataron on 2014-10-07

disable of kinetic scrolling

Alexander Wolf (alexwolf) wrote :

This code will give crash of Stellarium on Windows without virtual keyboard and/or with non-standard installation.

review: Needs Fixing
Vladislav Bataron (baratosha23) wrote :

Virtual keyboard is included in all versions of windows 8.
I added a check of system version.

6998. By Vladislav Bataron on 2014-10-07

Showing the touch keyboard on the device only with windows 8

Alexander Wolf (alexwolf) wrote :

Please see diff comments.

Fabien Chéreau (xalioth) wrote :

Isn't there a better method for doing this? I would be surprised that Qt doesn't provides a clean way for that. Virtual keyboard work natively on mobile plateforms.

Also, something like this is very dangerous:
ShellExecuteA(NULL, "open", "\"C:\\Program Files\\Common Files\\microsoft shared\\ink\\TabTip.exe\"", "", 0, SW_NORMAL);

review: Needs Fixing
Vladislav Bataron (baratosha23) wrote :

> Isn't there a better method for doing this? I would be surprised that Qt
> doesn't provides a clean way for that. Virtual keyboard work natively on
> mobile plateforms.
>
>
> Also, something like this is very dangerous:
> ShellExecuteA(NULL, "open", "\"C:\\Program Files\\Common Files\\microsoft
> shared\\ink\\TabTip.exe\"", "", 0, SW_NORMAL);

Unfortunately qt and the Win32 API does not have the normal method call the touch screen keyboard.
Please see BWK_readme.txt in sample - https://software.intel.com/en-us/blogs/2013/06/11/touch-keyboard-access-for-windows-8-desktop-apps

I can try to use qml to create on-screen keyboard.
http://qt-project.org/forums/viewthread/5516
http://doc.qt.digia.com/QtVirtualKeyboard/qtvirtualkeyboard-enterprise-virtualkeyboard-virtualkeyboard-virtualkeyboard-qml.html
Do this?

Vladislav Bataron (baratosha23) wrote :

Qt Virtual Keyboard is included only in Commercial Licensing qt.
http://www.qt.io/download/

How to make the virtual keyboard!?

Unmerged revisions

6998. By Vladislav Bataron on 2014-10-07

Showing the touch keyboard on the device only with windows 8

6997. By Vladislav Bataron on 2014-10-07

disable of kinetic scrolling

6996. By Vladislav Bataron on 2014-10-07

move variable listShowTouchKeyboard global variables

6995. By Vladislav Bataron on 2014-10-07

Merge branch

6994. By Vladislav Bataron on 2014-10-01

Fixed a bug when running widget LocationDialog before obtaining the coordinates of the location from ip.

6993. By Vladislav Bataron on 2014-09-27

Disable setFocus when using the touch screen keyboard

6992. By Vladislav Bataron on 2014-09-27

Merge branch

6991. By Vladislav Bataron on 2014-09-24

Show touch Keyboard for tablet pc

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'data/default_config.ini.cmake'
2--- data/default_config.ini.cmake 2014-09-10 13:15:56 +0000
3+++ data/default_config.ini.cmake 2014-10-07 08:24:37 +0000
4@@ -116,6 +116,7 @@
5 auto_hide_horizontal_toolbar = true
6 auto_hide_vertical_toolbar = true
7 flag_enable_kinetic_scrolling = true
8+flag_enable_touch_keyboard = false
9
10 [color]
11 default_color = 0.5,0.5,0.7
12
13=== modified file 'plugins/Oculars/src/gui/OcularDialog.cpp'
14--- plugins/Oculars/src/gui/OcularDialog.cpp 2014-09-08 14:57:05 +0000
15+++ plugins/Oculars/src/gui/OcularDialog.cpp 2014-10-07 08:24:37 +0000
16@@ -346,6 +346,15 @@
17 QList<QWidget *> addscroll;
18 addscroll << ui->textBrowser << ui->telescopeListView << ui->ccdListView << ui->ocularListView << ui->lensListView;
19 installKineticScrolling(addscroll);
20+
21+#ifdef Q_OS_WIN
22+ // Install the Event Filter to show the touch keyboard
23+ listShowTouchKeyboard << ui->togglePluginLineEdit << ui->togglePopupNavigatorWindowLineEdit << ui->ocularName << ui->ocularAFov << ui->ocularFL << ui->ocularFieldStop << ui->lensName << ui->lensMultipler
24+ << ui->ccdName << ui->ccdResX << ui->ccdResY << ui->ccdChipX << ui->ccdChipY << ui->ccdPixelX << ui->ccdPixelY << ui->telescopeName << ui->telescopeFL << ui->telescopeDiameter;
25+
26+ foreach(QWidget * w, listShowTouchKeyboard)
27+ w->installEventFilter(this);
28+#endif
29
30 //Now the rest of the actions.
31 connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close()));
32@@ -547,3 +556,27 @@
33
34 ui->textBrowser->setHtml(html);
35 }
36+
37+#ifdef Q_OS_WIN
38+bool OcularDialog::eventFilter(QObject *object, QEvent *event)
39+{
40+ foreach(QWidget * w, listShowTouchKeyboard)
41+ {
42+ if (object == w)
43+ {
44+ if (event->type() == QEvent::FocusIn)
45+ {
46+ showTouchKeyboard(true);
47+ return false;
48+ }
49+ if (event->type() == QEvent::FocusOut)
50+ {
51+ showTouchKeyboard(false);
52+ return false;
53+ }
54+
55+ }
56+ }
57+ return false;
58+}
59+#endif
60\ No newline at end of file
61
62=== modified file 'plugins/Oculars/src/gui/OcularDialog.hpp'
63--- plugins/Oculars/src/gui/OcularDialog.hpp 2014-01-17 12:19:02 +0000
64+++ plugins/Oculars/src/gui/OcularDialog.hpp 2014-10-07 08:24:37 +0000
65@@ -82,6 +82,10 @@
66 virtual void createDialogContent();
67 Ui_ocularDialogForm* ui;
68
69+#ifdef Q_OS_WIN
70+ virtual bool eventFilter(QObject *object, QEvent *event);
71+#endif
72+
73 private slots:
74 void keyBindingTogglePluginChanged(const QString& newString);
75 void keyBindingPopupNavigatorConfigChanged(const QString& newString);
76@@ -105,6 +109,9 @@
77 QList<Lens *>* lense;
78 PropertyBasedTableModel* lensTableModel;
79 QRegExpValidator* validatorName;
80+#ifdef Q_OS_WIN
81+ QList<QWidget *> listShowTouchKeyboard;
82+#endif
83 };
84
85 #endif // _OCULARDIALOG_HPP_
86
87=== modified file 'plugins/Satellites/src/gui/SatellitesDialog.cpp'
88--- plugins/Satellites/src/gui/SatellitesDialog.cpp 2014-09-08 14:57:05 +0000
89+++ plugins/Satellites/src/gui/SatellitesDialog.cpp 2014-10-07 08:24:37 +0000
90@@ -98,6 +98,12 @@
91 addscroll << ui->satellitesList << ui->sourceList << ui->aboutTextBrowser;
92 installKineticScrolling(addscroll);
93
94+#ifdef Q_OS_WIN
95+ // Install the Event Filter to show the touch keyboard
96+ ui->lineEditSearch->installEventFilter(this);
97+ ui->sourceEdit->installEventFilter(this);
98+#endif
99+
100 // Settings tab / updates group
101 // These controls are refreshed by updateSettingsPage(), which in
102 // turn is triggered by setting any of these values. Because
103@@ -915,3 +921,17 @@
104 ui->orbitCheckbox->blockSignals(!enabled);
105 ui->userCheckBox->blockSignals(!enabled);
106 }
107+
108+#ifdef Q_OS_WIN
109+bool SatellitesDialog::eventFilter(QObject *object, QEvent *event)
110+{
111+ if (object == ui->lineEditSearch || object == ui->sourceEdit)
112+ {
113+ if (event->type() == QEvent::FocusIn)
114+ showTouchKeyboard(true);
115+ if (event->type() == QEvent::FocusOut)
116+ showTouchKeyboard(false);
117+ }
118+ return false;
119+}
120+#endif
121\ No newline at end of file
122
123=== modified file 'plugins/Satellites/src/gui/SatellitesDialog.hpp'
124--- plugins/Satellites/src/gui/SatellitesDialog.hpp 2013-04-07 19:26:57 +0000
125+++ plugins/Satellites/src/gui/SatellitesDialog.hpp 2014-10-07 08:24:37 +0000
126@@ -50,6 +50,10 @@
127 //! Initialize the dialog widgets and connect the signals/slots
128 void createDialogContent();
129
130+#ifdef Q_OS_WIN
131+ virtual bool eventFilter(QObject *object, QEvent *event);
132+#endif
133+
134 public slots:
135 void retranslate();
136
137
138=== modified file 'plugins/Satellites/src/gui/SatellitesImportDialog.cpp'
139--- plugins/Satellites/src/gui/SatellitesImportDialog.cpp 2014-09-08 14:57:05 +0000
140+++ plugins/Satellites/src/gui/SatellitesImportDialog.cpp 2014-10-07 08:24:37 +0000
141@@ -90,6 +90,11 @@
142 addscroll << ui->listView;
143 installKineticScrolling(addscroll);
144
145+#ifdef Q_OS_WIN
146+ // Install the Event Filter to show the touch keyboard
147+ ui->lineEditSearch->installEventFilter(this);
148+#endif
149+
150 connect(ui->closeStelWindow, SIGNAL(clicked()),
151 this, SLOT(close()));
152
153@@ -404,3 +409,17 @@
154 }
155 }
156 }
157+
158+#ifdef Q_OS_WIN
159+bool SatellitesImportDialog::eventFilter(QObject *object, QEvent *event)
160+{
161+ if (object == ui->lineEditSearch)
162+ {
163+ if (event->type() == QEvent::FocusIn)
164+ showTouchKeyboard(true);
165+ if (event->type() == QEvent::FocusOut)
166+ showTouchKeyboard(false);
167+ }
168+ return false;
169+}
170+#endif
171\ No newline at end of file
172
173=== modified file 'plugins/Satellites/src/gui/SatellitesImportDialog.hpp'
174--- plugins/Satellites/src/gui/SatellitesImportDialog.hpp 2013-09-09 23:21:42 +0000
175+++ plugins/Satellites/src/gui/SatellitesImportDialog.hpp 2014-10-07 08:24:37 +0000
176@@ -78,6 +78,13 @@
177
178 QStandardItemModel* newSatellitesModel;
179 QSortFilterProxyModel * filterProxyModel;
180+
181+protected:
182+
183+#ifdef Q_OS_WIN
184+ virtual bool eventFilter(QObject *object, QEvent *event);
185+#endif
186+
187 };
188
189 #endif // IMPORTSATELLITESWINDOW_HPP
190
191=== modified file 'plugins/SolarSystemEditor/src/gui/MpcImportWindow.cpp'
192--- plugins/SolarSystemEditor/src/gui/MpcImportWindow.cpp 2014-07-04 07:59:24 +0000
193+++ plugins/SolarSystemEditor/src/gui/MpcImportWindow.cpp 2014-10-07 08:24:37 +0000
194@@ -92,6 +92,14 @@
195 {
196 ui->setupUi(dialog);
197
198+#ifdef Q_OS_WIN
199+ // Install the Event Filter to show the touch keyboard
200+ ui->lineEditURL->installEventFilter(this);
201+ ui->lineEditBookmarkTitle->installEventFilter(this);
202+ ui->lineEditFilePath->installEventFilter(this);
203+ ui->lineEditQuery->installEventFilter(this);
204+#endif
205+
206 //Signals
207 connect(&StelApp::getInstance(), SIGNAL(languageChanged()), this, SLOT(retranslate()));
208 connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close()));
209@@ -1055,3 +1063,17 @@
210 output.insert(title, bookmarkGroup.value(title));
211 }
212 }
213+
214+#ifdef Q_OS_WIN
215+bool MpcImportWindow::eventFilter(QObject *object, QEvent *event)
216+{
217+ if (object == ui->lineEditURL || object == ui->lineEditBookmarkTitle || object == ui->lineEditFilePath || object == ui->lineEditQuery)
218+ {
219+ if (event->type() == QEvent::FocusIn)
220+ showTouchKeyboard(true);
221+ if (event->type() == QEvent::FocusOut)
222+ showTouchKeyboard(false);
223+ }
224+ return false;
225+}
226+#endif
227\ No newline at end of file
228
229=== modified file 'plugins/SolarSystemEditor/src/gui/MpcImportWindow.hpp'
230--- plugins/SolarSystemEditor/src/gui/MpcImportWindow.hpp 2013-09-09 23:21:42 +0000
231+++ plugins/SolarSystemEditor/src/gui/MpcImportWindow.hpp 2014-10-07 08:24:37 +0000
232@@ -138,6 +138,10 @@
233 protected:
234 virtual void createDialogContent();
235 Ui_mpcImportWindow * ui;
236+
237+#ifdef Q_OS_WIN
238+ virtual bool eventFilter(QObject *object, QEvent *event);
239+#endif
240 };
241
242 #endif //_MPC_IMPORT_WINDOW_
243
244=== modified file 'src/StelMainView.cpp'
245--- src/StelMainView.cpp 2014-09-17 11:16:35 +0000
246+++ src/StelMainView.cpp 2014-10-07 08:24:37 +0000
247@@ -172,6 +172,9 @@
248 if (touchPoints.count() == 1)
249 setAcceptedMouseButtons(Qt::LeftButton | Qt::RightButton | Qt::MiddleButton);
250
251+ if (StelApp::getInstance().getSettings()->value("gui/flag_enable_touch_keyboard", false).toBool() == false)
252+ StelApp::getInstance().getSettings()->setValue("gui/flag_enable_touch_keyboard", true);
253+
254 return true;
255 }
256 break;
257
258=== modified file 'src/core/StelCore.cpp'
259--- src/core/StelCore.cpp 2014-10-05 11:17:24 +0000
260+++ src/core/StelCore.cpp 2014-10-07 08:24:37 +0000
261@@ -114,15 +114,10 @@
262 defaultLocationID = conf->value("init_location/location", "auto").toString();
263 bool ok;
264 StelLocationMgr* locationMgr = &StelApp::getInstance().getLocationMgr();
265- StelLocation location;
266+ StelLocation location = locationMgr->locationForString(defaultLocationID);
267+
268 if (defaultLocationID == "auto")
269- {
270 locationMgr->locationFromIP();
271- }
272- else
273- {
274- location = locationMgr->locationForString(defaultLocationID);
275- }
276
277 if (!location.isValid())
278 {
279
280=== modified file 'src/gui/ConfigurationDialog.cpp'
281--- src/gui/ConfigurationDialog.cpp 2014-09-26 14:33:13 +0000
282+++ src/gui/ConfigurationDialog.cpp 2014-10-07 08:24:37 +0000
283@@ -162,6 +162,13 @@
284 addscroll << ui->pluginsListWidget << ui->scriptListWidget;
285 installKineticScrolling(addscroll);
286
287+#ifdef Q_OS_WIN
288+ // Install the Event Filter to show the touch keyboard
289+ ui->screenshotDirEdit->installEventFilter(this);
290+ ui->todayTimeSpinBox->installEventFilter(this);
291+ ui->mouseTimeoutSpinBox->installEventFilter(this);
292+#endif
293+
294 // Selected object info
295 if (gui->getInfoTextFilters() == StelObject::InfoStringGroup(0))
296 {
297@@ -1232,3 +1239,17 @@
298
299 customDeltaTEquationDialog->setVisible(true);
300 }
301+
302+#ifdef Q_OS_WIN
303+bool ConfigurationDialog::eventFilter(QObject *object, QEvent *event)
304+{
305+ if (object == ui->screenshotDirEdit || object == ui->todayTimeSpinBox || object == ui->mouseTimeoutSpinBox)
306+ {
307+ if (event->type() == QEvent::FocusIn)
308+ showTouchKeyboard(true);
309+ if (event->type() == QEvent::FocusOut)
310+ showTouchKeyboard(false);
311+ }
312+ return false;
313+}
314+#endif
315\ No newline at end of file
316
317=== modified file 'src/gui/ConfigurationDialog.hpp'
318--- src/gui/ConfigurationDialog.hpp 2014-01-23 12:57:00 +0000
319+++ src/gui/ConfigurationDialog.hpp 2014-10-07 08:24:37 +0000
320@@ -50,6 +50,10 @@
321 virtual void createDialogContent();
322 Ui_configurationDialogForm* ui;
323
324+#ifdef Q_OS_WIN
325+ virtual bool eventFilter(QObject *object, QEvent *event);
326+#endif
327+
328 private:
329 //! Contains the parsed content of the starsConfig.json file
330 QVariantMap nextStarCatalogToDownload;
331
332=== modified file 'src/gui/LocationDialog.cpp'
333--- src/gui/LocationDialog.cpp 2014-10-05 09:30:57 +0000
334+++ src/gui/LocationDialog.cpp 2014-10-07 08:24:37 +0000
335@@ -92,6 +92,15 @@
336 addscroll << ui->citiesListView;
337 installKineticScrolling(addscroll);
338
339+#ifdef Q_OS_WIN
340+ // Install the Event Filter to show the touch keyboard
341+ ui->citySearchLineEdit->installEventFilter(this);
342+ ui->cityNameLineEdit->installEventFilter(this);
343+ ui->latitudeSpinBox->installEventFilter(this);
344+ ui->longitudeSpinBox->installEventFilter(this);
345+ ui->altitudeSpinBox->installEventFilter(this);
346+#endif
347+
348 populatePlanetList();
349 populateCountryList();
350
351@@ -129,6 +138,7 @@
352
353 connect(core, SIGNAL(locationChanged(StelLocation)), this, SLOT(updateFromProgram(StelLocation)));
354
355+ if (StelApp::getInstance().getSettings()->value("gui/flag_enable_touch_keyboard", false).toBool() == false)
356 ui->citySearchLineEdit->setFocus();
357 }
358
359@@ -573,3 +583,17 @@
360 connect(ui->citySearchLineEdit, SIGNAL(textChanged(const QString&)), proxyModel, SLOT(setFilterWildcard(const QString&)));
361 ui->citySearchLineEdit->setFocus();
362 }
363+
364+#ifdef Q_OS_WIN
365+bool LocationDialog::eventFilter(QObject *object, QEvent *event)
366+{
367+ if (object == ui->citySearchLineEdit || object == ui->cityNameLineEdit || object == ui->latitudeSpinBox || object == ui->longitudeSpinBox || object == ui->altitudeSpinBox)
368+ {
369+ if (event->type() == QEvent::FocusIn)
370+ showTouchKeyboard(true);
371+ if (event->type() == QEvent::FocusOut)
372+ showTouchKeyboard(false);
373+ }
374+ return false;
375+}
376+#endif
377\ No newline at end of file
378
379=== modified file 'src/gui/LocationDialog.hpp'
380--- src/gui/LocationDialog.hpp 2014-09-08 12:47:22 +0000
381+++ src/gui/LocationDialog.hpp 2014-10-07 08:24:37 +0000
382@@ -43,6 +43,10 @@
383 //! Initialize the dialog widgets and connect the signals/slots
384 virtual void createDialogContent();
385 Ui_locationDialogForm* ui;
386+
387+#ifdef Q_OS_WIN
388+ virtual bool eventFilter(QObject *object, QEvent *event);
389+#endif
390
391 private:
392 //! Set the values of all the fields from a location info
393
394=== modified file 'src/gui/SearchDialog.cpp'
395--- src/gui/SearchDialog.cpp 2014-09-16 19:30:26 +0000
396+++ src/gui/SearchDialog.cpp 2014-10-07 08:24:37 +0000
397@@ -299,7 +299,13 @@
398 connect(ui->lineEditSearchSkyObject, SIGNAL(selectionChanged()), this, SLOT(setHasSelectedFlag()));
399 connect(ui->lineEditSearchSkyObject, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(showContextMenu(QPoint)));
400
401- ui->lineEditSearchSkyObject->installEventFilter(this);
402+ ui->lineEditSearchSkyObject->installEventFilter(this);
403+#ifdef Q_OS_WIN
404+ // Install the Event Filter to show the touch keyboard
405+ ui->searchInListLineEdit->installEventFilter(this);
406+ ui->AxisYSpinBox->installEventFilter(this);
407+ ui->AxisXSpinBox->installEventFilter(this);
408+#endif
409
410 //Kinetic scrolling for tablet pc and pc
411 QList<QWidget *> addscroll;
412@@ -367,7 +373,7 @@
413 updateListTab();
414
415 // Set the focus directly on the line edit
416- if (ui->lineEditSearchSkyObject->isEnabled())
417+ if (ui->lineEditSearchSkyObject->isEnabled() && StelApp::getInstance().getSettings()->value("gui/flag_enable_touch_keyboard", false).toBool() == false)
418 ui->lineEditSearchSkyObject->setFocus();
419 }
420
421@@ -615,8 +621,19 @@
422 }
423 }
424
425-bool SearchDialog::eventFilter(QObject*, QEvent *event)
426+bool SearchDialog::eventFilter(QObject *object, QEvent *event)
427 {
428+#ifdef Q_OS_WIN
429+ if (object == ui->lineEditSearchSkyObject || object == ui->searchInListLineEdit || object == ui->AxisXSpinBox || object == ui->AxisYSpinBox)
430+ {
431+ if (event->type() == QEvent::FocusIn)
432+ showTouchKeyboard(true);
433+ if (event->type() == QEvent::FocusOut)
434+ showTouchKeyboard(false);
435+ return false;
436+ }
437+#endif
438+
439 if (event->type() == QEvent::KeyRelease)
440 {
441 QKeyEvent *keyEvent = static_cast<QKeyEvent *>(event);
442
443=== modified file 'src/gui/ShortcutsDialog.cpp'
444--- src/gui/ShortcutsDialog.cpp 2014-09-08 12:47:22 +0000
445+++ src/gui/ShortcutsDialog.cpp 2014-10-07 08:24:37 +0000
446@@ -296,6 +296,13 @@
447 addscroll << ui->shortcutsTreeView;
448 installKineticScrolling(addscroll);
449
450+#ifdef Q_OS_WIN
451+ // Install the Event Filter to show the touch keyboard
452+ ui->primaryShortcutEdit->installEventFilter(this);
453+ ui->lineEditSearch->installEventFilter(this);
454+ ui->altShortcutEdit->installEventFilter(this);
455+#endif
456+
457 connect(&StelApp::getInstance(), SIGNAL(languageChanged()), this, SLOT(retranslate()));
458 connect(ui->shortcutsTreeView->selectionModel(),
459 SIGNAL(currentChanged(QModelIndex,QModelIndex)),
460@@ -496,3 +503,17 @@
461 << q_("Alternative shortcut");
462 mainModel->setHorizontalHeaderLabels(headerLabels);
463 }
464+
465+#ifdef Q_OS_WIN
466+bool ShortcutsDialog::eventFilter(QObject *object, QEvent *event)
467+{
468+ if (object == ui->primaryShortcutEdit || object == ui->lineEditSearch || object == ui->altShortcutEdit)
469+ {
470+ if (event->type() == QEvent::FocusIn)
471+ showTouchKeyboard(true);
472+ if (event->type() == QEvent::FocusOut)
473+ showTouchKeyboard(false);
474+ }
475+ return false;
476+}
477+#endif
478\ No newline at end of file
479
480=== modified file 'src/gui/ShortcutsDialog.hpp'
481--- src/gui/ShortcutsDialog.hpp 2014-09-08 12:47:22 +0000
482+++ src/gui/ShortcutsDialog.hpp 2014-10-07 08:24:37 +0000
483@@ -89,6 +89,10 @@
484 //! Initialize the dialog widgets and connect the signals/slots.
485 virtual void createDialogContent();
486
487+#ifdef Q_OS_WIN
488+ virtual bool eventFilter(QObject *object, QEvent *event);
489+#endif
490+
491 private:
492 //! checks whether given item can be changed by editors.
493 static bool itemIsEditable(QStandardItem *item);
494
495=== modified file 'src/gui/StelDialog.cpp'
496--- src/gui/StelDialog.cpp 2014-09-14 16:45:46 +0000
497+++ src/gui/StelDialog.cpp 2014-10-07 08:24:37 +0000
498@@ -30,6 +30,12 @@
499 #include <QSettings>
500 #include <QScroller>
501
502+#ifdef Q_OS_WIN
503+#include <windows.h>
504+#include <objbase.h>
505+#include <Tchar.h>
506+#endif
507+
508 class CustomProxy : public QGraphicsProxyWidget
509 {
510 public:
511@@ -170,3 +176,32 @@
512 QScroller::scroller(w);
513 }
514 }
515+
516+#ifdef Q_OS_WIN
517+void StelDialog::showTouchKeyboard(bool show)
518+{
519+ if (StelApp::getInstance().getSettings()->value("gui/flag_enable_touch_keyboard", false).toBool() == false)
520+ return;
521+
522+ switch (QSysInfo::WindowsVersion){
523+ case QSysInfo::WV_6_3:
524+ case QSysInfo::WV_6_2:
525+ {
526+ if (show)
527+ {
528+ ShellExecuteA(NULL, "open", "\"C:\\Program Files\\Common Files\\microsoft shared\\ink\\TabTip.exe\"", "", 0, SW_NORMAL);
529+ }
530+ else
531+ {
532+ HWND wKB = ::FindWindow(_TEXT("IPTip_Main_Window"), NULL);
533+ if (wKB != NULL && ::IsWindowVisible(wKB))
534+ {
535+ ::PostMessage(wKB, WM_SYSCOMMAND, SC_CLOSE, 0);
536+ }
537+ }
538+ break;
539+ }
540+ default: return;
541+ }
542+}
543+#endif
544\ No newline at end of file
545
546=== modified file 'src/gui/StelDialog.hpp'
547--- src/gui/StelDialog.hpp 2014-09-08 12:47:22 +0000
548+++ src/gui/StelDialog.hpp 2014-10-07 08:24:37 +0000
549@@ -81,6 +81,11 @@
550
551 //! Kinetic scrolling for lists.
552 void installKineticScrolling(QList<QWidget *> addscroll);
553+
554+#ifdef Q_OS_WIN
555+ //! Show touch Keyboard for tablet pc
556+ void showTouchKeyboard(bool show);
557+#endif
558 };
559
560 #endif // _STELDIALOG_HPP_