From 25362c02584ce613d4b121fb80411a0ffbe49495 Mon Sep 17 00:00:00 2001 From: Kaj Wallin Date: Fri, 30 Apr 2010 09:55:23 +0300 Subject: [PATCH] Changed InfoTab from public to private and made proper changes to signals Reviewed by: --- images.qrc | 1 - src/ui/listviewscreen.cpp | 12 ++++-------- src/ui/listviewscreen.h | 17 +++++++++-------- src/ui/mainwindow.cpp | 4 ++-- 4 files changed, 15 insertions(+), 19 deletions(-) diff --git a/images.qrc b/images.qrc index 246a602..0f0ce86 100644 --- a/images.qrc +++ b/images.qrc @@ -25,6 +25,5 @@ res/images/led_red_g.png res/images/led_red_h.png res/images/led_red_s.png - res/images/indicator_update1.png diff --git a/src/ui/listviewscreen.cpp b/src/ui/listviewscreen.cpp index 7d89b82..a23ac98 100644 --- a/src/ui/listviewscreen.cpp +++ b/src/ui/listviewscreen.cpp @@ -195,7 +195,10 @@ ListViewScreen::ListViewScreen(QWidget *parent) m_vbox->addWidget(view); m_vbox->setMargin(0); -// connect(m_personalInfo,SIGNAL(launchMessageUpdate()),this,SLOT(updateMessage())); + connect(m_personalInfo,SIGNAL(launchMessageUpdate()), + this,SIGNAL(launchUpdateDialog())); + connect(m_personalInfo,SIGNAL(launchUpdateFriendsStatus()), + this, SIGNAL(updateFriendsData())); setObjectName("List view"); } @@ -226,13 +229,6 @@ ListViewScreen::~ListViewScreen() delete m_vbox; } -void ListViewScreen::updateMessage() -{ - qDebug() << __PRETTY_FUNCTION__; - - m_locationDialog->exec(); -} - void ListViewScreen::userDataChanged(User *user, QList &friends) { qDebug() << __PRETTY_FUNCTION__; diff --git a/src/ui/listviewscreen.h b/src/ui/listviewscreen.h index c1a388c..e407b6e 100644 --- a/src/ui/listviewscreen.h +++ b/src/ui/listviewscreen.h @@ -57,23 +57,24 @@ public: * MEMBER FUNCTIONS AND SLOTS ******************************************************************************/ public slots: - /** - * @brief Slot to open Location update dialog - */ - void updateMessage(); - void userDataChanged(User* user,QList& friends); signals: void toggleProgressIndicator(bool state); + /** + * @brief Forwarding signal from InfoTab to parent to open update dialog + */ + void launchUpdateDialog(); + /** + * @brief Forwarding signal from InfoTab to parent to update friends list data + */ + void updateFriendsData(); /******************************************************************************* * DATA MEMBERS ******************************************************************************/ -public: - InfoTab *m_personalInfo; ///< Personal info tab - private: + InfoTab *m_personalInfo; ///< Personal info tab QVBoxLayout *m_vbox; ///< Holds the graphics view Pixmap *m_arrowbutton; ///< Button which reveals/hides the info tab when pressed Pixmap *m_leftSideBar; diff --git a/src/ui/mainwindow.cpp b/src/ui/mainwindow.cpp index 6924422..951b9c7 100644 --- a/src/ui/mainwindow.cpp +++ b/src/ui/mainwindow.cpp @@ -40,7 +40,7 @@ MainWindow::MainWindow(QWidget *parent) this->hide(); m_locationDialog = new UpdateLocationDialog(this); - connect(m_listViewScreen->m_personalInfo,SIGNAL(launchMessageUpdate()), + connect(m_listViewScreen,SIGNAL(launchUpdateDialog()), this,SLOT(openLocationUpdateDialog())); connect(this, SIGNAL(reverseGeoReady(QString)), m_locationDialog, SLOT(setAddress(QString))); @@ -50,7 +50,7 @@ MainWindow::MainWindow(QWidget *parent) connect(this, SIGNAL(userDataChanged(User*,QList&)), m_listViewScreen, SLOT(userDataChanged(User*,QList&))); - connect(m_listViewScreen->m_personalInfo, SIGNAL(launchUpdateFriendsStatus()), + connect(m_listViewScreen, SIGNAL(updateFriendsData()), this, SIGNAL(refreshUserData())); connect(m_listViewScreen, SIGNAL(toggleProgressIndicator(bool)), this, -- 1.7.9.5