From: Mikko Siren Date: Fri, 29 May 2009 09:47:16 +0000 (+0300) Subject: Modified the dialog signaling to prevent idle screen coming from visible while dialog... X-Git-Url: https://vcs.maemo.org/git/?p=qtmeetings;a=commitdiff_plain;h=24cdf6f4ca42fff4f197fcedc5ac460cbb515c64 Modified the dialog signaling to prevent idle screen coming from visible while dialog is shown. Does not work for progress bar right now. --- diff --git a/src/BusinessLogic/Engine.cpp b/src/BusinessLogic/Engine.cpp index 5499005..e745491 100644 --- a/src/BusinessLogic/Engine.cpp +++ b/src/BusinessLogic/Engine.cpp @@ -252,7 +252,7 @@ void Engine::initUserInterface() connect( iWindowManager, SIGNAL( eventDetected() ), this, SLOT( handleViewEvent() ) ); connect( iWindowManager, SIGNAL( previousViewRestored() ), iUIManager, SLOT( previousViewRestored() ) ); -// connect( iWindowManager, SIGNAL( dialogActivated() ), this, SLOT( dialogActivated() ) ); + connect( iWindowManager, SIGNAL( dialogActivated() ), this, SLOT( dialogActivated() ) ); connect( iWindowManager, SIGNAL( dialogDeactivated() ), this, SLOT( dialogDeactivated() ) ); // Show the UI @@ -268,7 +268,7 @@ void Engine::initUserInterface() void Engine::handleViewEvent() { - if ( iIdleTimeCounter != 0 ) + if ( iIdleTimeCounter != 0 && iIdleTimeCounter->isActive()) { // Restart the idle time counter when view event is received iIdleTimeCounter->stop(); diff --git a/src/BusinessLogic/UIManager.cpp b/src/BusinessLogic/UIManager.cpp index 517a715..54ee865 100644 --- a/src/BusinessLogic/UIManager.cpp +++ b/src/BusinessLogic/UIManager.cpp @@ -170,7 +170,6 @@ void UIManager::showMeetingProgressBar( Meeting *aMeeting ) iProgressBar->update( tr( "Fetching meeting info..." ), tr( "Please wait" ) ); iProgressBar->toggleCancellable( true ); iWindowManager->showDialog( static_cast( iProgressBar ), false, false ); - iEngine->stopIdleTimeCounter(); } } @@ -212,7 +211,6 @@ void UIManager::progressBarCancelled() if ( iProgressBar != 0 ) { iProgressBar->close(); - iEngine->startIdleTimeCounter(); } } @@ -262,7 +260,7 @@ void UIManager::passwordEntered( PasswordDialog::PasswordStatus aStatus ) { iProgressBar->update( tr( "" ), tr( "Changing operation mode" ) ); iProgressBar->toggleCancellable( false ); - iWindowManager->showDialog( static_cast( iProgressBar ), false ); + iWindowManager->showDialog( static_cast( iProgressBar ), false, false ); } // ... and initiate the mode changing iEngine->changeDeviceMode( true ); diff --git a/src/UserInterface/Views/RoomStatusIndicatorWidget.cpp b/src/UserInterface/Views/RoomStatusIndicatorWidget.cpp index 694663e..302c931 100644 --- a/src/UserInterface/Views/RoomStatusIndicatorWidget.cpp +++ b/src/UserInterface/Views/RoomStatusIndicatorWidget.cpp @@ -6,6 +6,8 @@ #include "DigitalTimeDisplayWidget.h" #include "ToolBox.h" +#include + #include QTime RoomStatusIndicatorWidget::endOfTheDay = QTime( 23, 59, 0, 0 ); @@ -75,25 +77,28 @@ QString RoomStatusIndicatorWidget::statusToText( const Room::Status aStatus ) QPalette RoomStatusIndicatorWidget::createPalette( Room::Status aStatus ) { - QPixmap pixmap( aStatus == Room::BusyStatus ? ":roomstatus_busy" : ":roomstatus_free" ); + // QPixmap pixmap( aStatus == Room::BusyStatus ? ":roomstatus_busy" : ":roomstatus_free" ); + QString image = aStatus == Room::BusyStatus ? ":roomstatus_busy" : ":roomstatus_free"; // The image needs to be moved in normal mode so the traffic light not partly outside the screen const int xoffset( 60 ); const int yoffset( 19 ); - int cropwidth( pixmap.width() - xoffset ); - int cropheight( pixmap.height() - yoffset ); +// int cropwidth( pixmap.width() - xoffset ); +// int cropheight( pixmap.height() - yoffset ); QBrush brush; if ( windowState() == Qt::WindowFullScreen ) { // Use the full image in full screen mode - brush.setTexture( pixmap ); +// brush.setTexture( pixmap ); + brush.setTexture( QPixmap(image) ); } else { // Take part of the image so the traffic lights are moved xoffset poxels to left // and yoffset pixels to up - brush.setTexture( pixmap.copy( xoffset, yoffset, cropwidth, cropheight ) ); +// brush.setTexture( pixmap.copy( xoffset, yoffset, cropwidth, cropheight ) ); + brush.setTexture( QPixmap(image) ); } QPalette palette; @@ -124,3 +129,20 @@ void RoomStatusIndicatorWidget::currentRoomChanged( Room *aRoom ) { iDefaultRoomLabel->setText( aRoom->name() ); } + +bool RoomStatusIndicatorWidget::event(QEvent *event) +{ + switch(event->type()) + { + case QEvent::Paint: + qDebug() << "[RoomStatusIndicatorWidget::event] "; + break; + case QEvent::PaletteChange: + qDebug() << "[RoomStatusIndicatorWidget::event] "; + break; + default: + break; + } + + return ViewBase::event( event ); +} diff --git a/src/UserInterface/Views/RoomStatusIndicatorWidget.h b/src/UserInterface/Views/RoomStatusIndicatorWidget.h index 47c73fa..b13ff65 100644 --- a/src/UserInterface/Views/RoomStatusIndicatorWidget.h +++ b/src/UserInterface/Views/RoomStatusIndicatorWidget.h @@ -12,6 +12,8 @@ class QLabel; class QVBoxLayout; class TimeDisplayWidget; +class QEvent; + //! UserInterface class. Indicates if the default meeting room is busy or not. /*! * UserInterface class. Indicates if the default meeting room is busy or not. This widget @@ -37,6 +39,8 @@ public: RoomStatusIndicatorWidget( Room *aDefaultRoom, Room::Status aStatus, QTime aUntil, QString aTimeFormat, QWidget *aParent = 0 ); //! Destructor. virtual ~RoomStatusIndicatorWidget(); + + bool event(QEvent *event); public slots: //! Slot. Sets current time.