#include "friendlistpanel.h"
#include "fullscreenbutton.h"
#include "indicatorbuttonpanel.h"
+#include "locationsearchpanel.h"
#include "logindialog.h"
#include "mapscale.h"
#include "panelcommon.h"
setWindowTitle(tr("Situare"));
// set stacking order of widgets (from top to bottom)
- // if the fullscreen button exists, then it is the topmost one, otherwise the tabbed panel is
+ // m_tabbedPanel is the topmost one
if (m_fullScreenButton) {
- m_tabbedPanel->stackUnder(m_fullScreenButton);
+ m_fullScreenButton->stackUnder(m_tabbedPanel);
+ m_crosshair->stackUnder(m_fullScreenButton);
+ } else {
+ m_crosshair->stackUnder(m_tabbedPanel);
}
- m_crosshair->stackUnder(m_tabbedPanel);
m_zoomButtonPanel->stackUnder(m_crosshair);
m_indicatorButtonPanel->stackUnder(m_zoomButtonPanel);
m_osmLicense->stackUnder(m_indicatorButtonPanel);
queueDialog(msgBox);
}
+void MainWindow::buildLocationSearchPanel()
+{
+ qDebug() << __PRETTY_FUNCTION__;
+
+ m_locationSearchPanel = new LocationSearchPanel(this);
+
+ connect(this, SIGNAL(locationDataParsed(const QList<Location>&)),
+ m_locationSearchPanel, SLOT(populateLocationListView(const QList<Location>&)));
+
+ connect(m_locationSearchPanel, SIGNAL(locationItemClicked(const GeoCoordinate&, const GeoCoordinate&)),
+ this, SIGNAL(locationItemClicked(const GeoCoordinate&, const GeoCoordinate&)));
+
+ connect(m_locationSearchPanel, SIGNAL(routeToLocation(const GeoCoordinate&)),
+ this, SIGNAL(routeTo(const GeoCoordinate&)));
+
+ connect(m_locationSearchPanel, SIGNAL(requestSearchLocation()),
+ this, SLOT(startLocationSearch()));
+}
+
void MainWindow::buildMap()
{
qDebug() << __PRETTY_FUNCTION__;
buildIndicatorButtonPanel();
buildMapScale();
- connect(m_mapView, SIGNAL(viewScrolled(SceneCoordinate, bool)),
- this, SIGNAL(mapViewScrolled(SceneCoordinate, bool)));
+ connect(m_mapView, SIGNAL(viewScrolled(SceneCoordinate)),
+ this, SIGNAL(mapViewScrolled(SceneCoordinate)));
- connect(this, SIGNAL(centerToSceneCoordinates(SceneCoordinate, bool)),
- m_mapView, SLOT(centerToSceneCoordinates(SceneCoordinate, bool)));
+ connect(this, SIGNAL(centerToSceneCoordinates(SceneCoordinate)),
+ m_mapView, SLOT(centerToSceneCoordinates(SceneCoordinate)));
connect(m_mapView, SIGNAL(viewResized(QSize)),
this, SIGNAL(mapViewResized(QSize)));
buildUserInfoPanel();
buildFriendListPanel();
+ buildLocationSearchPanel();
buildRoutingPanel();
m_tabbedPanel = new TabbedPanel(this);
m_tabbedPanel->addTab(m_userInfoPanel, QIcon(":/res/images/user_info.png"));
m_tabbedPanel->addTab(m_friendsListPanel, QIcon(":/res/images/friend_list.png"));
+ m_tabbedPanel->addTab(m_locationSearchPanel, QIcon(":/res/images/search.png"));
m_tabbedPanel->addTab(m_routingPanel, QIcon(":/res/images/routing.png"));
connect(m_mapView, SIGNAL(viewResized(QSize)),
m_tabbedPanel, SLOT(resizePanel(QSize)));
- connect(m_friendsListPanel, SIGNAL(showPanelRequested(QWidget*)),
- m_tabbedPanel, SLOT(showPanel(QWidget*)));
+ connect(m_friendsListPanel, SIGNAL(openPanelRequested(QWidget*)),
+ m_tabbedPanel, SLOT(openPanel(QWidget*)));
- connect(m_routingPanel, SIGNAL(showPanelRequested(QWidget*)),
- m_tabbedPanel, SLOT(showPanel(QWidget*)));
+ connect(m_routingPanel, SIGNAL(openPanelRequested(QWidget*)),
+ m_tabbedPanel, SLOT(openPanel(QWidget*)));
connect(m_tabbedPanel, SIGNAL(panelClosed()),
m_friendsListPanel, SLOT(anyPanelClosed()));
connect(m_tabbedPanel, SIGNAL(panelOpened()),
m_mapView, SLOT(enableCenterShift()));
+
+ connect(m_tabbedPanel, SIGNAL(panelClosed()),
+ m_userInfoPanel, SIGNAL(collapse()));
+
+ connect(m_tabbedPanel, SIGNAL(currentChanged(int)),
+ m_userInfoPanel, SIGNAL(collapse()));
}
void MainWindow::buildRoutingPanel()
connect(this, SIGNAL(locationDataParsed(const QList<Location>&)),
m_routingPanel, SLOT(populateLocationListView(const QList<Location>&)));
- connect(m_routingPanel,
- SIGNAL(locationItemClicked(const GeoCoordinate&, const GeoCoordinate&)),
- this,
- SIGNAL(locationItemClicked(const GeoCoordinate&, const GeoCoordinate&)));
+ connect(m_routingPanel, SIGNAL(locationItemClicked(const GeoCoordinate&, const GeoCoordinate&)),
+ this, SIGNAL(locationItemClicked(const GeoCoordinate&, const GeoCoordinate&)));
connect(m_routingPanel, SIGNAL(routeToLocation(const GeoCoordinate&)),
this, SIGNAL(routeTo(const GeoCoordinate&)));
connect(m_routingPanel, SIGNAL(requestSearchLocation()),
this, SLOT(startLocationSearch()));
+
+ connect(m_routingPanel, SIGNAL(clearRoute()),
+ this, SIGNAL(clearRoute()));
}
void MainWindow::buildUserInfoPanel()