#include "map/mapcommon.h"
#include "map/mapview.h"
#include "mapscale.h"
+#include "meetpeoplepanel.h"
+#include "messagedialog.h"
+#include "messagepanel.h"
#include "panelcommon.h"
#include "routingpanel.h"
#include "searchdialog.h"
connect(m_friendsListPanel, SIGNAL(findFriend(GeoCoordinate)),
this, SIGNAL(centerToCoordinates(GeoCoordinate)));
- connect(this, SIGNAL(friendImageReady(User*)),
- m_friendsListPanel, SLOT(friendImageReady(User*)));
+ connect(this, SIGNAL(friendImageReady(QString,QPixmap)),
+ m_friendsListPanel, SLOT(friendImageReady(QString,QPixmap)));
connect(m_friendsListPanel, SIGNAL(routeToFriend(const GeoCoordinate&)),
this, SIGNAL(routeTo(const GeoCoordinate&)));
m_mapScale, SLOT(updateMapResolution(qreal)));
}
+void MainWindow::buildMeetPeoplePanel()
+{
+ qDebug() << __PRETTY_FUNCTION__;
+
+ m_meetPeoplePanel = new MeetPeoplePanel(this);
+
+ connect(this, SIGNAL(friendImageReady(QString,QPixmap)),
+ m_meetPeoplePanel, SLOT(setImage(QString,QPixmap)));
+
+ connect(this, SIGNAL(interestingPeopleReceived(QList<User>&,QList<User>&)),
+ m_meetPeoplePanel, SLOT(populateInterestingPeopleListView(QList<User>&,QList<User>&)));
+
+ connect(m_meetPeoplePanel, SIGNAL(requestInterestingPeople()),
+ this, SIGNAL(requestInterestingPeople()));
+
+ connect(m_meetPeoplePanel, SIGNAL(requestInterestingPeopleSearch()),
+ this, SLOT(startPeopleSearch()));
+
+ connect(m_meetPeoplePanel, SIGNAL(findPerson(GeoCoordinate)),
+ this, SIGNAL(centerToCoordinates(GeoCoordinate)));
+
+ connect(m_meetPeoplePanel, SIGNAL(requestMessageDialog(QPair<QString, QString>)),
+ this, SIGNAL(requestMessageDialog(QPair<QString, QString>)));
+
+ connect(m_meetPeoplePanel, SIGNAL(requestShowFriend(QList<QString>)),
+ m_friendsListPanel, SLOT(showFriendsInList(QList<QString>)));
+}
+
+void MainWindow::buildMessagePanel()
+{
+ qDebug() << __PRETTY_FUNCTION__;
+
+ m_messagePanel = new MessagePanel(this);
+
+ connect(this, SIGNAL(messagesReceived(QList<Message>&, QList<Message>&)),
+ m_messagePanel, SLOT(populateMessageListView(QList<Message>&, QList<Message>&)));
+
+ connect(m_messagePanel, SIGNAL(requestMessages()),
+ this, SIGNAL(requestMessages()));
+
+ connect(this, SIGNAL(friendImageReady(QString,QPixmap)),
+ m_messagePanel, SLOT(setImage(QString,QPixmap)));
+
+ connect(m_messagePanel, SIGNAL(requestRemoveMessage(QString)),
+ this, SIGNAL(requestRemoveMessage(QString)));
+
+ connect(m_messagePanel, SIGNAL(findFriend(GeoCoordinate)),
+ this, SIGNAL(centerToCoordinates(GeoCoordinate)));
+
+ connect(m_messagePanel, SIGNAL(requestMessageDialog(QPair<QString, QString>)),
+ this, SIGNAL(requestMessageDialog(QPair<QString, QString>)));
+}
+
void MainWindow::buildOsmLicense()
{
qDebug() << __PRETTY_FUNCTION__;
buildFriendListPanel();
buildLocationSearchPanel();
buildRoutingPanel();
+ buildMeetPeoplePanel();
+ buildMessagePanel();
m_tabbedPanel = new TabbedPanel(this);
m_situareTabsIndexes.append(
m_tabbedPanel->addTab(m_friendsListPanel, QIcon(":/res/images/friend_list.png")));
- m_tabbedPanel->addTab(m_locationSearchPanel, QIcon(":/res/images/location_search.png"));
- m_tabbedPanel->addTab(m_routingPanel, QIcon(":/res/images/routing.png"));
+// m_tabbedPanel->addTab(m_locationSearchPanel, QIcon(":/res/images/location_search.png"));
+// m_tabbedPanel->addTab(m_routingPanel, QIcon(":/res/images/routing.png"));
+ m_situareTabsIndexes.append(
+ m_tabbedPanel->addTab(m_meetPeoplePanel, QIcon(":/res/images/meet_people.png")));
+ m_situareTabsIndexes.append(
+ m_tabbedPanel->addTab(m_messagePanel, QIcon(":/res/images/message.png")));
connect(m_mapView, SIGNAL(viewResized(QSize)),
m_tabbedPanel, SLOT(resizePanel(QSize)));
connect(m_tabbedPanel, SIGNAL(currentChanged(int)),
m_userInfoPanel, SIGNAL(collapse()));
+ connect(m_tabbedPanel, SIGNAL(panelClosed()),
+ m_meetPeoplePanel, SLOT(anyPanelClosed()));
+
+ connect(m_tabbedPanel, SIGNAL(panelClosed()),
+ m_messagePanel, SLOT(anyPanelClosed()));
+
// signals for showing and hiding list item context buttons
+ connect(m_userInfoPanel, SIGNAL(listItemSelectionChanged(bool)),
+ m_tabbedPanel, SIGNAL(listItemSelectionChanged(bool)));
+
connect(m_friendsListPanel, SIGNAL(listItemSelectionChanged(bool)),
m_tabbedPanel, SIGNAL(listItemSelectionChanged(bool)));
connect(m_routingPanel, SIGNAL(listItemSelectionChanged(bool)),
m_tabbedPanel, SIGNAL(listItemSelectionChanged(bool)));
+
+ connect(m_meetPeoplePanel, SIGNAL(listItemSelectionChanged(bool)),
+ m_tabbedPanel, SIGNAL(listItemSelectionChanged(bool)));
+
+ connect(m_messagePanel, SIGNAL(listItemSelectionChanged(bool)),
+ m_tabbedPanel, SIGNAL(listItemSelectionChanged(bool)));
}
void MainWindow::buildRoutingPanel()
connect(m_userInfoPanel, SIGNAL(refreshUserData()),
this, SIGNAL(refreshUserData()));
- connect(m_userInfoPanel, SIGNAL(updateLocationMessageButtonClicked()),
- this, SLOT(showUpdateLocationDialog()));
+ connect(this, SIGNAL(userImageReady(QString,QPixmap)),
+ m_userInfoPanel, SLOT(setImage(QString,QPixmap)));
+
+ connect(m_userInfoPanel, SIGNAL(addTags(QStringList)),
+ this, SIGNAL(addTags(QStringList)));
+
+ connect(m_userInfoPanel, SIGNAL(removeTags(QStringList)),
+ this, SIGNAL(removeTags(QStringList)));
+
+ connect(this, SIGNAL(popularTagsReceived(QHash<QString,QString>&)),
+ m_userInfoPanel, SLOT(populatePopularTags(QHash<QString,QString>&)));
+
+ connect(m_userInfoPanel, SIGNAL(requestPopularTags()),
+ this, SIGNAL(requestPopularTags()));
}
void MainWindow::buildZoomButtonPanel()
QDialog *dialog = m_queue.takeFirst();
SearchDialog *searchDialog = qobject_cast<SearchDialog *>(dialog);
- if ((searchDialog) && (status != 0))
- emit searchForLocation(searchDialog->input());
+ MessageDialog *messageDialog = qobject_cast<MessageDialog *>(dialog);
+
+ if ((searchDialog) && (status != 0)) {
+ if (searchDialog->type() == SearchDialog::Location)
+ emit searchForLocation(searchDialog->input());
+ else if (searchDialog->type() == SearchDialog::PeopleTag)
+ emit requestSearchPeopleByTag(searchDialog->input());
+ } else if ((messageDialog) && (status != 0)) {
+ emit sendMessage(messageDialog->input().first, messageDialog->input().second,
+ messageDialog->isAddCoordinatesSelected());
+ }
dialog->deleteLater();
#endif
}
+void MainWindow::showMessageDialog(const QPair<QString, QString> &receiver)
+{
+ qDebug() << __PRETTY_FUNCTION__;
+
+ MessageDialog *messageDialog = new MessageDialog(receiver.first, receiver.second);
+ queueDialog(messageDialog);
+}
+
void MainWindow::showEnableAutomaticUpdateLocationDialog(const QString &text)
{
qDebug() << __PRETTY_FUNCTION__;
emit requestReverseGeo();
}
-void MainWindow::sslErrors(QNetworkReply *reply, const QList<QSslError> &errors)
+void MainWindow::startLocationSearch()
{
qDebug() << __PRETTY_FUNCTION__;
- Q_UNUSED(errors)
- reply->ignoreSslErrors();
+ SearchDialog *searchDialog = new SearchDialog(SearchDialog::Location);
+ queueDialog(searchDialog);
}
-void MainWindow::startLocationSearch()
+void MainWindow::startPeopleSearch()
{
qDebug() << __PRETTY_FUNCTION__;
- SearchDialog *searchDialog = new SearchDialog();
+ SearchDialog *searchDialog = new SearchDialog(SearchDialog::PeopleTag);
queueDialog(searchDialog);
}
+void MainWindow::sslErrors(QNetworkReply *reply, const QList<QSslError> &errors)
+{
+ qDebug() << __PRETTY_FUNCTION__;
+
+ Q_UNUSED(errors)
+ reply->ignoreSslErrors();
+}
+
void MainWindow::toggleFullScreen()
{
qDebug() << __PRETTY_FUNCTION__;