summaryrefslogtreecommitdiff
authorar <ar>2004-02-07 23:52:31 (UTC)
committer ar <ar>2004-02-07 23:52:31 (UTC)
commit6582895befc98131430710191238a93b9dde161c (patch) (side-by-side diff)
treed050483742d0e102e08138bcdd8f170a9558b12d
parent3f261fa6eac46b8d0d4ac8b8bb95b385435004da (diff)
downloadopie-6582895befc98131430710191238a93b9dde161c.zip
opie-6582895befc98131430710191238a93b9dde161c.tar.gz
opie-6582895befc98131430710191238a93b9dde161c.tar.bz2
QPEApplication::showDialog() and QPEAPplication::execDialog() for better big screen handling
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--core/apps/embeddedkonsole/konsole.cpp5
-rw-r--r--core/apps/textedit/textedit.cpp6
-rw-r--r--core/multimedia/opieplayer/playlistwidget.cpp3
-rw-r--r--core/pim/addressbook/abeditor.cpp3
-rw-r--r--core/pim/addressbook/addressbook.cpp8
-rw-r--r--core/pim/addressbook/contacteditor.cpp6
-rw-r--r--core/pim/datebook/datebook.cpp27
-rw-r--r--core/pim/datebook/dateentryimpl.cpp10
-rw-r--r--core/pim/datebook2/mainwindow.cpp9
-rw-r--r--core/pim/todo/mainwindow.cpp3
-rw-r--r--core/pim/todo/todoeditor.cpp9
-rw-r--r--core/settings/light-and-power/light.cpp4
12 files changed, 28 insertions, 65 deletions
diff --git a/core/apps/embeddedkonsole/konsole.cpp b/core/apps/embeddedkonsole/konsole.cpp
index a5adc03..ce8fb6b 100644
--- a/core/apps/embeddedkonsole/konsole.cpp
+++ b/core/apps/embeddedkonsole/konsole.cpp
@@ -41,15 +41,16 @@
#include <qapplication.h>
#include <qfontmetrics.h>
#include <qcombobox.h>
#include <qevent.h>
#include <qtabwidget.h>
#include <qtabbar.h>
-#include <qpe/config.h>
#include <qstringlist.h>
#include <qpalette.h>
+#include <qpe/config.h>
+#include <qpe/qpeapplication.h>
#include <unistd.h>
#include <pwd.h>
#include <sys/types.h>
//#include <sys/wait.h>
#include <stdio.h>
@@ -1073,13 +1074,13 @@ void Konsole::editCommandListMenuSelected(int iD)
}
}
if(iD == -24) {
// "edit commands"
CommandEditDialog *m = new CommandEditDialog(this);
connect(m,SIGNAL(commandsEdited()),this,SLOT(initCommandList()));
- m->showMaximized();
+ QPEApplication::showDialog( m );
}
}
// $QPEDIR/bin/qcop QPE/Application/embeddedkonsole 'setDocument(QString)' 'ssh -V'
void Konsole::setDocument( const QString &cmd) {
diff --git a/core/apps/textedit/textedit.cpp b/core/apps/textedit/textedit.cpp
index be18140..1299fe3 100644
--- a/core/apps/textedit/textedit.cpp
+++ b/core/apps/textedit/textedit.cpp
@@ -939,14 +939,13 @@ bool TextEdit::saveAs() {
if( filePerms ) {
filePermissions *filePerm;
filePerm = new filePermissions(this,
tr("Permissions"),true,
0,(const QString &)fileNm);
- filePerm->showMaximized();
- filePerm->exec();
+ QPEApplication::execDialog( filePerm );
if( filePerm)
delete filePerm;
}
// }
editor->setEdited( false);
@@ -1013,14 +1012,13 @@ void TextEdit::changeFont() {
d-> setCaption ( tr( "Choose font" ));
QBoxLayout *lay = new QVBoxLayout ( d );
OFontSelector *ofs = new OFontSelector ( true, d );
lay-> addWidget ( ofs );
ofs-> setSelectedFont ( editor-> font ( ));
- d-> showMaximized ( );
- if ( d-> exec ( ) == QDialog::Accepted )
+ if ( QPEApplication::execDialog( d ) == QDialog::Accepted )
editor-> setFont ( ofs-> selectedFont ( ));
delete d;
}
void TextEdit::editDelete() {
diff --git a/core/multimedia/opieplayer/playlistwidget.cpp b/core/multimedia/opieplayer/playlistwidget.cpp
index 5fb605b..82fd1e1 100644
--- a/core/multimedia/opieplayer/playlistwidget.cpp
+++ b/core/multimedia/opieplayer/playlistwidget.cpp
@@ -946,14 +946,13 @@ void PlayListWidget::listDelete() {
{
file = audioView->currentItem()->text(0);
QListIterator<DocLnk> Pdit( files.children() );
for ( ; Pdit.current(); ++Pdit ) {
if( Pdit.current()->name() == file) {
LnkProperties prop( Pdit.current() );
- prop.showMaximized();
- prop.exec();
+ QPEApplication::execDialog( &prop );
}
}
populateAudioView();
}
break;
case 2:
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
@@ -527,14 +527,13 @@ void AbEditor::saveEntry()
if ( !str.isNull() )
ent.setNotes( str );
}
void AbEditor::slotNote()
{
- dlgNote->showMaximized();
- if ( !dlgNote->exec() ) {
+ if ( ! QPEApplication::execDialog( &dlgNote ) ) {
// reset the note...
txtNote->setText( ent.notes() );
}
}
void AbEditor::setNameFocus()
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
@@ -279,14 +279,13 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name,
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() ){
qWarning("Font was changed!");
m_curFontSize = m_config.fontSize();
emit slotSetFont( m_curFontSize );
@@ -747,18 +746,15 @@ void AddressbookWindow::editEntry( EntryMode entryMode )
abEditor->setEntry( m_abView -> currentEntry() );
else if ( entryMode == NewEntry )
abEditor->setEntry( entry );
// 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();
insertEntry.assignUid();
m_abView -> addEntry( insertEntry );
m_abView -> setCurrentUid( insertEntry.uid() );
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
@@ -1080,14 +1080,13 @@ void ContactEditor::accept() {
}
}
void ContactEditor::slotNote() {
- dlgNote->showMaximized();
- if ( !dlgNote->exec() ) {
+ if ( ! QPEApplication::execDialog( dlgNote ) ) {
txtNote->setText( ent.notes() );
}
}
void ContactEditor::slotName() {
@@ -1095,14 +1094,13 @@ void ContactEditor::slotName() {
txtFirstName->setText( parseName(txtFullName->text(), NAME_F) );
txtMiddleName->setText( parseName(txtFullName->text(), NAME_M) );
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
tmpName = txtFirstName->text() + " " + txtMiddleName->text() + " " + txtLastName->text();
txtFullName->setText( tmpName.simplifyWhiteSpace() );
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
@@ -262,18 +262,13 @@ void DateBook::slotSettings()
if(!found) {
frmSettings.comboLocation->insertItem(defaultLocation);
frmSettings.comboLocation->setCurrentItem(frmSettings.comboLocation->count()-1);
}
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();
bJumpToCurTime = frmSettings.jumpToCurTime();
rowStyle = frmSettings.rowStyle();
defaultView=frmSettings.comboDefaultView->currentItem()+1;
@@ -434,16 +429,13 @@ void DateBook::duplicateEvent( const Event &e )
sv->setHScrollBarMode( QScrollView::AlwaysOff );
vb->addWidget( sv );
entry = new DateEntry( onMonday, dupevent, ampm, &editDlg, "editor" );
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()) {
if (QMessageBox::warning(this, tr("error box"), error, tr("Fix it"), tr("Continue"), 0, 0, 1) == 0)
continue;
}
@@ -483,16 +475,13 @@ void DateBook::editEvent( const Event &e )
sv->setHScrollBarMode( QScrollView::AlwaysOff );
vb->addWidget( sv );
entry = new DateEntry( onMonday, e, ampm, &editDlg, "editor" );
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;
newEv.setUid(e.uid()); // FIXME: Hack not to clear uid
QString error = checkEvent(newEv);
if (!error.isNull()) {
@@ -704,16 +693,13 @@ void DateBook::appMessage(const QCString& msg, const QByteArray& data)
QLabel *lblMsg = new QLabel( msg, &dlg );
view->addChild( lblMsg );
QPushButton *cmdOk = new QPushButton( tr("OK"), &dlg );
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 );
}
}
} else if ( msg == "nextView()" ) {
@@ -899,16 +885,13 @@ void DateBook::slotNewEntry(const QDateTime &start, const QDateTime &end, const
ev.setStart( start );
ev.setEnd( end );
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 );
if ( !error.isNull() ) {
if ( QMessageBox::warning( this, tr("Error!"), error, tr("Fix it"), tr("Continue"), 0, 0, 1 ) == 0 )
continue;
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
@@ -246,16 +246,13 @@ void DateEntry::slotEditNote() {
QString s;
s = "<B>"+ TimeString::longDateString( startDate ) + "</B>";
// s.sprintf("<B>%d/%d</B> ", startDate.day(), startDate.month());
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( &noteDlg ) ) {
noteStr=noteDlg.note->text();
}
}
void DateEntry::endDateChanged( int y, int m, int d )
@@ -392,16 +389,13 @@ void DateEntry::slotRepeat()
// since, this dialog doesn't need to keep track of it...
if ( rp.type != Event::NoRepeat )
e = new RepeatEntry( startWeekOnMonday, rp, startDate, this);
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();
}
// deleting sounds like a nice idea...
delete e;
}
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
@@ -226,30 +226,27 @@ Show* MainWindow::eventShow() {
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();
}
}
void MainWindow::hideShow() {
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
@@ -1025,14 +1025,13 @@ void MainWindow::doAlarm( const QDateTime& dt, int uid ) {
lay->addWidget( btnOk );
QString text = tr("<h1>Alarm at %1</h1><br>").arg( TimeString::dateString( dt ) );
text += todo.toRichText();
view->setText( text );
- dlg.showMaximized();
- bool needToStay = dlg.exec();
+ bool needToStay = QPEApplication::execDialog( &dlg );
if (loud)
killAlarm();
if (needToStay) {
// showMaximized();
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,7 +1,9 @@
+#include <qpe/qpeapplication.h>
+
#include "otaskeditor.h"
#include "todoeditor.h"
using namespace Todo;
Editor::Editor() {
@@ -16,16 +18,14 @@ OTodo Editor::newTodo( int cur,
QWidget*) {
OTaskEditor *e = self();
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
m_accepted = false;
OTodo ev = e->todo();
@@ -38,14 +38,13 @@ OTodo Editor::newTodo( int cur,
OTodo Editor::edit( QWidget *,
const OTodo& todo ) {
OTaskEditor *e = self();
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 )
m_accepted = true;
else
m_accepted = false;
diff --git a/core/settings/light-and-power/light.cpp b/core/settings/light-and-power/light.cpp
index d6d09a1..b21215b 100644
--- a/core/settings/light-and-power/light.cpp
+++ b/core/settings/light-and-power/light.cpp
@@ -30,12 +30,13 @@
#include <qpe/config.h>
#include <qpe/power.h>
#if defined(Q_WS_QWS) && !defined(QT_NO_COP)
#include <qpe/qcopenvelope_qws.h>
#endif
+#include <qpe/qpeapplication.h>
#include <qlabel.h>
#include <qcheckbox.h>
#include <qtabwidget.h>
#include <qslider.h>
#include <qspinbox.h>
@@ -198,14 +199,13 @@ LightSettings::~LightSettings ( )
}
void LightSettings::calibrateSensor ( )
{
Sensor *s = new Sensor ( m_sensordata, this );
connect ( s, SIGNAL( viewBacklight ( int )), this, SLOT( setBacklight ( int )));
- s-> showMaximized ( );
- s-> exec ( );
+ QPEApplication::execDialog( s );
delete s;
}
void LightSettings::calibrateSensorAC ( )
{
Sensor *s = new Sensor ( m_sensordata_ac, this );