Check for device state on update.
[yandex-traffic] / mainwidget.hpp
index 59aa5f2..00df461 100644 (file)
@@ -13,20 +13,31 @@ class MainWidget : public QWidget
 {
     Q_OBJECT
 private:
-    Traffic _traffic;
-    RegionsTable _regions;
-    Settings _settings;
+    Traffic* _traffic;
+    RegionsTable* _regions;
+    Settings* _settings;
 
     // Widgets
-    TrafficLight *_light;
-    QLabel *_label;
+    TrafficLight* _light;
+    QLabel* _label;
+
+    // Other stuff
+    QTimer *_timer;
 
 public:
     MainWidget ();
+    virtual ~MainWidget ();
+
+public slots:
+    void settingsDialog ();
+    void updateData ();
 
 protected:
     void paintEvent (QPaintEvent *event);
-    void timerEvent (QTimerEvent *event);
+    void mousePressEvent (QMouseEvent *event);
+
+    void updateSize ();
+    void applySettings ();
 
 protected slots:
     void trafficUpdated ();