Merge branch 'master' into context_driven_buttons, review
[situare] / src / ui / mainwindow.cpp
index cfba1f0..2ca83a8 100644 (file)
@@ -51,6 +51,7 @@
 #include "userinfopanel.h"
 #include "zoombuttonpanel.h"
 
+
 #include "mainwindow.h"
 
 // These MUST BE HERE, compiling for Maemo fails if moved
 #include <X11/Xlib.h>
 #endif // Q_WS_MAEMO_5
 
+#if defined(Q_WS_MAEMO_5) & defined(ARMEL)
+#include "ossoabookdialog.h"
+#endif
+
 MainWindow::MainWindow(QWidget *parent)
     : QMainWindow(parent),
       m_errorShown(false),
@@ -182,6 +187,9 @@ void MainWindow::buildFriendListPanel()
 
     connect(m_friendsListPanel, SIGNAL(routeToFriend(const GeoCoordinate&)),
             this, SIGNAL(routeTo(const GeoCoordinate&)));
+
+    connect(m_friendsListPanel, SIGNAL(requestContactDialog(const QString &)),
+            this, SIGNAL(requestContactDialog(const QString &)));
 }
 
 void MainWindow::buildFullScreenButton()
@@ -269,6 +277,12 @@ void MainWindow::buildLocationSearchPanel()
 
     connect(m_locationSearchPanel, SIGNAL(requestSearchLocation()),
             this, SLOT(startLocationSearch()));
+
+    connect(this, SIGNAL(searchForLocation(QString)),
+            m_locationSearchPanel, SLOT(prependSearchHistory(QString)));
+
+    connect(m_locationSearchPanel, SIGNAL(searchHistoryItemClicked(QString)),
+            this, SIGNAL(searchHistoryItemClicked(QString)));
 }
 
 void MainWindow::buildMap()
@@ -941,6 +955,18 @@ void MainWindow::setUsername(const QString &username)
     m_email = username;
 }
 
+void MainWindow::showContactDialog(const QString &guid)
+{
+    qDebug() << __PRETTY_FUNCTION__;
+
+#if defined(Q_WS_MAEMO_5) & defined(ARMEL)
+    OssoABookDialog::showContactDialog(guid);
+#else
+    Q_UNUSED(guid);
+    buildInformationBox(tr("Contact dialog works only on phone!"), true);
+#endif
+}
+
 void MainWindow::showEnableAutomaticUpdateLocationDialog(const QString &text)
 {
     qDebug() << __PRETTY_FUNCTION__;