<error code="109">Communication: SOAP error when fetching meeting details</error>
<error code="110">Communication error</error>
<error code="111">Communication: Invalid username or password</error>
- <error code="200">Failed to change the operation mode. Error creating internal file storage.</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">Failed to change the operation mode. Error fetching data of original hardware key settings.</error>
- <error code="205">Failed to change the operation mode. Error storing data of original hardware key settings.</error>
- <error code="206">Failed to change the operation mode. Error changing hardware key settings.</error>
- <error code="207">Failed to change the operation mode. Init script to auto launch the application was not installed/removed.</error>
- <error code="208">Failed to change the operation mode. The application failed to know the current mode of itself.</error>
- <error code="209">Failed to change the operation mode. The application failed to store the current mode of itself.</error>
- <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="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>
</errors>
void Engine::observedEventDetected()
{
qDebug() << "Engine::observedEventDetected()";
- iWindowManager->showWeeklyView();
+ iWindowManager->refreshMeetings( iMeetings );
// prepare to restart idle counter
if ( iIdleTimeCounter->isActive() )
{
iCommunication->fetchMeetingDetails( *aMeeting );
}
-bool Engine::isMeetingInList( const QList<Meeting*> &aList, const Meeting *aMeeting )
-{
- qDebug() << "Engine::isMeetingInList( const QList<Meeting*> &, const Meeting * )";
- for ( int i = 0; i < aList.count(); i++ )
- {
- if ( aMeeting->equals( *(aList.at( i )) ) )
- {
- return true;
- }
- }
- return false;
-}
-
void Engine::meetingsFetched( const QList<Meeting*> &aMeetings )
{
qDebug() << "Engine::meetingsFetched( const QList<Meeting*> & )";
- // check if there is any new meeting in the list came from the server -> added
- for ( int i = 0; i < aMeetings.count(); i++ )
- {
- // if the (i)th meeting is not in the local meeting list
- if ( !isMeetingInList( iMeetings, aMeetings.at( i ) ) )
- {
- // add to the local database =)
- Meeting* m = new Meeting( *(aMeetings.at( i )) );
- iMeetings.append( m );
- // and signal the changes
- iWindowManager->insertMeeting( m );
- }
+
+ for ( int i = 0; i < iMeetings.count(); ++i ) {
+ Meeting* m = iMeetings.takeAt( i );
+ delete m;
}
-
- // check if there is any meeting NOT in the list came from the server -> deleted
- for ( int i = 0; i < iMeetings.count(); i++ )
- {
- // if the (i)th meeting is in the local but NOT in the server's meeting list
- if ( !isMeetingInList( aMeetings, iMeetings.at( i ) ) )
- {
- Meeting* m = iMeetings.takeAt( i );
- // signal the changes
- iWindowManager->deleteMeeting( m );
- // delete the meeting from the local list
- delete m;
- }
+ iMeetings.clear();
+ for ( int i = 0; i < aMeetings.count(); ++i ) {
+ Meeting* m = new Meeting( *(aMeetings.at( i )) );
+ iMeetings.append( m );
}
+ iWindowManager->refreshMeetings( iMeetings );
// refresh room status info
roomStatusInfoNeeded( defaultRoom() );
}
* \return Index of the meeting if found; otherwise, -1.
*/
int indexOfMeetingAfter( Room *aRoom, QDateTime aAfter );
- //! Indicates if the QList contains the Meeting or not.
- /*!
- * Indicates if the QList contains the Meeting or not.
- * \param aList List of meetings.
- * \param aMeeting The meeting which is seeked in the list for.
- * \return True if contains; otherwise, false.
- */
- static bool isMeetingInList( const QList<Meeting*> &aList, const Meeting *aMeeting );
//! Slot. Fetches meetings from the server.
/*!
* Slot. Fetches meetings from the server, exact parameters are specified in the parameter list.
bool DeviceManager::setCurrentOperationMode()
{
- qDebug() << "DeviceManager::currentOperationMode()";
+ qDebug() << "DeviceManager::setCurrentOperationMode()";
QStringList modeResult;
if ( !iDataStorage->readData( iDataStorage->dataSectionToString( DeviceDataStorage::DeviceMode ), modeResult ) )
{
void ScheduleTableWidget::paintEvent( QPaintEvent* aEvent )
{
+ qDebug() << "ScheduleTableWidget::paintEvent()";
QTableWidget::paintEvent( aEvent );
ScheduleWidget* schedule = static_cast<ScheduleWidget*>( parent() );
void ScheduleTableWidget::populateMeetingList()
{
+ qDebug() << "ScheduleTableWidget::populateMeetingList()";
ScheduleWidget* schedule = static_cast<ScheduleWidget*>( parent() );
for ( int i = 0; i < schedule->weekLengthAsDays(); ++i )
ScheduleWidget::~ScheduleWidget()
{
- clear();
delete iScheduleTable;
}
return iShownDate.addDays( -1 * iShownDate.dayOfWeek() + 1 );
}
-Meeting* ScheduleWidget::currentMeeting()
-{
- return meeting( iCurrentDateTime );
-}
-
-Meeting* ScheduleWidget::meeting( QDateTime aAt )
-{
- for ( int i = 0; i < iMeetings.count(); ++i )
- {
- if ( iMeetings[i]->startsAt() <= aAt && iMeetings[i]->endsAt() >= aAt )
- {
- return iMeetings[i];
- }
- }
-
- return 0;
-}
-
-void ScheduleWidget::clear()
-{
- qDebug() << "ScheduleWidget::clear";
- int i = 0;
- while ( !iMeetings.isEmpty() )
- {
- i++;
- iMeetings.removeFirst();
- }
- qDebug() << "Deleted " << i << " items";
-}
-
-void ScheduleWidget::clear( QDateTime aFrom, QDateTime aUntil )
-{
- for ( int i = 0; i < iMeetings.count(); ++i )
- {
- if (( iMeetings[i]->startsAt() >= aFrom && iMeetings[i]->startsAt() <= aUntil ) ||
- ( iMeetings[i]->startsAt() <= aFrom && iMeetings[i]->endsAt() >= aFrom ) )
- {
- iMeetings.removeAt( i );
- --i;
- }
- }
-}
-
void ScheduleWidget::refresh()
{
+ qDebug() << "ScheduleWidget::refresh()";
+
for ( int i = 0; i < iScheduleTable->columnCount(); ++i )
{
QTableWidgetItem* item = iScheduleTable->item( 0, i );
item->setFont( font );
}
}
-
+
// force repaint of the main area
iScheduleTable->setSpan( 1, 1, iNumberOfHours, weekLengthAsDays() );
iLastRefresh = iCurrentDateTime.time();
}
+void ScheduleWidget::refreshMeetings( const QList<Meeting*> &aMeetings )
+{
+ iMeetings = aMeetings;
+ qDebug() << "Count: " << iMeetings.size();
+ refresh();
+}
+
void ScheduleWidget::setCurrentDateTime( QDateTime aCurrentDateTime )
{
- Meeting* previous = meeting( iCurrentDateTime );
- Meeting* current = meeting( aCurrentDateTime );
iCurrentDateTime = aCurrentDateTime;
if ( iLastRefresh.secsTo( iCurrentDateTime.time() ) > sRefreshIntervalInSeconds )
// enough time has elapsed since last refresh
refresh();
}
-
- if ( previous != current )
- {
- emit currentMeetingChanged( current );
- }
-}
-
-void ScheduleWidget::insertMeeting( Meeting *aMeeting )
-{
- Meeting* previous = meeting( iCurrentDateTime );
- iMeetings.append( aMeeting );
- Meeting* current = meeting( iCurrentDateTime );
-
- qDebug() << "Inserted" << aMeeting->toString();
-
- refresh();
-
- if ( previous != current )
- {
- emit currentMeetingChanged( current );
- }
}
-void ScheduleWidget::removeMeeting( Meeting *aMeeting )
-{
- Meeting* previous = meeting( iCurrentDateTime );
-
- qDebug() << "Delete" << aMeeting->toString();
- for ( int i = 0; i < iMeetings.count(); ++i )
- {
- if ( iMeetings[i]->equals( *(aMeeting) ) )
- {
- iMeetings.removeAt( i );
-
- refresh();
-
- Meeting* current = meeting( iCurrentDateTime );
- if ( previous != current )
- emit currentMeetingChanged( current );
-
- return;
- }
- }
-}
-
-//void ScheduleWidget::updateMeeting( Meeting *aMeeting )
-//{
-//
-//}
-
void ScheduleWidget::showPreviousWeek()
{
iShownDate = iShownDate.addDays( -7 );
//! Destructor.
~ScheduleTableWidget();
+
+ //! Populates meeting list.
+ /*!
+ * Populates meeting list.
+ */
+ void populateMeetingList();
protected:
//! Handles drawing of main table area.
private:
- //! Populates meeting list.
- /*!
- * Populates meeting list.
- */
- void populateMeetingList();
-
//! Finds overlapping meetings.
/*!
* Finds overlapping meetings.
*/
QDate beginningOfShownWeek();
- //! Gets current meeting.
- /*!
- * Gets current meeting.
- * \return current meeting, 0 if none.
- */
- Meeting* currentMeeting();
-
- //! Gets meeting at a specified date and time.
- /*!
- * Gets meeting at a specified date and time.
- * \param aAt Time when the meeting is.
- * \return meeting At the given time, 0 if none.
- */
- Meeting* meeting( QDateTime aAt );
-
signals:
//! Signal. Emitted if a meeting is activated.
* \param aMeeting Actived meeting.
*/
void meetingActivated( Meeting *aMeeting );
-
- //! Signal. Emitted when the current meeting changes to another.
- /*!
- * Signal. Emitted when the current meeting changes to another.
- * \param aNewMeeting New meeting.
- */
- void currentMeetingChanged( Meeting *aNewMeeting );
-
//! Signal. Emitted if the shown week has been changed.
/*!
* Signal. Emitted if the shown week has been changed.
public slots:
- //! Slot. Clears all meetings.
- /*!
- * Slot. Clears all meetings.
- */
- void clear();
-
- //! Slot. Clears meetings based on a range.
- /*!
- * Slot. Clears meetings based on a range.
- * \param aFrom Date and time from which the meetings are cleared.
- * \param aUntil Date and time until which the meetings are cleared.
- */
- void clear( QDateTime aFrom, QDateTime aUntil );
-
//! Slot. Refreshes display.
/*!
* Slot. Refreshes display.
+ * \param aMeetings The meeting list.
*/
void refresh();
-
+ //! Refreshes the meeting list.
+ /*!
+ * Refreshes the meeting list.
+ * \param aMeetings The list of meetings.
+ */
+ void refreshMeetings( const QList<Meeting*> &aMeetings );
+
//! Slot. Sets current date and time.
/*!
* Slot. Sets current date and time.
*/
void setCurrentDateTime( QDateTime aCurrentDateTime );
- //! Slot. Inserts a meeting to the schedule.
- /*!
- * Slot. Inserts a meeting to the schedule.
- * \param aMeeting Meeting to be inserted.
- */
- void insertMeeting( Meeting *aMeeting );
-
- //! Slot. Removes a meeting from the schedule.
- /*!
- * Slot. Removes a meeting from the schedule.
- * \param aMeeting Meeting to be removed.
- */
- void removeMeeting( Meeting *aMeeting );
-
- //! Slot. Updates a meeting in the schedule. (TODO)
- /*!
- * Slot updates a meeting in the schedule.
- * \param aMeeting Meeting was updated.
- */
- void updateMeeting( Meeting */*aMeeting*/ ) {};
-
//! Slot. Shows previous week.
/*!
* Slot. Shows previous week.
//! Current date and time.
QDateTime iCurrentDateTime;
- //! Meetings.
- QList<Meeting*> iMeetings; /*! Not owned */
-
//! Currently shown week.
QDate iShownDate;
//! When refresh() was called previously
QTime iLastRefresh;
+
+ //! Meetings.
+ QList<Meeting*> iMeetings; /*! Not owned */
//! Color for a free cell.
static const QColor sFreeBackground;
connect( iRoomsCombo, SIGNAL( currentRoomChanged( Room * ) ), this, SIGNAL( observedEventDetected() ) );\r
connect( iRoomsCombo, SIGNAL( currentIndexChanged( int ) ), this, SIGNAL( observedEventDetected() ) );\r
// TODO: connect RoomCombo signals to change meetings data.\r
- connect( iRoomsCombo, SIGNAL( currentRoomChanged( Room * ) ), iSchedule, SLOT( clear() ) );\r
connect( iRoomsCombo, SIGNAL( currentRoomChanged( Room * ) ), this, SIGNAL( currentRoomChanged( Room * ) ) );\r
connect( iRoomsCombo, SIGNAL( currentRoomChanged( Room * ) ), iSchedule, SLOT( refresh() ) );\r
}\r
}\r
}\r
\r
-Meeting* WeeklyViewWidget::currentMeeting()\r
-{\r
- return iSchedule->currentMeeting();\r
-}\r
-\r
Room* WeeklyViewWidget::currentRoom()\r
{\r
return iRoomsCombo->currentRoom();\r
iSchedule->setCurrentDateTime( aCurrentDateTime );\r
}\r
\r
-void WeeklyViewWidget::insertMeeting( Meeting *aMeeting )\r
-{\r
- iSchedule->insertMeeting( aMeeting );\r
-}\r
-\r
-void WeeklyViewWidget::deleteMeeting( Meeting *aMeeting )\r
-{\r
- iSchedule->removeMeeting( aMeeting );\r
-}\r
-\r
-void WeeklyViewWidget::updateMeeting( Meeting *aMeeting )\r
+QDate WeeklyViewWidget::beginnigOfShownWeek()\r
{\r
- iSchedule->updateMeeting( aMeeting );\r
+ return iSchedule->beginningOfShownWeek();\r
}\r
\r
-QDate WeeklyViewWidget::beginnigOfShownWeek()\r
+void WeeklyViewWidget::refreshMeetings( const QList<Meeting*> &aMeetings )\r
{\r
- return iSchedule->beginningOfShownWeek();\r
+ qDebug() << "WeeklyViewWidget::refreshMeetings()";\r
+ iSchedule->refreshMeetings( aMeetings );\r
}\r
//! Destructor.\r
virtual ~WeeklyViewWidget();\r
\r
- //! Current meeting\r
- /*!\r
- * Returns the current meeting if any\r
- * \return Current meeting if any, otherwise null pointer\r
- */\r
- Meeting* currentMeeting();\r
//! Current room\r
/*!\r
* Returns the currently selected meeting room.\r
* \return First day of week.\r
*/\r
QDate beginnigOfShownWeek();\r
+ //! Sends the refresh command to schedule widget.\r
+ /*!\r
+ * Sends the refresh command to schedule widget.\r
+ * \param aMeetings The list of meetings.\r
+ */\r
+ void refreshMeetings( const QList<Meeting*> &aMeetings );\r
+ \r
\r
signals:\r
//! Signals change of the meeting room.\r
* \param aNewRoom Selected meeting room.\r
*/\r
void currentRoomChanged( Room *aNewRoom );\r
- //! Signals change of the current meeting.\r
- /*!\r
- * Signal is emited when new meeting is started.\r
- * \param aNewMeeting Meeting that has been started.\r
- */\r
- void currentMeetingChanged( Meeting *aNewMeeting );\r
//! Meeting activated.\r
/*!\r
* Signal is emitted when a meeting is clicked by the user.\r
* \param aCurrentDateTime Date and time to be displayd.\r
*/\r
void setCurrentDateTime( QDateTime aCurrentDateTime );\r
- //! Insert meeting\r
- /*!\r
- * Inserts new meeting into the calendar\r
- * \param aMeeting Meeting to be inserted.\r
- */\r
- void insertMeeting( Meeting *aMeeting );\r
- //! Delete meeting\r
- /*!\r
- * Removes meeting from the calendar\r
- * \param aMeeting Meeting to be deleted.\r
- */\r
- void deleteMeeting( Meeting *aMeeting );\r
- //! Update meeting\r
- /*!\r
- * Updates the display of given meeting in calendar.\r
- * \param aMeeting Meeting to be updated.\r
- */\r
- void updateMeeting( Meeting *aMeeting );\r
\r
private:\r
//! Displays the selectable meeting rooms.\r
iFullScreen = true;
}
-void WindowManager::insertMeeting( Meeting *aMeeting )
-{
- iWeeklyView->insertMeeting( aMeeting );
-}
-
-void WindowManager::deleteMeeting( Meeting *aMeeting )
-{
- iWeeklyView->deleteMeeting( aMeeting );
-}
-
void WindowManager::showMeetingInfo( Meeting *aMeeting )
{
iMeetingInfo = new MeetingInfoDialog( aMeeting );
if( iProgressBar != 0 )
iProgressBar->update( aMessage );
}
+
+void WindowManager::refreshMeetings( const QList<Meeting*> &aMeetings )
+{
+ qDebug() << "WindowManager::refreshMeetings()";
+ iWeeklyView->refreshMeetings( aMeetings );
+}
* Closes the progress bar.
*/
void closeProgressBar();
+ //! Sends the refresh command to weekly view widget.
+ /*!
+ * Sends the refresh command to weekly view widget.
+ * \param aMeetings The list of meetings.
+ */
+ void refreshMeetings( const QList<Meeting*> &aMeetings );
- void insertMeeting( Meeting *aMeeting );
-
- void deleteMeeting( Meeting *aMeeting );
-
signals:
//! Request current status of the room.
/*!
delete room;
}
-void TestEngine::testUpdateMeeting()
-{
- Room* room = new Room( "foo", "bar" );
- Meeting* meeting = new Meeting( 1234, room, QDateTime( QDate( 2009, 4, 1 ), QTime( 12, 0, 0 ) ),
- QDateTime( QDate( 2009, 4, 1 ), QTime( 12, 30, 0 ) ) );
- iEngine->updateMeeting( meeting, "foo", "bar" );
- delete meeting;
- delete room;
-}
-
void TestEngine::testDeleteMeeting()
{
Room* room = new Room( "foo", "bar" );