Added and used a new base class for panels
authorPekka Nissinen <pekka.nissinen@ixonos.com>
Wed, 18 Aug 2010 13:55:37 +0000 (16:55 +0300)
committerPekka Nissinen <pekka.nissinen@ixonos.com>
Wed, 18 Aug 2010 13:55:37 +0000 (16:55 +0300)
src/src.pro
src/ui/friendlistpanel.cpp
src/ui/friendlistpanel.h
src/ui/panelbase.cpp [new file with mode: 0644]
src/ui/panelbase.h [new file with mode: 0644]
src/ui/userinfopanel.cpp
src/ui/userinfopanel.h

index 714164a..c7b9559 100644 (file)
@@ -71,6 +71,7 @@ SOURCES += main.cpp \
     ui/zoombuttonpanel.cpp \
     ui/searchdialog.cpp \
     ui/panelbar.cpp \
+    ui/panelbase.cpp \
     ui/panelcontentstack.cpp \
     ui/paneltab.cpp \
     ui/paneltabbar.cpp \
@@ -146,6 +147,7 @@ HEADERS += application.h \
     ui/listitemdelegate.h \
     ui/searchdialog.h \
     ui/panelbar.h \
+    ui/panelbase.h \
     ui/panelcommon.h \
     ui/panelcontentstack.h \
     ui/paneltab.h \
index 4f8d230..dc492fd 100644 (file)
@@ -38,7 +38,7 @@
 #include "friendlistpanel.h"
 
 FriendListPanel::FriendListPanel(QWidget *parent)
-    : QWidget(parent),
+    : PanelBase(parent),
       m_mainWindowIsTopmost(false),
       m_somePanelIsOpen(false)
 {
index 49d0ccb..8dcbb1d 100644 (file)
@@ -26,7 +26,7 @@
 #ifndef FRIENDLISTPANEL_H
 #define FRIENDLISTPANEL_H
 
-#include <QWidget>
+#include "panelbase.h"
 
 class QLabel;
 class QLineEdit;
@@ -46,7 +46,7 @@ class User;
  * @author Jussi Laitinen - jussi.laitinen (at) ixonos.com
  * @author Sami Rämö - sami.ramo (at) ixonos.com
  */
-class FriendListPanel : public QWidget
+class FriendListPanel : public PanelBase
 {
     Q_OBJECT
 
@@ -202,13 +202,6 @@ signals:
     */
     void routeToFriend(const GeoCoordinate &coordinates);
 
-    /**
-     * @brief Signal for requesting a panel to be opened
-     *
-     * @param widget Pointer to the widget that emitted the signal
-     */
-    void showPanelRequested(QWidget *widget);
-
 /*******************************************************************************
  * DATA MEMBERS
  ******************************************************************************/
diff --git a/src/ui/panelbase.cpp b/src/ui/panelbase.cpp
new file mode 100644 (file)
index 0000000..9f9ef3a
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+    Situare - A location system for Facebook
+    Copyright (C) 2010  Ixonos Plc. Authors:
+
+        Pekka Nissinen - pekka.nissinen@ixonos.com
+
+    Situare is free software; you can redistribute it and/or
+    modify it under the terms of the GNU General Public License
+    version 2 as published by the Free Software Foundation.
+
+    Situare is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with Situare; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,
+    USA.
+*/
+
+#include <QDebug>
+
+#include "panelbase.h"
+
+PanelBase::PanelBase(QWidget *parent)
+    : QWidget(parent)
+{
+    qDebug() << __PRETTY_FUNCTION__;
+}
diff --git a/src/ui/panelbase.h b/src/ui/panelbase.h
new file mode 100644 (file)
index 0000000..086aaf1
--- /dev/null
@@ -0,0 +1,63 @@
+/*
+    Situare - A location system for Facebook
+    Copyright (C) 2010  Ixonos Plc. Authors:
+
+        Pekka Nissinen - pekka.nissinen@ixonos.com
+
+    Situare is free software; you can redistribute it and/or
+    modify it under the terms of the GNU General Public License
+    version 2 as published by the Free Software Foundation.
+
+    Situare is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with Situare; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,
+    USA.
+*/
+
+#ifndef PANELBASE_H
+#define PANELBASE_H
+
+#include <QWidget>
+
+class ImageButton;
+
+/**
+ * @brief Base class for panels
+ *
+ * @author Pekka Nissinen - pekka.nissinen@ixonos.com
+ */
+class PanelBase : public QWidget
+{
+    Q_OBJECT
+
+public:
+    /**
+     * @brief Constructor
+     *
+     * @param parent Parent
+     */
+    PanelBase(QWidget *parent = 0);
+
+/*******************************************************************************
+ * SIGNALS
+ ******************************************************************************/
+signals:
+    /**
+     * @brief Signal for requesting a panel to be opened
+     *
+     * @param widget Pointer to the widget that emitted the signal
+     */
+    void showPanelRequested(QWidget *widget);
+
+/*******************************************************************************
+ * DATA MEMBERS
+ ******************************************************************************/
+protected:
+    QList<ImageButton *> m_contextButtonList;
+};
+#endif // PANELBASE_H
index e68f390..7bf1098 100644 (file)
 #include <QScrollArea>
 #include <QVBoxLayout>
 
+#include "imagebutton.h"
 #include "panelcommon.h"
 #include "userinfo.h"
 
 #include "userinfopanel.h"
 
 UserInfoPanel::UserInfoPanel(QWidget *parent)
-    : QWidget(parent)
+    : PanelBase(parent)
 {
     qDebug() << __PRETTY_FUNCTION__;
 
index df38811..47bdfc9 100644 (file)
@@ -24,8 +24,7 @@
 #ifndef USERPANEL_H
 #define USERPANEL_H
 
-#include <QWidget>
-
+#include "panelbase.h"
 #include "user/user.h"
 
 class UserInfo;
@@ -37,7 +36,7 @@ class UserInfo;
  * @author Katri Kaikkonen - katri.kaikkonen (at) ixonos.com
  * @author Pekka Nissinen - pekka.nissinen (at) ixonos.com
  */
-class UserInfoPanel : public QWidget
+class UserInfoPanel : public PanelBase
 {
     Q_OBJECT