Use dialog instead of popup menu.
[yandex-traffic] / mainwidget.hpp
index 65f64ab..20e86be 100644 (file)
@@ -3,6 +3,7 @@
 
 #include <QtGui>
 
+#include "traffic.hpp"
 #include "settings.hpp"
 #include "regions.hpp"
 #include "light.hpp"
@@ -12,19 +13,35 @@ class MainWidget : public QWidget
 {
     Q_OBJECT
 private:
-    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 ();
-    QSize sizeHint () const;
+    virtual ~MainWidget ();
+
+public slots:
+    void settingsDialog ();
+    void updateData ();
 
 protected:
+    bool event (QEvent *event);
     void paintEvent (QPaintEvent *event);
+
+    void updateSize ();
+    void applySettings ();
+
+protected slots:
+    void trafficUpdated ();
+    void deviceLockChanged (bool locked);
 };
 
 #endif /* __MAINWIDGET_H__ */