Added theme scheduler, poi support and speed alarm features.
[jspeed] / src / mainmenu.cpp
index a10d69b..da6af01 100644 (file)
 #include "mainmenu.h"
 #include "themeselector.h"
 #include "unitselector.h"
+#include "poisettings.h"
+#include "speedalarmsettings.h"
 
 MainMenu::MainMenu(QWidget* parent): QDialog(parent), itemCount_(0),
-currentRow_(0), themeSelector_(0), unitSelector_(0), aboutDialog_(0)
+currentRow_(0), themeSelector_(0), unitSelector_(0), poiSettings_(0),
+speedAlarmSettings_(0), aboutDialog_(0)
 {
     layout_ = new QVBoxLayout;
     setLayout(layout_);
@@ -35,8 +38,10 @@ currentRow_(0), themeSelector_(0), unitSelector_(0), aboutDialog_(0)
     setWindowTitle(tr("Menu"));
     addAction(tr("Reset trip"), this, SIGNAL(resetTrip()));
     addAction(tr("Reset all"), this, SLOT(confirmReset()));
-    addAction(tr("Select theme"), this, SLOT(selectTheme()));
+    addAction(tr("Theme"), this, SLOT(selectTheme()));
     addAction(tr("Set unit"), this, SLOT(selectUnit()));
+    addAction(tr("Speed camera alerts"), this, SLOT(openPoiAlerts()));
+    addAction(tr("Speed alarm"), this, SLOT(openSpeedAlarm()));
     addAction(tr("Flip screen"), this, SIGNAL(flip()));
     addAction(tr("About"), this, SLOT(showAbout()));
 }
@@ -52,6 +57,26 @@ void MainMenu::selectTheme()
     themeSelector_->show();
 }
 
+void MainMenu::openPoiAlerts()
+{
+    if(!poiSettings_)
+    {
+        poiSettings_ = new PoiSettings(this);
+    }
+
+    poiSettings_->show();
+}
+
+void MainMenu::openSpeedAlarm()
+{
+    if(!speedAlarmSettings_)
+    {
+        speedAlarmSettings_ = new SpeedAlarmSettings(this);
+    }
+
+    speedAlarmSettings_->show();
+}
+
 void MainMenu::selectUnit()
 {
     if(!unitSelector_)