Ui support added for GpsLocation. Menu with button to toggle gps on or
[ptas] / zouba / src / gui / searchdisplay.cpp
index 5a1e02c..dc3ec02 100644 (file)
@@ -37,6 +37,14 @@ SearchDisplay::SearchDisplay(QWidget *parent) :
     //this->ui->from_favorites->setIcon(QIcon::fromTheme("edit-copy"));
     //this->ui->dest_favorites->setText("Fav");
 
+    QMenuBar *menu = this->ui->menubar;
+    QAction *use_gps = new QAction("Use GPS", this);
+    use_gps->setCheckable(true);
+    use_gps->setChecked(false);
+    this->connect(use_gps, SIGNAL(toggled(bool)), SLOT(gps_status_change_requested(bool)));
+    this->connect(use_gps, SIGNAL(toggled(bool)), locations->getGpsLocation(), SLOT(enableGps(bool)));
+    menu->addAction(use_gps);
+
     this->from_selected = NULL;
     this->dest_selected = NULL;
     this->edit_window = NULL;
@@ -71,6 +79,12 @@ SearchDisplay::SearchDisplay(QWidget *parent) :
     qDebug() << "Finish constructor";
 }
 
+void SearchDisplay::gps_status_change_requested(bool status)
+{
+
+
+}
+
 SearchDisplay::~SearchDisplay()
 {
     delete ui;