We have no plans to implement alerts so far
[yandex-traffic] / mainwidget.hpp
index 3469b8b..ce894c6 100644 (file)
@@ -3,31 +3,40 @@
 
 #include <QtGui>
 
-#include <settings.hpp>
-#include <regions.hpp>
+#include "traffic.hpp"
+#include "settings.hpp"
+#include "regions.hpp"
+#include "light.hpp"
 
 
-class MainWidget : public QLabel
+class MainWidget : public QWidget
 {
     Q_OBJECT
 private:
-    RegionsTable _regions;
-    Settings _settings;
+    Traffic* _traffic;
+    RegionsTable* _regions;
+    Settings* _settings;
+
+    // Widgets
+    TrafficLight* _light;
+    QLabel* _label;
 
 public:
-    MainWidget ()
-        : QLabel ()
-    {
-        setAlignment(Qt::AlignCenter);
-        setAttribute(Qt::WA_TranslucentBackground);
-
-        setText (_settings.regions ().join (", "));
-    }
-
-    QSize sizeHint() const
-    {
-        return 2 * QLabel::sizeHint();
-    }
+    MainWidget ();
+    virtual ~MainWidget ();
+
+public slots:
+    void settingsDialog ();
+
+protected:
+    void paintEvent (QPaintEvent *event);
+    void timerEvent (QTimerEvent *event);
+
+    void updateData ();
+    void updateSize ();
+
+protected slots:
+    void trafficUpdated ();
 };
 
 #endif /* __MAINWIDGET_H__ */