From: Risto Lintinen Date: Wed, 26 Aug 2009 11:57:11 +0000 (+0300) Subject: added refresh on statusbar click X-Git-Url: http://vcs.maemo.org/git/?p=qtmeetings;a=commitdiff_plain;h=7e9daec272450fa2eeffe0a08732ef4696b37a4f added refresh on statusbar click --- diff --git a/src/BusinessLogic/Engine.cpp b/src/BusinessLogic/Engine.cpp index 9fd0c6c..6cf5ee4 100644 --- a/src/BusinessLogic/Engine.cpp +++ b/src/BusinessLogic/Engine.cpp @@ -421,7 +421,7 @@ void Engine::tick( QDateTime aCurrentDateTime ) void Engine::updateRoomInfo() { qDebug() << "ENGINE::: updateMeetings"; - roomStatusInfoNeeded(iCurrentRoom); + iUIManager->currentRoomChanged( iCurrentRoom ); } void Engine::configurationChanged() diff --git a/src/BusinessLogic/UIManager.cpp b/src/BusinessLogic/UIManager.cpp index 0913697..1c58381 100644 --- a/src/BusinessLogic/UIManager.cpp +++ b/src/BusinessLogic/UIManager.cpp @@ -75,6 +75,7 @@ void UIManager::createWeeklyView() connect( iWeeklyView, SIGNAL( currentRoomChanged( Room * ) ), this, SLOT( currentRoomChanged( Room * ) ) ); connect( iWeeklyView, SIGNAL( meetingActivated( Meeting * ) ), this, SLOT( showMeetingProgressBar( Meeting * ) ) ); // Connect signals to engine + connect( iWeeklyView, SIGNAL( refreshButtonClicked() ), iEngine, SLOT( updateRoomInfo() ) ); connect( iWeeklyView, SIGNAL( meetingActivated( Meeting * ) ), iEngine, SLOT( fetchMeetingDetails( Meeting * ) ) ); connect( iWeeklyView, SIGNAL( shownWeekChanged( QDate ) ), iEngine, SLOT( shownWeekChanged( QDate ) ) ); connect( iWeeklyView, SIGNAL( currentRoomChanged( Room * ) ), iEngine, SLOT( currentRoomChanged( Room * ) ) ); diff --git a/src/UserInterface/Components/BorderedBarWidget.cpp b/src/UserInterface/Components/BorderedBarWidget.cpp index 67356e4..0b92511 100644 --- a/src/UserInterface/Components/BorderedBarWidget.cpp +++ b/src/UserInterface/Components/BorderedBarWidget.cpp @@ -94,6 +94,12 @@ void BorderedBarWidget::paintEvent(QPaintEvent *) iRightLabel->setGeometry( rect() ); } +void BorderedBarWidget::mousePressEvent( QMouseEvent * ) +{ + emit ( clicked() ); +} + + void BorderedBarWidget::drawCorner( QPainter &aPainter, QPoint &aCenter ) { QRadialGradient radialGrad(QPointF(aCenter), iBorderWidth); diff --git a/src/UserInterface/Components/BorderedBarWidget.h b/src/UserInterface/Components/BorderedBarWidget.h index c97b18a..c3e56bf 100644 --- a/src/UserInterface/Components/BorderedBarWidget.h +++ b/src/UserInterface/Components/BorderedBarWidget.h @@ -86,6 +86,10 @@ public: */ void setPixmap( QPixmap aPixmap, TextPosition aPos = RightAlign ); +signals: + + void clicked(); + private: //! Draws the borders. /*! @@ -115,6 +119,8 @@ protected: */ virtual void paintEvent(QPaintEvent *); + void mousePressEvent( QMouseEvent * ); + private: //! Palette for storing colors. QPalette iPalette; diff --git a/src/UserInterface/Views/RoomStatusIndicatorWidget.cpp b/src/UserInterface/Views/RoomStatusIndicatorWidget.cpp index be37768..2ee240e 100644 --- a/src/UserInterface/Views/RoomStatusIndicatorWidget.cpp +++ b/src/UserInterface/Views/RoomStatusIndicatorWidget.cpp @@ -163,8 +163,7 @@ void RoomStatusIndicatorWidget::setConnectionStatus( QDateTime aCurrentTime, boo if (!aConnected) { - iStatusBar->setText( tr("Disconnected").arg(aLastUpdated.toString(iTimeFormat)) - , BorderedBarWidget::LeftAlign ); + iStatusBar->setText( tr("Disconnected"), BorderedBarWidget::LeftAlign ); } else { diff --git a/src/UserInterface/Views/WeeklyViewWidget.cpp b/src/UserInterface/Views/WeeklyViewWidget.cpp index 82d18c2..1596933 100644 --- a/src/UserInterface/Views/WeeklyViewWidget.cpp +++ b/src/UserInterface/Views/WeeklyViewWidget.cpp @@ -76,6 +76,8 @@ WeeklyViewWidget::WeeklyViewWidget( QDateTime aCurrentDateTime, Configuration *a iStatusBar->setFixedHeight( 36 ); iStatusBar->setText( tr("Disconnected"), BorderedBarWidget::LeftAlign ); + connect( iStatusBar, SIGNAL( clicked() ), this, SIGNAL( refreshButtonClicked() ) ); + iSchedule = new ScheduleWidget( aCurrentDateTime, iConfiguration->displaySettings(), this ); connect( iSchedule, SIGNAL( shownWeekChanged( QDate ) ), this, SIGNAL( shownWeekChanged( QDate ) ) ); connect( iSchedule, SIGNAL( meetingActivated( Meeting* ) ), this, SIGNAL( meetingActivated( Meeting* ) ) ); @@ -238,9 +240,7 @@ void WeeklyViewWidget::setConnectionStatus( QDateTime aCurrentTime, bool aConnec iStatusBar->setText( tr("Disconnected") , BorderedBarWidget::LeftAlign ); else if ( !aConnected ) { - iStatusBar->setText( tr("Disconnected") - .arg(aLastUpdated.toString(iConfiguration->displaySettings()->timeFormat())) - , BorderedBarWidget::LeftAlign ); + iStatusBar->setText( tr("Disconnected"), BorderedBarWidget::LeftAlign ); } else { diff --git a/src/UserInterface/Views/WeeklyViewWidget.h b/src/UserInterface/Views/WeeklyViewWidget.h index a9632a2..5ea4bf6 100644 --- a/src/UserInterface/Views/WeeklyViewWidget.h +++ b/src/UserInterface/Views/WeeklyViewWidget.h @@ -103,6 +103,13 @@ signals: * Signal is emited when settings button is clicked. */ void settingsButtonClicked(); + + //! Signals + /*! + * Signal is emited when refresh button is clicked. + */ + void refreshButtonClicked(); + //! Signal. Emitted if the shown week has been changed. /*!