From: Mikko Siren Date: Wed, 27 May 2009 06:45:03 +0000 (+0300) Subject: Still working X-Git-Url: https://vcs.maemo.org/git/?a=commitdiff_plain;h=9410983800d4a2e644eafcb728570278281d622c;hp=4f5e48bd4a1e5ab05cd5f0d46c3e335731bb05ff;p=qtmeetings Still working --- diff --git a/src/BusinessLogic/Engine.cpp b/src/BusinessLogic/Engine.cpp index 5245702..e4a527a 100644 --- a/src/BusinessLogic/Engine.cpp +++ b/src/BusinessLogic/Engine.cpp @@ -180,19 +180,6 @@ void Engine::fetchMeetings() fetchMeetings( iClock->datetime(), iClock->datetime().addDays( 7 ), room ); } -void Engine::fetchMeetingDetails( Meeting *aMeeting ) -{ - qDebug() << "Engine::fetchMeetingDetails( Meeting* )"; -// iWindowManager->showProgressBar( tr("Please Wait"), true ); -// iWindowManager->updateProgressBar( tr("Fetching Meeting Details...") ); -/* connect( iWindowManager, - SIGNAL( progressBarCancelled() ), - this, - SLOT( fetchMeetingDetailsCancelled() ) - ); */ - iCommunication->fetchMeetingDetails( *aMeeting ); -} - bool Engine::isMeetingInList( const QList &aList, const Meeting *aMeeting ) { qDebug() << "Engine::isMeetingInList( const QList &, const Meeting * )"; @@ -245,10 +232,12 @@ void Engine::errorHandler( int aCode, const QString &aAddInfo ) { qDebug() << "Engine::ErrorHandler, aCode: " << aCode; // inform UI about the problem - if( aCode >= 100 && aCode <= 150 ) + if( aCode >= 100 && aCode <= 150 ) { //communication errors + //we don't want these to close operation changing qDebug() << "CommunicationManager signaled an error:" << aCode; - // iWindowManager->closeProgressBar(); - // iWindowManager->error( ErrorMapper::codeToString( aCode, aAddInfo ) ); + } + + iWindowManager->error( ErrorMapper::codeToString( aCode, aAddInfo ) ); } void Engine::fetchMeetings( const QDateTime &aFrom, const QDateTime &aUntil, const Room *aIn ) @@ -257,45 +246,43 @@ void Engine::fetchMeetings( const QDateTime &aFrom, const QDateTime &aUntil, con iCommunication->fetchMeetings( aFrom, aUntil, *aIn ); } +void Engine::fetchMeetingDetails(Meeting *aMeeting) +{ + qDebug() << "[Engine::fetchMeetingDetails] "; +// Meeting tempMeeting = aMeeting; +// iCommunication->fetchMeetingDetails( tempMeeting ); +} + +void Engine::cancelFetchMeetingDetails() +{ + iCommunication->cancelFetchMeetingDetails(); +} + void Engine::shownWeekChanged( QDate aFrom ) { - qDebug() << "Engine::shownWeekChanged( QDate )"; + qDebug() << "[Engine::shownWeekChanged] "; QDateTime from( aFrom ); QDateTime to( aFrom.addDays( 7 ), QTime( 23, 59 ) ); - qDebug() << "Engine::shownWeekChanged " << aFrom.toString( "d.m. h:mm" ) << " to " << to.toString( "d.m. h:mm" ); + qDebug() << "[Engine::shownWeekChanged] "; + iCommunication->fetchMeetings( from, to, *defaultRoom() ); // fetchMeetings( from, to, iWindowManager->weeklyView()->currentRoom() ); } -void Engine::passwordEntered( PasswordDialog::PasswordStatus aPasswordStatus ) +void Engine::changeDeviceMode( bool aChange ) { - qDebug() << "Engine::passwordEntered( PasswordDialog::PasswordStatus )"; -// iWindowManager->closePasswordDialog(); - - switch ( aPasswordStatus ) + if ( aChange ) { - case PasswordDialog::Correct : - { - connect( iDevice, SIGNAL( changingModeFailed() ), this, SLOT( progressBarCancelled() ) ); - iDevice->changeMode( true ); - break; - } - case PasswordDialog::Incorrect : - { -// iWindowManager->error( tr( "Incorrect password." ) ); - iDevice->changeMode( false ); - break; - } - default : //case PasswordDialog::Canceled - { - iDevice->changeMode( false ); - } + connect( iDevice, SIGNAL( changingModeFailed() ), this, SLOT( changeModeFailed() ) ); + iAutoRefresh->stop(); // Stop the meeting update } + iDevice->changeMode( aChange ); } -void Engine::progressBarCancelled() +void Engine::changeModeFailed() { qDebug() << "Engine::progressBarCancelled()"; iDevice->changeMode( false ); + iAutoRefresh->start(); //we start the metting updating } void Engine::initUserInterface() @@ -391,12 +378,6 @@ void Engine::previousViewRestored() } } -void Engine::fetchMeetingDetailsCancelled() -{ - iCommunication->cancelFetchMeetingDetails(); -// iWindowManager->closeProgressBar(); -} - void Engine::stopIdleTimeCounter() { if ( iIdleTimeCounter != 0 ) diff --git a/src/BusinessLogic/Engine.h b/src/BusinessLogic/Engine.h index c457fae..fbe91dd 100644 --- a/src/BusinessLogic/Engine.h +++ b/src/BusinessLogic/Engine.h @@ -89,29 +89,17 @@ private slots: * room storage and calling the roomStatusInfoNeeded() separately on each of them. */ void checkStatusOfAllRooms(); - //! Slot. Fetches meeting details from the server. + //! Slot for receiving the failure event of operation mode changing. /*! - * Slot. Fetches meeting details from the server. - * \param aMeeting The meeting. + * Slot. Receives the failure event of operation mode changing. */ - void fetchMeetingDetails( Meeting *aMeeting ); - //! Slot for receiving the status of the entered password - /*! - * Slot. Receives the status of the entered password and makes the DeviceManager to change the - * operation mode if the password is correct. - * \param aPasswordStatus The status of the password. - */ - void passwordEntered( PasswordDialog::PasswordStatus aPasswordStatus ); - //! Slot for receiving the cancel event of the progress bar. - /*! - * Slot. Receives the cancel event of the progress bar. - */ - void progressBarCancelled(); + void changeModeFailed(); //! Slot for receiving the cancel event of the progress bar. /*! * Receives the cancel event of the progress bar when meeting details requested. */ - void fetchMeetingDetailsCancelled(); + void fetchMeetingDetails( Meeting *aMeeting ); + void cancelFetchMeetingDetails(); void handleViewEvent(); void previousViewRestored(); @@ -133,6 +121,8 @@ private slots: void stopIdleTimeCounter(); void startIdleTimeCounter(); + + void changeDeviceMode( bool aChange ); private: // Make the UIManager as friendly class so it can connect to private slots. diff --git a/src/BusinessLogic/UIManager.cpp b/src/BusinessLogic/UIManager.cpp index 9da0a8a..19f445f 100644 --- a/src/BusinessLogic/UIManager.cpp +++ b/src/BusinessLogic/UIManager.cpp @@ -9,7 +9,6 @@ #include "WeeklyViewWidget.h" #include "SettingsView.h" #include "RoomStatusIndicatorWidget.h" -#include "PasswordDialog.h" #include "MeetingInfoDialog.h" #include "ProgressBar.h" #include "CommunicationManager.h" @@ -38,12 +37,16 @@ UIManager::UIManager( Engine *aEngine, WindowManager *aWindowManager ) : if ( iEngine == 0 ) return; if ( iWindowManager == 0 ) return; + qDebug() << "[UIManager::ctor] <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"; + createWeeklyView(); createSettingsView(); createRoomStatusIndicator(); createPasswordDialog(); createProgressBar(); createMeetingInfoDialog(); + + qDebug() << "[UIManager::ctor] <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"; } UIManager::~UIManager() @@ -79,9 +82,13 @@ void UIManager::createWeeklyView() { iWeeklyView = new WeeklyViewWidget( QDateTime::currentDateTime(), iEngine->iConfiguration ); - // Connect signals + // Connect signals to UIManager connect( iWeeklyView, SIGNAL( settingsButtonClicked() ), this, SLOT( settingsViewRequest() ) ); 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( meetingActivated( Meeting * ) ), iEngine, SLOT( fetchMeetingDetails( Meeting * ) ) ); + connect( iWeeklyView, SIGNAL( shownWeekChanged( QDate ) ), iEngine, SLOT( shownWeekChanged( QDate ) ) ); } void UIManager::createSettingsView() @@ -100,19 +107,23 @@ void UIManager::createRoomStatusIndicator() void UIManager::createPasswordDialog() { iPasswordDialog = new PasswordDialog( iEngine->iConfiguration->adminPassword(), tr("UIManager::createPasswordDialog"), tr("UIManager::createPasswordDialog") ); + + connect( iPasswordDialog, SIGNAL( passwordEntered( PasswordDialog::PasswordStatus ) ), this, SLOT( passwordEntered( PasswordDialog::PasswordStatus ) ) ); } void UIManager::createProgressBar() { iProgressBar = new ProgressBar( tr("CHANGE THIS") ); - connect( iProgressBar, SIGNAL( cancelled() ), this, SLOT( progressBarCancelled() ) ); - connect( iProgressBar, SIGNAL( cancelled() ), iEngine, SLOT( progressBarCancelled() ) ); + // Connect to UIManager + connect( iProgressBar, SIGNAL( cancel() ), this, SLOT( progressBarCancelled() ) ); + // Connect to Engine + connect( iProgressBar, SIGNAL( cancel() ), iEngine, SLOT( cancelFetchMeetingDetails() ) ); } void UIManager::createMeetingInfoDialog() { - + iMeetingInfo = new MeetingInfoDialog(); } void UIManager::connectDeviceManager( DeviceManager *aDeviceManager ) @@ -120,16 +131,11 @@ void UIManager::connectDeviceManager( DeviceManager *aDeviceManager ) connect( aDeviceManager, SIGNAL( changeModeOrdered( DeviceManager::OperationMode ) ), this, SLOT( changeModeOrdered( DeviceManager::OperationMode ) ) ); - connect( aDeviceManager, SIGNAL( changingMode( const QString & ) ), iProgressBar, SLOT( update( const QString & ) ) ); + connect( aDeviceManager, SIGNAL( changingMode( const QString & ) ), this, SLOT( updateProgressBarText( const QString & ) ) ); } void UIManager::connectCommunicationManager( CommunicationManager *aCommunicationManager ) { - // To communication manager - connect( iWeeklyView, SIGNAL( meetingActivated( Meeting * ) ), aCommunicationManager, SLOT( fetchMeetingDetails( Meeting * ) ) ); - - // From communication manager - connect( aCommunicationManager, SIGNAL( meetingsFetched( const QList ) ), this, SLOT( meetingsFetched( const QList ) ) ); connect( aCommunicationManager, SIGNAL( meetingDetailsFetched( Meeting & ) ), this, SLOT( meetingDetailsFetched( Meeting & ) ) ); } @@ -160,10 +166,23 @@ void UIManager::meetingsFetched( const QList &aMeetings ) } +void UIManager::showMeetingProgressBar( Meeting *aMeeting ) +{ + if ( iProgressBar != 0 ) + { + iProgressBar->update( tr("Fetching meeting info...") ); + iWindowManager->showDialog( static_cast( iProgressBar ) ); + } +} + void UIManager::meetingDetailsFetched(Meeting &aDetailedMeeting) { if ( iMeetingInfo != 0 ) { + if ( iProgressBar != 0 ) + { + iProgressBar->close(); // Close it in case it's visible + } iMeetingInfo->setMeeting( &aDetailedMeeting ); iWindowManager->showDialog( static_cast( iMeetingInfo ) ); } @@ -185,7 +204,10 @@ void UIManager::previousViewRestored() void UIManager::progressBarCancelled() { - // TODO : Close progress bar + if ( iProgressBar != 0 ) + { + iProgressBar->close(); + } } void UIManager::changeModeOrdered( DeviceManager::OperationMode aMode ) @@ -219,3 +241,38 @@ void UIManager::updateTime(QDateTime aDateTime) iWeeklyView->setCurrentDateTime( aDateTime ); } } + +void UIManager::passwordEntered( PasswordDialog::PasswordStatus aStatus ) +{ + switch( aStatus ) + { + case PasswordDialog::Correct: + // Show the progress bar.. + if ( iProgressBar != 0 ) + { + iWindowManager->showDialog( static_cast( iProgressBar ) ); + } + // ... and initiate the mode changing + iEngine->changeDeviceMode( true ); + break; + case PasswordDialog::Incorrect: + iWindowManager->error( tr("Incorrect Password") ); + case PasswordDialog::Canceled: + iEngine->changeDeviceMode( false ); + break; + } + + // Close the dialog after we have handled the status + if ( iPasswordDialog != 0 ) + { + iPasswordDialog->close(); + } +} + +void UIManager::updateProgressBarText(const QString &aText) +{ + if ( iProgressBar != 0 ) + { + iProgressBar->update( aText ); + } +} diff --git a/src/BusinessLogic/UIManager.h b/src/BusinessLogic/UIManager.h index dfaf8fd..df7fe00 100644 --- a/src/BusinessLogic/UIManager.h +++ b/src/BusinessLogic/UIManager.h @@ -6,13 +6,13 @@ #include "Meeting.h" #include "DeviceManager.h" +#include "PasswordDialog.h" class Engine; class WindowManager; class WeeklyViewWidget; class SettingsView; class RoomStatusIndicatorWidget; -class PasswordDialog; class ProgressBar; class MeetingInfoDialog; class CommunicationManager; @@ -48,6 +48,9 @@ private slots: void currentRoomChanged( Room *aRoom ); void progressBarCancelled(); void updateTime( QDateTime aDateTime ); + void passwordEntered( PasswordDialog::PasswordStatus aStatus ); + void showMeetingProgressBar( Meeting *aMeeting ); + void updateProgressBarText( const QString &aText ); private: diff --git a/src/IO/Communication/MessagingUtils.cpp b/src/IO/Communication/MessagingUtils.cpp index 0f6e63e..d12b73a 100644 --- a/src/IO/Communication/MessagingUtils.cpp +++ b/src/IO/Communication/MessagingUtils.cpp @@ -1,4 +1,5 @@ #include +#include #include "MessagingUtils.h" #include "Meeting.h" @@ -868,8 +869,26 @@ int ReqMsgGetUserAvailability::setTimeZone() return MsgErrSomeError; } int err = MsgErrNoError; + + time_t rawtime; + tm *localTime; + + time(&rawtime); + localTime = localtime(&rawtime); + + int offsetMinutes = localTime->tm_gmtoff / 60; + if (localTime->tm_isdst) + offsetMinutes -= 60; // If DST is in use then reduce an hour from offset, because + // DST will be added to the offset later and it already includes + // DST. TODO: This is silly and must be changed if possible. + // If you can get UTC offset without DST, use it here. + +#ifdef MU_DEBUG + qDebug( "ReqMsgGetUserAvailability::setTimeZone - offset in minutes=%d", offsetMinutes ); +#endif + //TODO: timezone and daylight times to application configuration - setNodeValue( QString( "Bias" ), QString::number( -120 ), QDomNode::ElementNode, QString( "TimeZone" ) ); + setNodeValue( QString( "Bias" ), QString::number( -offsetMinutes ), QDomNode::ElementNode, QString( "TimeZone" ) ); setNodeValue( QString( "Bias" ), QString::number( 0 ), QDomNode::ElementNode, QString( "StandardTime" ) ); setNodeValue( QString( "Time" ), QString( "03:00:00" ), QDomNode::ElementNode, QString( "StandardTime" ) ); setNodeValue( QString( "DayOrder" ), QString::number( 5 ), QDomNode::ElementNode, QString( "StandardTime" ) ); diff --git a/src/IO/Communication/MessagingUtils.h b/src/IO/Communication/MessagingUtils.h index b15a99b..29d9744 100644 --- a/src/IO/Communication/MessagingUtils.h +++ b/src/IO/Communication/MessagingUtils.h @@ -17,8 +17,8 @@ #define ACTION_URL "http://schemas.microsoft.com/exchange/services/2006/messages/" //Set MessagingUtils Debug on/off -//#define MU_DEBUG -#undef MU_DEBUG +#define MU_DEBUG +//#undef MU_DEBUG class Meeting; class Room; diff --git a/src/IO/DeviceControl/DeviceManager.cpp b/src/IO/DeviceControl/DeviceManager.cpp index 6c6eb27..92613b2 100644 --- a/src/IO/DeviceControl/DeviceManager.cpp +++ b/src/IO/DeviceControl/DeviceManager.cpp @@ -81,7 +81,8 @@ void DeviceManager::changeMode( bool aChange ) } iModeToggler = new OperationModeToggler( iMode, iSettings, iAlarmSender, iConfigurator, iDataStorage ); connect( iModeToggler, SIGNAL( finished() ), this, SLOT( modeChanged() ) ); - connect( iModeToggler, SIGNAL( error( DeviceManager::ErrorCode ) ), this, SLOT( errorSender( DeviceManager::ErrorCode ) ) ); + connect( iModeToggler, SIGNAL( error( DeviceManager::ErrorCode, const QString & ) ), + this, SLOT( errorSender( DeviceManager::ErrorCode, const QString & ) ) ); connect( iModeToggler, SIGNAL( changingMode( const QString & ) ), this, SIGNAL( changingMode( const QString & ) ) ); connect( iModeToggler, SIGNAL( toggleErrorSending( bool ) ), this, SLOT( toggleErrorSending( bool ) ) ); iModeToggler->start(); @@ -172,16 +173,18 @@ void DeviceManager::errorSender( DeviceManager::ErrorCode aErrorCode, const QStr void DeviceManager::toggleErrorSending( bool aToggle ) { + qDebug() << "DeviceManager::toggleErrorSending( bool )"; iSendErrorMessages = aToggle; } void DeviceManager::modeChanged() { + qDebug() << "DeviceManager::modeChanged()"; if( iModeToggler != 0 ) { if ( iModeToggler->success() ) //mode changing went well iConfigurator->restartDevice(); else - emit changingModeFailed(); + emit changeModeFailed(); delete iModeToggler; iModeToggler = 0; } diff --git a/src/IO/DeviceControl/DeviceManager.h b/src/IO/DeviceControl/DeviceManager.h index 4d5aaa7..267cf96 100644 --- a/src/IO/DeviceControl/DeviceManager.h +++ b/src/IO/DeviceControl/DeviceManager.h @@ -3,6 +3,7 @@ #include #include +#include class AlarmSender; class HWKeyListener; @@ -39,6 +40,7 @@ public: /*! * Enumeration of errors */ + enum ErrorCode { FileCreationFailed, /*!< File couldn't be created. */ @@ -116,7 +118,7 @@ signals: /*! * Signal. Emitted if the operation mode change fails. */ - void changingModeFailed(); + void changeModeFailed(); private slots: //! Slot. Handles "full screen"-hardware key presses. @@ -183,4 +185,6 @@ private: }; +Q_DECLARE_METATYPE( DeviceManager::ErrorCode ) + #endif /*DEVICEMANAGER_H_*/ diff --git a/src/IO/DeviceControl/OperationModeToggler.cpp b/src/IO/DeviceControl/OperationModeToggler.cpp index 0f44687..cfa5d5d 100644 --- a/src/IO/DeviceControl/OperationModeToggler.cpp +++ b/src/IO/DeviceControl/OperationModeToggler.cpp @@ -22,6 +22,15 @@ OperationModeToggler::OperationModeToggler( iSuccess( true ) { qDebug() << "OperationModeToggler::OperationModeToggler( ... )"; + + qRegisterMetaType("DeviceManager::ErrorCode"); + + connect( iAlarmSender, SIGNAL( alarmSendingFailed( DeviceManager::ErrorCode, const QString& ) ), + this, SIGNAL( error( DeviceManager::ErrorCode, const QString& ) ) ); + connect( iConfigurator, SIGNAL( configuringError( DeviceManager::ErrorCode ) ), + this, SLOT( createError( DeviceManager::ErrorCode ) ) ); + connect( iDataStorage, SIGNAL( dataStorageInitFailed( DeviceManager::ErrorCode ) ), + this, SLOT( createError( DeviceManager::ErrorCode ) ) ); } OperationModeToggler::~OperationModeToggler() @@ -35,7 +44,7 @@ void OperationModeToggler::run() { case DeviceManager::EmptyMode: // error occured. Mode cannot be changed - emit error( DeviceManager::ModeNotFetched ); + createError( DeviceManager::ModeNotFetched ); iSuccess = false; return; case DeviceManager::StandAloneMode: @@ -78,7 +87,7 @@ void OperationModeToggler::run() emit changingMode( "Storing information about the new operation mode." ); sleep( 2 ); if( !storeOperationMode( DeviceManager::KioskMode, iDataStorage ) ) { - emit error( DeviceManager::ModeNotStored ); + createError( DeviceManager::ModeNotStored ); iSuccess = false; } } @@ -116,7 +125,7 @@ void OperationModeToggler::run() emit changingMode( "Storing information about the new operation mode." ); sleep( 2 ); if( !storeOperationMode( DeviceManager::StandAloneModeInProgress, iDataStorage ) ) { - emit error( DeviceManager::ModeNotStored ); + createError( DeviceManager::ModeNotStored ); iSuccess = false; } } @@ -145,6 +154,7 @@ void OperationModeToggler::run() bool OperationModeToggler::success() { + qDebug() << "OperationModeToggler::success()"; return iSuccess; } @@ -158,3 +168,11 @@ bool OperationModeToggler::storeOperationMode( DeviceManager::OperationMode aMod return false; return true; } + +void OperationModeToggler::createError( DeviceManager::ErrorCode aCode ) +{ + qDebug() << "OperationModeToggler::createError( DeviceManager::ErrorCode )"; + QString empty = ""; + emit error( aCode, empty ); +} + diff --git a/src/IO/DeviceControl/OperationModeToggler.h b/src/IO/DeviceControl/OperationModeToggler.h index 0b22266..77f9382 100644 --- a/src/IO/DeviceControl/OperationModeToggler.h +++ b/src/IO/DeviceControl/OperationModeToggler.h @@ -49,13 +49,13 @@ public: static bool storeOperationMode( DeviceManager::OperationMode aMode, DeviceDataStorage *aDataStorage ); signals: - //! Signal. Emitted if an error occurs during operation mode fetching or reading. + //! Signal. Emitted if an error happens. /*! - * Signal. Emitted if an error occurs during operation mode fetching or reading. Note that other - * possible errors are sent by the other instances e.g. alarm sender sents it's own errors. - * \param aCode The error code. + * Signal. Emitted if an error happens. + * \param aCode An error code defined by DeviceManager. + * \param aAddInfo Possible additional information. */ - void error( DeviceManager::ErrorCode aCode ); + void error( DeviceManager::ErrorCode aCode, const QString &aAddInfo ); //! Signal. Emitted if an error occurs during operation mode changing. /*! * Signal. Emitted if an error occurs during operation mode changing. If an error occurs, the operation @@ -70,6 +70,14 @@ signals: * \param aMessage Explains the sub-change */ void changingMode( const QString &aMessage ); + +private slots: + //! Slot. Emits an error signal. + /*! + * Slot. Emits an error signal. + * \param aCode The error code. + */ + void createError( DeviceManager::ErrorCode aCode ); private: DeviceManager::OperationMode iMode; diff --git a/src/UserInterface/Views/SettingsView.cpp b/src/UserInterface/Views/SettingsView.cpp index 863d84e..d233662 100644 --- a/src/UserInterface/Views/SettingsView.cpp +++ b/src/UserInterface/Views/SettingsView.cpp @@ -44,10 +44,7 @@ SettingsView::SettingsView( QWidget *aParent ) : QHBoxLayout *buttonLayout = new QHBoxLayout; iOkButton = new QPushButton; iOkButton->setText( tr( "OK" ) ); - iCancelButton = new QPushButton; - iCancelButton->setText( tr( "Cancel" ) ); buttonLayout->addWidget( iOkButton ); - buttonLayout->addWidget( iCancelButton ); // Handle the main layout QVBoxLayout *mainLayout = new QVBoxLayout; @@ -58,7 +55,6 @@ SettingsView::SettingsView( QWidget *aParent ) : // Handle component connections connect( iOkButton, SIGNAL( clicked() ), this, SLOT( handleOkClicked() ) ); - connect( iCancelButton, SIGNAL( clicked() ), this, SLOT( cancelClicked() ) ); } SettingsView::~SettingsView() @@ -73,11 +69,6 @@ SettingsView::~SettingsView() delete iOkButton; iOkButton = 0; } - if ( iCancelButton != 0 ) - { - delete iCancelButton; - iCancelButton = 0; - } if ( iSettingsTab != 0 ) { delete iSettingsTab; @@ -412,14 +403,6 @@ void SettingsView::handleOkClicked() // Emit the signal to notify that ok is pressed and data is saved. emit okClicked(); - -// close(); -} - -void SettingsView::cancelClicked() -{ - qDebug() << "[SettingsView::cancelClicked] "; - close(); } void SettingsView::viewResized(const QSize &size) diff --git a/src/UserInterface/Views/SettingsView.h b/src/UserInterface/Views/SettingsView.h index 3e04eee..e565aa1 100644 --- a/src/UserInterface/Views/SettingsView.h +++ b/src/UserInterface/Views/SettingsView.h @@ -36,8 +36,6 @@ public slots: private slots: //! Slot to handle the Ok button pressing. void handleOkClicked(); - //! Slot to handle the cancel button pressing. - void cancelClicked(); private: //! Initialize "Settings" tab. @@ -53,8 +51,6 @@ private: QTabWidget *iTabWidget; //! OK button to dismiss the settings view with saving the settings. QPushButton *iOkButton; - //! Cancel button to dismiss the settings view without saving settings. - QPushButton *iCancelButton; //! Settings tab. QWidget *iSettingsTab; //! Week View tab. diff --git a/src/UserInterface/Views/WeeklyViewWidget.cpp b/src/UserInterface/Views/WeeklyViewWidget.cpp index 3f2fec4..5283354 100644 --- a/src/UserInterface/Views/WeeklyViewWidget.cpp +++ b/src/UserInterface/Views/WeeklyViewWidget.cpp @@ -43,7 +43,7 @@ WeeklyViewWidget::WeeklyViewWidget( QDateTime aCurrentDateTime, Configuration *a iRoomsCombo = new MeetingRoomCombo( iConfiguration->rooms(), this ); iRoomsCombo->setCurrentRoom( iConfiguration->defaultRoom() ); - connect( iRoomsCombo, SIGNAL( currentRoomChange( Room * ) ), this, SIGNAL( currentRoomChange( Room * ) ) ); + connect( iRoomsCombo, SIGNAL( currentRoomChanged( Room * ) ), this, SIGNAL( currentRoomChanged( Room * ) ) ); iTimeDisplay = new DigitalTimeDisplayWidget( aCurrentDateTime.time(), iConfiguration->displaySettings()->timeFormat(), this ); iTimeDisplay->setFrameVisible( false ); diff --git a/src/UserInterface/WindowManager.cpp b/src/UserInterface/WindowManager.cpp index e50229a..7be6080 100644 --- a/src/UserInterface/WindowManager.cpp +++ b/src/UserInterface/WindowManager.cpp @@ -3,6 +3,7 @@ #include #include #include "ViewBase.h" +#include "PopUpMessageBox.h" #include @@ -105,7 +106,7 @@ void WindowManager::error( const QString &aErrorMessage ) { qDebug() << "WindowManager::showErrorPopup"; -// PopUpMessageBox::error( 0, aErrorMessage ); + showDialog( static_cast( PopUpMessageBox::error( 0, aErrorMessage ) ) ); } void WindowManager::setFullscreen()