Still working
authorMikko Siren <mikko.siren@ixonos.com>
Wed, 27 May 2009 06:45:03 +0000 (09:45 +0300)
committerMikko Siren <mikko.siren@ixonos.com>
Wed, 27 May 2009 06:45:03 +0000 (09:45 +0300)
14 files changed:
src/BusinessLogic/Engine.cpp
src/BusinessLogic/Engine.h
src/BusinessLogic/UIManager.cpp
src/BusinessLogic/UIManager.h
src/IO/Communication/MessagingUtils.cpp
src/IO/Communication/MessagingUtils.h
src/IO/DeviceControl/DeviceManager.cpp
src/IO/DeviceControl/DeviceManager.h
src/IO/DeviceControl/OperationModeToggler.cpp
src/IO/DeviceControl/OperationModeToggler.h
src/UserInterface/Views/SettingsView.cpp
src/UserInterface/Views/SettingsView.h
src/UserInterface/Views/WeeklyViewWidget.cpp
src/UserInterface/WindowManager.cpp

index 5245702..e4a527a 100644 (file)
@@ -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<Meeting*> &aList, const Meeting *aMeeting )
 {
        qDebug() << "Engine::isMeetingInList( const QList<Meeting*> &, 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] <TODO : METHOD NOT IMPLEMENTED>";
+//     Meeting tempMeeting = aMeeting;
+//     iCommunication->fetchMeetingDetails( tempMeeting );
+}
+
+void Engine::cancelFetchMeetingDetails()
+{
+       iCommunication->cancelFetchMeetingDetails();
+}
+
 void Engine::shownWeekChanged( QDate aFrom )
 {
-       qDebug() << "Engine::shownWeekChanged( QDate )";
+       qDebug() << "[Engine::shownWeekChanged] <Invoked>";
        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] <From " << aFrom.toString( "d.m. h:mm" ) << " to " << to.toString( "d.m. h:mm" ) << ">";
+       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 )
index c457fae..fbe91dd 100644 (file)
@@ -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.
index 9da0a8a..19f445f 100644 (file)
@@ -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<Meeting *> ) ), this, SLOT( meetingsFetched( const QList<Meeting *> ) ) );
        connect( aCommunicationManager, SIGNAL( meetingDetailsFetched( Meeting & ) ), this, SLOT( meetingDetailsFetched( Meeting & ) ) );
 }
 
@@ -160,10 +166,23 @@ void UIManager::meetingsFetched( const QList<Meeting*> &aMeetings )
        
 }
 
+void UIManager::showMeetingProgressBar( Meeting *aMeeting )
+{
+       if ( iProgressBar != 0 )
+       {
+               iProgressBar->update( tr("Fetching meeting info...") );
+               iWindowManager->showDialog( static_cast<QDialog *>( 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<QDialog *>( 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<QDialog *>( 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 );
+       }
+}
index dfaf8fd..df7fe00 100644 (file)
@@ -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:
        
index 0f6e63e..d12b73a 100644 (file)
@@ -1,4 +1,5 @@
 #include <QUrl>
+#include <time.h>
 
 #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" ) );
index b15a99b..29d9744 100644 (file)
@@ -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;
index 6c6eb27..92613b2 100644 (file)
@@ -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;
        }
index 4d5aaa7..267cf96 100644 (file)
@@ -3,6 +3,7 @@
 
 #include <QObject>
 #include <QStringList>
+#include <QMetaType>
 
 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_*/
index 0f44687..cfa5d5d 100644 (file)
@@ -22,6 +22,15 @@ OperationModeToggler::OperationModeToggler(
        iSuccess( true )
 {
        qDebug() << "OperationModeToggler::OperationModeToggler( ... )";
+       
+       qRegisterMetaType<DeviceManager::ErrorCode>("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 );
+}
+
index 0b22266..77f9382 100644 (file)
@@ -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;
index 863d84e..d233662 100644 (file)
@@ -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] <Invoked>";
-       close();
 }
 
 void SettingsView::viewResized(const QSize &size)
index 3e04eee..e565aa1 100644 (file)
@@ -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.
index 3f2fec4..5283354 100644 (file)
@@ -43,7 +43,7 @@ WeeklyViewWidget::WeeklyViewWidget( QDateTime aCurrentDateTime, Configuration *a
 \r
        iRoomsCombo = new MeetingRoomCombo( iConfiguration->rooms(), this );\r
        iRoomsCombo->setCurrentRoom( iConfiguration->defaultRoom() );\r
-       connect( iRoomsCombo, SIGNAL( currentRoomChange( Room * ) ), this, SIGNAL( currentRoomChange( Room * ) ) );\r
+       connect( iRoomsCombo, SIGNAL( currentRoomChanged( Room * ) ), this, SIGNAL( currentRoomChanged( Room * ) ) );\r
 \r
        iTimeDisplay = new DigitalTimeDisplayWidget( aCurrentDateTime.time(), iConfiguration->displaySettings()->timeFormat(), this );\r
        iTimeDisplay->setFrameVisible( false );\r
index e50229a..7be6080 100644 (file)
@@ -3,6 +3,7 @@
 #include <QEvent>
 #include <QDialog>
 #include "ViewBase.h"
+#include "PopUpMessageBox.h"
 
 #include <QtDebug>
 
@@ -105,7 +106,7 @@ void WindowManager::error( const QString &aErrorMessage )
 {
        qDebug() << "WindowManager::showErrorPopup";
 
-//     PopUpMessageBox::error( 0, aErrorMessage );
+       showDialog( static_cast<QDialog *>( PopUpMessageBox::error( 0, aErrorMessage ) ) );
 }
 
 void WindowManager::setFullscreen()