summaryrefslogtreecommitdiff
authorar <ar>2004-02-07 23:52:31 (UTC)
committer ar <ar>2004-02-07 23:52:31 (UTC)
commit6582895befc98131430710191238a93b9dde161c (patch) (unidiff)
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 @@
23 23
24#include "signal.h" 24#include "signal.h"
25 25
26#include <qpe/resource.h> 26#include <qpe/resource.h>
27 27
28#include <qdir.h> 28#include <qdir.h>
29#include <qevent.h> 29#include <qevent.h>
30#include <qdragobject.h> 30#include <qdragobject.h>
31#include <qobjectlist.h> 31#include <qobjectlist.h>
32#include <qtoolbutton.h> 32#include <qtoolbutton.h>
33#include <qtoolbar.h> 33#include <qtoolbar.h>
34#include <qpushbutton.h> 34#include <qpushbutton.h>
35#include <qfontdialog.h> 35#include <qfontdialog.h>
36#include <qglobal.h> 36#include <qglobal.h>
37#include <qpainter.h> 37#include <qpainter.h>
38#include <qmenubar.h> 38#include <qmenubar.h>
39#include <qmessagebox.h> 39#include <qmessagebox.h>
40#include <qaction.h> 40#include <qaction.h>
41#include <qapplication.h> 41#include <qapplication.h>
42#include <qfontmetrics.h> 42#include <qfontmetrics.h>
43#include <qcombobox.h> 43#include <qcombobox.h>
44#include <qevent.h> 44#include <qevent.h>
45#include <qtabwidget.h> 45#include <qtabwidget.h>
46#include <qtabbar.h> 46#include <qtabbar.h>
47#include <qpe/config.h>
48#include <qstringlist.h> 47#include <qstringlist.h>
49#include <qpalette.h> 48#include <qpalette.h>
49#include <qpe/config.h>
50#include <qpe/qpeapplication.h>
50 51
51#include <unistd.h> 52#include <unistd.h>
52#include <pwd.h> 53#include <pwd.h>
53#include <sys/types.h> 54#include <sys/types.h>
54//#include <sys/wait.h> 55//#include <sys/wait.h>
55#include <stdio.h> 56#include <stdio.h>
56#include <stdlib.h> 57#include <stdlib.h>
57#include <assert.h> 58#include <assert.h>
58 59
59#include "konsole.h" 60#include "konsole.h"
60#include "keytrans.h" 61#include "keytrans.h"
61#include "commandeditdialog.h" 62#include "commandeditdialog.h"
62 63
63#ifdef QT_QWS_OPIE 64#ifdef QT_QWS_OPIE
64#include <opie/colorpopupmenu.h> 65#include <opie/colorpopupmenu.h>
65#endif 66#endif
66 67
67 #include <qfontdatabase.h>// U.B. 68 #include <qfontdatabase.h>// U.B.
68 #include <qstringlist.h>// U.B. 69 #include <qstringlist.h>// U.B.
69 #include <qvaluelist.h> // U.B. 70 #include <qvaluelist.h> // U.B.
70 71
71class EKNumTabBar : public QTabBar { 72class EKNumTabBar : public QTabBar {
72public: 73public:
73 void numberTabs() 74 void numberTabs()
@@ -1055,49 +1056,49 @@ void Konsole::editCommandListMenuSelected(int iD)
1055 commonCombo->setEditable( FALSE ); 1056 commonCombo->setEditable( FALSE );
1056 } 1057 }
1057 } 1058 }
1058 } 1059 }
1059 if( iD == -23) { 1060 if( iD == -23) {
1060 cfg.setGroup("Commands"); 1061 cfg.setGroup("Commands");
1061// qDebug("enableCommandEdit"); 1062// qDebug("enableCommandEdit");
1062 if( !configMenu->isItemChecked(iD) ) { 1063 if( !configMenu->isItemChecked(iD) ) {
1063 commonCombo->setEditable( TRUE ); 1064 commonCombo->setEditable( TRUE );
1064 configMenu->setItemChecked(iD,TRUE); 1065 configMenu->setItemChecked(iD,TRUE);
1065 commonCombo->setCurrentItem(0); 1066 commonCombo->setCurrentItem(0);
1066 cfg.writeEntry("EditEnabled","TRUE"); 1067 cfg.writeEntry("EditEnabled","TRUE");
1067 } else { 1068 } else {
1068 commonCombo->setEditable( FALSE ); 1069 commonCombo->setEditable( FALSE );
1069 configMenu->setItemChecked(iD,FALSE); 1070 configMenu->setItemChecked(iD,FALSE);
1070 cfg.writeEntry("EditEnabled","FALSE"); 1071 cfg.writeEntry("EditEnabled","FALSE");
1071 commonCombo->setFocusPolicy(QWidget::NoFocus); 1072 commonCombo->setFocusPolicy(QWidget::NoFocus);
1072 te->setFocus(); 1073 te->setFocus();
1073 } 1074 }
1074 } 1075 }
1075 if(iD == -24) { 1076 if(iD == -24) {
1076 // "edit commands" 1077 // "edit commands"
1077 CommandEditDialog *m = new CommandEditDialog(this); 1078 CommandEditDialog *m = new CommandEditDialog(this);
1078 connect(m,SIGNAL(commandsEdited()),this,SLOT(initCommandList())); 1079 connect(m,SIGNAL(commandsEdited()),this,SLOT(initCommandList()));
1079 m->showMaximized(); 1080 QPEApplication::showDialog( m );
1080 } 1081 }
1081 1082
1082} 1083}
1083 1084
1084// $QPEDIR/bin/qcop QPE/Application/embeddedkonsole 'setDocument(QString)' 'ssh -V' 1085// $QPEDIR/bin/qcop QPE/Application/embeddedkonsole 'setDocument(QString)' 'ssh -V'
1085void Konsole::setDocument( const QString &cmd) { 1086void Konsole::setDocument( const QString &cmd) {
1086 newSession(); 1087 newSession();
1087 TEWidget* te = getTe(); 1088 TEWidget* te = getTe();
1088 if(cmd.find("-e", 0, TRUE) != -1) { 1089 if(cmd.find("-e", 0, TRUE) != -1) {
1089 QString cmd2; 1090 QString cmd2;
1090 cmd2=cmd.right(cmd.length()-3)+" &"; 1091 cmd2=cmd.right(cmd.length()-3)+" &";
1091 system(cmd2.latin1()); 1092 system(cmd2.latin1());
1092 if(startUp <= 1 && nsessions < 2) { 1093 if(startUp <= 1 && nsessions < 2) {
1093 doneSession(getTe()->currentSession, 0); 1094 doneSession(getTe()->currentSession, 0);
1094 exit(0); 1095 exit(0);
1095 } else 1096 } else
1096 doneSession(getTe()->currentSession, 0); 1097 doneSession(getTe()->currentSession, 0);
1097 } else { 1098 } else {
1098 if (te != 0) { 1099 if (te != 0) {
1099 te->emitText(cmd+"\r"); 1100 te->emitText(cmd+"\r");
1100 } 1101 }
1101 } 1102 }
1102 startUp++; 1103 startUp++;
1103} 1104}
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() {
921 currentFileName=fi.fileName(); 921 currentFileName=fi.fileName();
922 if(doc) 922 if(doc)
923// QString file = doc->file(); 923// QString file = doc->file();
924// doc->removeFiles(); 924// doc->removeFiles();
925 delete doc; 925 delete doc;
926 DocLnk nf; 926 DocLnk nf;
927 nf.setType("text/plain"); 927 nf.setType("text/plain");
928 nf.setFile( fileNm); 928 nf.setFile( fileNm);
929 doc = new DocLnk(nf); 929 doc = new DocLnk(nf);
930// editor->setText(rt); 930// editor->setText(rt);
931 qDebug("Saving file as "+currentFileName); 931 qDebug("Saving file as "+currentFileName);
932 doc->setName( currentFileName); 932 doc->setName( currentFileName);
933 updateCaption( currentFileName); 933 updateCaption( currentFileName);
934 934
935 FileManager fm; 935 FileManager fm;
936 if ( !fm.saveFile( *doc, rt ) ) { 936 if ( !fm.saveFile( *doc, rt ) ) {
937 return false; 937 return false;
938 } 938 }
939 939
940 if( filePerms ) { 940 if( filePerms ) {
941 filePermissions *filePerm; 941 filePermissions *filePerm;
942 filePerm = new filePermissions(this, 942 filePerm = new filePermissions(this,
943 tr("Permissions"),true, 943 tr("Permissions"),true,
944 0,(const QString &)fileNm); 944 0,(const QString &)fileNm);
945 filePerm->showMaximized(); 945 QPEApplication::execDialog( filePerm );
946 filePerm->exec();
947 946
948 if( filePerm) 947 if( filePerm)
949 delete filePerm; 948 delete filePerm;
950 } 949 }
951// } 950// }
952 editor->setEdited( false); 951 editor->setEdited( false);
953 edited1 = false; 952 edited1 = false;
954 edited = false; 953 edited = false;
955 if(caption().left(1)=="*") 954 if(caption().left(1)=="*")
956 setCaption(caption().right(caption().length()-1)); 955 setCaption(caption().right(caption().length()-1));
957 956
958 return true; 957 return true;
959 } 958 }
960 qDebug("returning false"); 959 qDebug("returning false");
961 return false; 960 return false;
962} //end saveAs 961} //end saveAs
963 962
964void TextEdit::clear() { 963void TextEdit::clear() {
965 delete doc; 964 delete doc;
966 doc = 0; 965 doc = 0;
967 editor->clear(); 966 editor->clear();
968} 967}
969 968
970void TextEdit::updateCaption( const QString &name ) { 969void TextEdit::updateCaption( const QString &name ) {
@@ -995,50 +994,49 @@ void TextEdit::setDocument(const QString& fileref) {
995 openDotFile(currentFileName); 994 openDotFile(currentFileName);
996 995
997 } else { 996 } else {
998 qDebug("setDoc open"); 997 qDebug("setDoc open");
999 bFromDocView = true; 998 bFromDocView = true;
1000 openFile(fileref); 999 openFile(fileref);
1001 editor->setEdited(true); 1000 editor->setEdited(true);
1002 edited1=false; 1001 edited1=false;
1003 edited=true; 1002 edited=true;
1004 // fromSetDocument=false; 1003 // fromSetDocument=false;
1005 // doSearchBar(); 1004 // doSearchBar();
1006 } 1005 }
1007 } 1006 }
1008 updateCaption( currentFileName); 1007 updateCaption( currentFileName);
1009} 1008}
1010 1009
1011void TextEdit::changeFont() { 1010void TextEdit::changeFont() {
1012 QDialog *d = new QDialog ( this, "FontDialog", true ); 1011 QDialog *d = new QDialog ( this, "FontDialog", true );
1013 d-> setCaption ( tr( "Choose font" )); 1012 d-> setCaption ( tr( "Choose font" ));
1014 QBoxLayout *lay = new QVBoxLayout ( d ); 1013 QBoxLayout *lay = new QVBoxLayout ( d );
1015 OFontSelector *ofs = new OFontSelector ( true, d ); 1014 OFontSelector *ofs = new OFontSelector ( true, d );
1016 lay-> addWidget ( ofs ); 1015 lay-> addWidget ( ofs );
1017 ofs-> setSelectedFont ( editor-> font ( )); 1016 ofs-> setSelectedFont ( editor-> font ( ));
1018 1017
1019 d-> showMaximized ( ); 1018 if ( QPEApplication::execDialog( d ) == QDialog::Accepted )
1020 if ( d-> exec ( ) == QDialog::Accepted )
1021 editor-> setFont ( ofs-> selectedFont ( )); 1019 editor-> setFont ( ofs-> selectedFont ( ));
1022 delete d; 1020 delete d;
1023 1021
1024} 1022}
1025 1023
1026void TextEdit::editDelete() { 1024void TextEdit::editDelete() {
1027 switch ( QMessageBox::warning(this,tr("Text Editor"), 1025 switch ( QMessageBox::warning(this,tr("Text Editor"),
1028 tr("Do you really want<BR>to <B>delete</B> " 1026 tr("Do you really want<BR>to <B>delete</B> "
1029 "the current file\nfrom the disk?<BR>This is " 1027 "the current file\nfrom the disk?<BR>This is "
1030 "<B>irreversable!</B>"), 1028 "<B>irreversable!</B>"),
1031 tr("Yes"),tr("No"),0,0,1) ) { 1029 tr("Yes"),tr("No"),0,0,1) ) {
1032 case 0: 1030 case 0:
1033 if(doc) { 1031 if(doc) {
1034 doc->removeFiles(); 1032 doc->removeFiles();
1035 clear(); 1033 clear();
1036 setCaption( tr("Text Editor") ); 1034 setCaption( tr("Text Editor") );
1037 } 1035 }
1038 break; 1036 break;
1039 case 1: 1037 case 1:
1040 // exit 1038 // exit
1041 break; 1039 break;
1042 }; 1040 };
1043} 1041}
1044 1042
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
928 // m.insertItem( tr( "Properties" ), this, SLOT( listDelete() )); 928 // m.insertItem( tr( "Properties" ), this, SLOT( listDelete() ));
929 m.exec( QCursor::pos() ); 929 m.exec( QCursor::pos() );
930 } 930 }
931 break; 931 break;
932 }; 932 };
933 933
934} 934}
935 935
936void PlayListWidget::listDelete() { 936void PlayListWidget::listDelete() {
937 Config cfg( "OpiePlayer" ); 937 Config cfg( "OpiePlayer" );
938 cfg.setGroup("PlayList"); 938 cfg.setGroup("PlayList");
939 currentPlayList = cfg.readEntry("CurrentPlaylist",""); 939 currentPlayList = cfg.readEntry("CurrentPlaylist","");
940 QString file; 940 QString file;
941 // int noOfFiles = cfg.readNumEntry("NumberOfFiles", 0 ); 941 // int noOfFiles = cfg.readNumEntry("NumberOfFiles", 0 );
942 switch ( tabWidget->currentPageIndex()) { 942 switch ( tabWidget->currentPageIndex()) {
943 case 0: 943 case 0:
944 break; 944 break;
945 case 1: 945 case 1:
946 { 946 {
947 file = audioView->currentItem()->text(0); 947 file = audioView->currentItem()->text(0);
948 QListIterator<DocLnk> Pdit( files.children() ); 948 QListIterator<DocLnk> Pdit( files.children() );
949 for ( ; Pdit.current(); ++Pdit ) { 949 for ( ; Pdit.current(); ++Pdit ) {
950 if( Pdit.current()->name() == file) { 950 if( Pdit.current()->name() == file) {
951 LnkProperties prop( Pdit.current() ); 951 LnkProperties prop( Pdit.current() );
952 prop.showMaximized(); 952 QPEApplication::execDialog( &prop );
953 prop.exec();
954 } 953 }
955 } 954 }
956 populateAudioView(); 955 populateAudioView();
957 } 956 }
958 break; 957 break;
959 case 2: 958 case 2:
960 { 959 {
961 // file = videoView->selectedItem()->text(0); 960 // file = videoView->selectedItem()->text(0);
962 // for ( int i = 0; i < noOfFiles; i++ ) { 961 // for ( int i = 0; i < noOfFiles; i++ ) {
963 // QString entryName; 962 // QString entryName;
964 // entryName.sprintf( "File%i", i + 1 ); 963 // entryName.sprintf( "File%i", i + 1 );
965 // QString linkFile = cfg.readEntry( entryName ); 964 // QString linkFile = cfg.readEntry( entryName );
966 // AppLnk lnk( AppLnk(linkFile)); 965 // AppLnk lnk( AppLnk(linkFile));
967 // if( lnk.name() == file ) { 966 // if( lnk.name() == file ) {
968 // LnkProperties prop( &lnk); 967 // LnkProperties prop( &lnk);
969 // // connect(&prop, SIGNAL(select(const AppLnk *)), this, SLOT(externalSelected(const AppLnk *))); 968 // // connect(&prop, SIGNAL(select(const AppLnk *)), this, SLOT(externalSelected(const AppLnk *)));
970 // prop.showMaximized(); 969 // prop.showMaximized();
971 // prop.exec(); 970 // prop.exec();
972 // } 971 // }
973 // } 972 // }
974 } 973 }
975 break; 974 break;
976 }; 975 };
977} 976}
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()
509 ent.setBirthday( it.current()->text() ); 509 ent.setBirthday( it.current()->text() );
510 break; 510 break;
511 case Qtopia::Anniversary: 511 case Qtopia::Anniversary:
512 ent.setAnniversary( it.current()->text() ); 512 ent.setAnniversary( it.current()->text() );
513 break; 513 break;
514 case Qtopia::Nickname: 514 case Qtopia::Nickname:
515 ent.setNickname( it.current()->text() ); 515 ent.setNickname( it.current()->text() );
516 break; 516 break;
517 default: 517 default:
518 break; 518 break;
519 519
520 } 520 }
521 } 521 }
522 522
523 int gender = genderCombo->currentItem(); 523 int gender = genderCombo->currentItem();
524 ent.setGender( QString::number( gender ) ); 524 ent.setGender( QString::number( gender ) );
525 525
526 QString str = txtNote->text(); 526 QString str = txtNote->text();
527 if ( !str.isNull() ) 527 if ( !str.isNull() )
528 ent.setNotes( str ); 528 ent.setNotes( str );
529} 529}
530 530
531void AbEditor::slotNote() 531void AbEditor::slotNote()
532{ 532{
533 dlgNote->showMaximized(); 533 if ( ! QPEApplication::execDialog( &dlgNote ) ) {
534 if ( !dlgNote->exec() ) {
535 // reset the note... 534 // reset the note...
536 txtNote->setText( ent.notes() ); 535 txtNote->setText( ent.notes() );
537 } 536 }
538} 537}
539 538
540void AbEditor::setNameFocus() 539void AbEditor::setNameFocus()
541{ 540{
542 firstEdit->setFocus(); 541 firstEdit->setFocus();
543} 542}
544 543
545void parseEmailFrom( const QString &txt, QString &strDefaultEmail, 544void parseEmailFrom( const QString &txt, QString &strDefaultEmail,
546 QString &strAll ) 545 QString &strAll )
547{ 546{
548 int where, 547 int where,
549 start; 548 start;
550 if ( txt.isEmpty() ) 549 if ( txt.isEmpty() )
551 return; 550 return;
552 551
553 // find the first 552 // find the first
554 where = txt.find( ',' ); 553 where = txt.find( ',' );
555 if ( where < 0 ) { 554 if ( where < 0 ) {
556 strDefaultEmail = txt; 555 strDefaultEmail = txt;
557 strAll = txt; 556 strAll = txt;
558 } else { 557 } 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,
261 populateCategories(); 261 populateCategories();
262 262
263 // Fontsize 263 // Fontsize
264 defaultFont = new QFont( m_abView->font() ); 264 defaultFont = new QFont( m_abView->font() );
265 slotSetFont(m_config.fontSize()); 265 slotSetFont(m_config.fontSize());
266 m_curFontSize = m_config.fontSize(); 266 m_curFontSize = m_config.fontSize();
267 267
268 setCentralWidget(listContainer); 268 setCentralWidget(listContainer);
269 269
270 // qDebug("adressbook contrsuction: t=%d", t.elapsed() ); 270 // qDebug("adressbook contrsuction: t=%d", t.elapsed() );
271 connect( qApp, SIGNAL( flush() ), this, SLOT( flush() ) ); 271 connect( qApp, SIGNAL( flush() ), this, SLOT( flush() ) );
272 connect( qApp, SIGNAL( reload() ), this, SLOT( reload() ) ); 272 connect( qApp, SIGNAL( reload() ), this, SLOT( reload() ) );
273 connect( qApp, SIGNAL( appMessage(const QCString &, const QByteArray &) ), 273 connect( qApp, SIGNAL( appMessage(const QCString &, const QByteArray &) ),
274 this, SLOT( appMessage(const QCString &, const QByteArray &) ) ); 274 this, SLOT( appMessage(const QCString &, const QByteArray &) ) );
275 275
276 276
277 isLoading = false; 277 isLoading = false;
278} 278}
279 279
280 280
281void AddressbookWindow::slotConfig() 281void AddressbookWindow::slotConfig()
282{ 282{
283 ConfigDlg* dlg = new ConfigDlg( this, "Config" ); 283 ConfigDlg* dlg = new ConfigDlg( this, "Config" );
284 dlg -> setConfig( m_config ); 284 dlg -> setConfig( m_config );
285 dlg -> showMaximized(); 285 if ( QPEApplication::execDialog( dlg ) ) {
286 if ( dlg -> exec() ) {
287 qWarning ("Config Dialog accepted!"); 286 qWarning ("Config Dialog accepted!");
288 m_config = dlg -> getConfig(); 287 m_config = dlg -> getConfig();
289 if ( m_curFontSize != m_config.fontSize() ){ 288 if ( m_curFontSize != m_config.fontSize() ){
290 qWarning("Font was changed!"); 289 qWarning("Font was changed!");
291 m_curFontSize = m_config.fontSize(); 290 m_curFontSize = m_config.fontSize();
292 emit slotSetFont( m_curFontSize ); 291 emit slotSetFont( m_curFontSize );
293 } 292 }
294 m_abView -> setListOrder( m_config.orderList() ); 293 m_abView -> setListOrder( m_config.orderList() );
295 } 294 }
296 295
297 delete dlg; 296 delete dlg;
298} 297}
299 298
300 299
301void AddressbookWindow::slotSetFont( int size ) 300void AddressbookWindow::slotSetFont( int size )
302{ 301{
303 qWarning("void AddressbookWindow::slotSetFont( %d )", size); 302 qWarning("void AddressbookWindow::slotSetFont( %d )", size);
304 303
305 if (size > 2 || size < 0) 304 if (size > 2 || size < 0)
306 size = 1; 305 size = 1;
307 306
308 m_config.setFontSize( size ); 307 m_config.setFontSize( size );
309 308
310 QFont *currentFont; 309 QFont *currentFont;
@@ -729,54 +728,51 @@ void AddressbookWindow::appMessage(const QCString &msg, const QByteArray &data)
729 // Reset category and edit.. 728 // Reset category and edit..
730 m_abView -> setShowByCategory( QString::null ); 729 m_abView -> setShowByCategory( QString::null );
731 m_abView -> setCurrentUid( uid ); 730 m_abView -> setCurrentUid( uid );
732 slotViewEdit(); 731 slotViewEdit();
733 } 732 }
734 733
735 if (needShow) 734 if (needShow)
736 QPEApplication::setKeepRunning(); 735 QPEApplication::setKeepRunning();
737 736
738} 737}
739 738
740void AddressbookWindow::editEntry( EntryMode entryMode ) 739void AddressbookWindow::editEntry( EntryMode entryMode )
741{ 740{
742 OContact entry; 741 OContact entry;
743 if ( !abEditor ) { 742 if ( !abEditor ) {
744 abEditor = new ContactEditor( entry, this, "editor" ); 743 abEditor = new ContactEditor( entry, this, "editor" );
745 } 744 }
746 if ( entryMode == EditEntry ) 745 if ( entryMode == EditEntry )
747 abEditor->setEntry( m_abView -> currentEntry() ); 746 abEditor->setEntry( m_abView -> currentEntry() );
748 else if ( entryMode == NewEntry ) 747 else if ( entryMode == NewEntry )
749 abEditor->setEntry( entry ); 748 abEditor->setEntry( entry );
750 // other things may change the caption. 749 // other things may change the caption.
751 abEditor->setCaption( tr("Edit Address") ); 750 abEditor->setCaption( tr("Edit Address") );
752 751
753#if defined(Q_WS_QWS) || defined(_WS_QWS_)
754 abEditor->showMaximized();
755#endif
756 // fix the foxus... 752 // fix the foxus...
757 abEditor->setNameFocus(); 753 abEditor->setNameFocus();
758 if ( abEditor->exec() ) { 754 if ( QPEApplication::execDialog( abEditor ) ) {
759 setFocus(); 755 setFocus();
760 if ( entryMode == NewEntry ) { 756 if ( entryMode == NewEntry ) {
761 OContact insertEntry = abEditor->entry(); 757 OContact insertEntry = abEditor->entry();
762 insertEntry.assignUid(); 758 insertEntry.assignUid();
763 m_abView -> addEntry( insertEntry ); 759 m_abView -> addEntry( insertEntry );
764 m_abView -> setCurrentUid( insertEntry.uid() ); 760 m_abView -> setCurrentUid( insertEntry.uid() );
765 } else { 761 } else {
766 OContact replEntry = abEditor->entry(); 762 OContact replEntry = abEditor->entry();
767 763
768 if ( !replEntry.isValidUid() ) 764 if ( !replEntry.isValidUid() )
769 replEntry.assignUid(); 765 replEntry.assignUid();
770 766
771 m_abView -> replaceEntry( replEntry ); 767 m_abView -> replaceEntry( replEntry );
772 } 768 }
773 } 769 }
774 // populateCategories(); 770 // populateCategories();
775 771
776} 772}
777 773
778void AddressbookWindow::editPersonal() 774void AddressbookWindow::editPersonal()
779{ 775{
780 OContact entry; 776 OContact entry;
781 777
782 // Switch to personal view if not selected 778 // 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 ){
1062 qWarning( "ContactEditor::slotOrganizationChange( %s )", textChanged.latin1() ); 1062 qWarning( "ContactEditor::slotOrganizationChange( %s )", textChanged.latin1() );
1063 // Special handling for storing Companies: 1063 // Special handling for storing Companies:
1064 // If no Fullname is given, we store the Company-Name as lastname 1064 // If no Fullname is given, we store the Company-Name as lastname
1065 // to handle it like a person.. 1065 // to handle it like a person..
1066 if ( txtFullName->text() == txtOrganization->text().left( txtFullName->text().length() ) ) 1066 if ( txtFullName->text() == txtOrganization->text().left( txtFullName->text().length() ) )
1067 txtFullName->setText( textChanged ); 1067 txtFullName->setText( textChanged );
1068 1068
1069} 1069}
1070 1070
1071void ContactEditor::accept() { 1071void ContactEditor::accept() {
1072 1072
1073 if ( isEmpty() ) { 1073 if ( isEmpty() ) {
1074 cleanupFields(); 1074 cleanupFields();
1075 reject(); 1075 reject();
1076 } else { 1076 } else {
1077 saveEntry(); 1077 saveEntry();
1078 cleanupFields(); 1078 cleanupFields();
1079 QDialog::accept(); 1079 QDialog::accept();
1080 } 1080 }
1081 1081
1082} 1082}
1083 1083
1084void ContactEditor::slotNote() { 1084void ContactEditor::slotNote() {
1085 1085
1086 dlgNote->showMaximized(); 1086 if ( ! QPEApplication::execDialog( dlgNote ) ) {
1087 if ( !dlgNote->exec() ) {
1088 txtNote->setText( ent.notes() ); 1087 txtNote->setText( ent.notes() );
1089 } 1088 }
1090} 1089}
1091 1090
1092void ContactEditor::slotName() { 1091void ContactEditor::slotName() {
1093 1092
1094 QString tmpName; 1093 QString tmpName;
1095 1094
1096 txtFirstName->setText( parseName(txtFullName->text(), NAME_F) ); 1095 txtFirstName->setText( parseName(txtFullName->text(), NAME_F) );
1097 txtMiddleName->setText( parseName(txtFullName->text(), NAME_M) ); 1096 txtMiddleName->setText( parseName(txtFullName->text(), NAME_M) );
1098 txtLastName->setText( parseName(txtFullName->text(), NAME_L) ); 1097 txtLastName->setText( parseName(txtFullName->text(), NAME_L) );
1099 // txtSuffix->setText( parseName(txtFullName->text(), NAME_S) ); 1098 // txtSuffix->setText( parseName(txtFullName->text(), NAME_S) );
1100 1099
1101 dlgName->showMaximized(); 1100 if ( QPEApplication::execDialog( dlgName ) ) {
1102 if ( dlgName->exec() ) {
1103 if ( txtLastName->text().contains( ' ', TRUE ) ) 1101 if ( txtLastName->text().contains( ' ', TRUE ) )
1104 tmpName = txtLastName->text() + ", " + txtFirstName->text() + " " + txtMiddleName->text(); 1102 tmpName = txtLastName->text() + ", " + txtFirstName->text() + " " + txtMiddleName->text();
1105 else 1103 else
1106 tmpName = txtFirstName->text() + " " + txtMiddleName->text() + " " + txtLastName->text(); 1104 tmpName = txtFirstName->text() + " " + txtMiddleName->text() + " " + txtLastName->text();
1107 1105
1108 txtFullName->setText( tmpName.simplifyWhiteSpace() ); 1106 txtFullName->setText( tmpName.simplifyWhiteSpace() );
1109 slotFullNameChange( txtFullName->text() ); 1107 slotFullNameChange( txtFullName->text() );
1110 } 1108 }
1111 1109
1112} 1110}
1113 1111
1114void ContactEditor::setNameFocus() { 1112void ContactEditor::setNameFocus() {
1115 1113
1116 txtFullName->setFocus(); 1114 txtFullName->setFocus();
1117 1115
1118} 1116}
1119 1117
1120bool ContactEditor::isEmpty() { 1118bool ContactEditor::isEmpty() {
1121 // Test and see if the record should be saved. 1119 // Test and see if the record should be saved.
1122 // More strict than the original qtopia, needs name or fileas to save 1120 // More strict than the original qtopia, needs name or fileas to save
1123 1121
1124 QString t = txtFullName->text(); 1122 QString t = txtFullName->text();
1125 if ( !t.isEmpty() && containsAlphaNum( t ) ) 1123 if ( !t.isEmpty() && containsAlphaNum( t ) )
1126 return false; 1124 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()
244void DateBook::slotSettings() 244void DateBook::slotSettings()
245{ 245{
246 DateBookSettings frmSettings( ampm, this ); 246 DateBookSettings frmSettings( ampm, this );
247 frmSettings.setStartTime( startTime ); 247 frmSettings.setStartTime( startTime );
248 frmSettings.setAlarmPreset( aPreset, presetTime ); 248 frmSettings.setAlarmPreset( aPreset, presetTime );
249 frmSettings.setJumpToCurTime( bJumpToCurTime ); 249 frmSettings.setJumpToCurTime( bJumpToCurTime );
250 frmSettings.setRowStyle( rowStyle ); 250 frmSettings.setRowStyle( rowStyle );
251 frmSettings.comboDefaultView->setCurrentItem(defaultView-1); 251 frmSettings.comboDefaultView->setCurrentItem(defaultView-1);
252 frmSettings.comboWeekListView->setCurrentItem(weeklistviewconfig); 252 frmSettings.comboWeekListView->setCurrentItem(weeklistviewconfig);
253 253
254 bool found=false; 254 bool found=false;
255 for (int i=0; i<(frmSettings.comboLocation->count()); i++) { 255 for (int i=0; i<(frmSettings.comboLocation->count()); i++) {
256 if ( frmSettings.comboLocation->text(i) == defaultLocation ) { 256 if ( frmSettings.comboLocation->text(i) == defaultLocation ) {
257 frmSettings.comboLocation->setCurrentItem(i); 257 frmSettings.comboLocation->setCurrentItem(i);
258 found=true; 258 found=true;
259 break; 259 break;
260 } 260 }
261 } 261 }
262 if(!found) { 262 if(!found) {
263 frmSettings.comboLocation->insertItem(defaultLocation); 263 frmSettings.comboLocation->insertItem(defaultLocation);
264 frmSettings.comboLocation->setCurrentItem(frmSettings.comboLocation->count()-1); 264 frmSettings.comboLocation->setCurrentItem(frmSettings.comboLocation->count()-1);
265 } 265 }
266 frmSettings.comboCategory->setCategories(defaultCategories,"Calendar", tr("Calendar")); 266 frmSettings.comboCategory->setCategories(defaultCategories,"Calendar", tr("Calendar"));
267 267
268#if defined (Q_WS_QWS) || defined(_WS_QWS_) 268 if ( QPEApplication::execDialog( &frmSettings ) ) {
269 frmSettings.showMaximized();
270#endif
271
272 if ( frmSettings.exec() ) {
273
274 aPreset = frmSettings.alarmPreset(); 269 aPreset = frmSettings.alarmPreset();
275 presetTime = frmSettings.presetTime(); 270 presetTime = frmSettings.presetTime();
276 startTime = frmSettings.startTime(); 271 startTime = frmSettings.startTime();
277 bJumpToCurTime = frmSettings.jumpToCurTime(); 272 bJumpToCurTime = frmSettings.jumpToCurTime();
278 rowStyle = frmSettings.rowStyle(); 273 rowStyle = frmSettings.rowStyle();
279 defaultView=frmSettings.comboDefaultView->currentItem()+1; 274 defaultView=frmSettings.comboDefaultView->currentItem()+1;
280 weeklistviewconfig=frmSettings.comboWeekListView->currentItem(); 275 weeklistviewconfig=frmSettings.comboWeekListView->currentItem();
281 defaultLocation=frmSettings.comboLocation->currentText(); 276 defaultLocation=frmSettings.comboLocation->currentText();
282 defaultCategories=frmSettings.comboCategory->currentCategories(); 277 defaultCategories=frmSettings.comboCategory->currentCategories();
283 278
284 if ( dayView ) { 279 if ( dayView ) {
285 dayView->setStartViewTime( startTime ); 280 dayView->setStartViewTime( startTime );
286 dayView->setJumpToCurTime( bJumpToCurTime ); 281 dayView->setJumpToCurTime( bJumpToCurTime );
287 dayView->setRowStyle( rowStyle ); 282 dayView->setRowStyle( rowStyle );
288 } 283 }
289 if ( weekView ) { 284 if ( weekView ) {
290 weekView->setStartViewTime( startTime ); 285 weekView->setStartViewTime( startTime );
291 } 286 }
292 saveSettings(); 287 saveSettings();
293 288
294 // make the change obvious 289 // make the change obvious
295 if ( views->visibleWidget() ) { 290 if ( views->visibleWidget() ) {
296 if ( views->visibleWidget() == dayView ) 291 if ( views->visibleWidget() == dayView )
297 dayView->redraw(); 292 dayView->redraw();
@@ -416,101 +411,95 @@ void DateBook::duplicateEvent( const Event &e )
416{ 411{
417 qWarning("Hmmm..."); 412 qWarning("Hmmm...");
418 // Alot of code duplication, as this is almost like editEvent(); 413 // Alot of code duplication, as this is almost like editEvent();
419 if (syncing) { 414 if (syncing) {
420 QMessageBox::warning( this, tr("Calendar"), tr( "Can not edit data, currently syncing") ); 415 QMessageBox::warning( this, tr("Calendar"), tr( "Can not edit data, currently syncing") );
421 return; 416 return;
422 } 417 }
423 418
424 Event dupevent(e);// Make a duplicate. 419 Event dupevent(e);// Make a duplicate.
425 420
426 // workaround added for text input. 421 // workaround added for text input.
427 QDialog editDlg( this, 0, TRUE ); 422 QDialog editDlg( this, 0, TRUE );
428 DateEntry *entry; 423 DateEntry *entry;
429 editDlg.setCaption( tr("Duplicate Event") ); 424 editDlg.setCaption( tr("Duplicate Event") );
430 QVBoxLayout *vb = new QVBoxLayout( &editDlg ); 425 QVBoxLayout *vb = new QVBoxLayout( &editDlg );
431 QScrollView *sv = new QScrollView( &editDlg, "scrollview" ); 426 QScrollView *sv = new QScrollView( &editDlg, "scrollview" );
432 sv->setResizePolicy( QScrollView::AutoOneFit ); 427 sv->setResizePolicy( QScrollView::AutoOneFit );
433 // KLUDGE!!! 428 // KLUDGE!!!
434 sv->setHScrollBarMode( QScrollView::AlwaysOff ); 429 sv->setHScrollBarMode( QScrollView::AlwaysOff );
435 vb->addWidget( sv ); 430 vb->addWidget( sv );
436 entry = new DateEntry( onMonday, dupevent, ampm, &editDlg, "editor" ); 431 entry = new DateEntry( onMonday, dupevent, ampm, &editDlg, "editor" );
437 entry->timezone->setEnabled( FALSE ); 432 entry->timezone->setEnabled( FALSE );
438 sv->addChild( entry ); 433 sv->addChild( entry );
439 434
440#if defined(Q_WS_QWS) || defined(_WS_QWS_) 435 while ( QPEApplication::execDialog( &editDlg ) ) {
441 editDlg.showMaximized();
442#endif
443 while (editDlg.exec() ) {
444 Event newEv = entry->event(); 436 Event newEv = entry->event();
445 QString error = checkEvent(newEv); 437 QString error = checkEvent(newEv);
446 if (!error.isNull()) { 438 if (!error.isNull()) {
447 if (QMessageBox::warning(this, tr("error box"), error, tr("Fix it"), tr("Continue"), 0, 0, 1) == 0) 439 if (QMessageBox::warning(this, tr("error box"), error, tr("Fix it"), tr("Continue"), 0, 0, 1) == 0)
448 continue; 440 continue;
449 } 441 }
450 /* 442 /*
451 * The problem: 443 * The problem:
452 * DateBookDB does remove repeating events not by uid but by the time 444 * DateBookDB does remove repeating events not by uid but by the time
453 * the recurrence was created 445 * the recurrence was created
454 * so we need to update that time as well 446 * so we need to update that time as well
455 */ 447 */
456 Event::RepeatPattern rp = newEv.repeatPattern(); 448 Event::RepeatPattern rp = newEv.repeatPattern();
457 rp.createTime = ::time( NULL ); 449 rp.createTime = ::time( NULL );
458 newEv.setRepeat( TRUE, rp ); // has repeat and repeatPattern... 450 newEv.setRepeat( TRUE, rp ); // has repeat and repeatPattern...
459 if( newEv.uid() == e.uid() || !newEv.isValidUid() ) 451 if( newEv.uid() == e.uid() || !newEv.isValidUid() )
460 newEv.assignUid(); 452 newEv.assignUid();
461 453
462 db->addEvent(newEv); 454 db->addEvent(newEv);
463 emit newEvent(); 455 emit newEvent();
464 break; 456 break;
465 } 457 }
466} 458}
467 459
468void DateBook::editEvent( const Event &e ) 460void DateBook::editEvent( const Event &e )
469{ 461{
470 if (syncing) { 462 if (syncing) {
471 QMessageBox::warning( this, tr("Calendar"), tr( "Can not edit data, currently syncing") ); 463 QMessageBox::warning( this, tr("Calendar"), tr( "Can not edit data, currently syncing") );
472 return; 464 return;
473 } 465 }
474 466
475 // workaround added for text input. 467 // workaround added for text input.
476 QDialog editDlg( this, 0, TRUE ); 468 QDialog editDlg( this, 0, TRUE );
477 DateEntry *entry; 469 DateEntry *entry;
478 editDlg.setCaption( tr("Edit Event") ); 470 editDlg.setCaption( tr("Edit Event") );
479 QVBoxLayout *vb = new QVBoxLayout( &editDlg ); 471 QVBoxLayout *vb = new QVBoxLayout( &editDlg );
480 QScrollView *sv = new QScrollView( &editDlg, "scrollview" ); 472 QScrollView *sv = new QScrollView( &editDlg, "scrollview" );
481 sv->setResizePolicy( QScrollView::AutoOneFit ); 473 sv->setResizePolicy( QScrollView::AutoOneFit );
482 // KLUDGE!!! 474 // KLUDGE!!!
483 sv->setHScrollBarMode( QScrollView::AlwaysOff ); 475 sv->setHScrollBarMode( QScrollView::AlwaysOff );
484 vb->addWidget( sv ); 476 vb->addWidget( sv );
485 entry = new DateEntry( onMonday, e, ampm, &editDlg, "editor" ); 477 entry = new DateEntry( onMonday, e, ampm, &editDlg, "editor" );
486 entry->timezone->setEnabled( FALSE ); 478 entry->timezone->setEnabled( FALSE );
487 sv->addChild( entry ); 479 sv->addChild( entry );
488 480
489#if defined(Q_WS_QWS) || defined(_WS_QWS_) 481 while ( QPEApplication::execDialog( &editDlg ) ) {
490 editDlg.showMaximized();
491#endif
492 while (editDlg.exec() ) {
493 Event newEv = entry->event(); 482 Event newEv = entry->event();
494 if(newEv.description().isEmpty() && newEv.notes().isEmpty() ) 483 if(newEv.description().isEmpty() && newEv.notes().isEmpty() )
495 break; 484 break;
496 newEv.setUid(e.uid()); // FIXME: Hack not to clear uid 485 newEv.setUid(e.uid()); // FIXME: Hack not to clear uid
497 QString error = checkEvent(newEv); 486 QString error = checkEvent(newEv);
498 if (!error.isNull()) { 487 if (!error.isNull()) {
499 if (QMessageBox::warning(this, tr("error box"), error, tr("Fix it"), tr("Continue"), 0, 0, 1) == 0) continue; 488 if (QMessageBox::warning(this, tr("error box"), error, tr("Fix it"), tr("Continue"), 0, 0, 1) == 0) continue;
500 } 489 }
501 db->editEvent(e, newEv); 490 db->editEvent(e, newEv);
502 emit newEvent(); 491 emit newEvent();
503 break; 492 break;
504 } 493 }
505} 494}
506 495
507void DateBook::removeEvent( const Event &e ) 496void DateBook::removeEvent( const Event &e )
508{ 497{
509 if (syncing) { 498 if (syncing) {
510 QMessageBox::warning( this, tr("Calendar"), tr( "Can not edit data, currently syncing") ); 499 QMessageBox::warning( this, tr("Calendar"), tr( "Can not edit data, currently syncing") );
511 return; 500 return;
512 } 501 }
513 502
514 QString strName = e.description(); 503 QString strName = e.description();
515 504
516 if ( !QPEMessageBox::confirmDelete( this, tr( "Calendar" ),strName ) ) 505 if ( !QPEMessageBox::confirmDelete( this, tr( "Calendar" ),strName ) )
@@ -686,52 +675,49 @@ void DateBook::appMessage(const QCString& msg, const QByteArray& data)
686 + "<BR>" 675 + "<BR>"
687 + (*it).notes() + "</CENTER>"; 676 + (*it).notes() + "</CENTER>";
688 if ( (*it).event().alarmSound() != Event::Silent ) { 677 if ( (*it).event().alarmSound() != Event::Silent ) {
689 bSound = TRUE; 678 bSound = TRUE;
690 } 679 }
691 } 680 }
692 } 681 }
693 if ( found ) { 682 if ( found ) {
694 if ( bSound ) { 683 if ( bSound ) {
695 Sound::soundAlarm(); 684 Sound::soundAlarm();
696 alarmCounter = 0; 685 alarmCounter = 0;
697 stopTimer = startTimer( 5000 ); 686 stopTimer = startTimer( 5000 );
698 } 687 }
699 QDialog dlg( this, 0, TRUE ); 688 QDialog dlg( this, 0, TRUE );
700 QVBoxLayout *vb = new QVBoxLayout( &dlg ); 689 QVBoxLayout *vb = new QVBoxLayout( &dlg );
701 QScrollView *view = new QScrollView( &dlg, "scrollView"); 690 QScrollView *view = new QScrollView( &dlg, "scrollView");
702 view->setResizePolicy( QScrollView::AutoOneFit ); 691 view->setResizePolicy( QScrollView::AutoOneFit );
703 vb->addWidget( view ); 692 vb->addWidget( view );
704 QLabel *lblMsg = new QLabel( msg, &dlg ); 693 QLabel *lblMsg = new QLabel( msg, &dlg );
705 view->addChild( lblMsg ); 694 view->addChild( lblMsg );
706 QPushButton *cmdOk = new QPushButton( tr("OK"), &dlg ); 695 QPushButton *cmdOk = new QPushButton( tr("OK"), &dlg );
707 connect( cmdOk, SIGNAL(clicked()), &dlg, SLOT(accept()) ); 696 connect( cmdOk, SIGNAL(clicked()), &dlg, SLOT(accept()) );
708 vb->addWidget( cmdOk ); 697 vb->addWidget( cmdOk );
709 698
710#if defined(Q_WS_QWS) || defined(_WS_QWS_) 699 needShow = QPEApplication::execDialog( &dlg );
711 dlg.showMaximized();
712#endif
713 needShow = dlg.exec();
714 700
715 if ( bSound ) 701 if ( bSound )
716 killTimer( stopTimer ); 702 killTimer( stopTimer );
717 } 703 }
718 } 704 }
719 } else if ( msg == "nextView()" ) { 705 } else if ( msg == "nextView()" ) {
720 needShow = true; 706 needShow = true;
721 if ( !qApp-> activeWindow ( )) { 707 if ( !qApp-> activeWindow ( )) {
722 needShow = TRUE; 708 needShow = TRUE;
723 } else { 709 } else {
724 QWidget* cur = views->visibleWidget(); 710 QWidget* cur = views->visibleWidget();
725 if ( cur ) { 711 if ( cur ) {
726 if ( cur == dayView ) 712 if ( cur == dayView )
727 viewWeek(); 713 viewWeek();
728 else if ( cur == weekView ) 714 else if ( cur == weekView )
729 viewWeekLst(); 715 viewWeekLst();
730 else if ( cur == weekLstView ) 716 else if ( cur == weekLstView )
731 viewMonth(); 717 viewMonth();
732 else if ( cur == monthView ) 718 else if ( cur == monthView )
733 viewDay(); 719 viewDay();
734 needShow = TRUE; 720 needShow = TRUE;
735 } 721 }
736 } 722 }
737 } else if (msg == "editEvent(int)") { 723 } else if (msg == "editEvent(int)") {
@@ -881,52 +867,49 @@ void DateBook::slotNewEntry(const QDateTime &start, const QDateTime &end, const
881 sv->setResizePolicy( QScrollView::AutoOneFit ); 867 sv->setResizePolicy( QScrollView::AutoOneFit );
882 sv->setFrameStyle( QFrame::NoFrame ); 868 sv->setFrameStyle( QFrame::NoFrame );
883 sv->setHScrollBarMode( QScrollView::AlwaysOff ); 869 sv->setHScrollBarMode( QScrollView::AlwaysOff );
884 vb->addWidget( sv ); 870 vb->addWidget( sv );
885 871
886 Event ev; 872 Event ev;
887 ev.setDescription( str ); 873 ev.setDescription( str );
888 // When the new gui comes in, change this... 874 // When the new gui comes in, change this...
889 if(location==0) { 875 if(location==0) {
890 if(defaultLocation.isEmpty()) { 876 if(defaultLocation.isEmpty()) {
891 ev.setLocation(tr("(Unknown)")); 877 ev.setLocation(tr("(Unknown)"));
892 } else { 878 } else {
893 ev.setLocation( defaultLocation ); 879 ev.setLocation( defaultLocation );
894 } 880 }
895 } else { 881 } else {
896 ev.setLocation(location); 882 ev.setLocation(location);
897 } 883 }
898 ev.setCategories(defaultCategories); 884 ev.setCategories(defaultCategories);
899 ev.setStart( start ); 885 ev.setStart( start );
900 ev.setEnd( end ); 886 ev.setEnd( end );
901 887
902 e = new DateEntry( onMonday, ev, ampm, &newDlg ); 888 e = new DateEntry( onMonday, ev, ampm, &newDlg );
903 e->setAlarmEnabled( aPreset, presetTime, Event::Loud ); 889 e->setAlarmEnabled( aPreset, presetTime, Event::Loud );
904 sv->addChild( e ); 890 sv->addChild( e );
905#if defined(Q_WS_QWS) || defined(_WS_QWS_) 891 while ( QPEApplication::execDialog( &newDlg ) ) {
906 newDlg.showMaximized();
907#endif
908 while (newDlg.exec()) {
909 ev = e->event(); 892 ev = e->event();
910 ev.assignUid(); 893 ev.assignUid();
911 QString error = checkEvent( ev ); 894 QString error = checkEvent( ev );
912 if ( !error.isNull() ) { 895 if ( !error.isNull() ) {
913 if ( QMessageBox::warning( this, tr("Error!"), error, tr("Fix it"), tr("Continue"), 0, 0, 1 ) == 0 ) 896 if ( QMessageBox::warning( this, tr("Error!"), error, tr("Fix it"), tr("Continue"), 0, 0, 1 ) == 0 )
914 continue; 897 continue;
915 } 898 }
916 db->addEvent( ev ); 899 db->addEvent( ev );
917 emit newEvent(); 900 emit newEvent();
918 break; 901 break;
919 } 902 }
920} 903}
921 904
922void DateBook::setDocument( const QString &filename ) 905void DateBook::setDocument( const QString &filename )
923{ 906{
924 if ( filename.find(".vcs") != int(filename.length()) - 4 ) return; 907 if ( filename.find(".vcs") != int(filename.length()) - 4 ) return;
925 908
926 QValueList<Event> tl = Event::readVCalendar( filename ); 909 QValueList<Event> tl = Event::readVCalendar( filename );
927 for( QValueList<Event>::Iterator it = tl.begin(); it != tl.end(); ++it ) { 910 for( QValueList<Event>::Iterator it = tl.begin(); it != tl.end(); ++it ) {
928 db->addEvent( *it ); 911 db->addEvent( *it );
929 } 912 }
930} 913}
931 914
932static const char * beamfile = "/tmp/obex/event.vcs"; 915static 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()
228 comboEnd->installEventFilter( this ); 228 comboEnd->installEventFilter( this );
229 comboStart->installEventFilter( this ); 229 comboStart->installEventFilter( this );
230} 230}
231 231
232/* 232/*
233 * Destroys the object and frees any allocated resources 233 * Destroys the object and frees any allocated resources
234 */ 234 */
235DateEntry::~DateEntry() 235DateEntry::~DateEntry()
236{ 236{
237 // no need to delete child widgets, Qt does it all for us 237 // no need to delete child widgets, Qt does it all for us
238 //cout << "Del: " << comboStart->currentText() << endl; 238 //cout << "Del: " << comboStart->currentText() << endl;
239} 239}
240 240
241/* 241/*
242 * public slot 242 * public slot
243 */ 243 */
244 244
245void DateEntry::slotEditNote() { 245void DateEntry::slotEditNote() {
246 QString s; 246 QString s;
247 s = "<B>"+ TimeString::longDateString( startDate ) + "</B>"; 247 s = "<B>"+ TimeString::longDateString( startDate ) + "</B>";
248// s.sprintf("<B>%d/%d</B> ", startDate.day(), startDate.month()); 248// s.sprintf("<B>%d/%d</B> ", startDate.day(), startDate.month());
249 NoteEntry noteDlg(s+comboDescription->currentText(), noteStr, 249 NoteEntry noteDlg(s+comboDescription->currentText(), noteStr,
250 this,0,TRUE); 250 this,0,TRUE);
251 251
252#if defined(Q_WS_QWS) || defined(_WS_QWS_) 252 if ( QPEApplication::execDialog( &noteDlg ) ) {
253 noteDlg.showMaximized();
254#endif
255 if (noteDlg.exec() ) {
256 noteStr=noteDlg.note->text(); 253 noteStr=noteDlg.note->text();
257 } 254 }
258 255
259} 256}
260 257
261void DateEntry::endDateChanged( int y, int m, int d ) 258void DateEntry::endDateChanged( int y, int m, int d )
262{ 259{
263 endDate.setYMD( y, m, d ); 260 endDate.setYMD( y, m, d );
264 if ( endDate < startDate ) { 261 if ( endDate < startDate ) {
265 endDate = startDate; 262 endDate = startDate;
266 } 263 }
267 264
268 buttonEnd->setText( TimeString::shortDate( endDate ) ); 265 buttonEnd->setText( TimeString::shortDate( endDate ) );
269 266
270 endPicker->setDate( endDate.year(), endDate.month(), endDate.day() ); 267 endPicker->setDate( endDate.year(), endDate.month(), endDate.day() );
271} 268}
272 269
273static QTime parseTime( const QString& s, bool ampm ) 270static QTime parseTime( const QString& s, bool ampm )
274{ 271{
275 QTime tmpTime; 272 QTime tmpTime;
276 QStringList l = QStringList::split( ':', s ); 273 QStringList l = QStringList::split( ':', s );
277 int hour = l[0].toInt(); 274 int hour = l[0].toInt();
278 if ( ampm ) { 275 if ( ampm ) {
279 int i=0; 276 int i=0;
@@ -374,52 +371,49 @@ void DateEntry::startTimePicked( const QTime &t ) {
374 371
375/* 372/*
376 * public slot 373 * public slot
377 */ 374 */
378void DateEntry::typeChanged( const QString &s ) 375void DateEntry::typeChanged( const QString &s )
379{ 376{
380 bool b = s != "All Day"; 377 bool b = s != "All Day";
381 buttonStart->setEnabled( b ); 378 buttonStart->setEnabled( b );
382 comboStart->setEnabled( b ); 379 comboStart->setEnabled( b );
383 comboEnd->setEnabled( b ); 380 comboEnd->setEnabled( b );
384} 381}
385 382
386void DateEntry::slotRepeat() 383void DateEntry::slotRepeat()
387{ 384{
388 // Work around for compiler Bug.. 385 // Work around for compiler Bug..
389 RepeatEntry *e; 386 RepeatEntry *e;
390 387
391 // it is better in my opinion to just grab this from the mother, 388 // it is better in my opinion to just grab this from the mother,
392 // since, this dialog doesn't need to keep track of it... 389 // since, this dialog doesn't need to keep track of it...
393 if ( rp.type != Event::NoRepeat ) 390 if ( rp.type != Event::NoRepeat )
394 e = new RepeatEntry( startWeekOnMonday, rp, startDate, this); 391 e = new RepeatEntry( startWeekOnMonday, rp, startDate, this);
395 else 392 else
396 e = new RepeatEntry( startWeekOnMonday, startDate, this ); 393 e = new RepeatEntry( startWeekOnMonday, startDate, this );
397 394
398#if defined(Q_WS_QWS) || defined(_WS_QWS_) 395 if ( QPEApplication::execDialog( e ) ) {
399 e->showMaximized();
400#endif
401 if ( e->exec() ) {
402 rp = e->repeatPattern(); 396 rp = e->repeatPattern();
403 setRepeatLabel(); 397 setRepeatLabel();
404 } 398 }
405 // deleting sounds like a nice idea... 399 // deleting sounds like a nice idea...
406 delete e; 400 delete e;
407} 401}
408 402
409void DateEntry::slotChangeStartOfWeek( bool onMonday ) 403void DateEntry::slotChangeStartOfWeek( bool onMonday )
410{ 404{
411 startWeekOnMonday = onMonday; 405 startWeekOnMonday = onMonday;
412} 406}
413 407
414Event DateEntry::event() 408Event DateEntry::event()
415{ 409{
416 Event ev; 410 Event ev;
417 Event::SoundTypeChoice st; 411 Event::SoundTypeChoice st;
418 ev.setDescription( comboDescription->currentText() ); 412 ev.setDescription( comboDescription->currentText() );
419 ev.setLocation( comboLocation->currentText() ); 413 ev.setLocation( comboLocation->currentText() );
420 ev.setCategories( comboCategory->currentCategories() ); 414 ev.setCategories( comboCategory->currentCategories() );
421 ev.setType( checkAllDay->isChecked() ? Event::AllDay : Event::Normal ); 415 ev.setType( checkAllDay->isChecked() ? Event::AllDay : Event::Normal );
422 if ( startDate > endDate ) { 416 if ( startDate > endDate ) {
423 QDate tmp = endDate; 417 QDate tmp = endDate;
424 endDate = startDate; 418 endDate = startDate;
425 startDate = tmp; 419 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() {
208TemplateManager MainWindow::templateManager() { 208TemplateManager MainWindow::templateManager() {
209 return m_tempMan; 209 return m_tempMan;
210} 210}
211LocationManager MainWindow::locationManager() { 211LocationManager MainWindow::locationManager() {
212 return m_locMan; 212 return m_locMan;
213} 213}
214DescriptionManager MainWindow::descriptionManager() { 214DescriptionManager MainWindow::descriptionManager() {
215 return m_descMan; 215 return m_descMan;
216} 216}
217void MainWindow::setLocationManager( const LocationManager& loc) { 217void MainWindow::setLocationManager( const LocationManager& loc) {
218 m_locMan = loc; 218 m_locMan = loc;
219} 219}
220void MainWindow::setDescriptionManager( const DescriptionManager& dsc ) { 220void MainWindow::setDescriptionManager( const DescriptionManager& dsc ) {
221 m_descMan = dsc; 221 m_descMan = dsc;
222} 222}
223Show* MainWindow::eventShow() { 223Show* MainWindow::eventShow() {
224 return m_show; 224 return m_show;
225} 225}
226void MainWindow::slotAction( QAction* act ) { 226void MainWindow::slotAction( QAction* act ) {
227 227
228} 228}
229void MainWindow::slotConfigureLocs() { 229void MainWindow::slotConfigureLocs() {
230 LocationManagerDialog dlg( locationManager() ); 230 LocationManagerDialog dlg( locationManager() );
231 dlg.setCaption( tr("Configure Locations") ); 231 dlg.setCaption( tr("Configure Locations") );
232 dlg.showMaximized(); 232 if ( QPEApplication::execDialog( &dlg ) == QDialog::Accepted ) {
233 if (dlg.exec() == QDialog::Accepted ) {
234 setLocationManager( dlg.manager() ); 233 setLocationManager( dlg.manager() );
235 } 234 }
236} 235}
237void MainWindow::slotConfigureDesc() { 236void MainWindow::slotConfigureDesc() {
238 DescriptionManagerDialog dlg( descriptionManager() ); 237 DescriptionManagerDialog dlg( descriptionManager() );
239 dlg.setCaption( tr("Configure Descriptions") ); 238 dlg.setCaption( tr("Configure Descriptions") );
240 dlg.showMaximized(); 239 if ( QPEApplication::execDialog( &dlg ) == QDialog::Accepted ) {
241 if (dlg.exec() == QDialog::Accepted ) {
242 setDescriptionManager( dlg.manager() ); 240 setDescriptionManager( dlg.manager() );
243 } 241 }
244} 242}
245void MainWindow::slotConfigureTemp() { 243void MainWindow::slotConfigureTemp() {
246 TemplateDialog dlg( templateManager(), editor() ); 244 TemplateDialog dlg( templateManager(), editor() );
247 dlg.setCaption( tr("Configure Templates") ); 245 dlg.setCaption( tr("Configure Templates") );
248 dlg.showMaximized(); 246 if ( QPEApplication::execDialog( &dlg ) == QDialog::Accepted ) {
249 if ( dlg.exec() == QDialog::Accepted ) {
250 m_tempMan = dlg.manager(); 247 m_tempMan = dlg.manager();
251 setTemplateMenu(); 248 setTemplateMenu();
252 } 249 }
253} 250}
254void MainWindow::hideShow() { 251void MainWindow::hideShow() {
255 252
256} 253}
257void MainWindow::viewPopup(int ) { 254void MainWindow::viewPopup(int ) {
258 255
259} 256}
260void MainWindow::viewAdd(const QDate& ) { 257void MainWindow::viewAdd(const QDate& ) {
261 258
262} 259}
263void MainWindow::viewAdd( const QDateTime&, const QDateTime& ) { 260void MainWindow::viewAdd( const QDateTime&, const QDateTime& ) {
264 261
265} 262}
266bool MainWindow::viewAP()const{ 263bool MainWindow::viewAP()const{
267} 264}
268bool MainWindow::viewStartMonday()const { 265bool MainWindow::viewStartMonday()const {
269 266
270} 267}
271void MainWindow::setTemplateMenu() { 268void MainWindow::setTemplateMenu() {
272 m_popTemplate->clear(); 269 m_popTemplate->clear();
273 270
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 ) {
1007 bool loud = false; 1007 bool loud = false;
1008 OPimNotifyManager::Alarms als = todo.notifiers().alarms(); 1008 OPimNotifyManager::Alarms als = todo.notifiers().alarms();
1009 OPimNotifyManager::Alarms::Iterator it; 1009 OPimNotifyManager::Alarms::Iterator it;
1010 for ( it = als.begin(); it != als.end(); ++it ) { 1010 for ( it = als.begin(); it != als.end(); ++it ) {
1011 if ( (*it).dateTime() == dt ) { 1011 if ( (*it).dateTime() == dt ) {
1012 loud = ( (*it).sound() == OPimAlarm::Loud ); 1012 loud = ( (*it).sound() == OPimAlarm::Loud );
1013 break; 1013 break;
1014 } 1014 }
1015 } 1015 }
1016 if (loud) 1016 if (loud)
1017 startAlarm(); 1017 startAlarm();
1018 1018
1019 QDialog dlg(this, 0, TRUE ); 1019 QDialog dlg(this, 0, TRUE );
1020 QVBoxLayout* lay = new QVBoxLayout( &dlg ); 1020 QVBoxLayout* lay = new QVBoxLayout( &dlg );
1021 QTextView* view = new QTextView( &dlg ); 1021 QTextView* view = new QTextView( &dlg );
1022 lay->addWidget( view ); 1022 lay->addWidget( view );
1023 QPushButton* btnOk = new QPushButton( tr("Ok"), &dlg ); 1023 QPushButton* btnOk = new QPushButton( tr("Ok"), &dlg );
1024 connect( btnOk, SIGNAL(clicked() ), &dlg, SLOT(accept() ) ); 1024 connect( btnOk, SIGNAL(clicked() ), &dlg, SLOT(accept() ) );
1025 lay->addWidget( btnOk ); 1025 lay->addWidget( btnOk );
1026 1026
1027 QString text = tr("<h1>Alarm at %1</h1><br>").arg( TimeString::dateString( dt ) ); 1027 QString text = tr("<h1>Alarm at %1</h1><br>").arg( TimeString::dateString( dt ) );
1028 text += todo.toRichText(); 1028 text += todo.toRichText();
1029 view->setText( text ); 1029 view->setText( text );
1030 1030
1031 dlg.showMaximized(); 1031 bool needToStay = QPEApplication::execDialog( &dlg );
1032 bool needToStay = dlg.exec();
1033 1032
1034 if (loud) 1033 if (loud)
1035 killAlarm(); 1034 killAlarm();
1036 1035
1037 if (needToStay) { 1036 if (needToStay) {
1038// showMaximized(); 1037// showMaximized();
1039// raise(); 1038// raise();
1040 QPEApplication::setKeepRunning(); 1039 QPEApplication::setKeepRunning();
1041// setActiveWindow(); 1040// setActiveWindow();
1042 } 1041 }
1043 1042
1044} 1043}
1045 1044
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 @@
1 1
2#include <qpe/qpeapplication.h>
3
2#include "otaskeditor.h" 4#include "otaskeditor.h"
3#include "todoeditor.h" 5#include "todoeditor.h"
4 6
5using namespace Todo; 7using namespace Todo;
6 8
7Editor::Editor() { 9Editor::Editor() {
8 m_accepted = false; 10 m_accepted = false;
9 m_self = 0l; 11 m_self = 0l;
10} 12}
11Editor::~Editor() { 13Editor::~Editor() {
12 delete m_self; 14 delete m_self;
13 m_self = 0; 15 m_self = 0;
14} 16}
15OTodo Editor::newTodo( int cur, 17OTodo Editor::newTodo( int cur,
16 QWidget*) { 18 QWidget*) {
17 19
18 OTaskEditor *e = self(); 20 OTaskEditor *e = self();
19 e->setCaption( QObject::tr("Enter Task") ); 21 e->setCaption( QObject::tr("Enter Task") );
20 e->init( cur ); 22 e->init( cur );
21 23
24 int ret = QPEApplication::execDialog( e );
22 25
23 e->showMaximized();
24
25 int ret = e->exec();
26 if ( QDialog::Accepted == ret ) { 26 if ( QDialog::Accepted == ret ) {
27 m_accepted = true; 27 m_accepted = true;
28 }else 28 }else
29 m_accepted = false; 29 m_accepted = false;
30 30
31 OTodo ev = e->todo(); 31 OTodo ev = e->todo();
32 qWarning("Todo uid"); 32 qWarning("Todo uid");
33 qWarning("Todo %s %d %d", ev.summary().latin1(), ev.progress(), ev.isCompleted() ); 33 qWarning("Todo %s %d %d", ev.summary().latin1(), ev.progress(), ev.isCompleted() );
34 ev.setUid(1); 34 ev.setUid(1);
35 35
36 return ev; 36 return ev;
37} 37}
38OTodo Editor::edit( QWidget *, 38OTodo Editor::edit( QWidget *,
39 const OTodo& todo ) { 39 const OTodo& todo ) {
40 OTaskEditor *e = self(); 40 OTaskEditor *e = self();
41 e->init( todo ); 41 e->init( todo );
42 e->setCaption( QObject::tr( "Edit Task" ) ); 42 e->setCaption( QObject::tr( "Edit Task" ) );
43 43
44 e->showMaximized(); 44 int ret = QPEApplication::execDialog( e );
45 int ret = e->exec();
46 45
47 OTodo ev = e->todo(); 46 OTodo ev = e->todo();
48 if ( ret == QDialog::Accepted ) 47 if ( ret == QDialog::Accepted )
49 m_accepted = true; 48 m_accepted = true;
50 else 49 else
51 m_accepted = false; 50 m_accepted = false;
52 51
53 return ev; 52 return ev;
54} 53}
55bool Editor::accepted()const { 54bool Editor::accepted()const {
56 return m_accepted; 55 return m_accepted;
57} 56}
58OTaskEditor* Editor::self() { 57OTaskEditor* Editor::self() {
59 if (!m_self ) 58 if (!m_self )
60 m_self = new OTaskEditor(0); 59 m_self = new OTaskEditor(0);
61 60
62 return m_self; 61 return m_self;
63} 62}
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 @@
12    .%`+i>       _;_. 12    .%`+i>       _;_.
13    .i_,=:_.      -<s. This file is distributed in the hope that 13    .i_,=:_.      -<s. This file is distributed in the hope that
14     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 14     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
15    : ..    .:,     . . . without even the implied warranty of 15    : ..    .:,     . . . without even the implied warranty of
16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General 17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
18..}^=.=       =       ; Public License for more details. 18..}^=.=       =       ; Public License for more details.
19++=   -.     .`     .: 19++=   -.     .`     .:
20 :     =  ...= . :.=- You should have received a copy of the GNU 20 :     =  ...= . :.=- You should have received a copy of the GNU
21 -.   .:....=;==+<; General Public License along with this file; 21 -.   .:....=;==+<; General Public License along with this file;
22  -_. . .   )=.  = see the file COPYING. If not, write to the 22  -_. . .   )=.  = see the file COPYING. If not, write to the
23    --        :-=` Free Software Foundation, Inc., 23    --        :-=` Free Software Foundation, Inc.,
24 59 Temple Place - Suite 330, 24 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA. 25 Boston, MA 02111-1307, USA.
26 26
27*/ 27*/
28 28
29#include "light.h" 29#include "light.h"
30 30
31#include <qpe/config.h> 31#include <qpe/config.h>
32#include <qpe/power.h> 32#include <qpe/power.h>
33#if defined(Q_WS_QWS) && !defined(QT_NO_COP) 33#if defined(Q_WS_QWS) && !defined(QT_NO_COP)
34#include <qpe/qcopenvelope_qws.h> 34#include <qpe/qcopenvelope_qws.h>
35#endif 35#endif
36#include <qpe/qpeapplication.h>
36 37
37#include <qlabel.h> 38#include <qlabel.h>
38#include <qcheckbox.h> 39#include <qcheckbox.h>
39#include <qtabwidget.h> 40#include <qtabwidget.h>
40#include <qslider.h> 41#include <qslider.h>
41#include <qspinbox.h> 42#include <qspinbox.h>
42#include <qpushbutton.h> 43#include <qpushbutton.h>
43#include <qgroupbox.h> 44#include <qgroupbox.h>
44#include <qcombobox.h> 45#include <qcombobox.h>
45 46
46#include <opie/odevice.h> 47#include <opie/odevice.h>
47 48
48#include "sensor.h" 49#include "sensor.h"
49 50
50using namespace Opie; 51using namespace Opie;
51 52
52LightSettings::LightSettings( QWidget* parent, const char* name, WFlags ) 53LightSettings::LightSettings( QWidget* parent, const char* name, WFlags )
53 : LightSettingsBase( parent, name, false, WStyle_ContextHelp ) 54 : LightSettingsBase( parent, name, false, WStyle_ContextHelp )
54{ 55{
55 m_bres = ODevice::inst ( )-> displayBrightnessResolution ( ); 56 m_bres = ODevice::inst ( )-> displayBrightnessResolution ( );
56 m_cres = ODevice::inst ( )-> displayContrastResolution ( ); 57 m_cres = ODevice::inst ( )-> displayContrastResolution ( );
57 58
58 // check whether to show the light sensor stuff 59 // check whether to show the light sensor stuff
59 60
@@ -180,50 +181,49 @@ LightSettings::LightSettings( QWidget* parent, const char* name, WFlags )
180 else { 181 else {
181 tabs-> setCurrentPage ( 1 ); 182 tabs-> setCurrentPage ( 1 );
182 } 183 }
183 184
184 connect ( brightness, SIGNAL( valueChanged ( int )), this, SLOT( setBacklight ( int ))); 185 connect ( brightness, SIGNAL( valueChanged ( int )), this, SLOT( setBacklight ( int )));
185 connect ( brightness_ac, SIGNAL( valueChanged ( int )), this, SLOT( setBacklight ( int ))); 186 connect ( brightness_ac, SIGNAL( valueChanged ( int )), this, SLOT( setBacklight ( int )));
186 if (m_cres) { 187 if (m_cres) {
187 connect ( contrast, SIGNAL( valueChanged ( int )), this, SLOT( setContrast ( int ))); 188 connect ( contrast, SIGNAL( valueChanged ( int )), this, SLOT( setContrast ( int )));
188 connect ( contrast_ac, SIGNAL( valueChanged ( int )), this, SLOT( setContrast ( int ))); 189 connect ( contrast_ac, SIGNAL( valueChanged ( int )), this, SLOT( setContrast ( int )));
189 } 190 }
190 connect( frequency, SIGNAL( activated(int) ), this, SLOT( setFrequency(int) ) ); 191 connect( frequency, SIGNAL( activated(int) ), this, SLOT( setFrequency(int) ) );
191 connect( frequency_ac, SIGNAL( activated(int) ), this, SLOT( setFrequency(int) ) ); 192 connect( frequency_ac, SIGNAL( activated(int) ), this, SLOT( setFrequency(int) ) );
192 connect( closeHingeAction, SIGNAL( activated(int) ), this, SLOT( setCloseHingeAction(int) ) ); 193 connect( closeHingeAction, SIGNAL( activated(int) ), this, SLOT( setCloseHingeAction(int) ) );
193 connect( closeHingeAction_ac, SIGNAL( activated(int) ), this, SLOT( setCloseHingeAction(int) ) ); 194 connect( closeHingeAction_ac, SIGNAL( activated(int) ), this, SLOT( setCloseHingeAction(int) ) );
194} 195}
195 196
196LightSettings::~LightSettings ( ) 197LightSettings::~LightSettings ( )
197{ 198{
198} 199}
199 200
200void LightSettings::calibrateSensor ( ) 201void LightSettings::calibrateSensor ( )
201{ 202{
202 Sensor *s = new Sensor ( m_sensordata, this ); 203 Sensor *s = new Sensor ( m_sensordata, this );
203 connect ( s, SIGNAL( viewBacklight ( int )), this, SLOT( setBacklight ( int ))); 204 connect ( s, SIGNAL( viewBacklight ( int )), this, SLOT( setBacklight ( int )));
204 s-> showMaximized ( ); 205 QPEApplication::execDialog( s );
205 s-> exec ( );
206 delete s; 206 delete s;
207} 207}
208 208
209void LightSettings::calibrateSensorAC ( ) 209void LightSettings::calibrateSensorAC ( )
210{ 210{
211 Sensor *s = new Sensor ( m_sensordata_ac, this ); 211 Sensor *s = new Sensor ( m_sensordata_ac, this );
212 connect ( s, SIGNAL( viewBacklight ( int )), this, SLOT( setBacklight ( int ))); 212 connect ( s, SIGNAL( viewBacklight ( int )), this, SLOT( setBacklight ( int )));
213 s-> showMaximized ( ); 213 s-> showMaximized ( );
214 s-> exec ( ); 214 s-> exec ( );
215 delete s; 215 delete s;
216} 216}
217 217
218void LightSettings::setBacklight ( int bright ) 218void LightSettings::setBacklight ( int bright )
219{ 219{
220 QCopEnvelope e ( "QPE/System", "setBacklight(int)" ); 220 QCopEnvelope e ( "QPE/System", "setBacklight(int)" );
221 e << bright; 221 e << bright;
222 222
223 if ( bright != -1 ) { 223 if ( bright != -1 ) {
224 m_resettimer-> stop ( ); 224 m_resettimer-> stop ( );
225 m_resettimer-> start ( 4000, true ); 225 m_resettimer-> start ( 4000, true );
226 } 226 }
227} 227}
228 228
229void LightSettings::setContrast ( int contr ) 229void LightSettings::setContrast ( int contr )