src/UserInterface/Components/ \
src/UserInterface/Utils/ \
src/UserInterface/Views/
-HEADERS += src/UserInterface/Utils/ProgressBar.h \
+HEADERS += src/IO/DeviceControl/OperationModeToggler.h \
+ src/UserInterface/Utils/ProgressBar.h \
src/Domain/Room.h \
src/Domain/Meeting.h \
src/Domain/Configuration/ConnectionSettings.h \
src/UserInterface/Views/SettingsView.h \
src/UserInterface/WindowManager.h \
src/UserInterface/Views/ViewBase.h
-SOURCES += src/UserInterface/Utils/ProgressBar.cpp \
+SOURCES += src/IO/DeviceControl/OperationModeToggler.cpp \
+ src/UserInterface/Utils/ProgressBar.cpp \
src/Domain/Room.cpp \
src/Domain/Meeting.cpp \
src/Domain/Configuration/ConnectionSettings.cpp \
resources/UserInterface.qrc
CONFIG += link_pkgconfig
PKGCONFIG += libalarm
-
//DEFINES += DEBUG_OUTPUT_TO_FILE
executable.files = qtmeetings
executable.path = /usr/bin/
<error code="210">Error storing data of original automatic screen switching-off and dimming parameter values. Using the default values instead.</error>
<error code="211">Error fetching data of original automatic screen switching-off and dimming parameter values. Using the default values instead.</error>
<error code="212">Failed to change the operation mode. Error changing automatic screen switching-off and dimming parameter values.</error>
- <error code="213">Failed to change the operation mode. Error restarting the device.</error>
+ <error code="213">Failed to change the operation mode. Error restarting the device. Restart device manually.</error>
</errors>
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 );
}
{
qDebug() << "Engine::ErrorHandler, aCode: " << aCode;
// inform UI about the problem
- if( aCode >= 100 && aCode <= 110 )
+ if( aCode >= 100 && aCode <= 150 )
qDebug() << "CommunicationManager signaled an error:" << aCode;
-// iWindowManager->error( ErrorMapper::codeToString( aCode, aAddInfo ) );
+ // iWindowManager->closeProgressBar();
+ // iWindowManager->error( ErrorMapper::codeToString( aCode, aAddInfo ) );
}
void Engine::currentRoomChanged( Room *aCurrentRoom )
// connect( iWindowManager, SIGNAL( progressBarCancelled() ), this, SLOT( progressBarCancelled() ) );
// connect( iDevice, SIGNAL( changingMode( const QString & ) ),
// iWindowManager, SLOT( updateProgressBar( const QString & ) ) );
+ // TODO : Connect the signal directory to progress bar dialog which should be instance in engine
+// connect( iDevice, SIGNAL( changingMode( const QString & ) ),
+// iWindowManager, SLOT( updateProgressBar( const QString & ) ) );
+ connect( iDevice, SIGNAL( changingModeFailed() ), this, SLOT( progressBarCancelled() ) );
iDevice->changeMode( true );
break;
}
{
iIdleTimeCounter->start();
}
-}
\ No newline at end of file
+}
+
+void Engine::fetchMeetingDetailsCancelled()
+{
+ iCommunication->cancelFetchMeetingDetails();
+ iWindowManager->closeProgressBar();
+}
class Configuration;
class CommunicationManager;
class Meeting;
-// class DeviceManager;
class WeeklyViewWidget;
class SettingsView;
class RoomStatusIndicatorWidget;
* Slot. Receives the cancel event of the progress bar.
*/
void progressBarCancelled();
+ //! 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 handleViewEvent();
void previousViewRestored();
}
}
+void CommunicationManager::cancelFetchMeetingDetails()
+{
+ const RequestData *rd = NULL;
+ for( rd = findRequest( GetCalendarItem );rd != NULL; )
+ {
+ int id = rd->requestId;
+ iCancelledRequests.append( id );
+ rd = findRequest( GetCalendarItem );
+ }
+}
+
void CommunicationManager::getMeetingDetails( Meeting &aMeeting )
{
ReqMsgGetCalendarItem msg( aMeeting.secondaryId() );
void CommunicationManager::requestFinished( int aRequestId, int aError )
{
RequestData* rd = takeRequest( aRequestId );
+ if( iCancelledRequests.contains( rd->requestId ) )
+ {
+ iCancelledRequests.removeAll( rd->requestId );
+ delete rd;
+ return;
+ }
QByteArray* response = iFetchingCommunication->response( aRequestId );
qDebug() << "CommunicationManager::requestFinished: id: " << aRequestId << " error: " << aError;
* \param aMeeting A meeting the detailed information is wanted.
*/
void fetchMeetingDetails( Meeting &aMeeting );
+ //! Cancels all meeting detail requests.
+ void cancelFetchMeetingDetails();
/* Not supported member functions which are using the modifying communication
void setModifyCredentials( const QString &aUsername, const QString &aPassword ) {};
void createMeeting( const Meeting &aMeeting ) {};
QList<Meeting*> iMeetings;
//! Additional information about requests made to the Exchange server
QList<RequestData*> iRequestInfos;
+ //! A flag that all meeting detail requests has been cancelled
+ QList<int> iCancelledRequests;
};
#endif /*COMMUNICATIONMANAGER_H_*/
}
bool DeviceConfigurator::toggleScreenSwitchOff( bool aEnable )
-{
+{
qDebug() << "DeviceConfigurator::toggleScreenSwitchOff( bool )";
QString command = "gconftool-2";
QStringList args;
#include "StartupSettings.h"
#include "DeviceDataStorage.h"
#include "DeviceConfigurator.h"
+#include "OperationModeToggler.h"
#include <QtDebug>
#include <QStringList>
DeviceManager::~DeviceManager()
{
qDebug() << "DeviceManager::~DeviceManager()";
+ delete iDataStorage;
+ iDataStorage = 0;
+ delete iAlarmSender;
+ iAlarmSender = 0;
+ delete iConfigurator;
+ iConfigurator = 0;
+ delete iDataStorage;
+ iDataStorage = 0;
+ delete iHWKeyListener;
+ iHWKeyListener = 0;
}
void DeviceManager::initDeviceManager()
handleKeyPresses( true );
return;
}
-
- switch ( iMode )
- {
- case EmptyMode:
- // error occured. Mode cannot be changed
- errorSender( ModeNotFetched );
- handleKeyPresses( true );
- break;
- case StandAloneMode:
-
- // change to KioskMode
- emit changingMode( "Changing to Kiosk mode" );
- while( 1 );
-
- // check if auto turn on/off functionality enabled and send turn on/off alarm events to alarm daemon
- if ( iSettings->isPowersavingEnabled() )
- {
- if ( !iAlarmSender->sendAlarms( iSettings->turnOnAt(), iSettings->turnOffAt() ) )
- {
- handleKeyPresses( true );
- return; //this is critical so returning if no success
- }
- }
-
- // - disable the certain hw keys (only "home"-hw-key at the moment)
- // - register init script to launch the application when ever the device is launched
- // - disable the screen "auto-switch-off" and "dimming"
- // - store info about the new operation mode
- if ( !iConfigurator->toggleHWKeys( false ) ||
- !iConfigurator->toggleInitScript( true ) ||
- !iConfigurator->toggleScreenSwitchOff( false ) ||
- !this->storeOperationMode( KioskMode ) ||
- !iConfigurator->restartDevice() )
- {
-
- // we have to roll back if something fails
- // of course rolling back may fail as well but it is impossible to catch
- iSendErrorMessages = false;
- iAlarmSender->removeAlarms();
- iConfigurator->toggleHWKeys( true );
- iConfigurator->toggleInitScript( false );
- iConfigurator->toggleScreenSwitchOff( true );
- iSendErrorMessages = true;
- handleKeyPresses( true );
- return;
- }
- break;
-
- case KioskMode:
- // change to StandAloneInProgress mode
-
- // - enable the certain hw keys (only "home"-hw-key at the moment)
- // - unregister the init script
- // - enable the screen "auto-switch-off" and "dimming"
- // - store info about the new operation mode
- if ( !iConfigurator->toggleHWKeys( true ) ||
- !iConfigurator->toggleScreenSwitchOff( true ) ||
- !this->storeOperationMode( StandAloneModeInProgress ) ||
- !iAlarmSender->removeStoredAlarms() ||
- !iConfigurator->restartDevice() )
- {
- // we have to roll back if something fails
- // of course rolling back may fail as well but it is impossible to catch
- iSendErrorMessages = false;
- iConfigurator->toggleHWKeys( false );
- iConfigurator->toggleInitScript( true );
- iConfigurator->toggleScreenSwitchOff( false );
- this->storeOperationMode( KioskMode );
- iSendErrorMessages = true;
- handleKeyPresses( true );
- return;
- }
-
- break;
- default: // StandAloneModeInProgress should never come in question
- break;
- }
+ 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( changingMode( const QString & ) ), this, SIGNAL( changingMode( const QString & ) ) );
+ connect( iModeToggler, SIGNAL( toggleErrorSending( bool ) ), this, SLOT( toggleErrorSending( bool ) ) );
+ iModeToggler->start();
}
bool DeviceManager::setCurrentOperationMode()
return true;
}
-bool DeviceManager::storeOperationMode( OperationMode aMode )
-{
- qDebug() << "DeviceManager::storeOperationMode( const OperationMode & )";
- QStringList modeStrList;
- QString str;
- modeStrList.append( str.append( QString( "%1" ).arg( aMode ) ) );
- if ( !iDataStorage->storeData( iDataStorage->dataSectionToString( DeviceDataStorage::DeviceMode ), modeStrList ) )
- {
- errorSender( ModeNotStored );
- return false;
- }
- return true;
-}
-
bool DeviceManager::finalizeStandAloneMode()
{
qDebug() << "DeviceManager::finalizeStandAloneMode()";
- if ( !storeOperationMode( StandAloneMode ) || !iConfigurator->toggleInitScript( false ) )
+ if ( !OperationModeToggler::storeOperationMode( StandAloneMode, iDataStorage ) || !iConfigurator->toggleInitScript( false ) ) {
+ errorSender( DeviceManager::ModeNotStored );
return false;
+ }
return true;
}
emit error( ERROR_BASE + ( int )aErrorCode, aAddInfo );
}
+
+void DeviceManager::toggleErrorSending( bool aToggle )
+{
+ iSendErrorMessages = aToggle;
+}
+
+void DeviceManager::modeChanged()
+{
+ if( iModeToggler != 0 ) {
+ if ( iModeToggler->success() ) //mode changing went well
+ iConfigurator->restartDevice();
+ else
+ emit changingModeFailed();
+ delete iModeToggler;
+ iModeToggler = 0;
+ }
+
+ //in case device restarting fails we just continue
+ handleKeyPresses( true );
+}
\ No newline at end of file
class StartupSettings;
class DeviceDataStorage;
class DeviceConfigurator;
+class OperationModeToggler;
static const int ERROR_BASE=200;
* \param aAddInfo Possible additional information.
*/
void error( int aCode, const QString &aAddInfo );
-
+ //! Signal. Emitted during the operation mode change to explain the current sub-change.
+ /*!
+ * Signal. Emitted during the operation mode change to explain the current sub-change.
+ * \param aMessage Explains the sub-change
+ */
void changingMode( const QString &aMessage );
+ //! Signal. Emitted if the operation mode change fails.
+ /*!
+ * Signal. Emitted if the operation mode change fails.
+ */
+ void changingModeFailed();
private slots:
//! Slot. Handles "full screen"-hardware key presses.
* \param aAddInfo The possible additional error text.
*/
void errorSender( DeviceManager::ErrorCode aErrorCode, const QString &aAddInfo = "" );
+ //! Slot. Is called after the operation mode changing is finished.
+ /*!
+ * Slot. Is called after the operation mode changing is finished. If everything went fine, restarts
+ * the device.
+ */
+ void modeChanged();
+ //! Slot. Toggles an attribute that indicates whether the errors should be sent.
+ /*!
+ * Slot. Toggles an attribute that indicates whether the errors should be sent.
+ * \param aToggle Indicates if the errors are wanted to be shown.
+ */
+ void toggleErrorSending( bool aToggle );
private:
//! Updates the internal indicator of the current operation mode.
* \return True if operation mode fetching succeeds; otherwise, false.
*/
bool setCurrentOperationMode();
- //! Stores the current operation mode.
- /*!
- * Stores the current operation mode by asking the DeviceDataStorage to write it to the internal
- * data storage.
- * \param aMode The operation mode that user wants to activate.
- * \return True if operation mode storing succeeds; otherwise, false.
- */
- bool storeOperationMode( OperationMode aMode );
//! Asks DeviceConfigurator to remove the deactivate script of the application.
/*!
* Asks DeviceConfigurator to remove the deactivate script of the application. Also asks
StartupSettings *iSettings;
DeviceDataStorage *iDataStorage;
DeviceConfigurator *iConfigurator;
+ OperationModeToggler *iModeToggler;
OperationMode iMode;
bool iSendErrorMessages;
--- /dev/null
+#include "OperationModeToggler.h"
+#include "DeviceManager.h"
+#include "StartupSettings.h"
+#include "AlarmSender.h"
+#include "DeviceConfigurator.h"
+#include "DeviceDataStorage.h"
+
+#include <QtDebug>
+
+OperationModeToggler::OperationModeToggler(
+ DeviceManager::OperationMode aMode,
+ StartupSettings *aSettings,
+ AlarmSender *aAlarmSender,
+ DeviceConfigurator *aConfigurator,
+ DeviceDataStorage *aDataStorage
+ ) :
+ iMode( aMode ),
+ iSettings( aSettings ),
+ iAlarmSender( aAlarmSender ),
+ iConfigurator( aConfigurator ),
+ iDataStorage( aDataStorage ),
+ iSuccess( true )
+{
+ qDebug() << "OperationModeToggler::OperationModeToggler( ... )";
+}
+
+OperationModeToggler::~OperationModeToggler()
+{
+ qDebug() << "OperationModeToggler::~OperationModeToggler()";
+}
+
+void OperationModeToggler::run()
+{
+ switch ( iMode )
+ {
+ case DeviceManager::EmptyMode:
+ // error occured. Mode cannot be changed
+ emit error( DeviceManager::ModeNotFetched );
+ iSuccess = false;
+ return;
+ case DeviceManager::StandAloneMode:
+
+ // change to KioskMode
+
+ // check if auto turn on/off functionality enabled and send turn on/off alarm events to alarm daemon
+ if ( iSettings->isPowersavingEnabled() )
+ {
+ emit changingMode( "Sending the auto launch alarms to alarm daemon." );
+ if ( !iAlarmSender->sendAlarms( iSettings->turnOnAt(), iSettings->turnOffAt() ) )
+ {
+ iSuccess = false;
+ return; //this is critical so returning if no success
+ }
+ }
+
+ // - disable the certain hw keys (only "home"-hw-key at the moment)
+ // - register init script to launch the application when ever the device is launched
+ // - disable the screen "auto-switch-off" and "dimming"
+ // - store info about the new operation mode
+
+ emit changingMode( "Disabling home hardware-key." );
+ sleep( 2 );
+ if( !iConfigurator->toggleHWKeys( false ) )
+ iSuccess = false;
+ if( iSuccess ) {
+ emit changingMode( "Installing the application init start-up script." );
+ sleep( 2 );
+ if ( !iConfigurator->toggleInitScript( true ) )
+ iSuccess = false;
+ }
+ if( iSuccess ) {
+ emit changingMode( "Disabling the screen switching off and dimming." );
+ sleep( 2 );
+ if( !iConfigurator->toggleScreenSwitchOff( false ) )
+ iSuccess = false;
+ }
+ if( iSuccess ) {
+ emit changingMode( "Storing information about the new operation mode." );
+ sleep( 2 );
+ if( !storeOperationMode( DeviceManager::KioskMode, iDataStorage ) ) {
+ emit error( DeviceManager::ModeNotStored );
+ iSuccess = false;
+ }
+ }
+ if( !iSuccess ) {
+ // we have to roll back if something fails
+ // of course rolling back may fail as well but it is impossible to catch
+ emit toggleErrorSending( false );
+ iAlarmSender->removeAlarms();
+ iConfigurator->toggleHWKeys( true );
+ iConfigurator->toggleInitScript( false );
+ iConfigurator->toggleScreenSwitchOff( true );
+ emit toggleErrorSending( true );
+ return;
+ }
+ break;
+
+ case DeviceManager::KioskMode:
+ // change to StandAloneInProgress mode
+
+ // - enable the certain hw keys (only "home"-hw-key at the moment)
+ // - unregister the init script
+ // - enable the screen "auto-switch-off" and "dimming"
+ // - store info about the new operation mode
+ emit changingMode( "Enabling home hardware-key." );
+ sleep( 2 );
+ if( !iConfigurator->toggleHWKeys( true ) )
+ iSuccess = false;
+ if( iSuccess ) {
+ emit changingMode( "Enabling the screen switching off and dimming." );
+ sleep( 2 );
+ if( !iConfigurator->toggleScreenSwitchOff( true ) )
+ iSuccess = false;
+ }
+ if( iSuccess ) {
+ emit changingMode( "Storing information about the new operation mode." );
+ sleep( 2 );
+ if( !storeOperationMode( DeviceManager::StandAloneModeInProgress, iDataStorage ) ) {
+ emit error( DeviceManager::ModeNotStored );
+ iSuccess = false;
+ }
+ }
+ if( iSuccess ) {
+ emit changingMode( "Removing the auto launch alarms from alarm daemon." );
+ sleep( 2 );
+ if( !iAlarmSender->removeStoredAlarms() )
+ iSuccess = false;
+ }
+ if( !iSuccess ) {
+ // we have to roll back if something fails
+ // of course rolling back may fail as well but it is impossible to catch
+ emit toggleErrorSending( false );
+ iConfigurator->toggleHWKeys( false );
+ iConfigurator->toggleInitScript( true );
+ iConfigurator->toggleScreenSwitchOff( false );
+ storeOperationMode( DeviceManager::KioskMode, iDataStorage );
+ emit toggleErrorSending( true );
+ return;
+ }
+ break;
+ default: // StandAloneModeInProgress should never come in question
+ break;
+ }
+}
+
+bool OperationModeToggler::success()
+{
+ return iSuccess;
+}
+
+bool OperationModeToggler::storeOperationMode( DeviceManager::OperationMode aMode, DeviceDataStorage *aDataStorage )
+{
+ qDebug() << "OperationModeToggler::storeOperationMode( const OperationMode & )";
+ QStringList modeStrList;
+ QString str;
+ modeStrList.append( str.append( QString( "%1" ).arg( aMode ) ) );
+ if ( !aDataStorage->storeData( aDataStorage->dataSectionToString( DeviceDataStorage::DeviceMode ), modeStrList ) )
+ return false;
+ return true;
+}
--- /dev/null
+#ifndef OPERATIONMODETOGGLER_H_
+#define OPERATIONMODETOGGLER_H_
+
+#include "DeviceManager.h"
+
+#include <QThread>
+
+class StartupSettings;
+class AlarmSender;
+class DeviceConfigurator;
+class DeviceDataStorage;
+
+class OperationModeToggler : public QThread
+{
+ Q_OBJECT
+
+public:
+ //! Constructor.
+ /*!
+ * Constructor for HWKeyListener class
+ */
+ OperationModeToggler(
+ DeviceManager::OperationMode aMode,
+ StartupSettings *aSettings,
+ AlarmSender *aAlarmSender,
+ DeviceConfigurator *aConfigurator,
+ DeviceDataStorage *aDataStorage
+ );
+
+ //! Destructor.
+ virtual ~OperationModeToggler();
+ //! Run method of the class.
+ /*!
+ * Run method of the class.
+ */
+ void run();
+ //! Returns the success status of the operation mode change.
+ /*!
+ * Returns the success status of the operation mode change.
+ */
+ bool success();
+ //! Stores the current operation mode.
+ /*!
+ * Stores the current operation mode by asking the DeviceDataStorage to write it to the internal
+ * data storage.
+ * \param aMode The operation mode that user wants to activate.
+ * \return True if operation mode storing succeeds; otherwise, false.
+ */
+ 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 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.
+ */
+ void error( DeviceManager::ErrorCode aCode );
+ //! 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
+ * mode changes made so far have to be rolled back. During this we don't want to show possible new
+ * errors.
+ * \param aToggle Indicates if the errors are wanted to be shown.
+ */
+ void toggleErrorSending( bool aToggle );
+ //! Signal. Emitted during the operation mode change to explain the current sub-change.
+ /*!
+ * Signal. Emitted during the operation mode change to explain the current sub-change.
+ * \param aMessage Explains the sub-change
+ */
+ void changingMode( const QString &aMessage );
+
+private:
+ DeviceManager::OperationMode iMode;
+ StartupSettings *iSettings;
+ AlarmSender *iAlarmSender;
+ DeviceConfigurator *iConfigurator;
+ DeviceDataStorage *iDataStorage;
+ bool iSuccess;
+};
+
+#endif /*OPERATIONMODETOGGLER_H_*/
void ScheduleTableWidget::mousePressEvent( QMouseEvent* aEvent )
{
activateMeeting( aEvent->x(), aEvent->y() );
+ iTabletBlocked = false;
}
void ScheduleTableWidget::populateMeetingList()
iProgress = new QProgressBar();
iProgress->setMinimumWidth( 200 );
- iProgress->setMaximum( 0 );
+ iProgress->setRange( 0, 0 );
+ iProgress->reset();
iProgress->setTextVisible( false );
QVBoxLayout *mainLayout = new QVBoxLayout;
subLayout->addWidget( buttonCancel );
connect( buttonCancel, SIGNAL( pressed() ), this, SIGNAL( cancel() ) );
}
-
+ mainLayout->addLayout( subLayout );
+ mainLayout->setAlignment( Qt::AlignCenter );
setLayout( mainLayout );
}
{
qDebug() << "ProgressBar::update( const QString & )";
iLabel->setText( aMessage );
-}
\ No newline at end of file
+}
#include <QtDebug>
-const int IDLE_TIME_MULTIPLIER = 60000; // Multiplies milliseconds to minutes
-
WindowManager::WindowManager( QWidget *aParent ) :
QWidget( aParent ),
iApplicationName( tr( "Qt Meetings" ) ),
return QWidget::event( event );
}
+void WindowManager::error( const QString &aErrorMessage )
+{
+ qDebug() << "WindowManager::showErrorPopup";
+
+ PopUpMessageBox::error( 0, aErrorMessage );
+}
+
void WindowManager::setFullscreen()
{
this->setWindowState( Qt::WindowFullScreen );
+<<<<<<< HEAD:src/UserInterface/WindowManager.h
#ifndef WINDOWMANAGER_H_\r
#define WINDOWMANAGER_H_\r
\r
};\r
\r
#endif /*WINDOWMANAGER_H_*/\r
+=======
+#ifndef WINDOWMANAGER_H_
+#define WINDOWMANAGER_H_
+
+#include <QObject>
+#include <QTime>
+#include "Room.h"
+#include "Meeting.h"
+#include "PasswordDialog.h"
+#include "DeviceManager.h"
+
+class QTimer;
+class RoomStatusIndicatorWidget;
+class WeeklyViewWidget;
+class Engine;
+class MeetingInfoDialog;
+class SettingsView;
+class ProgressBar;
+class Configuration;
+
+//! UserInterface class. Behaves as a proxy between the user interface and application's business logic.
+/*!
+ * UserInterface class. Controls the whole user interface, starting with displaying the appropriate
+ * views. It behaves as a proxy between the user interface and application's business logic, it connects
+ * the specified components together and forwards the data to the correct place. It also manages the correct
+ * appearance of current views on the screen.
+ */
+class WindowManager : public QObject
+{
+ Q_OBJECT
+
+public:
+ //! Constructor.
+ /*!
+ * Constructor of WindowManager.
+ * \param aConfiguration The pointer to configuration.
+ */
+ WindowManager( Configuration *aConfiguration );
+ //! Destructor.
+ virtual ~WindowManager();
+ /*!
+ * Displays an error message
+ * \param aErrorMessage Message to be displayd
+ */
+ void error( const QString &aErrorMessage );
+ //! Updates the rooms status.
+ /*!
+ * Forwards the signal of changed status to current view.
+ * \param aRoom Room which status is changed.
+ * \param aStatus Current status of room.
+ * \param aTime Time when status is changed.
+ */
+ void roomStatusChanged( Room *aRoom, Room::Status aStatus, QTime aTime );
+ //! Shows the password dialog.
+ /*!
+ * Shows the password dialog.
+ * \param aAdminPassword The correct password.
+ * \param aMessage The message to be shown in the password dialog.
+ */
+ void showPasswordDialog( QByteArray aAdminPassword, const QString &aMessage );
+ //! Closes the password dialog.
+ /*!
+ * Closes the password dialog.
+ */
+ void closePasswordDialog();
+ //! Displays the weekly view.
+ /*!
+ * Displays the weekly view.
+ */
+ void showWeeklyView();
+ //! Displays the meeting info dialog.
+ /*!
+ * Displays the meeting info dialog.
+ * \param aMeeting Meeting to be displayd
+ */
+ void showMeetingInfo( Meeting *aMeeting );
+ //! Returns the pointer to the weekly view.
+ /*!
+ * Returns the pointer to the weekly view.
+ */
+ WeeklyViewWidget * weeklyView();
+ //! Switches the views to full screen.
+ /*!
+ * Switches the views to full screen.
+ */
+ void fullScreen();
+ //! Shows the progress bar.
+ /*!
+ * Starts showing the progress bar.
+ * \param aText The text to be shown in progress bar.
+ * \param aCancellable Is the Cancel button visible. By default not visible.
+ */
+ void showProgressBar( const QString &aText, bool aCancellable = false );
+ //! Closes the progress bar.
+ /*!
+ * Closes the progress bar.
+ */
+ void closeProgressBar();
+
+ void insertMeeting( Meeting *aMeeting );
+
+ void deleteMeeting( Meeting *aMeeting );
+
+signals:
+ //! Request current status of the room.
+ /*!
+ * Signal is emitted when there is need to check current status of room aRoom.
+ * \param aRoom Meetingroom which status is requested.
+ */
+ void roomStatusInfoNeeded( Room *aRoom );
+ //! Indicate that some user event has happened.
+ /*!
+ * Signal is emitted if some user event has happened.
+ */
+ void observedEventDetected();
+ //! Meeting activated.
+ /*!
+ * Signal is emitted when a meeting is clicked by the user.
+ * \param aMeeting actived meeting.
+ */
+ void meetingActivated( Meeting *aMeeting );
+ //! Signals if the shown week has been changed.
+ /*!
+ * Signal. Emitted if the shown week has been changed.
+ * \param aDate The first date of the shown week.
+ */
+ void shownWeekChanged( QDate aDate );
+ //! Signals change of the meeting room.
+ /*!
+ * Signal is emitted when meeting room is changed.
+ * \param aRoom Selected meeting room.
+ */
+ void currentRoomChanged( Room *aRoom );
+ //! Signals when the password dialog buttons are clicked.
+ /*!
+ * Signal is emitted when the password dialog buttons are clicked.
+ * \param aPasswordStatus The status of the password.
+ */
+ void passwordEntered( PasswordDialog::PasswordStatus aPasswordStatus );
+ //! Signals when the cancel button in the progress bar is clicked.
+ /*!
+ * Signal is emitted when the cancel button in the progress bar is clicked.
+ */
+ void progressBarCancelled();
+
+public slots:
+ //! Slot for displaying the screensaver (room status view).
+ /*!
+ * Slot. Displays the screensaver.
+ */
+ void showRoomStatus();
+ //! Slot for updating the time.
+ /*!
+ * Slot. Forwards the signal of changed time to current view.
+ * \param aCurrentDateTime Current date and time.
+ */
+ void distributeDateTimeInfo( QDateTime aCurrentDateTime );
+
+ void updateProgressBar( const QString &aMessage );
+
+private slots:
+ //! Displays the settings view
+ void showSettingsView();
+
+private:
+ //! Name of the application.
+ QString iApplicationName;
+ //! Defines whether the views should be shown as full screen
+ bool iFullScreen;
+ //! Pointer to the configuration.
+ Configuration *iConfiguration;
+ //! Pointer to the weekly view.
+ WeeklyViewWidget *iWeeklyView;
+ //! Pointer to the screensaver (room status view).
+ RoomStatusIndicatorWidget *iRoomStatusView;
+ //! Pointer to the meeting info dialog
+ MeetingInfoDialog *iMeetingInfo;
+ //! Pointer to the settings view
+ SettingsView *iSettingsView;
+ //! Pointer to the progress bar
+ ProgressBar *iProgressBar;
+ //! Pointer to the password dialog.
+ PasswordDialog *iPasswordDialog;
+
+};
+
+#endif /*WINDOWMANAGER_H_*/
+>>>>>>> deb6aee06a80416a24a64c2ac6349a2341acdc39:src/UserInterface/WindowManager.h