Merge branch 'master' of https://git.maemo.org/projects/qtmeetings
authorJan Lapinkataja <jan.lapinkataja@ixonos.com>
Wed, 27 May 2009 13:42:14 +0000 (16:42 +0300)
committerJan Lapinkataja <jan.lapinkataja@ixonos.com>
Wed, 27 May 2009 13:42:14 +0000 (16:42 +0300)
Conflicts:
src/BusinessLogic/Engine.cpp

1  2 
src/BusinessLogic/Engine.cpp

@@@ -47,7 -47,8 +47,7 @@@ Engine::Engine() 
        //initialize idle time counter
        iIdleTimeCounter = new QTimer();
        iIdleTimeCounter->setSingleShot( true);
 -      iIdleTimeCounter->setInterval(IDLE_TIME_MULTIPLIER
 -                      * iConfiguration->displaySettings()->screensaver() );
 +      iIdleTimeCounter->setInterval(IDLE_TIME_MULTIPLIER * iConfiguration->displaySettings()->screensaver() );
        iIdleTimeCounter->start();
        connect(iIdleTimeCounter, SIGNAL( timeout() ), iWindowManager, SLOT( showRoomStatus() ));
  
@@@ -102,7 -103,6 +102,6 @@@ void Engine::closeApplication(
  void Engine::observedEventDetected()
  {
        qDebug() << "Engine::observedEventDetected()";
        if ( !iIdleTimeCounter->isActive() )
        {
                iWindowManager->weeklyView()->showCurrentWeek();
@@@ -180,11 -180,13 +179,11 @@@ void Engine::roomStatusInfoNeeded(Room 
        int indexOfNextMeeting = indexOfMeetingAfter(aRoom, iClock->datetime() );
  
        // if there is no meeting, then status is Free; otherwise Busy
 -      Room::Status
 -                      status =
 -                                      (indexOfCurrentMeeting == -1 ) ? Room::FreeStatus : Room::BusyStatus;
 +      Room::Status status = (indexOfCurrentMeeting == -1 ) ? Room::FreeStatus : Room::BusyStatus;
        // if room is Busy, then check end time, otherwise...
        QTime until = (status == Room::BusyStatus ) ? iMeetings.at( indexOfCurrentMeeting )->endsAt().time() :
        // ...if there is meeting following on the same day then check end time, otherwise end is the of the working day
 -      ((indexOfNextMeeting != -1 ) ? iMeetings.at( indexOfNextMeeting )->startsAt().time() : Engine::endOfTheDay );
 +      ( ( indexOfNextMeeting != -1 ) ? iMeetings.at( indexOfNextMeeting )->startsAt().time() : Engine::endOfTheDay );
  
        //currently works only for deafult room
        if (aRoom->equals( *(defaultRoom() )) )
  
  void Engine::fetchMeetings()
  {
 -      Room *room = defaultRoom();
 -      qDebug() << "Engine::fetchMeetings for " << room->name();
 -      fetchMeetings(iClock->datetime(), iClock->datetime().addDays( 7), room);
 +      qDebug() << "Engine::fetchMeetings for " << iWindowManager->weeklyView()->currentRoom();
 +      QDateTime from( iWindowManager->weeklyView()->beginnigOfShownWeek() );
 +      QDateTime to( from.addDays( 7 ) );
 +      fetchMeetings( from, to, iWindowManager->weeklyView()->currentRoom() );
  }
  
 -void Engine::fetchMeetingDetails(Meeting *aMeeting)
 +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);
 +      iWindowManager->showProgressBar( tr( "Please Wait" ), true );
 +      iWindowManager->updateProgressBar( tr( "Fetching Meeting Details..." ) );
 +      connect(iWindowManager, SIGNAL( progressBarCancelled() ), this, SLOT( fetchMeetingDetailsCancelled() ));
 +      iCommunication->fetchMeetingDetails( *aMeeting );
  }
  
  void Engine::meetingsFetched( const QList<Meeting*> &aMeetings )
        }
        iMeetings.clear();
        for ( int i = 0; i < aMeetings.count(); ++i ) {
 -              Meeting* m = new Meeting( *(aMeetings.at( i )) );
 +              Meeting* m = new Meeting( *( aMeetings.at( i ) ) );
                iMeetings.append( m );
        }
  
        iWindowManager->refreshMeetings( iMeetings );
        // refresh room status info
 -      roomStatusInfoNeeded(defaultRoom() );
 +      roomStatusInfoNeeded( defaultRoom() );
  }
  
 -void Engine::meetingDetailsFetched(Meeting &aDetailedMeeting)
 +void Engine::meetingDetailsFetched( Meeting &aDetailedMeeting )
  {
        qDebug() << "Engine::meetingDetailsFetched( Meeting & )";
        iWindowManager->closeProgressBar();
 -      iWindowManager->showMeetingInfo( &aDetailedMeeting);
 +      iWindowManager->showMeetingInfo( &aDetailedMeeting );
  }
  
 -void Engine::errorHandler(int aCode, const QString &aAddInfo)
 +void Engine::errorHandler( int aCode, const QString &aAddInfo )
  {
        qDebug() << "Engine::ErrorHandler, aCode: " << aCode;
        // inform UI about the problem
                qDebug() << "CommunicationManager signaled an error:" << aCode;
                iWindowManager->closeProgressBar();
        }
 -      iWindowManager->error(ErrorMapper::codeToString(aCode, aAddInfo) );
 +      iWindowManager->error( ErrorMapper::codeToString(aCode, aAddInfo ) );
  }
  
 -void Engine::currentRoomChanged(Room *aCurrentRoom)
 +void Engine::currentRoomChanged( Room *aCurrentRoom )
  {
        qDebug() << "Engine::currentRoomChanged to " << aCurrentRoom->name();
        QDateTime from(iWindowManager->weeklyView()->beginnigOfShownWeek() );
 -      QDateTime to(from.addDays( 8) );
 -      fetchMeetings(from, to, aCurrentRoom);
 +      QDateTime to( from.addDays( 7 ) );
 +      fetchMeetings( from, to, aCurrentRoom );
  }
  
 -void Engine::fetchMeetings(const QDateTime &aFrom, const QDateTime &aUntil, const Room *aIn)
 +void Engine::fetchMeetings( const QDateTime &aFrom, const QDateTime &aUntil, const Room *aIn )
  {
 -      qDebug()
 -                      << "Engine::fetchMeetings( const QDateTime &, const QDateTime &, const Room * )";
 -      iCommunication->fetchMeetings(aFrom, aUntil, *aIn);
 +      qDebug() << "Engine::fetchMeetings( const QDateTime &, const QDateTime &, const Room * )";
 +      iCommunication->fetchMeetings( aFrom, aUntil, *aIn );
  }
  
 -void Engine::shownWeekChanged(QDate aFrom)
 +void Engine::shownWeekChanged( QDate aFrom )
  {
        qDebug() << "Engine::shownWeekChanged( QDate )";
 -      QDateTime from(aFrom);
 -      QDateTime to(aFrom.addDays( 7), QTime( 23, 59) );
 -      qDebug() << "Engine::shownWeekChanged " << aFrom.toString("d.m. h:mm")
 -                      << " to " << to.toString("d.m. h:mm");
 -      fetchMeetings(from, to, iWindowManager->weeklyView()->currentRoom() );
 +      QDateTime from( aFrom );
 +      QDateTime to( aFrom.addDays( 7 ), QTime( 23, 59 ) );
 +      qDebug() << "Engine::shownWeekChanged " << aFrom.toString( "d.m. h:mm" ) << " to " << to.toString( "d.m. h:mm" );
 +      fetchMeetings( from, to, iWindowManager->weeklyView()->currentRoom() );
  }
  
 -void Engine::changeModeOrdered(DeviceManager::OperationMode aMode)
 +void Engine::changeModeOrdered( DeviceManager::OperationMode aMode )
  {
        qDebug() << "Engine::changeModeOrdered( DeviceManager::OperationMode )";
 -      QString message = tr( "You are about to change operation mode to %1." )
 -      .arg(iDevice->operationModeToString(aMode) );
 +      QString message = tr( "You are about to change operation mode to %1." ).arg( iDevice->operationModeToString(aMode ) );
  
 -      iWindowManager->showPasswordDialog(iConfiguration->adminPassword(), message);
 +      iWindowManager->showPasswordDialog( iConfiguration->adminPassword(), message );
  }
  
 -void Engine::passwordEntered(PasswordDialog::PasswordStatus aPasswordStatus)
 +void Engine::passwordEntered( PasswordDialog::PasswordStatus aPasswordStatus )
  {
        qDebug() << "Engine::passwordEntered( PasswordDialog::PasswordStatus )";
        iWindowManager->closePasswordDialog();
  
 -      switch (aPasswordStatus)
 -      {
 +      switch ( aPasswordStatus ) {
                case PasswordDialog::Correct:
 -              {
                        iAutoRefresh->stop(); //we stop the metting updating
                        iWindowManager->showProgressBar( "Changing current operation mode." );
                        connect(iDevice, SIGNAL( changingMode( const QString & ) ), iWindowManager, SLOT( updateProgressBar( const QString & ) ));
                        connect( iDevice, SIGNAL( changeModeFailed() ), this, SLOT( changeModeFailed() ) );
                        iDevice->changeMode( true);
                        break;
 -              }
                case PasswordDialog::Incorrect:
 -              {
 -                      iWindowManager->error(tr("Incorrect password.") );
 -                      iDevice->changeMode( false);
 +                      iWindowManager->error( tr( "Incorrect password." ) );
 +                      iDevice->changeMode( false );
                        break;
 -              }
                default: //case PasswordDialog::Canceled
 -              {
 -                      iDevice->changeMode( false);
 -              }
 +                      iDevice->changeMode( false );
        }
  }
  
@@@ -313,3 -326,4 +312,4 @@@ void Engine::fetchMeetingDetailsCancell
        iCommunication->cancelFetchMeetingDetails();
        iWindowManager->closeProgressBar();
  }