Confilcts solved
authorJan Lapinkataja <jan.lapinkataja@ixonos.com>
Fri, 29 May 2009 10:07:54 +0000 (13:07 +0300)
committerJan Lapinkataja <jan.lapinkataja@ixonos.com>
Fri, 29 May 2009 10:07:54 +0000 (13:07 +0300)
Conflicts:
src/BusinessLogic/Engine.cpp
src/UserInterface/Views/RoomStatusIndicatorWidget.cpp

1  2 
src/BusinessLogic/Engine.cpp
src/BusinessLogic/UIManager.cpp
src/UserInterface/Views/RoomStatusIndicatorWidget.cpp
src/UserInterface/Views/RoomStatusIndicatorWidget.h

@@@ -16,7 -16,7 +16,7 @@@
  #include <QtDebug>
  
  QTime Engine::endOfTheDay = QTime( 23, 59, 0, 0); // end of the day is 11:59pm
- const int IDLE_TIME_MULTIPLIER = 5000; // Multiplies milliseconds to minutes
+ const int IDLE_TIME_MULTIPLIER = 60000; // Multiplies milliseconds to minutes
  
  // Macro to help deleting objects. This could be global.
  #define QT_DELETE(X) \
@@@ -164,15 -164,31 +164,31 @@@ void Engine::roomStatusInfoNeeded(Room 
        ( ( indexOfNextMeeting != -1 ) ? iMeetings.at( indexOfNextMeeting )->startsAt().time() : Engine::endOfTheDay );
  
        //currently works only for deafult room
-       if ( aRoom->equals( *(iCurrentRoom) ) )
-       {
-               emit roomStatusChanged( status, until );
-       }
+ //    if( aRoom->equals( *(defaultRoom() ) ) )
+ //            iWindowManager->roomStatusChanged( aRoom, status, until );
+ }
+ /*
+ void Engine::fetchMeetings()
+ {
+       qDebug() << "Engine::fetchMeetings for " << iCurrentRoom;
+       QDateTime from( iWindowManager->weeklyView()->beginnigOfShownWeek() );
+       QDateTime to( from.addDays( 7 ) );
+       // fetchMeetings( from, to, iWindowManager->weeklyView()->currentRoom() );
+       // Signal is connected to the currentRoomChanged slot which keeps the iCurrentRoom up to date
+       fetchMeetings( from, to, iCurrentRoom );
  }
+ */
  
  void Engine::fetchMeetingDetails( Meeting *aMeeting )
  {
        qDebug() << "Engine::fetchMeetingDetails( Meeting* )";
+ /*    iWindowManager->showProgressBar(tr("Please Wait"), true);
+       iWindowManager->updateProgressBar(tr("Fetching Meeting Details...") );
+       connect(iWindowManager, 
+       SIGNAL( progressBarCancelled() ), this, 
+       SLOT( fetchMeetingDetailsCancelled() ));
+       iCommunication->fetchMeetingDetails( *aMeeting); */
        iCommunication->fetchMeetingDetails( *aMeeting );
  }
  
@@@ -224,20 -240,16 +240,16 @@@ void Engine::shownWeekChanged( QDate aF
  //    fetchMeetings( from, to, iWindowManager->weeklyView()->currentRoom() );
  }
  
- void Engine::changeDeviceMode( bool aChange )
+ void Engine::changeDeviceMode()
  {
-       if ( aChange )
-       {
-               connect( iDevice, SIGNAL( changingModeFailed() ), this, SLOT( changeModeFailed() ) );
-               iAutoRefresh->stop(); // Stop the meeting update
-       }
-       iDevice->changeMode( aChange );
+       connect( iDevice, SIGNAL( changeModeFailed() ), this, SLOT( changeModeFailed() ) );
+       iAutoRefresh->stop(); // Stop the meeting update
+       iDevice->changeMode();
  }
  
  void Engine::changeModeFailed()
  {
        qDebug() << "Engine::progressBarCancelled()";
-       iDevice->changeMode( false );
        iAutoRefresh->start(); //we start the metting updating
  }
  
@@@ -252,8 -264,8 +264,8 @@@ void Engine::initUserInterface(
        
        connect( iWindowManager, SIGNAL( eventDetected() ), this, SLOT( handleViewEvent() ) );
        connect( iWindowManager, SIGNAL( previousViewRestored() ), iUIManager, SLOT( previousViewRestored() ) );
 -//    connect( iWindowManager, SIGNAL( dialogActivated() ), this, SLOT( dialogActivated() ) );
 -//    connect( iWindowManager, SIGNAL( dialogDeactivated() ), this, SLOT( dialogDeactivated() ) );
 +      connect( iWindowManager, SIGNAL( dialogActivated() ), this, SLOT( dialogActivated() ) );
 +      connect( iWindowManager, SIGNAL( dialogDeactivated() ), this, SLOT( dialogDeactivated() ) );
        
        // Show the UI
        iWindowManager->setWindowState( Qt::WindowMaximized );
  
  void Engine::handleViewEvent()
  {
 -      if ( iIdleTimeCounter != 0 )
 +      if ( iIdleTimeCounter != 0 && iIdleTimeCounter->isActive())
        {
                // Restart the idle time counter when view event is received
                iIdleTimeCounter->stop();
@@@ -358,4 -370,4 +370,4 @@@ void Engine::currentRoomChanged(Room *a
  {
        qDebug() << "[Engine::currentRoomChanged] <invoked>";
        iCurrentRoom = aRoom;
- }
+ }
@@@ -89,11 -89,7 +89,7 @@@ void UIManager::createSettingsView(
  
  void UIManager::createRoomStatusIndicator()
  {
-       iRoomStatusIndicator = new RoomStatusIndicatorWidget( iEngine->defaultRoom(), Room::FreeStatus, QTime::currentTime().addSecs(100000000), iEngine->iConfiguration->displaySettings()->timeFormat() );
-       
-       // Connect engine signals
-       connect( iEngine, SIGNAL( roomStatusChanged( Room::Status, QTime ) ), iRoomStatusIndicator, SLOT( statusChanged( Room::Status, QTime ) ) );
-       connect( iWeeklyView, SIGNAL( currentRoomChanged( Room * ) ), iRoomStatusIndicator, SLOT( currentRoomChanged( Room * ) ) );
+       iRoomStatusIndicator = new RoomStatusIndicatorWidget( iEngine->defaultRoom(), Room::FreeStatus, QTime::currentTime(), iEngine->iConfiguration->displaySettings()->dateFormat() );
  }
  
  void UIManager::createPasswordDialog()
  void UIManager::createProgressBar()
  {
        iProgressBar = new ProgressBar( tr("CHANGE THIS"), true );
-       
        // Connect to UIManager
        connect( iProgressBar, SIGNAL( cancel() ), this, SLOT( progressBarCancelled() ) );
        // Connect to Engine
@@@ -170,6 -165,7 +165,6 @@@ void UIManager::showMeetingProgressBar
                iProgressBar->update( tr( "Fetching meeting info..." ), tr( "Please wait" ) );
                iProgressBar->toggleCancellable( true );
                iWindowManager->showDialog( static_cast<QDialog *>( iProgressBar ), false, false );
 -              iEngine->stopIdleTimeCounter();
        }
  }
  
@@@ -182,10 -178,8 +177,8 @@@ void UIManager::meetingDetailsFetched(M
                {
                        iProgressBar->close(); // Close it in case it's visible
                }
-               iEngine->stopIdleTimeCounter(); // Timer restarted when the dialog is dismissed.
                MeetingInfoDialog *tmp = new MeetingInfoDialog( &aDetailedMeeting );
                iWindowManager->showDialog( static_cast<QDialog *>( tmp ) );
-               
  // TODO : We should use the member variable and implement correctly the setMeeting() method !!!
  //            iMeetingInfo->setMeeting( &aDetailedMeeting );
  //            iWindowManager->showDialog( static_cast<QDialog *>( iMeetingInfo ) );
@@@ -211,6 -205,7 +204,6 @@@ void UIManager::progressBarCancelled(
        if ( iProgressBar != 0 )
        {
                iProgressBar->close();
 -              iEngine->startIdleTimeCounter();
        }
  }
  
@@@ -244,10 -239,6 +237,6 @@@ void UIManager::updateTime(QDateTime aD
        {
                iWeeklyView->setCurrentDateTime( aDateTime );
        }
-       if ( iRoomStatusIndicator != 0 )
-       {
-               iRoomStatusIndicator->setCurrentTime( aDateTime.time() );
-       }
  }
  
  void UIManager::passwordEntered( PasswordDialog::PasswordStatus aStatus )
                        {
                                iProgressBar->update( tr( "" ), tr( "Changing operation mode" ) );
                                iProgressBar->toggleCancellable( false );
 -                              iWindowManager->showDialog( static_cast<QDialog *>( iProgressBar ), false );
 +                              iWindowManager->showDialog( static_cast<QDialog *>( iProgressBar ), false, false );
                        }
                        // ... and initiate the mode changing
-                       iEngine->changeDeviceMode( true );
+                       iEngine->changeDeviceMode();
                        break;
                case PasswordDialog::Incorrect:
                        iWindowManager->error( tr("Incorrect Password") );
+                       break;
                case PasswordDialog::Canceled:
-                       iEngine->changeDeviceMode( false );
                        break;
        }
        
@@@ -6,8 -6,6 +6,8 @@@
  #include "DigitalTimeDisplayWidget.h"\r
  #include "ToolBox.h"\r
  \r
 +#include <QEvent>\r
 +\r
  #include <QtDebug>\r
  \r
  QTime RoomStatusIndicatorWidget::endOfTheDay = QTime( 23, 59, 0, 0 );\r
@@@ -15,7 -13,6 +15,6 @@@
  RoomStatusIndicatorWidget::RoomStatusIndicatorWidget( Room *aDefaultRoom, Room::Status aStatus, QTime aUntil, QString aTimeFormat, QWidget *aParent ) :\r
                ViewBase( ViewBase::ObservedView, aParent ), iTimeFormat( aTimeFormat )\r
  {\r
-       \r
        QFont importantTextFont;\r
        //importantTextFont.setBold( true );\r
        importantTextFont.setPointSize( 20 );\r
@@@ -77,28 -74,25 +76,28 @@@ QString RoomStatusIndicatorWidget::stat
  \r
  QPalette RoomStatusIndicatorWidget::createPalette( Room::Status aStatus )\r
  {\r
 -      QPixmap pixmap( aStatus == Room::BusyStatus ? ":roomstatus_busy" : ":roomstatus_free" );\r
 +      // QPixmap pixmap( aStatus == Room::BusyStatus ? ":roomstatus_busy" : ":roomstatus_free" );\r
 +      QString image = aStatus == Room::BusyStatus ? ":roomstatus_busy" : ":roomstatus_free";\r
  \r
        // The image needs to be moved in normal mode so the traffic light not partly outside the screen\r
        const int xoffset( 60 );\r
        const int yoffset( 19 );\r
 -      int cropwidth( pixmap.width() - xoffset );\r
 -      int cropheight( pixmap.height() - yoffset );\r
 +//    int cropwidth( pixmap.width() - xoffset );\r
 +//    int cropheight( pixmap.height() - yoffset );\r
        \r
        QBrush brush;\r
        if ( windowState() == Qt::WindowFullScreen )\r
        {\r
                // Use the full image in full screen mode\r
 -              brush.setTexture( pixmap );\r
 +//            brush.setTexture( pixmap );\r
 +              brush.setTexture( QPixmap(image) );\r
        }\r
        else\r
        {\r
                // Take part of the image so the traffic lights are moved xoffset poxels to left \r
                // and yoffset pixels to up\r
 -              brush.setTexture( pixmap.copy( xoffset, yoffset, cropwidth, cropheight ) );\r
 +//            brush.setTexture( pixmap.copy( xoffset, yoffset, cropwidth, cropheight ) );\r
 +              brush.setTexture( QPixmap(image) );\r
        }\r
  \r
        QPalette palette;\r
@@@ -123,26 -117,4 +122,26 @@@ void RoomStatusIndicatorWidget::statusC
                iUntilTextLabel->setText( tr( "until %1" ).arg( aUntil.toString( iTimeFormat ) ) );\r
        }\r
        setPalette( createPalette( aStatus ) );\r
- }\r
++}
 +\r
 +void RoomStatusIndicatorWidget::currentRoomChanged( Room *aRoom )\r
 +{\r
 +      iDefaultRoomLabel->setText( aRoom->name() );\r
 +}\r
 +\r
 +bool RoomStatusIndicatorWidget::event(QEvent *event)\r
 +{\r
 +      switch(event->type())\r
 +      {\r
 +              case QEvent::Paint:\r
 +                      qDebug() << "[RoomStatusIndicatorWidget::event] <Paint event>";\r
 +                      break;\r
 +              case QEvent::PaletteChange:\r
 +                      qDebug() << "[RoomStatusIndicatorWidget::event] <Palette change event>";\r
 +                      break;\r
 +              default:\r
 +                      break;\r
 +      }\r
 +      \r
 +      return ViewBase::event( event );\r
  }\r
@@@ -12,8 -12,6 +12,8 @@@ class QLabel
  class QVBoxLayout;\r
  class TimeDisplayWidget;\r
  \r
 +class QEvent;\r
 +\r
  //! UserInterface class. Indicates if the default meeting room is busy or not.\r
  /*!\r
   * UserInterface class. Indicates if the default meeting room is busy or not. This widget\r
@@@ -39,8 -37,6 +39,8 @@@ public
        RoomStatusIndicatorWidget( Room *aDefaultRoom, Room::Status aStatus, QTime aUntil, QString aTimeFormat, QWidget *aParent = 0 );\r
        //! Destructor.\r
        virtual ~RoomStatusIndicatorWidget();\r
 +      \r
 +      bool event(QEvent *event);\r
  \r
  public slots:\r
        //! Slot. Sets current time.\r
         * \param aUntil The new time until the specified status is valid.\r
         */\r
        void statusChanged( const Room::Status aStatus, const QTime aUntil );\r
-       //! Changed the current room.\r
-       /*!\r
-        * This slot is used to inform that current room is changed and it changes\r
-        * the room name label.\r
-        */\r
-       void currentRoomChanged( Room *aRoom );\r
        \r
        void viewResized(const QSize &newSize, const QSize &oldSize) { }\r
  \r