Merge branch 'new_panels_with_context_buttons' of https://vcs.maemo.org/git/situare...
[situare] / src / ui / routingpanel.cpp
index 1455ff6..9662506 100644 (file)
@@ -29,15 +29,15 @@ RoutingPanel::RoutingPanel(QWidget *parent)
     listViewLayout->setContentsMargins(PANEL_MARGIN_LEFT, PANEL_MARGIN_TOP,
                                        PANEL_MARGIN_RIGHT, PANEL_MARGIN_BOTTOM);
 
-    ImageButton *searchLocationButton = new ImageButton(0, ":/res/images/search.png",
-                                                             ":/res/images/search_s.png");
+    ImageButton *searchLocationButton = new ImageButton(":/res/images/search.png",
+                                                        ":/res/images/search_s.png",
+                                                        "", this);
 
-    m_contextButtonList.append(searchLocationButton);
+    m_contextButtonLayout->addWidget(searchLocationButton, 0, 0);
 
-    m_routeButton = new ImageButton(this, ":res/images/route_to_location.png",
-                                    ":res/images/route_to_location_s.png");
+    m_routeButton = new ImageButton(":res/images/route_to_location.png",
+                                    ":res/images/route_to_location_s.png", "", this);
     m_routeButton->setDisabled(true);
-    m_routeButton->hide();
 
     m_locationListHeaderWidget = new QWidget();
     m_locationListHeaderWidget->setLayout(headerLayout);
@@ -62,7 +62,6 @@ RoutingPanel::RoutingPanel(QWidget *parent)
     listViewLayout->addWidget(m_locationListView);
     listViewLayout->addWidget(m_routeWaypointListView);
 
-    routingLayout->addWidget(m_routeButton);
     routingLayout->addWidget(m_locationListHeaderWidget);
     routingLayout->addLayout(listViewLayout);
 
@@ -84,7 +83,7 @@ RoutingPanel::RoutingPanel(QWidget *parent)
             this, SIGNAL(requestSearchLocation()));
 
     // CONTEXT BUTTONS
-    m_contextButtonList.append(m_routeButton);
+    m_contextButtonLayout->addWidget(m_routeButton, 1, 0);
 }
 
 void RoutingPanel::clearListsSelections()
@@ -110,8 +109,6 @@ 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()));
 
@@ -153,8 +150,6 @@ void RoutingPanel::setRoute(Route &route)
 {
     qDebug() << __PRETTY_FUNCTION__;
 
-    m_routeButton->hide();
-
     m_locationListHeaderWidget->hide();
     m_locationListView->hide();
     m_routeWaypointListView->show();