#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;
+
+ // Other stuff
+ QTimer *_timer;
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 ();
+ 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__ */