Begun to relocating buttons from UserInfo class to UserInfoPanel
authorPekka Nissinen <pekka.nissinen@ixonos.com>
Wed, 18 Aug 2010 13:57:26 +0000 (16:57 +0300)
committerPekka Nissinen <pekka.nissinen@ixonos.com>
Wed, 18 Aug 2010 13:57:26 +0000 (16:57 +0300)
src/ui/userinfo.cpp
src/ui/userinfo.h
src/ui/userinfopanel.cpp

index 7fd54e1..102660e 100644 (file)
@@ -68,10 +68,6 @@ UserInfo::UserInfo(QWidget *parent)
     infoLayout->setMargin(0);
     infoLayout->setSpacing(0);
 
-    QHBoxLayout *buttonLayout = new QHBoxLayout();
-    buttonLayout->setMargin(0);
-    buttonLayout->setSpacing(0);
-
     QLabel *envelopeLabel = new QLabel();
     envelopeLabel->setPixmap(QPixmap(":/res/images/envelope.png"));
     envelopeLabel->setContentsMargins(0, 0, MARGIN, 0);
@@ -97,14 +93,6 @@ UserInfo::UserInfo(QWidget *parent)
     m_updatedLabel = new QLabel();
     m_updatedLabel->setWordWrap(true);
 
-    ImageButton *updateFriendsButton = new ImageButton(this, ":/res/images/refresh.png",
-                                                             ":/res/images/refresh_s.png");
-    ImageButton *updateStatusMessageButton = new ImageButton(this, ":/res/images/send_position.png",
-                                                                   ":/res/images/send_position_s.png");
-
-    buttonLayout->addWidget(updateFriendsButton);
-    buttonLayout->addWidget(updateStatusMessageButton);
-
     infoLayout->addRow(envelopeLabel, m_statusTextLabel);
     infoLayout->addRow(compassLabel, m_locationLabel);
     infoLayout->addRow(clockLabel, m_updatedLabel);
@@ -112,13 +100,6 @@ UserInfo::UserInfo(QWidget *parent)
     verticalLayout->addWidget(m_findButton, 0, Qt::AlignHCenter);
     verticalLayout->addWidget(m_nameLabel, 0, Qt::AlignHCenter);
     verticalLayout->addLayout(infoLayout);
-    verticalLayout->addLayout(buttonLayout);
-
-    connect(updateStatusMessageButton,SIGNAL(clicked()),
-            this,SLOT(messageUpdate()));
-
-    connect(updateFriendsButton,SIGNAL(clicked()),
-            this, SIGNAL(refreshUserData()));
 
     connect(m_findButton, SIGNAL(clicked()),
             this, SLOT(findButtonClicked()));
index de62847..7a90a64 100644 (file)
@@ -201,11 +201,6 @@ signals:
     void notificateUpdateFailing(const QString &message, bool modal);
 
     /**
-     * @brief Signal for refreshing user data.
-     */
-    void refreshUserData();
-
-    /**
      * @brief Signal for requesting reverseGeo from SituareEngine
      */
     void requestReverseGeo();
index 7bf1098..db35d46 100644 (file)
@@ -67,20 +67,31 @@ UserInfoPanel::UserInfoPanel(QWidget *parent)
     connect(m_userInfo,SIGNAL(requestReverseGeo()),
             this, SIGNAL(requestReverseGeo()));
 
-    connect(this, SIGNAL(reverseGeoReady(QString)),
-            m_userInfo, SIGNAL(reverseGeoReady(QString)));
-
     connect(m_userInfo, SIGNAL(statusUpdate(QString,bool)),
             this, SIGNAL(statusUpdate(QString,bool)));
 
-    connect(m_userInfo, SIGNAL(refreshUserData()),
-            this, SIGNAL(refreshUserData()));
+    connect(m_userInfo, SIGNAL(notificateUpdateFailing(QString, bool)),
+             this, SIGNAL(notificateUpdateFailing(QString, bool)));
+
+    connect(this, SIGNAL(reverseGeoReady(QString)),
+            m_userInfo, SIGNAL(reverseGeoReady(QString)));
 
     connect(this, SIGNAL(clearUpdateLocationDialogData()),
             m_userInfo, SLOT(clearUpdateLocationDialogData()));
 
-    connect(m_userInfo, SIGNAL(notificateUpdateFailing(QString, bool)),
-             this, SIGNAL(notificateUpdateFailing(QString, bool)));
+    ImageButton *updateFriendsButton = new ImageButton(this, ":/res/images/refresh.png",
+                                                             ":/res/images/refresh_s.png");
+    ImageButton *updateStatusMessageButton = new ImageButton(this, ":/res/images/send_position.png",
+                                                                   ":/res/images/send_position_s.png");
+
+    m_contextButtonList.append(updateFriendsButton);
+    m_contextButtonList.append(updateStatusMessageButton);
+
+    connect(updateFriendsButton, SIGNAL(clicked()),
+            this, SIGNAL(refreshUserData()));
+
+    connect(updateStatusMessageButton, SIGNAL(clicked()),
+            m_userInfo, SLOT(messageUpdate()));
 }
 
 void UserInfoPanel::userDataReceived(User *user)