author | František Kučera <franta-hg@frantovo.cz> |
Fri, 30 Aug 2019 01:22:12 +0200 | |
branch | v_0 |
changeset 16 | 2705911938b4 |
parent 15 | 00783e323e66 |
child 17 | d37c6dd9aa20 |
permissions | -rw-r--r-- |
15 | 1 |
/** |
2 |
* cadMousePro |
|
3 |
* Copyright © 2019 František Kučera (Frantovo.cz, GlobalCode.info) |
|
4 |
* |
|
5 |
* This program is free software: you can redistribute it and/or modify |
|
6 |
* it under the terms of the GNU General Public License as published by |
|
7 |
* the Free Software Foundation, either version 3 of the License, or |
|
8 |
* (at your option) any later version. |
|
9 |
* |
|
10 |
* This program is distributed in the hope that it will be useful, |
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
* GNU General Public License for more details. |
|
14 |
* |
|
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/>. |
|
17 |
*/ |
|
18 |
#pragma once |
|
19 |
||
20 |
#include <QMainWindow> |
|
16
2705911938b4
GUI for mouse configuration over D-Bus daemon
František Kučera <franta-hg@frantovo.cz>
parents:
15
diff
changeset
|
21 |
#include <QFormLayout> |
2705911938b4
GUI for mouse configuration over D-Bus daemon
František Kučera <franta-hg@frantovo.cz>
parents:
15
diff
changeset
|
22 |
#include <QCheckBox> |
2705911938b4
GUI for mouse configuration over D-Bus daemon
František Kučera <franta-hg@frantovo.cz>
parents:
15
diff
changeset
|
23 |
#include <QRadioButton> |
2705911938b4
GUI for mouse configuration over D-Bus daemon
František Kučera <franta-hg@frantovo.cz>
parents:
15
diff
changeset
|
24 |
#include <QButtonGroup> |
2705911938b4
GUI for mouse configuration over D-Bus daemon
František Kučera <franta-hg@frantovo.cz>
parents:
15
diff
changeset
|
25 |
#include <QLineEdit> |
2705911938b4
GUI for mouse configuration over D-Bus daemon
František Kučera <franta-hg@frantovo.cz>
parents:
15
diff
changeset
|
26 |
#include <QtDBus/QDBusConnection> |
2705911938b4
GUI for mouse configuration over D-Bus daemon
František Kučera <franta-hg@frantovo.cz>
parents:
15
diff
changeset
|
27 |
|
2705911938b4
GUI for mouse configuration over D-Bus daemon
František Kučera <franta-hg@frantovo.cz>
parents:
15
diff
changeset
|
28 |
#include "generated-sources/Proxy.h" |
15 | 29 |
|
30 |
class MouseMainWindow : public QMainWindow { |
|
31 |
Q_OBJECT |
|
32 |
public: |
|
16
2705911938b4
GUI for mouse configuration over D-Bus daemon
František Kučera <franta-hg@frantovo.cz>
parents:
15
diff
changeset
|
33 |
MouseMainWindow(); |
15 | 34 |
|
35 |
virtual ~MouseMainWindow() { |
|
36 |
} |
|
37 |
||
16
2705911938b4
GUI for mouse configuration over D-Bus daemon
František Kučera <franta-hg@frantovo.cz>
parents:
15
diff
changeset
|
38 |
private: |
2705911938b4
GUI for mouse configuration over D-Bus daemon
František Kučera <franta-hg@frantovo.cz>
parents:
15
diff
changeset
|
39 |
QWidget* centralwidget; |
2705911938b4
GUI for mouse configuration over D-Bus daemon
František Kučera <franta-hg@frantovo.cz>
parents:
15
diff
changeset
|
40 |
QFormLayout* formLayout; |
2705911938b4
GUI for mouse configuration over D-Bus daemon
František Kučera <franta-hg@frantovo.cz>
parents:
15
diff
changeset
|
41 |
QCheckBox* statusProxy = new QCheckBox("connected to Daemon", this); |
2705911938b4
GUI for mouse configuration over D-Bus daemon
František Kučera <franta-hg@frantovo.cz>
parents:
15
diff
changeset
|
42 |
QCheckBox* statusUPower = new QCheckBox("connected to UPower", this); |
2705911938b4
GUI for mouse configuration over D-Bus daemon
František Kučera <franta-hg@frantovo.cz>
parents:
15
diff
changeset
|
43 |
QCheckBox* statusDevice = new QCheckBox("present", this); |
2705911938b4
GUI for mouse configuration over D-Bus daemon
František Kučera <franta-hg@frantovo.cz>
parents:
15
diff
changeset
|
44 |
|
2705911938b4
GUI for mouse configuration over D-Bus daemon
František Kučera <franta-hg@frantovo.cz>
parents:
15
diff
changeset
|
45 |
QCheckBox* configureSmartScrolling = new QCheckBox("smart scrolling (free wheel)", this); |
2705911938b4
GUI for mouse configuration over D-Bus daemon
František Kučera <franta-hg@frantovo.cz>
parents:
15
diff
changeset
|
46 |
QCheckBox* configureLiftOffDetection = new QCheckBox("lift-off detection", this); |
2705911938b4
GUI for mouse configuration over D-Bus daemon
František Kučera <franta-hg@frantovo.cz>
parents:
15
diff
changeset
|
47 |
QRadioButton* configureFrequency125 = new QRadioButton("125 Hz", this); |
2705911938b4
GUI for mouse configuration over D-Bus daemon
František Kučera <franta-hg@frantovo.cz>
parents:
15
diff
changeset
|
48 |
QRadioButton* configureFrequency250 = new QRadioButton("250 Hz", this); |
2705911938b4
GUI for mouse configuration over D-Bus daemon
František Kučera <franta-hg@frantovo.cz>
parents:
15
diff
changeset
|
49 |
QRadioButton* configureFrequency500 = new QRadioButton("500 Hz", this); |
2705911938b4
GUI for mouse configuration over D-Bus daemon
František Kučera <franta-hg@frantovo.cz>
parents:
15
diff
changeset
|
50 |
QRadioButton* configureFrequency1000 = new QRadioButton("1000 Hz", this); |
2705911938b4
GUI for mouse configuration over D-Bus daemon
František Kučera <franta-hg@frantovo.cz>
parents:
15
diff
changeset
|
51 |
|
2705911938b4
GUI for mouse configuration over D-Bus daemon
František Kučera <franta-hg@frantovo.cz>
parents:
15
diff
changeset
|
52 |
QLineEdit* message = new QLineEdit(this); |
2705911938b4
GUI for mouse configuration over D-Bus daemon
František Kučera <franta-hg@frantovo.cz>
parents:
15
diff
changeset
|
53 |
|
2705911938b4
GUI for mouse configuration over D-Bus daemon
František Kučera <franta-hg@frantovo.cz>
parents:
15
diff
changeset
|
54 |
QDBusConnection connection = QDBusConnection::systemBus(); |
2705911938b4
GUI for mouse configuration over D-Bus daemon
František Kučera <franta-hg@frantovo.cz>
parents:
15
diff
changeset
|
55 |
InfoGlobalcodeMouseCadMouseProInterface* proxy; |
2705911938b4
GUI for mouse configuration over D-Bus daemon
František Kučera <franta-hg@frantovo.cz>
parents:
15
diff
changeset
|
56 |
|
2705911938b4
GUI for mouse configuration over D-Bus daemon
František Kučera <franta-hg@frantovo.cz>
parents:
15
diff
changeset
|
57 |
private slots: |
2705911938b4
GUI for mouse configuration over D-Bus daemon
František Kučera <franta-hg@frantovo.cz>
parents:
15
diff
changeset
|
58 |
void refresh(); |
2705911938b4
GUI for mouse configuration over D-Bus daemon
František Kučera <franta-hg@frantovo.cz>
parents:
15
diff
changeset
|
59 |
void configure(); |
15 | 60 |
}; |