Commented new code and fixed some of the old
authorKaj Wallin <kaj.wallin@ixonos.com>
Fri, 21 May 2010 07:07:15 +0000 (10:07 +0300)
committerKaj Wallin <kaj.wallin@ixonos.com>
Fri, 21 May 2010 07:07:15 +0000 (10:07 +0300)
Reviewed by:

src/ui/panelsidebar.h
src/ui/panelsliderbar.h
src/ui/sidepanel.cpp
src/ui/sidepanel.h
src/ui/userpanel.h

index 0550b64..c22bdac 100644 (file)
@@ -42,7 +42,7 @@ public:
     * @param parent Parent
     * @param side Qstring for the sidebar location. Accepts "left" and "right"
     */
-    PanelSideBar(QWidget *parent, Side side);
+    PanelSideBar(QWidget *parent = 0, Side side = LEFT);
 
 /*******************************************************************************
  * BASE CLASS INHERITED AND REIMPLEMENTED MEMBER FUNCTIONS
index fb24e65..fed9220 100644 (file)
@@ -29,6 +29,7 @@
 /**
 * @brief Generic class from drawing sliding bar attached to panels
 *
+* @author Kaj Wallin - kaj.wallin (at) ixonos.com
 * @class PanelSliderBar panelsliderbar.h "ui/panelsliderbar.h"
 */
 class PanelSliderBar : public QWidget
index 009030c..c4129a7 100644 (file)
@@ -22,6 +22,7 @@
 
 #include "sidepanel.h"
 #include "panelsliderbar.h"
+#include "panelsidebar.h"
 
 SidePanel::SidePanel(QWidget *parent) :
     QWidget(parent)
@@ -151,12 +152,12 @@ void SidePanel::setType(SidePanel::PanelType type)
 
 void SidePanel::stateChangedToClosed()
 {
-    qWarning() << __PRETTY_FUNCTION__;
+    qDebug() << __PRETTY_FUNCTION__;
     isOpen = false;
 }
 
 void SidePanel::stateChangedToOpen()
 {
-    qWarning() << __PRETTY_FUNCTION__;
+    qDebug() << __PRETTY_FUNCTION__;
     isOpen = true;
 }
index 2df3788..7d2dbd9 100644 (file)
 class PanelSideBar;
 class PanelSliderBar;
 
+/**
+* @brief Base class for sliding side panels
+*
+* @author Kaj Wallin - kaj.wallin (at) ixonos.com
+* @class SidePanel sidepanel.h "ui/sidepanel.h"
+*/
 class SidePanel : public QWidget
 {
     Q_OBJECT
 public:
+    /**
+    * @brief
+
+    * @param parent
+    */
     SidePanel(QWidget *parent);
 
+    /**
+    * @brief Enumerator for the panel type
+    * Defines values: UserPanel, FriendsPanel
+    *
+    * @sa setType
+    */
     enum PanelType {UserPanel, FriendsPanel};
 /******************************************************************************
  * MEMBER FUNCTIONS AND SLOTS
  ******************************************************************************/
 public slots:
+    /**
+    * @brief Public slot that will open the panel unless already open
+    */
     void openPanel();
+
+    /**
+    * @brief Public slot that will close the panel unless already closed
+    */
     void closePanel();
+
     /**
     * @brief Slot to redraw the panel after window resize event
     *
@@ -50,17 +75,39 @@ public slots:
     */
     void screenResized(const QSize &size);
 
+    /**
+    * @brief Type setter for the panel. Also sets panel visible
+    *
+    * Use to set panel type as UserPanel or FriendsPanel. Panel type determines
+    * which side the panel will be rendered. UserPanel will always be rendered
+    * on the left side of the screen and FriendsPanel on the right side.
+    *
+    * @param type Type of the panel, either UserPanel or FriendsPanel
+    * @sa PanelType
+    */
     void setType(SidePanel::PanelType type);
 
 
 private slots:
+    /**
+    * @brief Internal slot used to track statemachine state
+    */
     void stateChangedToClosed();
+    /**
+    * @brief Internal slot used to track statemachine state
+    */
     void stateChangedToOpen();
 
 /******************************************************************************
  * SIGNALS
  ******************************************************************************/
 signals:
+    /**
+    * @brief Signal that is sent to state machine when state must be changed
+    *
+    * @sa openPanel
+    * @sa closePanel
+    */
     void toggleState();
 
 /*******************************************************************************
@@ -70,7 +117,7 @@ protected:
     QVBoxLayout *m_panelVBox; ///< Vertical layout inside the panel
 
 private:
-    bool isOpen;
+    bool isOpen; ///< Boolean used to tranch the current state of the statemachine
     QSignalTransition *m_panelTransitionClose; ///< Transition signal for closing the panel
     QSignalTransition *m_panelTransitionOpen; ///< Transition signal for opening the panel
     QState *m_panelStateClosed; ///< State of the closed panel
@@ -78,7 +125,7 @@ private:
     QStateMachine *m_panelStateMachine; ///< State machine for sliding the panel
     QWidget *m_panelBase; ///< Widget for panel base
 
-    PanelType currentType;
+    PanelType currentType; ///< Holder for the type of this panel
     PanelSideBar *userPanelSidebar; ///< Overlaying widget for sidebar
     PanelSliderBar *m_panelSlidingBar; ///< Widget for sidebar tab item
 };
index d002be3..13541e2 100644 (file)
@@ -91,6 +91,6 @@ signals:
  * DATA MEMBERS
  ******************************************************************************/
 private:
-    UserInfo *m_userInfo;
+    UserInfo *m_userInfo; ///< Instance of the user info view
 };
 #endif // USERPANEL_H