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

Proposed by Vladislav Bataron
Status: Rejected
Rejected by: Alexander Wolf
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 Needs Fixing
Alexander Wolf Needs Fixing
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

disable of kinetic scrolling

Revision history for this message
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
Revision history for this message
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

Showing the touch keyboard on the device only with windows 8

Revision history for this message
Alexander Wolf (alexwolf) wrote :

Please see diff comments.

Revision history for this message
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
Revision history for this message
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?

Revision history for this message
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

Showing the touch keyboard on the device only with windows 8

6997. By Vladislav Bataron

disable of kinetic scrolling

6996. By Vladislav Bataron

move variable listShowTouchKeyboard global variables

6995. By Vladislav Bataron

Merge branch

6994. By Vladislav Bataron

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

6993. By Vladislav Bataron

Disable setFocus when using the touch screen keyboard

6992. By Vladislav Bataron

Merge branch

6991. By Vladislav Bataron

Show touch Keyboard for tablet pc

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'data/default_config.ini.cmake'
--- data/default_config.ini.cmake 2014-09-10 13:15:56 +0000
+++ data/default_config.ini.cmake 2014-10-07 08:24:37 +0000
@@ -116,6 +116,7 @@
116auto_hide_horizontal_toolbar = true116auto_hide_horizontal_toolbar = true
117auto_hide_vertical_toolbar = true117auto_hide_vertical_toolbar = true
118flag_enable_kinetic_scrolling = true118flag_enable_kinetic_scrolling = true
119flag_enable_touch_keyboard = false
119120
120[color]121[color]
121default_color = 0.5,0.5,0.7122default_color = 0.5,0.5,0.7
122123
=== modified file 'plugins/Oculars/src/gui/OcularDialog.cpp'
--- plugins/Oculars/src/gui/OcularDialog.cpp 2014-09-08 14:57:05 +0000
+++ plugins/Oculars/src/gui/OcularDialog.cpp 2014-10-07 08:24:37 +0000
@@ -346,6 +346,15 @@
346 QList<QWidget *> addscroll;346 QList<QWidget *> addscroll;
347 addscroll << ui->textBrowser << ui->telescopeListView << ui->ccdListView << ui->ocularListView << ui->lensListView;347 addscroll << ui->textBrowser << ui->telescopeListView << ui->ccdListView << ui->ocularListView << ui->lensListView;
348 installKineticScrolling(addscroll);348 installKineticScrolling(addscroll);
349
350#ifdef Q_OS_WIN
351 // Install the Event Filter to show the touch keyboard
352 listShowTouchKeyboard << ui->togglePluginLineEdit << ui->togglePopupNavigatorWindowLineEdit << ui->ocularName << ui->ocularAFov << ui->ocularFL << ui->ocularFieldStop << ui->lensName << ui->lensMultipler
353 << ui->ccdName << ui->ccdResX << ui->ccdResY << ui->ccdChipX << ui->ccdChipY << ui->ccdPixelX << ui->ccdPixelY << ui->telescopeName << ui->telescopeFL << ui->telescopeDiameter;
354
355 foreach(QWidget * w, listShowTouchKeyboard)
356 w->installEventFilter(this);
357#endif
349 358
350 //Now the rest of the actions.359 //Now the rest of the actions.
351 connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close()));360 connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close()));
@@ -547,3 +556,27 @@
547556
548 ui->textBrowser->setHtml(html);557 ui->textBrowser->setHtml(html);
549}558}
559
560#ifdef Q_OS_WIN
561bool OcularDialog::eventFilter(QObject *object, QEvent *event)
562{
563 foreach(QWidget * w, listShowTouchKeyboard)
564 {
565 if (object == w)
566 {
567 if (event->type() == QEvent::FocusIn)
568 {
569 showTouchKeyboard(true);
570 return false;
571 }
572 if (event->type() == QEvent::FocusOut)
573 {
574 showTouchKeyboard(false);
575 return false;
576 }
577
578 }
579 }
580 return false;
581}
582#endif
550\ No newline at end of file583\ No newline at end of file
551584
=== modified file 'plugins/Oculars/src/gui/OcularDialog.hpp'
--- plugins/Oculars/src/gui/OcularDialog.hpp 2014-01-17 12:19:02 +0000
+++ plugins/Oculars/src/gui/OcularDialog.hpp 2014-10-07 08:24:37 +0000
@@ -82,6 +82,10 @@
82 virtual void createDialogContent();82 virtual void createDialogContent();
83 Ui_ocularDialogForm* ui;83 Ui_ocularDialogForm* ui;
8484
85#ifdef Q_OS_WIN
86 virtual bool eventFilter(QObject *object, QEvent *event);
87#endif
88
85private slots:89private slots:
86 void keyBindingTogglePluginChanged(const QString& newString);90 void keyBindingTogglePluginChanged(const QString& newString);
87 void keyBindingPopupNavigatorConfigChanged(const QString& newString);91 void keyBindingPopupNavigatorConfigChanged(const QString& newString);
@@ -105,6 +109,9 @@
105 QList<Lens *>* lense;109 QList<Lens *>* lense;
106 PropertyBasedTableModel* lensTableModel;110 PropertyBasedTableModel* lensTableModel;
107 QRegExpValidator* validatorName;111 QRegExpValidator* validatorName;
112#ifdef Q_OS_WIN
113 QList<QWidget *> listShowTouchKeyboard;
114#endif
108};115};
109116
110#endif // _OCULARDIALOG_HPP_117#endif // _OCULARDIALOG_HPP_
111118
=== modified file 'plugins/Satellites/src/gui/SatellitesDialog.cpp'
--- plugins/Satellites/src/gui/SatellitesDialog.cpp 2014-09-08 14:57:05 +0000
+++ plugins/Satellites/src/gui/SatellitesDialog.cpp 2014-10-07 08:24:37 +0000
@@ -98,6 +98,12 @@
98 addscroll << ui->satellitesList << ui->sourceList << ui->aboutTextBrowser;98 addscroll << ui->satellitesList << ui->sourceList << ui->aboutTextBrowser;
99 installKineticScrolling(addscroll);99 installKineticScrolling(addscroll);
100100
101#ifdef Q_OS_WIN
102 // Install the Event Filter to show the touch keyboard
103 ui->lineEditSearch->installEventFilter(this);
104 ui->sourceEdit->installEventFilter(this);
105#endif
106
101 // Settings tab / updates group107 // Settings tab / updates group
102 // These controls are refreshed by updateSettingsPage(), which in108 // These controls are refreshed by updateSettingsPage(), which in
103 // turn is triggered by setting any of these values. Because 109 // turn is triggered by setting any of these values. Because
@@ -915,3 +921,17 @@
915 ui->orbitCheckbox->blockSignals(!enabled);921 ui->orbitCheckbox->blockSignals(!enabled);
916 ui->userCheckBox->blockSignals(!enabled);922 ui->userCheckBox->blockSignals(!enabled);
917}923}
924
925#ifdef Q_OS_WIN
926bool SatellitesDialog::eventFilter(QObject *object, QEvent *event)
927{
928 if (object == ui->lineEditSearch || object == ui->sourceEdit)
929 {
930 if (event->type() == QEvent::FocusIn)
931 showTouchKeyboard(true);
932 if (event->type() == QEvent::FocusOut)
933 showTouchKeyboard(false);
934 }
935 return false;
936}
937#endif
918\ No newline at end of file938\ No newline at end of file
919939
=== modified file 'plugins/Satellites/src/gui/SatellitesDialog.hpp'
--- plugins/Satellites/src/gui/SatellitesDialog.hpp 2013-04-07 19:26:57 +0000
+++ plugins/Satellites/src/gui/SatellitesDialog.hpp 2014-10-07 08:24:37 +0000
@@ -50,6 +50,10 @@
50 //! Initialize the dialog widgets and connect the signals/slots50 //! Initialize the dialog widgets and connect the signals/slots
51 void createDialogContent();51 void createDialogContent();
5252
53#ifdef Q_OS_WIN
54 virtual bool eventFilter(QObject *object, QEvent *event);
55#endif
56
53public slots:57public slots:
54 void retranslate();58 void retranslate();
5559
5660
=== modified file 'plugins/Satellites/src/gui/SatellitesImportDialog.cpp'
--- plugins/Satellites/src/gui/SatellitesImportDialog.cpp 2014-09-08 14:57:05 +0000
+++ plugins/Satellites/src/gui/SatellitesImportDialog.cpp 2014-10-07 08:24:37 +0000
@@ -90,6 +90,11 @@
90 addscroll << ui->listView;90 addscroll << ui->listView;
91 installKineticScrolling(addscroll);91 installKineticScrolling(addscroll);
92 92
93#ifdef Q_OS_WIN
94 // Install the Event Filter to show the touch keyboard
95 ui->lineEditSearch->installEventFilter(this);
96#endif
97
93 connect(ui->closeStelWindow, SIGNAL(clicked()),98 connect(ui->closeStelWindow, SIGNAL(clicked()),
94 this, SLOT(close()));99 this, SLOT(close()));
95100
@@ -404,3 +409,17 @@
404 }409 }
405 }410 }
406}411}
412
413#ifdef Q_OS_WIN
414bool SatellitesImportDialog::eventFilter(QObject *object, QEvent *event)
415{
416 if (object == ui->lineEditSearch)
417 {
418 if (event->type() == QEvent::FocusIn)
419 showTouchKeyboard(true);
420 if (event->type() == QEvent::FocusOut)
421 showTouchKeyboard(false);
422 }
423 return false;
424}
425#endif
407\ No newline at end of file426\ No newline at end of file
408427
=== modified file 'plugins/Satellites/src/gui/SatellitesImportDialog.hpp'
--- plugins/Satellites/src/gui/SatellitesImportDialog.hpp 2013-09-09 23:21:42 +0000
+++ plugins/Satellites/src/gui/SatellitesImportDialog.hpp 2014-10-07 08:24:37 +0000
@@ -78,6 +78,13 @@
78 78
79 QStandardItemModel* newSatellitesModel;79 QStandardItemModel* newSatellitesModel;
80 QSortFilterProxyModel * filterProxyModel;80 QSortFilterProxyModel * filterProxyModel;
81
82protected:
83
84#ifdef Q_OS_WIN
85 virtual bool eventFilter(QObject *object, QEvent *event);
86#endif
87
81};88};
8289
83#endif // IMPORTSATELLITESWINDOW_HPP90#endif // IMPORTSATELLITESWINDOW_HPP
8491
=== modified file 'plugins/SolarSystemEditor/src/gui/MpcImportWindow.cpp'
--- plugins/SolarSystemEditor/src/gui/MpcImportWindow.cpp 2014-07-04 07:59:24 +0000
+++ plugins/SolarSystemEditor/src/gui/MpcImportWindow.cpp 2014-10-07 08:24:37 +0000
@@ -92,6 +92,14 @@
92{92{
93 ui->setupUi(dialog);93 ui->setupUi(dialog);
9494
95#ifdef Q_OS_WIN
96 // Install the Event Filter to show the touch keyboard
97 ui->lineEditURL->installEventFilter(this);
98 ui->lineEditBookmarkTitle->installEventFilter(this);
99 ui->lineEditFilePath->installEventFilter(this);
100 ui->lineEditQuery->installEventFilter(this);
101#endif
102
95 //Signals103 //Signals
96 connect(&StelApp::getInstance(), SIGNAL(languageChanged()), this, SLOT(retranslate()));104 connect(&StelApp::getInstance(), SIGNAL(languageChanged()), this, SLOT(retranslate()));
97 connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close()));105 connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close()));
@@ -1055,3 +1063,17 @@
1055 output.insert(title, bookmarkGroup.value(title));1063 output.insert(title, bookmarkGroup.value(title));
1056 }1064 }
1057}1065}
1066
1067#ifdef Q_OS_WIN
1068bool MpcImportWindow::eventFilter(QObject *object, QEvent *event)
1069{
1070 if (object == ui->lineEditURL || object == ui->lineEditBookmarkTitle || object == ui->lineEditFilePath || object == ui->lineEditQuery)
1071 {
1072 if (event->type() == QEvent::FocusIn)
1073 showTouchKeyboard(true);
1074 if (event->type() == QEvent::FocusOut)
1075 showTouchKeyboard(false);
1076 }
1077 return false;
1078}
1079#endif
1058\ No newline at end of file1080\ No newline at end of file
10591081
=== modified file 'plugins/SolarSystemEditor/src/gui/MpcImportWindow.hpp'
--- plugins/SolarSystemEditor/src/gui/MpcImportWindow.hpp 2013-09-09 23:21:42 +0000
+++ plugins/SolarSystemEditor/src/gui/MpcImportWindow.hpp 2014-10-07 08:24:37 +0000
@@ -138,6 +138,10 @@
138protected:138protected:
139 virtual void createDialogContent();139 virtual void createDialogContent();
140 Ui_mpcImportWindow * ui;140 Ui_mpcImportWindow * ui;
141
142#ifdef Q_OS_WIN
143 virtual bool eventFilter(QObject *object, QEvent *event);
144#endif
141};145};
142146
143#endif //_MPC_IMPORT_WINDOW_147#endif //_MPC_IMPORT_WINDOW_
144148
=== modified file 'src/StelMainView.cpp'
--- src/StelMainView.cpp 2014-09-17 11:16:35 +0000
+++ src/StelMainView.cpp 2014-10-07 08:24:37 +0000
@@ -172,6 +172,9 @@
172 if (touchPoints.count() == 1)172 if (touchPoints.count() == 1)
173 setAcceptedMouseButtons(Qt::LeftButton | Qt::RightButton | Qt::MiddleButton);173 setAcceptedMouseButtons(Qt::LeftButton | Qt::RightButton | Qt::MiddleButton);
174174
175 if (StelApp::getInstance().getSettings()->value("gui/flag_enable_touch_keyboard", false).toBool() == false)
176 StelApp::getInstance().getSettings()->setValue("gui/flag_enable_touch_keyboard", true);
177
175 return true;178 return true;
176 }179 }
177 break;180 break;
178181
=== modified file 'src/core/StelCore.cpp'
--- src/core/StelCore.cpp 2014-10-05 11:17:24 +0000
+++ src/core/StelCore.cpp 2014-10-07 08:24:37 +0000
@@ -114,15 +114,10 @@
114 defaultLocationID = conf->value("init_location/location", "auto").toString();114 defaultLocationID = conf->value("init_location/location", "auto").toString();
115 bool ok;115 bool ok;
116 StelLocationMgr* locationMgr = &StelApp::getInstance().getLocationMgr();116 StelLocationMgr* locationMgr = &StelApp::getInstance().getLocationMgr();
117 StelLocation location;117 StelLocation location = locationMgr->locationForString(defaultLocationID);
118
118 if (defaultLocationID == "auto")119 if (defaultLocationID == "auto")
119 {
120 locationMgr->locationFromIP();120 locationMgr->locationFromIP();
121 }
122 else
123 {
124 location = locationMgr->locationForString(defaultLocationID);
125 }
126121
127 if (!location.isValid())122 if (!location.isValid())
128 {123 {
129124
=== modified file 'src/gui/ConfigurationDialog.cpp'
--- src/gui/ConfigurationDialog.cpp 2014-09-26 14:33:13 +0000
+++ src/gui/ConfigurationDialog.cpp 2014-10-07 08:24:37 +0000
@@ -162,6 +162,13 @@
162 addscroll << ui->pluginsListWidget << ui->scriptListWidget;162 addscroll << ui->pluginsListWidget << ui->scriptListWidget;
163 installKineticScrolling(addscroll);163 installKineticScrolling(addscroll);
164164
165#ifdef Q_OS_WIN
166 // Install the Event Filter to show the touch keyboard
167 ui->screenshotDirEdit->installEventFilter(this);
168 ui->todayTimeSpinBox->installEventFilter(this);
169 ui->mouseTimeoutSpinBox->installEventFilter(this);
170#endif
171
165 // Selected object info172 // Selected object info
166 if (gui->getInfoTextFilters() == StelObject::InfoStringGroup(0))173 if (gui->getInfoTextFilters() == StelObject::InfoStringGroup(0))
167 {174 {
@@ -1232,3 +1239,17 @@
12321239
1233 customDeltaTEquationDialog->setVisible(true);1240 customDeltaTEquationDialog->setVisible(true);
1234}1241}
1242
1243#ifdef Q_OS_WIN
1244bool ConfigurationDialog::eventFilter(QObject *object, QEvent *event)
1245{
1246 if (object == ui->screenshotDirEdit || object == ui->todayTimeSpinBox || object == ui->mouseTimeoutSpinBox)
1247 {
1248 if (event->type() == QEvent::FocusIn)
1249 showTouchKeyboard(true);
1250 if (event->type() == QEvent::FocusOut)
1251 showTouchKeyboard(false);
1252 }
1253 return false;
1254}
1255#endif
1235\ No newline at end of file1256\ No newline at end of file
12361257
=== modified file 'src/gui/ConfigurationDialog.hpp'
--- src/gui/ConfigurationDialog.hpp 2014-01-23 12:57:00 +0000
+++ src/gui/ConfigurationDialog.hpp 2014-10-07 08:24:37 +0000
@@ -50,6 +50,10 @@
50 virtual void createDialogContent();50 virtual void createDialogContent();
51 Ui_configurationDialogForm* ui;51 Ui_configurationDialogForm* ui;
5252
53#ifdef Q_OS_WIN
54 virtual bool eventFilter(QObject *object, QEvent *event);
55#endif
56
53private:57private:
54 //! Contains the parsed content of the starsConfig.json file58 //! Contains the parsed content of the starsConfig.json file
55 QVariantMap nextStarCatalogToDownload;59 QVariantMap nextStarCatalogToDownload;
5660
=== modified file 'src/gui/LocationDialog.cpp'
--- src/gui/LocationDialog.cpp 2014-10-05 09:30:57 +0000
+++ src/gui/LocationDialog.cpp 2014-10-07 08:24:37 +0000
@@ -92,6 +92,15 @@
92 addscroll << ui->citiesListView;92 addscroll << ui->citiesListView;
93 installKineticScrolling(addscroll);93 installKineticScrolling(addscroll);
9494
95#ifdef Q_OS_WIN
96 // Install the Event Filter to show the touch keyboard
97 ui->citySearchLineEdit->installEventFilter(this);
98 ui->cityNameLineEdit->installEventFilter(this);
99 ui->latitudeSpinBox->installEventFilter(this);
100 ui->longitudeSpinBox->installEventFilter(this);
101 ui->altitudeSpinBox->installEventFilter(this);
102#endif
103
95 populatePlanetList();104 populatePlanetList();
96 populateCountryList();105 populateCountryList();
97106
@@ -129,6 +138,7 @@
129 138
130 connect(core, SIGNAL(locationChanged(StelLocation)), this, SLOT(updateFromProgram(StelLocation)));139 connect(core, SIGNAL(locationChanged(StelLocation)), this, SLOT(updateFromProgram(StelLocation)));
131140
141 if (StelApp::getInstance().getSettings()->value("gui/flag_enable_touch_keyboard", false).toBool() == false)
132 ui->citySearchLineEdit->setFocus();142 ui->citySearchLineEdit->setFocus();
133}143}
134144
@@ -573,3 +583,17 @@
573 connect(ui->citySearchLineEdit, SIGNAL(textChanged(const QString&)), proxyModel, SLOT(setFilterWildcard(const QString&)));583 connect(ui->citySearchLineEdit, SIGNAL(textChanged(const QString&)), proxyModel, SLOT(setFilterWildcard(const QString&)));
574 ui->citySearchLineEdit->setFocus();584 ui->citySearchLineEdit->setFocus();
575}585}
586
587#ifdef Q_OS_WIN
588bool LocationDialog::eventFilter(QObject *object, QEvent *event)
589{
590 if (object == ui->citySearchLineEdit || object == ui->cityNameLineEdit || object == ui->latitudeSpinBox || object == ui->longitudeSpinBox || object == ui->altitudeSpinBox)
591 {
592 if (event->type() == QEvent::FocusIn)
593 showTouchKeyboard(true);
594 if (event->type() == QEvent::FocusOut)
595 showTouchKeyboard(false);
596 }
597 return false;
598}
599#endif
576\ No newline at end of file600\ No newline at end of file
577601
=== modified file 'src/gui/LocationDialog.hpp'
--- src/gui/LocationDialog.hpp 2014-09-08 12:47:22 +0000
+++ src/gui/LocationDialog.hpp 2014-10-07 08:24:37 +0000
@@ -43,6 +43,10 @@
43 //! Initialize the dialog widgets and connect the signals/slots43 //! Initialize the dialog widgets and connect the signals/slots
44 virtual void createDialogContent();44 virtual void createDialogContent();
45 Ui_locationDialogForm* ui;45 Ui_locationDialogForm* ui;
46
47#ifdef Q_OS_WIN
48 virtual bool eventFilter(QObject *object, QEvent *event);
49#endif
46 50
47private:51private:
48 //! Set the values of all the fields from a location info52 //! Set the values of all the fields from a location info
4953
=== modified file 'src/gui/SearchDialog.cpp'
--- src/gui/SearchDialog.cpp 2014-09-16 19:30:26 +0000
+++ src/gui/SearchDialog.cpp 2014-10-07 08:24:37 +0000
@@ -299,7 +299,13 @@
299 connect(ui->lineEditSearchSkyObject, SIGNAL(selectionChanged()), this, SLOT(setHasSelectedFlag()));299 connect(ui->lineEditSearchSkyObject, SIGNAL(selectionChanged()), this, SLOT(setHasSelectedFlag()));
300 connect(ui->lineEditSearchSkyObject, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(showContextMenu(QPoint)));300 connect(ui->lineEditSearchSkyObject, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(showContextMenu(QPoint)));
301301
302 ui->lineEditSearchSkyObject->installEventFilter(this); 302 ui->lineEditSearchSkyObject->installEventFilter(this);
303#ifdef Q_OS_WIN
304 // Install the Event Filter to show the touch keyboard
305 ui->searchInListLineEdit->installEventFilter(this);
306 ui->AxisYSpinBox->installEventFilter(this);
307 ui->AxisXSpinBox->installEventFilter(this);
308#endif
303309
304 //Kinetic scrolling for tablet pc and pc310 //Kinetic scrolling for tablet pc and pc
305 QList<QWidget *> addscroll;311 QList<QWidget *> addscroll;
@@ -367,7 +373,7 @@
367 updateListTab();373 updateListTab();
368374
369 // Set the focus directly on the line edit375 // Set the focus directly on the line edit
370 if (ui->lineEditSearchSkyObject->isEnabled())376 if (ui->lineEditSearchSkyObject->isEnabled() && StelApp::getInstance().getSettings()->value("gui/flag_enable_touch_keyboard", false).toBool() == false)
371 ui->lineEditSearchSkyObject->setFocus();377 ui->lineEditSearchSkyObject->setFocus();
372}378}
373379
@@ -615,8 +621,19 @@
615 }621 }
616}622}
617623
618bool SearchDialog::eventFilter(QObject*, QEvent *event)624bool SearchDialog::eventFilter(QObject *object, QEvent *event)
619{625{
626#ifdef Q_OS_WIN
627 if (object == ui->lineEditSearchSkyObject || object == ui->searchInListLineEdit || object == ui->AxisXSpinBox || object == ui->AxisYSpinBox)
628 {
629 if (event->type() == QEvent::FocusIn)
630 showTouchKeyboard(true);
631 if (event->type() == QEvent::FocusOut)
632 showTouchKeyboard(false);
633 return false;
634 }
635#endif
636
620 if (event->type() == QEvent::KeyRelease)637 if (event->type() == QEvent::KeyRelease)
621 {638 {
622 QKeyEvent *keyEvent = static_cast<QKeyEvent *>(event);639 QKeyEvent *keyEvent = static_cast<QKeyEvent *>(event);
623640
=== modified file 'src/gui/ShortcutsDialog.cpp'
--- src/gui/ShortcutsDialog.cpp 2014-09-08 12:47:22 +0000
+++ src/gui/ShortcutsDialog.cpp 2014-10-07 08:24:37 +0000
@@ -296,6 +296,13 @@
296 addscroll << ui->shortcutsTreeView;296 addscroll << ui->shortcutsTreeView;
297 installKineticScrolling(addscroll);297 installKineticScrolling(addscroll);
298298
299#ifdef Q_OS_WIN
300 // Install the Event Filter to show the touch keyboard
301 ui->primaryShortcutEdit->installEventFilter(this);
302 ui->lineEditSearch->installEventFilter(this);
303 ui->altShortcutEdit->installEventFilter(this);
304#endif
305
299 connect(&StelApp::getInstance(), SIGNAL(languageChanged()), this, SLOT(retranslate()));306 connect(&StelApp::getInstance(), SIGNAL(languageChanged()), this, SLOT(retranslate()));
300 connect(ui->shortcutsTreeView->selectionModel(),307 connect(ui->shortcutsTreeView->selectionModel(),
301 SIGNAL(currentChanged(QModelIndex,QModelIndex)),308 SIGNAL(currentChanged(QModelIndex,QModelIndex)),
@@ -496,3 +503,17 @@
496 << q_("Alternative shortcut");503 << q_("Alternative shortcut");
497 mainModel->setHorizontalHeaderLabels(headerLabels);504 mainModel->setHorizontalHeaderLabels(headerLabels);
498}505}
506
507#ifdef Q_OS_WIN
508bool ShortcutsDialog::eventFilter(QObject *object, QEvent *event)
509{
510 if (object == ui->primaryShortcutEdit || object == ui->lineEditSearch || object == ui->altShortcutEdit)
511 {
512 if (event->type() == QEvent::FocusIn)
513 showTouchKeyboard(true);
514 if (event->type() == QEvent::FocusOut)
515 showTouchKeyboard(false);
516 }
517 return false;
518}
519#endif
499\ No newline at end of file520\ No newline at end of file
500521
=== modified file 'src/gui/ShortcutsDialog.hpp'
--- src/gui/ShortcutsDialog.hpp 2014-09-08 12:47:22 +0000
+++ src/gui/ShortcutsDialog.hpp 2014-10-07 08:24:37 +0000
@@ -89,6 +89,10 @@
89 //! Initialize the dialog widgets and connect the signals/slots.89 //! Initialize the dialog widgets and connect the signals/slots.
90 virtual void createDialogContent();90 virtual void createDialogContent();
9191
92#ifdef Q_OS_WIN
93 virtual bool eventFilter(QObject *object, QEvent *event);
94#endif
95
92private:96private:
93 //! checks whether given item can be changed by editors.97 //! checks whether given item can be changed by editors.
94 static bool itemIsEditable(QStandardItem *item);98 static bool itemIsEditable(QStandardItem *item);
9599
=== modified file 'src/gui/StelDialog.cpp'
--- src/gui/StelDialog.cpp 2014-09-14 16:45:46 +0000
+++ src/gui/StelDialog.cpp 2014-10-07 08:24:37 +0000
@@ -30,6 +30,12 @@
30#include <QSettings>30#include <QSettings>
31#include <QScroller>31#include <QScroller>
3232
33#ifdef Q_OS_WIN
34#include <windows.h>
35#include <objbase.h>
36#include <Tchar.h>
37#endif
38
33class CustomProxy : public QGraphicsProxyWidget39class CustomProxy : public QGraphicsProxyWidget
34{40{
35 public:41 public:
@@ -170,3 +176,32 @@
170 QScroller::scroller(w);176 QScroller::scroller(w);
171 }177 }
172}178}
179
180#ifdef Q_OS_WIN
181void StelDialog::showTouchKeyboard(bool show)
182{
183 if (StelApp::getInstance().getSettings()->value("gui/flag_enable_touch_keyboard", false).toBool() == false)
184 return;
185
186 switch (QSysInfo::WindowsVersion){
187 case QSysInfo::WV_6_3:
188 case QSysInfo::WV_6_2:
189 {
190 if (show)
191 {
192 ShellExecuteA(NULL, "open", "\"C:\\Program Files\\Common Files\\microsoft shared\\ink\\TabTip.exe\"", "", 0, SW_NORMAL);
193 }
194 else
195 {
196 HWND wKB = ::FindWindow(_TEXT("IPTip_Main_Window"), NULL);
197 if (wKB != NULL && ::IsWindowVisible(wKB))
198 {
199 ::PostMessage(wKB, WM_SYSCOMMAND, SC_CLOSE, 0);
200 }
201 }
202 break;
203 }
204 default: return;
205 }
206}
207#endif
173\ No newline at end of file208\ No newline at end of file
174209
=== modified file 'src/gui/StelDialog.hpp'
--- src/gui/StelDialog.hpp 2014-09-08 12:47:22 +0000
+++ src/gui/StelDialog.hpp 2014-10-07 08:24:37 +0000
@@ -81,6 +81,11 @@
8181
82 //! Kinetic scrolling for lists.82 //! Kinetic scrolling for lists.
83 void installKineticScrolling(QList<QWidget *> addscroll);83 void installKineticScrolling(QList<QWidget *> addscroll);
84
85#ifdef Q_OS_WIN
86 //! Show touch Keyboard for tablet pc
87 void showTouchKeyboard(bool show);
88#endif
84};89};
8590
86#endif // _STELDIALOG_HPP_91#endif // _STELDIALOG_HPP_