#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_);
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("Set unit"), this, SLOT(selectUnit()));
+ addAction(tr("Theme"), this, SLOT(selectTheme()));
+ addAction(tr("Options"), 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()));
}
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_)
{
unitSelector_ = new UnitSelector(this);
connect(unitSelector_, SIGNAL(unitChanged()), this, SIGNAL(unitChanged()));
+ connect(unitSelector_, SIGNAL(orientationChanged()), this, SIGNAL(orientationChanged()));
}
unitSelector_->show();