Merge branch 'new_panels_with_context_buttons' of https://vcs.maemo.org/git/situare...
authorSami Rämö <sami.ramo@ixonos.com>
Wed, 25 Aug 2010 07:45:33 +0000 (10:45 +0300)
committerSami Rämö <sami.ramo@ixonos.com>
Wed, 25 Aug 2010 10:02:59 +0000 (13:02 +0300)
 - Also fixed the routing panel buttons

1  2 
src/ui/friendlistpanel.cpp
src/ui/routingpanel.cpp

@@@ -63,8 -62,7 +63,8 @@@ FriendListPanel::FriendListPanel(QWidge
      m_friendListHeaderWidget->setLayout(filterLayout);
      m_friendListHeaderWidget->setAutoFillBackground(true);
  
-     m_routeButton = new ImageButton(this, ":res/images/route_to_friend.png",
-                                     ":res/images/route_to_friend_s.png");
 -    m_routeButton = new QPushButton(tr("Route to friend"));
++    m_routeButton = new ImageButton(":res/images/route_to_friend.png",
++                                    ":res/images/route_to_friend_s.png", "", this);
      m_routeButton->setDisabled(true);
  
      QPalette labelPalette = m_friendListHeaderWidget->palette();
      m_friendListHeaderWidget->setPalette(labelPalette);
      m_friendListHeaderWidget->hide();
      m_friendListLabel = new QLabel(this);
-     m_clearFilterButton = new ImageButton(this, ":res/images/filtered.png",
-                                           ":res/images/filtered_s.png");
 -    m_clearFilterButton = new QPushButton(tr("Show all"));
++    m_clearFilterButton = new ImageButton(":res/images/filtered.png",
++                                          ":res/images/filtered_s.png", "", this);
 +
 +    m_clearFilterButton->setCheckable(true);
  
      filterLayout->addWidget(m_friendListLabel);
      filterLayout->addWidget(m_clearFilterButton);
  
      connect(qApp, SIGNAL(topmostWindowChanged(bool)),
              this, SLOT(topmostWindowChanged(bool)));
 +
 +    // CONTEXT BUTTONS
-     m_contextButtonList.append(m_routeButton);
-     m_contextButtonList.append(m_clearFilterButton);
++    m_contextButtonLayout->addWidget(m_routeButton, 0, 0);
++    m_contextButtonLayout->addWidget(m_clearFilterButton, 1, 0);
  }
  
  void FriendListPanel::anyPanelClosed()
@@@ -29,15 -29,15 +29,15 @@@ RoutingPanel::RoutingPanel(QWidget *par
      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 QPushButton(tr("Route to location"));
++    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,7 +62,6 @@@
      listViewLayout->addWidget(m_locationListView);
      listViewLayout->addWidget(m_routeWaypointListView);
  
--    routingLayout->addWidget(m_routeButton);
      routingLayout->addWidget(m_locationListHeaderWidget);
      routingLayout->addLayout(listViewLayout);
  
@@@ -82,9 -82,6 +81,9 @@@
  
      connect(searchLocationButton, SIGNAL(clicked()),
              this, SIGNAL(requestSearchLocation()));
 +
 +    // CONTEXT BUTTONS
-     m_contextButtonList.append(m_routeButton);
++    m_contextButtonLayout->addWidget(m_routeButton, 1, 0);
  }
  
  void RoutingPanel::clearListsSelections()
@@@ -110,8 -107,8 +109,6 @@@ void RoutingPanel::populateLocationList
  {
      qDebug() << __PRETTY_FUNCTION__;
  
--    m_routeButton->show();
--
      m_locationListHeaderWidget->show();
      m_locationListLabel->setText(tr("Search results: %1").arg(locations.count()));
  
@@@ -153,8 -150,8 +150,6 @@@ void RoutingPanel::setRoute(Route &rout
  {
      qDebug() << __PRETTY_FUNCTION__;
  
--    m_routeButton->hide();
--
      m_locationListHeaderWidget->hide();
      m_locationListView->hide();
      m_routeWaypointListView->show();