<error code="110">Communication error</error>
<error code="111">Communication: Invalid username or password</error>
<error code="200">Device Control: Error creating internal file storage.</error>
- <error code="201">Failed to change the operation mode. Error removing old alarm events.</error>
- <error code="202">Failed to change the operation mode. Error sending alarm events. %1</error>
- <error code="203">Failed to change the operation mode. Error storing data about sent alarm events. Removing the already sent alarm events.</error>
- <error code="204">Error storing data of original automatic screen switching-off and dimming parameter values. Using the default values instead.</error>
- <error code="205">Error fetching data of original automatic screen switching-off and dimming parameter values. Using the default values instead.</error>
- <error code="206">Failed to change the operation mode. Error changing automatic screen switching-off and dimming parameter values.</error>
- <error code="207">Failed to change the operation mode. Error fetching data of original hardware key settings.</error>
- <error code="208">Failed to change the operation mode. Error storing data of original hardware key settings.</error>
- <error code="209">Failed to change the operation mode. Error changing hardware key settings.</error>
- <error code="210">Failed to change the operation mode. Init script to auto launch the application was not installed/removed.</error>
- <error code="211">Failed to change the operation mode. The application failed to know the current mode of itself.</error>
- <error code="212">Failed to change the operation mode. The application failed to store the current mode of itself.</error>
- <error code="213">Failed to change the operation mode. Error restarting the device. Restart device manually.</error>
+ <error code="201">Device Control: Error removing old alarm events.</error>
+ <error code="202">Device Control: Error sending alarm events. %1</error>
+ <error code="203">Device Control: Error storing data about sent alarm events. Removing the already sent alarm events.</error>
+ <error code="204">Device Control: Error storing data of original automatic screen switching-off and dimming parameter values. Used the default values instead.</error>
+ <error code="205">Device Control: Error fetching data of original automatic screen switching-off and dimming parameter values. Used the default values instead.</error>
+ <error code="206">Device Control: Error changing automatic screen switching-off and dimming parameter values.</error>
+ <error code="207">Device Control: Error fetching data of original hardware key settings.</error>
+ <error code="208">Device Control: Error storing data of original hardware key settings.</error>
+ <error code="209">Device Control: Error changing hardware key settings.</error>
+ <error code="210">Device Control: Init script to auto launch the application was not installed/removed.</error>
+ <error code="211">Device Control: The application failed to know the current mode of itself.</error>
+ <error code="212">Device Control: The application failed to store the current mode of itself.</error>
+ <error code="213">Device Control: Error restarting the device. Restart device manually to activate operation mode change.</error>
</errors>
// fetchMeetings( from, to, iWindowManager->weeklyView()->currentRoom() );
}
-void Engine::changeDeviceMode( bool aChange )
+void Engine::changeDeviceMode()
{
- if ( aChange )
- {
- connect( iDevice, SIGNAL( changingModeFailed() ), this, SLOT( changeModeFailed() ) );
- iAutoRefresh->stop(); // Stop the meeting update
- }
- iDevice->changeMode( aChange );
+ connect( iDevice, SIGNAL( changeModeFailed() ), this, SLOT( changeModeFailed() ) );
+ iAutoRefresh->stop(); // Stop the meeting update
+ iDevice->changeMode();
}
void Engine::changeModeFailed()
{
qDebug() << "Engine::progressBarCancelled()";
- iDevice->changeMode( false );
iAutoRefresh->start(); //we start the metting updating
}
iWindowManager->show();
iUIManager->showMainView();
+ // This triggers the meeting fetching
+ iUIManager->currentRoomChanged( this->iCurrentRoom );
+
qDebug() << "[Engine::initUserInterface] <Finished>";
}
void Engine::handleViewEvent()
{
- if ( iIdleTimeCounter != 0 )
+ if ( iIdleTimeCounter != 0 && iIdleTimeCounter->isActive())
{
// Restart the idle time counter when view event is received
iIdleTimeCounter->stop();
void Engine::currentRoomChanged(Room *aRoom)
{
+ qDebug() << "[Engine::currentRoomChanged] <invoked>";
iCurrentRoom = aRoom;
}
\ No newline at end of file
void stopIdleTimeCounter();
void startIdleTimeCounter();
- void changeDeviceMode( bool aChange );
+ void changeDeviceMode();
void currentRoomChanged( Room *aRoom );
if ( iEngine == 0 ) return;
if ( iWindowManager == 0 ) return;
- qDebug() << "[UIManager::ctor] <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>";
-
createWeeklyView();
createSettingsView();
createRoomStatusIndicator();
createPasswordDialog();
createProgressBar();
createMeetingInfoDialog();
-
- qDebug() << "[UIManager::ctor] <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>";
}
UIManager::~UIManager()
iWindowManager->showView( iWeeklyView );
}
-void UIManager::showProgressBar( QString aText )
-{
- if ( iProgressBar != 0 )
- {
- iProgressBar->update( aText );
- iWindowManager->showDialog( iProgressBar );
- }
-}
-
// ===============================================
// INITIALIZE THE UIMANAGER
void UIManager::createWeeklyView()
void UIManager::createPasswordDialog()
{
- iPasswordDialog = new PasswordDialog( iEngine->iConfiguration->adminPassword(), tr("UIManager::createPasswordDialog"), tr("UIManager::createPasswordDialog") );
-
+ iPasswordDialog = new PasswordDialog( iEngine->iConfiguration->adminPassword(), "", tr("Enter password") );
connect( iPasswordDialog, SIGNAL( passwordEntered( PasswordDialog::PasswordStatus ) ), this, SLOT( passwordEntered( PasswordDialog::PasswordStatus ) ) );
}
void UIManager::createProgressBar()
{
iProgressBar = new ProgressBar( tr("CHANGE THIS"), true );
-
// Connect to UIManager
connect( iProgressBar, SIGNAL( cancel() ), this, SLOT( progressBarCancelled() ) );
// Connect to Engine
{
if ( iProgressBar != 0 )
{
- iProgressBar->update( tr("Fetching meeting info...") );
+ iProgressBar->update( tr( "Fetching meeting info..." ), tr( "Please wait" ) );
+ iProgressBar->toggleCancellable( true );
iWindowManager->showDialog( static_cast<QDialog *>( iProgressBar ), false, false );
- iEngine->stopIdleTimeCounter();
}
}
if ( iProgressBar != 0 )
{
iProgressBar->close();
- iEngine->startIdleTimeCounter();
}
}
void UIManager::changeModeOrdered( DeviceManager::OperationMode aMode )
{
qDebug() << "[UIManager::changeModeOrdered] <Invoked>";
-
- QString message = tr( "You are about to change operation mode to %1." )
- .arg( iEngine->iDevice->operationModeToString( aMode ) );
if ( iPasswordDialog != 0 )
{
- // TODO : Set the new text for password dialog
+ QString text = tr( "You are about to change operation mode to %1." )
+ .arg( iEngine->iDevice->operationModeToString( aMode ) );
+ iPasswordDialog->update( text );
iWindowManager->showDialog( static_cast<QDialog *>( iPasswordDialog ) );
}
}
void UIManager::currentRoomChanged(Room *aRoom)
{
+ qDebug() << "[UIManager::currentRoomChanged] <Invoked>";
if ( iWeeklyView != 0 )
{
QDateTime from = QDateTime( iWeeklyView->beginnigOfShownWeek() );
// Show the progress bar..
if ( iProgressBar != 0 )
{
- iWindowManager->showDialog( static_cast<QDialog *>( iProgressBar ), false );
+ iProgressBar->update( tr( "" ), tr( "Changing operation mode" ) );
+ iProgressBar->toggleCancellable( false );
+ iWindowManager->showDialog( static_cast<QDialog *>( iProgressBar ), false, false );
}
// ... and initiate the mode changing
- iEngine->changeDeviceMode( true );
+ iEngine->changeDeviceMode();
break;
case PasswordDialog::Incorrect:
iWindowManager->error( tr("Incorrect Password") );
+ break;
case PasswordDialog::Canceled:
- iEngine->changeDeviceMode( false );
break;
}
class CommunicationManager;
class QDateTime;
+//! User Interface manager class.
+/*!
+ * User Interface manager class that is responsible for handling
+ * UI actions. It creates the needed views and connects signals
+ * accordingly. All interactions with the UI is handled by this
+ * class. The Engine class handles the basic logic and does not
+ * know or care about the UI and this class does not know or care
+ * about the basic logic only UI related actions (signals, events etc.).
+ */
class UIManager : public QObject
{
Q_OBJECT
UIManager( Engine *aEngine, WindowManager *aWindowManager );
virtual ~UIManager();
+ //! Connects Device Managers signals.
+ /*!
+ * This method connects Device Managers signals directly to UI
+ * components or to it selft.
+ */
void connectDeviceManager( DeviceManager *aDeviceManager );
+ //! Connects Communication Managers signals.
+ /*!
+ * This method connects Communication Managers signals directly to UI
+ * components or to it selft.
+ */
void connectCommunicationManager( CommunicationManager *aCommunicationManager );
+ //! Shows the main view.
+ /*!
+ * Makes the main view visible trough WindowManager.
+ */
void showMainView();
- void showProgressBar( QString aText );
signals:
public slots:
+ //! Handles setting view request.
+ /*!
+ * Handles request to show settings view. Makes the
+ * view visible and stops the idle time counter.
+ */
void settingsViewRequest();
+ //! Handles setting views ok clicked.
+ /*!
+ * Handles the setting views Ok button clicked
+ * signal. Sets the weekly view visible and starts
+ * the idle time counter.
+ */
void settingsOkClicked();
+ //! Handles setting views cancel clicked.
+ /*!
+ * Handles the setting views Cancel button clicked
+ * signal. Sets the weekly view visible and starts
+ * the idle time counter.
+ */
void settingsCancelClicked();
+ //! Handles room status indicator view request.
+ /*!
+ * Handles the request to show room status indicator
+ * view. Sets the view visible and stops the idle
+ * time counter. The WindowManager handles restoring
+ * what ever view was previously visible.
+ */
void roomStatusIndicatorRequested();
+ //! Handles previousViewRestored signal.
+ /*!
+ * Handles the restoring of previous view. This is usually
+ * signaled by WindowManager when room status indicator
+ * view is being hidden.
+ */
void previousViewRestored();
+ //! Handle change mode order.
+ /*!
+ * Handles change mode order. Displays the password query dialog
+ * and waits for its response.
+ */
void changeModeOrdered( DeviceManager::OperationMode aMode );
+ //! Handles select room change.
+ /*!
+ * Handles the changing of currently select room. Engine is requested
+ * to start fetching new meetings for currently shown week.
+ */
+ void currentRoomChanged( Room *aRoom );
private slots:
void meetingsFetched( const QList<Meeting*> &aMeetings );
void meetingDetailsFetched( Meeting &aDetailedMeeting );
- void currentRoomChanged( Room *aRoom );
void progressBarCancelled();
void updateTime( QDateTime aDateTime );
void passwordEntered( PasswordDialog::PasswordStatus aStatus );
void CommunicationManager::cancelFetchMeetingDetails()
{
- const RequestData *rd = NULL;
- for( rd = findRequest( GetCalendarItem );rd != NULL; )
- {
- int id = rd->requestId;
+ const RequestData *rd = findRequest( GetCalendarItem );
+ if( rd != NULL ) {
+ int id = rd->requestId;
iCancelledRequests.append( id );
- rd = findRequest( GetCalendarItem );
}
}
bool DeviceConfigurator::toggleScreenSwitchOff( bool aEnable )
{
qDebug() << "DeviceConfigurator::toggleScreenSwitchOff( bool )";
+ emit configuringError( DeviceManager::ScreenSettingsNotChanged );
+ return false;
QString command = "gconftool-2";
QStringList args;
QByteArray result;
#include <QtDebug>
#include <QStringList>
-DeviceManager::DeviceManager( StartupSettings *aSettings )
+DeviceManager::DeviceManager( StartupSettings *aSettings ) :
+ iAlarmSender( 0 ),
+ iHWKeyListener( 0 ),
+ iSettings( 0 ),
+ iDataStorage( 0 ),
+ iConfigurator( 0 ),
+ iModeToggler( 0 )
{
qDebug() << "DeviceManager::DeviceManager( StartupSettings * )";
void DeviceManager::initDeviceManager()
{
qDebug() << "DeviceManager::init()";
+
+ qRegisterMetaType<DeviceManager::ErrorCode>("DeviceManager::ErrorCode");
+
iDataStorage = new DeviceDataStorage();
connect( iDataStorage, SIGNAL( dataStorageInitFailed( DeviceManager::ErrorCode ) ),
this, SLOT( errorSender( DeviceManager::ErrorCode ) ) );
iMode = EmptyMode;
iHWKeyListener = new HWKeyListener();
- handleKeyPresses( true );
+ handleHWKeyPresses( true );
}
DeviceManager::OperationMode DeviceManager::currentOperationMode()
}
}
-void DeviceManager::changeMode( bool aChange )
+void DeviceManager::changeMode()
{
qDebug() << "void DeviceManager::changeMode()";
- if( !aChange ) {
- handleKeyPresses( true );
- return;
+ if( iModeToggler == 0 ) {
+ iModeToggler = new OperationModeToggler( iMode, iSettings, iAlarmSender, iConfigurator, iDataStorage );
+ connect( iModeToggler, SIGNAL( finished() ), this, SLOT( modeChanged() ) );
+ 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();
}
- iModeToggler = new OperationModeToggler( iMode, iSettings, iAlarmSender, iConfigurator, iDataStorage );
- connect( iModeToggler, SIGNAL( finished() ), this, SLOT( modeChanged() ) );
- 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();
}
bool DeviceManager::setCurrentOperationMode()
return true;
}
-void DeviceManager::handleKeyPresses( bool aHandle )
-{
- qDebug() << "DeviceManager::handleKeyPresses( bool )";
- if ( !aHandle )
- disconnect( iHWKeyListener, SIGNAL( HWKeyFullScreenPressed() ), this, SLOT( HWKeyFullScreenPressed() ) );
- else
- connect( iHWKeyListener, SIGNAL( HWKeyFullScreenPressed() ), this, SLOT( HWKeyFullScreenPressed() ) );
-}
-
void DeviceManager::HWKeyFullScreenPressed()
{
qDebug() << "DeviceManager::HWKeyFullScreenPressed()";
-
+ handleHWKeyPresses( false );
// no more key presses before this one is handled
- handleKeyPresses( false );
-
+ //handleKeyPresses( false );
OperationMode nextMode;
- switch ( iMode )
- {
+ switch ( iMode ) {
case KioskMode:
nextMode = StandAloneMode;
break;
}
if ( nextMode != EmptyMode )
emit changeModeOrdered( nextMode );
- else
- handleKeyPresses( true );
}
void DeviceManager::errorSender( DeviceManager::ErrorCode aErrorCode, const QString &aAddInfo )
{
qDebug() << "DeviceManager::modeChanged()";
if( iModeToggler != 0 ) {
- if ( iModeToggler->success() ) //mode changing went well
+ if ( iModeToggler->success() ) {//mode changing went well
+ emit changingMode( "Restarting device" );
+ sleep( 2 );
iConfigurator->restartDevice();
+ }
else
emit changeModeFailed();
delete iModeToggler;
iModeToggler = 0;
}
-
- //in case device restarting fails we just continue
- handleKeyPresses( true );
+ handleHWKeyPresses( true );
+}
+
+void DeviceManager::handleHWKeyPresses( bool aToggle )
+{
+ qDebug() << "DeviceManager::handleHWKeyPresses( bool )";
+ if( aToggle )
+ connect( iHWKeyListener, SIGNAL( HWKeyFullScreenPressed() ), this, SLOT( HWKeyFullScreenPressed() ) );
+ else
+ disconnect( iHWKeyListener, SIGNAL( HWKeyFullScreenPressed() ), this, SLOT( HWKeyFullScreenPressed() ) );
}
//! Changes the operation mode.
/*!
* Changes the operation mode.
- * \param aChange To indicate if the mode should be changed or not
*/
- void changeMode( bool aChange );
+ void changeMode();
+ void handleHWKeyPresses( bool aToggle );
signals:
//! Signal. Emitted if user tries to change the operation mode.
* \return True if operation mode storing and deactivation of the init script succeed; otherwise, false.
*/
bool finalizeStandAloneMode();
- //! Connects/disconnects the HWKeyListener signals to the private HWKeyFullScreenPressed() slot.
- /*!
- * Connects/disconnects the HWKeyListener signals to the private HWKeyFullScreenPressed() slot. In case
- * a signal is caught the connection is disabled until the signal handling is finished.
- * \param aHandle indicates if the signals should be connected or not.
- */
- void handleKeyPresses( bool aHandle );
private:
AlarmSender *iAlarmSender;
bool HWKeyListener::eventFilter( QObject*, QEvent* e )
{
- if ( e->type() == QEvent::KeyPress )
+ if ( e->type() == QEvent::KeyRelease )
{
QKeyEvent *keyEvent = static_cast<QKeyEvent *>( e );
switch ( keyEvent->key() )
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()
if ( !iAlarmSender->sendAlarms( iSettings->turnOnAt(), iSettings->turnOffAt() ) )
{
iSuccess = false;
+ emit changingMode( "Rolling back changes..." );
return; //this is critical so returning if no success
}
}
// 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 );
+ emit changingMode( "Rolling back changes..." );
iAlarmSender->removeAlarms();
iConfigurator->toggleHWKeys( true );
iConfigurator->toggleInitScript( false );
// 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 );
+ emit changingMode( "Rolling back changes..." );
iConfigurator->toggleHWKeys( false );
iConfigurator->toggleInitScript( true );
iConfigurator->toggleScreenSwitchOff( false );
QVBoxLayout *layout = new QVBoxLayout;
- if ( !aText.isNull() )
- {
- QLabel *text = new QLabel( aText );
- layout->addWidget( text );
- layout->addStretch();
- }
+ iText = new QLabel( aText );
+ layout->addWidget( iText );
+ layout->addStretch();
iPasswordEdit = new QLineEdit;
iPasswordEdit->setEchoMode( QLineEdit::Password );
layout->addLayout( buttonLayout );
// Connect the user action signals to corresponding slots
- connect( buttonOK, SIGNAL( pressed() ), this, SLOT( okButtonPressed() ) );
- connect( buttonCancel, SIGNAL( pressed() ), this, SLOT( cancelButtonPressed() ) );
+ connect( buttonOK, SIGNAL( released() ), this, SLOT( okButtonPressed() ) );
+ connect( buttonCancel, SIGNAL( released() ), this, SLOT( cancelButtonPressed() ) );
// Enable the layout
setLayout( layout );
emit passwordEntered( PasswordDialog::Canceled );
}
+void PasswordDialog::update( const QString &aText )
+{
+ qDebug() << "PasswordDialog::update()";
+ iText->setText( aText );
+}
#include <QDialog>
class QLineEdit;
+class QLabel;
class QByteArray;
//! UserInterface class. Responsible for poping-up password query on the screen.
Incorrect, /*!< Incorrect password. */
Canceled
};
+
+ //! Constructor.
+ /*!
+ * Constructor to initialize a PasswordDialog instance.
+ * \param aParent The parent object.
+ * \param aPassword The password.
+ */
+ PasswordDialog( const QString &aPassword, const QString &aText, const QString &aTitle = "", QWidget *aParent = 0 );
+ //! Destructor.
+ virtual ~PasswordDialog();
+ //! Updates the text of the password dialog label.
+ /*!
+ * Updates the text of the password dialog label.
+ * \param aText The text for the label.
+ */
+ void update( const QString &aText );
signals:
//! Signals the authenticity of the password when the uuser dismisses the dialog.
void okButtonPressed();
void cancelButtonPressed();
-public:
- //! Constructor.
- /*!
- * Constructor to initialize a PasswordDialog instance.
- * \param aParent The parent object.
- * \param aPassword The password.
- */
- PasswordDialog( const QString &aPassword, const QString &aText, const QString &aTitle = "", QWidget *aParent = 0 );
- //! Destructor.
- virtual ~PasswordDialog();
-
+private:
QLineEdit *iPasswordEdit;
+ QLabel *iText;
QByteArray iPasswordHash;
};
#include <QLabel>
#include <QtDebug>
-ProgressBar::ProgressBar( const QString &aText, bool aCancellable, QWidget *aParent ) :
+ProgressBar::ProgressBar( const QString &aTitle, bool aCancellable, QWidget *aParent ) :
QDialog( aParent )
{
qDebug() << "ProgressBar::ProgressBar( const QString &, bool, QWidget *)";
- setWindowTitle( aText );
+ setWindowTitle( aTitle );
+
setModal( true );
iProgress = new QProgressBar();
mainLayout->addWidget( iLabel );
QHBoxLayout *subLayout = new QHBoxLayout;
subLayout->addWidget( iProgress );
- if( aCancellable ) {
- QPushButton *buttonCancel = new QPushButton( tr( "Cancel" ) );
- subLayout->addSpacing( 5 );
- subLayout->addWidget( buttonCancel );
- connect( buttonCancel, SIGNAL( pressed() ), this, SIGNAL( cancel() ) );
+
+ iButton = new QPushButton( tr( "Cancel" ) );
+ subLayout->addSpacing( 5 );
+ subLayout->addWidget( iButton );
+ connect( iButton, SIGNAL( pressed() ), this, SIGNAL( cancel() ) );
+ if( !aCancellable ) {
+ iButton->setVisible( false );
}
+
mainLayout->addLayout( subLayout );
mainLayout->setAlignment( Qt::AlignCenter );
setLayout( mainLayout );
qDebug() << "ProgressBar::~ProgressBar()";
}
-void ProgressBar::update( const QString &aMessage )
+void ProgressBar::update( const QString &aMessage, const QString &aTitle )
{
qDebug() << "ProgressBar::update( const QString & )";
iLabel->setText( aMessage );
+ if( aTitle != "" )
+ setWindowTitle( aTitle );
+}
+
+void ProgressBar::toggleCancellable( bool aEnable )
+{
+ if( aEnable )
+ iButton->setVisible( true );
+ else
+ iButton->setVisible( false );
}
class QProgressBar;
class QLabel;
+class QPushButton;
//! UserInterface class.
/*!
/*!
* Constructor to initialize the StatusWidget instance.
* \param aParent Parent object.
- * \param aText Title string to be set to the progress bar.
+ * \param aTitle Title string to be set to the progress bar.
*/
- ProgressBar( const QString &aText, bool aCancellable = false, QWidget *aParent = 0 );
+ ProgressBar( const QString &aTitle, bool aCancellable = false, QWidget *aParent = 0 );
//! Destructor.
virtual ~ProgressBar();
+ //! Updates the text fields of progress bar dialog.
+ /*!
+ * Updates the text fields of progress bar dialog.
+ * \param aMessage The text for the label of the dialog.
+ * \param aTitle Title string to be set to the progress bar.
+ */
+ void update( const QString &aMessage, const QString &aTitle = "" );
- void update( const QString &aMessage );
+ void toggleCancellable( bool aEnable );
signals:
//! Signal. Emitted if user presses cancel button.
private:
QProgressBar *iProgress;
QLabel *iLabel;
+ QPushButton *iButton;
};
#include "DigitalTimeDisplayWidget.h"\r
#include "ToolBox.h"\r
\r
+#include <QEvent>\r
+\r
#include <QtDebug>\r
\r
QTime RoomStatusIndicatorWidget::endOfTheDay = QTime( 23, 59, 0, 0 );\r
\r
QPalette RoomStatusIndicatorWidget::createPalette( Room::Status aStatus )\r
{\r
- QPixmap pixmap( aStatus == Room::BusyStatus ? ":roomstatus_busy" : ":roomstatus_free" );\r
+ // QPixmap pixmap( aStatus == Room::BusyStatus ? ":roomstatus_busy" : ":roomstatus_free" );\r
+ QString image = aStatus == Room::BusyStatus ? ":roomstatus_busy" : ":roomstatus_free";\r
\r
// The image needs to be moved in normal mode so the traffic light not partly outside the screen\r
const int xoffset( 60 );\r
const int yoffset( 19 );\r
- int cropwidth( pixmap.width() - xoffset );\r
- int cropheight( pixmap.height() - yoffset );\r
+// int cropwidth( pixmap.width() - xoffset );\r
+// int cropheight( pixmap.height() - yoffset );\r
\r
QBrush brush;\r
if ( windowState() == Qt::WindowFullScreen )\r
{\r
// Use the full image in full screen mode\r
- brush.setTexture( pixmap );\r
+// brush.setTexture( pixmap );\r
+ brush.setTexture( QPixmap(image) );\r
}\r
else\r
{\r
// Take part of the image so the traffic lights are moved xoffset poxels to left \r
// and yoffset pixels to up\r
- brush.setTexture( pixmap.copy( xoffset, yoffset, cropwidth, cropheight ) );\r
+// brush.setTexture( pixmap.copy( xoffset, yoffset, cropwidth, cropheight ) );\r
+ brush.setTexture( QPixmap(image) );\r
}\r
\r
QPalette palette;\r
iUntilTextLabel->setText( tr( "until %1" ).arg( aUntil.toString( iTimeFormat ) ) );\r
}\r
setPalette( createPalette( aStatus ) );\r
+}
+\r
+void RoomStatusIndicatorWidget::currentRoomChanged( Room *aRoom )\r
+{\r
+ iDefaultRoomLabel->setText( aRoom->name() );\r
+}\r
+\r
+bool RoomStatusIndicatorWidget::event(QEvent *event)\r
+{\r
+ switch(event->type())\r
+ {\r
+ case QEvent::Paint:\r
+ qDebug() << "[RoomStatusIndicatorWidget::event] <Paint event>";\r
+ break;\r
+ case QEvent::PaletteChange:\r
+ qDebug() << "[RoomStatusIndicatorWidget::event] <Palette change event>";\r
+ break;\r
+ default:\r
+ break;\r
+ }\r
+ \r
+ return ViewBase::event( event );\r
}\r
class QVBoxLayout;\r
class TimeDisplayWidget;\r
\r
+class QEvent;\r
+\r
//! UserInterface class. Indicates if the default meeting room is busy or not.\r
/*!\r
* UserInterface class. Indicates if the default meeting room is busy or not. This widget\r
RoomStatusIndicatorWidget( Room *aDefaultRoom, Room::Status aStatus, QTime aUntil, QString aTimeFormat, QWidget *aParent = 0 );\r
//! Destructor.\r
virtual ~RoomStatusIndicatorWidget();\r
+ \r
+ bool event(QEvent *event);\r
\r
public slots:\r
//! Slot. Sets current time.\r