Fixed defects of review
authorKatri Kaikkonen <katri.kaikkonen@ixonos.com>
Mon, 6 Sep 2010 11:44:28 +0000 (14:44 +0300)
committerKatri Kaikkonen <katri.kaikkonen@ixonos.com>
Mon, 6 Sep 2010 11:44:28 +0000 (14:44 +0300)
Reviewed by Sami Rämö

src/ui/friendlistpanel.cpp
src/ui/locationsearchpanel.cpp
src/ui/routingpanel.cpp
src/ui/routingpanel.h

index 316638e..ed887ef 100644 (file)
@@ -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();
     }
index a1c66e7..cea9b09 100644 (file)
@@ -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();
     }
index 6380de2..75d969b 100644 (file)
@@ -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<RouteSegment> segments = route.segments();
     QList<GeoCoordinate> 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();
+    }
+}
index 5d773d2..de29501 100644 (file)
@@ -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
  ******************************************************************************/