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) (ignore 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
@@ -23,51 +23,52 @@
#include "signal.h"
#include <qpe/resource.h>
#include <qdir.h>
#include <qevent.h>
#include <qdragobject.h>
#include <qobjectlist.h>
#include <qtoolbutton.h>
#include <qtoolbar.h>
#include <qpushbutton.h>
#include <qfontdialog.h>
#include <qglobal.h>
#include <qpainter.h>
#include <qmenubar.h>
#include <qmessagebox.h>
#include <qaction.h>
#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>
#include <stdlib.h>
#include <assert.h>
#include "konsole.h"
#include "keytrans.h"
#include "commandeditdialog.h"
#ifdef QT_QWS_OPIE
#include <opie/colorpopupmenu.h>
#endif
#include <qfontdatabase.h> // U.B.
#include <qstringlist.h> // U.B.
#include <qvaluelist.h> // U.B.
class EKNumTabBar : public QTabBar {
public:
void numberTabs()
@@ -1055,49 +1056,49 @@ void Konsole::editCommandListMenuSelected(int iD)
commonCombo->setEditable( FALSE );
}
}
}
if( iD == -23) {
cfg.setGroup("Commands");
// qDebug("enableCommandEdit");
if( !configMenu->isItemChecked(iD) ) {
commonCombo->setEditable( TRUE );
configMenu->setItemChecked(iD,TRUE);
commonCombo->setCurrentItem(0);
cfg.writeEntry("EditEnabled","TRUE");
} else {
commonCombo->setEditable( FALSE );
configMenu->setItemChecked(iD,FALSE);
cfg.writeEntry("EditEnabled","FALSE");
commonCombo->setFocusPolicy(QWidget::NoFocus);
te->setFocus();
}
}
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) {
newSession();
TEWidget* te = getTe();
if(cmd.find("-e", 0, TRUE) != -1) {
QString cmd2;
cmd2=cmd.right(cmd.length()-3)+" &";
system(cmd2.latin1());
if(startUp <= 1 && nsessions < 2) {
doneSession(getTe()->currentSession, 0);
exit(0);
} else
doneSession(getTe()->currentSession, 0);
} else {
if (te != 0) {
te->emitText(cmd+"\r");
}
}
startUp++;
}
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
@@ -921,50 +921,49 @@ bool TextEdit::saveAs() {
currentFileName=fi.fileName();
if(doc)
// QString file = doc->file();
// doc->removeFiles();
delete doc;
DocLnk nf;
nf.setType("text/plain");
nf.setFile( fileNm);
doc = new DocLnk(nf);
// editor->setText(rt);
qDebug("Saving file as "+currentFileName);
doc->setName( currentFileName);
updateCaption( currentFileName);
FileManager fm;
if ( !fm.saveFile( *doc, rt ) ) {
return false;
}
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);
edited1 = false;
edited = false;
if(caption().left(1)=="*")
setCaption(caption().right(caption().length()-1));
return true;
}
qDebug("returning false");
return false;
} //end saveAs
void TextEdit::clear() {
delete doc;
doc = 0;
editor->clear();
}
void TextEdit::updateCaption( const QString &name ) {
@@ -995,50 +994,49 @@ void TextEdit::setDocument(const QString& fileref) {
openDotFile(currentFileName);
} else {
qDebug("setDoc open");
bFromDocView = true;
openFile(fileref);
editor->setEdited(true);
edited1=false;
edited=true;
// fromSetDocument=false;
// doSearchBar();
}
}
updateCaption( currentFileName);
}
void TextEdit::changeFont() {
QDialog *d = new QDialog ( this, "FontDialog", true );
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() {
switch ( QMessageBox::warning(this,tr("Text Editor"),
tr("Do you really want<BR>to <B>delete</B> "
"the current file\nfrom the disk?<BR>This is "
"<B>irreversable!</B>"),
tr("Yes"),tr("No"),0,0,1) ) {
case 0:
if(doc) {
doc->removeFiles();
clear();
setCaption( tr("Text Editor") );
}
break;
case 1:
// exit
break;
};
}
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
@@ -928,50 +928,49 @@ void PlayListWidget::playlistViewPressed( int mouse, QListViewItem *, const QPoi
// m.insertItem( tr( "Properties" ), this, SLOT( listDelete() ));
m.exec( QCursor::pos() );
}
break;
};
}
void PlayListWidget::listDelete() {
Config cfg( "OpiePlayer" );
cfg.setGroup("PlayList");
currentPlayList = cfg.readEntry("CurrentPlaylist","");
QString file;
// int noOfFiles = cfg.readNumEntry("NumberOfFiles", 0 );
switch ( tabWidget->currentPageIndex()) {
case 0:
break;
case 1:
{
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:
{
// file = videoView->selectedItem()->text(0);
// for ( int i = 0; i < noOfFiles; i++ ) {
// QString entryName;
// entryName.sprintf( "File%i", i + 1 );
// QString linkFile = cfg.readEntry( entryName );
// AppLnk lnk( AppLnk(linkFile));
// if( lnk.name() == file ) {
// LnkProperties prop( &lnk);
// // connect(&prop, SIGNAL(select(const AppLnk *)), this, SLOT(externalSelected(const AppLnk *)));
// prop.showMaximized();
// prop.exec();
// }
// }
}
break;
};
}
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
@@ -509,50 +509,49 @@ void AbEditor::saveEntry()
ent.setBirthday( it.current()->text() );
break;
case Qtopia::Anniversary:
ent.setAnniversary( it.current()->text() );
break;
case Qtopia::Nickname:
ent.setNickname( it.current()->text() );
break;
default:
break;
}
}
int gender = genderCombo->currentItem();
ent.setGender( QString::number( gender ) );
QString str = txtNote->text();
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()
{
firstEdit->setFocus();
}
void parseEmailFrom( const QString &txt, QString &strDefaultEmail,
QString &strAll )
{
int where,
start;
if ( txt.isEmpty() )
return;
// find the first
where = txt.find( ',' );
if ( where < 0 ) {
strDefaultEmail = txt;
strAll = txt;
} else {
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
@@ -261,50 +261,49 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name,
populateCategories();
// Fontsize
defaultFont = new QFont( m_abView->font() );
slotSetFont(m_config.fontSize());
m_curFontSize = m_config.fontSize();
setCentralWidget(listContainer);
// qDebug("adressbook contrsuction: t=%d", t.elapsed() );
connect( qApp, SIGNAL( flush() ), this, SLOT( flush() ) );
connect( qApp, SIGNAL( reload() ), this, SLOT( reload() ) );
connect( qApp, SIGNAL( appMessage(const QCString &, const QByteArray &) ),
this, SLOT( appMessage(const QCString &, const QByteArray &) ) );
isLoading = false;
}
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 );
}
m_abView -> setListOrder( m_config.orderList() );
}
delete dlg;
}
void AddressbookWindow::slotSetFont( int size )
{
qWarning("void AddressbookWindow::slotSetFont( %d )", size);
if (size > 2 || size < 0)
size = 1;
m_config.setFontSize( size );
QFont *currentFont;
@@ -729,54 +728,51 @@ void AddressbookWindow::appMessage(const QCString &msg, const QByteArray &data)
// Reset category and edit..
m_abView -> setShowByCategory( QString::null );
m_abView -> setCurrentUid( uid );
slotViewEdit();
}
if (needShow)
QPEApplication::setKeepRunning();
}
void AddressbookWindow::editEntry( EntryMode entryMode )
{
OContact entry;
if ( !abEditor ) {
abEditor = new ContactEditor( entry, this, "editor" );
}
if ( entryMode == EditEntry )
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() );
} else {
OContact replEntry = abEditor->entry();
if ( !replEntry.isValidUid() )
replEntry.assignUid();
m_abView -> replaceEntry( replEntry );
}
}
// populateCategories();
}
void AddressbookWindow::editPersonal()
{
OContact entry;
// Switch to personal view if not selected
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
@@ -1062,65 +1062,63 @@ void ContactEditor::slotOrganizationChange( const QString &textChanged ){
qWarning( "ContactEditor::slotOrganizationChange( %s )", textChanged.latin1() );
// Special handling for storing Companies:
// If no Fullname is given, we store the Company-Name as lastname
// to handle it like a person..
if ( txtFullName->text() == txtOrganization->text().left( txtFullName->text().length() ) )
txtFullName->setText( textChanged );
}
void ContactEditor::accept() {
if ( isEmpty() ) {
cleanupFields();
reject();
} else {
saveEntry();
cleanupFields();
QDialog::accept();
}
}
void ContactEditor::slotNote() {
- dlgNote->showMaximized();
- if ( !dlgNote->exec() ) {
+ if ( ! QPEApplication::execDialog( dlgNote ) ) {
txtNote->setText( ent.notes() );
}
}
void ContactEditor::slotName() {
QString tmpName;
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() );
slotFullNameChange( txtFullName->text() );
}
}
void ContactEditor::setNameFocus() {
txtFullName->setFocus();
}
bool ContactEditor::isEmpty() {
// Test and see if the record should be saved.
// More strict than the original qtopia, needs name or fileas to save
QString t = txtFullName->text();
if ( !t.isEmpty() && containsAlphaNum( t ) )
return false;
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
@@ -244,54 +244,49 @@ DateBook::~DateBook()
void DateBook::slotSettings()
{
DateBookSettings frmSettings( ampm, this );
frmSettings.setStartTime( startTime );
frmSettings.setAlarmPreset( aPreset, presetTime );
frmSettings.setJumpToCurTime( bJumpToCurTime );
frmSettings.setRowStyle( rowStyle );
frmSettings.comboDefaultView->setCurrentItem(defaultView-1);
frmSettings.comboWeekListView->setCurrentItem(weeklistviewconfig);
bool found=false;
for (int i=0; i<(frmSettings.comboLocation->count()); i++) {
if ( frmSettings.comboLocation->text(i) == defaultLocation ) {
frmSettings.comboLocation->setCurrentItem(i);
found=true;
break;
}
}
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;
weeklistviewconfig=frmSettings.comboWeekListView->currentItem();
defaultLocation=frmSettings.comboLocation->currentText();
defaultCategories=frmSettings.comboCategory->currentCategories();
if ( dayView ) {
dayView->setStartViewTime( startTime );
dayView->setJumpToCurTime( bJumpToCurTime );
dayView->setRowStyle( rowStyle );
}
if ( weekView ) {
weekView->setStartViewTime( startTime );
}
saveSettings();
// make the change obvious
if ( views->visibleWidget() ) {
if ( views->visibleWidget() == dayView )
dayView->redraw();
@@ -416,101 +411,95 @@ void DateBook::duplicateEvent( const Event &e )
{
qWarning("Hmmm...");
// Alot of code duplication, as this is almost like editEvent();
if (syncing) {
QMessageBox::warning( this, tr("Calendar"), tr( "Can not edit data, currently syncing") );
return;
}
Event dupevent(e); // Make a duplicate.
// workaround added for text input.
QDialog editDlg( this, 0, TRUE );
DateEntry *entry;
editDlg.setCaption( tr("Duplicate Event") );
QVBoxLayout *vb = new QVBoxLayout( &editDlg );
QScrollView *sv = new QScrollView( &editDlg, "scrollview" );
sv->setResizePolicy( QScrollView::AutoOneFit );
// KLUDGE!!!
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;
}
/*
* The problem:
* DateBookDB does remove repeating events not by uid but by the time
* the recurrence was created
* so we need to update that time as well
*/
Event::RepeatPattern rp = newEv.repeatPattern();
rp.createTime = ::time( NULL );
newEv.setRepeat( TRUE, rp ); // has repeat and repeatPattern...
if( newEv.uid() == e.uid() || !newEv.isValidUid() )
newEv.assignUid();
db->addEvent(newEv);
emit newEvent();
break;
}
}
void DateBook::editEvent( const Event &e )
{
if (syncing) {
QMessageBox::warning( this, tr("Calendar"), tr( "Can not edit data, currently syncing") );
return;
}
// workaround added for text input.
QDialog editDlg( this, 0, TRUE );
DateEntry *entry;
editDlg.setCaption( tr("Edit Event") );
QVBoxLayout *vb = new QVBoxLayout( &editDlg );
QScrollView *sv = new QScrollView( &editDlg, "scrollview" );
sv->setResizePolicy( QScrollView::AutoOneFit );
// KLUDGE!!!
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()) {
if (QMessageBox::warning(this, tr("error box"), error, tr("Fix it"), tr("Continue"), 0, 0, 1) == 0) continue;
}
db->editEvent(e, newEv);
emit newEvent();
break;
}
}
void DateBook::removeEvent( const Event &e )
{
if (syncing) {
QMessageBox::warning( this, tr("Calendar"), tr( "Can not edit data, currently syncing") );
return;
}
QString strName = e.description();
if ( !QPEMessageBox::confirmDelete( this, tr( "Calendar" ),strName ) )
@@ -686,52 +675,49 @@ void DateBook::appMessage(const QCString& msg, const QByteArray& data)
+ "<BR>"
+ (*it).notes() + "</CENTER>";
if ( (*it).event().alarmSound() != Event::Silent ) {
bSound = TRUE;
}
}
}
if ( found ) {
if ( bSound ) {
Sound::soundAlarm();
alarmCounter = 0;
stopTimer = startTimer( 5000 );
}
QDialog dlg( this, 0, TRUE );
QVBoxLayout *vb = new QVBoxLayout( &dlg );
QScrollView *view = new QScrollView( &dlg, "scrollView");
view->setResizePolicy( QScrollView::AutoOneFit );
vb->addWidget( view );
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()" ) {
needShow = true;
if ( !qApp-> activeWindow ( )) {
needShow = TRUE;
} else {
QWidget* cur = views->visibleWidget();
if ( cur ) {
if ( cur == dayView )
viewWeek();
else if ( cur == weekView )
viewWeekLst();
else if ( cur == weekLstView )
viewMonth();
else if ( cur == monthView )
viewDay();
needShow = TRUE;
}
}
} else if (msg == "editEvent(int)") {
@@ -881,52 +867,49 @@ void DateBook::slotNewEntry(const QDateTime &start, const QDateTime &end, const
sv->setResizePolicy( QScrollView::AutoOneFit );
sv->setFrameStyle( QFrame::NoFrame );
sv->setHScrollBarMode( QScrollView::AlwaysOff );
vb->addWidget( sv );
Event ev;
ev.setDescription( str );
// When the new gui comes in, change this...
if(location==0) {
if(defaultLocation.isEmpty()) {
ev.setLocation(tr("(Unknown)"));
} else {
ev.setLocation( defaultLocation );
}
} else {
ev.setLocation(location);
}
ev.setCategories(defaultCategories);
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;
}
db->addEvent( ev );
emit newEvent();
break;
}
}
void DateBook::setDocument( const QString &filename )
{
if ( filename.find(".vcs") != int(filename.length()) - 4 ) return;
QValueList<Event> tl = Event::readVCalendar( filename );
for( QValueList<Event>::Iterator it = tl.begin(); it != tl.end(); ++it ) {
db->addEvent( *it );
}
}
static const char * beamfile = "/tmp/obex/event.vcs";
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
@@ -228,52 +228,49 @@ void DateEntry::init()
comboEnd->installEventFilter( this );
comboStart->installEventFilter( this );
}
/*
* Destroys the object and frees any allocated resources
*/
DateEntry::~DateEntry()
{
// no need to delete child widgets, Qt does it all for us
//cout << "Del: " << comboStart->currentText() << endl;
}
/*
* public slot
*/
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 )
{
endDate.setYMD( y, m, d );
if ( endDate < startDate ) {
endDate = startDate;
}
buttonEnd->setText( TimeString::shortDate( endDate ) );
endPicker->setDate( endDate.year(), endDate.month(), endDate.day() );
}
static QTime parseTime( const QString& s, bool ampm )
{
QTime tmpTime;
QStringList l = QStringList::split( ':', s );
int hour = l[0].toInt();
if ( ampm ) {
int i=0;
@@ -374,52 +371,49 @@ void DateEntry::startTimePicked( const QTime &t ) {
/*
* public slot
*/
void DateEntry::typeChanged( const QString &s )
{
bool b = s != "All Day";
buttonStart->setEnabled( b );
comboStart->setEnabled( b );
comboEnd->setEnabled( b );
}
void DateEntry::slotRepeat()
{
// Work around for compiler Bug..
RepeatEntry *e;
// it is better in my opinion to just grab this from the mother,
// 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;
}
void DateEntry::slotChangeStartOfWeek( bool onMonday )
{
startWeekOnMonday = onMonday;
}
Event DateEntry::event()
{
Event ev;
Event::SoundTypeChoice st;
ev.setDescription( comboDescription->currentText() );
ev.setLocation( comboLocation->currentText() );
ev.setCategories( comboCategory->currentCategories() );
ev.setType( checkAllDay->isChecked() ? Event::AllDay : Event::Normal );
if ( startDate > endDate ) {
QDate tmp = endDate;
endDate = startDate;
startDate = tmp;
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
@@ -208,66 +208,63 @@ BookManager* MainWindow::manager() {
TemplateManager MainWindow::templateManager() {
return m_tempMan;
}
LocationManager MainWindow::locationManager() {
return m_locMan;
}
DescriptionManager MainWindow::descriptionManager() {
return m_descMan;
}
void MainWindow::setLocationManager( const LocationManager& loc) {
m_locMan = loc;
}
void MainWindow::setDescriptionManager( const DescriptionManager& dsc ) {
m_descMan = dsc;
}
Show* MainWindow::eventShow() {
return m_show;
}
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() {
}
void MainWindow::viewPopup(int ) {
}
void MainWindow::viewAdd(const QDate& ) {
}
void MainWindow::viewAdd( const QDateTime&, const QDateTime& ) {
}
bool MainWindow::viewAP()const{
}
bool MainWindow::viewStartMonday()const {
}
void MainWindow::setTemplateMenu() {
m_popTemplate->clear();
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
@@ -1007,39 +1007,38 @@ void MainWindow::doAlarm( const QDateTime& dt, int uid ) {
bool loud = false;
OPimNotifyManager::Alarms als = todo.notifiers().alarms();
OPimNotifyManager::Alarms::Iterator it;
for ( it = als.begin(); it != als.end(); ++it ) {
if ( (*it).dateTime() == dt ) {
loud = ( (*it).sound() == OPimAlarm::Loud );
break;
}
}
if (loud)
startAlarm();
QDialog dlg(this, 0, TRUE );
QVBoxLayout* lay = new QVBoxLayout( &dlg );
QTextView* view = new QTextView( &dlg );
lay->addWidget( view );
QPushButton* btnOk = new QPushButton( tr("Ok"), &dlg );
connect( btnOk, SIGNAL(clicked() ), &dlg, SLOT(accept() ) );
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();
// raise();
QPEApplication::setKeepRunning();
// setActiveWindow();
}
}
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,63 +1,62 @@
+#include <qpe/qpeapplication.h>
+
#include "otaskeditor.h"
#include "todoeditor.h"
using namespace Todo;
Editor::Editor() {
m_accepted = false;
m_self = 0l;
}
Editor::~Editor() {
delete m_self;
m_self = 0;
}
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();
qWarning("Todo uid");
qWarning("Todo %s %d %d", ev.summary().latin1(), ev.progress(), ev.isCompleted() );
ev.setUid(1);
return ev;
}
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;
return ev;
}
bool Editor::accepted()const {
return m_accepted;
}
OTaskEditor* Editor::self() {
if (!m_self )
m_self = new OTaskEditor(0);
return m_self;
}
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
@@ -12,48 +12,49 @@
    .%`+i>       _;_.
    .i_,=:_.      -<s. This file is distributed in the hope that
     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
    : ..    .:,     . . . without even the implied warranty of
    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
..}^=.=       =       ; Public License for more details.
++=   -.     .`     .:
 :     =  ...= . :.=- You should have received a copy of the GNU
 -.   .:....=;==+<; General Public License along with this file;
  -_. . .   )=.  = see the file COPYING. If not, write to the
    --        :-=` Free Software Foundation, Inc.,
59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include "light.h"
#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>
#include <qpushbutton.h>
#include <qgroupbox.h>
#include <qcombobox.h>
#include <opie/odevice.h>
#include "sensor.h"
using namespace Opie;
LightSettings::LightSettings( QWidget* parent, const char* name, WFlags )
: LightSettingsBase( parent, name, false, WStyle_ContextHelp )
{
m_bres = ODevice::inst ( )-> displayBrightnessResolution ( );
m_cres = ODevice::inst ( )-> displayContrastResolution ( );
// check whether to show the light sensor stuff
@@ -180,50 +181,49 @@ LightSettings::LightSettings( QWidget* parent, const char* name, WFlags )
else {
tabs-> setCurrentPage ( 1 );
}
connect ( brightness, SIGNAL( valueChanged ( int )), this, SLOT( setBacklight ( int )));
connect ( brightness_ac, SIGNAL( valueChanged ( int )), this, SLOT( setBacklight ( int )));
if (m_cres) {
connect ( contrast, SIGNAL( valueChanged ( int )), this, SLOT( setContrast ( int )));
connect ( contrast_ac, SIGNAL( valueChanged ( int )), this, SLOT( setContrast ( int )));
}
connect( frequency, SIGNAL( activated(int) ), this, SLOT( setFrequency(int) ) );
connect( frequency_ac, SIGNAL( activated(int) ), this, SLOT( setFrequency(int) ) );
connect( closeHingeAction, SIGNAL( activated(int) ), this, SLOT( setCloseHingeAction(int) ) );
connect( closeHingeAction_ac, SIGNAL( activated(int) ), this, SLOT( setCloseHingeAction(int) ) );
}
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 );
connect ( s, SIGNAL( viewBacklight ( int )), this, SLOT( setBacklight ( int )));
s-> showMaximized ( );
s-> exec ( );
delete s;
}
void LightSettings::setBacklight ( int bright )
{
QCopEnvelope e ( "QPE/System", "setBacklight(int)" );
e << bright;
if ( bright != -1 ) {
m_resettimer-> stop ( );
m_resettimer-> start ( 4000, true );
}
}
void LightSettings::setContrast ( int contr )