From 6582895befc98131430710191238a93b9dde161c Mon Sep 17 00:00:00 2001 From: ar Date: Sat, 07 Feb 2004 23:52:31 +0000 Subject: QPEApplication::showDialog() and QPEAPplication::execDialog() for better big screen handling --- (limited to 'core/pim') diff --git a/core/pim/addressbook/abeditor.cpp b/core/pim/addressbook/abeditor.cpp index 91e8722..75e7ede 100644 --- a/core/pim/addressbook/abeditor.cpp +++ b/core/pim/addressbook/abeditor.cpp @@ -530,8 +530,7 @@ void AbEditor::saveEntry() void AbEditor::slotNote() { - dlgNote->showMaximized(); - if ( !dlgNote->exec() ) { + if ( ! QPEApplication::execDialog( &dlgNote ) ) { // reset the note... txtNote->setText( ent.notes() ); } diff --git a/core/pim/addressbook/addressbook.cpp b/core/pim/addressbook/addressbook.cpp index 00cd2a6..1c7ddd4 100644 --- a/core/pim/addressbook/addressbook.cpp +++ b/core/pim/addressbook/addressbook.cpp @@ -282,8 +282,7 @@ void AddressbookWindow::slotConfig() { ConfigDlg* dlg = new ConfigDlg( this, "Config" ); dlg -> setConfig( m_config ); - dlg -> showMaximized(); - if ( dlg -> exec() ) { + if ( QPEApplication::execDialog( dlg ) ) { qWarning ("Config Dialog accepted!"); m_config = dlg -> getConfig(); if ( m_curFontSize != m_config.fontSize() ){ @@ -750,12 +749,9 @@ void AddressbookWindow::editEntry( EntryMode entryMode ) // other things may change the caption. abEditor->setCaption( tr("Edit Address") ); -#if defined(Q_WS_QWS) || defined(_WS_QWS_) - abEditor->showMaximized(); -#endif // fix the foxus... abEditor->setNameFocus(); - if ( abEditor->exec() ) { + if ( QPEApplication::execDialog( abEditor ) ) { setFocus(); if ( entryMode == NewEntry ) { OContact insertEntry = abEditor->entry(); diff --git a/core/pim/addressbook/contacteditor.cpp b/core/pim/addressbook/contacteditor.cpp index 8fbd065..7932781 100644 --- a/core/pim/addressbook/contacteditor.cpp +++ b/core/pim/addressbook/contacteditor.cpp @@ -1083,8 +1083,7 @@ void ContactEditor::accept() { void ContactEditor::slotNote() { - dlgNote->showMaximized(); - if ( !dlgNote->exec() ) { + if ( ! QPEApplication::execDialog( dlgNote ) ) { txtNote->setText( ent.notes() ); } } @@ -1098,8 +1097,7 @@ void ContactEditor::slotName() { txtLastName->setText( parseName(txtFullName->text(), NAME_L) ); // txtSuffix->setText( parseName(txtFullName->text(), NAME_S) ); - dlgName->showMaximized(); - if ( dlgName->exec() ) { + if ( QPEApplication::execDialog( dlgName ) ) { if ( txtLastName->text().contains( ' ', TRUE ) ) tmpName = txtLastName->text() + ", " + txtFirstName->text() + " " + txtMiddleName->text(); else diff --git a/core/pim/datebook/datebook.cpp b/core/pim/datebook/datebook.cpp index 44f1515..706cc08 100644 --- a/core/pim/datebook/datebook.cpp +++ b/core/pim/datebook/datebook.cpp @@ -265,12 +265,7 @@ void DateBook::slotSettings() } frmSettings.comboCategory->setCategories(defaultCategories,"Calendar", tr("Calendar")); -#if defined (Q_WS_QWS) || defined(_WS_QWS_) - frmSettings.showMaximized(); -#endif - - if ( frmSettings.exec() ) { - + if ( QPEApplication::execDialog( &frmSettings ) ) { aPreset = frmSettings.alarmPreset(); presetTime = frmSettings.presetTime(); startTime = frmSettings.startTime(); @@ -437,10 +432,7 @@ void DateBook::duplicateEvent( const Event &e ) entry->timezone->setEnabled( FALSE ); sv->addChild( entry ); -#if defined(Q_WS_QWS) || defined(_WS_QWS_) - editDlg.showMaximized(); -#endif - while (editDlg.exec() ) { + while ( QPEApplication::execDialog( &editDlg ) ) { Event newEv = entry->event(); QString error = checkEvent(newEv); if (!error.isNull()) { @@ -486,10 +478,7 @@ void DateBook::editEvent( const Event &e ) entry->timezone->setEnabled( FALSE ); sv->addChild( entry ); -#if defined(Q_WS_QWS) || defined(_WS_QWS_) - editDlg.showMaximized(); -#endif - while (editDlg.exec() ) { + while ( QPEApplication::execDialog( &editDlg ) ) { Event newEv = entry->event(); if(newEv.description().isEmpty() && newEv.notes().isEmpty() ) break; @@ -707,10 +696,7 @@ void DateBook::appMessage(const QCString& msg, const QByteArray& data) connect( cmdOk, SIGNAL(clicked()), &dlg, SLOT(accept()) ); vb->addWidget( cmdOk ); -#if defined(Q_WS_QWS) || defined(_WS_QWS_) - dlg.showMaximized(); -#endif - needShow = dlg.exec(); + needShow = QPEApplication::execDialog( &dlg ); if ( bSound ) killTimer( stopTimer ); @@ -902,10 +888,7 @@ void DateBook::slotNewEntry(const QDateTime &start, const QDateTime &end, const e = new DateEntry( onMonday, ev, ampm, &newDlg ); e->setAlarmEnabled( aPreset, presetTime, Event::Loud ); sv->addChild( e ); -#if defined(Q_WS_QWS) || defined(_WS_QWS_) - newDlg.showMaximized(); -#endif - while (newDlg.exec()) { + while ( QPEApplication::execDialog( &newDlg ) ) { ev = e->event(); ev.assignUid(); QString error = checkEvent( ev ); diff --git a/core/pim/datebook/dateentryimpl.cpp b/core/pim/datebook/dateentryimpl.cpp index d9e5225..856837c 100644 --- a/core/pim/datebook/dateentryimpl.cpp +++ b/core/pim/datebook/dateentryimpl.cpp @@ -249,10 +249,7 @@ void DateEntry::slotEditNote() { NoteEntry noteDlg(s+comboDescription->currentText(), noteStr, this,0,TRUE); -#if defined(Q_WS_QWS) || defined(_WS_QWS_) - noteDlg.showMaximized(); -#endif - if (noteDlg.exec() ) { + if ( QPEApplication::execDialog( ¬eDlg ) ) { noteStr=noteDlg.note->text(); } @@ -395,10 +392,7 @@ void DateEntry::slotRepeat() else e = new RepeatEntry( startWeekOnMonday, startDate, this ); -#if defined(Q_WS_QWS) || defined(_WS_QWS_) - e->showMaximized(); -#endif - if ( e->exec() ) { + if ( QPEApplication::execDialog( e ) ) { rp = e->repeatPattern(); setRepeatLabel(); } diff --git a/core/pim/datebook2/mainwindow.cpp b/core/pim/datebook2/mainwindow.cpp index be30415..7ff2204 100644 --- a/core/pim/datebook2/mainwindow.cpp +++ b/core/pim/datebook2/mainwindow.cpp @@ -229,24 +229,21 @@ void MainWindow::slotAction( QAction* act ) { void MainWindow::slotConfigureLocs() { LocationManagerDialog dlg( locationManager() ); dlg.setCaption( tr("Configure Locations") ); - dlg.showMaximized(); - if (dlg.exec() == QDialog::Accepted ) { + if ( QPEApplication::execDialog( &dlg ) == QDialog::Accepted ) { setLocationManager( dlg.manager() ); } } void MainWindow::slotConfigureDesc() { DescriptionManagerDialog dlg( descriptionManager() ); dlg.setCaption( tr("Configure Descriptions") ); - dlg.showMaximized(); - if (dlg.exec() == QDialog::Accepted ) { + if ( QPEApplication::execDialog( &dlg ) == QDialog::Accepted ) { setDescriptionManager( dlg.manager() ); } } void MainWindow::slotConfigureTemp() { TemplateDialog dlg( templateManager(), editor() ); dlg.setCaption( tr("Configure Templates") ); - dlg.showMaximized(); - if ( dlg.exec() == QDialog::Accepted ) { + if ( QPEApplication::execDialog( &dlg ) == QDialog::Accepted ) { m_tempMan = dlg.manager(); setTemplateMenu(); } diff --git a/core/pim/todo/mainwindow.cpp b/core/pim/todo/mainwindow.cpp index d06a405..fc189bd 100644 --- a/core/pim/todo/mainwindow.cpp +++ b/core/pim/todo/mainwindow.cpp @@ -1028,8 +1028,7 @@ void MainWindow::doAlarm( const QDateTime& dt, int uid ) { text += todo.toRichText(); view->setText( text ); - dlg.showMaximized(); - bool needToStay = dlg.exec(); + bool needToStay = QPEApplication::execDialog( &dlg ); if (loud) killAlarm(); diff --git a/core/pim/todo/todoeditor.cpp b/core/pim/todo/todoeditor.cpp index c204325..78aedd6 100644 --- a/core/pim/todo/todoeditor.cpp +++ b/core/pim/todo/todoeditor.cpp @@ -1,4 +1,6 @@ +#include + #include "otaskeditor.h" #include "todoeditor.h" @@ -19,10 +21,8 @@ OTodo Editor::newTodo( int cur, e->setCaption( QObject::tr("Enter Task") ); e->init( cur ); + int ret = QPEApplication::execDialog( e ); - e->showMaximized(); - - int ret = e->exec(); if ( QDialog::Accepted == ret ) { m_accepted = true; }else @@ -41,8 +41,7 @@ OTodo Editor::edit( QWidget *, e->init( todo ); e->setCaption( QObject::tr( "Edit Task" ) ); - e->showMaximized(); - int ret = e->exec(); + int ret = QPEApplication::execDialog( e ); OTodo ev = e->todo(); if ( ret == QDialog::Accepted ) -- cgit v0.9.0.2