projects
/
qtmeetings
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
cbca95a
)
Got something working
author
Mikko Siren
<mikko.siren@ixonos.com>
Wed, 27 May 2009 11:10:50 +0000
(14:10 +0300)
committer
Mikko Siren
<mikko.siren@ixonos.com>
Wed, 27 May 2009 11:10:50 +0000
(14:10 +0300)
src/BusinessLogic/Engine.cpp
patch
|
blob
|
history
src/BusinessLogic/UIManager.cpp
patch
|
blob
|
history
src/BusinessLogic/UIManager.h
patch
|
blob
|
history
src/UserInterface/Views/RoomStatusIndicatorWidget.h
patch
|
blob
|
history
src/UserInterface/Views/SettingsView.cpp
patch
|
blob
|
history
src/UserInterface/Views/SettingsView.h
patch
|
blob
|
history
src/UserInterface/Views/ViewBase.h
patch
|
blob
|
history
src/UserInterface/Views/WeeklyViewWidget.h
patch
|
blob
|
history
src/UserInterface/WindowManager.cpp
patch
|
blob
|
history
src/UserInterface/WindowManager.h
patch
|
blob
|
history
diff --git
a/src/BusinessLogic/Engine.cpp
b/src/BusinessLogic/Engine.cpp
index
fb0fe9f
..
566b885
100644
(file)
--- a/
src/BusinessLogic/Engine.cpp
+++ b/
src/BusinessLogic/Engine.cpp
@@
-28,7
+28,8
@@
const int IDLE_TIME_MULTIPLIER = 60000; // Multiplies milliseconds to minutes
Engine::Engine() :
Engine::Engine() :
- iClock( 0 ), iConfiguration( 0 ), iCommunication( 0 )
+ iClock( 0 ), iConfiguration( 0 ), iCommunication( 0 ),
+ iWindowManager( 0 ), iUIManager( 0 )
{
qDebug() << "Engine::Engine()";
{
qDebug() << "Engine::Engine()";
@@
-204,7
+205,6
@@
void Engine::meetingsFetched(const QList<Meeting*> &aMeetings)
Meeting* m = new Meeting( *(aMeetings.at( i )) );
iMeetings.append(m);
// and signal the changes
Meeting* m = new Meeting( *(aMeetings.at( i )) );
iMeetings.append(m);
// and signal the changes
-// iWeeklyView->insertMeeting( m );
}
}
}
}
@@
-216,7
+216,6
@@
void Engine::meetingsFetched(const QList<Meeting*> &aMeetings)
{
Meeting* m = iMeetings.takeAt(i);
// signal the changes
{
Meeting* m = iMeetings.takeAt(i);
// signal the changes
-// iWeeklyView->deleteMeeting( m );
// delete the meeting from the local list
delete m;
}
// delete the meeting from the local list
delete m;
}
@@
-228,7
+227,10
@@
void Engine::meetingsFetched(const QList<Meeting*> &aMeetings)
void Engine::errorHandler( int aCode, const QString &aAddInfo )
{
void Engine::errorHandler( int aCode, const QString &aAddInfo )
{
- iWindowManager->error( ErrorMapper::codeToString( aCode, aAddInfo ) );
+ if ( iWindowManager != 0 )
+ {
+ iWindowManager->error( ErrorMapper::codeToString( aCode, aAddInfo ) );
+ }
}
void Engine::fetchMeetings( const QDateTime &aFrom, const QDateTime &aUntil, const Room *aIn )
}
void Engine::fetchMeetings( const QDateTime &aFrom, const QDateTime &aUntil, const Room *aIn )
@@
-241,6
+243,8
@@
void Engine::fetchMeetings( const QDateTime &aFrom, const QDateTime &aUntil, con
void Engine::fetchMeetingDetails(Meeting *aMeeting)
{
qDebug() << "[Engine::fetchMeetingDetails] <TODO : METHOD NOT IMPLEMENTED>";
void Engine::fetchMeetingDetails(Meeting *aMeeting)
{
qDebug() << "[Engine::fetchMeetingDetails] <TODO : METHOD NOT IMPLEMENTED>";
+ Meeting tempMeeting(aMeeting->primaryId(), aMeeting->room(), aMeeting->startsAt(), aMeeting->endsAt() );
+ iCommunication->fetchMeetingDetails( tempMeeting );
// Meeting tempMeeting = aMeeting;
// iCommunication->fetchMeetingDetails( tempMeeting );
}
// Meeting tempMeeting = aMeeting;
// iCommunication->fetchMeetingDetails( tempMeeting );
}
diff --git
a/src/BusinessLogic/UIManager.cpp
b/src/BusinessLogic/UIManager.cpp
index
19f445f
..
7e24d61
100644
(file)
--- a/
src/BusinessLogic/UIManager.cpp
+++ b/
src/BusinessLogic/UIManager.cpp
@@
-71,7
+71,7
@@
void UIManager::showProgressBar( QString aText )
{
if ( iProgressBar != 0 )
{
{
if ( iProgressBar != 0 )
{
- iProgressBar->update( tr("Changing current operation mode.") );
+ iProgressBar->update( aText );
iWindowManager->showDialog( iProgressBar );
}
}
iWindowManager->showDialog( iProgressBar );
}
}
@@
-113,7
+113,7
@@
void UIManager::createPasswordDialog()
void UIManager::createProgressBar()
{
void UIManager::createProgressBar()
{
- iProgressBar = new ProgressBar( tr("CHANGE THIS") );
+ iProgressBar = new ProgressBar( tr("CHANGE THIS"), true );
// Connect to UIManager
connect( iProgressBar, SIGNAL( cancel() ), this, SLOT( progressBarCancelled() ) );
// Connect to UIManager
connect( iProgressBar, SIGNAL( cancel() ), this, SLOT( progressBarCancelled() ) );
@@
-132,11
+132,13
@@
void UIManager::connectDeviceManager( DeviceManager *aDeviceManager )
this, SLOT( changeModeOrdered( DeviceManager::OperationMode ) ) );
connect( aDeviceManager, SIGNAL( changingMode( const QString & ) ), this, SLOT( updateProgressBarText( const QString & ) ) );
this, SLOT( changeModeOrdered( DeviceManager::OperationMode ) ) );
connect( aDeviceManager, SIGNAL( changingMode( const QString & ) ), this, SLOT( updateProgressBarText( const QString & ) ) );
+ connect( aDeviceManager, SIGNAL( changeModeFailed() ), this, SLOT( hideProgressBar() ) );
}
void UIManager::connectCommunicationManager( CommunicationManager *aCommunicationManager )
{
connect( aCommunicationManager, SIGNAL( meetingDetailsFetched( Meeting & ) ), this, SLOT( meetingDetailsFetched( Meeting & ) ) );
}
void UIManager::connectCommunicationManager( CommunicationManager *aCommunicationManager )
{
connect( aCommunicationManager, SIGNAL( meetingDetailsFetched( Meeting & ) ), this, SLOT( meetingDetailsFetched( Meeting & ) ) );
+ connect( aCommunicationManager, SIGNAL( meetingsFetched( const QList<Meeting *> & ) ), this, SLOT( meetingsFetched( const QList<Meeting *> & ) ) );
}
// ============================================
}
// ============================================
@@
-163,7
+165,12
@@
void UIManager::settingsOkClicked()
void UIManager::meetingsFetched( const QList<Meeting*> &aMeetings )
{
void UIManager::meetingsFetched( const QList<Meeting*> &aMeetings )
{
-
+ qDebug() << "[UIManager::meetingsFetched] <SHOULD NOT SIMPLY INSERT MEETINGS TO WEEKLYVIEW !!!>";
+ for ( int i = 0; i < aMeetings.count(); i++ )
+ {
+ Meeting *m = new Meeting( *( aMeetings.at(i) ) );
+ iWeeklyView->insertMeeting( m );
+ }
}
void UIManager::showMeetingProgressBar( Meeting *aMeeting )
}
void UIManager::showMeetingProgressBar( Meeting *aMeeting )
@@
-171,20
+178,22
@@
void UIManager::showMeetingProgressBar( Meeting *aMeeting )
if ( iProgressBar != 0 )
{
iProgressBar->update( tr("Fetching meeting info...") );
if ( iProgressBar != 0 )
{
iProgressBar->update( tr("Fetching meeting info...") );
- iWindowManager->showDialog( static_cast<QDialog *>( iProgressBar ) );
+ iWindowManager->showDialog( static_cast<QDialog *>( iProgressBar ), false );
}
}
void UIManager::meetingDetailsFetched(Meeting &aDetailedMeeting)
{
}
}
void UIManager::meetingDetailsFetched(Meeting &aDetailedMeeting)
{
+ qDebug() << "[UIManager::meetingDetailsFetched] <Invoked>";
if ( iMeetingInfo != 0 )
{
if ( iMeetingInfo != 0 )
{
- if ( iProgressBar != 0 )
+ if ( iProgressBar != 0 && iProgressBar->isVisible() )
{
iProgressBar->close(); // Close it in case it's visible
}
{
iProgressBar->close(); // Close it in case it's visible
}
- iMeetingInfo->setMeeting( &aDetailedMeeting );
- iWindowManager->showDialog( static_cast<QDialog *>( iMeetingInfo ) );
+ // iMeetingInfo->setMeeting( &aDetailedMeeting );
+ MeetingInfoDialog *tmp = new MeetingInfoDialog( &aDetailedMeeting );
+ iWindowManager->showDialog( static_cast<QDialog *>( tmp/*iMeetingInfo*/ ) );
}
}
}
}
@@
-250,7
+259,7
@@
void UIManager::passwordEntered( PasswordDialog::PasswordStatus aStatus )
// Show the progress bar..
if ( iProgressBar != 0 )
{
// Show the progress bar..
if ( iProgressBar != 0 )
{
- iWindowManager->showDialog( static_cast<QDialog *>( iProgressBar ) );
+ iWindowManager->showDialog( static_cast<QDialog *>( iProgressBar ), false );
}
// ... and initiate the mode changing
iEngine->changeDeviceMode( true );
}
// ... and initiate the mode changing
iEngine->changeDeviceMode( true );
@@
-276,3
+285,12
@@
void UIManager::updateProgressBarText(const QString &aText)
iProgressBar->update( aText );
}
}
iProgressBar->update( aText );
}
}
+
+void UIManager::hideProgressBar()
+{
+ qDebug() << "[UIManager::hideProgressBar] <Invoked>";
+ if ( iProgressBar != 0 && iProgressBar->isVisible() )
+ {
+ iProgressBar->close();
+ }
+}
diff --git
a/src/BusinessLogic/UIManager.h
b/src/BusinessLogic/UIManager.h
index
df7fe00
..
de123b6
100644
(file)
--- a/
src/BusinessLogic/UIManager.h
+++ b/
src/BusinessLogic/UIManager.h
@@
-51,6
+51,7
@@
private slots:
void passwordEntered( PasswordDialog::PasswordStatus aStatus );
void showMeetingProgressBar( Meeting *aMeeting );
void updateProgressBarText( const QString &aText );
void passwordEntered( PasswordDialog::PasswordStatus aStatus );
void showMeetingProgressBar( Meeting *aMeeting );
void updateProgressBarText( const QString &aText );
+ void hideProgressBar();
private:
private:
diff --git
a/src/UserInterface/Views/RoomStatusIndicatorWidget.h
b/src/UserInterface/Views/RoomStatusIndicatorWidget.h
index
96c4235
..
c20ce45
100644
(file)
--- a/
src/UserInterface/Views/RoomStatusIndicatorWidget.h
+++ b/
src/UserInterface/Views/RoomStatusIndicatorWidget.h
@@
-56,7
+56,7
@@
public slots:
*/
\r
void statusChanged( const Room::Status aStatus, const QTime aUntil );
\r
\r
*/
\r
void statusChanged( const Room::Status aStatus, const QTime aUntil );
\r
\r
- void viewResized(const QSize &size) { }
\r
+ void viewResized(const QSize &newSize, const QSize &oldSize) { }
\r
\r
private:
\r
//! Translates the status into human readable text.
\r
\r
private:
\r
//! Translates the status into human readable text.
\r
diff --git
a/src/UserInterface/Views/SettingsView.cpp
b/src/UserInterface/Views/SettingsView.cpp
index
d233662
..
1021d77
100644
(file)
--- a/
src/UserInterface/Views/SettingsView.cpp
+++ b/
src/UserInterface/Views/SettingsView.cpp
@@
-405,9
+405,12
@@
void SettingsView::handleOkClicked()
emit okClicked();
}
emit okClicked();
}
-void SettingsView::viewResized(const QSize &size)
+void SettingsView::viewResized(const QSize &newSize, const QSize &oldSize)
{
{
- qDebug() << "[SettingsView::viewResized] <Invoked>";
-
- qDebug() << "[SettingsView::viewResized] <Finished>";
+ if ( oldSize.height() > newSize.height() )
+ {
+ // Get the button's height and add that to the new size so that
+ // the ok button is hidden under the keyboard.
+ size().rheight() += iOkButton->size().height();
+ }
}
\ No newline at end of file
}
\ No newline at end of file
diff --git
a/src/UserInterface/Views/SettingsView.h
b/src/UserInterface/Views/SettingsView.h
index
e565aa1
..
2845a8d
100644
(file)
--- a/
src/UserInterface/Views/SettingsView.h
+++ b/
src/UserInterface/Views/SettingsView.h
@@
-31,7
+31,7
@@
signals:
void okClicked();
public slots:
void okClicked();
public slots:
- void viewResized(const QSize &size);
+ void viewResized(const QSize &newSize, const QSize &oldSize);
private slots:
//! Slot to handle the Ok button pressing.
private slots:
//! Slot to handle the Ok button pressing.
diff --git
a/src/UserInterface/Views/ViewBase.h
b/src/UserInterface/Views/ViewBase.h
index
00bcf70
..
631a089
100644
(file)
--- a/
src/UserInterface/Views/ViewBase.h
+++ b/
src/UserInterface/Views/ViewBase.h
@@
-49,7
+49,7
@@
public slots:
* after it has been resized, for example when the on screen keyboard is
* displayed.
*/
* after it has been resized, for example when the on screen keyboard is
* displayed.
*/
- virtual void viewResized(const QSize &size) = 0;
+ virtual void viewResized(const QSize &newSize, const QSize &oldSize) = 0;
signals:
/*!
signals:
/*!
diff --git
a/src/UserInterface/Views/WeeklyViewWidget.h
b/src/UserInterface/Views/WeeklyViewWidget.h
index
da71191
..
2f9c799
100644
(file)
--- a/
src/UserInterface/Views/WeeklyViewWidget.h
+++ b/
src/UserInterface/Views/WeeklyViewWidget.h
@@
-147,7
+147,7
@@
public slots:
* Handle possible resize changes after the view is resized
\r
* to match the window managers client area.
\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 &size) { }
\r
+ void viewResized(const QSize &newSize, const QSize &oldSize) { }
\r
\r
private:
\r
//! Displays the selectable meeting rooms.
\r
\r
private:
\r
//! Displays the selectable meeting rooms.
\r
diff --git
a/src/UserInterface/WindowManager.cpp
b/src/UserInterface/WindowManager.cpp
index
7be6080
..
af006f1
100644
(file)
--- a/
src/UserInterface/WindowManager.cpp
+++ b/
src/UserInterface/WindowManager.cpp
@@
-43,7
+43,7
@@
void WindowManager::showView( ViewBase *view )
// Make the new view visible and handle connections
iCurrentView = view;
connect( iCurrentView, SIGNAL( eventDetected() ), this, SLOT( viewEventDetected() ) );
// Make the new view visible and handle connections
iCurrentView = view;
connect( iCurrentView, SIGNAL( eventDetected() ), this, SLOT( viewEventDetected() ) );
- connect( this, SIGNAL( viewResized(const QSize &) ), iCurrentView, SLOT( viewResized( const QSize & ) ) );
+ connect( this, SIGNAL( viewResized(const QSize &, const QSize &) ), iCurrentView, SLOT( viewResized( const QSize &, const QSize & ) ) );
view->resize( this->size() );
view->show();
view->resize( this->size() );
view->show();
@@
-52,18
+52,25
@@
void WindowManager::showView( ViewBase *view )
if ( oldView != 0 )
{
disconnect( oldView, SIGNAL( eventDetected() ), this, SLOT( viewEventDetected() ) );
if ( oldView != 0 )
{
disconnect( oldView, SIGNAL( eventDetected() ), this, SLOT( viewEventDetected() ) );
- disconnect( this, SIGNAL( viewResized(const QSize &) ), oldView, SLOT( viewResized(const QSize &) ) );
+ disconnect( this, SIGNAL( viewResized(const QSize &, const QSize &) ), oldView, SLOT( viewResized(const QSize &, const QSize &) ) );
oldView->hide();
}
}
oldView->hide();
}
}
-void WindowManager::showDialog(QDialog *dialog)
+void WindowManager::showDialog(QDialog *aDialog, bool blocking, bool aSendSignal)
{
// Handle dialog displaying
{
// Handle dialog displaying
- emit dialogActivated();
- dialog->exec();
- emit dialogDeactivated();
+ if ( aSendSignal ) emit dialogActivated();
+ if ( blocking )
+ {
+ aDialog->exec();
+ }
+ else
+ {
+ aDialog->show();
+ }
+ if ( aSendSignal ) emit dialogDeactivated();
}
void WindowManager::viewEventDetected()
}
void WindowManager::viewEventDetected()
@@
-94,8
+101,9
@@
bool WindowManager::event(QEvent *event)
{
if ( iCurrentView != 0 )
{
{
if ( iCurrentView != 0 )
{
+ QSize currentSize = iCurrentView->size();
iCurrentView->setFixedSize( this->size() );
iCurrentView->setFixedSize( this->size() );
- emit viewResized( this->size() );
+ emit viewResized( this->size(), currentSize );
}
}
}
}
@@
-104,9
+112,13
@@
bool WindowManager::event(QEvent *event)
void WindowManager::error( const QString &aErrorMessage )
{
void WindowManager::error( const QString &aErrorMessage )
{
- qDebug() << "WindowManager::showErrorPopup";
+ qDebug() << "WindowManager::error ";
- showDialog( static_cast<QDialog *>( PopUpMessageBox::error( 0, aErrorMessage ) ) );
+ PopUpMessageBox *popup = PopUpMessageBox::error( 0, aErrorMessage );
+ if ( popup != 0 )
+ {
+ showDialog( static_cast<QDialog *>( popup ), false );
+ }
}
void WindowManager::setFullscreen()
}
void WindowManager::setFullscreen()
diff --git
a/src/UserInterface/WindowManager.h
b/src/UserInterface/WindowManager.h
index
fe594c2
..
2f46050
100644
(file)
--- a/
src/UserInterface/WindowManager.h
+++ b/
src/UserInterface/WindowManager.h
@@
-47,7
+47,7
@@
signals:
* i.e. it received resized QEvent.
\r
* \param The new view size.
\r
*/
\r
* i.e. it received resized QEvent.
\r
* \param The new view size.
\r
*/
\r
- void viewResized(const QSize &);
\r
+ void viewResized(const QSize &newSize, const QSize &oldSize);
\r
\r
//! Previous view is restored.
\r
/*!
\r
\r
//! Previous view is restored.
\r
/*!
\r
@@
-77,7
+77,7
@@
public slots:
* QDialog's exec() method and emits dialogDeactivated signal when
\r
* the exec() method returns.
\r
*/
\r
* QDialog's exec() method and emits dialogDeactivated signal when
\r
* the exec() method returns.
\r
*/
\r
- void showDialog( QDialog *dialog );
\r
+ void showDialog( QDialog *aDialog, bool blocking = true, bool aSendSignal = true );
\r
\r
//! View event is detected.
\r
/*!
\r
\r
//! View event is detected.
\r
/*!
\r