author | zecke <zecke> | 2002-06-17 13:47:54 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-06-17 13:47:54 (UTC) |
commit | 77ec78630c69c80a3d8bad7f7feb9cc9f18ab346 (patch) (unidiff) | |
tree | e8dca2e2fe6bae5fc814758f5edc8c0f66528a79 | |
parent | 282007e58a8a038a0db042341528510e73ac80fc (diff) | |
download | opie-77ec78630c69c80a3d8bad7f7feb9cc9f18ab346.zip opie-77ec78630c69c80a3d8bad7f7feb9cc9f18ab346.tar.gz opie-77ec78630c69c80a3d8bad7f7feb9cc9f18ab346.tar.bz2 |
fix overlapping
-rw-r--r-- | core/pim/todo/mainwindow.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/core/pim/todo/mainwindow.cpp b/core/pim/todo/mainwindow.cpp index 1358f1c..fa9c221 100644 --- a/core/pim/todo/mainwindow.cpp +++ b/core/pim/todo/mainwindow.cpp | |||
@@ -1,205 +1,206 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. |
3 | ** Copyright (C) 2002 zecke | 3 | ** Copyright (C) 2002 zecke |
4 | ** Copyright (C) 2002 Stefan Eilers (se, eilers.stefan@epost.de) | 4 | ** Copyright (C) 2002 Stefan Eilers (se, eilers.stefan@epost.de) |
5 | ** | 5 | ** |
6 | ** This file is part of Qtopia Environment. | 6 | ** This file is part of Qtopia Environment. |
7 | ** | 7 | ** |
8 | ** This file may be distributed and/or modified under the terms of the | 8 | ** This file may be distributed and/or modified under the terms of the |
9 | ** GNU General Public License version 2 as published by the Free Software | 9 | ** GNU General Public License version 2 as published by the Free Software |
10 | ** Foundation and appearing in the file LICENSE.GPL included in the | 10 | ** Foundation and appearing in the file LICENSE.GPL included in the |
11 | ** packaging of this file. | 11 | ** packaging of this file. |
12 | ** | 12 | ** |
13 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 13 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
14 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 14 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
15 | ** | 15 | ** |
16 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 16 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
17 | ** | 17 | ** |
18 | ** Contact info@trolltech.com if any conditions of this licensing are | 18 | ** Contact info@trolltech.com if any conditions of this licensing are |
19 | ** not clear to you. | 19 | ** not clear to you. |
20 | ** | 20 | ** |
21 | **********************************************************************/ | 21 | **********************************************************************/ |
22 | 22 | ||
23 | #define QTOPIA_INTERNAL_FD | 23 | #define QTOPIA_INTERNAL_FD |
24 | 24 | ||
25 | #include "mainwindow.h" | 25 | #include "mainwindow.h" |
26 | #include "todoentryimpl.h" | 26 | #include "todoentryimpl.h" |
27 | #include "todotable.h" | 27 | #include "todotable.h" |
28 | #include "todolabel.h" | 28 | #include "todolabel.h" |
29 | 29 | ||
30 | #include <opie/tododb.h> | 30 | #include <opie/tododb.h> |
31 | #include <opie/todovcalresource.h> | 31 | #include <opie/todovcalresource.h> |
32 | #include <opie/ofontmenu.h> | 32 | #include <opie/ofontmenu.h> |
33 | 33 | ||
34 | #include <qpe/qpeapplication.h> | 34 | #include <qpe/qpeapplication.h> |
35 | #include <qpe/config.h> | 35 | #include <qpe/config.h> |
36 | #include <qpe/finddialog.h> | 36 | #include <qpe/finddialog.h> |
37 | #include <qpe/global.h> | 37 | #include <qpe/global.h> |
38 | #include <qpe/ir.h> | 38 | #include <qpe/ir.h> |
39 | #include <qpe/qpemenubar.h> | 39 | #include <qpe/qpemenubar.h> |
40 | #include <qpe/qpemessagebox.h> | 40 | #include <qpe/qpemessagebox.h> |
41 | #include <qpe/resource.h> | 41 | #include <qpe/resource.h> |
42 | //#include <qpe/task.h> | 42 | //#include <qpe/task.h> |
43 | #include <qpe/qpetoolbar.h> | 43 | #include <qpe/qpetoolbar.h> |
44 | 44 | ||
45 | #include <qaction.h> | 45 | #include <qaction.h> |
46 | #include <qarray.h> | 46 | #include <qarray.h> |
47 | #include <qdatastream.h> | 47 | #include <qdatastream.h> |
48 | #include <qdatetime.h> | 48 | #include <qdatetime.h> |
49 | #include <qfile.h> | 49 | #include <qfile.h> |
50 | #include <qmessagebox.h> | 50 | #include <qmessagebox.h> |
51 | #include <qpopupmenu.h> | 51 | #include <qpopupmenu.h> |
52 | #include <qwidgetstack.h> | 52 | #include <qwidgetstack.h> |
53 | 53 | ||
54 | #include <sys/stat.h> | 54 | #include <sys/stat.h> |
55 | #include <sys/types.h> | 55 | #include <sys/types.h> |
56 | #include <fcntl.h> | 56 | #include <fcntl.h> |
57 | #include <unistd.h> | 57 | #include <unistd.h> |
58 | 58 | ||
59 | #include <stdlib.h> | 59 | #include <stdlib.h> |
60 | 60 | ||
61 | static QString todolistXMLFilename() | 61 | static QString todolistXMLFilename() |
62 | { | 62 | { |
63 | return Global::applicationFileName("todolist","todolist.xml"); | 63 | return Global::applicationFileName("todolist","todolist.xml"); |
64 | } | 64 | } |
65 | 65 | ||
66 | static QString categoriesXMLFilename() | 66 | static QString categoriesXMLFilename() |
67 | { | 67 | { |
68 | return Global::applicationFileName("todolist","categories.xml"); | 68 | return Global::applicationFileName("todolist","categories.xml"); |
69 | } | 69 | } |
70 | 70 | ||
71 | TodoWindow::TodoWindow( QWidget *parent, const char *name, WFlags f ) : | 71 | TodoWindow::TodoWindow( QWidget *parent, const char *name, WFlags f ) : |
72 | QMainWindow( parent, name, f ), syncing(FALSE) | 72 | QMainWindow( parent, name, f ), syncing(FALSE) |
73 | { | 73 | { |
74 | // QTime t; | 74 | // QTime t; |
75 | // t.start(); | 75 | // t.start(); |
76 | mView = 0l; | 76 | mView = 0l; |
77 | mStack = new QWidgetStack(this, "main stack"); | 77 | mStack = new QWidgetStack(this, "main stack"); |
78 | setCentralWidget( mStack ); | ||
78 | setCaption( tr("Todo") ); | 79 | setCaption( tr("Todo") ); |
79 | QString str; | 80 | QString str; |
80 | table = new TodoTable( this ); | 81 | table = new TodoTable( this ); |
81 | table->setColumnWidth( 2, 10 ); | 82 | table->setColumnWidth( 2, 10 ); |
82 | table->setPaintingEnabled( FALSE ); | 83 | table->setPaintingEnabled( FALSE ); |
83 | table->setUpdatesEnabled( FALSE ); | 84 | table->setUpdatesEnabled( FALSE ); |
84 | table->viewport()->setUpdatesEnabled( FALSE ); | 85 | table->viewport()->setUpdatesEnabled( FALSE ); |
85 | 86 | ||
86 | { | 87 | { |
87 | str = todolistXMLFilename(); | 88 | str = todolistXMLFilename(); |
88 | if ( str.isNull() ) | 89 | if ( str.isNull() ) |
89 | QMessageBox::critical( this, | 90 | QMessageBox::critical( this, |
90 | tr("Out of Space"), | 91 | tr("Out of Space"), |
91 | tr("Unable to create startup files\n" | 92 | tr("Unable to create startup files\n" |
92 | "Free up some space\n" | 93 | "Free up some space\n" |
93 | "before you enter any data") ); | 94 | "before you enter any data") ); |
94 | else | 95 | else |
95 | table->load( str ); | 96 | table->load( str ); |
96 | } | 97 | } |
97 | 98 | ||
98 | // repeat for categories... | 99 | // repeat for categories... |
99 | str = categoriesXMLFilename(); | 100 | str = categoriesXMLFilename(); |
100 | if ( str.isNull() ) | 101 | if ( str.isNull() ) |
101 | QMessageBox::critical( this, | 102 | QMessageBox::critical( this, |
102 | tr( "Out of Space" ), | 103 | tr( "Out of Space" ), |
103 | tr( "Unable to create startup files\n" | 104 | tr( "Unable to create startup files\n" |
104 | "Free up some space\n" | 105 | "Free up some space\n" |
105 | "before you enter any data") ); | 106 | "before you enter any data") ); |
106 | 107 | ||
107 | mStack->addWidget(table, 1 ); | 108 | mStack->addWidget(table, 1 ); |
108 | mStack->raiseWidget( 1 ); | 109 | mStack->raiseWidget( 1 ); |
109 | setCentralWidget( mStack ); | 110 | setCentralWidget( mStack ); |
110 | setToolBarsMovable( FALSE ); | 111 | setToolBarsMovable( FALSE ); |
111 | 112 | ||
112 | // qDebug("after load: t=%d", t.elapsed() ); | 113 | // qDebug("after load: t=%d", t.elapsed() ); |
113 | 114 | ||
114 | Config config( "todo" ); | 115 | Config config( "todo" ); |
115 | config.setGroup( "View" ); | 116 | config.setGroup( "View" ); |
116 | bool complete = config.readBoolEntry( "ShowComplete", true ); | 117 | bool complete = config.readBoolEntry( "ShowComplete", true ); |
117 | table->setShowCompleted( complete ); | 118 | table->setShowCompleted( complete ); |
118 | 119 | ||
119 | bool showdeadline = config.readBoolEntry("ShowDeadLine", true); | 120 | bool showdeadline = config.readBoolEntry("ShowDeadLine", true); |
120 | table->setShowDeadline (showdeadline); | 121 | table->setShowDeadline (showdeadline); |
121 | 122 | ||
122 | QString category = config.readEntry( "Category", QString::null ); | 123 | QString category = config.readEntry( "Category", QString::null ); |
123 | table->setShowCategory( category ); | 124 | table->setShowCategory( category ); |
124 | 125 | ||
125 | QPEToolBar *bar = new QPEToolBar( this ); | 126 | QPEToolBar *bar = new QPEToolBar( this ); |
126 | bar->setHorizontalStretchable( TRUE ); | 127 | bar->setHorizontalStretchable( TRUE ); |
127 | 128 | ||
128 | QPEMenuBar *mb = new QPEMenuBar( bar ); | 129 | QPEMenuBar *mb = new QPEMenuBar( bar ); |
129 | 130 | ||
130 | catMenu = new QPopupMenu( this ); | 131 | catMenu = new QPopupMenu( this ); |
131 | QPopupMenu *edit = new QPopupMenu( this ); | 132 | QPopupMenu *edit = new QPopupMenu( this ); |
132 | QPopupMenu *options = new QPopupMenu(this ); | 133 | QPopupMenu *options = new QPopupMenu(this ); |
133 | 134 | ||
134 | contextMenu = new QPopupMenu( this ); | 135 | contextMenu = new QPopupMenu( this ); |
135 | 136 | ||
136 | bar = new QPEToolBar( this ); | 137 | bar = new QPEToolBar( this ); |
137 | 138 | ||
138 | QAction *a = new QAction( tr( "New Task" ), Resource::loadPixmap( "new" ), | 139 | QAction *a = new QAction( tr( "New Task" ), Resource::loadPixmap( "new" ), |
139 | QString::null, 0, this, 0 ); | 140 | QString::null, 0, this, 0 ); |
140 | connect( a, SIGNAL( activated() ), | 141 | connect( a, SIGNAL( activated() ), |
141 | this, SLOT( slotNew() ) ); | 142 | this, SLOT( slotNew() ) ); |
142 | a->addTo( bar ); | 143 | a->addTo( bar ); |
143 | a->addTo( edit ); | 144 | a->addTo( edit ); |
144 | 145 | ||
145 | a = new QAction( tr( "Edit Task" ), Resource::loadIconSet( "edit" ), | 146 | a = new QAction( tr( "Edit Task" ), Resource::loadIconSet( "edit" ), |
146 | QString::null, 0, this, 0 ); | 147 | QString::null, 0, this, 0 ); |
147 | connect( a, SIGNAL( activated() ), | 148 | connect( a, SIGNAL( activated() ), |
148 | this, SLOT( slotEdit() ) ); | 149 | this, SLOT( slotEdit() ) ); |
149 | a->addTo( bar ); | 150 | a->addTo( bar ); |
150 | a->addTo( edit ); | 151 | a->addTo( edit ); |
151 | a->addTo( contextMenu ); | 152 | a->addTo( contextMenu ); |
152 | a->setEnabled( FALSE ); | 153 | a->setEnabled( FALSE ); |
153 | editAction = a; | 154 | editAction = a; |
154 | 155 | ||
155 | a = new QAction( QString::null, tr("View Task"), 0, this, 0 ); | 156 | a = new QAction( QString::null, tr("View Task"), 0, this, 0 ); |
156 | a->addTo( edit ); | 157 | a->addTo( edit ); |
157 | a->addTo( contextMenu ); | 158 | a->addTo( contextMenu ); |
158 | connect( a, SIGNAL( activated() ), | 159 | connect( a, SIGNAL( activated() ), |
159 | this, SLOT(slotShowDetails() ) ); | 160 | this, SLOT(slotShowDetails() ) ); |
160 | 161 | ||
161 | edit->insertSeparator(); | 162 | edit->insertSeparator(); |
162 | 163 | ||
163 | a = new QAction( tr( "Delete..." ), Resource::loadIconSet( "trash" ), | 164 | a = new QAction( tr( "Delete..." ), Resource::loadIconSet( "trash" ), |
164 | QString::null, 0, this, 0 ); | 165 | QString::null, 0, this, 0 ); |
165 | connect( a, SIGNAL( activated() ), | 166 | connect( a, SIGNAL( activated() ), |
166 | this, SLOT( slotDelete() ) ); | 167 | this, SLOT( slotDelete() ) ); |
167 | a->addTo( bar ); | 168 | a->addTo( bar ); |
168 | a->addTo( edit ); | 169 | a->addTo( edit ); |
169 | a->addTo( contextMenu ); | 170 | a->addTo( contextMenu ); |
170 | a->setEnabled( FALSE ); | 171 | a->setEnabled( FALSE ); |
171 | deleteAction = a; | 172 | deleteAction = a; |
172 | 173 | ||
173 | // delete All in category is missing.... | 174 | // delete All in category is missing.... |
174 | // set All Done | 175 | // set All Done |
175 | // set All Done in category | 176 | // set All Done in category |
176 | 177 | ||
177 | a = new QAction( QString::null, tr( "Delete all..."), 0, this, 0 ); | 178 | a = new QAction( QString::null, tr( "Delete all..."), 0, this, 0 ); |
178 | connect(a, SIGNAL( activated() ), | 179 | connect(a, SIGNAL( activated() ), |
179 | this, SLOT( slotDeleteAll() ) ); | 180 | this, SLOT( slotDeleteAll() ) ); |
180 | a->addTo(edit ); | 181 | a->addTo(edit ); |
181 | a->setEnabled( FALSE ); | 182 | a->setEnabled( FALSE ); |
182 | deleteAllAction = a; | 183 | deleteAllAction = a; |
183 | 184 | ||
184 | edit->insertSeparator(); | 185 | edit->insertSeparator(); |
185 | a = new QAction( QString::null, tr("Duplicate" ), 0, this, 0 ); | 186 | a = new QAction( QString::null, tr("Duplicate" ), 0, this, 0 ); |
186 | connect(a, SIGNAL( activated() ), | 187 | connect(a, SIGNAL( activated() ), |
187 | this, SLOT( slotDuplicate() ) ); | 188 | this, SLOT( slotDuplicate() ) ); |
188 | a->addTo(edit ); | 189 | a->addTo(edit ); |
189 | a->setEnabled( FALSE ); | 190 | a->setEnabled( FALSE ); |
190 | duplicateAction = a; | 191 | duplicateAction = a; |
191 | edit->insertSeparator(); | 192 | edit->insertSeparator(); |
192 | 193 | ||
193 | 194 | ||
194 | 195 | ||
195 | if ( Ir::supported() ) { | 196 | if ( Ir::supported() ) { |
196 | a = new QAction( tr( "Beam" ), Resource::loadPixmap( "beam" ), | 197 | a = new QAction( tr( "Beam" ), Resource::loadPixmap( "beam" ), |
197 | QString::null, 0, this, 0 ); | 198 | QString::null, 0, this, 0 ); |
198 | connect( a, SIGNAL( activated() ), | 199 | connect( a, SIGNAL( activated() ), |
199 | this, SLOT( slotBeam() ) ); | 200 | this, SLOT( slotBeam() ) ); |
200 | a->addTo( edit ); | 201 | a->addTo( edit ); |
201 | a->addTo( bar ); | 202 | a->addTo( bar ); |
202 | } | 203 | } |
203 | 204 | ||
204 | a = new QAction( tr( "Find" ), Resource::loadIconSet( "mag" ), | 205 | a = new QAction( tr( "Find" ), Resource::loadIconSet( "mag" ), |
205 | QString::null, 0, this, 0 ); | 206 | QString::null, 0, this, 0 ); |