1.0.6 candidate 1_0_6_candidate
authorRisto Lintinen <lintiri@lintiri-desktop.(none)>
Thu, 27 Aug 2009 05:38:59 +0000 (08:38 +0300)
committerRisto Lintinen <lintiri@lintiri-desktop.(none)>
Thu, 27 Aug 2009 05:38:59 +0000 (08:38 +0300)
commit 7e9daec272450fa2eeffe0a08732ef4696b37a4f
Author: Risto Lintinen <lintiri@lintiri-desktop.(none)>
Date:   Wed Aug 26 14:57:11 2009 +0300

    added refresh on statusbar click

commit 627d527566f469ac20bfd9ee536f4624f9dd0655
Author: Risto Lintinen <lintiri@lintiri-desktop.(none)>
Date:   Wed Aug 26 11:45:17 2009 +0300

    deleted unnecessary files

commit 52cdeca811d3ffc2804aede00616640d93429171
Author: Risto Lintinen <lintiri@lintiri-desktop.(none)>
Date:   Wed Aug 26 11:44:05 2009 +0300

    deb packaging improvements

commit a39640fc3ee32d823998ea9a14a106c8bca92b1c
Author: Risto Lintinen <lintiri@lintiri-desktop.(none)>
Date:   Tue Aug 25 10:28:23 2009 +0300

    fixes for debian install

commit 031dfbe58e5265dfff05b8ceb7ffae21be7c4868
Author: Risto Lintinen <lintiri@lintiri-desktop.(none)>
Date:   Tue Aug 25 10:27:15 2009 +0300

    User interface and menu fixes

commit 51d64b3d9f4cacc447c74e5811e692fbe9b4137f
Author: Risto Lintinen <lintiri@lintiri-desktop.(none)>
Date:   Mon Aug 24 12:04:45 2009 +0300

    Status bar fixed

commit a2659d5f04b1662bea18fbbbff3a763fcfe3ff7c
Author: Timo Holopainen <holopti@holopti-desktop.(none)>
Date:   Mon Aug 24 11:23:38 2009 +0300

    Show confidential meeting details setting added

    Squashed commit of the following:

    commit d8ce7147dfa33ee9bb79e10b09b3a82018bdb05b
    Author: Timo Holopainen <holopti@holopti-desktop.(none)>
    Date:   Mon Aug 24 11:03:06 2009 +0300

        Show confidential meeting details setting added to settings. Meeting view updated to support that privacy setting.

commit 11e5e6349ca6f86f864075fb9d38a778950cebf2
Author: Risto Lintinen <lintiri@lintiri-desktop.(none)>
Date:   Fri Aug 21 13:01:48 2009 +0300

    code warnings cleaned

commit 663a2fc8ce3a0b8b987655fe709a831a3db9b315
Author: Risto Lintinen <lintiri@lintiri-desktop.(none)>
Date:   Fri Aug 21 12:05:25 2009 +0300

    User interface update

30 files changed:
QtMeetings.conf
QtMeetings.pro
debian/changelog
debian/files [new file with mode: 0644]
debian/qtmeetings.install
resources/icons/roomstatus_busy.png
resources/icons/roomstatus_free.png
src/BusinessLogic/Engine.cpp
src/BusinessLogic/Engine.h
src/BusinessLogic/UIManager.cpp
src/Domain/Configuration/Configuration.cpp
src/Domain/Configuration/Configuration.h
src/IO/Communication/Communication.cpp
src/IO/Communication/Communication.h
src/IO/Communication/CommunicationManager.cpp
src/IO/Communication/CommunicationManager.h
src/UserInterface/Components/BorderedBarWidget.cpp [new file with mode: 0644]
src/UserInterface/Components/BorderedBarWidget.h [new file with mode: 0644]
src/UserInterface/Components/MeetingRoomCombo.cpp
src/UserInterface/Components/ScheduleWidget.cpp
src/UserInterface/Components/ScheduleWidget.h
src/UserInterface/Views/MeetingInfoDialog.cpp
src/UserInterface/Views/RoomStatusIndicatorWidget.cpp
src/UserInterface/Views/RoomStatusIndicatorWidget.h
src/UserInterface/Views/SettingsView.cpp
src/UserInterface/Views/SettingsView.h
src/UserInterface/Views/WeeklyViewWidget.cpp
src/UserInterface/Views/WeeklyViewWidget.h
src/UserInterface/WindowManager.cpp
src/UserInterface/WindowManager.h

index 04cb472..9f1d726 100644 (file)
@@ -2,11 +2,7 @@
 <configuration password="admin" >
 
        <connection>
-               <!-- TEST SERVER DATA-->
-               <!--<serverurl>192.168.0.35</serverurl>
-               <username>maemo</username>
-               <password>P@ssw0rd</password>-->
-               <serverurl>jklexch01.ixonos.com</serverurl>
+               <serverurl></serverurl>
                <username></username>
                <password></password>
                <!-- interval is interpreted in seconds -->
@@ -14,7 +10,7 @@
        </connection>
 
        <startup>
-               <powersaving enabled="true" on="08:00" off="17:00" />
+               <powersaving enabled="true" on="08:00" off="16:00" />
        </startup>
 
        <display>
index b4c6c65..e46c741 100644 (file)
@@ -13,7 +13,8 @@ INCLUDEPATH += src/Domain/ \
     src/UserInterface/Components/ \
     src/UserInterface/Utils/ \
     src/UserInterface/Views/
-HEADERS += src/BusinessLogic/UIManager.h \
+HEADERS += src/UserInterface/Components/BorderedBarWidget.h \
+    src/BusinessLogic/UIManager.h \
     src/IO/DeviceControl/OperationModeToggler.h \
     src/UserInterface/Utils/ProgressBar.h \
     src/Domain/Room.h \
@@ -48,7 +49,8 @@ HEADERS += src/BusinessLogic/UIManager.h \
     src/UserInterface/Views/SettingsView.h \
     src/UserInterface/WindowManager.h \
     src/UserInterface/Views/ViewBase.h
-SOURCES += src/BusinessLogic/UIManager.cpp \
+SOURCES += src/UserInterface/Components/BorderedBarWidget.cpp \
+    src/BusinessLogic/UIManager.cpp \
     src/IO/DeviceControl/OperationModeToggler.cpp \
     src/UserInterface/Utils/ProgressBar.cpp \
     src/Domain/Room.cpp \
index 08cf32a..ff20c47 100644 (file)
@@ -1,3 +1,10 @@
+qtmeetings (1.0.6-1) unstable; urgency=low
+
+  * Improved user interface
+  * Fix for settings read and write
+
+ -- Risto Lintinen <risto.lintinen@ixonos.com>  Mon, 24 May 2009 12:30:00 +0300
+
 qtmeetings (1.0.5-1) unstable; urgency=low
 
   * Improved communication module for getting a meeting secondary id and detailed information
diff --git a/debian/files b/debian/files
new file mode 100644 (file)
index 0000000..216a8e5
--- /dev/null
@@ -0,0 +1 @@
+qtmeetings_1.0.6-1_armel.deb user/other optional
index e69de29..ad52d9b 100644 (file)
@@ -0,0 +1,2 @@
+QtMeetings.conf etc
+QtMeetings.desktop usr/share/applications/hildon
index d735440..d69d8ba 100644 (file)
Binary files a/resources/icons/roomstatus_busy.png and b/resources/icons/roomstatus_busy.png differ
index 14aa52f..2c6edce 100644 (file)
Binary files a/resources/icons/roomstatus_free.png and b/resources/icons/roomstatus_free.png differ
index c7aad8b..6cf5ee4 100644 (file)
@@ -32,8 +32,7 @@ Engine::Engine() :
                iWindowManager( 0 ), iUIManager( 0 )
 {
        qDebug() << "Engine::Engine()";
-       iCommunicationFailed = false;
-       iCurrentWeekFetched = false;
+       iCommunicationFailed = true;
        
        initConfiguration();
        initDevice();
@@ -53,9 +52,15 @@ Engine::Engine() :
 
        // Create auto refresh timer
        iAutoRefresh = new QTimer;
-       iAutoRefresh->setInterval(iConfiguration->connectionSettings()->refreshInterval() * 1000);
+
+       iAutoRefresh->setInterval(Configuration::instance()->getRefreshinterval() * 1000);
+
        iAutoRefresh->start();
        connect( iAutoRefresh, SIGNAL( timeout() ), iAutoRefresh, SLOT( start() ) );
+       connect( iAutoRefresh, SIGNAL( timeout() ), this, SLOT( updateRoomInfo() ) );
+
+       connect(iWindowManager, SIGNAL(closeClicked()), this, SLOT(closeApplication()));
+
        // connect( iAutoRefresh, SIGNAL( timeout() ), this, SLOT( fetchMeetings() ) );
        
        if( iDevice->currentOperationMode() == DeviceManager::KioskMode )
@@ -64,7 +69,7 @@ Engine::Engine() :
        }
 
        connectSignals();
-       
+       connect( Configuration::instance(), SIGNAL( configurationChanged() ), this, SLOT( configurationChanged() ) );
        // QTimer::singleShot( 0, this, SLOT( fetchMeetings() ) );
 
        // TODO: continue implementation
@@ -105,7 +110,6 @@ Room* Engine::defaultRoom()
 void Engine::checkStatusOfAllRooms()
 {
        // TODO: Check if date has changed
-       //      qDebug() << "Engine::checkStatusOfAllRooms()";
        // iterate trough on the rooms
        for (int i = 0; i < iConfiguration->rooms().count(); i++)
        {
@@ -182,10 +186,14 @@ void Engine::fetchMeetingDetails( Meeting *aMeeting )
 void Engine::meetingsFetched( const QList<Meeting*> &aMeetings )
 {
        qDebug() << "Engine::meetingsFetched( const QList<Meeting*> & )";
-       // TODO: should check if this week's meetings were fetched
-       if( iCommunicationFailed || !iCurrentWeekFetched )
+       QTime c = QTime::currentTime();
+       iLastCommunication.setHMS( c.hour(), c.minute(), c.second() );
+
+       qDebug() << "Error length: "<< iCommunicationError.length();
+       qDebug() << "Error: "<< iCommunicationError;
+
+       if( iCommunicationError.length() == 0 )
        {
-               iCurrentWeekFetched = true;
                iCommunicationFailed = false;
                iUIManager->connectionEstablished();
        }
@@ -208,21 +216,42 @@ void Engine::meetingsFetched( const QList<Meeting*> &aMeetings )
 
 void Engine::errorHandler( int aCode, const QString &aAddInfo )
 {      
+       iCommunicationFailed = true;
+
        if( aCode >= 100 && aCode < 150 )
        {
-               iCommunicationFailed = true;
-               if ( iUIManager != 0 ) iUIManager->connectionLost();
+               if ( iUIManager != 0 )
+                       {
+                               iUIManager->connectionLost();
+                       }
        }
        if ( iWindowManager != 0 )
        {
-               iWindowManager->error( ErrorMapper::codeToString( aCode, aAddInfo ) );
+               iCommunicationError = ErrorMapper::codeToString( aCode, aAddInfo );
+               //iWindowManager->error( ErrorMapper::codeToString( aCode, aAddInfo ) );
        }
 }
 
+bool Engine::connected()
+{
+       return !iCommunicationFailed;
+}
+
+QTime Engine::lastUpdated()
+{
+       return iLastCommunication;
+}
+
+QString Engine::errorMessage()
+{
+       return iCommunicationError;
+}
+
 void Engine::fetchMeetings( const int aWeek, const int aYear, const Room *aIn )
 {
        qDebug()
                        << "Engine::fetchMeetings( const int aWeek, const int aYear, const Room * )";
+       iCommunicationError = "";
        iCommunication->fetchMeetings(aWeek, aYear, *aIn);
 }
 
@@ -234,6 +263,7 @@ void Engine::cancelFetchMeetingDetails()
 void Engine::shownWeekChanged( QDate aFrom )
 {
        qDebug() << "[Engine::shownWeekChanged] <Invoked>";
+       iCommunicationError = "";
        iCommunication->fetchMeetings( aFrom.weekNumber(), aFrom.year(), *iCurrentRoom/*defaultRoom()*/ );
 }
 
@@ -308,7 +338,7 @@ void Engine::connectSignals()
 void Engine::initCommunication()
 {
        // initialize communication
-       iCommunication = new CommunicationManager( *(iConfiguration->connectionSettings()) );
+       iCommunication = new CommunicationManager(/* *(iConfiguration->connectionSettings()) */);
        connect( iCommunication, SIGNAL( error( int, CommunicationManager::CommunicationType  ) ),
                        this, SLOT( errorHandler( int ) ) );
        connect( iCommunication, SIGNAL( meetingsFetched( const QList<Meeting*>& ) ),
@@ -385,4 +415,16 @@ void Engine::tick( QDateTime aCurrentDateTime )
                }
        }
        iCurrentDate = aCurrentDateTime.date();
-}
\ No newline at end of file
+}
+
+
+void Engine::updateRoomInfo()
+{
+       qDebug() << "ENGINE::: updateMeetings";
+       iUIManager->currentRoomChanged( iCurrentRoom );
+}
+
+void Engine::configurationChanged()
+{
+       iAutoRefresh->setInterval(Configuration::instance()->getRefreshinterval() * 1000);
+}
index c58e423..65690a1 100644 (file)
@@ -39,6 +39,10 @@ public:
         */
        Room* defaultRoom();
 
+       bool connected();
+       QTime lastUpdated();
+       QString errorMessage();
+
 signals:
 
        void roomStatusChanged( Room::Status aStatus, QTime aUntil );
@@ -122,6 +126,15 @@ private slots:
        
        void tick( QDateTime aCurrentDateTime );
        
+       /**
+        * Updates the current rooms info.
+        */
+       void updateRoomInfo();
+       /**
+        *
+        */
+       void configurationChanged();
+
 private:
        // Make the UIManager as friendly class so it can connect to private slots.
        friend class UIManager;
@@ -189,14 +202,13 @@ private:
 
 private:
        static QTime endOfTheDay;
-
-       WindowManager *iWindowManager;
        
        QTimer *iIdleTimeCounter;
        Clock *iClock;
        QDate iCurrentDate;
        Configuration *iConfiguration;
        CommunicationManager *iCommunication;
+       WindowManager *iWindowManager;
        DeviceManager *iDevice;
        UIManager *iUIManager;
 
@@ -206,7 +218,8 @@ private:
        
        Room *iCurrentRoom;
        bool iCommunicationFailed;
-       bool iCurrentWeekFetched;
+       QString iCommunicationError;
+       QTime iLastCommunication;
 };
 
 #endif /*ENGINE_H_*/
index eb80616..1c58381 100644 (file)
@@ -37,8 +37,9 @@ UIManager::UIManager( Engine *aEngine, WindowManager *aWindowManager ) :
        if ( iEngine == 0 ) return;
        if ( iWindowManager == 0 ) return;
        
+       connect(iWindowManager, SIGNAL(showSettingsClicked()), this, SLOT(settingsViewRequest()));
+
        createWeeklyView();
-       createSettingsView();
        createRoomStatusIndicator();
        createPasswordDialog();
        createProgressBar();
@@ -74,6 +75,7 @@ void UIManager::createWeeklyView()
        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( refreshButtonClicked() ), iEngine, SLOT( updateRoomInfo() ) );
        connect( iWeeklyView, SIGNAL( meetingActivated( Meeting * ) ), iEngine, SLOT( fetchMeetingDetails( Meeting * ) ) );
        connect( iWeeklyView, SIGNAL( shownWeekChanged( QDate ) ), iEngine, SLOT( shownWeekChanged( QDate ) ) );
        connect( iWeeklyView, SIGNAL( currentRoomChanged( Room * ) ), iEngine, SLOT( currentRoomChanged( Room * ) ) );
@@ -134,12 +136,11 @@ void UIManager::connectCommunicationManager( CommunicationManager *aCommunicatio
 //             UIMANAGER SLOTS
 void UIManager::settingsViewRequest()
 {
+       createSettingsView();
+
        // Show the settings view and stop the idle timer
-       if ( iSettingsView != 0 )
-       {
-               iWindowManager->showView( static_cast<ViewBase *>( iSettingsView ) );
-               iEngine->stopIdleTimeCounter();
-       }
+       iWindowManager->showView( static_cast<ViewBase *>( iSettingsView ) );
+       iEngine->stopIdleTimeCounter();
 }
 
 void UIManager::settingsOkClicked()
@@ -148,7 +149,9 @@ void UIManager::settingsOkClicked()
        if ( iWeeklyView != 0 )
        {
                iWindowManager->showView( static_cast<ViewBase *>( iWeeklyView ) );
+               QT_DELETE(iSettingsView);
                iEngine->startIdleTimeCounter();
+               currentRoomChanged(iWeeklyView->currentRoom());
        }
 }
 
@@ -161,7 +164,7 @@ void UIManager::meetingsFetched( const QList<Meeting*> &aMeetings )
        }
 }
 
-void UIManager::showMeetingProgressBar( Meeting *aMeeting )
+void UIManager::showMeetingProgressBar( Meeting */*aMeeting*/ )
 {
        if ( iProgressBar != 0 )
        {
@@ -227,7 +230,6 @@ void UIManager::connectionLost()
 {
        qDebug() << "UIManager::connectionLost()";
        iWeeklyView->connectionLost();
-       iSettingsView->connectionLost();
        iRoomStatusIndicator->connectionLost();
 }
 
@@ -235,7 +237,6 @@ void UIManager::connectionEstablished()
 {
        qDebug() << "UIManager::connectionEstablished()";
        iWeeklyView->connectionEstablished();
-       iSettingsView->connectionEstablished();
        iRoomStatusIndicator->connectionEstablished();
 }
 
@@ -253,11 +254,11 @@ void UIManager::updateTime(QDateTime aDateTime)
 {
        if ( iWeeklyView != 0 )
        {
-               iWeeklyView->setCurrentDateTime( aDateTime );
+               iWeeklyView->setConnectionStatus( aDateTime, iEngine->connected(), iEngine->lastUpdated(), iEngine->errorMessage() );
        }
        if ( iRoomStatusIndicator != 0 )
        {
-               iRoomStatusIndicator->setCurrentTime( aDateTime.time() );
+               iRoomStatusIndicator->setConnectionStatus( aDateTime, iEngine->connected(), iEngine->lastUpdated(), iEngine->errorMessage() );
        }
 }
 
@@ -313,6 +314,7 @@ void UIManager::settingsCancelClicked()
        if ( iWeeklyView != 0 )
        {
                iWindowManager->showView( static_cast<ViewBase *>( iWeeklyView ) );
+               QT_DELETE(iSettingsView);
                iEngine->startIdleTimeCounter();
        }
-}
\ No newline at end of file
+}
index 2a33998..997711b 100644 (file)
 #include <QCryptographicHash>
 
 #include <QtDebug>
+#include <QString>
+#include <QUrl>
 
 Configuration * Configuration::sInstance = 0;
 QString Configuration::sConfigurationPath = "/etc/QtMeetings.conf";
 
 Configuration::Configuration() :
-               iConnectionSettings( 0 ),
-               iStartupSettings( 0 ),
-               iDisplaySettings( 0 ),
-               iDateTimeSettings( 0 )
+       iConnectionSettings(0), iStartupSettings(0), iDisplaySettings(0),
+       iDateTimeSettings(0), 
+       iShowConfidentialMeetingDetails(false)
 {
 }
 
-Configuration::~Configuration()
-{
+Configuration::~Configuration() {
        delete iConnectionSettings;
        delete iStartupSettings;
        delete iDisplaySettings;
        delete iDateTimeSettings;
-       while ( !iRooms.isEmpty() )
-       {
+       while (!iRooms.isEmpty()) {
                delete iRooms.takeFirst();
        }
 }
 
-Configuration* Configuration::instance()
-{
-       if ( sInstance == 0 )
-       {
-               sInstance = readFromXML( sConfigurationPath );
-        if( !sInstance )
-        {
-            qDebug() << "FATAL: Configuration cannot be read from:" << Configuration::sConfigurationPath;
-        }
-    }
+Configuration* Configuration::instance() {
+       if (sInstance == 0) {
+               qDebug() << "HERE";
+               sInstance = new Configuration();
+               sInstance->readFromXML(sConfigurationPath);
+               if (!sInstance) {
+                       qDebug() << "FATAL: Configuration cannot be read from:"
+                                       << Configuration::sConfigurationPath;
+               }
+       }
        return sInstance;
 }
 
-ConnectionSettings* Configuration::connectionSettings()
-{
-       return iConnectionSettings;
-}
+/*ConnectionSettings* Configuration::connectionSettings()
+ {
+ return iConnectionSettings;
+ }*/
 
-StartupSettings * Configuration::startupSettings()
-{
+StartupSettings * Configuration::startupSettings() {
        return iStartupSettings;
 }
 
-DisplaySettings * Configuration::displaySettings()
-{
+DisplaySettings * Configuration::displaySettings() {
        return iDisplaySettings;
 }
 
-DateTimeSettings * Configuration::dateTimeSettings()
-{
+DateTimeSettings * Configuration::dateTimeSettings() {
        return iDateTimeSettings;
 }
 
-Room* Configuration::defaultRoom()
-{
+Room* Configuration::defaultRoom() {
        // default room is stored as the first element of the list
-       return ( iRooms.count() == 0 ) ? 0 : iRooms.at( 0 );
+       return (iRooms.count() == 0) ? 0 : iRooms.at(0);
 }
 
-QString Configuration::languageCode()
-{
+QString Configuration::languageCode() {
        return iLanguageCode;
 }
 
-QList<Room*> Configuration::rooms()
-{
+QList<Room*> Configuration::rooms() {
        return iRooms;
 }
 
-QByteArray Configuration::adminPassword()
-{
+QByteArray Configuration::adminPassword() {
        return iAdminPassword;
 }
+QUrl Configuration::getServerUrl() {
+       return iConnectionSettings->serverUrl();
+}
 
-void Configuration::save()
-{
-       QDomDocument doc;
-       QFile file( sConfigurationPath );
+QString Configuration::getUsername() {
+       return iConnectionSettings->username();
+}
+QString Configuration::getPassword() {
+       return iConnectionSettings->password();
+}
 
-       if ( !file.open( QIODevice::ReadWrite ) )
-       {
+unsigned int Configuration::getRefreshinterval() {
+       return iConnectionSettings->refreshInterval();
+}
+
+void Configuration::setServerUrl(QUrl serverUrl) {
+       iConnectionSettings->setServerUrl(serverUrl);
+}
+void Configuration::setUsername(QString username) {
+       iConnectionSettings->setUsername(username);
+}
+void Configuration::setPassword(QString password) {
+       iConnectionSettings->setPassword(password);
+}
+void Configuration::setRefreshinterval(unsigned int refreshinterval) {
+       iConnectionSettings->setRefreshInterval(refreshinterval);
+}
+
+void Configuration::save() {
+       QDomDocument doc;
+       QFile file(sConfigurationPath);
+       if (!file.open(QIODevice::ReadWrite)) {
                return;
        }
 
-       if ( !doc.setContent( &file ) )
-       {
+       if (!doc.setContent(&file)) {
                file.close();
                return;
        }
@@ -108,110 +123,100 @@ void Configuration::save()
        QDomElement root = doc.documentElement();
        // Save all attributes to document
 
-       saveAdminPassword( root );
+       saveAdminPassword(root);
 
-       for ( QDomNode node = root.firstChild(); !node.isNull(); node = node.nextSibling() )
-       {
+       bool confidentialMeetingDetailsElementMissing = true;
+
+       for (QDomNode node = root.firstChild(); !node.isNull(); node
+                       = node.nextSibling()) {
                QDomElement e = node.toElement();
                QString tagName = e.tagName().toLower();
+               if (tagName == QString("connection")) {
+                       saveConnectionSettings(node);
+               } else if (tagName == QString("rooms")) {
+                       saveRooms(node);
+               } else if (tagName == QString("language")) {
+                       saveLanguageCode(node);
+               } else if (tagName == QString("startup")) {
+                       saveStartupSettings(node);
+               } else if (tagName == QString("display")) {
+                       saveDisplaySettings(node);
+               } else if (tagName == QString("daylight_saving_time")) {
+                       saveDateTimeSettings(node);
+               } else if (tagName == QString("privacy")) {
+                       confidentialMeetingDetailsElementMissing = false;
+                       savePrivacySettings(node);
+               }               
+       }
 
-               if ( tagName == QString( "connection" ) )
-               {
-                       saveConnectionSettings( node );
-               }
-               else if ( tagName == QString( "rooms" ) )
-               {
-                       saveRooms( node );
-               }
-               else if ( tagName == QString( "language" ) )
-               {
-                       saveLanguageCode( node );
-               }
-               else if ( tagName == QString( "startup" ) )
-               {
-                       saveStartupSettings( node );
-               }
-               else if ( tagName == QString( "display" ) )
-               {
-                       saveDisplaySettings( node );
-               }
-               else if (tagName == QString( "daylight_saving_time" ) )
-               {
-                       saveDateTimeSettings( node );
-               }
+       if( confidentialMeetingDetailsElementMissing )
+       {
+               QDomElement e = root.ownerDocument().createElement("privacy");
+               savePrivacySettings(e);
+               root.appendChild(e);
        }
 
        //! Empty the file from previous content and write again with new one
-       file.resize( 0 );
-       file.write( doc.toByteArray( 4 ) );     //! 4 as intent
+       file.resize(0);
+       file.write(doc.toByteArray(4)); //! 4 as intent
 
        file.close();
-
+       emit configurationChanged();
 }
 
-void Configuration::saveConnectionSettings( const QDomNode &aXML )
-{
-       for ( QDomNode node = aXML.firstChild(); !node.isNull(); node = node.nextSibling() )
-       {
+void Configuration::saveConnectionSettings(const QDomNode &aXML) {
+       QDomElement e = aXML.firstChild().toElement();
+       QString tagName = e.tagName().toLower();
+       qDebug() << tagName;
+       for (QDomNode node = aXML.firstChild(); !node.isNull(); node
+                       = node.nextSibling()) {
                QDomElement e = node.toElement();
                QString tagName = e.tagName().toLower();
-               if ( tagName == QString( "serverurl" ) )
-               {
-                       QDomText t = node.ownerDocument().createTextNode( iConnectionSettings->serverUrl().toString() );
-                       if ( e.hasChildNodes() )
-                       {
-                               e.replaceChild( t, e.firstChild() );
-                       }
-                       else
-                       {
-                               e.appendChild( e.firstChild() );
+               qDebug() << tagName;
+               if (tagName == QString("serverurl")) {
+                       QDomText t = node.ownerDocument().createTextNode(
+                                       iConnectionSettings->serverUrl().toString());
+                       if (e.hasChildNodes()) {
+                               e.replaceChild(t, e.firstChild());
+                       } else {
+                               e.appendChild(t);
                        }
-               }
-               else if ( tagName == QString( "username" ) )
-               {
-                       QDomText t = node.ownerDocument().createTextNode( iConnectionSettings->username() );
-                       if ( e.hasChildNodes() )
-                       {
-                               e.replaceChild( t, e.firstChild() );
-                       }
-                       else
-                       {
-                               e.appendChild( e.firstChild() );
+               } else if (tagName == QString("username")) {
+                       QDomText t = node.ownerDocument().createTextNode(
+                                       iConnectionSettings->username());
+                       if (e.hasChildNodes()) {
+                               e.replaceChild(t, e.firstChild());
+                       } else {
+                               e.appendChild(t);
                        }
-               }
-               else if ( tagName == QString( "password" ) )
-               {
-                       QDomText t = node.ownerDocument().createTextNode( iConnectionSettings->password() );
-                       if ( e.hasChildNodes() )
-                       {
-                               e.replaceChild( t, e.firstChild() );
-                       }
-                       else
-                       {
-                               e.appendChild( e.firstChild() );
+
+               } else if (tagName == QString("password")) {
+                       QDomText t = node.ownerDocument().createTextNode(
+                                       iConnectionSettings->password());
+                       if (e.hasChildNodes()) {
+                               e.replaceChild(t, e.firstChild());
+                       } else {
+                               e.appendChild(t);
                        }
-               }
-               else if ( tagName == QString( "refreshinterval" ) )
-               {
-                       QString s = QString( "%1" ).arg( iConnectionSettings->refreshInterval() );
-                       QDomText t = node.ownerDocument().createTextNode( s );
-                       e.replaceChild( t, e.firstChild() );
+               } else if (tagName == QString("refreshinterval")) {
+                       QString s = QString("%1").arg(
+                                       iConnectionSettings->refreshInterval());
+                       QDomText t = node.ownerDocument().createTextNode(s);
+                       e.replaceChild(t, e.firstChild());
                }
        }
 }
 
-void Configuration::saveRooms( const QDomNode &aXML )
-{
+void Configuration::saveRooms(const QDomNode &aXML) {
        //! List of rooms must be cleared and rewritten again
        QDomDocument doc = aXML.ownerDocument();
-       QDomNode root = aXML; 
+       QDomNode root = aXML;
 
        // Remove child nodes...
        int count = root.childNodes().count();
        QDomNode node = root.firstChild();
        QDomNode next;
-       for (int i = 0; i < count; i++)
-       {
+       for (int i = 0; i < count; i++) {
                qDebug() << "remove " << node.toElement().text();
                next = node.nextSibling();
                node = root.removeChild(node);
@@ -220,264 +225,220 @@ void Configuration::saveRooms( const QDomNode &aXML )
 
        node = aXML;
        QList<Room*>::iterator i;
-       for ( i = iRooms.begin(); i != iRooms.end(); ++i )
-       {
-               QDomElement tag = doc.createElement( "room" );
-               node.appendChild( tag );
+       for (i = iRooms.begin(); i != iRooms.end(); ++i) {
+               QDomElement tag = doc.createElement("room");
+               node.appendChild(tag);
 
                // First room in the list is a dafault room
-               if ( i == iRooms.begin() )
-               {
-                       tag.setAttribute( "default", "true" );
+               if (i == iRooms.begin()) {
+                       tag.setAttribute("default", "true");
                }
 
-               QDomElement ename = doc.createElement( "name" );
-               QDomText tname = node.ownerDocument().createTextNode(( *i )->name() );
-               ename.appendChild( tname );
-               tag.appendChild( ename );
+               QDomElement ename = doc.createElement("name");
+               QDomText tname = node.ownerDocument().createTextNode((*i)->name());
+               ename.appendChild(tname);
+               tag.appendChild(ename);
 
-               QDomElement eaddress = doc.createElement( "address" );
-               QDomText taddress = node.ownerDocument().createTextNode(( *i )->address() );
-               eaddress.appendChild( taddress );
-               tag.appendChild( eaddress );
+               QDomElement eaddress = doc.createElement("address");
+               QDomText taddress =
+                               node.ownerDocument().createTextNode((*i)->address());
+               eaddress.appendChild(taddress);
+               tag.appendChild(eaddress);
        }
 }
 
-void Configuration::saveLanguageCode( const QDomNode &aXML )
-{
+void Configuration::saveLanguageCode(const QDomNode &aXML) {
        QDomElement e = aXML.toElement();
-       e.setAttribute( "code", languageCode() );
+       e.setAttribute("code", languageCode());
 }
 
-void Configuration::saveStartupSettings( const QDomNode &aXML )
-{
+void Configuration::saveStartupSettings(const QDomNode &aXML) {
        QDomElement e = aXML.toElement();
 
-       for ( QDomNode node = aXML.firstChild(); !node.isNull(); node = node.nextSibling() )
-       {
+       for (QDomNode node = aXML.firstChild(); !node.isNull(); node
+                       = node.nextSibling()) {
                e = node.toElement();
                QString tagName = e.tagName().toLower();
 
-               if ( tagName == QString( "powersaving" ) )
-               {
-                       ( iStartupSettings->isPowersavingEnabled() ?
-                         e.setAttribute( "enabled", "true" ) :
-                         e.setAttribute( "enabled", "false" ) );
+               if (tagName == QString("powersaving")) {
+                       (iStartupSettings->isPowersavingEnabled() ? e.setAttribute(
+                                       "enabled", "true") : e.setAttribute("enabled", "false"));
 
-                       e.setAttribute( "on", iStartupSettings->turnOnAt().toString( "hh:mm" ) );
-                       e.setAttribute( "off", iStartupSettings->turnOffAt().toString( "hh:mm" ) );
+                       e.setAttribute("on", iStartupSettings->turnOnAt().toString("hh:mm"));
+                       e.setAttribute("off", iStartupSettings->turnOffAt().toString(
+                                       "hh:mm"));
                }
        }
 }
 
-void Configuration::saveDisplaySettings( const QDomNode &aXML )
-{
-       for ( QDomNode node = aXML.firstChild(); !node.isNull(); node = node.nextSibling() )
-       {
+void Configuration::saveDisplaySettings(const QDomNode &aXML) {
+       for (QDomNode node = aXML.firstChild(); !node.isNull(); node
+                       = node.nextSibling()) {
                QDomElement e = node.toElement();
                QString tagName = e.tagName().toLower();
 
-               if ( tagName == QString( "schedule" ) )
-               {
-                       for ( QDomNode scheduleNode = node.firstChild(); !scheduleNode.isNull(); scheduleNode = scheduleNode.nextSibling() )
-                       {
+               if (tagName == QString("schedule")) {
+                       for (QDomNode scheduleNode = node.firstChild(); !scheduleNode.isNull(); scheduleNode
+                                       = scheduleNode.nextSibling()) {
                                QDomElement scheduleElem = scheduleNode.toElement();
                                tagName = scheduleElem.tagName().toLower();
 
-                               if ( tagName == QString( "week" ) )
-                               {
-                                       scheduleElem.setAttribute( "days", iDisplaySettings->daysInSchedule() );
+                               if (tagName == QString("week")) {
+                                       scheduleElem.setAttribute("days",
+                                                       iDisplaySettings->daysInSchedule());
+                               } else if (tagName == QString("day")) {
+                                       scheduleElem.setAttribute("startsat",
+                                                       iDisplaySettings->dayStartsAt().toString("hh:mm"));
+                                       scheduleElem.setAttribute("endsat",
+                                                       iDisplaySettings->dayEndsAt().toString("hh:mm"));
                                }
-                               else if ( tagName == QString( "day" ) )
-                               {
-                                       scheduleElem.setAttribute( "startsat", iDisplaySettings->dayStartsAt().toString( "hh:mm" ) );
-                                       scheduleElem.setAttribute( "endsat", iDisplaySettings->dayEndsAt().toString( "hh:mm" ) );
-                               }
-                       }       // end of for
-               }       // end of schedule
-               else if ( tagName == QString( "dateformat" ) )
-               {
-                       QDomText t = node.ownerDocument().createTextNode( iDisplaySettings->dateFormat() );
-                       e.replaceChild( t, e.firstChild() );
-               }
-               else if ( tagName == QString( "timeformat" ) )
-               {
-                       QDomText t = node.ownerDocument().createTextNode( iDisplaySettings->timeFormat() );
-                       e.replaceChild( t, e.firstChild() );
-               }
-               else if ( tagName == QString( "screensaver" ) )
-               {
-                       QString s = QString( "%1" ).arg( iDisplaySettings->screensaver() );
-                       QDomText t = node.ownerDocument().createTextNode( s );
-                       e.replaceChild( t, e.firstChild() );
+                       } // end of for
+               } // end of schedule
+               else if (tagName == QString("dateformat")) {
+                       QDomText t = node.ownerDocument().createTextNode(
+                                       iDisplaySettings->dateFormat());
+                       e.replaceChild(t, e.firstChild());
+               } else if (tagName == QString("timeformat")) {
+                       QDomText t = node.ownerDocument().createTextNode(
+                                       iDisplaySettings->timeFormat());
+                       e.replaceChild(t, e.firstChild());
+               } else if (tagName == QString("screensaver")) {
+                       QString s = QString("%1").arg(iDisplaySettings->screensaver());
+                       QDomText t = node.ownerDocument().createTextNode(s);
+                       e.replaceChild(t, e.firstChild());
                }
        }
 }
 
-void Configuration::saveDateTimeSettings( const QDomNode &aXML )
-{
-       for ( QDomNode node = aXML.firstChild(); !node.isNull(); node = node.nextSibling() )
-       {
+void Configuration::saveDateTimeSettings(const QDomNode &aXML) {
+       for (QDomNode node = aXML.firstChild(); !node.isNull(); node
+                       = node.nextSibling()) {
                QDomElement e = node.toElement();
                QString tagName = e.tagName().toLower();
 
-               if ( tagName == QString( "dayofweek" ) )
-               {
-                       QDomText t = node.ownerDocument().createTextNode( iDateTimeSettings->switchDay() );
-                       e.replaceChild( t, e.firstChild() );
-               }
-               else if( tagName == QString( "StandardTimeChangeMoment" ) )
-               {
-                       QDomText t = node.ownerDocument().createTextNode( iDateTimeSettings->STDDateTime().toString("ddMMyyyyhhmmss"));
-                       e.replaceChild( t, e.firstChild() );
-               }
-               else if( tagName == QString( "DaylightSaveTimeChangeMoment" ) )
-               {
-                       QDomText t = node.ownerDocument().createTextNode( iDateTimeSettings->DSTDateTime().toString("ddMMyyyyhhmmss"));
-                       e.replaceChild( t, e.firstChild() );
+               if (tagName == QString("dayofweek")) {
+                       QDomText t = node.ownerDocument().createTextNode(
+                                       iDateTimeSettings->switchDay());
+                       e.replaceChild(t, e.firstChild());
+               } else if (tagName == QString("StandardTimeChangeMoment")) {
+                       QDomText t =
+                                       node.ownerDocument().createTextNode(
+                                                       iDateTimeSettings->STDDateTime().toString(
+                                                                       "ddMMyyyyhhmmss"));
+                       e.replaceChild(t, e.firstChild());
+               } else if (tagName == QString("DaylightSaveTimeChangeMoment")) {
+                       QDomText t =
+                                       node.ownerDocument().createTextNode(
+                                                       iDateTimeSettings->DSTDateTime().toString(
+                                                                       "ddMMyyyyhhmmss"));
+                       e.replaceChild(t, e.firstChild());
                }
        }
 }
 
-void Configuration::saveAdminPassword( const QDomNode &aXML )
-{
+void Configuration::saveAdminPassword(const QDomNode &aXML) {
        QDomElement e = aXML.toElement();
-       e.setAttribute( "password", QString( adminPassword() ) );
+       e.setAttribute("password", QString(adminPassword()));
 }
 
-
-Configuration* Configuration::readFromXML( const QString &aPath )
-{
+void Configuration::readFromXML(const QString &aPath) {
        QDomDocument doc;
-       QFile file( aPath );
+       QFile file(aPath);
 
-       if ( !file.open( QIODevice::ReadOnly ) )
-       {
-               return 0;
+       if (!file.open(QIODevice::ReadOnly)) {
+               return;
        }
-       if ( !doc.setContent( &file ) )
-       {
+       if (!doc.setContent(&file)) {
                file.close();
-               return 0;
+               return;
        }
        file.close();
 
        QDomElement root = doc.documentElement();
        // check if the file is the one we need
-       if ( root.tagName().toLower() != QString( "configuration" ) )
-       {
-               return 0;
+       if (root.tagName().toLower() != QString("configuration")) {
+               return;
        }
 
-       Configuration* conf = new Configuration();
+       iAdminPassword = /*Configuration::*/readAdminPassword(root);
 
-       conf->iAdminPassword = Configuration::readAdminPassword( root );
-
-       for ( QDomNode node = root.firstChild(); !node.isNull(); node = node.nextSibling() )
-       {
+       for (QDomNode node = root.firstChild(); !node.isNull(); node
+                       = node.nextSibling()) {
                QDomElement e = node.toElement();
                QString tagName = e.tagName().toLower();
 
-               if ( tagName == QString( "connection" ) )
-               {
-                       conf->iConnectionSettings = Configuration::readConnectionSettings( node );
-               }
-               else if ( tagName == QString( "rooms" ) )
-               {
-                       conf->iRooms = Configuration::readRooms( node );
-               }
-               else if ( tagName == QString( "language" ) )
-               {
-                       conf->iLanguageCode = Configuration::readLanguageCode( node );
-               }
-               else if ( tagName == QString( "startup" ) )
-               {
-                       conf->iStartupSettings = Configuration::readStartupSettings( node );
-               }
-               else if ( tagName == QString( "display" ) )
-               {
-                       conf->iDisplaySettings = Configuration::readDisplaySettings( node );
-               }
-               else if ( tagName == QString( "daylight_saving_time" ) )
-               {
-                       conf->iDateTimeSettings = Configuration::readDateTimeSettings(node);
+               if (tagName == QString("connection")) {
+                       iConnectionSettings = readConnectionSettings(node);
+               } else if (tagName == QString("rooms")) {
+                       iRooms = readRooms(node);
+               } else if (tagName == QString("language")) {
+                       iLanguageCode = readLanguageCode(node);
+               } else if (tagName == QString("startup")) {
+                       iStartupSettings = readStartupSettings(node);
+               } else if (tagName == QString("display")) {
+                       iDisplaySettings = readDisplaySettings(node);
+               } else if (tagName == QString("daylight_saving_time")) {
+                       iDateTimeSettings = readDateTimeSettings(node);
+               } else if (tagName == QString("privacy")) {
+                       readPrivacySettings(node);
                }
        }
-
-       return conf;
 }
 
-ConnectionSettings* Configuration::readConnectionSettings( const QDomNode &aXML )
-{
+ConnectionSettings* Configuration::readConnectionSettings(const QDomNode &aXML) {
        QString server, username, password;
        unsigned int interval = Configuration::sDefaultInterval;
 
-       for ( QDomNode node = aXML.firstChild(); !node.isNull(); node = node.nextSibling() )
-       {
+       for (QDomNode node = aXML.firstChild(); !node.isNull(); node
+                       = node.nextSibling()) {
                QDomElement e = node.toElement();
                QString tagName = e.tagName().toLower();
 
-               if ( tagName == QString( "serverurl" ) )
-               {
+               if (tagName == QString("serverurl")) {
                        server = e.text();
-               }
-               else if ( tagName == QString( "username" ) )
-               {
+               } else if (tagName == QString("username")) {
                        username = e.text();
-               }
-               else if ( tagName == QString( "password" ) )
-               {
+               } else if (tagName == QString("password")) {
                        password = e.text();
-               }
-               else if ( tagName == QString( "refreshinterval" ) )
-               {
+               } else if (tagName == QString("refreshinterval")) {
                        bool success = false;
-                       unsigned int intervalTMP = e.text().toUInt( &success );
-                       if ( success )
-                       {
+                       unsigned int intervalTMP = e.text().toUInt(&success);
+                       if (success) {
                                interval = intervalTMP;
                        }
                }
        }
 
-       return new ConnectionSettings( server, username, password, interval );
+       return new ConnectionSettings(server, username, password, interval);
 }
 
-QList<Room*> Configuration::readRooms( const QDomNode &aXML )
-{
+QList<Room*> Configuration::readRooms(const QDomNode &aXML) {
        QList<Room*> rooms;
 
-       for ( QDomNode node = aXML.firstChild(); !node.isNull(); node = node.nextSibling() )
-       {
+       for (QDomNode node = aXML.firstChild(); !node.isNull(); node
+                       = node.nextSibling()) {
                QDomElement e = node.toElement();
                QString tagName = e.tagName().toLower();
 
-               if ( tagName == QString( "room" ) )
-               {
+               if (tagName == QString("room")) {
                        QString name, address;
 
-                       for ( QDomNode roomNode = node.firstChild(); !roomNode.isNull(); roomNode = roomNode.nextSibling() )
-                       {
+                       for (QDomNode roomNode = node.firstChild(); !roomNode.isNull(); roomNode
+                                       = roomNode.nextSibling()) {
                                QDomElement roomElem = roomNode.toElement();
                                tagName = roomElem.tagName().toLower();
-                               if ( tagName == QString( "name" ) )
-                               {
+                               if (tagName == QString("name")) {
                                        name = roomElem.text();
-                               }
-                               else if ( tagName == QString( "address" ) )
-                               {
+                               } else if (tagName == QString("address")) {
                                        address = roomElem.text();
                                }
                        }
-                       Room* room = new Room( name, address );
-                       QString defaultAttr = e.attribute( "default" ).toLower();
-                       if ( defaultAttr == QString( "true" ) )
-                       {
-                               rooms.insert( 0, room );
-                       }
-                       else
-                       {
-                               rooms.append( room );
+                       Room* room = new Room(name, address);
+                       QString defaultAttr = e.attribute("default").toLower();
+                       if (defaultAttr == QString("true")) {
+                               rooms.insert(0, room);
+                       } else {
+                               rooms.append(room);
                        }
                }
        }
@@ -485,217 +446,240 @@ QList<Room*> Configuration::readRooms( const QDomNode &aXML )
        return rooms;
 }
 
-QString Configuration::readLanguageCode( const QDomNode &aXML )
-{
+QString Configuration::readLanguageCode(const QDomNode &aXML) {
        QDomElement e = aXML.toElement();
        QString tagName = e.tagName().toLower();
 
-       if ( e.hasAttribute( "code" ) )
-       {
-               return e.attribute( "code" );
-       }
-       else
-       {
+       if (e.hasAttribute("code")) {
+               return e.attribute("code");
+       } else {
                // default language is English
                return "EN";
        }
 }
 
-StartupSettings * Configuration::readStartupSettings( const QDomNode &aXML )
-{
+StartupSettings * Configuration::readStartupSettings(const QDomNode &aXML) {
        QDomElement e = aXML.toElement();
 
        bool isPowersavingEnabled = false;
        QTime turnOnAt, turnOffAt;
 
-       for ( QDomNode node = aXML.firstChild(); !node.isNull(); node = node.nextSibling() )
-       {
+       for (QDomNode node = aXML.firstChild(); !node.isNull(); node
+                       = node.nextSibling()) {
                e = node.toElement();
                QString tagName = e.tagName().toLower();
 
-               if ( tagName == QString( "powersaving" ) )
-               {
-                       if ( e.hasAttribute( "enabled" ) &&
-                                 e.attribute( "enabled" ) == QString( "true" ) )
-                       {
+               if (tagName == QString("powersaving")) {
+                       if (e.hasAttribute("enabled") && e.attribute("enabled") == QString(
+                                       "true")) {
                                isPowersavingEnabled = true;
                        }
 
-                       if ( e.hasAttribute( "on" ) )
-                       {
-                               QString on = e.attribute( "on" );
-                               turnOnAt = QTime::fromString( on, "hh:mm" );
+                       if (e.hasAttribute("on")) {
+                               QString on = e.attribute("on");
+                               turnOnAt = QTime::fromString(on, "hh:mm");
 
                        }
 
-                       if ( e.hasAttribute( "off" ) )
-                       {
-                               QString off = e.attribute( "off" );
-                               turnOffAt = QTime::fromString( off, "hh:mm" );
+                       if (e.hasAttribute("off")) {
+                               QString off = e.attribute("off");
+                               turnOffAt = QTime::fromString(off, "hh:mm");
                        }
                }
        }
 
-       return new StartupSettings( isPowersavingEnabled, turnOnAt, turnOffAt );
+       return new StartupSettings(isPowersavingEnabled, turnOnAt, turnOffAt);
 }
 
-DisplaySettings * Configuration::readDisplaySettings( const QDomNode &aXML )
-{
-       DisplaySettings::DaysInSchedule daysInSchedule = DisplaySettings::WeekdaysInSchedule;
+DisplaySettings * Configuration::readDisplaySettings(const QDomNode &aXML) {
+       DisplaySettings::DaysInSchedule daysInSchedule =
+                       DisplaySettings::WeekdaysInSchedule;
        QTime dayStartsAt, dayEndsAt;
        DisplaySettings::DateFormat dateformat = DisplaySettings::ShortDateFormat;
-       DisplaySettings::TimeFormat timeformat = DisplaySettings::TwentyFourHoursTimeFormat;
-       int screensaver = 1;    //! Default value for screensaver wait time
+       DisplaySettings::TimeFormat timeformat =
+                       DisplaySettings::TwentyFourHoursTimeFormat;
+       int screensaver = 1; //! Default value for screensaver wait time
 
-       for ( QDomNode node = aXML.firstChild(); !node.isNull(); node = node.nextSibling() )
-       {
+       for (QDomNode node = aXML.firstChild(); !node.isNull(); node
+                       = node.nextSibling()) {
                QDomElement e = node.toElement();
                QString tagName = e.tagName().toLower();
 
-               if ( tagName == QString( "schedule" ) )
-               {
-                       for ( QDomNode scheduleNode = node.firstChild(); !scheduleNode.isNull(); scheduleNode = scheduleNode.nextSibling() )
-                       {
+               if (tagName == QString("schedule")) {
+                       for (QDomNode scheduleNode = node.firstChild(); !scheduleNode.isNull(); scheduleNode
+                                       = scheduleNode.nextSibling()) {
                                QDomElement scheduleElem = scheduleNode.toElement();
                                tagName = scheduleElem.tagName().toLower();
 
-                               if ( tagName == QString( "week" ) )
-                               {
-                                       if ( scheduleElem.hasAttribute( "days" ) )
-                                       {
+                               if (tagName == QString("week")) {
+                                       if (scheduleElem.hasAttribute("days")) {
                                                // default value is 5, only other supported possibility is 7
                                                bool success = false;
-                                               unsigned int days = scheduleElem.attribute( "days" ).toUInt( &success );
-                                               daysInSchedule = ( success && days == 7 ) ? DisplaySettings::WholeWeekInSchedule : DisplaySettings::WeekdaysInSchedule;
+                                               unsigned int days =
+                                                               scheduleElem.attribute("days").toUInt(&success);
+                                               daysInSchedule
+                                                               = (success && days == 7) ? DisplaySettings::WholeWeekInSchedule
+                                                                               : DisplaySettings::WeekdaysInSchedule;
                                        }
 
-                               }
-                               else if ( tagName == QString( "day" ) )
-                               {
-                                       if ( scheduleElem.hasAttribute( "startsat" ) )
-                                       {
-                                               QString time = scheduleElem.attribute( "startsat" );
-                                               dayStartsAt = QTime::fromString( time, "hh:mm" );
+                               } else if (tagName == QString("day")) {
+                                       if (scheduleElem.hasAttribute("startsat")) {
+                                               QString time = scheduleElem.attribute("startsat");
+                                               dayStartsAt = QTime::fromString(time, "hh:mm");
                                        }
-                                       if ( scheduleElem.hasAttribute( "endsat" ) )
-                                       {
-                                               QString time = scheduleElem.attribute( "endsat" );
-                                               dayEndsAt = QTime::fromString( time, "hh:mm" );
+                                       if (scheduleElem.hasAttribute("endsat")) {
+                                               QString time = scheduleElem.attribute("endsat");
+                                               dayEndsAt = QTime::fromString(time, "hh:mm");
                                        }
 
                                }
-                       }       // end of for
-               }       // end of schedule
-               else if ( tagName == QString( "dateformat" ) )
-               {
+                       } // end of for
+               } // end of schedule
+               else if (tagName == QString("dateformat")) {
                        //! Not able to display long format anyway at the moment
                        /*
-                       if ( e.text() == QObject::tr( "dddd d MMMM yyyy" ) )
-                               dateformat = DisplaySettings::LongDateFormat;
-                       else
-                               dateformat = DisplaySettings::ShortDateFormat;
-                       */
+                        if ( e.text() == QObject::tr( "dddd d MMMM yyyy" ) )
+                        dateformat = DisplaySettings::LongDateFormat;
+                        else
+                        dateformat = DisplaySettings::ShortDateFormat;
+                        */
                        dateformat = DisplaySettings::ShortDateFormat;
-               }
-               else if ( tagName == QString( "timeformat" ) )
-               {
+               } else if (tagName == QString("timeformat")) {
                        //! Not able to display "TwelveHoursTimeFormat" anyway at the moment
                        /*
-                       if ( e.text() == QObject::tr( "hh:mm ap" ) )
-                               timeformat = DisplaySettings::TwelveHoursTimeFormat;
-                       else
-                               timeformat = DisplaySettings::TwentyFourHoursTimeFormat;
-                       */
+                        if ( e.text() == QObject::tr( "hh:mm ap" ) )
+                        timeformat = DisplaySettings::TwelveHoursTimeFormat;
+                        else
+                        timeformat = DisplaySettings::TwentyFourHoursTimeFormat;
+                        */
                        timeformat = DisplaySettings::TwentyFourHoursTimeFormat;
-               }
-               else if ( tagName == QString( "screensaver" ) )
-               {
+               } else if (tagName == QString("screensaver")) {
                        bool success = false;
-                       unsigned int screensaverTMP = e.text().toUInt( &success );
-                       if ( success )
-                       {
+                       unsigned int screensaverTMP = e.text().toUInt(&success);
+                       if (success) {
                                screensaver = screensaverTMP;
                        }
                }
        }
 
-       return new DisplaySettings( dateformat, timeformat, daysInSchedule, dayStartsAt, dayEndsAt, screensaver );
+       return new DisplaySettings(dateformat, timeformat, daysInSchedule,
+                       dayStartsAt, dayEndsAt, screensaver);
 }
 
-DateTimeSettings * Configuration::readDateTimeSettings( const QDomNode &aXML )
-{
+DateTimeSettings * Configuration::readDateTimeSettings(const QDomNode &aXML) {
        // Set defaults..
-       QDateTime standardTimeChangeMoment = QDateTime::fromString("05.10.2009 04:00:00", "dd'.'MM'.'yyyy' 'hh:mm:ss");
-       QDateTime daylightSaveTimeChangeMoment = QDateTime::fromString("01.04.2010 03:00:00", "dd'.'MM'.'yyyy' 'hh:mm:ss");
+       QDateTime standardTimeChangeMoment = QDateTime::fromString(
+                       "05.10.2009 04:00:00", "dd'.'MM'.'yyyy' 'hh:mm:ss");
+       QDateTime daylightSaveTimeChangeMoment = QDateTime::fromString(
+                       "01.04.2010 03:00:00", "dd'.'MM'.'yyyy' 'hh:mm:ss");
        DateTimeSettings::weekDay dayOfWeek = DateTimeSettings::Sunday;
-       
-       for ( QDomNode node = aXML.firstChild(); !node.isNull(); node = node.nextSibling() )
-       {
+
+       for (QDomNode node = aXML.firstChild(); !node.isNull(); node
+                       = node.nextSibling()) {
                QDomElement e = node.toElement();
                QString tagName = e.tagName().toLower();
 
-               if ( tagName == QString( "dayofweek" ) )
-               {
-                       qDebug() << "Configuration::readDateTimeSettings: " +e.text();
-                       
+               if (tagName == QString("dayofweek")) {
+                       qDebug() << "Configuration::readDateTimeSettings: " + e.text();
+
                        bool success = false;
-                       unsigned int weekDayTmp = e.text().toUInt( &success );
-                       if( success && weekDayTmp < 7 )
-                       {
-                               dayOfWeek = (DateTimeSettings::weekDay)weekDayTmp;
+                       unsigned int weekDayTmp = e.text().toUInt(&success);
+                       if (success && weekDayTmp < 7) {
+                               dayOfWeek = (DateTimeSettings::weekDay) weekDayTmp;
                        }
-               }
-               else if( tagName == QString( "standardtimechangemoment" ) )
-               {
-                       standardTimeChangeMoment = QDateTime::fromString(e.text(), "dd'.'MM'.'yyyy' 'hh:mm:ss");
-                       qDebug() << "Configuration::readDateTimeSettings: " +standardTimeChangeMoment.toString("dd.MM.yyyy hh:mm:ss");
-               }
-               else if( tagName == QString( "daylightsavetimechangemoment" ) )
-               {
-                       daylightSaveTimeChangeMoment = QDateTime::fromString(e.text(), "dd'.'MM'.'yyyy' 'hh:mm:ss");
-                       qDebug() << "Configuration::readDateTimeSettings: " +daylightSaveTimeChangeMoment.toString("dd.MM.yyyy hh:mm:ss");
+               } else if (tagName == QString("standardtimechangemoment")) {
+                       standardTimeChangeMoment = QDateTime::fromString(e.text(),
+                                       "dd'.'MM'.'yyyy' 'hh:mm:ss");
+                       qDebug() << "Configuration::readDateTimeSettings: "
+                                       + standardTimeChangeMoment.toString("dd.MM.yyyy hh:mm:ss");
+               } else if (tagName == QString("daylightsavetimechangemoment")) {
+                       daylightSaveTimeChangeMoment = QDateTime::fromString(e.text(),
+                                       "dd'.'MM'.'yyyy' 'hh:mm:ss");
+                       qDebug() << "Configuration::readDateTimeSettings: "
+                                       + daylightSaveTimeChangeMoment.toString(
+                                                       "dd.MM.yyyy hh:mm:ss");
                }
        }
-       
-       return new DateTimeSettings(standardTimeChangeMoment, daylightSaveTimeChangeMoment, dayOfWeek);
+
+       return new DateTimeSettings(standardTimeChangeMoment,
+                       daylightSaveTimeChangeMoment, dayOfWeek);
 }
 
-QByteArray Configuration::readAdminPassword( const QDomNode &aXML )
-{
+QByteArray Configuration::readAdminPassword(const QDomNode &aXML) {
        QDomElement e = aXML.toElement();
        QString tagName = e.tagName().toLower();
-       if ( e.hasAttribute( "password" ) )
-       {
-               QString pw = e.attribute( "password" );
+       if (e.hasAttribute("password")) {
+               QString pw = e.attribute("password");
                // Check if the password is default uncrypted "admin"
-               if ( pw == QString( "admin" ) )
-               {
+
+               int x = QString::compare(pw, "admin", Qt::CaseInsensitive);  // x == 0
+
+               if (x == 0) {
                        // uncrypted password needs to be encoded
-                       QCryptographicHash *hash = new QCryptographicHash( QCryptographicHash::Md5 );
-                       hash->addData( pw.toUtf8() );
-                       pw = QString( hash->result() );
+                       QCryptographicHash *hash = new QCryptographicHash(
+                                       QCryptographicHash::Md5);
+                       hash->addData(pw.toUtf8());
+                       pw = QString(hash->result());
                        delete hash;
+                       return (pw.toAscii()).toHex();
                }
-               return ( pw.toAscii() ).toHex();
-               
+
+               return (pw.toAscii());
+
+       } else {
+               return 0;
+       }
+}
+
+void Configuration::setRooms(const QList<Room*> aRooms) {
+       iRooms = aRooms;
+}
+
+void Configuration::readPrivacySettings(const QDomNode &aXML) {
+       QString s = QString("show_confidential_meeting_details");
+
+       QDomElement e = aXML.firstChildElement(s);
+
+       if (e.hasAttribute("enabled") && 
+               e.attribute("enabled") == QString("true")) {
+               iShowConfidentialMeetingDetails = true;
        }
        else
        {
-               return 0;
+               iShowConfidentialMeetingDetails = false;
        }
 }
 
-void Configuration::setRooms( const QList<Room*> aRooms )
-{
-       iRooms = aRooms;
+void Configuration::savePrivacySettings(QDomNode &aXML) {
+       QString s = QString("show_confidential_meeting_details");
+
+       QDomElement e = aXML.firstChildElement(s);
+
+       if (e.isNull()) {
+               e = aXML.ownerDocument().createElement(s);
+               aXML.appendChild(e);
+       }
+
+       if( showConfidentialMeetingDetails() )
+               e.setAttribute("enabled", "true");
+       else
+               e.setAttribute("enabled", "false");
 }
 
-QString Configuration::hashPassword( const QString aPassword )
-{
-       QCryptographicHash *hash = new QCryptographicHash( QCryptographicHash::Md5 );
-       hash->addData( aPassword.toUtf8() );
+bool Configuration::setShowConfidentialMeetingDetails(
+               bool showconfidentialmeetingdetails) {
+       iShowConfidentialMeetingDetails = showconfidentialmeetingdetails;
+}
+
+bool Configuration::showConfidentialMeetingDetails() {
+       return iShowConfidentialMeetingDetails;
+}
+
+QString Configuration::hashPassword(const QString aPassword) {
+       QCryptographicHash *hash = new QCryptographicHash(QCryptographicHash::Md5);
+       hash->addData(aPassword.toUtf8());
        QByteArray password = hash->result();
        delete hash;
 
-       return QString( password );
+       return QString(password);
 }
index 5cd7e6d..9c5c253 100644 (file)
@@ -5,6 +5,7 @@
 #include <QString>
 #include <QList>
 #include <QTime>
+#include <QUrl>
 
 class ConnectionSettings;
 class StartupSettings;
@@ -19,8 +20,7 @@ class DateTimeSettings;
  * file at initialization time. Since there is one appliation per device normally running, therefore
  * there is only one instance of this class, which is accessible by using a statis getter method.
  */
-class Configuration : public QObject
-{
+class Configuration: public QObject {
 Q_OBJECT
 
 private:
@@ -46,7 +46,47 @@ public:
         * Gets the connection settings.
         * \return Pointer to ConnectionSettings instance.
         */
-       ConnectionSettings* connectionSettings();
+       //ConnectionSettings* connectionSettings();
+       /**
+        * Returns the current server URL
+        */
+       QUrl getServerUrl();
+       /**
+        * Returns the current username
+        */
+       QString getUsername();
+       /**
+        * Returns the current users password
+        */
+       QString getPassword();
+       /**
+        * Returns the refresh interval
+        */
+       unsigned int getRefreshinterval();
+       /**
+        * Sets the current server URL
+        */
+       void setServerUrl(QUrl serverUrl);
+       /**
+        * Sets the current username
+        */
+       void setUsername(QString username);
+       /**
+        * Sets the current users password
+        */
+       void setPassword(QString password);
+       /**
+        * Sets the refresh interval
+        */
+       void setRefreshinterval(unsigned int refreshinterval);
+       
+       //! Sets the confidential meeting details showing setting.
+       /*!
+        * Sets the confidential meeting details showing setting.
+        * \param confidential meeting details showing setting.
+        */
+       bool setShowConfidentialMeetingDetails(bool showconfidentialmeetingdetails);
+       
        //! Gets the detault room.
        /*!
         * Gets the default meeting room.
@@ -91,11 +131,21 @@ public:
        QByteArray adminPassword();
        //! Sets room list.
        /*!
-        * Sets  room list.
+        * Sets room list.
         * \param aRooms List of rooms
         */
        void setRooms(const QList<Room*> aRooms);
 
+       //! Gets the confidential meeting details showing setting.
+       /*!
+        * Gets the confidential meeting details showing setting.
+        * \return confidential meeting details showing setting.
+        */
+       bool showConfidentialMeetingDetails();
+       
+signals:
+       void configurationChanged();
+
 public slots:
 
        //! Saves setting values to file.
@@ -111,48 +161,48 @@ private:
         * \param aPath path and name of configuration file
         * \return Configuration object.
         */
-       static Configuration* readFromXML(const QString &aPath);
+       void readFromXML(const QString &aPath);
        //! Static. Reads settings of connection from and XML node.
        /*!
         * Static. Reads settings of connection from an XML node.
         * \param aXml QDomNode containing connection parameters.
         * \return Pointer to ConnectionSettings object.
         */
-       static ConnectionSettings* readConnectionSettings(const QDomNode &aXML);
+       ConnectionSettings* readConnectionSettings(const QDomNode &aXML);
        //! Static. Reads rooms from an XML node.
        /*!
         * Static. Reads rooms from an XML node.
         * \param aXml QDomNode containing meeting room parameters
         * \return List of meetingrooms.
         */
-       static QList<Room*> readRooms(const QDomNode &aXML);
+       QList<Room*> readRooms(const QDomNode &aXML);
        //! Static. Reads language code from an XML node.
        /*!
         * Static. Reads rooms from an XML node.
         * \param aXml QDomNode containing language code
         * \return Language code.
         */
-       static QString readLanguageCode(const QDomNode &aXML);
+       QString readLanguageCode(const QDomNode &aXML);
        //! Static. Reads settings of startup from an XML node.
        /*!
         * Static. Reads settings of startup from an XML node.
         * \param aXml QDomNode containing startup parameters
         * \return Pointer to the read StartupSettings object.
         */
-       static StartupSettings* readStartupSettings(const QDomNode &aXML);
+       StartupSettings* readStartupSettings(const QDomNode &aXML);
        /*!
         * Static function to load and store display settings from xml node.
         * \param aXml QDomNode containing display parameters
         * \return Pointer to the read DisplaySettings object.
         */
-       static DisplaySettings* readDisplaySettings(const QDomNode &aXML);
+       DisplaySettings* readDisplaySettings(const QDomNode &aXML);
        //! Static. Reads the date/time settings from an XML node.
        /*!
         * Static. Reads the date/time settings from an XML node.
         * \param aXml QDomNode containing the date/time settings
         * \return The date/time settings.
         */
-       static DateTimeSettings* readDateTimeSettings(const QDomNode &aXML);
+       DateTimeSettings* readDateTimeSettings(const QDomNode &aXML);
 
        //! Static. Reads adminstrator's password from an XML node.
        /*!
@@ -160,8 +210,16 @@ private:
         * \param aXml QDomNode containing admin password
         * \return Admin password.
         */
-       static QByteArray readAdminPassword(const QDomNode &aXML);
+       QByteArray readAdminPassword(const QDomNode &aXML);
 
+       //! Static. Reads confidential meeting details setting from an XML node.
+       /*!
+        * Static. Reads confidential meeting details setting from an XML node.
+        * \param aXml QDomNode containing confidential meeting details setting
+        * \return Confidential meeting details setting.
+        */
+       void readPrivacySettings(const QDomNode &aXML);
+       
        //! Saves connection data to the document.
        /*!
         * Reads data from iConnectionSettings and saves it to the aXML document.
@@ -206,6 +264,13 @@ private:
         */
        void saveAdminPassword(const QDomNode &aXML);
 
+       //! Saves confidential meeting details setting to the document.
+       /*!
+        * Reads data from iShowConfidentialMeetingDetails and saves it to the aXML document.
+        * \param aXml QDomNode confidential meeting details setting
+        */
+       void savePrivacySettings(QDomNode &aXML);
+               
        //! Hash password with md5 method.
        /*!
         * Hash password with md5 method.
@@ -236,6 +301,7 @@ private:
        //! Stores language code
        QString iLanguageCode;
 
+       bool iShowConfidentialMeetingDetails;
 };
 
 #endif /*CONFIGURATION_H_*/
index 5c3b924..04a26e2 100644 (file)
@@ -1,14 +1,16 @@
 #include "Communication.h"
 #include "ConnectionSettings.h"
 #include <QAuthenticator>
+#include "Configuration.h"
+#include <QDebug>
 
-Communication::Communication( const ConnectionSettings &aConnection ) :
+
+Communication::Communication() :
        iCurrentRequest(0),
        iAuthFailCount(0)
 {
-       iConnectionSettings = new ConnectionSettings( aConnection );
+       iHttp = new QHttp(Configuration::instance()->getServerUrl().toString()/*Configuration::instance()->getServerUrl().toString()*/, QHttp::ConnectionModeHttps );
 
-       iHttp = new QHttp( iConnectionSettings->serverUrl().toString(), QHttp::ConnectionModeHttps );
 
        connect( iHttp,
                         SIGNAL( readyRead( const QHttpResponseHeader& ) ),
@@ -39,11 +41,12 @@ Communication::Communication( const ConnectionSettings &aConnection ) :
                         iHttp,
                         SLOT( ignoreSslErrors() )/*this, SLOT( notifySsl( const QList<QSslError>& ) )*/
                        );
+       connect(Configuration::instance(),SIGNAL(configrationChanged()), SLOT(configurationChanged()));
 }
 
 Communication::~Communication()
 {
-       delete iConnectionSettings;
+       //delete iConnectionSettings;
        delete iHttp;
        QList<QByteArray*> responses = iResponses.values();
        while(!responses.isEmpty())
@@ -86,8 +89,9 @@ void Communication::handleResults( int aId, bool /*aError*/ )
 
 void Communication::handleAuthentication( const QString& /*aHost*/, quint16 /*aPort*/, QAuthenticator* aAuthenticator )
 {
-       aAuthenticator->setPassword( iConnectionSettings->password() );
-       aAuthenticator->setUser( iConnectionSettings->username() );
+
+       aAuthenticator->setPassword( Configuration::instance()->getPassword() );
+       aAuthenticator->setUser( Configuration::instance()->getUsername() );
        iAuthFailCount++;
        if( iAuthFailCount > 1 )
        {
@@ -99,9 +103,12 @@ int Communication::request( const QString &aCommand, const QByteArray &aContent
 {
        if( iAuthFailCount > 1 )
                return 0;
-       
+
+       iHttp->setHost(Configuration::instance()->getServerUrl().toString(),QHttp::ConnectionModeHttps);
        QHttpRequestHeader header( QString( "POST" ), QString( "/ews/exchange.asmx" ) );
-       header.setValue( "Host", iConnectionSettings->serverUrl().toString() );
+
+       header.setValue( "Host",Configuration::instance()->getServerUrl().toString() );
+
        QString command = aCommand;
        header.setContentType( command );
 
@@ -131,3 +138,8 @@ void Communication::handleReadProgress( int aDone, int aTotal )
 {
        emit readProgress( iCurrentRequest, aDone, aTotal );
 }
+
+void Communication::configurationChanged()
+{
+       iHttp->setHost(Configuration::instance()->getServerUrl().toString(),QHttp::ConnectionModeHttps );
+}
index 41dedb5..07c6601 100644 (file)
@@ -23,7 +23,7 @@ public:
         *  \param aConnection Reference to ConnectionSettings which holds
         *  the server to connect to and authentication information.
        */
-       Communication( const ConnectionSettings &aConnection );
+       Communication(/* const ConnectionSettings &aConnection*/ );
        
        virtual ~Communication();
        //! Returns the response of a request identified by aRequestId.
@@ -40,6 +40,8 @@ public:
        */
        int request( const QString &aCommand, const QByteArray &aContent );
 
+
+
 signals:
        //! Emitted when a request ongoing. Reports the bytes read from the server.
        /*! 
@@ -71,12 +73,15 @@ protected slots:
        void handleRequestStarted( int aRequestId );
        //! Connected to QHttp::dataReadProgress
        void handleReadProgress( int aDone, int aTotal );
+       //!Called when the settings are changed by the user
+       void configurationChanged();
+
 
 private:
        /*!
         * Instance of Connection settings of the communication
        */
-       ConnectionSettings *iConnectionSettings;
+       //ConnectionSettings *iConnectionSettings;
        /*!
         * Instance of QHttp
        */
index 2f340a0..0880920 100644 (file)
@@ -6,14 +6,17 @@
 #include <QDateTime>
 #include <QDomDocument>
 #include <QDebug>
+#include "../../Domain/Configuration/Configuration.h"
 
 static const int ERROR_BASE=100;
 
-CommunicationManager::CommunicationManager( const ConnectionSettings &aConnection )
+
+CommunicationManager::CommunicationManager()
 {
-       iConnectionSettings = new ConnectionSettings( aConnection );
+
        iModifyingCommunication = NULL;
-       iFetchingCommunication = new Communication( aConnection );
+
+       iFetchingCommunication = new Communication();
 
        if ( iFetchingCommunication )
        {
@@ -28,11 +31,12 @@ CommunicationManager::CommunicationManager( const ConnectionSettings &aConnectio
                                 SLOT( requestFinished( int, int ) )
                                );
        }
+
 }
 
 CommunicationManager::~CommunicationManager()
 {
-       delete iConnectionSettings;
+       //delete iConnectionSettings;
        delete iModifyingCommunication;
        delete iFetchingCommunication;
        while ( !iMeetings.isEmpty() )
@@ -150,6 +154,9 @@ void CommunicationManager::requestFinished( int aRequestId, int aError )
                        err = 10;
                delete rd;
                emit error( ERROR_BASE+(int)err, CommunicationManager::FetchingCommunication );
+               while ( !iMeetings.isEmpty() )
+                                       delete iMeetings.takeFirst();
+               emit meetingsFetched( iMeetings );
                return;
        }
 
@@ -164,9 +171,17 @@ void CommunicationManager::requestFinished( int aRequestId, int aError )
        
                int err = msg.getMeetingsFromResponse( iMeetings, *(rd->room) );
                if( err )
+                       {
                        emit error( ERROR_BASE+8, CommunicationManager::FetchingCommunication );
+                       while ( !iMeetings.isEmpty() )
+                                                               delete iMeetings.takeFirst();
+                                       emit meetingsFetched( iMeetings );
+                       }
                else
+                       {
+                       qDebug("*** COMMUNICATIONMANAGER ::: Meetings fetched!");
                        emit meetingsFetched( iMeetings );
+                       }
                break;
                }
        case ConvertId:
@@ -185,7 +200,13 @@ void CommunicationManager::requestFinished( int aRequestId, int aError )
                ResMsgGetCalendarItem msg( *response );
                int err = msg.getMeetingDetailsFromResponse( *(rd->meeting) );
                if( err )
+                       {
                        emit error( ERROR_BASE+9, CommunicationManager::FetchingCommunication );
+                       while ( !iMeetings.isEmpty() )
+                                                               delete iMeetings.takeFirst();
+                                       emit meetingsFetched( iMeetings );
+                       }
+
                else
                        emit meetingDetailsFetched( *(rd->meeting) );
                break;
@@ -235,3 +256,4 @@ const CommunicationManager::RequestData* CommunicationManager::findRequest( Requ
        }
        return NULL;
 }
+
index 4dfd00b..abfce60 100644 (file)
@@ -36,7 +36,7 @@ public:
        /*! 
         *  \param aConnection Reference to the fetching ConnectionSettings.
        */
-       CommunicationManager( const ConnectionSettings &aConnection );
+       CommunicationManager( /*const ConnectionSettings &aConnection*/ );
        virtual ~CommunicationManager();
        //! Starts fetching meetings. Meetings are returned by the meetingsFetched signal.
        /*! 
@@ -157,7 +157,7 @@ protected:
        
 private:
        //! Instance of Connection settings of the fetching communication
-       ConnectionSettings *iConnectionSettings;
+       //ConnectionSettings *iConnectionSettings;
        //! Instance of the fetching communication
        Communication* iFetchingCommunication;
        //! Instance of the modifying communication
diff --git a/src/UserInterface/Components/BorderedBarWidget.cpp b/src/UserInterface/Components/BorderedBarWidget.cpp
new file mode 100644 (file)
index 0000000..0b92511
--- /dev/null
@@ -0,0 +1,171 @@
+#include <QPainter>
+#include "BorderedBarWidget.h"
+
+BorderedBarWidget::BorderedBarWidget( QWidget *aParent ) :
+       QWidget( aParent ){
+       iCenterLabel = new QLabel(this);
+       iCenterLabel->setAlignment( Qt::AlignCenter );
+       iLeftLabel = new QLabel(this);
+       iLeftLabel->setAlignment( Qt::AlignLeading | Qt::AlignVCenter);
+       iRightLabel = new QLabel(this);
+       iRightLabel->setAlignment( Qt::AlignTrailing | Qt::AlignVCenter);
+}
+
+BorderedBarWidget::~BorderedBarWidget() {
+       delete iCenterLabel;
+       delete iLeftLabel;
+       delete iRightLabel;
+}
+
+QColor BorderedBarWidget::backgroundColor()
+{
+       return iPalette.color( QPalette::Window );;
+}
+
+QColor BorderedBarWidget::faceColor()
+{
+       return iPalette.color( QPalette::WindowText );;
+}
+
+int BorderedBarWidget::borderWidth()
+{
+       return iBorderWidth;
+}
+
+QString BorderedBarWidget::text( TextPosition aPos )
+{
+       if ( aPos == CenterAlign )
+               return iCenterLabel->text();
+       else if ( aPos == LeftAlign )
+               return iLeftLabel->text();
+       else if ( aPos == RightAlign )
+               return iRightLabel->text();
+       return "";
+}
+
+void BorderedBarWidget::setBackgroundColor( QColor aColor )
+{
+       iPalette.setColor( QPalette::Window, aColor );
+       iCenterLabel->setPalette( iPalette );
+       iLeftLabel->setPalette( iPalette );
+       iRightLabel->setPalette( iPalette );
+}
+
+void BorderedBarWidget::setFaceColor( QColor aColor )
+{
+       iPalette.setColor( QPalette::WindowText, aColor );
+       iCenterLabel->setPalette( iPalette );
+       iLeftLabel->setPalette( iPalette );
+       iRightLabel->setPalette( iPalette );
+}
+
+void BorderedBarWidget::setBorderWidth( int aWidth )
+{
+       iBorderWidth = aWidth;
+       iRightLabel->setMargin( 2*iBorderWidth );
+       iLeftLabel->setMargin( 2*iBorderWidth );
+}
+
+void BorderedBarWidget::setText( QString aText, TextPosition aPos )
+{
+       if ( aPos == CenterAlign )
+               iCenterLabel->setText( aText );
+       else if ( aPos == LeftAlign )
+               iLeftLabel->setText( aText );
+       else if ( aPos == RightAlign )
+               iRightLabel->setText( aText );
+}
+
+void BorderedBarWidget::setPixmap( QPixmap aPixmap, TextPosition aPos )
+{
+       if ( aPos == CenterAlign )
+               iCenterLabel->setPixmap( aPixmap );
+       else if ( aPos == LeftAlign )
+               iLeftLabel->setPixmap( aPixmap );
+       else if ( aPos == RightAlign )
+               iRightLabel->setPixmap( aPixmap );
+}
+
+void BorderedBarWidget::paintEvent(QPaintEvent *)
+{
+       drawBorder();
+       iCenterLabel->setGeometry( rect() );
+       iLeftLabel->setGeometry( rect() );
+       iRightLabel->setGeometry( rect() );
+}
+
+void BorderedBarWidget::mousePressEvent( QMouseEvent * )
+{
+       emit ( clicked() );
+}
+
+
+void BorderedBarWidget::drawCorner( QPainter &aPainter, QPoint &aCenter )
+{
+       QRadialGradient radialGrad(QPointF(aCenter), iBorderWidth);
+       radialGrad.setColorAt(0, iPalette.color( QPalette::WindowText));
+       radialGrad.setColorAt(1, iPalette.color( QPalette::Window));
+    aPainter.setBrush(radialGrad);
+       aPainter.drawEllipse(QPoint(aCenter), iBorderWidth, iBorderWidth);
+}
+
+void BorderedBarWidget::drawSide( QPainter &aPainter, QPoint aStartPoint, QPoint aEndPoint )
+{
+       QPoint d = aEndPoint - aStartPoint;
+       QPoint gradEnd = aStartPoint;
+       if ( abs( d.x() ) < abs( d.y() ) )
+               gradEnd.setX( aEndPoint.x()+1 );
+       else
+               gradEnd.setY( aEndPoint.y()+1 );
+
+       QLinearGradient linearGradTop(aStartPoint, gradEnd);
+       linearGradTop.setColorAt(0, iPalette.color( QPalette::Window));
+       linearGradTop.setColorAt(1, iPalette.color( QPalette::WindowText));
+    aPainter.setBrush(linearGradTop);
+       aPainter.drawRect( QRect(aStartPoint,aEndPoint) );
+}
+
+void BorderedBarWidget::drawBorder()
+{
+       QPainter painter(this);
+    painter.setPen(Qt::NoPen);
+       painter.setRenderHint(QPainter::Antialiasing, true);
+
+       /*top left corner*/
+       QPoint center(iBorderWidth,iBorderWidth);
+       drawCorner( painter, center );
+
+       /*top right corner*/
+       center.setX( this->rect().right()-iBorderWidth );
+       center.setY( iBorderWidth );
+       drawCorner( painter, center );
+
+       /*bottom left corner*/
+       center.setX( iBorderWidth );
+       center.setY( this->rect().bottom()-iBorderWidth );
+       drawCorner( painter, center );
+
+       /*bottom right corner*/
+       center.setX( this->rect().right()-iBorderWidth );
+       center.setY( this->rect().bottom()-iBorderWidth );
+       drawCorner( painter, center );
+
+       /*top*/
+       drawSide( painter, QPoint(iBorderWidth,0), QPoint(this->rect().right()-(iBorderWidth+1),(iBorderWidth-1)) );
+
+       /*right*/
+       drawSide( painter, QPoint(this->rect().right(),this->rect().bottom()-iBorderWidth), QPoint(this->rect().right()-(iBorderWidth+1),iBorderWidth-1) );
+
+       /*bottom*/
+       drawSide( painter, QPoint(this->rect().right()-iBorderWidth, this->rect().bottom()), QPoint((iBorderWidth-1),this->rect().bottom()-(iBorderWidth+1)) );
+
+       /*left*/
+       drawSide( painter, QPoint(0,iBorderWidth), QPoint((iBorderWidth-1), this->rect().bottom()-(iBorderWidth+1)) );
+
+       /*inside*/
+       QBrush brush( iPalette.color( QPalette::Window ) );
+       painter.setBrush(brush);
+       QRect inside(iBorderWidth,iBorderWidth,this->rect().right()-2*iBorderWidth,this->rect().bottom()-2*iBorderWidth);
+       painter.drawRoundRect(inside,iBorderWidth,iBorderWidth);
+
+}
diff --git a/src/UserInterface/Components/BorderedBarWidget.h b/src/UserInterface/Components/BorderedBarWidget.h
new file mode 100644 (file)
index 0000000..c3e56bf
--- /dev/null
@@ -0,0 +1,137 @@
+#ifndef BORDEREDBARWIDGET_H_
+#define BORDEREDBARWIDGET_H_
+
+#include <QtGui/QWidget>
+#include <QtGui/QLabel>
+
+//! Userinterface class. Displays text or images with a gradient border.
+/*!
+ * Userinterface class. Displays text or images with a gradient border. Inherits QWidget and
+ * diplays content in QLabel.
+ */
+class BorderedBarWidget : public QWidget {
+
+       Q_OBJECT;
+
+public:
+       enum TextPosition
+       {
+               LeftAlign, /*!< Indicates that the item inserted should be aligned to the left. */
+               CenterAlign, /*!< Indicates that the item inserted should be aligned to the center. */
+               RightAlign /*!< Indicates that the item inserted should be aligned to the right. */
+       };
+
+public:
+       //! Constructor.
+       /*!
+        * Constructor to initialize a BorderedBarWidget instance.
+        * \param aParent Parent widget. Optional.
+        */
+       BorderedBarWidget( QWidget *aParent = 0 );
+       //! Destructor.
+       virtual ~BorderedBarWidget();
+
+       //! Returns background color.
+       /*!
+        * \return The background color of the widget.
+        */
+       QColor backgroundColor();
+       //! Returns face color.
+       /*!
+        * \return The text and border color.
+        */
+    QColor faceColor();
+       //! Returns border width.
+       /*!
+        * \return The border width.
+        */
+    int borderWidth();
+       //! Returns text.
+       /*!
+        * \param aPos Text position. Optional.
+        * \return The text at a position.
+        */
+    QString text( TextPosition aPos = CenterAlign );
+
+       //! Sets background color.
+       /*!
+        * Sets the background color of the widget.
+        * \param aColor The new color.
+        */
+    void setBackgroundColor( QColor aColor);
+       //! Sets face color.
+       /*!
+        * Sets the text and border color of the widget.
+        * \param aColor The new color.
+        */
+    void setFaceColor( QColor aColor );
+       //! Sets border width.
+       /*!
+        * Sets the width of the border.
+        * \param aWidth The new width in pixels.
+        */
+    void setBorderWidth( int aWidth );
+       //! Sets text.
+       /*!
+        * Sets text to a certain position in a bar.
+        * \param aText The new text.
+        * \param aPos The position of the text. Optional.
+        */
+    void setText( QString aText, TextPosition aPos = CenterAlign );
+       //! Sets pixmap.
+       /*!
+        * Sets pixmap to a certain position in a bar.
+        * \param aPixmap The new pixmap.
+        * \param aPos The position of the pixmap. Optional.
+        */
+    void setPixmap( QPixmap aPixmap, TextPosition aPos = RightAlign );
+
+signals:
+
+       void clicked();
+
+private:
+       //! Draws the borders.
+       /*!
+        * Handles drawing of the borders.
+        */
+       void drawBorder();
+       //! Draws corner.
+       /*!
+        * Handles drawing of a corner.
+        * \param aPainter Painter used for drawing.
+        * \param aCenter Inner corner of the widget.
+        */
+       void drawCorner( QPainter &aPainter, QPoint &aCenter );
+       //! Draws side.
+       /*!
+        * Handles drawing of a single side.
+        * \param aPainter Painter used for drawing.
+        * \param aStartPoint Start point of drawing area.
+        * \param aEndPoint End point of drawing area.
+        */
+       void drawSide( QPainter &aPainter, QPoint aStartPoint, QPoint aEndPoint );
+
+protected:
+       //! Handles drawing of the widget.
+       /*!
+        * Handles drawing of the widget.
+        */
+    virtual void paintEvent(QPaintEvent *);
+
+    void mousePressEvent( QMouseEvent * );
+
+private:
+       //! Palette for storing colors.
+    QPalette iPalette;
+       //! Border width.
+    int iBorderWidth;
+       //! Label for left aligned content.
+       QLabel *iLeftLabel;
+       //! Label for center aligned content.
+    QLabel *iCenterLabel;
+       //! Label for right aligned content.
+       QLabel *iRightLabel;
+};
+
+#endif /* BORDEREDBARWIDGET_H_ */
index fad0493..defd64f 100644 (file)
@@ -13,8 +13,9 @@ MeetingRoomCombo::MeetingRoomCombo( QList<Room*> aRooms, QWidget *aParent ) :
        qSort( iRooms.begin(), iRooms.end(), Room::caseInsensitiveLessThan );
 
        QFont regularTextFont;
-       regularTextFont.setBold( false );
-       regularTextFont.setPointSize( 12 );
+       regularTextFont.setStyleHint( QFont::Helvetica );
+       regularTextFont.setBold( true );
+       regularTextFont.setPixelSize( 18 );
 
        iRoomCombo = new QComboBox( this );
        for ( int i = 0; i < iRooms.count(); i++ )
@@ -22,6 +23,7 @@ MeetingRoomCombo::MeetingRoomCombo( QList<Room*> aRooms, QWidget *aParent ) :
                iRoomCombo->addItem( iRooms.at( i )->name() );
        }
        iRoomCombo->setFont( regularTextFont );
+       iRoomCombo->setFixedHeight( 46 );
        connect( iRoomCombo, SIGNAL( currentIndexChanged( int ) ), this, SLOT( setCurrentIndex( int ) ) );
        connect( iRoomCombo, SIGNAL( currentIndexChanged( const QString & ) ), this, SLOT( setCurrentRoomBy( const QString & ) ) );
 
index 0d68da6..181593e 100644 (file)
@@ -9,11 +9,14 @@
 #include <QPainter>
 #include "Meeting.h"
 
-const QColor ScheduleWidget::sFreeBackground = QColor( 192, 238, 189 );
+const QColor ScheduleWidget::sFreeBackground = QColor( Qt::white );
 const QColor ScheduleWidget::sBusyBackground = QColor( 238, 147, 17 );
+const QColor ScheduleWidget::sBusyBackgroundStart = QColor( 254, 193, 104 );
+const QColor ScheduleWidget::sCurrentBackgroundStart = QColor( 237, 124, 125 );
+const QColor ScheduleWidget::sCurrentBackground = QColor( 161, 1, 1 );
 const QColor ScheduleWidget::sHeaderBackground = QColor( Qt::white );
 const QColor ScheduleWidget::sDayHighlightColor = QColor( 255, 235, 160 );
-const QColor ScheduleWidget::sTimeHighlightColor = QColor( Qt::blue );
+const QColor ScheduleWidget::sTimeHighlightColor = QColor( Qt::black );
 const QColor ScheduleWidget::sMainGridColor = QColor( 140, 140, 140 );
 const QColor ScheduleWidget::sHalfGridColor = QColor( 195, 195, 195 );
 const QColor ScheduleWidget::sFrameColor = QColor( Qt::black );
@@ -94,8 +97,6 @@ void ScheduleTableWidget::paintEvent( QPaintEvent* aEvent )
        }
 
        // draw meetings
-       QBrush brush( ScheduleWidget::sBusyBackground );
-       painter.setBrush( brush );
        painter.setRenderHint( QPainter::Antialiasing );
        painter.setPen( ScheduleWidget::sFrameColor );
        populateMeetingList();
@@ -104,6 +105,21 @@ void ScheduleTableWidget::paintEvent( QPaintEvent* aEvent )
        {
                for ( int i = 0; i < iMeetingsByDay[day].size(); ++i )
                {
+                       QLinearGradient linearGrad( QPoint(iMeetingsByDay[day][i].rect.x(),iMeetingsByDay[day][i].rect.y()) , QPoint(iMeetingsByDay[day][i].rect.x(),iMeetingsByDay[day][i].rect.bottom()) );
+                       // draw meeting with red if it is ongoing
+                       if ( iMeetingsByDay[day][i].meeting->startsAt() <= QDateTime::currentDateTime() &&
+                                       iMeetingsByDay[day][i].meeting->endsAt() >= QDateTime::currentDateTime() )
+                       {
+                               linearGrad.setColorAt(0, ScheduleWidget::sCurrentBackgroundStart);
+                               linearGrad.setColorAt(1, ScheduleWidget::sCurrentBackground);
+                       }
+                       else
+                       {
+                               linearGrad.setColorAt(0, ScheduleWidget::sBusyBackgroundStart);
+                               linearGrad.setColorAt(1, ScheduleWidget::sBusyBackground);
+                       }
+                       painter.setBrush(linearGrad);
+
                        painter.drawRoundRect( iMeetingsByDay[day][i].rect, 20, 20 );
                }
        }
@@ -295,7 +311,9 @@ ScheduleWidget::ScheduleWidget( QDateTime aCurrentDateTime, DisplaySettings *aSe
        iScheduleTable->setShowGrid( false );
 
        QFont font;
-       font.setPointSize( 10 );
+       font.setStyleHint( QFont::Helvetica );
+       font.setBold( true );
+       font.setPixelSize( 20 );
 
        // add empty item to top-left corner, this will be updated in refresh()
        QTableWidgetItem *weekItem = new QTableWidgetItem();
@@ -346,7 +364,11 @@ ScheduleWidget::ScheduleWidget( QDateTime aCurrentDateTime, DisplaySettings *aSe
 
 ScheduleWidget::~ScheduleWidget()
 {
-       delete iScheduleTable;
+       if ( iScheduleTable )
+       {
+               delete iScheduleTable;
+               iScheduleTable = 0;
+       }
 }
 
 QDate ScheduleWidget::beginningOfShownWeek()
@@ -366,7 +388,7 @@ void ScheduleWidget::refresh()
                        item->setText( tr( "Wk %1" ).arg( iShownDate.weekNumber() ) );
                        continue;
                }
-               item->setText( iShownDate.addDays( i - 1 ).toString( tr( "ddd d MMM" ) ) );
+               item->setText( iShownDate.addDays( i - 1 ).toString( tr( "ddd d/M" ) ) );
 
                if ( iCurrentDateTime.date() == iShownDate.addDays( i - 1 ) )
                {
@@ -446,10 +468,10 @@ int ScheduleWidget::weekLengthAsDays()
 void ScheduleWidget::resizeEvent( QResizeEvent* /* aEvent */ )
 {
        QRect rect = iScheduleTable->contentsRect();
-       int rowHeight = ( int )( rect.height() / ( float )iScheduleTable->rowCount() );
-       int headerRowHeight = rowHeight;
-       int columnWidth = ( int )( rect.width() / ( iScheduleTable->columnCount() - 0.5f ) );
-       int headerColumnWidth = columnWidth / 2;
+       int rowHeight = ( int )( rect.height() / ( float )( iScheduleTable->rowCount() + 1 ) );
+       int headerRowHeight = ( int )rowHeight*2;
+       int headerColumnWidth = rect.width() * 0.15f;
+       int columnWidth = ( rect.width() - headerColumnWidth ) / ( iScheduleTable->columnCount() - 1 );
 
        iScheduleTable->setRowHeight( 0, headerRowHeight );
        for ( int i = 1; i < iScheduleTable->rowCount(); ++i )
@@ -466,6 +488,7 @@ void ScheduleWidget::resizeEvent( QResizeEvent* /* aEvent */ )
        // resize table so that frame size matches exactly
        int leftMargin = 0, topMargin = 0, rightMargin = 0, bottomMargin = 0;
        iScheduleTable->getContentsMargins( &leftMargin, &topMargin, &rightMargin, &bottomMargin );
-       iScheduleTable->resize( columnWidth * iScheduleTable->columnCount() - headerColumnWidth + leftMargin + rightMargin,
-                                       rowHeight * iScheduleTable->rowCount() + topMargin + bottomMargin );
+       iScheduleTable->resize( columnWidth * ( iScheduleTable->columnCount() - 1 ) +
+                                               headerColumnWidth + leftMargin + rightMargin,
+                                               rowHeight * ( iScheduleTable->rowCount() + 1 ) + topMargin + bottomMargin );
 }
index 47b8e3f..27c7f11 100644 (file)
@@ -261,8 +261,17 @@ private:
        static const QColor sFreeBackground;
 
        //! Color for a busy cell.
+       static const QColor sBusyBackgroundStart;
+
+       //! Color for a busy cell.
        static const QColor sBusyBackground;
 
+       //! Color for a busy cell.
+       static const QColor sCurrentBackgroundStart;
+
+       //! Color for a busy cell.
+       static const QColor sCurrentBackground;
+
        //! Color for headers.
        static const QColor sHeaderBackground;
 
index 9a08de9..760eca9 100644 (file)
@@ -1,7 +1,10 @@
 #include "MeetingInfoDialog.h"
+
 #include "ToolBox.h"
 #include "Meeting.h"
 #include "Room.h"
+#include "Configuration.h"
+
 #include <QLabel>
 #include <QVBoxLayout>
 #include <QPushButton>
@@ -43,11 +46,30 @@ void MeetingInfoDialog::createDialogView(Meeting *aMeeting)
        boldFont.setBold( true );
 
        QLabel *subjectLabel = ToolBox::createLabel( tr( "Subject:" ), boldFont );
-       QLabel *subjectContent = ToolBox::createLabel( aMeeting->subject(), normalFont );
+       QLabel *subjectContent = new QLabel();
+       subjectContent->setFont( normalFont );
 
        QLabel *descriptionLabel = ToolBox::createLabel( tr( "Description:" ), boldFont );
        QTextEdit *descriptionContent = new QTextEdit( "" );
-       descriptionContent->setHtml( aMeeting->description() );
+
+       if( Configuration::instance()->showConfidentialMeetingDetails() )
+       {
+               subjectContent->setText( aMeeting->subject() );
+               descriptionContent->setHtml( aMeeting->description() );
+       }
+
+       if( subjectContent->text().isEmpty() )
+       {
+               subjectContent->setText( tr( "Room reserved", "Meeting Info Subject" ) ); // default subject text
+       }
+
+       qDebug() << "############ Desc: " << descriptionContent->toPlainText().trimmed();
+
+       if( descriptionContent->toPlainText().trimmed().isEmpty() )
+       {
+               descriptionContent->setPlainText( tr( "Room reserved", "Meeting Info Description" ) ); // default description text
+       }
+
        descriptionContent->setReadOnly( true );
        descriptionContent->setFont( normalFont );
 
index ebe2a90..2ee240e 100644 (file)
@@ -3,7 +3,8 @@
 #include <QLabel>
 #include <QFont>
 #include <QVBoxLayout>
-#include "DigitalTimeDisplayWidget.h"
+#include "BorderedBarWidget.h"
+
 #include "ToolBox.h"
 
 #include <QEvent>
@@ -15,68 +16,78 @@ QTime RoomStatusIndicatorWidget::endOfTheDay = QTime( 23, 59, 0, 0);
 RoomStatusIndicatorWidget::RoomStatusIndicatorWidget(Room *aDefaultRoom, Room::Status aStatus, QTime aUntil, QString aTimeFormat, QWidget *aParent) :
        ViewBase(ViewBase::ObservedView, aParent), iTimeFormat(aTimeFormat)
 {
-       QFont importantTextFont;
-       //importantTextFont.setBold( true );
-       importantTextFont.setPointSize( 20);
+       QFont clockFont;
+       clockFont.setStyleHint( QFont::Helvetica );
+       clockFont.setBold( true );
+       clockFont.setPixelSize( 36 );
+
+       QFont textFont;
+       textFont.setStyleHint( QFont::Helvetica );
+       textFont.setBold( true );
+       textFont.setPixelSize( 48 );
 
-       QFont regularTextFont;
-       //regularTextFont.setBold( true );
-       regularTextFont.setPointSize( 12);
+       QFont statusBarFont;
+       statusBarFont.setStyleHint( QFont::Helvetica );
+       statusBarFont.setPixelSize( 18 );
 
        // display for current time
        // Note: the time display receives current time info from Engine::clock()
-       iTimeDisplay = new DigitalTimeDisplayWidget( QTime::currentTime(), iTimeFormat, this );
-       iTimeDisplay->setFrameVisible( false);
-       iTimeDisplay->setSize( 250, 120);
+       iTimeDisplay = new BorderedBarWidget( this );
+       iTimeDisplay->setFaceColor( Qt::darkGray );
+       iTimeDisplay->setBackgroundColor( Qt::white );
+       iTimeDisplay->setBorderWidth( 6 );
+       iTimeDisplay->setFixedWidth( 170 );
+       iTimeDisplay->setFixedHeight( 50 );
+       iTimeDisplay->setFont( clockFont );
+
+       iStatusBar = new BorderedBarWidget( this );
+       iStatusBar->setFaceColor( Qt::darkGray );
+       iStatusBar->setBackgroundColor( Qt::white );
+       iStatusBar->setBorderWidth( 4 );
+       iStatusBar->setFont(statusBarFont);
+       iStatusBar->setFixedHeight( 36 );
+       iStatusBar->setText( tr("Disconnected"), BorderedBarWidget::LeftAlign );
 
        // Pegasus
        iDefaultRoomLabel
-                       = ToolBox::createLabel(aDefaultRoom->name(), importantTextFont);
-       iDefaultRoomLabel->setAlignment(Qt::AlignHCenter);
-       iDefaultRoomLabel->setHidden( true);
+                       = ToolBox::createLabel(aDefaultRoom->name(), textFont);
+       iDefaultRoomLabel->setAlignment( Qt::AlignHCenter );
+       iDefaultRoomLabel->setHidden( true );
 
        // is busy
-       iStatusLabel = ToolBox::createLabel(tr( "is %1" ).arg(statusToText(aStatus) ), importantTextFont);
-       iStatusLabel->setAlignment(Qt::AlignHCenter);
-       iStatusLabel->setStyleSheet("background-color: transparent");
-       iStatusLabel->setHidden( true);
+       iStatusLabel = ToolBox::createLabel(tr( "is %1" ).arg(statusToText(aStatus) ), textFont);
+       iStatusLabel->setAlignment( Qt::AlignHCenter );
+       iStatusLabel->setHidden( true );
 
        // until 13:22
        iUntilTextLabel
-                       = ToolBox::createLabel(tr( "until %1" ).arg(aUntil.toString(iTimeFormat) ), importantTextFont);
-       iUntilTextLabel->setAlignment(Qt::AlignHCenter);
-       iUntilTextLabel->setStyleSheet("background-color: transparent");
-       iUntilTextLabel->setHidden( true);
-
-       // No connection to server note
-       qDebug()
-                       << "RoomStatusIndicatorWidget::RoomStatusIndicatorWidget() creating connection label";
-       QFrame* connectionLabelFrame = new QFrame( this );
-       iConnectionLabel = new QLabel( tr( "No connection to server" ), connectionLabelFrame );
-       iConnectionLabel->setFont(importantTextFont);
-       iConnectionLabel->setAlignment(Qt::AlignHCenter);
-       iConnectionLabel->setWordWrap( true);
-       iConnectionLabel->setStyleSheet("background-color: transparent; color: red; text-decoration:blink; max-width: 250px");
-       connectionLabelFrame->setFixedSize(iConnectionLabel->sizeHint() );
-       if (connectedOnce && !connectionError)
-               iConnectionLabel->setHidden( true);
-
-       QVBoxLayout *topLayout = new QVBoxLayout;
-       topLayout->addStretch();
+                       = ToolBox::createLabel(tr( "until %1" ).arg(aUntil.toString(iTimeFormat) ), textFont);
+       iUntilTextLabel->setAlignment( Qt::AlignHCenter );
+       iUntilTextLabel->setHidden( true );
+
+       QHBoxLayout *topLayout = new QHBoxLayout;
        topLayout->addWidget(iTimeDisplay);
-       topLayout->addSpacing( 28);
-       topLayout->addWidget(iDefaultRoomLabel);
-       topLayout->addWidget(iStatusLabel);
-       topLayout->addWidget(iUntilTextLabel);
-       topLayout->addSpacing( 28);
-       topLayout->addWidget(connectionLabelFrame);
-       topLayout->addStretch();
-
-       QHBoxLayout *mainLayout = new QHBoxLayout;
-       mainLayout->addLayout(topLayout);
-       mainLayout->addStretch();
-       //mainLayout->setMargin( 65 );
-       mainLayout->setContentsMargins( 65, 65, 65, 0);
+
+       QVBoxLayout *textLayout = new QVBoxLayout;
+       textLayout->addWidget(iDefaultRoomLabel);
+       textLayout->addWidget(iStatusLabel);
+       textLayout->addWidget(iUntilTextLabel);
+       textLayout->addSpacing( 250 );
+
+       QHBoxLayout *centerLayout = new QHBoxLayout;
+       centerLayout->addLayout( textLayout );
+       centerLayout->addSpacing( 250 );
+
+       QHBoxLayout *bottomLayout = new QHBoxLayout;
+       bottomLayout->addSpacing( 56 );
+       bottomLayout->addWidget( iStatusBar );
+       bottomLayout->addSpacing( 56 );
+
+       QVBoxLayout *mainLayout = new QVBoxLayout;
+       mainLayout->addLayout( topLayout );
+       mainLayout->addSpacing( 50 );
+       mainLayout->addLayout( centerLayout );
+       mainLayout->addLayout( bottomLayout );
        setLayout(mainLayout);
 
        statusChanged(aStatus, aUntil);
@@ -95,6 +106,9 @@ RoomStatusIndicatorWidget::~RoomStatusIndicatorWidget()
 {
        delete iTimeDisplay;
        iTimeDisplay = 0;
+
+       delete iStatusBar;
+       iStatusBar = 0;
 }
 
 QString RoomStatusIndicatorWidget::statusToText(const Room::Status aStatus)
@@ -116,7 +130,7 @@ QPalette RoomStatusIndicatorWidget::createPalette(Room::Status aStatus)
        int cropheight(pixmap.height() - yoffset);
 
        QBrush brush;
-       if (windowState() == Qt::WindowFullScreen)
+       if ( (pixmap.width() == rect().width()) && (pixmap.height() == rect().height()) )
        {
                // Use the full image in full screen mode
                brush.setTexture(pixmap);
@@ -130,16 +144,42 @@ QPalette RoomStatusIndicatorWidget::createPalette(Room::Status aStatus)
 
        QPalette palette;
        palette.setColor( QPalette::Window, Qt::white );
-       palette.setColor( QPalette::WindowText, Qt::darkGray );
+       palette.setColor( QPalette::WindowText, Qt::black );
        palette.setBrush( QPalette::Window, brush );
        return palette;
 }
 
-void RoomStatusIndicatorWidget::setCurrentTime(QTime aCurrentTime)
+void RoomStatusIndicatorWidget::setConnectionStatus( QDateTime aCurrentTime, bool aConnected,
+               QTime aLastUpdated, QString aError )
 {
-       iTimeDisplay->setTime(aCurrentTime);
+       iTimeDisplay->setText( aCurrentTime.toString( iTimeFormat ) );
+       if ( aLastUpdated.isNull() )
+               iStatusBar->setText( tr("Disconnected") , BorderedBarWidget::LeftAlign );
+       else
+       {
+               iDefaultRoomLabel->setHidden( false );
+               iUntilTextLabel->setHidden( false );
+               iStatusLabel->setHidden( false );
+
+               if (!aConnected)
+               {
+                       iStatusBar->setText( tr("Disconnected"), BorderedBarWidget::LeftAlign );
+               }
+               else
+               {
+                       iStatusBar->setText( tr("Connected - Last update %1").arg(aLastUpdated.toString(iTimeFormat)) ,
+                                       BorderedBarWidget::LeftAlign );
+               }
+       }
+       showError( aError );
 }
 
+void RoomStatusIndicatorWidget::showError( QString aError )
+{
+       iStatusBar->setText( aError );
+}
+
+
 void RoomStatusIndicatorWidget::statusChanged(const Room::Status aStatus, const QTime aUntil)
 {
        iStatusLabel->setText(tr( "is %1" ).arg(statusToText(aStatus) ) );
@@ -164,11 +204,11 @@ bool RoomStatusIndicatorWidget::event(QEvent *event)
        switch (event->type())
        {
                case QEvent::Paint:
-                       qDebug() << "[RoomStatusIndicatorWidget::event] <Paint event>";
+                       //qDebug() << "[RoomStatusIndicatorWidget::event] <Paint event>";
                        break;
                case QEvent::PaletteChange:
-                       qDebug()
-                                       << "[RoomStatusIndicatorWidget::event] <Palette change event>";
+                       //qDebug()
+                       //              << "[RoomStatusIndicatorWidget::event] <Palette change event>";
                        break;
                default:
                        break;
@@ -179,24 +219,10 @@ bool RoomStatusIndicatorWidget::event(QEvent *event)
 
 void RoomStatusIndicatorWidget::connectionEstablished()
 {
-       if ( !connectedOnce)
-       { 
-               // Just got the required meetings for the first time              
-               qDebug() << "RoomStatusIndicatorWidget::connectionEstablished() first call";
-               iDefaultRoomLabel->setHidden( false);
-               iUntilTextLabel->setHidden( false);
-               iStatusLabel->setHidden( false);
-       }
-       else
-       {
-               qDebug() << "RoomStatusIndicatorWidget::connectionEstablished()";
-       }
        ViewBase::connectionEstablished();
-       iConnectionLabel->setHidden( true);
 }
 
 void RoomStatusIndicatorWidget::connectionLost()
 {
        ViewBase::connectionLost();
-       iConnectionLabel->setHidden( false);
 }
index 643160a..c9256dc 100644 (file)
@@ -10,7 +10,7 @@
 \r
 class QLabel;\r
 class QVBoxLayout;\r
-class TimeDisplayWidget;\r
+class BorderedBarWidget;\r
 \r
 class QEvent;\r
 \r
@@ -43,13 +43,14 @@ public:
        bool event(QEvent *event);\r
 \r
 public slots:\r
-       //! Slot. Sets current time.\r
+       //! Slot. Sets the connection status\r
        /*!\r
-        * Slots. Sets current time on the widget. It is used to provide up-to-date time for the widget's\r
-        * TimeDisplayWidget.\r
-        * \param aCurrentTime The current time.\r
+        * Sets the current time, and connection status\r
+        * \param aCurrentTime Time to be displayed.\r
+        * \param aConnected connection status to be displayed.\r
+        * \param aLastUpdated Time of last successful connection to be displayed.\r
         */\r
-       void setCurrentTime( QTime aCurrentTime );\r
+       void setConnectionStatus( QDateTime aCurrentTime, bool aConnected, QTime aLastUpdated = QTime(), QString aError = "");\r
        //! Slot. Used to indicate changes in the status of the default room.\r
        /*!\r
         * Slot. Used to indicate changes in the status of the default room. If the specified until time equals\r
@@ -60,9 +61,11 @@ public slots:
         */\r
        void statusChanged( const Room::Status aStatus, const QTime aUntil );\r
        \r
+       void showError( QString aError );\r
+\r
        void currentRoomChanged( Room *aRoom );\r
        \r
-       void viewResized(const QSize &newSize, const QSize &oldSize) { }\r
+       void viewResized(const QSize &/*newSize*/, const QSize &/*oldSize*/) { }\r
 \r
        void connectionEstablished();\r
        \r
@@ -88,8 +91,9 @@ private:
        QLabel *iDefaultRoomLabel;\r
        QLabel *iStatusLabel;\r
        QLabel *iUntilTextLabel;\r
-       QLabel *iConnectionLabel;\r
-       TimeDisplayWidget *iTimeDisplay;\r
+       BorderedBarWidget *iTimeDisplay;\r
+       BorderedBarWidget *iStatusBar;\r
+\r
        QString iTimeFormat;\r
 \r
        static QTime endOfTheDay;\r
index 30ab301..fad4c15 100644 (file)
 #include "DisplaySettings.h"
 #include "ConnectionSettings.h"
 #include "StartupSettings.h"
+#include <QScrollArea>
 
 #include <QtDebug>
 
+#define QT_DELETE(X) \
+       if ( X != 0 ) \
+       { \
+               qDebug() << "delete " << X; \
+               delete X; \
+               X = 0; \
+       }
+
 SettingsView::SettingsView( QWidget *aParent ) :
                ViewBase( ViewBase::NormalView, aParent )
 {
@@ -66,96 +75,26 @@ SettingsView::SettingsView( QWidget *aParent ) :
 
 SettingsView::~SettingsView()
 {
-       if ( iTabWidget != 0 )
-       {
-               delete iTabWidget;
-               iTabWidget = 0;
-       }
-       if ( iOkButton != 0 )
-       {
-               delete iOkButton;
-               iOkButton = 0;
-       }
-       if ( iCancelButton != 0 )
-       {
-               delete iCancelButton;
-               iCancelButton = 0;
-       }
-       if ( iSettingsTab != 0 )
-       {
-               delete iSettingsTab;
-               iSettingsTab = 0;
-       }
-       if ( iWeekViewTab != 0 )
-       {
-               delete iWeekViewTab;
-               iWeekViewTab = 0;
-       }
-       if ( iResourcesTab != 0 )
-       {
-               delete iResourcesTab;
-               iResourcesTab = 0;
-       }
-       if ( iKioskModeTab != 0 )
-       {
-               delete iKioskModeTab;
-               iKioskModeTab = 0;
-       }
-       if ( iUserName != 0 )
-       {
-               delete iUserName;
-               iUserName = 0;
-       }
-       if ( iPassword != 0 )
-       {
-               delete iPassword;
-               iPassword = 0;
-       }
-       if ( iServerAddress != 0 )
-       {
-               delete iServerAddress;
-               iServerAddress = 0;
-       }
-       if ( iDayStartTime != 0 )
-       {
-               delete iDayStartTime;
-               iDayStartTime = 0;
-       }
-       if ( iDayEndTime != 0 )
-       {
-               delete iDayEndTime;
-               iDayEndTime = 0;
-       }
-       if ( iFiveDays != 0 )
-       {
-               delete iFiveDays;
-               iFiveDays = 0;
-       }
-       if ( iSevenDays != 0 )
-       {
-               delete iSevenDays;
-               iSevenDays = 0;
-       }
-       if ( iRefreshInterval != 0 )
-       {
-               delete iRefreshInterval;
-               iRefreshInterval = 0;
-       }
-       if ( iPowerSaveEnabled != 0 )
-       {
-               delete iPowerSaveEnabled;
-               iPowerSaveEnabled = 0;
-       }
-       if ( iPowerSaveStartTime != 0 )
-       {
-               delete iPowerSaveStartTime;
-               iPowerSaveStartTime = 0;
-       }
-       if ( iPowerSaveEndTime != 0 )
-       {
-               delete iPowerSaveEndTime;
-               iPowerSaveEndTime = 0;
-       }
+       qDebug() << "[SettingsView::~SettingsView]";
+       /*QT_DELETE(iOkButton);
+       QT_DELETE(iCancelButton);
+       QT_DELETE(iUserName);
+       QT_DELETE(iPassword);
+       QT_DELETE(iServerAddress);
+       QT_DELETE(iDayStartTime);
+       QT_DELETE(iDayEndTime);
+       QT_DELETE(iFiveDays);
+       QT_DELETE(iSevenDays);
+       QT_DELETE(iRefreshInterval);
+       QT_DELETE(iPowerSaveEnabled);
+       QT_DELETE(iPowerSaveStartTime);
+       QT_DELETE(iPowerSaveEndTime);
+       QT_DELETE(iShowConfidentialMeetingDetails);
+       QT_DELETE(iSettingsTab);
+       QT_DELETE(iWeekViewTab);
+       QT_DELETE(iResourcesTab);
+       QT_DELETE(iKioskModeTab);
+       QT_DELETE(iTabWidget);*/
 }
 
 QWidget *SettingsView::initSettingsTab()
@@ -174,6 +113,7 @@ QWidget *SettingsView::initSettingsTab()
        // Create the group boxes
        QGroupBox *userInformationGroup = new QGroupBox( tr( "User Information" ) );
        QGroupBox *serverInformationGroup = new QGroupBox( tr( "Server Information" ) );
+       QGroupBox *privacySettingsGroup = new QGroupBox( tr( "Privacy Settings" ) );
 
        // Prepare the user infromation group box
        QGridLayout *ugl = new QGridLayout;
@@ -201,14 +141,25 @@ QWidget *SettingsView::initSettingsTab()
 
        serverInformationGroup->setLayout( sgl );
 
+       // Prepare meeting info setting box
+       QGridLayout *pgl = new QGridLayout;
+       iShowConfidentialMeetingDetails = new QCheckBox( tr( "Show confidential meeting details" ) );
+
+       pgl->addWidget( iShowConfidentialMeetingDetails, 0, 0 );
+
+       privacySettingsGroup->setLayout( pgl );
+       
        // Prepare and set the main layout
        QVBoxLayout *mainLayout = new QVBoxLayout;
        mainLayout->addWidget( userInformationGroup );
        mainLayout->addWidget( serverInformationGroup );
+       mainLayout->addWidget( privacySettingsGroup );
 
        widget->setLayout( mainLayout );
 
-       return widget;
+       QScrollArea *scroll = new QScrollArea;
+       scroll->setWidget(widget);
+       return scroll;
 }
 
 QWidget *SettingsView::initWeekViewTab()
@@ -251,7 +202,9 @@ QWidget *SettingsView::initWeekViewTab()
 
        widget->setLayout( mainLayout );
 
-       return widget;
+       QScrollArea *scroll = new QScrollArea;
+       scroll->setWidget(widget);
+       return scroll;
 }
 
 QWidget *SettingsView::initResourcesTab()
@@ -298,7 +251,9 @@ QWidget *SettingsView::initResourcesTab()
 
        widget->setLayout( mainLayout );
 
-       return widget;
+       QScrollArea *scroll = new QScrollArea;
+       scroll->setWidget(widget);
+       return scroll;
 }
 
 QWidget *SettingsView::initKioskModeTab()
@@ -320,7 +275,7 @@ QWidget *SettingsView::initKioskModeTab()
        }
        iPowerSaveStartTime->setTime( Configuration::instance()->startupSettings()->turnOnAt() );
        iPowerSaveEndTime->setTime( Configuration::instance()->startupSettings()->turnOffAt() );
-
+       
        // Prepare the admin password box
        QGroupBox *adminPasswordGroup = new QGroupBox( tr( "Admin Password" ) );
        QLabel *oldPwdLabel = new QLabel( tr( "Old password:" ) );
@@ -369,7 +324,9 @@ QWidget *SettingsView::initKioskModeTab()
 
        widget->setLayout( mainLayout );
 
-       return widget;
+       QScrollArea *scroll = new QScrollArea;
+       scroll->setWidget(widget);
+       return scroll;
 }
 
 void SettingsView::handleOkClicked()
@@ -392,16 +349,18 @@ void SettingsView::handleOkClicked()
        bool sevenDays = iSevenDays->isChecked();
        bool powerSaveEnabled = iPowerSaveEnabled->isChecked();
 
+       bool showConfidentialMeetingDetails = iShowConfidentialMeetingDetails->isChecked();
+       
        // set values to Configuration
        // set user information
-       Configuration::instance()->connectionSettings()->setUsername( userName );
-       Configuration::instance()->connectionSettings()->setPassword( password );
+       Configuration::instance()->setUsername(userName);//connectionSettings()->setUsername( userName );
+       Configuration::instance()->setPassword(password);//connectionSettings()->setPassword( password );
        
        // set server information
-       Configuration::instance()->connectionSettings()->setServerUrl( serverAddress );
+       Configuration::instance()->setServerUrl(serverAddress);//connectionSettings()->setServerUrl( serverAddress );
        if ( ok )
        {
-               Configuration::instance()->connectionSettings()->setRefreshInterval( refreshInterval );
+               Configuration::instance()->setRefreshinterval(refreshInterval);//connectionSettings()->setRefreshInterval( refreshInterval );
        }
        
        // set weekly view settings
@@ -421,8 +380,15 @@ void SettingsView::handleOkClicked()
        Configuration::instance()->startupSettings()->setTurnOnAt( powerSaveStart );
        Configuration::instance()->startupSettings()->setTurnOffAt( powerSaveEnd );
        
+       // set privacy settings
+       Configuration::instance()->setShowConfidentialMeetingDetails( showConfidentialMeetingDetails );
+       
+       qDebug() << "[SettingsView::okClicked] save()";
+       
        // save configuration
        Configuration::instance()->save();
+
+       qDebug() << "[SettingsView::okClicked] setValues()";
        
        // Emit the signal to notify that ok is pressed and data is saved.
        setValues();
@@ -448,12 +414,12 @@ void SettingsView::handleCancelClicked()
 void SettingsView::setValues()
 {
        // set user information
-       iUserName->setText( Configuration::instance()->connectionSettings()->username() );
-       iPassword->setText( Configuration::instance()->connectionSettings()->password() );
+       iUserName->setText( Configuration::instance()->getUsername() );
+       iPassword->setText( Configuration::instance()->getPassword());//connectionSettings()->password() );
        // set server information
-       iServerAddress->setText( Configuration::instance()->connectionSettings()->serverUrl().toString() );
+       iServerAddress->setText( Configuration::instance()->getServerUrl().toString());//connectionSettings()->serverUrl().toString() );
        QString refreshIntervalStr;
-       refreshIntervalStr.setNum( Configuration::instance()->connectionSettings()->refreshInterval() );
+       refreshIntervalStr.setNum( Configuration::instance()->getRefreshinterval());//connectionSettings()->refreshInterval() );
        iRefreshInterval->setText( refreshIntervalStr );
        // set weekly view display settings
        if ( Configuration::instance()->displaySettings()->daysInSchedule() == DisplaySettings::WeekdaysInSchedule )
@@ -479,4 +445,7 @@ void SettingsView::setValues()
        }
        iPowerSaveStartTime->setTime( Configuration::instance()->startupSettings()->turnOnAt() );
        iPowerSaveEndTime->setTime( Configuration::instance()->startupSettings()->turnOffAt() );
+       
+       // set privacy settings
+       iShowConfidentialMeetingDetails->setChecked( Configuration::instance()->showConfidentialMeetingDetails() );
 }
index c86e690..923da77 100644 (file)
@@ -90,6 +90,9 @@ private:
        QTimeEdit *iPowerSaveStartTime;
        //! End time for deactivating power save.
        QTimeEdit *iPowerSaveEndTime;
+
+       //! Show confidential meeting details.
+       QCheckBox *iShowConfidentialMeetingDetails;
 };
 
 #endif /*SETTINGSVIEW_H_*/
index 643732e..1596933 100644 (file)
@@ -16,6 +16,7 @@
 #include "ScheduleWidget.h"\r
 #include "ToolBox.h"\r
 #include "MeetingInfoDialog.h"\r
+#include "BorderedBarWidget.h"\r
 \r
 #include <QtDebug>\r
 \r
@@ -33,6 +34,20 @@ WeeklyViewWidget::WeeklyViewWidget( QDateTime aCurrentDateTime, Configuration *a
        regularTextFont.setBold( true );\r
        regularTextFont.setPointSize( 12 );\r
 \r
+       QFont clockFont;\r
+       clockFont.setStyleHint( QFont::Helvetica );\r
+       clockFont.setBold( true );\r
+       clockFont.setPixelSize( 36 );\r
+\r
+       QFont statusBarFont;\r
+       statusBarFont.setStyleHint( QFont::Helvetica );\r
+       statusBarFont.setPixelSize( 18 );\r
+\r
+       QFont buttonFont;\r
+       buttonFont.setStyleHint( QFont::Helvetica );\r
+       buttonFont.setBold( true );\r
+       buttonFont.setPixelSize( 18 );\r
+\r
        iSettingsButton = new QPushButton;\r
        iSettingsButton->setIcon( QPixmap( ":button_settings" ) );\r
        iSettingsButton->setFixedWidth( 36 );\r
@@ -41,57 +56,90 @@ WeeklyViewWidget::WeeklyViewWidget( QDateTime aCurrentDateTime, Configuration *a
        iCurrentDayLabel = ToolBox::createLabel( aCurrentDateTime.toString( iConfiguration->displaySettings()->dateFormat() ), regularTextFont );\r
        iCurrentWeekLabel = ToolBox::createLabel( tr( "Wk %1" ).arg( aCurrentDateTime.date().weekNumber() ), regularTextFont );\r
 \r
+       iTimeDisplay = new BorderedBarWidget( this );\r
+       iTimeDisplay->setFaceColor( Qt::darkGray );\r
+       iTimeDisplay->setBackgroundColor( Qt::white);\r
+       iTimeDisplay->setBorderWidth( 6 );\r
+       iTimeDisplay->setFixedWidth( 170 );\r
+       iTimeDisplay->setFixedHeight( 50 );\r
+       iTimeDisplay->setFont( clockFont );\r
+\r
        iRoomsCombo = new MeetingRoomCombo( iConfiguration->rooms(), this );\r
        iRoomsCombo->setCurrentRoom( iConfiguration->defaultRoom() );\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
-       iTimeDisplay->setFont( regularTextFont );\r
+       iStatusBar = new BorderedBarWidget( this );\r
+       iStatusBar->setFaceColor( Qt::darkGray );\r
+       iStatusBar->setBackgroundColor( Qt::white );\r
+       iStatusBar->setBorderWidth( 4 );\r
+       iStatusBar->setFont(statusBarFont);\r
+       iStatusBar->setFixedHeight( 36 );\r
+       iStatusBar->setText( tr("Disconnected"), BorderedBarWidget::LeftAlign );\r
+\r
+       connect( iStatusBar, SIGNAL( clicked() ), this, SIGNAL( refreshButtonClicked() ) );\r
 \r
        iSchedule = new ScheduleWidget( aCurrentDateTime, iConfiguration->displaySettings(), this );\r
        connect( iSchedule, SIGNAL( shownWeekChanged( QDate ) ), this, SIGNAL( shownWeekChanged( QDate ) ) );\r
        connect( iSchedule, SIGNAL( meetingActivated( Meeting* ) ), this, SIGNAL( meetingActivated( Meeting* ) ) );\r
 \r
        iPreviousWeekButton = new QPushButton( this );\r
-       iPreviousWeekButton->setText( tr( "<<" ) );\r
-       iPreviousWeekButton->setFixedWidth( 60 );\r
+       iPreviousWeekButton->setText( tr( "<" ) );\r
+       iPreviousWeekButton->setFixedWidth( 50 );\r
+       iPreviousWeekButton->setFixedHeight( 100 );\r
+       iPreviousWeekButton->setFont( buttonFont );\r
        connect( iPreviousWeekButton, SIGNAL( clicked() ), iSchedule, SLOT( showPreviousWeek() ) );\r
 \r
        iCurrentWeekButton = new QPushButton( this );\r
        iCurrentWeekButton->setFixedWidth( 100 );\r
-       iCurrentWeekButton->setText( tr( "Current" ) );\r
+       iCurrentWeekButton->setFixedHeight( 46 );\r
+       iCurrentWeekButton->setText( tr( "Today" ) );\r
+       iCurrentWeekButton->setFont( buttonFont );\r
+\r
        connect( iCurrentWeekButton, SIGNAL( clicked() ), iSchedule, SLOT( showCurrentWeek() ) );\r
 \r
        iNextWeekButton = new QPushButton( this );\r
-       iNextWeekButton->setFixedWidth( 60 );\r
-       iNextWeekButton->setText( tr( ">>" ) );\r
+       iNextWeekButton->setFixedWidth( 50 );\r
+       iNextWeekButton->setFixedHeight( 100 );\r
+       iNextWeekButton->setText( tr( ">" ) );\r
+       iNextWeekButton->setFont( buttonFont );\r
        connect( iNextWeekButton, SIGNAL( clicked() ), iSchedule, SLOT( showNextWeek() ) );\r
 \r
        // **********************************\r
        //              Create the view's layout\r
+       QVBoxLayout *leftLayout = new QVBoxLayout;\r
+       QVBoxLayout *centerLayout = new QVBoxLayout;\r
+       QVBoxLayout *rightLayout = new QVBoxLayout;\r
+\r
+       leftLayout->addWidget( iPreviousWeekButton );\r
+       rightLayout->addWidget( iNextWeekButton );\r
+\r
        QHBoxLayout *tableLayout = new QHBoxLayout;\r
        tableLayout->addWidget( iSchedule );\r
 \r
-       QHBoxLayout *bottomLayout = new QHBoxLayout;\r
-       bottomLayout->addWidget( iRoomsCombo );\r
-       bottomLayout->addWidget( iTimeDisplay );\r
-       QVBoxLayout *dateLayout = new QVBoxLayout;\r
-       dateLayout->addWidget( iCurrentDayLabel );\r
-       dateLayout->addWidget( iCurrentWeekLabel );\r
-       bottomLayout->addLayout( dateLayout );\r
-       bottomLayout->addWidget( iPreviousWeekButton );\r
-       bottomLayout->addWidget( iCurrentWeekButton );\r
-       bottomLayout->addWidget( iNextWeekButton );\r
-       bottomLayout->addWidget( iSettingsButton );\r
-\r
-       QVBoxLayout *mainLayout = new QVBoxLayout;\r
-       mainLayout->addLayout( tableLayout );\r
-       mainLayout->addLayout( bottomLayout );\r
+       QGridLayout *naviLayout = new QGridLayout;\r
+       naviLayout->addWidget( iCurrentWeekButton, 0, 0, Qt::AlignLeft );\r
+       naviLayout->addWidget( iTimeDisplay, 0, 1, Qt::AlignCenter );\r
+       naviLayout->addWidget( iRoomsCombo, 0, 2, Qt::AlignRight );\r
+\r
+//     QVBoxLayout *dateLayout = new QVBoxLayout;\r
+//     dateLayout->addWidget( iCurrentDayLabel );\r
+//     dateLayout->addWidget( iCurrentWeekLabel );\r
+//     bottomLayout->addLayout( dateLayout );\r
+//     bottomLayout->addWidget( iSettingsButton );\r
+\r
+       centerLayout->addLayout( naviLayout );\r
+       centerLayout->addLayout( tableLayout );\r
+       centerLayout->addWidget( iStatusBar );\r
+\r
+       QHBoxLayout *mainLayout = new QHBoxLayout;\r
+       mainLayout->addLayout( leftLayout );\r
+       mainLayout->addLayout( centerLayout );\r
+       mainLayout->addLayout( rightLayout );\r
        setLayout( mainLayout );\r
        \r
        // Set child observing\r
        observeChild( iRoomsCombo );\r
+       observeChild( iStatusBar );\r
        observeChild( iTimeDisplay );\r
        observeChild( iCurrentDayLabel );\r
        observeChild( iCurrentWeekLabel );\r
@@ -102,7 +150,7 @@ WeeklyViewWidget::WeeklyViewWidget( QDateTime aCurrentDateTime, Configuration *a
 \r
        QPalette palette;\r
        palette.setColor( QPalette::Window, Qt::white );\r
-       palette.setColor( QPalette::WindowText, Qt::darkGray );\r
+       palette.setColor( QPalette::Foreground, Qt::darkGray );\r
        setPalette( palette );\r
 \r
        setAutoFillBackground( true );\r
@@ -132,6 +180,12 @@ WeeklyViewWidget::~WeeklyViewWidget()
                delete iTimeDisplay;\r
                iTimeDisplay = 0;\r
        }\r
+       if ( iStatusBar )\r
+       {\r
+               delete iStatusBar;\r
+               iStatusBar = 0;\r
+       }\r
+\r
        if ( iSchedule )\r
        {\r
                delete iSchedule;\r
@@ -174,15 +228,32 @@ Room* WeeklyViewWidget::currentRoom()
        return iRoomsCombo->currentRoom();\r
 }\r
 \r
-void WeeklyViewWidget::setCurrentDateTime( QDateTime aCurrentDateTime )\r
+void WeeklyViewWidget::setConnectionStatus( QDateTime aCurrentTime, bool aConnected,\r
+               QTime aLastUpdated, QString aError )\r
 {\r
-       iCurrentDayLabel->setText( aCurrentDateTime.date().toString( iConfiguration->displaySettings()->dateFormat() ) );\r
+       iCurrentDayLabel->setText( aCurrentTime.date().toString( iConfiguration->displaySettings()->dateFormat() ) );\r
+       iCurrentWeekLabel->setText( tr( "Wk %1" ).arg( aCurrentTime.date().weekNumber() ) );\r
+       iSchedule->setCurrentDateTime( aCurrentTime );\r
        \r
-       iCurrentWeekLabel->setText( tr( "Wk %1" ).arg( aCurrentDateTime.date().weekNumber() ) );\r
-\r
-       iTimeDisplay->setTime( aCurrentDateTime.time() );\r
+       iTimeDisplay->setText( aCurrentTime.toString( iConfiguration->displaySettings()->timeFormat() ) );\r
+       if ( aLastUpdated.isNull() )\r
+               iStatusBar->setText( tr("Disconnected") , BorderedBarWidget::LeftAlign );\r
+       else if ( !aConnected )\r
+       {\r
+               iStatusBar->setText( tr("Disconnected"), BorderedBarWidget::LeftAlign );\r
+       }\r
+       else\r
+       {\r
+               iStatusBar->setText( tr("Connected - Last update %1")\r
+                               .arg(aLastUpdated.toString(iConfiguration->displaySettings()->timeFormat())) ,\r
+                               BorderedBarWidget::LeftAlign );\r
+       }\r
+       showError( aError );\r
+ }\r
 \r
-       iSchedule->setCurrentDateTime( aCurrentDateTime );\r
+void WeeklyViewWidget::showError( QString aError )\r
+{\r
+       iStatusBar->setText( aError );\r
 }\r
 \r
 QDate WeeklyViewWidget::beginnigOfShownWeek()\r
@@ -205,3 +276,13 @@ void WeeklyViewWidget::setDefaultRoom()
 {\r
        iRoomsCombo->setCurrentRoom( iConfiguration->defaultRoom() );\r
 }\r
+\r
+void WeeklyViewWidget::connectionEstablished()\r
+{\r
+       ViewBase::connectionEstablished();\r
+}\r
+\r
+void WeeklyViewWidget::connectionLost()\r
+{\r
+       ViewBase::connectionLost();\r
+}\r
index 055617b..5ea4bf6 100644 (file)
-#ifndef WEEKLYVIEWWIDGET_H_\r
-#define WEEKLYVIEWWIDGET_H_\r
-\r
-#include "ViewBase.h"\r
-#include <QDateTime>\r
-\r
-class QLabel;\r
-class QPushButton;\r
-class MeetingRoomCombo;\r
-class TimeDisplayWidget;\r
-class ScheduleWidget;\r
-class Configuration;\r
-class Meeting;\r
-class Room;\r
-\r
-//! Userinterface class. Shows a weekly calendar for the selected room, provides date and time information.\r
-/*!\r
- * UserInterface class. Shows the current date and time and selected week's calendar for\r
- * selected meeting room. User can select meeting room, browse weeks back and forth, and can navigate\r
- * back to the current week.\r
- */\r
-class WeeklyViewWidget : public ViewBase\r
-{\r
-       Q_OBJECT\r
-\r
-public:\r
-       //! Constructor.\r
-       /*!\r
-        * Constructor to initialize an WeeklyViewWidget instance.\r
-        * \param aCurrentDateTime\r
-        * \param aConfiguration Pointer to the configuration object. Not owned.\r
-        * \param aParent Pointer to the parent widget.\r
-        */\r
-       WeeklyViewWidget( QDateTime aCurrentDateTime, Configuration *aConfiguration, QWidget *aParent = 0 );\r
-       //! Destructor.\r
-       virtual ~WeeklyViewWidget();\r
-\r
-       //! Current room\r
-       /*!\r
-        * Returns the currently selected meeting room.\r
-        * \return Selected meeting room.\r
-        */\r
-       Room* currentRoom();\r
-\r
-       //! First day of week currently displayd\r
-       /*!\r
-        * Returns the first day of week currently displayd.\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
-       void showCurrentWeek();\r
-       \r
-       void setDefaultRoom();\r
-       \r
-signals:\r
-       //! Signals change of the meeting room.\r
-       /*!\r
-        * Signal is emited when meeting room is changed.\r
-        * \param aNewRoom Selected meeting room.\r
-        */\r
-       void currentRoomChanged( Room *aNewRoom );\r
-       //! Meeting activated.\r
-       /*!\r
-        * Signal is emitted when a meeting is clicked by the user.\r
-        * \param aMeeting actived meeting.\r
-        */\r
-       void meetingActivated( Meeting *aMeeting );\r
-       //! Signals creation of new meeting.\r
-       /*!\r
-        * Signal is emited when new meeting is created.\r
-        * \param aMeeting Meeting that has been created.\r
-        * \param aUsername User who created the meeting.\r
-        * \param aPassword Password of the "aUsername"\r
-        */\r
-       void meetingToCreate( Meeting *aMeeting, const QString &aUsername, const QString &aPassword );\r
-       //! Signals deletion of a meeting.\r
-       /*!\r
-        * Signal is emited when meeting is deleted.\r
-        * \param aMeeting Deleted meeting.\r
-        * \param aUsername User who deleted the meeting.\r
-        * \param aPassword Password of the "aUsername"\r
-        */\r
-       void meetingToDelete( Meeting *aMeeting, const QString &aUsername, const QString &aPassword );\r
-       //! Signals modifications of a meeting.\r
-       /*!\r
-        * Signal is emited when meeting is modified.\r
-        * \param aMeeting Modified meeting.\r
-        * \param aUsername User who modified the meeting.\r
-        * \param aPassword Password of the "aUsername"\r
-        */\r
-       void meetingToUpdate( Meeting *aMeeting, const QString &aUsername, const QString &aPassword );\r
-\r
-       //! Signals\r
-       /*!\r
-        * Signal is emited when settings button is clicked.\r
-        */\r
-       void settingsButtonClicked();\r
-       \r
-       //! Signal. Emitted if the shown week has been changed.\r
-       /*!\r
+#ifndef WEEKLYVIEWWIDGET_H_
+#define WEEKLYVIEWWIDGET_H_
+
+#include "ViewBase.h"
+#include <QDateTime>
+
+class QLabel;
+class QPushButton;
+class MeetingRoomCombo;
+class TimeDisplayWidget;
+class ScheduleWidget;
+class Configuration;
+class Meeting;
+class Room;
+class BorderedBarWidget;
+
+//! Userinterface class. Shows a weekly calendar for the selected room, provides date and time information.
+/*!
+ * UserInterface class. Shows the current date and time and selected week's calendar for
+ * selected meeting room. User can select meeting room, browse weeks back and forth, and can navigate
+ * back to the current week.
+ */
+class WeeklyViewWidget : public ViewBase
+{
+       Q_OBJECT
+
+public:
+       //! Constructor.
+       /*!
+        * Constructor to initialize an WeeklyViewWidget instance.
+        * \param aCurrentDateTime
+        * \param aConfiguration Pointer to the configuration object. Not owned.
+        * \param aParent Pointer to the parent widget.
+        */
+       WeeklyViewWidget( QDateTime aCurrentDateTime, Configuration *aConfiguration, QWidget *aParent = 0 );
+       //! Destructor.
+       virtual ~WeeklyViewWidget();
+
+       //! Current room
+       /*!
+        * Returns the currently selected meeting room.
+        * \return Selected meeting room.
+        */
+       Room* currentRoom();
+
+       //! First day of week currently displayd
+       /*!
+        * Returns the first day of week currently displayd.
+        * \return First day of week.
+        */
+       QDate beginnigOfShownWeek();
+       //! Sends the refresh command to schedule widget.
+       /*!
+        * Sends the refresh command to schedule widget.
+        * \param aMeetings The list of meetings.
+        */
+       void refreshMeetings( const QList<Meeting*> &aMeetings );
+       
+       void showCurrentWeek();
+       
+       void setDefaultRoom();
+       
+signals:
+       //! Signals change of the meeting room.
+       /*!
+        * Signal is emited when meeting room is changed.
+        * \param aNewRoom Selected meeting room.
+        */
+       void currentRoomChanged( Room *aNewRoom );
+       //! Meeting activated.
+       /*!
+        * Signal is emitted when a meeting is clicked by the user.
+        * \param aMeeting actived meeting.
+        */
+       void meetingActivated( Meeting *aMeeting );
+       //! Signals creation of new meeting.
+       /*!
+        * Signal is emited when new meeting is created.
+        * \param aMeeting Meeting that has been created.
+        * \param aUsername User who created the meeting.
+        * \param aPassword Password of the "aUsername"
+        */
+       void meetingToCreate( Meeting *aMeeting, const QString &aUsername, const QString &aPassword );
+       //! Signals deletion of a meeting.
+       /*!
+        * Signal is emited when meeting is deleted.
+        * \param aMeeting Deleted meeting.
+        * \param aUsername User who deleted the meeting.
+        * \param aPassword Password of the "aUsername"
+        */
+       void meetingToDelete( Meeting *aMeeting, const QString &aUsername, const QString &aPassword );
+       //! Signals modifications of a meeting.
+       /*!
+        * Signal is emited when meeting is modified.
+        * \param aMeeting Modified meeting.
+        * \param aUsername User who modified the meeting.
+        * \param aPassword Password of the "aUsername"
+        */
+       void meetingToUpdate( Meeting *aMeeting, const QString &aUsername, const QString &aPassword );
+
+       //! Signals
+       /*!
+        * Signal is emited when settings button is clicked.
+        */
+       void settingsButtonClicked();
+
+       //! Signals
+       /*!
+        * Signal is emited when refresh button is clicked.
+        */
+       void refreshButtonClicked();
+
+       
+       //! Signal. Emitted 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 );\r
-\r
-public slots:\r
-       //! Sets the date and time\r
-       /*!\r
-        * Sets the current date and time\r
-        * \param aCurrentDateTime Date and time to be displayd.\r
-        */\r
-       void setCurrentDateTime( QDateTime aCurrentDateTime );\r
-       //! Handle resizing\r
-       /*!\r
-        * Handle possible resize changes after the view is resized\r
-        * to match the window managers client area.\r
-        */\r
-       void viewResized(const QSize &newSize, const QSize &oldSize) { }\r
-\r
-private:\r
-       //! Displays the selectable meeting rooms.\r
-       MeetingRoomCombo *iRoomsCombo;\r
-       //! Displays the time.\r
-       TimeDisplayWidget *iTimeDisplay;\r
-       //! Displays the calendar.\r
-       ScheduleWidget *iSchedule;\r
-       //! Displays the date.\r
-       QLabel *iCurrentDayLabel;\r
-       //! Displays the week number.\r
-       QLabel *iCurrentWeekLabel;\r
-       //! Button used to display previous week's calendar.\r
-       QPushButton *iPreviousWeekButton;\r
-       //! Button used to display current week's calendar.\r
-       QPushButton *iCurrentWeekButton;\r
-       //! Button used to display next week's calendar.\r
-       QPushButton *iNextWeekButton;\r
-       //! Settings button. TODO : Correct widget is needed!!\r
-       QPushButton *iSettingsButton;\r
-       //! About button. TODO : Correct widget is needed!!\r
-       QPushButton *iAboutButton;\r
-       /* !\r
-        * Pointer to configuration object.\r
-        * Contains configurable data and IS NOT OWNED by the widget.\r
-        */\r
-       Configuration *iConfiguration;\r
-};\r
-\r
-#endif /*WEEKLYVIEWWIDGET_H_*/\r
+       void shownWeekChanged( QDate aDate );
+
+public slots:
+       //! Slot. Sets the connection status
+       /*!
+        * Sets the current time, and connection status
+        * \param aCurrentTime Time to be displayed.
+        * \param aConnected connection status to be displayed.
+        * \param aLastUpdated Time of last successful connection to be displayed.
+        */
+       void setConnectionStatus( QDateTime aCurrentTime, bool aConnected, QTime aLastUpdated = QTime(), QString aError = "" );
+       //! Handle resizing
+       /*!
+        * Handle possible resize changes after the view is resized
+        * to match the window managers client area.
+        */
+       void viewResized(const QSize &/*newSize*/, const QSize &/*oldSize*/) { }
+
+       void showError( QString aError );
+
+       void connectionEstablished();
+
+       void connectionLost();
+
+private:
+       //! Displays the selectable meeting rooms.
+       MeetingRoomCombo *iRoomsCombo;
+       //! Displays the time.
+       BorderedBarWidget *iTimeDisplay;
+       //! Displays the status.
+       BorderedBarWidget *iStatusBar;
+       //! Displays the calendar.
+       ScheduleWidget *iSchedule;
+       //! Displays the date.
+       QLabel *iCurrentDayLabel;
+       //! Displays the week number.
+       QLabel *iCurrentWeekLabel;
+       //! Button used to display previous week's calendar.
+       QPushButton *iPreviousWeekButton;
+       //! Button used to display current week's calendar.
+       QPushButton *iCurrentWeekButton;
+       //! Button used to display next week's calendar.
+       QPushButton *iNextWeekButton;
+       //! Settings button. TODO : Correct widget is needed!!
+       QPushButton *iSettingsButton;
+       //! About button. TODO : Correct widget is needed!!
+       QPushButton *iAboutButton;
+       /* !
+        * Pointer to configuration object.
+        * Contains configurable data and IS NOT OWNED by the widget.
+        */
+       Configuration *iConfiguration;
+};
+
+#endif /*WEEKLYVIEWWIDGET_H_*/
index af006f1..aa90587 100644 (file)
@@ -2,17 +2,26 @@
 
 #include <QEvent>
 #include <QDialog>
+#include <QMenuBar>
 #include "ViewBase.h"
 #include "PopUpMessageBox.h"
 
 #include <QtDebug>
 
 WindowManager::WindowManager( QWidget *aParent ) :
-               QWidget( aParent ),
+       QMainWindow( aParent ),
                iApplicationName( tr( "Qt Meetings" ) ),
                iCurrentView( 0 )
 {
        this->setWindowTitle( iApplicationName );
+        settingsAction = new QAction(tr("&Settings"), this);
+        closeAction = new QAction(tr("&Close"), this);
+        connect(settingsAction, SIGNAL(triggered()), this, SIGNAL(showSettingsClicked()));
+        connect(closeAction, SIGNAL(triggered()), this, SIGNAL(closeClicked()));
+     editMenu = menuBar()->addMenu(tr("&Edit"));
+     editMenu->addAction(settingsAction);
+        menuBar()->addMenu(editMenu);
+        menuBar()->addAction(closeAction);
 }
 
 WindowManager::~WindowManager()
@@ -44,8 +53,12 @@ void WindowManager::showView( ViewBase *view )
        iCurrentView = view;
        connect( iCurrentView, SIGNAL( eventDetected() ), this, SLOT( viewEventDetected() ) );
        connect( this, SIGNAL( viewResized(const QSize &, const QSize &) ), iCurrentView, SLOT( viewResized( const QSize &, const QSize & ) ) );
-       view->resize( this->size() );
-       
+       if (((QWidget*)view) != this)
+       {
+               this->adjustSize();
+       }
+       view->resize(this->size());
+       //view->adjustSize();
        view->show();
        
        // Disconnect old connections and hide the view
index aa736cf..b71c04d 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef WINDOWMANAGER_H_
 #define WINDOWMANAGER_H_
 
-#include <QWidget>
+#include <QMainWindow>
 #include <QStack>
 
 // Forward declarations
@@ -18,7 +18,7 @@ class QString;
  * can track the views events and restore previous view if the current on is ObservedView. This
  * is a handy mechanism for screensaver etc.
  */
-class WindowManager : public QWidget
+class WindowManager : public QMainWindow
 {
        Q_OBJECT
 
@@ -58,6 +58,10 @@ signals:
         */
        void previousViewRestored();
        
+       void showSettingsClicked();
+
+       void closeClicked();
+
        void dialogActivated();
        void dialogDeactivated();
 
@@ -102,6 +106,12 @@ private:
        //! Stack of views previously displayed.
        QStack<ViewBase *> iViewList;
 
+       //! Menu settings
+    QAction *settingsAction;
+    //! Menu close application
+    QAction *closeAction;
+    //! Edit menu
+    QMenu *editMenu;
 };
 
 #endif /*WINDOWMANAGER_H_*/