Fixes to speed alarm and poi alerts. Added flicker effect. Some new fields to text...
[jspeed] / src / mainwindow.cpp
index 0d1294a..d30e299 100644 (file)
@@ -36,11 +36,8 @@ MainWindow::MainWindow(): QMainWindow(0), menu_(0), themeLoader_(0), mainScreen_
 {
     setWindowTitle(tr("jSpeed"));
     showFullScreen();
-    Odometer::instance().start();
-    PoiAlerts::instance().start();
-    SpeedAlarm::instance().start();
     addScreens();
-    startBacklight();
+    QTimer::singleShot(500, this, SLOT(loadServices()));
 }
 
 MainWindow::~MainWindow()
@@ -48,6 +45,17 @@ MainWindow::~MainWindow()
     delete themeLoader_;
 }
 
+void MainWindow::loadServices()
+{
+    Odometer::instance().start();
+    QApplication::processEvents();
+    PoiAlerts::instance().start();
+    QApplication::processEvents();
+    SpeedAlarm::instance().start();
+    QApplication::processEvents();
+    startBacklight();
+}
+
 void MainWindow::addScreens()
 {
     stack_ = new MainWindowStack(this);
@@ -119,8 +127,6 @@ void MainWindow::openMenu()
         connect(menu_, SIGNAL(flip()), stack_, SLOT(flip()));
         connect(menu_, SIGNAL(themeChanged()), this, SLOT(loadTheme()));
         connect(menu_, SIGNAL(unitChanged()), &(Odometer::instance()), SLOT(updateUnit()));
-        connect(menu_, SIGNAL(poiSettingsChanged()), &(PoiAlerts::instance()), SLOT(loadConfig()));
-        connect(menu_, SIGNAL(speedAlarmSettingsChanged()), &(SpeedAlarm::instance()), SLOT(loadConfig()));
     }
 
     menu_->show();