#include "locationlistview.h"
#include "imagebutton.h"
#include "panelcommon.h"
-#include "routing/location.h"
-#include "routing/route.h"
#include "routewaypointlistitem.h"
#include "routewaypointlistview.h"
+#include "routing/location.h"
+#include "routing/route.h"
#include "routingpanel.h"
// --- ROUTING INSTRUCTIONS WIDGET ---
m_routeWaypointListView = new RouteWaypointListView(this);
m_routeWaypointListView->setItemDelegate(new ExtendedListItemDelegate(this));
-// m_routeWaypointListView->hide();
connect(m_routeWaypointListView, SIGNAL(routeWaypointItemClicked(GeoCoordinate)),
this, SIGNAL(routeWaypointItemClicked(GeoCoordinate)));
QPalette labelPalette = resultsHeaderWidget->palette();
labelPalette.setColor(QPalette::Background, Qt::black);
resultsHeaderWidget->setPalette(labelPalette);
-// m_resultsHeaderWidget->hide();
QHBoxLayout *headerLayout = new QHBoxLayout();
resultsHeaderWidget->setLayout(headerLayout);
// list view
m_locationListView = new LocationListView(this);
m_locationListView->setItemDelegate(new ExtendedListItemDelegate(this));
-// m_locationListView->hide();
connect(m_locationListView,
SIGNAL(locationItemClicked(const GeoCoordinate&, const GeoCoordinate&)),
m_views->setContentsMargins(PANEL_MARGIN_LEFT, PANEL_MARGIN_TOP,
PANEL_MARGIN_RIGHT, PANEL_MARGIN_BOTTOM);
- m_views->addWidget(m_resultsView);
m_views->addWidget(m_routingView);
+ m_views->addWidget(m_resultsView);
// --- CONTEXT BUTTONS ---
m_searchLocationButton = new ImageButton(":/res/images/search.png",
{
qDebug() << __PRETTY_FUNCTION__;
-// m_resultsHeaderWidget->show();
m_resultsLabel->setText(tr("Search results: %1").arg(locations.count()));
-// m_routeWaypointListView->hide();
-// m_locationListView->show();
m_locationListView->clearList();
for (int i = 0; i < locations.size(); ++i) {
void RoutingPanel::routeButtonToggled(bool checked)
{
+ qDebug() << __PRETTY_FUNCTION__;
+
if (checked) {
routeToSelectedLocation();
m_searchLocationButton->setChecked(false);
void RoutingPanel::searchLocationButtonToggled(bool checked)
{
+ qDebug() << __PRETTY_FUNCTION__;
+
if (checked) {
showResultsView();
emit requestSearchLocation();
} else {
showRoutingView();
-// m_resultsHeaderWidget->hide();
-// m_locationListView->hide();
}
}
{
qDebug() << __PRETTY_FUNCTION__;
-// m_resultsHeaderWidget->hide();
-// m_locationListView->hide();
-// m_routeWaypointListView->show();
-// m_routeWaypointListView->clearList();
+ m_routeWaypointListView->clearList();
QList<RouteSegment> segments = route.segments();
QList<GeoCoordinate> geometryPoints = route.geometryPoints();
m_views->setCurrentWidget(m_routingView);
m_locationListView->clearItemSelection();
-
}
* MEMBER FUNCTIONS AND SLOTS
******************************************************************************/
private:
+ /**
+ * @brief Switch to search results view mode
+ */
void showResultsView();
+ /**
+ * @brief Switch to routing instructions view mode
+ */
void showRoutingView();
private slots:
*/
void populateLocationListView(const QList<Location> &locations);
+ /**
+ * @brief Handler for route button toggling actions
+ */
void routeButtonToggled(bool checked);
/**
*/
void routeToSelectedLocation();
+ /**
+ * @brief Handler for search button toggling actions
+ */
void searchLocationButtonToggled(bool checked);
/**
* DATA MEMBERS
******************************************************************************/
private:
- QLabel *m_resultsLabel; ///< Location list label
+ QLabel *m_resultsLabel; ///< Location list label
- QStackedLayout *m_views;
+ QStackedLayout *m_views; ///< Views
- QWidget *m_resultsView;
- QWidget *m_routingView;
+ QWidget *m_resultsView; ///< Search results view widget
+ QWidget *m_routingView; ///< Routing instructions view widget
ImageButton *m_routeButton; ///< Route to location button
ImageButton *m_searchLocationButton; ///< Search location button
- LocationListView *m_locationListView; ///< Location list view
- RouteWaypointListView *m_routeWaypointListView; ///< Route waypoint list view
+ LocationListView *m_locationListView; ///< Search results list view
+ RouteWaypointListView *m_routeWaypointListView; ///< Route instructions list view
};
#endif // ROUTINGPANEL_H