From: Katri Kaikkonen Date: Mon, 6 Sep 2010 11:44:28 +0000 (+0300) Subject: Fixed defects of review X-Git-Tag: v2.0b-1~12 X-Git-Url: http://vcs.maemo.org/git/?p=situare;a=commitdiff_plain;h=1360867207a7def91afabc51076da74cb63e61e6 Fixed defects of review Reviewed by Sami Rämö --- diff --git a/src/ui/friendlistpanel.cpp b/src/ui/friendlistpanel.cpp index 316638e..ed887ef 100644 --- a/src/ui/friendlistpanel.cpp +++ b/src/ui/friendlistpanel.cpp @@ -115,7 +115,7 @@ FriendListPanel::FriendListPanel(QWidget *parent) setLayout(friendListPanelLayout); m_noFriendsLabel = new QLabel(); - m_noFriendsLabel->setText("No Friends"); + m_noFriendsLabel->setText("No friends"); m_noFriendsLabel->setAlignment(Qt::AlignCenter); QPalette noFriendsPalette = palette(); @@ -314,7 +314,7 @@ void FriendListPanel::showEvent(QShowEvent *event) void FriendListPanel::showEmptyPanel(bool show) { - if (show){ + if (show) { m_noFriendsLabel->show(); m_friendListView->hide(); } diff --git a/src/ui/locationsearchpanel.cpp b/src/ui/locationsearchpanel.cpp index a1c66e7..cea9b09 100644 --- a/src/ui/locationsearchpanel.cpp +++ b/src/ui/locationsearchpanel.cpp @@ -93,7 +93,7 @@ LocationSearchPanel::LocationSearchPanel(QWidget *parent) panelLayout->setContentsMargins(MARGIN_LEFT, PANEL_MARGIN_TOP, PANEL_MARGIN_RIGHT, PANEL_MARGIN_BOTTOM); m_noSearchLabel = new QLabel(); - m_noSearchLabel->setText("No Search Results"); + m_noSearchLabel->setText("No search results"); m_noSearchLabel->setAlignment(Qt::AlignCenter); QPalette m_noSearchPalette = palette(); @@ -234,7 +234,7 @@ void LocationSearchPanel::routeToSelectedLocation() void LocationSearchPanel::showEmptyPanel(bool show) { - if (show){ + if (show) { m_noSearchLabel->show(); m_searchHistoryListView->hide(); } diff --git a/src/ui/routingpanel.cpp b/src/ui/routingpanel.cpp index 6380de2..75d969b 100644 --- a/src/ui/routingpanel.cpp +++ b/src/ui/routingpanel.cpp @@ -51,7 +51,7 @@ RoutingPanel::RoutingPanel(QWidget *parent) PANEL_MARGIN_RIGHT, PANEL_MARGIN_BOTTOM); m_noRouteLabel = new QLabel(); - m_noRouteLabel->setText("No Route"); + m_noRouteLabel->setText("No route"); m_noRouteLabel->setAlignment(Qt::AlignCenter); QPalette noRoutePalette = palette(); @@ -60,7 +60,6 @@ RoutingPanel::RoutingPanel(QWidget *parent) panelLayout->addWidget(m_routeWaypointListView); panelLayout->addWidget(m_noRouteLabel, Qt::AlignCenter); - m_routeWaypointListView->hide(); setLayout(panelLayout); // --- CONTEXT BUTTONS --- @@ -77,6 +76,8 @@ RoutingPanel::RoutingPanel(QWidget *parent) m_genericButtonsLayout->addWidget(routeToCursorButton); m_genericButtonsLayout->addWidget(m_clearRouteButton); + + showEmptyPanel(true); } void RoutingPanel::clearListsSelections() @@ -93,7 +94,7 @@ void RoutingPanel::clearRouteButtonClicked() m_clearRouteButton->setDisabled(true); m_routeWaypointListView->clearList(); m_routeWaypointListView->hide(); - m_noRouteLabel->show(); + showEmptyPanel(true); emit clearRoute(); } @@ -111,7 +112,7 @@ void RoutingPanel::setRoute(Route &route) qDebug() << __PRETTY_FUNCTION__; m_routeWaypointListView->clearList(); - m_noRouteLabel->hide(); + showEmptyPanel(false); QList segments = route.segments(); QList geometryPoints = route.geometryPoints(); @@ -132,3 +133,14 @@ void RoutingPanel::setRoute(Route &route) emit openPanelRequested(this); } + +void RoutingPanel::showEmptyPanel(bool show) +{ + if (show) { + m_noRouteLabel->show(); + m_routeWaypointListView->hide(); + } + else { + m_noRouteLabel->hide(); + } +} diff --git a/src/ui/routingpanel.h b/src/ui/routingpanel.h index 5d773d2..de29501 100644 --- a/src/ui/routingpanel.h +++ b/src/ui/routingpanel.h @@ -87,6 +87,13 @@ private slots: */ void setRoute(Route &route); + /** + * @brief show / hide empty panel label + * + * @param show true if empty panel should be shown + */ + void showEmptyPanel(bool show); + /******************************************************************************* * SIGNALS ******************************************************************************/