Merge branch 'master' into new_panels_with_context_buttons
[situare] / src / ui / userinfopanel.cpp
index e68f390..2c48092 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__;
 
@@ -66,20 +67,36 @@ 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(statusUpdate(QString,bool)),
-            this, SIGNAL(statusUpdate(QString,bool)));
+    connect(m_userInfo, SIGNAL(notificateUpdateFailing(QString, bool)),
+             this, SIGNAL(notificateUpdateFailing(QString, bool)));
 
-    connect(m_userInfo, SIGNAL(refreshUserData()),
-            this, SIGNAL(refreshUserData()));
+    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)));
+    connect(this, SIGNAL(collapse()),
+            m_userInfo, SLOT(collapse()));
+
+    ImageButton *updateFriendsButton = new ImageButton(":/res/images/refresh.png",
+                                                       ":/res/images/refresh_s.png",
+                                                       "", this);
+    ImageButton *updateStatusMessageButton = new ImageButton(":/res/images/send_position.png",
+                                                             ":/res/images/send_position_s.png",
+                                                             "", this);
+
+    m_contextButtonLayout->addWidget(updateFriendsButton);
+    m_contextButtonLayout->addWidget(updateStatusMessageButton);
+
+    connect(updateFriendsButton, SIGNAL(clicked()),
+            this, SIGNAL(refreshUserData()));
+
+    connect(updateStatusMessageButton, SIGNAL(clicked()),
+            m_userInfo, SLOT(messageUpdate()));
 }
 
 void UserInfoPanel::userDataReceived(User *user)