13 * GNU General Public License for more details. |
13 * GNU General Public License for more details. |
14 * |
14 * |
15 * You should have received a copy of the GNU General Public License |
15 * You should have received a copy of the GNU General Public License |
16 * along with this program. If not, see <http://www.gnu.org/licenses/>. |
16 * along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 */ |
17 */ |
18 #include <iostream> |
18 #include <QApplication> |
19 |
19 |
20 #include <QApplication> |
|
21 #include <QtDBus/QDBusConnection> |
|
22 |
|
23 #include "generated-sources/Proxy.h" |
|
24 #include "MouseMainWindow.h" |
20 #include "MouseMainWindow.h" |
25 |
21 |
26 int main(int argc, char** argv) { |
22 int main(int argc, char** argv) { |
|
23 QApplication qtApplication(argc, argv); |
27 |
24 |
28 std::wcout << L"cadMousePro GUI" << std::endl; |
|
29 |
|
30 |
|
31 QApplication qtApplication(argc, argv); |
|
32 |
|
33 MouseMainWindow window; |
25 MouseMainWindow window; |
34 window.show(); |
26 window.show(); |
35 |
|
36 |
|
37 QDBusConnection connection = QDBusConnection::systemBus(); |
|
38 |
|
39 InfoGlobalcodeMouseCadMouseProInterface* proxy = new InfoGlobalcodeMouseCadMouseProInterface("info.globalcode.mouse.cadMousePro", "/info/globalcode/mouse/cadMousePro", connection, &qtApplication); |
|
40 |
|
41 std::wcout << (proxy->isValid() ? L"connected" : L"disconnected") << std::endl; |
|
42 std::wcout << (proxy->devicePresent() ? L"mouse found" : L"mouse not found") << std::endl; |
|
43 std::wcout << L"mouse name: " << proxy->deviceName().toStdWString() << std::endl; |
|
44 std::wcout << connection.lastError().message().toStdWString() << std::endl; |
|
45 |
27 |
46 return qtApplication.exec(); |
28 return qtApplication.exec(); |
47 |
|
48 } |
29 } |