Changed the names of panel opening slots and signals into "more" appropriate ones
authorPekka Nissinen <pekka.nissinen@ixonos.com>
Sun, 29 Aug 2010 19:35:02 +0000 (22:35 +0300)
committerPekka Nissinen <pekka.nissinen@ixonos.com>
Sun, 29 Aug 2010 19:35:02 +0000 (22:35 +0300)
src/ui/friendlistpanel.cpp
src/ui/mainwindow.cpp
src/ui/panelbase.h
src/ui/tabbedpanel.cpp
src/ui/tabbedpanel.h

index 4b62e3f..9c1b6c9 100644 (file)
@@ -297,7 +297,7 @@ void FriendListPanel::showFriendsInList(const QList<QString> &userIDs)
 
     clearTextFiltering();
 
-    emit showPanelRequested(this);
+    emit openPanelRequested(this);
 }
 
 void FriendListPanel::topmostWindowChanged(bool mainWindowIsTopmost)
index 576c238..0d4c574 100644 (file)
@@ -331,11 +331,11 @@ void MainWindow::buildPanels()
     connect(m_mapView, SIGNAL(viewResized(QSize)),
             m_tabbedPanel, SLOT(resizePanel(QSize)));
 
-    connect(m_friendsListPanel, SIGNAL(showPanelRequested(QWidget*)),
-            m_tabbedPanel, SLOT(showPanel(QWidget*)));
+    connect(m_friendsListPanel, SIGNAL(openPanelRequested(QWidget*)),
+            m_tabbedPanel, SLOT(openPanel(QWidget*)));
 
-    connect(m_routingPanel, SIGNAL(showPanelRequested(QWidget*)),
-            m_tabbedPanel, SLOT(showPanel(QWidget*)));
+    connect(m_routingPanel, SIGNAL(openPanelRequested(QWidget*)),
+            m_tabbedPanel, SLOT(openPanel(QWidget*)));
 
     connect(m_tabbedPanel, SIGNAL(panelClosed()),
             m_friendsListPanel, SLOT(anyPanelClosed()));
index deeaa08..c226f57 100644 (file)
@@ -65,7 +65,7 @@ signals:
      *
      * @param widget Pointer to the widget that emitted the signal
      */
-    void showPanelRequested(QWidget *widget);
+    void openPanelRequested(QWidget *widget);
 
 /*******************************************************************************
  * DATA MEMBERS
index 11afa8d..2c69d38 100644 (file)
@@ -38,7 +38,7 @@ const int PANEL_CONTEXT_BUTTON_BAR_LEFT_X = 1;
 
 TabbedPanel::TabbedPanel(QWidget *parent)
     : QWidget(parent),
-      m_isOpen(false)
+      m_open(false)
 {
     qDebug() << __PRETTY_FUNCTION__;
 
@@ -121,7 +121,7 @@ void TabbedPanel::closePanel()
 {
     qDebug() << __PRETTY_FUNCTION__;
 
-    if (m_isOpen)
+    if (m_open)
         emit toggleState();
 }
 
@@ -135,6 +135,13 @@ int TabbedPanel::insertTab(int index, QWidget *widget, const QIcon& icon)
     return index;
 }
 
+void TabbedPanel::openPanel(QWidget *widget)
+{
+    qDebug() << __PRETTY_FUNCTION__;
+
+    m_panelTabBar->selectTab(m_panelContentStack->indexOf(widget));
+}
+
 void TabbedPanel::removeTab(int index)
 {
     qDebug() << __PRETTY_FUNCTION__;
@@ -160,7 +167,7 @@ void TabbedPanel::resizePanel(const QSize &size)
     resize(PANEL_BAR_TABBED_WIDTH + PANEL_WIDTH,
            size.height() - PANEL_TOP_PADDING - PANEL_BOTTOM_PADDING);
 
-    if (!m_isOpen)
+    if (!m_open)
         move(size.width() - PANEL_TAB_WIDTH - PANEL_BAR_WIDTH, PANEL_TOP_PADDING);
     else
         move(size.width() - PANEL_TAB_WIDTH - PANEL_BAR_WIDTH - PANEL_WIDTH, PANEL_TOP_PADDING);
@@ -187,7 +194,7 @@ void TabbedPanel::setCurrentIndex(int index)
     if ((index < m_panelContentStack->count()) && (index >= 0)) {
         m_panelContentStack->setCurrentIndex(index);
 
-        if (!m_isOpen)
+        if (!m_open)
             emit toggleState();
 
         m_panelContextButtonBar->setContextButtons(
@@ -197,23 +204,16 @@ void TabbedPanel::setCurrentIndex(int index)
     }
 }
 
-void TabbedPanel::showPanel(QWidget *widget)
-{
-    qDebug() << __PRETTY_FUNCTION__;
-
-    m_panelTabBar->selectTab(m_panelContentStack->indexOf(widget));
-}
-
 void TabbedPanel::stateChanged()
 {
     qDebug() << __PRETTY_FUNCTION__;
 
-    if (!m_isOpen) {
-        m_isOpen = true;
+    if (!m_open) {
+        m_open = true;
         m_panelContextButtonBar->setVisible(true);
         emit panelOpened();
     } else {
-        m_isOpen = false;
+        m_open = false;
         m_panelContextButtonBar->setVisible(false);
         emit panelClosed();
     }
index 58dbb17..aaeb990 100644 (file)
@@ -102,11 +102,13 @@ public slots:
     void closePanel();
 
     /**
-     * @brief Slot that shows the tab (and opens it if closed) with the desired widget
+     * @brief Slot that opens the panel
+     *
+     * If widget pointer is provided the corresponding tab is also set active
      *
      * @param widget Widget
      */
-    void showPanel(QWidget *widget);
+    void openPanel(QWidget *widget = 0);
 
     /**
      * @brief Slot to redraw the panel after window resize event
@@ -129,7 +131,7 @@ private slots:
     void setCurrentIndex(int index);
 
     /**
-     * @brief Internal slot used to track statemachine state
+     * @brief Internal slot used to set the panel state
      */
     void stateChanged();
 
@@ -161,7 +163,7 @@ signals:
     void panelOpened();
 
     /**
-     * @brief Signal that is sent to state machine when panel state must be changed
+     * @brief Signal that is sent when the panel state must be changed
      *
      * @sa openPanel
      * @sa closePanel
@@ -172,7 +174,7 @@ signals:
  * DATA MEMBERS
  ******************************************************************************/
 private:
-    bool m_isOpen;      ///< Boolean used to track the current state of the statemachine
+    bool m_open;                                    ///< Current state of the panel
 
     QPropertyAnimation *m_panelAnimation;           ///< Animation for panel state changes