Rough implementation of the item related buttons
[situare] / src / ui / locationsearchpanel.cpp
index db8fbb1..b765744 100644 (file)
@@ -62,6 +62,9 @@ LocationSearchPanel::LocationSearchPanel(QWidget *parent)
     connect(m_locationListView, SIGNAL(listItemSelectionChanged()),
             this, SLOT(setRouteButtonDisabled()));
 
+    connect(m_locationListView, SIGNAL(listItemSelectionChanged()),
+            this, SLOT(onListItemSelectionChanged()));
+
     QVBoxLayout *resultsListViewLayout = new QVBoxLayout;
     resultsListViewLayout->setContentsMargins(PANEL_MARGIN_LEFT, PANEL_MARGIN_TOP,
                                        PANEL_MARGIN_RIGHT, PANEL_MARGIN_BOTTOM);
@@ -80,19 +83,18 @@ LocationSearchPanel::LocationSearchPanel(QWidget *parent)
     panelLayout->addLayout(resultsListViewLayout);
 
     // --- CONTEXT BUTTONS ---
+    m_routeButton = new ImageButton(":res/images/compass.png", "", "", this);
+    m_routeButton->setDisabled(true);
+    connect(m_routeButton, SIGNAL(clicked()),
+            this, SLOT(routeToSelectedLocation()));
+
     ImageButton *searchLocationButton = new ImageButton(":/res/images/search.png",
                                                         ":/res/images/search_s.png", "", this);
     connect(searchLocationButton, SIGNAL(clicked()),
             this, SIGNAL(requestSearchLocation()));
 
-    m_routeButton = new ImageButton(":res/images/route_to_location.png",
-                                    ":res/images/route_to_location_s.png", "", this);
-    m_routeButton->setDisabled(true);
-    connect(m_routeButton, SIGNAL(clicked()),
-            this, SLOT(routeToSelectedLocation()));
-
-    m_contextButtonLayout->addWidget(searchLocationButton);
-    m_contextButtonLayout->addWidget(m_routeButton);
+    m_itemButtonsLayout->addWidget(m_routeButton);
+    m_genericButtonsLayout->addWidget(searchLocationButton);
 }
 
 void LocationSearchPanel::clearListsSelections()