connect(m_routingPanel, SIGNAL(routeWaypointItemClicked(GeoCoordinate)),
this, SIGNAL(centerToCoordinates(GeoCoordinate)));
+
+ connect(m_routingPanel, SIGNAL(requestSearchLocation()),
+ this, SLOT(startLocationSearch()));
}
void MainWindow::buildUserInfoPanel()
connect(m_gpsToggleAct, SIGNAL(triggered(bool)),
this, SIGNAL(gpsTriggered(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_searchLocationAct); /// @todo remove when not needed!
m_viewMenu->setObjectName(tr("Menu"));
}
QAction *m_gpsToggleAct; ///< Action to trigger gps toggle
QAction *m_loginAct; ///< Action to Login/Logout
QAction *m_toSettingsAct; ///< Action to trigger switch to settings dialog
- QAction *m_searchLocationAct; /// @todo this is temporary, remove when not needed!
QLabel *m_osmLicense; ///< Label for Open Street Map license
QLabel *m_ownLocationCrosshair; ///< Label that show ownLocationCrosshair
} else if (turnType == "TU") {
setImage(AvatarImage::create(QPixmap(":/res/images/arrow_turn_u_turn.png"),
AvatarImage::Small));
- } else if (turnType == "EXIT") {
+ } else if (turnType.startsWith("EXIT")) {
setImage(AvatarImage::create(QPixmap(":/res/images/arrow_turn_roundabout.png"),
AvatarImage::Small));
} else
* @brief Set route waypoint data for this item.
*
* @param routeSegment RouteSegment data
- * @param coordinates GeoCoordinate
+ * @param coordinate GeoCoordinate
*/
void setRouteWaypointData(const RouteSegment &routeSegment,
const GeoCoordinate &coordinate);
private:
+ /**
+ * @brief Sets item's turn type image.
+ *
+ * @param turnType turn type defined in RouteSegment class.
+ */
void setTurnTypeImage(const QString &turnType);
/******************************************************************************
QVBoxLayout *listViewLayout = new QVBoxLayout;
listViewLayout->setContentsMargins(PANEL_MARGIN_LEFT, 0, PANEL_MARGIN_RIGHT, 0);
+ m_searchLocationButton = new QPushButton("Search location");
+
m_routeButton = new QPushButton("Route to location");
+ m_routeButton->hide();
m_locationListHeaderWidget = new QWidget();
m_locationListHeaderWidget->setLayout(headerLayout);
listViewLayout->addWidget(m_locationListView);
listViewLayout->addWidget(m_routeWaypointListView);
+ routingLayout->addWidget(m_searchLocationButton);
routingLayout->addWidget(m_routeButton);
routingLayout->addWidget(m_locationListHeaderWidget);
routingLayout->addLayout(listViewLayout);
connect(m_routeWaypointListView, SIGNAL(routeWaypointItemClicked(GeoCoordinate)),
this, SIGNAL(routeWaypointItemClicked(GeoCoordinate)));
+
+ connect(m_searchLocationButton, SIGNAL(clicked()),
+ this, SIGNAL(requestSearchLocation()));
}
void RoutingPanel::populateLocationListView(const QList<Location> &locations)
{
qDebug() << __PRETTY_FUNCTION__;
+ m_routeButton->show();
+
m_locationListHeaderWidget->show();
m_locationListLabel->setText(tr("Search results: %1").arg(locations.count()));
void locationItemClicked(const GeoCoordinate &swBound, const GeoCoordinate &neBound);
/**
+ * @brief Signal for requesting searching location.
+ */
+ void requestSearchLocation();
+
+ /**
* @brief Signal for routing to location.
*
* @param coordinates location's geo coordinates
*/
void routeToLocation(const GeoCoordinate &coordinates);
+ /**
+ * @brief Signal for route waypoint item clicked.
+ *
+ * @param coordinate waypoint item's coordinate
+ */
void routeWaypointItemClicked(const GeoCoordinate &coordinate);
/*******************************************************************************
QLabel *m_locationListLabel; ///< Location list label
QPushButton *m_routeButton; ///< Route to location button
+ QPushButton *m_searchLocationButton; ///< Search location button
QWidget *m_locationListHeaderWidget; ///< Location list header widget