cadMousePro-gui/src/MouseMainWindow.h
branchv_0
changeset 21 642f32f76c9d
parent 20 cfb5f62ea048
child 26 fff8e9a86e85
equal deleted inserted replaced
20:cfb5f62ea048 21:642f32f76c9d
    23 #include <QCheckBox>
    23 #include <QCheckBox>
    24 #include <QRadioButton>
    24 #include <QRadioButton>
    25 #include <QButtonGroup>
    25 #include <QButtonGroup>
    26 #include <QLineEdit>
    26 #include <QLineEdit>
    27 #include <QLabel>
    27 #include <QLabel>
       
    28 #include <QProgressBar>
    28 #include <QtDBus/QDBusConnection>
    29 #include <QtDBus/QDBusConnection>
    29 
    30 
    30 #include "generated-sources/Proxy.h"
    31 #include "generated-sources/Proxy.h"
       
    32 #include "generated-sources/UPowerProxy.h"
    31 
    33 
    32 class MouseMainWindow : public QMainWindow {
    34 class MouseMainWindow : public QMainWindow {
    33 	Q_OBJECT
    35 	Q_OBJECT
    34 public:
    36 public:
    35 	MouseMainWindow();
    37 	MouseMainWindow();
    41 	QTabWidget* tabs = new QTabWidget(this);
    43 	QTabWidget* tabs = new QTabWidget(this);
    42 	QCheckBox* statusProxy = new QCheckBox("connected to Daemon", this);
    44 	QCheckBox* statusProxy = new QCheckBox("connected to Daemon", this);
    43 	QCheckBox* statusUPower = new QCheckBox("connected to UPower", this);
    45 	QCheckBox* statusUPower = new QCheckBox("connected to UPower", this);
    44 	QCheckBox* statusDevice = new QCheckBox("mouse found", this);
    46 	QCheckBox* statusDevice = new QCheckBox("mouse found", this);
    45 	QLabel* statusName = new QLabel(this);
    47 	QLabel* statusName = new QLabel(this);
       
    48 	QProgressBar* statusBattery = new QProgressBar(this);
    46 
    49 
    47 	QCheckBox* configureSmartScrolling = new QCheckBox("smart scrolling (free wheel)", this);
    50 	QCheckBox* configureSmartScrolling = new QCheckBox("smart scrolling (free wheel)", this);
    48 	QCheckBox* configureLiftOffDetection = new QCheckBox("lift-off detection", this);
    51 	QCheckBox* configureLiftOffDetection = new QCheckBox("lift-off detection", this);
    49 	QRadioButton* configureFrequency125 = new QRadioButton("125 Hz", this);
    52 	QRadioButton* configureFrequency125 = new QRadioButton("125 Hz", this);
    50 	QRadioButton* configureFrequency250 = new QRadioButton("250 Hz", this);
    53 	QRadioButton* configureFrequency250 = new QRadioButton("250 Hz", this);
    53 
    56 
    54 	QLineEdit* message = new QLineEdit(this);
    57 	QLineEdit* message = new QLineEdit(this);
    55 
    58 
    56 	QDBusConnection connection = QDBusConnection::systemBus();
    59 	QDBusConnection connection = QDBusConnection::systemBus();
    57 	InfoGlobalcodeMouseCadMouseProInterface* proxy;
    60 	InfoGlobalcodeMouseCadMouseProInterface* proxy;
       
    61 	OrgFreedesktopUPowerInterface* upowerProxy;
    58 
    62 
    59 	void initStatusPanel();
    63 	void initStatusPanel();
    60 	void initConfigurationPanel();
    64 	void initConfigurationPanel();
    61 	void initAboutPanel();
    65 	void initAboutPanel();
    62 	
    66 	
    63 	void appendAboutLine(QFormLayout* layout, const QString& label, const QString& value, QWidget* parent);
    67 	void appendAboutLine(QFormLayout* layout, const QString& label, const QString& value, QWidget* parent);
       
    68 	
       
    69 	int getBatteryLevel();
    64 
    70 
    65 private slots:
    71 private slots:
    66 	void refresh();
    72 	void refresh();
    67 	void configure();
    73 	void configure();
    68 };
    74 };