#include "fullscreenbutton.h"
#include "logindialog.h"
#include "mapscale.h"
+#include "searchdialog.h"
#include "settingsdialog.h"
#include "userinfopanel.h"
#include "zoombuttonpanel.h"
m_mapScale->stackUnder(m_ownLocationCrosshair);
m_mapView->stackUnder(m_mapScale);
- // ->
- QLineEdit *ledit = new QLineEdit(this);
- ledit->stackUnder(m_osmLicense);
- ledit->move(50, (DEFAULT_SCREEN_HEIGHT - 130) );
- ledit->setFixedSize((DEFAULT_SCREEN_WIDTH - 50), 70);
- ledit->show();
- // <-
-
grabZoomKeys(true);
// Set default screen size
connect(m_autoCenteringAct, SIGNAL(triggered(bool)),
this, SIGNAL(autoCenteringTriggered(bool)));
+ /// @todo remove when not needed!
+ m_searchLocationAct = new QAction(tr("Location search"), this);
+ connect(m_searchLocationAct, SIGNAL(triggered()),
+ this, SLOT(startLocationSearch()));
+
// build the actual menu
m_viewMenu = menuBar()->addMenu(tr("Main"));
m_viewMenu->addAction(m_loginAct);
m_viewMenu->addAction(m_toSettingsAct);
m_viewMenu->addAction(m_gpsToggleAct);
m_viewMenu->addAction(m_autoCenteringAct);
+ m_viewMenu->addAction(m_searchLocationAct); /// @todo remove when not needed!
m_viewMenu->setObjectName(tr("Menu"));
}
QDialog *dialog = m_queue.takeFirst();
LoginDialog *loginDialog = qobject_cast<LoginDialog *>(dialog);
+ SearchDialog *searchDialog = qobject_cast<SearchDialog *>(dialog);
if(loginDialog) {
if(status != 0) {
buildWebView();
} else {
emit cancelLoginProcess();
}
+ } else if(searchDialog) {
+ if(status != 0) {
+ emit searchForLocation(searchDialog->input());
+ }
}
dialog->deleteLater();
}
}
+void MainWindow::startLocationSearch()
+{
+ qDebug() << __PRETTY_FUNCTION__;
+
+ SearchDialog *searchDialog = new SearchDialog();
+ queueDialog(searchDialog);
+}
+
void MainWindow::startLoginProcess()
{
qDebug() << __PRETTY_FUNCTION__;
emit error(ErrorContext::NETWORK, reply->error());
}
}
-