summaryrefslogtreecommitdiff
path: root/core/pim/todo
authorar <ar>2004-02-07 23:52:31 (UTC)
committer ar <ar>2004-02-07 23:52:31 (UTC)
commit6582895befc98131430710191238a93b9dde161c (patch) (unidiff)
treed050483742d0e102e08138bcdd8f170a9558b12d /core/pim/todo
parent3f261fa6eac46b8d0d4ac8b8bb95b385435004da (diff)
downloadopie-6582895befc98131430710191238a93b9dde161c.zip
opie-6582895befc98131430710191238a93b9dde161c.tar.gz
opie-6582895befc98131430710191238a93b9dde161c.tar.bz2
QPEApplication::showDialog() and QPEAPplication::execDialog() for better big screen handling
Diffstat (limited to 'core/pim/todo') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/todo/mainwindow.cpp3
-rw-r--r--core/pim/todo/todoeditor.cpp9
2 files changed, 5 insertions, 7 deletions
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
@@ -1019,26 +1019,25 @@ void MainWindow::doAlarm( const QDateTime& dt, int uid ) {
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}
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,57 +1,56 @@
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}