-rw-r--r-- | core/pim/todo/mainwindow.cpp | 3 | ||||
-rw-r--r-- | core/pim/todo/otaskeditor.cpp | 83 | ||||
-rw-r--r-- | core/pim/todo/otaskeditor.h | 37 | ||||
-rw-r--r-- | core/pim/todo/taskeditoradvanced.ui | 222 | ||||
-rw-r--r-- | core/pim/todo/taskeditoralarms.ui | 148 | ||||
-rw-r--r-- | core/pim/todo/taskeditoroverview.ui | 542 | ||||
-rw-r--r-- | core/pim/todo/taskeditoroverviewimpl.cpp | 169 | ||||
-rw-r--r-- | core/pim/todo/taskeditoroverviewimpl.h | 54 | ||||
-rw-r--r-- | core/pim/todo/todo.pro | 12 | ||||
-rw-r--r-- | core/pim/todo/todoeditor.cpp | 12 | ||||
-rw-r--r-- | core/pim/todo/todoentry.ui | 481 | ||||
-rw-r--r-- | core/pim/todo/todoentryimpl.cpp | 189 | ||||
-rw-r--r-- | core/pim/todo/todoentryimpl.h | 65 |
13 files changed, 1271 insertions, 746 deletions
diff --git a/core/pim/todo/mainwindow.cpp b/core/pim/todo/mainwindow.cpp index 8377573..bf9fc23 100644 --- a/core/pim/todo/mainwindow.cpp +++ b/core/pim/todo/mainwindow.cpp | |||
@@ -1,706 +1,707 @@ | |||
1 | /* | 1 | /* |
2 | =. This file is part of the OPIE Project | 2 | =. This file is part of the OPIE Project |
3 | .=l. Copyright (c) 2002 <> | 3 | .=l. Copyright (c) 2002 <> |
4 | .>+-= | 4 | .>+-= |
5 | _;:, .> :=|. This program is free software; you can | 5 | _;:, .> :=|. This program is free software; you can |
6 | .> <`_, > . <= redistribute it and/or modify it under | 6 | .> <`_, > . <= redistribute it and/or modify it under |
7 | :`=1 )Y*s>-.-- : the terms of the GNU General Public | 7 | :`=1 )Y*s>-.-- : the terms of the GNU General Public |
8 | .="- .-=="i, .._ License as published by the Free Software | 8 | .="- .-=="i, .._ License as published by the Free Software |
9 | - . .-<_> .<> Foundation; either version 2 of the License, | 9 | - . .-<_> .<> Foundation; either version 2 of the License, |
10 | ._= =} : or (at your option) any later version. | 10 | ._= =} : or (at your option) any later version. |
11 | .%`+i> _;_. | 11 | .%`+i> _;_. |
12 | .i_,=:_. -<s. This program is distributed in the hope that | 12 | .i_,=:_. -<s. This program is distributed in the hope that |
13 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 13 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
14 | : .. .:, . . . without even the implied warranty of | 14 | : .. .:, . . . without even the implied warranty of |
15 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 15 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
16 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 16 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
17 | ..}^=.= = ; Library General Public License for more | 17 | ..}^=.= = ; Library General Public License for more |
18 | ++= -. .` .: details. | 18 | ++= -. .` .: 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 | 21 | -_. . . )=. = General Public License along with |
22 | -- :-=` this library; see the file COPYING.LIB. | 22 | -- :-=` this library; see the file COPYING.LIB. |
23 | If not, write to the Free Software Foundation, | 23 | If not, write to the Free Software Foundation, |
24 | Inc., 59 Temple Place - Suite 330, | 24 | Inc., 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 <unistd.h> | 29 | #include <unistd.h> |
30 | 30 | ||
31 | #include <qmenubar.h> | 31 | #include <qmenubar.h> |
32 | #include <qmessagebox.h> | 32 | #include <qmessagebox.h> |
33 | #include <qtoolbar.h> | 33 | #include <qtoolbar.h> |
34 | #include <qpopupmenu.h> | 34 | #include <qpopupmenu.h> |
35 | #include <qwidgetstack.h> | 35 | #include <qwidgetstack.h> |
36 | #include <qaction.h> | 36 | #include <qaction.h> |
37 | #include <qtimer.h> | 37 | #include <qtimer.h> |
38 | #include <qvbox.h> | 38 | #include <qvbox.h> |
39 | #include <qlineedit.h> | 39 | #include <qlineedit.h> |
40 | 40 | ||
41 | #include <qpe/applnk.h> | 41 | #include <qpe/applnk.h> |
42 | #include <qpe/config.h> | 42 | #include <qpe/config.h> |
43 | #include <qpe/ir.h> | 43 | #include <qpe/ir.h> |
44 | #include <qpe/resource.h> | 44 | #include <qpe/resource.h> |
45 | #include <qpe/qpemessagebox.h> | 45 | #include <qpe/qpemessagebox.h> |
46 | 46 | ||
47 | #include <opie/otodoaccessvcal.h> | 47 | #include <opie/otodoaccessvcal.h> |
48 | 48 | ||
49 | #include "quickeditimpl.h" | 49 | #include "quickeditimpl.h" |
50 | #include "todotemplatemanager.h" | 50 | #include "todotemplatemanager.h" |
51 | #include "templateeditor.h" | 51 | #include "templateeditor.h" |
52 | #include "todoentryimpl.h" | 52 | #include "todoentryimpl.h" |
53 | #include "tableview.h" | 53 | #include "tableview.h" |
54 | 54 | ||
55 | #include "textviewshow.h" | 55 | #include "textviewshow.h" |
56 | #include "todoeditor.h" | 56 | #include "todoeditor.h" |
57 | #include "mainwindow.h" | 57 | #include "mainwindow.h" |
58 | 58 | ||
59 | 59 | ||
60 | using namespace Todo; | 60 | using namespace Todo; |
61 | 61 | ||
62 | MainWindow::MainWindow( QWidget* parent, | 62 | MainWindow::MainWindow( QWidget* parent, |
63 | const char* name ) { | 63 | const char* name ) { |
64 | 64 | ||
65 | m_syncing = false; | 65 | m_syncing = false; |
66 | m_counter = 0; | 66 | m_counter = 0; |
67 | m_tempManager = new TemplateManager(); | 67 | m_tempManager = new TemplateManager(); |
68 | m_tempManager->load(); | 68 | m_tempManager->load(); |
69 | 69 | ||
70 | initUI(); | 70 | initUI(); |
71 | initConfig(); | 71 | initConfig(); |
72 | initViews(); | 72 | initViews(); |
73 | initActions(); | 73 | initActions(); |
74 | initEditor(); | 74 | initEditor(); |
75 | initShow(); | 75 | initShow(); |
76 | initTemplate(); | 76 | initTemplate(); |
77 | 77 | ||
78 | populateTemplates(); | 78 | populateTemplates(); |
79 | raiseCurrentView(); | 79 | raiseCurrentView(); |
80 | QTimer::singleShot(0, this, SLOT(populateCategories() ) ); | 80 | QTimer::singleShot(0, this, SLOT(populateCategories() ) ); |
81 | } | 81 | } |
82 | void MainWindow::initTemplate() { | 82 | void MainWindow::initTemplate() { |
83 | m_curTempEd = new TemplateEditor( this, templateManager() ); | 83 | m_curTempEd = new TemplateEditor( this, templateManager() ); |
84 | } | 84 | } |
85 | void MainWindow::initActions() { | 85 | void MainWindow::initActions() { |
86 | QAction* a = new QAction( tr("New Task" ), Resource::loadPixmap( "new" ), | 86 | QAction* a = new QAction( tr("New Task" ), Resource::loadPixmap( "new" ), |
87 | QString::null, 0, this, 0 ); | 87 | QString::null, 0, this, 0 ); |
88 | connect(a, SIGNAL( activated() ), | 88 | connect(a, SIGNAL( activated() ), |
89 | this, SLOT( slotNew() ) ); | 89 | this, SLOT( slotNew() ) ); |
90 | a->addTo(m_tool ); | 90 | a->addTo(m_tool ); |
91 | a->addTo(m_edit ); | 91 | a->addTo(m_edit ); |
92 | 92 | ||
93 | a = new QAction( tr("Edit Task"), Resource::loadIconSet( "edit" ), | 93 | a = new QAction( tr("Edit Task"), Resource::loadIconSet( "edit" ), |
94 | QString::null, 0, this, 0 ); | 94 | QString::null, 0, this, 0 ); |
95 | connect(a, SIGNAL(activated() ), | 95 | connect(a, SIGNAL(activated() ), |
96 | this, SLOT( slotEdit() ) ); | 96 | this, SLOT( slotEdit() ) ); |
97 | a->addTo( m_tool ); | 97 | a->addTo( m_tool ); |
98 | a->addTo( m_edit ); | 98 | a->addTo( m_edit ); |
99 | m_editAction = a; | 99 | m_editAction = a; |
100 | 100 | ||
101 | a = new QAction( QString::null, tr("View Task"), 0, this, 0 ); | 101 | a = new QAction( QString::null, tr("View Task"), 0, this, 0 ); |
102 | connect(a, SIGNAL( activated() ), | 102 | connect(a, SIGNAL( activated() ), |
103 | this, SLOT( slotShowDetails() ) ); | 103 | this, SLOT( slotShowDetails() ) ); |
104 | a->addTo( m_edit ); | 104 | a->addTo( m_edit ); |
105 | 105 | ||
106 | m_edit->insertSeparator(); | 106 | m_edit->insertSeparator(); |
107 | 107 | ||
108 | a = new QAction( tr("Delete..."), Resource::loadIconSet( "trash" ), | 108 | a = new QAction( tr("Delete..."), Resource::loadIconSet( "trash" ), |
109 | QString::null, 0, this, 0 ); | 109 | QString::null, 0, this, 0 ); |
110 | connect(a, SIGNAL(activated() ), | 110 | connect(a, SIGNAL(activated() ), |
111 | this, SLOT(slotDelete() ) ); | 111 | this, SLOT(slotDelete() ) ); |
112 | a->addTo( m_tool ); | 112 | a->addTo( m_tool ); |
113 | a->addTo( m_edit ); | 113 | a->addTo( m_edit ); |
114 | m_deleteAction = a; | 114 | m_deleteAction = a; |
115 | 115 | ||
116 | a = new QAction( QString::null, tr("Delete all..."), 0, this, 0 ); | 116 | a = new QAction( QString::null, tr("Delete all..."), 0, this, 0 ); |
117 | connect(a, SIGNAL( activated() ), | 117 | connect(a, SIGNAL( activated() ), |
118 | this, SLOT( slotDeleteAll() ) ); | 118 | this, SLOT( slotDeleteAll() ) ); |
119 | a->addTo(m_edit ); | 119 | a->addTo(m_edit ); |
120 | m_deleteAllAction = a; | 120 | m_deleteAllAction = a; |
121 | 121 | ||
122 | a = new QAction( QString::null, tr("Delete completed"), | 122 | a = new QAction( QString::null, tr("Delete completed"), |
123 | 0, this, 0 ); | 123 | 0, this, 0 ); |
124 | connect(a, SIGNAL( activated() ), | 124 | connect(a, SIGNAL( activated() ), |
125 | this, SLOT( slotDeleteCompleted() ) ); | 125 | this, SLOT( slotDeleteCompleted() ) ); |
126 | a->addTo(m_edit ); | 126 | a->addTo(m_edit ); |
127 | a->setEnabled( TRUE ); | 127 | a->setEnabled( TRUE ); |
128 | m_deleteCompleteAction = a; | 128 | m_deleteCompleteAction = a; |
129 | 129 | ||
130 | m_edit->insertSeparator(); | 130 | m_edit->insertSeparator(); |
131 | 131 | ||
132 | a = new QAction( QString::null, tr("Duplicate"), 0, this, 0 ); | 132 | a = new QAction( QString::null, tr("Duplicate"), 0, this, 0 ); |
133 | connect(a, SIGNAL( activated() ), | 133 | connect(a, SIGNAL( activated() ), |
134 | this, SLOT( slotDuplicate() ) ); | 134 | this, SLOT( slotDuplicate() ) ); |
135 | a->addTo(m_edit ); | 135 | a->addTo(m_edit ); |
136 | m_duplicateAction = a; | 136 | m_duplicateAction = a; |
137 | 137 | ||
138 | m_edit->insertSeparator(); | 138 | m_edit->insertSeparator(); |
139 | 139 | ||
140 | if ( Ir::supported() ) { | 140 | if ( Ir::supported() ) { |
141 | a = new QAction( tr( "Beam" ), Resource::loadPixmap( "beam" ), | 141 | a = new QAction( tr( "Beam" ), Resource::loadPixmap( "beam" ), |
142 | QString::null, 0, this, 0 ); | 142 | QString::null, 0, this, 0 ); |
143 | connect( a, SIGNAL( activated() ), | 143 | connect( a, SIGNAL( activated() ), |
144 | this, SLOT( slotBeam() ) ); | 144 | this, SLOT( slotBeam() ) ); |
145 | a->addTo( m_edit ); | 145 | a->addTo( m_edit ); |
146 | a->addTo( m_tool ); | 146 | a->addTo( m_tool ); |
147 | } | 147 | } |
148 | 148 | ||
149 | a = new QAction( tr("Find"), Resource::loadIconSet( "mag" ), | 149 | a = new QAction( tr("Find"), Resource::loadIconSet( "mag" ), |
150 | QString::null, 0, this, 0 ); | 150 | QString::null, 0, this, 0 ); |
151 | connect(a, SIGNAL( activated() ), | 151 | connect(a, SIGNAL( activated() ), |
152 | this, SLOT( slotFind() ) ); | 152 | this, SLOT( slotFind() ) ); |
153 | a->addTo( m_options ); | 153 | a->addTo( m_options ); |
154 | m_findAction = a; | 154 | m_findAction = a; |
155 | 155 | ||
156 | m_options->insertSeparator(); | 156 | m_options->insertSeparator(); |
157 | 157 | ||
158 | m_completedAction = new QAction( QString::null, tr("Completed tasks"), | 158 | m_completedAction = new QAction( QString::null, tr("Completed tasks"), |
159 | 0, this, 0, TRUE ); | 159 | 0, this, 0, TRUE ); |
160 | m_completedAction->addTo( m_options ); | 160 | m_completedAction->addTo( m_options ); |
161 | m_completedAction->setOn( showCompleted() ); | 161 | m_completedAction->setOn( showCompleted() ); |
162 | connect(m_completedAction, SIGNAL( toggled(bool) ), | 162 | connect(m_completedAction, SIGNAL( toggled(bool) ), |
163 | this, SLOT(slotShowCompleted(bool) ) ); | 163 | this, SLOT(slotShowCompleted(bool) ) ); |
164 | 164 | ||
165 | m_showDeadLineAction = new QAction( QString::null, tr("Show Deadline"), | 165 | m_showDeadLineAction = new QAction( QString::null, tr("Show Deadline"), |
166 | 0, this, 0, TRUE ); | 166 | 0, this, 0, TRUE ); |
167 | m_showDeadLineAction->addTo( m_options ); | 167 | m_showDeadLineAction->addTo( m_options ); |
168 | m_showDeadLineAction->setOn( showDeadline() ); | 168 | m_showDeadLineAction->setOn( showDeadline() ); |
169 | connect(m_showDeadLineAction, SIGNAL(toggled(bool) ), | 169 | connect(m_showDeadLineAction, SIGNAL(toggled(bool) ), |
170 | this, SLOT( slotShowDeadLine( bool ) ) ); | 170 | this, SLOT( slotShowDeadLine( bool ) ) ); |
171 | 171 | ||
172 | m_options->insertSeparator(); | 172 | m_options->insertSeparator(); |
173 | 173 | ||
174 | m_bar->insertItem( tr("Data") ,m_edit ); | 174 | m_bar->insertItem( tr("Data") ,m_edit ); |
175 | m_bar->insertItem( tr("Category"), m_catMenu ); | 175 | m_bar->insertItem( tr("Category"), m_catMenu ); |
176 | m_bar->insertItem( tr("Options"), m_options ); | 176 | m_bar->insertItem( tr("Options"), m_options ); |
177 | 177 | ||
178 | /* initialize the view menu */ | 178 | /* initialize the view menu */ |
179 | a = new QAction( QString::null, tr("Show over due"), | 179 | a = new QAction( QString::null, tr("Show over due"), |
180 | 0, this, 0, TRUE ); | 180 | 0, this, 0, TRUE ); |
181 | a->addTo( m_view ); | 181 | a->addTo( m_view ); |
182 | a->setOn( showOverDue() ); | 182 | a->setOn( showOverDue() ); |
183 | connect(a, SIGNAL(toggled(bool)), | 183 | connect(a, SIGNAL(toggled(bool)), |
184 | this, SLOT(slotShowDue(bool) ) ); | 184 | this, SLOT(slotShowDue(bool) ) ); |
185 | m_view->insertSeparator(); | 185 | m_view->insertSeparator(); |
186 | 186 | ||
187 | m_bar->insertItem( tr("View"), m_view ); | 187 | m_bar->insertItem( tr("View"), m_view ); |
188 | 188 | ||
189 | /* templates */ | 189 | /* templates */ |
190 | m_edit->insertItem(tr("New from template"), m_template, | 190 | m_edit->insertItem(tr("New from template"), m_template, |
191 | -1, 0 ); | 191 | -1, 0 ); |
192 | 192 | ||
193 | } | 193 | } |
194 | /* m_curCat from Config */ | 194 | /* m_curCat from Config */ |
195 | void MainWindow::initConfig() { | 195 | void MainWindow::initConfig() { |
196 | Config config( "todo" ); | 196 | Config config( "todo" ); |
197 | config.setGroup( "View" ); | 197 | config.setGroup( "View" ); |
198 | m_completed = config.readBoolEntry( "ShowComplete", TRUE ); | 198 | m_completed = config.readBoolEntry( "ShowComplete", TRUE ); |
199 | m_curCat = config.readEntry( "Category", QString::null ); | 199 | m_curCat = config.readEntry( "Category", QString::null ); |
200 | m_deadline = config.readBoolEntry( "ShowDeadLine", TRUE); | 200 | m_deadline = config.readBoolEntry( "ShowDeadLine", TRUE); |
201 | m_overdue = config.readBoolEntry("ShowOverDue", TRUE ); | 201 | m_overdue = config.readBoolEntry("ShowOverDue", TRUE ); |
202 | } | 202 | } |
203 | void MainWindow::initUI() { | 203 | void MainWindow::initUI() { |
204 | m_mainBox = new QVBox(this, "main box "); | 204 | m_mainBox = new QVBox(this, "main box "); |
205 | m_curQuick = new QuickEditImpl(this, m_mainBox ); | 205 | m_curQuick = new QuickEditImpl(this, m_mainBox ); |
206 | m_curQuick->signal()->connect( this, SLOT(slotQuickEntered() ) ); | 206 | m_curQuick->signal()->connect( this, SLOT(slotQuickEntered() ) ); |
207 | m_quickEdit.append( m_curQuick ); | 207 | m_quickEdit.append( m_curQuick ); |
208 | 208 | ||
209 | 209 | ||
210 | 210 | ||
211 | m_stack = new QWidgetStack(m_mainBox, "main stack"); | 211 | m_stack = new QWidgetStack(m_mainBox, "main stack"); |
212 | setCentralWidget( m_mainBox ); | 212 | setCentralWidget( m_mainBox ); |
213 | 213 | ||
214 | setToolBarsMovable( FALSE ); | 214 | setToolBarsMovable( FALSE ); |
215 | 215 | ||
216 | m_tool = new QToolBar( this ); | 216 | m_tool = new QToolBar( this ); |
217 | m_tool->setHorizontalStretchable( TRUE ); | 217 | m_tool->setHorizontalStretchable( TRUE ); |
218 | 218 | ||
219 | m_bar = new QMenuBar( m_tool ); | 219 | m_bar = new QMenuBar( m_tool ); |
220 | 220 | ||
221 | /** QPopupMenu */ | 221 | /** QPopupMenu */ |
222 | m_edit = new QPopupMenu( this ); | 222 | m_edit = new QPopupMenu( this ); |
223 | m_options = new QPopupMenu( this ); | 223 | m_options = new QPopupMenu( this ); |
224 | m_view = new QPopupMenu( this ); | 224 | m_view = new QPopupMenu( this ); |
225 | m_catMenu = new QPopupMenu( this ); | 225 | m_catMenu = new QPopupMenu( this ); |
226 | m_template = new QPopupMenu( this ); | 226 | m_template = new QPopupMenu( this ); |
227 | 227 | ||
228 | m_catMenu->setCheckable( TRUE ); | 228 | m_catMenu->setCheckable( TRUE ); |
229 | m_template->setCheckable( TRUE ); | 229 | m_template->setCheckable( TRUE ); |
230 | 230 | ||
231 | connect(m_catMenu, SIGNAL(activated(int) ), | 231 | connect(m_catMenu, SIGNAL(activated(int) ), |
232 | this, SLOT(setCategory(int) ) ); | 232 | this, SLOT(setCategory(int) ) ); |
233 | connect(m_template, SIGNAL(activated(int) ), | 233 | connect(m_template, SIGNAL(activated(int) ), |
234 | this, SLOT(slotNewFromTemplate(int) ) ); | 234 | this, SLOT(slotNewFromTemplate(int) ) ); |
235 | } | 235 | } |
236 | void MainWindow::initViews() { | 236 | void MainWindow::initViews() { |
237 | TableView* tableView = new TableView( this, m_stack ); | 237 | TableView* tableView = new TableView( this, m_stack ); |
238 | m_stack->addWidget( tableView, m_counter++ ); | 238 | m_stack->addWidget( tableView, m_counter++ ); |
239 | m_views.append( tableView ); | 239 | m_views.append( tableView ); |
240 | m_curView = tableView; | 240 | m_curView = tableView; |
241 | connectBase( tableView ); | 241 | connectBase( tableView ); |
242 | /* add QString type + QString configname to | 242 | /* add QString type + QString configname to |
243 | * the View menu | 243 | * the View menu |
244 | * and subdirs for multiple views | 244 | * and subdirs for multiple views |
245 | */ | 245 | */ |
246 | } | 246 | } |
247 | void MainWindow::initEditor() { | 247 | void MainWindow::initEditor() { |
248 | m_curEdit = new Editor(); | 248 | m_curEdit = new Editor(); |
249 | } | 249 | } |
250 | void MainWindow::initShow() { | 250 | void MainWindow::initShow() { |
251 | m_curShow = new TextViewShow(this); | 251 | m_curShow = new TextViewShow(this); |
252 | m_stack->addWidget( m_curShow->widget() , m_counter++ ); | 252 | m_stack->addWidget( m_curShow->widget() , m_counter++ ); |
253 | } | 253 | } |
254 | MainWindow::~MainWindow() { | 254 | MainWindow::~MainWindow() { |
255 | delete templateManager(); | 255 | delete templateManager(); |
256 | } | 256 | } |
257 | void MainWindow::connectBase( ViewBase* base) { | 257 | void MainWindow::connectBase( ViewBase* base) { |
258 | base->connectShow( this, SLOT(slotShow(int) ) ); | 258 | base->connectShow( this, SLOT(slotShow(int) ) ); |
259 | base->connectEdit( this, SLOT(slotEdit(int) ) ); | 259 | base->connectEdit( this, SLOT(slotEdit(int) ) ); |
260 | base->connectUpdateSmall( this, | 260 | base->connectUpdateSmall( this, |
261 | SLOT(slotUpate1(int, const Todo::SmallTodo&) )); | 261 | SLOT(slotUpate1(int, const Todo::SmallTodo&) )); |
262 | base->connectUpdateBig( this, | 262 | base->connectUpdateBig( this, |
263 | SLOT(slotUpate2(int, const OTodo& ) ) ); | 263 | SLOT(slotUpate2(int, const OTodo& ) ) ); |
264 | base->connectUpdateView( this, SLOT(slotUpdate3( QWidget* ) ) ) ; | 264 | base->connectUpdateView( this, SLOT(slotUpdate3( QWidget* ) ) ) ; |
265 | base->connectRemove(&m_todoMgr, | 265 | base->connectRemove(&m_todoMgr, |
266 | SLOT(remove(int)) ); | 266 | SLOT(remove(int)) ); |
267 | } | 267 | } |
268 | QPopupMenu* MainWindow::contextMenu( int uid ) { | 268 | QPopupMenu* MainWindow::contextMenu( int uid ) { |
269 | QPopupMenu* menu = new QPopupMenu(); | 269 | QPopupMenu* menu = new QPopupMenu(); |
270 | 270 | ||
271 | m_editAction->addTo( menu ); | 271 | m_editAction->addTo( menu ); |
272 | m_deleteAction->addTo( menu ); | 272 | m_deleteAction->addTo( menu ); |
273 | m_duplicateAction->addTo( menu ); | 273 | m_duplicateAction->addTo( menu ); |
274 | menu->insertSeparator(); | 274 | menu->insertSeparator(); |
275 | 275 | ||
276 | return menu; | 276 | return menu; |
277 | } | 277 | } |
278 | QPopupMenu* MainWindow::options() { | 278 | QPopupMenu* MainWindow::options() { |
279 | qWarning("Options"); | 279 | qWarning("Options"); |
280 | return m_options; | 280 | return m_options; |
281 | } | 281 | } |
282 | QPopupMenu* MainWindow::edit() { | 282 | QPopupMenu* MainWindow::edit() { |
283 | return m_edit; | 283 | return m_edit; |
284 | } | 284 | } |
285 | QPopupMenu* MainWindow::view() { | 285 | QPopupMenu* MainWindow::view() { |
286 | return m_view; | 286 | return m_view; |
287 | } | 287 | } |
288 | QToolBar* MainWindow::toolbar() { | 288 | QToolBar* MainWindow::toolbar() { |
289 | return m_tool; | 289 | return m_tool; |
290 | } | 290 | } |
291 | OTodoAccess::List MainWindow::list()const { | 291 | OTodoAccess::List MainWindow::list()const { |
292 | return m_todoMgr.list(); | 292 | return m_todoMgr.list(); |
293 | } | 293 | } |
294 | OTodoAccess::List MainWindow::sorted( bool asc, int sortOrder ) { | 294 | OTodoAccess::List MainWindow::sorted( bool asc, int sortOrder ) { |
295 | int cat = 0; | 295 | int cat = 0; |
296 | if ( m_curCat != tr("All Categories") ) | 296 | if ( m_curCat != tr("All Categories") ) |
297 | cat = currentCatId(); | 297 | cat = currentCatId(); |
298 | 298 | ||
299 | int filter = 1; | 299 | int filter = 1; |
300 | 300 | ||
301 | if (!m_completed ) | 301 | if (!m_completed ) |
302 | filter |= 4; | 302 | filter |= 4; |
303 | if (m_overdue) | 303 | if (m_overdue) |
304 | filter |= 2; | 304 | filter |= 2; |
305 | 305 | ||
306 | return m_todoMgr.sorted( asc, sortOrder, filter, cat ); | 306 | return m_todoMgr.sorted( asc, sortOrder, filter, cat ); |
307 | } | 307 | } |
308 | OTodoAccess::List MainWindow::sorted( bool asc, int sortOrder, int addFilter) { | 308 | OTodoAccess::List MainWindow::sorted( bool asc, int sortOrder, int addFilter) { |
309 | int cat = 0; | 309 | int cat = 0; |
310 | if ( m_curCat != tr("All Categories") ) | 310 | if ( m_curCat != tr("All Categories") ) |
311 | cat = currentCatId(); | 311 | cat = currentCatId(); |
312 | 312 | ||
313 | return m_todoMgr.sorted(asc, sortOrder, addFilter, cat ); | 313 | return m_todoMgr.sorted(asc, sortOrder, addFilter, cat ); |
314 | } | 314 | } |
315 | OTodo MainWindow::event( int uid ) { | 315 | OTodo MainWindow::event( int uid ) { |
316 | return m_todoMgr.event( uid ); | 316 | return m_todoMgr.event( uid ); |
317 | } | 317 | } |
318 | bool MainWindow::isSyncing()const { | 318 | bool MainWindow::isSyncing()const { |
319 | return m_syncing; | 319 | return m_syncing; |
320 | } | 320 | } |
321 | TemplateManager* MainWindow::templateManager() { | 321 | TemplateManager* MainWindow::templateManager() { |
322 | return m_tempManager; | 322 | return m_tempManager; |
323 | } | 323 | } |
324 | Editor* MainWindow::currentEditor() { | 324 | Editor* MainWindow::currentEditor() { |
325 | return m_curEdit; | 325 | return m_curEdit; |
326 | } | 326 | } |
327 | TodoShow* MainWindow::currentShow() { | 327 | TodoShow* MainWindow::currentShow() { |
328 | return m_curShow; | 328 | return m_curShow; |
329 | } | 329 | } |
330 | void MainWindow::slotReload() { | 330 | void MainWindow::slotReload() { |
331 | m_todoMgr.reload(); | 331 | m_todoMgr.reload(); |
332 | currentView()->updateView( ); | 332 | currentView()->updateView( ); |
333 | raiseCurrentView(); | 333 | raiseCurrentView(); |
334 | } | 334 | } |
335 | void MainWindow::closeEvent( QCloseEvent* e ) { | 335 | void MainWindow::closeEvent( QCloseEvent* e ) { |
336 | if (m_stack->visibleWidget() == currentShow()->widget() ) { | 336 | if (m_stack->visibleWidget() == currentShow()->widget() ) { |
337 | raiseCurrentView(); | 337 | raiseCurrentView(); |
338 | e->ignore(); | 338 | e->ignore(); |
339 | return; | 339 | return; |
340 | } | 340 | } |
341 | /* | 341 | /* |
342 | * we should have flushed and now we're still saving | 342 | * we should have flushed and now we're still saving |
343 | * so there is no need to flush | 343 | * so there is no need to flush |
344 | */ | 344 | */ |
345 | if (m_syncing ) { | 345 | if (m_syncing ) { |
346 | e->accept(); | 346 | e->accept(); |
347 | return; | 347 | return; |
348 | } | 348 | } |
349 | bool quit = false; | 349 | bool quit = false; |
350 | if ( m_todoMgr.saveAll() ){ | 350 | if ( m_todoMgr.saveAll() ){ |
351 | qWarning("saved"); | 351 | qWarning("saved"); |
352 | quit = true; | 352 | quit = true; |
353 | }else { | 353 | }else { |
354 | if ( QMessageBox::critical( this, tr("Out of space"), | 354 | if ( QMessageBox::critical( this, tr("Out of space"), |
355 | tr("Todo was unable\n" | 355 | tr("Todo was unable\n" |
356 | "to save your changes.\n" | 356 | "to save your changes.\n" |
357 | "Free up some space\n" | 357 | "Free up some space\n" |
358 | "and try again.\n" | 358 | "and try again.\n" |
359 | "\nQuit Anyway?"), | 359 | "\nQuit Anyway?"), |
360 | QMessageBox::Yes|QMessageBox::Escape, | 360 | QMessageBox::Yes|QMessageBox::Escape, |
361 | QMessageBox::No|QMessageBox::Default) | 361 | QMessageBox::No|QMessageBox::Default) |
362 | != QMessageBox::No ) { | 362 | != QMessageBox::No ) { |
363 | e->accept(); | 363 | e->accept(); |
364 | quit = true; | 364 | quit = true; |
365 | }else | 365 | }else |
366 | e->ignore(); | 366 | e->ignore(); |
367 | 367 | ||
368 | } | 368 | } |
369 | 369 | ||
370 | if (quit ) { | 370 | if (quit ) { |
371 | Config config( "todo" ); | 371 | Config config( "todo" ); |
372 | config.setGroup( "View" ); | 372 | config.setGroup( "View" ); |
373 | config.writeEntry( "ShowComplete", showCompleted() ); | 373 | config.writeEntry( "ShowComplete", showCompleted() ); |
374 | config.writeEntry( "Category", currentCategory() ); | 374 | config.writeEntry( "Category", currentCategory() ); |
375 | config.writeEntry( "ShowDeadLine", showDeadline()); | 375 | config.writeEntry( "ShowDeadLine", showDeadline()); |
376 | config.writeEntry( "ShowOverDue", showOverDue() ); | 376 | config.writeEntry( "ShowOverDue", showOverDue() ); |
377 | /* svae templates */ | 377 | /* svae templates */ |
378 | templateManager()->save(); | 378 | templateManager()->save(); |
379 | e->accept(); | 379 | e->accept(); |
380 | } | 380 | } |
381 | } | 381 | } |
382 | void MainWindow::populateTemplates() { | 382 | void MainWindow::populateTemplates() { |
383 | m_template->clear(); | 383 | m_template->clear(); |
384 | QStringList list = templateManager()->templates(); | 384 | QStringList list = templateManager()->templates(); |
385 | QStringList::Iterator it; | 385 | QStringList::Iterator it; |
386 | for ( it = list.begin(); it != list.end(); ++it ) { | 386 | for ( it = list.begin(); it != list.end(); ++it ) { |
387 | m_template->insertItem( (*it) ); | 387 | m_template->insertItem( (*it) ); |
388 | } | 388 | } |
389 | } | 389 | } |
390 | /* | 390 | /* |
391 | * slotNewFromTemplate | 391 | * slotNewFromTemplate |
392 | * We use the edit widget to do | 392 | * We use the edit widget to do |
393 | * the config but we setUid(-1) | 393 | * the config but we setUid(-1) |
394 | * to get a new uid | 394 | * to get a new uid |
395 | */ | 395 | */ |
396 | /* | 396 | /* |
397 | * first we get the name of the template | 397 | * first we get the name of the template |
398 | * then we will use the TemplateManager | 398 | * then we will use the TemplateManager |
399 | */ | 399 | */ |
400 | void MainWindow::slotNewFromTemplate( int id ) { | 400 | void MainWindow::slotNewFromTemplate( int id ) { |
401 | QString name = m_template->text( id ); | 401 | QString name = m_template->text( id ); |
402 | 402 | ||
403 | OTodo event = templateManager()->templateEvent( name ); | 403 | OTodo event = templateManager()->templateEvent( name ); |
404 | event = currentEditor()->edit(this, | 404 | event = currentEditor()->edit(this, |
405 | event ); | 405 | event ); |
406 | 406 | ||
407 | if ( currentEditor()->accepted() ) { | 407 | if ( currentEditor()->accepted() ) { |
408 | /* assign new todo */ | 408 | /* assign new todo */ |
409 | event.setUid( -1 ); | 409 | event.setUid( -1 ); |
410 | currentView()->addEvent( event ); | 410 | currentView()->addEvent( event ); |
411 | m_todoMgr.add( event ); | 411 | m_todoMgr.add( event ); |
412 | 412 | ||
413 | populateCategories(); | 413 | populateCategories(); |
414 | } | 414 | } |
415 | } | 415 | } |
416 | void MainWindow::slotNew() { | 416 | void MainWindow::slotNew() { |
417 | if(m_syncing) { | 417 | if(m_syncing) { |
418 | QMessageBox::warning(this, tr("Todo"), | 418 | QMessageBox::warning(this, tr("Todo"), |
419 | tr("Can not edit data, currently syncing")); | 419 | tr("Can not edit data, currently syncing")); |
420 | return; | 420 | return; |
421 | } | 421 | } |
422 | 422 | ||
423 | 423 | ||
424 | OTodo todo = currentEditor()->newTodo( currentCatId(), | 424 | OTodo todo = currentEditor()->newTodo( currentCatId(), |
425 | this ); | 425 | this ); |
426 | 426 | ||
427 | if ( currentEditor()->accepted() ) { | 427 | if ( currentEditor()->accepted() ) { |
428 | //todo.assignUid(); | 428 | //todo.assignUid(); |
429 | currentView()->addEvent( todo ); | ||
430 | m_todoMgr.add( todo ); | 429 | m_todoMgr.add( todo ); |
430 | currentView()->addEvent( todo ); | ||
431 | |||
431 | 432 | ||
432 | // I'm afraid we must call this every time now, otherwise | 433 | // I'm afraid we must call this every time now, otherwise |
433 | // spend expensive time comparing all these strings... | 434 | // spend expensive time comparing all these strings... |
434 | // but only call if we changed something -zecke | 435 | // but only call if we changed something -zecke |
435 | populateCategories(); | 436 | populateCategories(); |
436 | } | 437 | } |
437 | raiseCurrentView( ); | 438 | raiseCurrentView( ); |
438 | } | 439 | } |
439 | void MainWindow::slotDuplicate() { | 440 | void MainWindow::slotDuplicate() { |
440 | if(m_syncing) { | 441 | if(m_syncing) { |
441 | QMessageBox::warning(this, tr("Todo"), | 442 | QMessageBox::warning(this, tr("Todo"), |
442 | tr("Can not edit data, currently syncing")); | 443 | tr("Can not edit data, currently syncing")); |
443 | return; | 444 | return; |
444 | } | 445 | } |
445 | OTodo ev = m_todoMgr.event( currentView()->current() ); | 446 | OTodo ev = m_todoMgr.event( currentView()->current() ); |
446 | /* let's generate a new uid */ | 447 | /* let's generate a new uid */ |
447 | ev.setUid(-1); | 448 | ev.setUid(-1); |
448 | m_todoMgr.add( ev ); | 449 | m_todoMgr.add( ev ); |
449 | 450 | ||
450 | currentView()->addEvent( ev ); | 451 | currentView()->addEvent( ev ); |
451 | raiseCurrentView(); | 452 | raiseCurrentView(); |
452 | } | 453 | } |
453 | void MainWindow::slotDelete() { | 454 | void MainWindow::slotDelete() { |
454 | if (!currentView()->current() ) | 455 | if (!currentView()->current() ) |
455 | return; | 456 | return; |
456 | 457 | ||
457 | if(m_syncing) { | 458 | if(m_syncing) { |
458 | QMessageBox::warning(this, tr("Todo"), | 459 | QMessageBox::warning(this, tr("Todo"), |
459 | tr("Can not edit data, currently syncing")); | 460 | tr("Can not edit data, currently syncing")); |
460 | return; | 461 | return; |
461 | } | 462 | } |
462 | QString strName = currentView()->currentRepresentation(); | 463 | QString strName = currentView()->currentRepresentation(); |
463 | if (!QPEMessageBox::confirmDelete(this, tr("Todo"), strName ) ) | 464 | if (!QPEMessageBox::confirmDelete(this, tr("Todo"), strName ) ) |
464 | return; | 465 | return; |
465 | 466 | ||
466 | m_todoMgr.remove( currentView()->current() ); | 467 | m_todoMgr.remove( currentView()->current() ); |
467 | currentView()->removeEvent( currentView()->current() ); | 468 | currentView()->removeEvent( currentView()->current() ); |
468 | raiseCurrentView(); | 469 | raiseCurrentView(); |
469 | } | 470 | } |
470 | void MainWindow::slotDeleteAll() { | 471 | void MainWindow::slotDeleteAll() { |
471 | if(m_syncing) { | 472 | if(m_syncing) { |
472 | QMessageBox::warning(this, tr("Todo"), | 473 | QMessageBox::warning(this, tr("Todo"), |
473 | tr("Can not edit data, currently syncing")); | 474 | tr("Can not edit data, currently syncing")); |
474 | return; | 475 | return; |
475 | } | 476 | } |
476 | 477 | ||
477 | //QString strName = table->text( table->currentRow(), 2 ).left( 30 ); | 478 | //QString strName = table->text( table->currentRow(), 2 ).left( 30 ); |
478 | 479 | ||
479 | if ( !QPEMessageBox::confirmDelete( this, tr( "Todo" ), tr("all tasks?") ) ) | 480 | if ( !QPEMessageBox::confirmDelete( this, tr( "Todo" ), tr("all tasks?") ) ) |
480 | return; | 481 | return; |
481 | 482 | ||
482 | m_todoMgr.removeAll(); | 483 | m_todoMgr.removeAll(); |
483 | currentView()->clear(); | 484 | currentView()->clear(); |
484 | 485 | ||
485 | raiseCurrentView(); | 486 | raiseCurrentView(); |
486 | } | 487 | } |
487 | void MainWindow::slotDeleteCompleted() { | 488 | void MainWindow::slotDeleteCompleted() { |
488 | if(m_syncing) { | 489 | if(m_syncing) { |
489 | QMessageBox::warning(this, tr("Todo"), | 490 | QMessageBox::warning(this, tr("Todo"), |
490 | tr("Can not edit data, currently syncing")); | 491 | tr("Can not edit data, currently syncing")); |
491 | return; | 492 | return; |
492 | } | 493 | } |
493 | 494 | ||
494 | if ( !QPEMessageBox::confirmDelete( this, tr( "Todo" ), tr("all completed tasks?") ) ) | 495 | if ( !QPEMessageBox::confirmDelete( this, tr( "Todo" ), tr("all completed tasks?") ) ) |
495 | return; | 496 | return; |
496 | 497 | ||
497 | // FIXME | 498 | // FIXME |
498 | //m_todoMgr.remove( currentView()->completed() ); | 499 | //m_todoMgr.remove( currentView()->completed() ); |
499 | currentView()->updateView( ); | 500 | currentView()->updateView( ); |
500 | } | 501 | } |
501 | void MainWindow::slotFind() { | 502 | void MainWindow::slotFind() { |
502 | 503 | ||
503 | } | 504 | } |
504 | void MainWindow::slotEdit() { | 505 | void MainWindow::slotEdit() { |
505 | slotEdit( currentView()->current() ); | 506 | slotEdit( currentView()->current() ); |
506 | } | 507 | } |
507 | /* | 508 | /* |
508 | * set the category | 509 | * set the category |
509 | */ | 510 | */ |
510 | void MainWindow::setCategory( int c) { | 511 | void MainWindow::setCategory( int c) { |
511 | if ( c <= 0 ) return; | 512 | if ( c <= 0 ) return; |
512 | 513 | ||
513 | 514 | ||
514 | qWarning("Iterating over cats %d", c ); | 515 | qWarning("Iterating over cats %d", c ); |
515 | for ( unsigned int i = 1; i < m_catMenu->count(); i++ ) | 516 | for ( unsigned int i = 1; i < m_catMenu->count(); i++ ) |
516 | m_catMenu->setItemChecked(i, c == (int)i ); | 517 | m_catMenu->setItemChecked(i, c == (int)i ); |
517 | 518 | ||
518 | if (c == 1 ) { | 519 | if (c == 1 ) { |
519 | m_curCat = QString::null; | 520 | m_curCat = QString::null; |
520 | setCaption( tr("Todo") + " - " + tr("All Categories" ) ); | 521 | setCaption( tr("Todo") + " - " + tr("All Categories" ) ); |
521 | 522 | ||
522 | }else if ( c == (int)m_catMenu->count() - 1 ) { | 523 | }else if ( c == (int)m_catMenu->count() - 1 ) { |
523 | m_curCat = tr("Unfiled"); | 524 | m_curCat = tr("Unfiled"); |
524 | setCaption( tr("Todo") + " - " + tr("Unfiled") ); | 525 | setCaption( tr("Todo") + " - " + tr("Unfiled") ); |
525 | }else { | 526 | }else { |
526 | m_curCat = m_todoMgr.categories()[c-2]; | 527 | m_curCat = m_todoMgr.categories()[c-2]; |
527 | setCaption( tr("Todo") + " - " + m_curCat ); | 528 | setCaption( tr("Todo") + " - " + m_curCat ); |
528 | } | 529 | } |
529 | m_catMenu->setItemChecked( c, true ); | 530 | m_catMenu->setItemChecked( c, true ); |
530 | 531 | ||
531 | currentView()->setShowCategory( m_curCat ); | 532 | currentView()->setShowCategory( m_curCat ); |
532 | raiseCurrentView(); | 533 | raiseCurrentView(); |
533 | } | 534 | } |
534 | void MainWindow::slotShowDeadLine( bool dead) { | 535 | void MainWindow::slotShowDeadLine( bool dead) { |
535 | m_deadline = dead; | 536 | m_deadline = dead; |
536 | currentView()->setShowDeadline( dead ); | 537 | currentView()->setShowDeadline( dead ); |
537 | } | 538 | } |
538 | void MainWindow::slotShowCompleted( bool show) { | 539 | void MainWindow::slotShowCompleted( bool show) { |
539 | m_completed = show; | 540 | m_completed = show; |
540 | currentView()->setShowCompleted( m_completed ); | 541 | currentView()->setShowCompleted( m_completed ); |
541 | } | 542 | } |
542 | bool MainWindow::showOverDue()const { | 543 | bool MainWindow::showOverDue()const { |
543 | return m_overdue; | 544 | return m_overdue; |
544 | } | 545 | } |
545 | void MainWindow::setDocument( const QString& fi) { | 546 | void MainWindow::setDocument( const QString& fi) { |
546 | DocLnk doc(fi); | 547 | DocLnk doc(fi); |
547 | if (doc.isValid() ) | 548 | if (doc.isValid() ) |
548 | receiveFile(doc.file() ); | 549 | receiveFile(doc.file() ); |
549 | else | 550 | else |
550 | receiveFile(fi ); | 551 | receiveFile(fi ); |
551 | } | 552 | } |
552 | 553 | ||
553 | static const char *beamfile = "/tmp/opie-todo.vcs"; | 554 | static const char *beamfile = "/tmp/opie-todo.vcs"; |
554 | void MainWindow::slotBeam() { | 555 | void MainWindow::slotBeam() { |
555 | ::unlink( beamfile ); | 556 | ::unlink( beamfile ); |
556 | OTodo todo = event( currentView()->current() ); | 557 | OTodo todo = event( currentView()->current() ); |
557 | OTodoAccessVCal* cal = new OTodoAccessVCal(QString::fromLatin1(beamfile) ); | 558 | OTodoAccessVCal* cal = new OTodoAccessVCal(QString::fromLatin1(beamfile) ); |
558 | OTodoAccess acc( cal ); | 559 | OTodoAccess acc( cal ); |
559 | acc.load(); | 560 | acc.load(); |
560 | acc.add( todo ); | 561 | acc.add( todo ); |
561 | acc.save(); | 562 | acc.save(); |
562 | Ir* ir = new Ir(this ); | 563 | Ir* ir = new Ir(this ); |
563 | connect(ir, SIGNAL(done(Ir*) ), | 564 | connect(ir, SIGNAL(done(Ir*) ), |
564 | this, SLOT(beamDone(Ir*) ) ); | 565 | this, SLOT(beamDone(Ir*) ) ); |
565 | ir->send( beamfile, todo.summary(), "text/x-vCalendar" ); | 566 | ir->send( beamfile, todo.summary(), "text/x-vCalendar" ); |
566 | 567 | ||
567 | } | 568 | } |
568 | void MainWindow::beamDone( Ir* ir) { | 569 | void MainWindow::beamDone( Ir* ir) { |
569 | delete ir; | 570 | delete ir; |
570 | ::unlink( beamfile ); | 571 | ::unlink( beamfile ); |
571 | } | 572 | } |
572 | void MainWindow::receiveFile( const QString& filename ) { | 573 | void MainWindow::receiveFile( const QString& filename ) { |
573 | OTodoAccessVCal* cal = new OTodoAccessVCal(filename ); | 574 | OTodoAccessVCal* cal = new OTodoAccessVCal(filename ); |
574 | OTodoAccess acc( cal ); | 575 | OTodoAccess acc( cal ); |
575 | acc.load(); | 576 | acc.load(); |
576 | OTodoAccess::List list = acc.allRecords(); | 577 | OTodoAccess::List list = acc.allRecords(); |
577 | 578 | ||
578 | QString message = tr("<P>%1 new tasks arrived.<p>Would you like to add them to your Todolist?").arg(list.count() ); | 579 | QString message = tr("<P>%1 new tasks arrived.<p>Would you like to add them to your Todolist?").arg(list.count() ); |
579 | 580 | ||
580 | if ( QMessageBox::information(this, tr("New Tasks"), | 581 | if ( QMessageBox::information(this, tr("New Tasks"), |
581 | message, QMessageBox::Ok, | 582 | message, QMessageBox::Ok, |
582 | QMessageBox::Cancel ) == QMessageBox::Ok ) { | 583 | QMessageBox::Cancel ) == QMessageBox::Ok ) { |
583 | OTodoAccess::List::Iterator it; | 584 | OTodoAccess::List::Iterator it; |
584 | for ( it = list.begin(); it != list.end(); ++it ) | 585 | for ( it = list.begin(); it != list.end(); ++it ) |
585 | m_todoMgr.add( (*it) ); | 586 | m_todoMgr.add( (*it) ); |
586 | 587 | ||
587 | currentView()->updateView(); | 588 | currentView()->updateView(); |
588 | } | 589 | } |
589 | } | 590 | } |
590 | 591 | ||
591 | void MainWindow::slotFlush() { | 592 | void MainWindow::slotFlush() { |
592 | m_syncing = FALSE; | 593 | m_syncing = FALSE; |
593 | m_todoMgr.save(); | 594 | m_todoMgr.save(); |
594 | } | 595 | } |
595 | void MainWindow::slotShowDetails() { | 596 | void MainWindow::slotShowDetails() { |
596 | slotShow( currentView()->current() ); | 597 | slotShow( currentView()->current() ); |
597 | } | 598 | } |
598 | /* | 599 | /* |
599 | * populate the Categories | 600 | * populate the Categories |
600 | * Menu | 601 | * Menu |
601 | */ | 602 | */ |
602 | void MainWindow::populateCategories() { | 603 | void MainWindow::populateCategories() { |
603 | m_todoMgr.load(); | 604 | m_todoMgr.load(); |
604 | 605 | ||
605 | m_catMenu->clear(); | 606 | m_catMenu->clear(); |
606 | int id, rememberId; | 607 | int id, rememberId; |
607 | id = 1; | 608 | id = 1; |
608 | rememberId = 1; | 609 | rememberId = 1; |
609 | 610 | ||
610 | m_catMenu->insertItem( tr( "All Categories" ), id++ ); | 611 | m_catMenu->insertItem( tr( "All Categories" ), id++ ); |
611 | m_catMenu->insertSeparator(); | 612 | m_catMenu->insertSeparator(); |
612 | QStringList categories = m_todoMgr.categories(); | 613 | QStringList categories = m_todoMgr.categories(); |
613 | categories.append( tr( "Unfiled" ) ); | 614 | categories.append( tr( "Unfiled" ) ); |
614 | for ( QStringList::Iterator it = categories.begin(); | 615 | for ( QStringList::Iterator it = categories.begin(); |
615 | it != categories.end(); ++it ) { | 616 | it != categories.end(); ++it ) { |
616 | m_catMenu->insertItem( *it, id ); | 617 | m_catMenu->insertItem( *it, id ); |
617 | if ( *it == currentCategory() ) | 618 | if ( *it == currentCategory() ) |
618 | rememberId = id; | 619 | rememberId = id; |
619 | ++id; | 620 | ++id; |
620 | } | 621 | } |
621 | setCategory( rememberId ); | 622 | setCategory( rememberId ); |
622 | } | 623 | } |
623 | bool MainWindow::showCompleted()const { | 624 | bool MainWindow::showCompleted()const { |
624 | return m_completed; | 625 | return m_completed; |
625 | } | 626 | } |
626 | bool MainWindow::showDeadline()const { | 627 | bool MainWindow::showDeadline()const { |
627 | return m_deadline; | 628 | return m_deadline; |
628 | } | 629 | } |
629 | QString MainWindow::currentCategory()const { | 630 | QString MainWindow::currentCategory()const { |
630 | return m_curCat; | 631 | return m_curCat; |
631 | } | 632 | } |
632 | int MainWindow::currentCatId() { | 633 | int MainWindow::currentCatId() { |
633 | return m_todoMgr.catId( m_curCat ); | 634 | return m_todoMgr.catId( m_curCat ); |
634 | } | 635 | } |
635 | ViewBase* MainWindow::currentView() { | 636 | ViewBase* MainWindow::currentView() { |
636 | return m_curView; | 637 | return m_curView; |
637 | } | 638 | } |
638 | void MainWindow::raiseCurrentView() { | 639 | void MainWindow::raiseCurrentView() { |
639 | m_stack->raiseWidget( m_curView->widget() ); | 640 | m_stack->raiseWidget( m_curView->widget() ); |
640 | } | 641 | } |
641 | void MainWindow::slotShowDue(bool ov) { | 642 | void MainWindow::slotShowDue(bool ov) { |
642 | m_overdue = ov; | 643 | m_overdue = ov; |
643 | currentView()->showOverDue( ov ); | 644 | currentView()->showOverDue( ov ); |
644 | raiseCurrentView(); | 645 | raiseCurrentView(); |
645 | } | 646 | } |
646 | void MainWindow::slotShow( int uid ) { | 647 | void MainWindow::slotShow( int uid ) { |
647 | qWarning("slotShow"); | 648 | qWarning("slotShow"); |
648 | currentShow()->slotShow( event( uid ) ); | 649 | currentShow()->slotShow( event( uid ) ); |
649 | m_stack->raiseWidget( currentShow()->widget() ); | 650 | m_stack->raiseWidget( currentShow()->widget() ); |
650 | } | 651 | } |
651 | void MainWindow::slotEdit( int uid ) { | 652 | void MainWindow::slotEdit( int uid ) { |
652 | if(m_syncing) { | 653 | if(m_syncing) { |
653 | QMessageBox::warning(this, tr("Todo"), | 654 | QMessageBox::warning(this, tr("Todo"), |
654 | tr("Can not edit data, currently syncing")); | 655 | tr("Can not edit data, currently syncing")); |
655 | return; | 656 | return; |
656 | } | 657 | } |
657 | 658 | ||
658 | OTodo todo = m_todoMgr.event( uid ); | 659 | OTodo todo = m_todoMgr.event( uid ); |
659 | 660 | ||
660 | todo = currentEditor()->edit(this, todo ); | 661 | todo = currentEditor()->edit(this, todo ); |
661 | 662 | ||
662 | /* if completed */ | 663 | /* if completed */ |
663 | if ( currentEditor()->accepted() ) { | 664 | if ( currentEditor()->accepted() ) { |
664 | qWarning("Replacing now" ); | 665 | qWarning("Replacing now" ); |
665 | m_todoMgr.update( todo.uid(), todo ); | 666 | m_todoMgr.update( todo.uid(), todo ); |
666 | currentView()->replaceEvent( todo ); | 667 | currentView()->replaceEvent( todo ); |
667 | /* a Category might have changed */ | 668 | /* a Category might have changed */ |
668 | populateCategories(); | 669 | populateCategories(); |
669 | } | 670 | } |
670 | 671 | ||
671 | raiseCurrentView(); | 672 | raiseCurrentView(); |
672 | } | 673 | } |
673 | /* | 674 | /* |
674 | void MainWindow::slotUpdate1( int uid, const SmallTodo& ev) { | 675 | void MainWindow::slotUpdate1( int uid, const SmallTodo& ev) { |
675 | m_todoMgr.update( uid, ev ); | 676 | m_todoMgr.update( uid, ev ); |
676 | } | 677 | } |
677 | */ | 678 | */ |
678 | void MainWindow::updateTodo( const OTodo& ev) { | 679 | void MainWindow::updateTodo( const OTodo& ev) { |
679 | m_todoMgr.update( ev.uid() , ev ); | 680 | m_todoMgr.update( ev.uid() , ev ); |
680 | } | 681 | } |
681 | /* The view changed it's configuration | 682 | /* The view changed it's configuration |
682 | * update the view menu | 683 | * update the view menu |
683 | */ | 684 | */ |
684 | void MainWindow::slotUpdate3( QWidget* ) { | 685 | void MainWindow::slotUpdate3( QWidget* ) { |
685 | 686 | ||
686 | } | 687 | } |
687 | void MainWindow::updateList() { | 688 | void MainWindow::updateList() { |
688 | m_todoMgr.updateList(); | 689 | m_todoMgr.updateList(); |
689 | } | 690 | } |
690 | void MainWindow::setReadAhead( uint count ) { | 691 | void MainWindow::setReadAhead( uint count ) { |
691 | if (m_todoMgr.todoDB() ) | 692 | if (m_todoMgr.todoDB() ) |
692 | m_todoMgr.todoDB()->setReadAhead( count ); | 693 | m_todoMgr.todoDB()->setReadAhead( count ); |
693 | } | 694 | } |
694 | void MainWindow::slotQuickEntered() { | 695 | void MainWindow::slotQuickEntered() { |
695 | qWarning("entered"); | 696 | qWarning("entered"); |
696 | OTodo todo = quickEditor()->todo(); | 697 | OTodo todo = quickEditor()->todo(); |
697 | if (todo.isEmpty() ) | 698 | if (todo.isEmpty() ) |
698 | return; | 699 | return; |
699 | 700 | ||
700 | m_todoMgr.add( todo ); | 701 | m_todoMgr.add( todo ); |
701 | currentView()->addEvent( todo ); | 702 | currentView()->addEvent( todo ); |
702 | raiseCurrentView(); | 703 | raiseCurrentView(); |
703 | } | 704 | } |
704 | QuickEditBase* MainWindow::quickEditor() { | 705 | QuickEditBase* MainWindow::quickEditor() { |
705 | return m_curQuick; | 706 | return m_curQuick; |
706 | } | 707 | } |
diff --git a/core/pim/todo/otaskeditor.cpp b/core/pim/todo/otaskeditor.cpp new file mode 100644 index 0000000..e8e922f --- a/dev/null +++ b/core/pim/todo/otaskeditor.cpp | |||
@@ -0,0 +1,83 @@ | |||
1 | #include <qdatetime.h> | ||
2 | #include <qlayout.h> | ||
3 | #include <qlabel.h> | ||
4 | #include <qmultilineedit.h> | ||
5 | |||
6 | #include <opie/orecurrancewidget.h> | ||
7 | |||
8 | #include "taskeditoroverviewimpl.h" | ||
9 | #include "taskeditoradvanced.h" | ||
10 | #include "taskeditoralarms.h" | ||
11 | |||
12 | #include "otaskeditor.h" | ||
13 | |||
14 | OTaskEditor::OTaskEditor(int cur) | ||
15 | : QDialog(0, 0, TRUE ) { | ||
16 | init(); | ||
17 | OTodo to; | ||
18 | to.setCategories( cur ); | ||
19 | load(to); | ||
20 | m_uid = 1; // generate a new one | ||
21 | } | ||
22 | OTaskEditor::OTaskEditor( const OTodo& to) | ||
23 | : QDialog(0, 0, TRUE ) { | ||
24 | init(); | ||
25 | load( to ); | ||
26 | m_uid = to.uid(); | ||
27 | } | ||
28 | OTaskEditor::~OTaskEditor() { | ||
29 | |||
30 | } | ||
31 | OTodo OTaskEditor::todo()const{ | ||
32 | qWarning("saving!"); | ||
33 | OTodo to; | ||
34 | to.setUid(m_uid ); | ||
35 | m_overView->save( to ); | ||
36 | to.setDescription( m_line->text() ); | ||
37 | |||
38 | return to; | ||
39 | } | ||
40 | void OTaskEditor::load(const OTodo& to) { | ||
41 | m_overView->load( to ); | ||
42 | m_line->setText( to.description() ); | ||
43 | } | ||
44 | void OTaskEditor::init() { | ||
45 | QVBoxLayout* lay = new QVBoxLayout(this); | ||
46 | setCaption("Task Editor"); | ||
47 | m_tab = new OTabWidget(this); | ||
48 | |||
49 | /* | ||
50 | * Add the Widgets | ||
51 | */ | ||
52 | m_overView = new TaskEditorOverViewImpl(m_tab ); | ||
53 | m_tab->addTab( m_overView, QString::null, tr("Overview") ); | ||
54 | |||
55 | m_adv = new TaskEditorAdvanced( m_tab ); | ||
56 | m_line = new QMultiLineEdit(m_adv ); | ||
57 | QLabel* label = new QLabel(m_adv ); | ||
58 | label->setText( tr("Description") ); | ||
59 | ((QGridLayout*) m_adv->layout() )->addWidget( label,3, 0 ); | ||
60 | ((QGridLayout*) m_adv->layout())->addWidget( m_line,4,0 ); | ||
61 | m_tab->addTab( m_adv, QString::null, tr("Advanced") ); | ||
62 | |||
63 | m_alarm = new TaskEditorAlarms( m_tab ); | ||
64 | m_tab->addTab( m_alarm, QString::null, tr("Alarms") ); | ||
65 | |||
66 | m_remind = new TaskEditorAlarms( m_tab ); | ||
67 | m_tab->addTab( m_remind, QString::null, tr("Reminders") ); | ||
68 | |||
69 | QLabel* lbl = new QLabel(m_tab ); | ||
70 | lbl->setText( tr("X-Ref") ); | ||
71 | m_tab->addTab( lbl, QString::null, tr("X-Ref") ); | ||
72 | |||
73 | m_rec = new ORecurranceWidget( true, QDate::currentDate(), this ); | ||
74 | m_tab->addTab( m_rec, QString::null, tr("Recurrance") ); | ||
75 | |||
76 | lay->addWidget(m_tab ); | ||
77 | |||
78 | /* signal and slots */ | ||
79 | connect(m_overView, SIGNAL(recurranceEnabled(bool) ), | ||
80 | m_rec, SLOT(setEnabled(bool) ) ); | ||
81 | |||
82 | m_tab->setCurrentTab( m_overView ); | ||
83 | } | ||
diff --git a/core/pim/todo/otaskeditor.h b/core/pim/todo/otaskeditor.h new file mode 100644 index 0000000..5842fdc --- a/dev/null +++ b/core/pim/todo/otaskeditor.h | |||
@@ -0,0 +1,37 @@ | |||
1 | #ifndef OPIE_TASK_EDITOR_H | ||
2 | #define OPIE_TASK_EDITOR_H | ||
3 | |||
4 | #include <qdialog.h> | ||
5 | |||
6 | #include <opie/otodo.h> | ||
7 | #include <opie/otabwidget.h> | ||
8 | |||
9 | class TaskEditorOverViewImpl; | ||
10 | class TaskEditorAdvanced; | ||
11 | class TaskEditorAlarms; | ||
12 | class ORecurranceWidget; | ||
13 | class QMultiLineEdit; | ||
14 | class OTaskEditor : public QDialog { | ||
15 | Q_OBJECT | ||
16 | public: | ||
17 | OTaskEditor(int cur); | ||
18 | OTaskEditor( const OTodo& todo ); | ||
19 | ~OTaskEditor(); | ||
20 | |||
21 | OTodo todo()const; | ||
22 | private: | ||
23 | void load( const OTodo& ); | ||
24 | void init(); | ||
25 | |||
26 | OTabWidget *m_tab; | ||
27 | TaskEditorOverViewImpl* m_overView; | ||
28 | TaskEditorAdvanced *m_adv; | ||
29 | TaskEditorAlarms *m_alarm; | ||
30 | TaskEditorAlarms* m_remind; | ||
31 | ORecurranceWidget* m_rec; | ||
32 | QMultiLineEdit* m_line; | ||
33 | int m_uid; | ||
34 | |||
35 | }; | ||
36 | |||
37 | #endif | ||
diff --git a/core/pim/todo/taskeditoradvanced.ui b/core/pim/todo/taskeditoradvanced.ui new file mode 100644 index 0000000..3ea1346 --- a/dev/null +++ b/core/pim/todo/taskeditoradvanced.ui | |||
@@ -0,0 +1,222 @@ | |||
1 | <!DOCTYPE UI><UI> | ||
2 | <class>TaskEditorAdvanced</class> | ||
3 | <widget> | ||
4 | <class>QWidget</class> | ||
5 | <property stdset="1"> | ||
6 | <name>name</name> | ||
7 | <cstring>TaskEditorAdvanced</cstring> | ||
8 | </property> | ||
9 | <property stdset="1"> | ||
10 | <name>geometry</name> | ||
11 | <rect> | ||
12 | <x>0</x> | ||
13 | <y>0</y> | ||
14 | <width>236</width> | ||
15 | <height>307</height> | ||
16 | </rect> | ||
17 | </property> | ||
18 | <property stdset="1"> | ||
19 | <name>caption</name> | ||
20 | <string>Form2</string> | ||
21 | </property> | ||
22 | <property> | ||
23 | <name>layoutMargin</name> | ||
24 | </property> | ||
25 | <property> | ||
26 | <name>layoutSpacing</name> | ||
27 | </property> | ||
28 | <grid> | ||
29 | <property stdset="1"> | ||
30 | <name>margin</name> | ||
31 | <number>8</number> | ||
32 | </property> | ||
33 | <property stdset="1"> | ||
34 | <name>spacing</name> | ||
35 | <number>6</number> | ||
36 | </property> | ||
37 | <widget row="0" column="0" > | ||
38 | <class>QLayoutWidget</class> | ||
39 | <property stdset="1"> | ||
40 | <name>name</name> | ||
41 | <cstring>Layout13</cstring> | ||
42 | </property> | ||
43 | <hbox> | ||
44 | <property stdset="1"> | ||
45 | <name>margin</name> | ||
46 | <number>0</number> | ||
47 | </property> | ||
48 | <property stdset="1"> | ||
49 | <name>spacing</name> | ||
50 | <number>6</number> | ||
51 | </property> | ||
52 | <widget> | ||
53 | <class>QLabel</class> | ||
54 | <property stdset="1"> | ||
55 | <name>name</name> | ||
56 | <cstring>lblState</cstring> | ||
57 | </property> | ||
58 | <property stdset="1"> | ||
59 | <name>text</name> | ||
60 | <string>State:</string> | ||
61 | </property> | ||
62 | </widget> | ||
63 | <widget> | ||
64 | <class>QComboBox</class> | ||
65 | <item> | ||
66 | <property> | ||
67 | <name>text</name> | ||
68 | <string>Started</string> | ||
69 | </property> | ||
70 | </item> | ||
71 | <item> | ||
72 | <property> | ||
73 | <name>text</name> | ||
74 | <string>Postponed</string> | ||
75 | </property> | ||
76 | </item> | ||
77 | <item> | ||
78 | <property> | ||
79 | <name>text</name> | ||
80 | <string>Finished</string> | ||
81 | </property> | ||
82 | </item> | ||
83 | <item> | ||
84 | <property> | ||
85 | <name>text</name> | ||
86 | <string>Not started</string> | ||
87 | </property> | ||
88 | </item> | ||
89 | <property stdset="1"> | ||
90 | <name>name</name> | ||
91 | <cstring>cmbState</cstring> | ||
92 | </property> | ||
93 | </widget> | ||
94 | </hbox> | ||
95 | </widget> | ||
96 | <widget row="2" column="0" > | ||
97 | <class>QLayoutWidget</class> | ||
98 | <property stdset="1"> | ||
99 | <name>name</name> | ||
100 | <cstring>Layout17</cstring> | ||
101 | </property> | ||
102 | <hbox> | ||
103 | <property stdset="1"> | ||
104 | <name>margin</name> | ||
105 | <number>0</number> | ||
106 | </property> | ||
107 | <property stdset="1"> | ||
108 | <name>spacing</name> | ||
109 | <number>6</number> | ||
110 | </property> | ||
111 | <widget> | ||
112 | <class>QLabel</class> | ||
113 | <property stdset="1"> | ||
114 | <name>name</name> | ||
115 | <cstring>lblMaintainer</cstring> | ||
116 | </property> | ||
117 | <property stdset="1"> | ||
118 | <name>text</name> | ||
119 | <string>Maintainer</string> | ||
120 | </property> | ||
121 | </widget> | ||
122 | <widget> | ||
123 | <class>QLabel</class> | ||
124 | <property stdset="1"> | ||
125 | <name>name</name> | ||
126 | <cstring>txtMaintainer</cstring> | ||
127 | </property> | ||
128 | <property stdset="1"> | ||
129 | <name>text</name> | ||
130 | <string>test</string> | ||
131 | </property> | ||
132 | <property stdset="1"> | ||
133 | <name>textFormat</name> | ||
134 | <enum>RichText</enum> | ||
135 | </property> | ||
136 | </widget> | ||
137 | <widget> | ||
138 | <class>QLayoutWidget</class> | ||
139 | <property stdset="1"> | ||
140 | <name>name</name> | ||
141 | <cstring>Layout16</cstring> | ||
142 | </property> | ||
143 | <vbox> | ||
144 | <property stdset="1"> | ||
145 | <name>margin</name> | ||
146 | <number>0</number> | ||
147 | </property> | ||
148 | <property stdset="1"> | ||
149 | <name>spacing</name> | ||
150 | <number>6</number> | ||
151 | </property> | ||
152 | <widget> | ||
153 | <class>QToolButton</class> | ||
154 | <property stdset="1"> | ||
155 | <name>name</name> | ||
156 | <cstring>tbtMaintainer</cstring> | ||
157 | </property> | ||
158 | <property stdset="1"> | ||
159 | <name>text</name> | ||
160 | <string>...</string> | ||
161 | </property> | ||
162 | </widget> | ||
163 | </vbox> | ||
164 | </widget> | ||
165 | </hbox> | ||
166 | </widget> | ||
167 | <widget row="1" column="0" > | ||
168 | <class>QLayoutWidget</class> | ||
169 | <property stdset="1"> | ||
170 | <name>name</name> | ||
171 | <cstring>Layout4</cstring> | ||
172 | </property> | ||
173 | <hbox> | ||
174 | <property stdset="1"> | ||
175 | <name>margin</name> | ||
176 | <number>0</number> | ||
177 | </property> | ||
178 | <property stdset="1"> | ||
179 | <name>spacing</name> | ||
180 | <number>6</number> | ||
181 | </property> | ||
182 | <widget> | ||
183 | <class>QLabel</class> | ||
184 | <property stdset="1"> | ||
185 | <name>name</name> | ||
186 | <cstring>txtMode</cstring> | ||
187 | </property> | ||
188 | <property stdset="1"> | ||
189 | <name>text</name> | ||
190 | <string>Maintain Mode:</string> | ||
191 | </property> | ||
192 | </widget> | ||
193 | <widget> | ||
194 | <class>QComboBox</class> | ||
195 | <item> | ||
196 | <property> | ||
197 | <name>text</name> | ||
198 | <string>Responsible</string> | ||
199 | </property> | ||
200 | </item> | ||
201 | <item> | ||
202 | <property> | ||
203 | <name>text</name> | ||
204 | <string>Done By</string> | ||
205 | </property> | ||
206 | </item> | ||
207 | <item> | ||
208 | <property> | ||
209 | <name>text</name> | ||
210 | <string>Coordinating</string> | ||
211 | </property> | ||
212 | </item> | ||
213 | <property stdset="1"> | ||
214 | <name>name</name> | ||
215 | <cstring>cmbMode</cstring> | ||
216 | </property> | ||
217 | </widget> | ||
218 | </hbox> | ||
219 | </widget> | ||
220 | </grid> | ||
221 | </widget> | ||
222 | </UI> | ||
diff --git a/core/pim/todo/taskeditoralarms.ui b/core/pim/todo/taskeditoralarms.ui new file mode 100644 index 0000000..ab21796 --- a/dev/null +++ b/core/pim/todo/taskeditoralarms.ui | |||
@@ -0,0 +1,148 @@ | |||
1 | <!DOCTYPE UI><UI> | ||
2 | <class>TaskEditorAlarms</class> | ||
3 | <author>zecke</author> | ||
4 | <widget> | ||
5 | <class>QWidget</class> | ||
6 | <property stdset="1"> | ||
7 | <name>name</name> | ||
8 | <cstring>TaskEditorAlarms</cstring> | ||
9 | </property> | ||
10 | <property stdset="1"> | ||
11 | <name>geometry</name> | ||
12 | <rect> | ||
13 | <x>0</x> | ||
14 | <y>0</y> | ||
15 | <width>195</width> | ||
16 | <height>271</height> | ||
17 | </rect> | ||
18 | </property> | ||
19 | <property stdset="1"> | ||
20 | <name>caption</name> | ||
21 | <string>Form3</string> | ||
22 | </property> | ||
23 | <property> | ||
24 | <name>layoutMargin</name> | ||
25 | </property> | ||
26 | <grid> | ||
27 | <property stdset="1"> | ||
28 | <name>margin</name> | ||
29 | <number>8</number> | ||
30 | </property> | ||
31 | <property stdset="1"> | ||
32 | <name>spacing</name> | ||
33 | <number>6</number> | ||
34 | </property> | ||
35 | <widget row="0" column="0" > | ||
36 | <class>QLayoutWidget</class> | ||
37 | <property stdset="1"> | ||
38 | <name>name</name> | ||
39 | <cstring>Layout19</cstring> | ||
40 | </property> | ||
41 | <vbox> | ||
42 | <property stdset="1"> | ||
43 | <name>margin</name> | ||
44 | <number>0</number> | ||
45 | </property> | ||
46 | <property stdset="1"> | ||
47 | <name>spacing</name> | ||
48 | <number>6</number> | ||
49 | </property> | ||
50 | <widget> | ||
51 | <class>QLabel</class> | ||
52 | <property stdset="1"> | ||
53 | <name>name</name> | ||
54 | <cstring>txtAlarm</cstring> | ||
55 | </property> | ||
56 | <property stdset="1"> | ||
57 | <name>text</name> | ||
58 | <string>empty</string> | ||
59 | </property> | ||
60 | </widget> | ||
61 | <widget> | ||
62 | <class>QListView</class> | ||
63 | <property stdset="1"> | ||
64 | <name>name</name> | ||
65 | <cstring>lstAlarms</cstring> | ||
66 | </property> | ||
67 | </widget> | ||
68 | </vbox> | ||
69 | </widget> | ||
70 | <widget row="1" column="0" > | ||
71 | <class>QLayoutWidget</class> | ||
72 | <property stdset="1"> | ||
73 | <name>name</name> | ||
74 | <cstring>Layout23</cstring> | ||
75 | </property> | ||
76 | <hbox> | ||
77 | <property stdset="1"> | ||
78 | <name>margin</name> | ||
79 | <number>0</number> | ||
80 | </property> | ||
81 | <property stdset="1"> | ||
82 | <name>spacing</name> | ||
83 | <number>6</number> | ||
84 | </property> | ||
85 | <widget> | ||
86 | <class>QPushButton</class> | ||
87 | <property stdset="1"> | ||
88 | <name>name</name> | ||
89 | <cstring>alAdd</cstring> | ||
90 | </property> | ||
91 | <property stdset="1"> | ||
92 | <name>sizePolicy</name> | ||
93 | <sizepolicy> | ||
94 | <hsizetype>4</hsizetype> | ||
95 | <vsizetype>0</vsizetype> | ||
96 | </sizepolicy> | ||
97 | </property> | ||
98 | <property stdset="1"> | ||
99 | <name>text</name> | ||
100 | <string>&Add</string> | ||
101 | </property> | ||
102 | <property stdset="1"> | ||
103 | <name>autoResize</name> | ||
104 | <bool>true</bool> | ||
105 | </property> | ||
106 | </widget> | ||
107 | <widget> | ||
108 | <class>QPushButton</class> | ||
109 | <property stdset="1"> | ||
110 | <name>name</name> | ||
111 | <cstring>alEdit</cstring> | ||
112 | </property> | ||
113 | <property stdset="1"> | ||
114 | <name>sizePolicy</name> | ||
115 | <sizepolicy> | ||
116 | <hsizetype>4</hsizetype> | ||
117 | <vsizetype>0</vsizetype> | ||
118 | </sizepolicy> | ||
119 | </property> | ||
120 | <property stdset="1"> | ||
121 | <name>text</name> | ||
122 | <string>&Edit</string> | ||
123 | </property> | ||
124 | <property stdset="1"> | ||
125 | <name>autoResize</name> | ||
126 | <bool>true</bool> | ||
127 | </property> | ||
128 | </widget> | ||
129 | <widget> | ||
130 | <class>QPushButton</class> | ||
131 | <property stdset="1"> | ||
132 | <name>name</name> | ||
133 | <cstring>alRemove</cstring> | ||
134 | </property> | ||
135 | <property stdset="1"> | ||
136 | <name>text</name> | ||
137 | <string>&Remove</string> | ||
138 | </property> | ||
139 | <property stdset="1"> | ||
140 | <name>autoResize</name> | ||
141 | <bool>true</bool> | ||
142 | </property> | ||
143 | </widget> | ||
144 | </hbox> | ||
145 | </widget> | ||
146 | </grid> | ||
147 | </widget> | ||
148 | </UI> | ||
diff --git a/core/pim/todo/taskeditoroverview.ui b/core/pim/todo/taskeditoroverview.ui new file mode 100644 index 0000000..a6bf645 --- a/dev/null +++ b/core/pim/todo/taskeditoroverview.ui | |||
@@ -0,0 +1,542 @@ | |||
1 | <!DOCTYPE UI><UI> | ||
2 | <class>TaskEditorOverView</class> | ||
3 | <author>zecke</author> | ||
4 | <widget> | ||
5 | <class>QWidget</class> | ||
6 | <property stdset="1"> | ||
7 | <name>name</name> | ||
8 | <cstring>TaskEditorOverView</cstring> | ||
9 | </property> | ||
10 | <property stdset="1"> | ||
11 | <name>geometry</name> | ||
12 | <rect> | ||
13 | <x>0</x> | ||
14 | <y>0</y> | ||
15 | <width>308</width> | ||
16 | <height>445</height> | ||
17 | </rect> | ||
18 | </property> | ||
19 | <property stdset="1"> | ||
20 | <name>caption</name> | ||
21 | <string>Form1</string> | ||
22 | </property> | ||
23 | <property> | ||
24 | <name>layoutMargin</name> | ||
25 | </property> | ||
26 | <grid> | ||
27 | <property stdset="1"> | ||
28 | <name>margin</name> | ||
29 | <number>4</number> | ||
30 | </property> | ||
31 | <property stdset="1"> | ||
32 | <name>spacing</name> | ||
33 | <number>6</number> | ||
34 | </property> | ||
35 | <widget row="5" column="0" rowspan="1" colspan="2" > | ||
36 | <class>QLayoutWidget</class> | ||
37 | <property stdset="1"> | ||
38 | <name>name</name> | ||
39 | <cstring>Layout11</cstring> | ||
40 | </property> | ||
41 | <hbox> | ||
42 | <property stdset="1"> | ||
43 | <name>margin</name> | ||
44 | <number>0</number> | ||
45 | </property> | ||
46 | <property stdset="1"> | ||
47 | <name>spacing</name> | ||
48 | <number>6</number> | ||
49 | </property> | ||
50 | <widget> | ||
51 | <class>QLabel</class> | ||
52 | <property stdset="1"> | ||
53 | <name>name</name> | ||
54 | <cstring>txtPrio</cstring> | ||
55 | </property> | ||
56 | <property stdset="1"> | ||
57 | <name>text</name> | ||
58 | <string>Priority</string> | ||
59 | </property> | ||
60 | </widget> | ||
61 | <widget> | ||
62 | <class>QComboBox</class> | ||
63 | <item> | ||
64 | <property> | ||
65 | <name>text</name> | ||
66 | <string>1 - Very High</string> | ||
67 | </property> | ||
68 | </item> | ||
69 | <item> | ||
70 | <property> | ||
71 | <name>text</name> | ||
72 | <string>2 - High</string> | ||
73 | </property> | ||
74 | </item> | ||
75 | <item> | ||
76 | <property> | ||
77 | <name>text</name> | ||
78 | <string>3 - Normal</string> | ||
79 | </property> | ||
80 | </item> | ||
81 | <item> | ||
82 | <property> | ||
83 | <name>text</name> | ||
84 | <string>4 - Low</string> | ||
85 | </property> | ||
86 | </item> | ||
87 | <item> | ||
88 | <property> | ||
89 | <name>text</name> | ||
90 | <string>5 - Very Low</string> | ||
91 | </property> | ||
92 | </item> | ||
93 | <property stdset="1"> | ||
94 | <name>name</name> | ||
95 | <cstring>cmbPrio</cstring> | ||
96 | </property> | ||
97 | </widget> | ||
98 | </hbox> | ||
99 | </widget> | ||
100 | <widget row="4" column="0" rowspan="1" colspan="2" > | ||
101 | <class>QLayoutWidget</class> | ||
102 | <property stdset="1"> | ||
103 | <name>name</name> | ||
104 | <cstring>Layout11</cstring> | ||
105 | </property> | ||
106 | <hbox> | ||
107 | <property stdset="1"> | ||
108 | <name>margin</name> | ||
109 | <number>0</number> | ||
110 | </property> | ||
111 | <property stdset="1"> | ||
112 | <name>spacing</name> | ||
113 | <number>6</number> | ||
114 | </property> | ||
115 | <widget> | ||
116 | <class>QLabel</class> | ||
117 | <property stdset="1"> | ||
118 | <name>name</name> | ||
119 | <cstring>txtProgress</cstring> | ||
120 | </property> | ||
121 | <property stdset="1"> | ||
122 | <name>text</name> | ||
123 | <string>Progress</string> | ||
124 | </property> | ||
125 | </widget> | ||
126 | <widget> | ||
127 | <class>QComboBox</class> | ||
128 | <item> | ||
129 | <property> | ||
130 | <name>text</name> | ||
131 | <string>0 %</string> | ||
132 | </property> | ||
133 | </item> | ||
134 | <item> | ||
135 | <property> | ||
136 | <name>text</name> | ||
137 | <string>20 %</string> | ||
138 | </property> | ||
139 | </item> | ||
140 | <item> | ||
141 | <property> | ||
142 | <name>text</name> | ||
143 | <string>40 %</string> | ||
144 | </property> | ||
145 | </item> | ||
146 | <item> | ||
147 | <property> | ||
148 | <name>text</name> | ||
149 | <string>60 %</string> | ||
150 | </property> | ||
151 | </item> | ||
152 | <item> | ||
153 | <property> | ||
154 | <name>text</name> | ||
155 | <string>80 %</string> | ||
156 | </property> | ||
157 | </item> | ||
158 | <item> | ||
159 | <property> | ||
160 | <name>text</name> | ||
161 | <string>100 %</string> | ||
162 | </property> | ||
163 | </item> | ||
164 | <property stdset="1"> | ||
165 | <name>name</name> | ||
166 | <cstring>cmbProgress</cstring> | ||
167 | </property> | ||
168 | </widget> | ||
169 | </hbox> | ||
170 | </widget> | ||
171 | <widget row="2" column="0" rowspan="1" colspan="2" > | ||
172 | <class>QLayoutWidget</class> | ||
173 | <property stdset="1"> | ||
174 | <name>name</name> | ||
175 | <cstring>Layout9</cstring> | ||
176 | </property> | ||
177 | <hbox> | ||
178 | <property stdset="1"> | ||
179 | <name>margin</name> | ||
180 | <number>0</number> | ||
181 | </property> | ||
182 | <property stdset="1"> | ||
183 | <name>spacing</name> | ||
184 | <number>6</number> | ||
185 | </property> | ||
186 | <widget> | ||
187 | <class>QCheckBox</class> | ||
188 | <property stdset="1"> | ||
189 | <name>name</name> | ||
190 | <cstring>ckbDue</cstring> | ||
191 | </property> | ||
192 | <property stdset="1"> | ||
193 | <name>text</name> | ||
194 | <string>Due Date:</string> | ||
195 | </property> | ||
196 | </widget> | ||
197 | <widget> | ||
198 | <class>QPushButton</class> | ||
199 | <property stdset="1"> | ||
200 | <name>name</name> | ||
201 | <cstring>btnDue</cstring> | ||
202 | </property> | ||
203 | <property stdset="1"> | ||
204 | <name>enabled</name> | ||
205 | <bool>false</bool> | ||
206 | </property> | ||
207 | <property stdset="1"> | ||
208 | <name>text</name> | ||
209 | <string>1 Januar 2002</string> | ||
210 | </property> | ||
211 | </widget> | ||
212 | </hbox> | ||
213 | </widget> | ||
214 | <widget row="1" column="0" rowspan="1" colspan="2" > | ||
215 | <class>QLayoutWidget</class> | ||
216 | <property stdset="1"> | ||
217 | <name>name</name> | ||
218 | <cstring>Layout8</cstring> | ||
219 | </property> | ||
220 | <hbox> | ||
221 | <property stdset="1"> | ||
222 | <name>margin</name> | ||
223 | <number>0</number> | ||
224 | </property> | ||
225 | <property stdset="1"> | ||
226 | <name>spacing</name> | ||
227 | <number>6</number> | ||
228 | </property> | ||
229 | <widget> | ||
230 | <class>QCheckBox</class> | ||
231 | <property stdset="1"> | ||
232 | <name>name</name> | ||
233 | <cstring>ckbStart</cstring> | ||
234 | </property> | ||
235 | <property stdset="1"> | ||
236 | <name>text</name> | ||
237 | <string>Start Date:</string> | ||
238 | </property> | ||
239 | </widget> | ||
240 | <widget> | ||
241 | <class>QPushButton</class> | ||
242 | <property stdset="1"> | ||
243 | <name>name</name> | ||
244 | <cstring>btnStart</cstring> | ||
245 | </property> | ||
246 | <property stdset="1"> | ||
247 | <name>enabled</name> | ||
248 | <bool>false</bool> | ||
249 | </property> | ||
250 | <property stdset="1"> | ||
251 | <name>text</name> | ||
252 | <string>1 Januar 2001</string> | ||
253 | </property> | ||
254 | </widget> | ||
255 | </hbox> | ||
256 | </widget> | ||
257 | <widget row="0" column="0" rowspan="1" colspan="2" > | ||
258 | <class>QLayoutWidget</class> | ||
259 | <property stdset="1"> | ||
260 | <name>name</name> | ||
261 | <cstring>Layout7</cstring> | ||
262 | </property> | ||
263 | <hbox> | ||
264 | <property stdset="1"> | ||
265 | <name>margin</name> | ||
266 | <number>0</number> | ||
267 | </property> | ||
268 | <property stdset="1"> | ||
269 | <name>spacing</name> | ||
270 | <number>6</number> | ||
271 | </property> | ||
272 | <widget> | ||
273 | <class>QLabel</class> | ||
274 | <property stdset="1"> | ||
275 | <name>name</name> | ||
276 | <cstring>lblSum</cstring> | ||
277 | </property> | ||
278 | <property stdset="1"> | ||
279 | <name>text</name> | ||
280 | <string>Summary</string> | ||
281 | </property> | ||
282 | </widget> | ||
283 | <widget> | ||
284 | <class>QComboBox</class> | ||
285 | <item> | ||
286 | <property> | ||
287 | <name>text</name> | ||
288 | <string>Complete</string> | ||
289 | </property> | ||
290 | </item> | ||
291 | <item> | ||
292 | <property> | ||
293 | <name>text</name> | ||
294 | <string>work on</string> | ||
295 | </property> | ||
296 | </item> | ||
297 | <item> | ||
298 | <property> | ||
299 | <name>text</name> | ||
300 | <string>buy</string> | ||
301 | </property> | ||
302 | </item> | ||
303 | <item> | ||
304 | <property> | ||
305 | <name>text</name> | ||
306 | <string>organize</string> | ||
307 | </property> | ||
308 | </item> | ||
309 | <item> | ||
310 | <property> | ||
311 | <name>text</name> | ||
312 | <string>get</string> | ||
313 | </property> | ||
314 | </item> | ||
315 | <item> | ||
316 | <property> | ||
317 | <name>text</name> | ||
318 | <string>Update</string> | ||
319 | </property> | ||
320 | </item> | ||
321 | <item> | ||
322 | <property> | ||
323 | <name>text</name> | ||
324 | <string>Create</string> | ||
325 | </property> | ||
326 | </item> | ||
327 | <item> | ||
328 | <property> | ||
329 | <name>text</name> | ||
330 | <string>Plan</string> | ||
331 | </property> | ||
332 | </item> | ||
333 | <item> | ||
334 | <property> | ||
335 | <name>text</name> | ||
336 | <string>Call</string> | ||
337 | </property> | ||
338 | </item> | ||
339 | <item> | ||
340 | <property> | ||
341 | <name>text</name> | ||
342 | <string>Mail</string> | ||
343 | </property> | ||
344 | </item> | ||
345 | <property stdset="1"> | ||
346 | <name>name</name> | ||
347 | <cstring>cmbSum</cstring> | ||
348 | </property> | ||
349 | <property stdset="1"> | ||
350 | <name>editable</name> | ||
351 | <bool>true</bool> | ||
352 | </property> | ||
353 | </widget> | ||
354 | </hbox> | ||
355 | </widget> | ||
356 | <widget row="3" column="0" rowspan="1" colspan="2" > | ||
357 | <class>QLayoutWidget</class> | ||
358 | <property stdset="1"> | ||
359 | <name>name</name> | ||
360 | <cstring>Layout10</cstring> | ||
361 | </property> | ||
362 | <hbox> | ||
363 | <property stdset="1"> | ||
364 | <name>margin</name> | ||
365 | <number>0</number> | ||
366 | </property> | ||
367 | <property stdset="1"> | ||
368 | <name>spacing</name> | ||
369 | <number>6</number> | ||
370 | </property> | ||
371 | <widget> | ||
372 | <class>QCheckBox</class> | ||
373 | <property stdset="1"> | ||
374 | <name>name</name> | ||
375 | <cstring>ckbComp</cstring> | ||
376 | </property> | ||
377 | <property stdset="1"> | ||
378 | <name>enabled</name> | ||
379 | <bool>true</bool> | ||
380 | </property> | ||
381 | <property stdset="1"> | ||
382 | <name>text</name> | ||
383 | <string>Completed Date</string> | ||
384 | </property> | ||
385 | </widget> | ||
386 | <widget> | ||
387 | <class>QPushButton</class> | ||
388 | <property stdset="1"> | ||
389 | <name>name</name> | ||
390 | <cstring>btnComp</cstring> | ||
391 | </property> | ||
392 | <property stdset="1"> | ||
393 | <name>enabled</name> | ||
394 | <bool>false</bool> | ||
395 | </property> | ||
396 | <property stdset="1"> | ||
397 | <name>text</name> | ||
398 | <string>1 Januar 2002</string> | ||
399 | </property> | ||
400 | </widget> | ||
401 | </hbox> | ||
402 | </widget> | ||
403 | <widget row="6" column="0" > | ||
404 | <class>QCheckBox</class> | ||
405 | <property stdset="1"> | ||
406 | <name>name</name> | ||
407 | <cstring>ckbCompleted</cstring> | ||
408 | </property> | ||
409 | <property stdset="1"> | ||
410 | <name>text</name> | ||
411 | <string>Completed</string> | ||
412 | </property> | ||
413 | </widget> | ||
414 | <widget row="7" column="0" rowspan="1" colspan="2" > | ||
415 | <class>QLayoutWidget</class> | ||
416 | <property stdset="1"> | ||
417 | <name>name</name> | ||
418 | <cstring>Layout12</cstring> | ||
419 | </property> | ||
420 | <hbox> | ||
421 | <property stdset="1"> | ||
422 | <name>margin</name> | ||
423 | <number>0</number> | ||
424 | </property> | ||
425 | <property stdset="1"> | ||
426 | <name>spacing</name> | ||
427 | <number>6</number> | ||
428 | </property> | ||
429 | <widget> | ||
430 | <class>QLabel</class> | ||
431 | <property stdset="1"> | ||
432 | <name>name</name> | ||
433 | <cstring>txtCategory</cstring> | ||
434 | </property> | ||
435 | <property stdset="1"> | ||
436 | <name>text</name> | ||
437 | <string>Category</string> | ||
438 | </property> | ||
439 | </widget> | ||
440 | <widget> | ||
441 | <class>CategorySelect</class> | ||
442 | <property stdset="1"> | ||
443 | <name>name</name> | ||
444 | <cstring>comboCategory</cstring> | ||
445 | </property> | ||
446 | <property stdset="1"> | ||
447 | <name>sizePolicy</name> | ||
448 | <sizepolicy> | ||
449 | <hsizetype>7</hsizetype> | ||
450 | <vsizetype>0</vsizetype> | ||
451 | </sizepolicy> | ||
452 | </property> | ||
453 | <property stdset="1"> | ||
454 | <name>minimumSize</name> | ||
455 | <size> | ||
456 | <width>60</width> | ||
457 | <height>20</height> | ||
458 | </size> | ||
459 | </property> | ||
460 | </widget> | ||
461 | </hbox> | ||
462 | </widget> | ||
463 | <widget row="8" column="0" rowspan="1" colspan="2" > | ||
464 | <class>QCheckBox</class> | ||
465 | <property stdset="1"> | ||
466 | <name>name</name> | ||
467 | <cstring>CheckBox7</cstring> | ||
468 | </property> | ||
469 | <property stdset="1"> | ||
470 | <name>text</name> | ||
471 | <string>Enable Recurrance</string> | ||
472 | </property> | ||
473 | </widget> | ||
474 | <spacer row="9" column="1" > | ||
475 | <property> | ||
476 | <name>name</name> | ||
477 | <cstring>Spacer1</cstring> | ||
478 | </property> | ||
479 | <property stdset="1"> | ||
480 | <name>orientation</name> | ||
481 | <enum>Vertical</enum> | ||
482 | </property> | ||
483 | <property stdset="1"> | ||
484 | <name>sizeType</name> | ||
485 | <enum>Expanding</enum> | ||
486 | </property> | ||
487 | <property> | ||
488 | <name>sizeHint</name> | ||
489 | <size> | ||
490 | <width>20</width> | ||
491 | <height>20</height> | ||
492 | </size> | ||
493 | </property> | ||
494 | </spacer> | ||
495 | </grid> | ||
496 | </widget> | ||
497 | <customwidgets> | ||
498 | <customwidget> | ||
499 | <class>CategorySelect</class> | ||
500 | <header location="global">qpe/categoryselect.h</header> | ||
501 | <sizehint> | ||
502 | <width>-1</width> | ||
503 | <height>-1</height> | ||
504 | </sizehint> | ||
505 | <container>0</container> | ||
506 | <sizepolicy> | ||
507 | <hordata>7</hordata> | ||
508 | <verdata>1</verdata> | ||
509 | </sizepolicy> | ||
510 | <pixmap>image0</pixmap> | ||
511 | </customwidget> | ||
512 | </customwidgets> | ||
513 | <images> | ||
514 | <image> | ||
515 | <name>image0</name> | ||
516 | <data format="XPM.GZ" length="646">789c6dd2c10ac2300c00d07bbf2234b7229d1be245fc04c5a3201e4615f430059d0711ff5ddb2e6bb236ec90eed134cb5a19d8ef36602af5ecdbfeeac05dda0798d3abebde87e3faa374d3807fa0d633a52d38d8de6f679fe33fc776e196f53cd010188256a3600a292882096246517815ca99884606e18044a3a40d91824820924265a7923a2e8bcd05f33db1173e002913175f2a6be6d3294871a2d95fa00e8a94ee017b69d339d90df1e77c57ea072ede6758</data> | ||
517 | </image> | ||
518 | </images> | ||
519 | <connections> | ||
520 | <connection> | ||
521 | <sender>ckbStart</sender> | ||
522 | <signal>clicked()</signal> | ||
523 | <receiver>TaskEditorOverView</receiver> | ||
524 | <slot>slotStartChecked()</slot> | ||
525 | </connection> | ||
526 | <connection> | ||
527 | <sender>ckbDue</sender> | ||
528 | <signal>clicked()</signal> | ||
529 | <receiver>TaskEditorOverView</receiver> | ||
530 | <slot>slotDueChecked()</slot> | ||
531 | </connection> | ||
532 | <connection> | ||
533 | <sender>ckbComp</sender> | ||
534 | <signal>clicked()</signal> | ||
535 | <receiver>TaskEditorOverView</receiver> | ||
536 | <slot>slotCompletedChecked()</slot> | ||
537 | </connection> | ||
538 | <slot access="protected">slotCompletedChecked()</slot> | ||
539 | <slot access="protected">slotDueChecked()</slot> | ||
540 | <slot access="protected">slotStartChecked()</slot> | ||
541 | </connections> | ||
542 | </UI> | ||
diff --git a/core/pim/todo/taskeditoroverviewimpl.cpp b/core/pim/todo/taskeditoroverviewimpl.cpp new file mode 100644 index 0000000..b9b2ae6 --- a/dev/null +++ b/core/pim/todo/taskeditoroverviewimpl.cpp | |||
@@ -0,0 +1,169 @@ | |||
1 | #include <qapplication.h> | ||
2 | #include <qcheckbox.h> | ||
3 | #include <qcombobox.h> | ||
4 | #include <qpopupmenu.h> | ||
5 | |||
6 | #include <qpe/datebookmonth.h> | ||
7 | #include <qpe/categoryselect.h> | ||
8 | #include <qpe/timestring.h> | ||
9 | |||
10 | #include "taskeditoroverviewimpl.h" | ||
11 | |||
12 | /* | ||
13 | * we need to hack | ||
14 | */ | ||
15 | |||
16 | TaskEditorOverViewImpl::TaskEditorOverViewImpl( QWidget* parent, const char* name ) | ||
17 | : TaskEditorOverView( parent, name ) { | ||
18 | init(); | ||
19 | } | ||
20 | TaskEditorOverViewImpl::~TaskEditorOverViewImpl() { | ||
21 | } | ||
22 | void TaskEditorOverViewImpl::load( const OTodo& todo) { | ||
23 | QDate date = QDate::currentDate(); | ||
24 | QString str = TimeString::longDateString( date ); | ||
25 | |||
26 | emit recurranceEnabled( FALSE ); | ||
27 | ckbStart->setChecked( FALSE ); | ||
28 | btnStart->setText( str ); | ||
29 | |||
30 | ckbComp->setChecked( FALSE ); | ||
31 | btnComp->setText( str ); | ||
32 | |||
33 | cmbProgress->setCurrentItem( todo.progress()/20 ); | ||
34 | cmbSum->insertItem( todo.summary(), 0 ); | ||
35 | cmbSum->setCurrentItem( 0 ); | ||
36 | |||
37 | ckbDue->setChecked( todo.hasDueDate() ); | ||
38 | btnDue->setText( TimeString::longDateString( todo.dueDate() ) ); | ||
39 | |||
40 | cmbPrio->setCurrentItem( todo.priority() -1 ); | ||
41 | ckbCompleted->setChecked( todo.isCompleted() ); | ||
42 | |||
43 | comboCategory->setCategories( todo.categories(), "Todo List", tr("Todo List") ); | ||
44 | |||
45 | } | ||
46 | void TaskEditorOverViewImpl::save( OTodo& to) { | ||
47 | qWarning("save it now"); | ||
48 | if ( ckbDue->isChecked() ) { | ||
49 | to.setDueDate( m_due ); | ||
50 | to.setHasDueDate( true ); | ||
51 | }else | ||
52 | to.setHasDueDate( false ); | ||
53 | if ( comboCategory->currentCategory() != -1 ) { | ||
54 | QArray<int> arr = comboCategory->currentCategories(); | ||
55 | to.setCategories( arr ); | ||
56 | } | ||
57 | to.setPriority( cmbPrio->currentItem() + 1 ); | ||
58 | to.setCompleted( ckbCompleted->isChecked() ); | ||
59 | to.setSummary( cmbSum->currentText() ); | ||
60 | to.setProgress( cmbProgress->currentItem() * 20 ); | ||
61 | } | ||
62 | /* | ||
63 | * here we will init the basic view | ||
64 | * one Popup for each Date Button | ||
65 | * and some other signal and slots connection | ||
66 | */ | ||
67 | void TaskEditorOverViewImpl::init() { | ||
68 | QDate curDate = QDate::currentDate(); | ||
69 | m_start = m_comp = m_due = curDate; | ||
70 | QString str = TimeString::longDateString( curDate ); | ||
71 | |||
72 | /* Start Date Picker */ | ||
73 | m_startPop = new QPopupMenu(this); | ||
74 | m_startBook = new DateBookMonth(m_startPop, 0, TRUE ); | ||
75 | m_startPop->insertItem( m_startBook ); | ||
76 | connect( m_startBook, SIGNAL( dateClicked(int, int, int) ), | ||
77 | this, SLOT(slotStartChanged(int, int, int) ) ); | ||
78 | |||
79 | |||
80 | /* Due Date Picker */ | ||
81 | m_duePop = new QPopupMenu(this); | ||
82 | m_dueBook = new DateBookMonth(m_duePop, 0, TRUE ); | ||
83 | m_duePop->insertItem( m_dueBook ); | ||
84 | connect( m_dueBook, SIGNAL( dateClicked(int, int, int) ), | ||
85 | this, SLOT(slotDueChanged(int, int, int) ) ); | ||
86 | |||
87 | m_compPop = new QPopupMenu(this); | ||
88 | m_compBook = new DateBookMonth(m_compPop, 0, TRUE ); | ||
89 | m_compPop->insertItem(m_compBook ); | ||
90 | connect( m_compBook, SIGNAL(dateClicked(int, int, int) ), | ||
91 | this, SLOT(slotCompletedChanged(int, int, int) ) ); | ||
92 | |||
93 | |||
94 | /* | ||
95 | * another part of the hack | ||
96 | * it's deprecated in Qt2 but | ||
97 | * still available in my qt-copy of Qt3.1beta2 | ||
98 | */ | ||
99 | btnDue->setIsMenuButton( TRUE ); | ||
100 | btnStart->setIsMenuButton( TRUE ); | ||
101 | btnComp->setIsMenuButton( TRUE ); | ||
102 | |||
103 | /* now connect the hack */ | ||
104 | connect(btnDue, SIGNAL(clicked() ), | ||
105 | this, SLOT(hackySlotHack2() ) ); | ||
106 | connect(btnStart, SIGNAL(clicked() ), | ||
107 | this, SLOT(hackySlotHack1() ) ); | ||
108 | connect(btnComp, SIGNAL(clicked() ), | ||
109 | this, SLOT(hackySlotHack3() ) ); | ||
110 | |||
111 | /* recurrance */ | ||
112 | connect(CheckBox7, SIGNAL(clicked() ), | ||
113 | this, SLOT(slotRecClicked() ) ); | ||
114 | } | ||
115 | |||
116 | void TaskEditorOverViewImpl::slotStartChecked() { | ||
117 | qWarning("slotStartChecked"); | ||
118 | btnStart->setEnabled( ckbStart->isChecked() ); | ||
119 | } | ||
120 | void TaskEditorOverViewImpl::slotStartChanged(int y, int m, int d) { | ||
121 | m_start.setYMD( y, m, d ); | ||
122 | btnStart->setText( TimeString::longDateString( m_start ) ); | ||
123 | } | ||
124 | void TaskEditorOverViewImpl::slotDueChecked() { | ||
125 | btnDue->setEnabled( ckbDue->isChecked() ); | ||
126 | qWarning("slotDueChecked"); | ||
127 | } | ||
128 | void TaskEditorOverViewImpl::slotDueChanged(int y, int m, int d ) { | ||
129 | m_due.setYMD(y, m, d ); | ||
130 | btnDue->setText( TimeString::longDateString( m_due ) ); | ||
131 | } | ||
132 | void TaskEditorOverViewImpl::slotCompletedChecked() { | ||
133 | btnComp->setEnabled( ckbComp->isChecked() ); | ||
134 | qWarning("slotCompletedChecked"); | ||
135 | } | ||
136 | void TaskEditorOverViewImpl::slotCompletedChanged(int y, int m, int d) { | ||
137 | m_comp.setYMD( y, m, d ); | ||
138 | btnComp->setText( TimeString::longDateString( m_comp ) ); | ||
139 | } | ||
140 | /* | ||
141 | * called by a button pressed event... | ||
142 | * three slots to avoid ugly name() tests | ||
143 | * to sender() | ||
144 | */ | ||
145 | void TaskEditorOverViewImpl::hackySlotHack1() { | ||
146 | btnStart->setDown( FALSE ); | ||
147 | popup( btnStart, m_startPop ); | ||
148 | } | ||
149 | void TaskEditorOverViewImpl::hackySlotHack2() { | ||
150 | btnDue->setDown( FALSE ); | ||
151 | popup( btnDue, m_duePop ); | ||
152 | } | ||
153 | void TaskEditorOverViewImpl::hackySlotHack3() { | ||
154 | btnComp->setDown( FALSE ); | ||
155 | popup( btnComp, m_compPop ); | ||
156 | } | ||
157 | void TaskEditorOverViewImpl::slotRecClicked() { | ||
158 | qWarning("enabled recurrance"); | ||
159 | emit recurranceEnabled( CheckBox7->isChecked() ); | ||
160 | } | ||
161 | /* | ||
162 | * GPL from TT QPushButton code | ||
163 | */ | ||
164 | void TaskEditorOverViewImpl::popup( QPushButton* pu, QPopupMenu* pop) { | ||
165 | if ( pu->mapToGlobal( QPoint(0, pu->rect().bottom() ) ).y() + pop->sizeHint().height() <= qApp->desktop()->height() ) | ||
166 | pop->exec( pu->mapToGlobal( pu->rect().bottomLeft() ) ); | ||
167 | else | ||
168 | pop->exec( pu->mapToGlobal( pu->rect().topLeft() - QPoint(0, pu->sizeHint().height() ) ) ); | ||
169 | } | ||
diff --git a/core/pim/todo/taskeditoroverviewimpl.h b/core/pim/todo/taskeditoroverviewimpl.h new file mode 100644 index 0000000..4fab381 --- a/dev/null +++ b/core/pim/todo/taskeditoroverviewimpl.h | |||
@@ -0,0 +1,54 @@ | |||
1 | #ifndef OPIE_TASK_EDITOR_VIEW_IMPL_H | ||
2 | #define OPIE_TASK_EDITOR_VIEW_IMPL_H | ||
3 | |||
4 | #include <qsize.h> | ||
5 | |||
6 | #include <opie/otodo.h> | ||
7 | |||
8 | #include "taskeditoroverview.h" | ||
9 | |||
10 | class DateBookMonth; | ||
11 | class QPushButton; | ||
12 | class QPopupMenu; | ||
13 | class TaskEditorOverViewImpl : public TaskEditorOverView { | ||
14 | Q_OBJECT | ||
15 | public: | ||
16 | TaskEditorOverViewImpl(QWidget* parent, const char* name = 0); | ||
17 | ~TaskEditorOverViewImpl(); | ||
18 | |||
19 | void load( const OTodo& ); | ||
20 | void save( OTodo& ); | ||
21 | signals: | ||
22 | void recurranceEnabled( bool ); | ||
23 | |||
24 | private: | ||
25 | void init(); | ||
26 | void popup(QPushButton*, QPopupMenu*); | ||
27 | DateBookMonth* m_dueBook; | ||
28 | DateBookMonth* m_startBook; | ||
29 | DateBookMonth* m_compBook; | ||
30 | QDate m_start; | ||
31 | QDate m_comp; | ||
32 | QDate m_due; | ||
33 | QPopupMenu* m_startPop; | ||
34 | QPopupMenu* m_compPop; | ||
35 | QPopupMenu* m_duePop; | ||
36 | bool m_bDue : 1; | ||
37 | |||
38 | private slots: | ||
39 | void slotStartChecked(); | ||
40 | void slotStartChanged(int, int, int ); | ||
41 | void slotDueChecked(); | ||
42 | void slotDueChanged(int, int, int ); | ||
43 | void slotCompletedChecked(); | ||
44 | void slotCompletedChanged(int, int, int ); | ||
45 | |||
46 | void hackySlotHack1(); | ||
47 | void hackySlotHack2(); | ||
48 | void hackySlotHack3(); | ||
49 | |||
50 | void slotRecClicked(); | ||
51 | }; | ||
52 | |||
53 | |||
54 | #endif | ||
diff --git a/core/pim/todo/todo.pro b/core/pim/todo/todo.pro index d432e78..8f21416 100644 --- a/core/pim/todo/todo.pro +++ b/core/pim/todo/todo.pro | |||
@@ -1,59 +1,61 @@ | |||
1 | TEMPLATE= app | 1 | TEMPLATE= app |
2 | CONFIG = qt warn_on release | 2 | CONFIG = qt warn_on release |
3 | DESTDIR = $(OPIEDIR)/bin | 3 | DESTDIR = $(OPIEDIR)/bin |
4 | 4 | ||
5 | HEADERS= smalltodo.h \ | 5 | HEADERS= smalltodo.h \ |
6 | todomanager.h \ | 6 | todomanager.h \ |
7 | mainwindow.h \ | 7 | mainwindow.h \ |
8 | todoview.h \ | 8 | todoview.h \ |
9 | todoentryimpl.h \ | ||
10 | tableview.h \ | 9 | tableview.h \ |
11 | tableitems.h \ | 10 | tableitems.h \ |
12 | todotemplatemanager.h \ | 11 | todotemplatemanager.h \ |
13 | todoeditor.h \ | 12 | todoeditor.h \ |
14 | todoshow.h \ | 13 | todoshow.h \ |
15 | textviewshow.h \ | 14 | textviewshow.h \ |
16 | templateeditor.h \ | 15 | templateeditor.h \ |
17 | templatedialog.h \ | 16 | templatedialog.h \ |
18 | templatedialogimpl.h \ | 17 | templatedialogimpl.h \ |
19 | quickedit.h \ | 18 | quickedit.h \ |
20 | quickeditimpl.h | 19 | quickeditimpl.h \ |
20 | otaskeditor.h \ | ||
21 | taskeditoroverviewimpl.h | ||
21 | 22 | ||
22 | SOURCES= smalltodo.cpp \ | 23 | SOURCES= smalltodo.cpp \ |
23 | todomanager.cpp \ | 24 | todomanager.cpp \ |
24 | mainwindow.cpp \ | 25 | mainwindow.cpp \ |
25 | main.cpp \ | 26 | main.cpp \ |
26 | todoentryimpl.cpp \ | ||
27 | tableview.cpp \ | 27 | tableview.cpp \ |
28 | tableitems.cpp \ | 28 | tableitems.cpp \ |
29 | todoview.cpp \ | 29 | todoview.cpp \ |
30 | todotemplatemanager.cpp \ | 30 | todotemplatemanager.cpp \ |
31 | todoeditor.cpp \ | 31 | todoeditor.cpp \ |
32 | todoshow.cpp \ | 32 | todoshow.cpp \ |
33 | textviewshow.cpp \ | 33 | textviewshow.cpp \ |
34 | templateeditor.cpp \ | 34 | templateeditor.cpp \ |
35 | templatedialog.cpp \ | 35 | templatedialog.cpp \ |
36 | templatedialogimpl.cpp \ | 36 | templatedialogimpl.cpp \ |
37 | quickeditimpl.cpp \ | 37 | quickeditimpl.cpp \ |
38 | quickedit.cpp | 38 | quickedit.cpp \ |
39 | otaskeditor.cpp \ | ||
40 | taskeditoroverviewimpl.cpp | ||
39 | 41 | ||
40 | INTERFACES= todoentry.ui | 42 | INTERFACES= taskeditoradvanced.ui taskeditoralarms.ui taskeditoroverview.ui |
41 | TARGET = todolist | 43 | TARGET = todolist |
42 | INCLUDEPATH += $(OPIEDIR)/include | 44 | INCLUDEPATH += $(OPIEDIR)/include |
43 | DEPENDPATH+= $(OPIEDIR)/include | 45 | DEPENDPATH+= $(OPIEDIR)/include |
44 | LIBS += -lqpe -lopie | 46 | LIBS += -lqpe -lopie |
45 | 47 | ||
46 | TRANSLATIONS = ../../../i18n/de/todolist.ts \ | 48 | TRANSLATIONS = ../../../i18n/de/todolist.ts \ |
47 | ../../../i18n/en/todolist.ts \ | 49 | ../../../i18n/en/todolist.ts \ |
48 | ../../../i18n/es/todolist.ts \ | 50 | ../../../i18n/es/todolist.ts \ |
49 | ../../../i18n/fr/todolist.ts \ | 51 | ../../../i18n/fr/todolist.ts \ |
50 | ../../../i18n/hu/todolist.ts \ | 52 | ../../../i18n/hu/todolist.ts \ |
51 | ../../../i18n/ja/todolist.ts \ | 53 | ../../../i18n/ja/todolist.ts \ |
52 | ../../../i18n/ko/todolist.ts \ | 54 | ../../../i18n/ko/todolist.ts \ |
53 | ../../../i18n/no/todolist.ts \ | 55 | ../../../i18n/no/todolist.ts \ |
54 | ../../../i18n/pl/todolist.ts \ | 56 | ../../../i18n/pl/todolist.ts \ |
55 | ../../../i18n/pt/todolist.ts \ | 57 | ../../../i18n/pt/todolist.ts \ |
56 | ../../../i18n/pt_BR/todolist.ts \ | 58 | ../../../i18n/pt_BR/todolist.ts \ |
57 | ../../../i18n/sl/todolist.ts \ | 59 | ../../../i18n/sl/todolist.ts \ |
58 | ../../../i18n/zh_CN/todolist.ts \ | 60 | ../../../i18n/zh_CN/todolist.ts \ |
59 | ../../../i18n/zh_TW/todolist.ts | 61 | ../../../i18n/zh_TW/todolist.ts |
diff --git a/core/pim/todo/todoeditor.cpp b/core/pim/todo/todoeditor.cpp index c9ade20..e19ab8d 100644 --- a/core/pim/todo/todoeditor.cpp +++ b/core/pim/todo/todoeditor.cpp | |||
@@ -1,53 +1,55 @@ | |||
1 | 1 | ||
2 | #include "todoentryimpl.h" | 2 | #include "otaskeditor.h" |
3 | #include "todoeditor.h" | 3 | #include "todoeditor.h" |
4 | 4 | ||
5 | using namespace Todo; | 5 | using namespace Todo; |
6 | 6 | ||
7 | Editor::Editor() { | 7 | Editor::Editor() { |
8 | m_accepted = false; | 8 | m_accepted = false; |
9 | } | 9 | } |
10 | Editor::~Editor() { | 10 | Editor::~Editor() { |
11 | } | 11 | } |
12 | OTodo Editor::newTodo( int cur, | 12 | OTodo Editor::newTodo( int cur, |
13 | QWidget* par) { | 13 | QWidget* par) { |
14 | 14 | ||
15 | NewTaskDialog e( cur, par, 0, TRUE ); | 15 | OTaskEditor e( cur); |
16 | 16 | ||
17 | 17 | ||
18 | #if defined(Q_WS_QWS) || defined(_WS_QWS_) | 18 | #if defined(Q_WS_QWS) || defined(_WS_QWS_) |
19 | e.showMaximized(); | 19 | e.showMaximized(); |
20 | #endif | 20 | #endif |
21 | 21 | ||
22 | int ret = e.exec(); | 22 | int ret = e.exec(); |
23 | if ( QDialog::Accepted == ret ) { | 23 | if ( QDialog::Accepted == ret ) { |
24 | m_accepted = true; | 24 | m_accepted = true; |
25 | }else | 25 | }else |
26 | m_accepted = false; | 26 | m_accepted = false; |
27 | 27 | ||
28 | OTodo ev = e.todoEntry(); | 28 | OTodo ev = e.todo(); |
29 | qWarning("Todo uid"); | ||
30 | qWarning("Todo %s %d %d", ev.summary().latin1(), ev.progress(), ev.isCompleted() ); | ||
29 | ev.setUid(1); | 31 | ev.setUid(1); |
30 | 32 | ||
31 | return ev; | 33 | return ev; |
32 | } | 34 | } |
33 | OTodo Editor::edit( QWidget *wid, | 35 | OTodo Editor::edit( QWidget *wid, |
34 | const OTodo& todo ) { | 36 | const OTodo& todo ) { |
35 | NewTaskDialog e( todo, wid, 0, TRUE ); | 37 | OTaskEditor e( todo ); |
36 | e.setCaption( QObject::tr( "Edit Task" ) ); | 38 | e.setCaption( QObject::tr( "Edit Task" ) ); |
37 | 39 | ||
38 | #if defined(Q_WS_QWS) || defined(_WS_QWS_) | 40 | #if defined(Q_WS_QWS) || defined(_WS_QWS_) |
39 | e.showMaximized(); | 41 | e.showMaximized(); |
40 | #endif | 42 | #endif |
41 | int ret = e.exec(); | 43 | int ret = e.exec(); |
42 | 44 | ||
43 | OTodo ev = e.todoEntry(); | 45 | OTodo ev = e.todo(); |
44 | if ( ret == QDialog::Accepted ) | 46 | if ( ret == QDialog::Accepted ) |
45 | m_accepted = true; | 47 | m_accepted = true; |
46 | else | 48 | else |
47 | m_accepted = false; | 49 | m_accepted = false; |
48 | 50 | ||
49 | return ev; | 51 | return ev; |
50 | } | 52 | } |
51 | bool Editor::accepted()const { | 53 | bool Editor::accepted()const { |
52 | return m_accepted; | 54 | return m_accepted; |
53 | } | 55 | } |
diff --git a/core/pim/todo/todoentry.ui b/core/pim/todo/todoentry.ui deleted file mode 100644 index 60547f2..0000000 --- a/core/pim/todo/todoentry.ui +++ b/dev/null | |||
@@ -1,481 +0,0 @@ | |||
1 | <!DOCTYPE UI><UI> | ||
2 | <class>NewTaskDialogBase</class> | ||
3 | <comment>********************************************************************* | ||
4 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | ||
5 | ** | ||
6 | ** This file is part of Qtopia Environment. | ||
7 | ** | ||
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 | ||
10 | ** Foundation and appearing in the file LICENSE.GPL included in the | ||
11 | ** packaging of this file. | ||
12 | ** | ||
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. | ||
15 | ** | ||
16 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | ||
17 | ** | ||
18 | ** Contact info@trolltech.com if any conditions of this licensing are | ||
19 | ** not clear to you. | ||
20 | ** | ||
21 | *********************************************************************</comment> | ||
22 | <widget> | ||
23 | <class>QDialog</class> | ||
24 | <property stdset="1"> | ||
25 | <name>name</name> | ||
26 | <cstring>NewTaskDialogBase</cstring> | ||
27 | </property> | ||
28 | <property stdset="1"> | ||
29 | <name>geometry</name> | ||
30 | <rect> | ||
31 | <x>0</x> | ||
32 | <y>0</y> | ||
33 | <width>239</width> | ||
34 | <height>320</height> | ||
35 | </rect> | ||
36 | </property> | ||
37 | <property stdset="1"> | ||
38 | <name>caption</name> | ||
39 | <string>New Task</string> | ||
40 | </property> | ||
41 | <property> | ||
42 | <name>layoutMargin</name> | ||
43 | </property> | ||
44 | <property> | ||
45 | <name>layoutSpacing</name> | ||
46 | </property> | ||
47 | <vbox> | ||
48 | <property stdset="1"> | ||
49 | <name>margin</name> | ||
50 | <number>4</number> | ||
51 | </property> | ||
52 | <property stdset="1"> | ||
53 | <name>spacing</name> | ||
54 | <number>4</number> | ||
55 | </property> | ||
56 | <widget> | ||
57 | <class>QLayoutWidget</class> | ||
58 | <property stdset="1"> | ||
59 | <name>name</name> | ||
60 | <cstring>Layout19</cstring> | ||
61 | </property> | ||
62 | <property> | ||
63 | <name>layoutSpacing</name> | ||
64 | </property> | ||
65 | <grid> | ||
66 | <property stdset="1"> | ||
67 | <name>margin</name> | ||
68 | <number>0</number> | ||
69 | </property> | ||
70 | <property stdset="1"> | ||
71 | <name>spacing</name> | ||
72 | <number>4</number> | ||
73 | </property> | ||
74 | <widget row="3" column="1" > | ||
75 | <class>QLayoutWidget</class> | ||
76 | <property stdset="1"> | ||
77 | <name>name</name> | ||
78 | <cstring>Layout6</cstring> | ||
79 | </property> | ||
80 | <property> | ||
81 | <name>layoutSpacing</name> | ||
82 | </property> | ||
83 | <hbox> | ||
84 | <property stdset="1"> | ||
85 | <name>margin</name> | ||
86 | <number>0</number> | ||
87 | </property> | ||
88 | <property stdset="1"> | ||
89 | <name>spacing</name> | ||
90 | <number>4</number> | ||
91 | </property> | ||
92 | <widget> | ||
93 | <class>QComboBox</class> | ||
94 | <item> | ||
95 | <property> | ||
96 | <name>text</name> | ||
97 | <string>0%</string> | ||
98 | </property> | ||
99 | </item> | ||
100 | <item> | ||
101 | <property> | ||
102 | <name>text</name> | ||
103 | <string>20%</string> | ||
104 | </property> | ||
105 | </item> | ||
106 | <item> | ||
107 | <property> | ||
108 | <name>text</name> | ||
109 | <string>40%</string> | ||
110 | </property> | ||
111 | </item> | ||
112 | <item> | ||
113 | <property> | ||
114 | <name>text</name> | ||
115 | <string>60%</string> | ||
116 | </property> | ||
117 | </item> | ||
118 | <item> | ||
119 | <property> | ||
120 | <name>text</name> | ||
121 | <string>80%</string> | ||
122 | </property> | ||
123 | </item> | ||
124 | <item> | ||
125 | <property> | ||
126 | <name>text</name> | ||
127 | <string>100%</string> | ||
128 | </property> | ||
129 | </item> | ||
130 | <property stdset="1"> | ||
131 | <name>name</name> | ||
132 | <cstring>cmbProg</cstring> | ||
133 | </property> | ||
134 | <property stdset="1"> | ||
135 | <name>sizePolicy</name> | ||
136 | <sizepolicy> | ||
137 | <hsizetype>7</hsizetype> | ||
138 | <vsizetype>0</vsizetype> | ||
139 | </sizepolicy> | ||
140 | </property> | ||
141 | <property stdset="1"> | ||
142 | <name>maximumSize</name> | ||
143 | <size> | ||
144 | <width>32767</width> | ||
145 | <height>32767</height> | ||
146 | </size> | ||
147 | </property> | ||
148 | </widget> | ||
149 | <widget> | ||
150 | <class>QCheckBox</class> | ||
151 | <property stdset="1"> | ||
152 | <name>name</name> | ||
153 | <cstring>checkCompleted</cstring> | ||
154 | </property> | ||
155 | <property stdset="1"> | ||
156 | <name>text</name> | ||
157 | <string>&Completed</string> | ||
158 | </property> | ||
159 | </widget> | ||
160 | </hbox> | ||
161 | </widget> | ||
162 | <widget row="0" column="0" > | ||
163 | <class>QLabel</class> | ||
164 | <property stdset="1"> | ||
165 | <name>name</name> | ||
166 | <cstring>TextLabel2</cstring> | ||
167 | </property> | ||
168 | <property stdset="1"> | ||
169 | <name>text</name> | ||
170 | <string>Priority:</string> | ||
171 | </property> | ||
172 | </widget> | ||
173 | <widget row="4" column="1" > | ||
174 | <class>QPushButton</class> | ||
175 | <property stdset="1"> | ||
176 | <name>name</name> | ||
177 | <cstring>buttonDate</cstring> | ||
178 | </property> | ||
179 | <property stdset="1"> | ||
180 | <name>enabled</name> | ||
181 | <bool>false</bool> | ||
182 | </property> | ||
183 | <property stdset="1"> | ||
184 | <name>text</name> | ||
185 | <string>1 Jan 2001</string> | ||
186 | </property> | ||
187 | </widget> | ||
188 | <widget row="3" column="0" > | ||
189 | <class>QLabel</class> | ||
190 | <property stdset="1"> | ||
191 | <name>name</name> | ||
192 | <cstring>txtProg</cstring> | ||
193 | </property> | ||
194 | <property stdset="1"> | ||
195 | <name>frameShape</name> | ||
196 | <enum>MShape</enum> | ||
197 | </property> | ||
198 | <property stdset="1"> | ||
199 | <name>frameShadow</name> | ||
200 | <enum>MShadow</enum> | ||
201 | </property> | ||
202 | <property stdset="1"> | ||
203 | <name>text</name> | ||
204 | <string>Progress:</string> | ||
205 | </property> | ||
206 | </widget> | ||
207 | <widget row="2" column="1" > | ||
208 | <class>QPushButton</class> | ||
209 | <property stdset="1"> | ||
210 | <name>name</name> | ||
211 | <cstring>selectGroupButton</cstring> | ||
212 | </property> | ||
213 | <property stdset="1"> | ||
214 | <name>text</name> | ||
215 | <string>Select</string> | ||
216 | </property> | ||
217 | </widget> | ||
218 | <widget row="2" column="0" > | ||
219 | <class>QLabel</class> | ||
220 | <property stdset="1"> | ||
221 | <name>name</name> | ||
222 | <cstring>txtProg_2</cstring> | ||
223 | </property> | ||
224 | <property stdset="1"> | ||
225 | <name>frameShape</name> | ||
226 | <enum>MShape</enum> | ||
227 | </property> | ||
228 | <property stdset="1"> | ||
229 | <name>frameShadow</name> | ||
230 | <enum>MShadow</enum> | ||
231 | </property> | ||
232 | <property stdset="1"> | ||
233 | <name>text</name> | ||
234 | <string>Group:</string> | ||
235 | </property> | ||
236 | </widget> | ||
237 | <widget row="4" column="0" > | ||
238 | <class>QCheckBox</class> | ||
239 | <property stdset="1"> | ||
240 | <name>name</name> | ||
241 | <cstring>checkDate</cstring> | ||
242 | </property> | ||
243 | <property stdset="1"> | ||
244 | <name>text</name> | ||
245 | <string>D&ue</string> | ||
246 | </property> | ||
247 | </widget> | ||
248 | <widget row="1" column="1" > | ||
249 | <class>CategorySelect</class> | ||
250 | <property stdset="1"> | ||
251 | <name>name</name> | ||
252 | <cstring>comboCategory</cstring> | ||
253 | </property> | ||
254 | <property stdset="1"> | ||
255 | <name>sizePolicy</name> | ||
256 | <sizepolicy> | ||
257 | <hsizetype>7</hsizetype> | ||
258 | <vsizetype>0</vsizetype> | ||
259 | </sizepolicy> | ||
260 | </property> | ||
261 | <property stdset="1"> | ||
262 | <name>minimumSize</name> | ||
263 | <size> | ||
264 | <width>60</width> | ||
265 | <height>20</height> | ||
266 | </size> | ||
267 | </property> | ||
268 | </widget> | ||
269 | <widget row="0" column="1" > | ||
270 | <class>QComboBox</class> | ||
271 | <item> | ||
272 | <property> | ||
273 | <name>text</name> | ||
274 | <string>1 - Very High</string> | ||
275 | </property> | ||
276 | </item> | ||
277 | <item> | ||
278 | <property> | ||
279 | <name>text</name> | ||
280 | <string>2 - High</string> | ||
281 | </property> | ||
282 | </item> | ||
283 | <item> | ||
284 | <property> | ||
285 | <name>text</name> | ||
286 | <string>3 - Normal</string> | ||
287 | </property> | ||
288 | </item> | ||
289 | <item> | ||
290 | <property> | ||
291 | <name>text</name> | ||
292 | <string>4 - Low</string> | ||
293 | </property> | ||
294 | </item> | ||
295 | <item> | ||
296 | <property> | ||
297 | <name>text</name> | ||
298 | <string>5 - Very Low</string> | ||
299 | </property> | ||
300 | </item> | ||
301 | <property stdset="1"> | ||
302 | <name>name</name> | ||
303 | <cstring>comboPriority</cstring> | ||
304 | </property> | ||
305 | <property stdset="1"> | ||
306 | <name>currentItem</name> | ||
307 | <number>2</number> | ||
308 | </property> | ||
309 | </widget> | ||
310 | <widget row="5" column="0" > | ||
311 | <class>QLabel</class> | ||
312 | <property stdset="1"> | ||
313 | <name>name</name> | ||
314 | <cstring>TextLabel1</cstring> | ||
315 | </property> | ||
316 | <property stdset="1"> | ||
317 | <name>text</name> | ||
318 | <string>Summary:</string> | ||
319 | </property> | ||
320 | </widget> | ||
321 | <widget row="1" column="0" > | ||
322 | <class>QLabel</class> | ||
323 | <property stdset="1"> | ||
324 | <name>name</name> | ||
325 | <cstring>TextLabel3</cstring> | ||
326 | </property> | ||
327 | <property stdset="1"> | ||
328 | <name>frameShape</name> | ||
329 | <enum>NoFrame</enum> | ||
330 | </property> | ||
331 | <property stdset="1"> | ||
332 | <name>text</name> | ||
333 | <string>Category:</string> | ||
334 | </property> | ||
335 | </widget> | ||
336 | <widget row="5" column="1" > | ||
337 | <class>QLayoutWidget</class> | ||
338 | <property stdset="1"> | ||
339 | <name>name</name> | ||
340 | <cstring>Layout8</cstring> | ||
341 | </property> | ||
342 | <property> | ||
343 | <name>layoutSpacing</name> | ||
344 | </property> | ||
345 | <hbox> | ||
346 | <property stdset="1"> | ||
347 | <name>margin</name> | ||
348 | <number>0</number> | ||
349 | </property> | ||
350 | <property stdset="1"> | ||
351 | <name>spacing</name> | ||
352 | <number>4</number> | ||
353 | </property> | ||
354 | <widget> | ||
355 | <class>QLineEdit</class> | ||
356 | <property stdset="1"> | ||
357 | <name>name</name> | ||
358 | <cstring>lneSum</cstring> | ||
359 | </property> | ||
360 | </widget> | ||
361 | <widget> | ||
362 | <class>OClickableLabel</class> | ||
363 | <property stdset="1"> | ||
364 | <name>name</name> | ||
365 | <cstring>lblDown</cstring> | ||
366 | </property> | ||
367 | <property stdset="1"> | ||
368 | <name>sizePolicy</name> | ||
369 | <sizepolicy> | ||
370 | <hsizetype>0</hsizetype> | ||
371 | <vsizetype>0</vsizetype> | ||
372 | </sizepolicy> | ||
373 | </property> | ||
374 | <property stdset="1"> | ||
375 | <name>minimumSize</name> | ||
376 | <size> | ||
377 | <width>20</width> | ||
378 | <height>20</height> | ||
379 | </size> | ||
380 | </property> | ||
381 | <property stdset="1"> | ||
382 | <name>maximumSize</name> | ||
383 | <size> | ||
384 | <width>20</width> | ||
385 | <height>20</height> | ||
386 | </size> | ||
387 | </property> | ||
388 | </widget> | ||
389 | </hbox> | ||
390 | </widget> | ||
391 | </grid> | ||
392 | </widget> | ||
393 | <widget> | ||
394 | <class>QMultiLineEdit</class> | ||
395 | <property stdset="1"> | ||
396 | <name>name</name> | ||
397 | <cstring>txtTodo</cstring> | ||
398 | </property> | ||
399 | <property stdset="1"> | ||
400 | <name>sizePolicy</name> | ||
401 | <sizepolicy> | ||
402 | <hsizetype>7</hsizetype> | ||
403 | <vsizetype>7</vsizetype> | ||
404 | </sizepolicy> | ||
405 | </property> | ||
406 | <property stdset="1"> | ||
407 | <name>wordWrap</name> | ||
408 | <enum>WidgetWidth</enum> | ||
409 | </property> | ||
410 | </widget> | ||
411 | </vbox> | ||
412 | </widget> | ||
413 | <customwidgets> | ||
414 | <customwidget> | ||
415 | <class>CategorySelect</class> | ||
416 | <header location="global">qpe/categoryselect.h</header> | ||
417 | <sizehint> | ||
418 | <width>-1</width> | ||
419 | <height>-1</height> | ||
420 | </sizehint> | ||
421 | <container>0</container> | ||
422 | <sizepolicy> | ||
423 | <hordata>7</hordata> | ||
424 | <verdata>1</verdata> | ||
425 | </sizepolicy> | ||
426 | <pixmap>image0</pixmap> | ||
427 | </customwidget> | ||
428 | <customwidget> | ||
429 | <class>OClickableLabel</class> | ||
430 | <header location="global">opie/oclickablelabel.h</header> | ||
431 | <sizehint> | ||
432 | <width>-1</width> | ||
433 | <height>-1</height> | ||
434 | </sizehint> | ||
435 | <container>0</container> | ||
436 | <sizepolicy> | ||
437 | <hordata>5</hordata> | ||
438 | <verdata>5</verdata> | ||
439 | </sizepolicy> | ||
440 | <pixmap>image0</pixmap> | ||
441 | <signal>clicked()</signal> | ||
442 | <signal>toggled(bool)</signal> | ||
443 | <slot access="public">slotOn(bool)</slot> | ||
444 | </customwidget> | ||
445 | </customwidgets> | ||
446 | <images> | ||
447 | <image> | ||
448 | <name>image0</name> | ||
449 | <data format="XPM.GZ" length="646">789c6dd2c10ac2300c00d07bbf2234b7229d1be245fc04c5a3201e4615f430059d0711ff5ddb2e6bb236ec90eed134cb5a19d8ef36602af5ecdbfeeac05dda0798d3abebde87e3faa374d3807fa0d633a52d38d8de6f679fe33fc776e196f53cd010188256a3600a292882096246517815ca99884606e18044a3a40d91824820924265a7923a2e8bcd05f33db1173e002913175f2a6be6d3294871a2d95fa00e8a94ee017b69d339d90df1e77c57ea072ede6758</data> | ||
450 | </image> | ||
451 | </images> | ||
452 | <connections> | ||
453 | <connection> | ||
454 | <sender>checkDate</sender> | ||
455 | <signal>toggled(bool)</signal> | ||
456 | <receiver>buttonDate</receiver> | ||
457 | <slot>setEnabled(bool)</slot> | ||
458 | </connection> | ||
459 | <connection> | ||
460 | <sender>lblDown</sender> | ||
461 | <signal>clicked()</signal> | ||
462 | <receiver>NewTaskDialogBase</receiver> | ||
463 | <slot>slotCopy()</slot> | ||
464 | </connection> | ||
465 | <slot access="protected">dateChanged( const QString & )</slot> | ||
466 | <slot access="protected">dateChanged( int, int, int )</slot> | ||
467 | <slot access="protected">slotCopy()</slot> | ||
468 | </connections> | ||
469 | <tabstops> | ||
470 | <tabstop>comboPriority</tabstop> | ||
471 | <tabstop>comboCategory</tabstop> | ||
472 | <tabstop>selectGroupButton</tabstop> | ||
473 | <tabstop>cmbProg</tabstop> | ||
474 | <tabstop>checkCompleted</tabstop> | ||
475 | <tabstop>checkDate</tabstop> | ||
476 | <tabstop>buttonDate</tabstop> | ||
477 | <tabstop>lneSum</tabstop> | ||
478 | <tabstop>lblDown</tabstop> | ||
479 | <tabstop>txtTodo</tabstop> | ||
480 | </tabstops> | ||
481 | </UI> | ||
diff --git a/core/pim/todo/todoentryimpl.cpp b/core/pim/todo/todoentryimpl.cpp deleted file mode 100644 index 4211ae2..0000000 --- a/core/pim/todo/todoentryimpl.cpp +++ b/dev/null | |||
@@ -1,189 +0,0 @@ | |||
1 | /********************************************************************** | ||
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | ||
3 | ** Copyright (C) 2002 zecke | ||
4 | ** | ||
5 | ** This file is part of Qtopia Environment. | ||
6 | ** | ||
7 | ** This file may be distributed and/or modified under the terms of the | ||
8 | ** GNU General Public License version 2 as published by the Free Software | ||
9 | ** Foundation and appearing in the file LICENSE.GPL included in the | ||
10 | ** packaging of this file. | ||
11 | ** | ||
12 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | ||
13 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | ||
14 | ** | ||
15 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | ||
16 | ** | ||
17 | ** Contact info@trolltech.com if any conditions of this licensing are | ||
18 | ** not clear to you. | ||
19 | ** | ||
20 | **********************************************************************/ | ||
21 | |||
22 | #include "todoentryimpl.h" | ||
23 | |||
24 | #include <opie/oclickablelabel.h> | ||
25 | #include <opie/otodo.h> | ||
26 | |||
27 | #include <qpe/categoryselect.h> | ||
28 | #include <qpe/datebookmonth.h> | ||
29 | #include <qpe/global.h> | ||
30 | #include <qpe/resource.h> | ||
31 | #include <qpe/imageedit.h> | ||
32 | #include <qpe/timestring.h> | ||
33 | #include <qpe/palmtoprecord.h> | ||
34 | |||
35 | #include <qlayout.h> | ||
36 | #include <qmessagebox.h> | ||
37 | #include <qpopupmenu.h> | ||
38 | #include <qtoolbutton.h> | ||
39 | #include <qcombobox.h> | ||
40 | #include <qcheckbox.h> | ||
41 | #include <qlineedit.h> | ||
42 | #include <qmultilineedit.h> | ||
43 | #include <qlabel.h> | ||
44 | #include <qtimer.h> | ||
45 | #include <qapplication.h> | ||
46 | #include <qvaluelist.h> | ||
47 | |||
48 | NewTaskDialog::NewTaskDialog( const OTodo& task, QWidget *parent, | ||
49 | const char *name, bool modal, WFlags fl ) | ||
50 | : NewTaskDialogBase( parent, name, modal, fl ), | ||
51 | todo( task ) | ||
52 | { | ||
53 | todo.setCategories( task.categories() ); | ||
54 | if ( todo.hasDueDate() ) | ||
55 | date = todo.dueDate(); | ||
56 | else | ||
57 | date = QDate::currentDate(); | ||
58 | |||
59 | init(); | ||
60 | comboPriority->setCurrentItem( task.priority() - 1 ); | ||
61 | |||
62 | checkCompleted->setChecked( task.isCompleted() ); | ||
63 | checkDate->setChecked( task.hasDueDate() ); | ||
64 | buttonDate->setText( TimeString::longDateString( date ) ); | ||
65 | |||
66 | txtTodo->setText( task.description() ); | ||
67 | lneSum->setText( task.summary() ); | ||
68 | cmbProg->setCurrentItem( task.progress()/20 ); | ||
69 | } | ||
70 | |||
71 | /* | ||
72 | * Constructs a NewTaskDialog which is a child of 'parent', with the | ||
73 | * name 'name' and widget flags set to 'f' | ||
74 | * | ||
75 | * The dialog will by default be modeless, unless you set 'modal' to | ||
76 | * TRUE to construct a modal dialog. | ||
77 | */ | ||
78 | NewTaskDialog::NewTaskDialog( int id, QWidget* parent, const char* name, bool modal, | ||
79 | WFlags fl ) | ||
80 | : NewTaskDialogBase( parent, name, modal, fl ), | ||
81 | date( QDate::currentDate() ) | ||
82 | { | ||
83 | if ( id != -1 ) | ||
84 | todo.setCategories( id ); | ||
85 | init(); | ||
86 | } | ||
87 | |||
88 | void NewTaskDialog::init() | ||
89 | { | ||
90 | if( layout() != 0 ){ | ||
91 | layout()->setMargin( 2 ); | ||
92 | } | ||
93 | QPopupMenu *m1 = new QPopupMenu( this ); | ||
94 | picker = new DateBookMonth( m1, 0, TRUE ); | ||
95 | m1->insertItem( picker ); | ||
96 | buttonDate->setPopup( m1 ); | ||
97 | comboCategory->setCategories( todo.categories(), "Todo List", tr("Todo List") ); | ||
98 | |||
99 | connect( picker, SIGNAL( dateClicked( int, int, int ) ), | ||
100 | this, SLOT( dateChanged( int, int, int ) ) ); | ||
101 | |||
102 | connect ( selectGroupButton, SIGNAL( clicked() ), | ||
103 | this, SLOT( groupButtonClicked () ) ); | ||
104 | |||
105 | buttonDate->setText( TimeString::longDateString( date ) ); | ||
106 | picker->setDate( date.year(), date.month(), date.day() ); | ||
107 | lblDown->setPixmap(Resource::loadPixmap("down") ); | ||
108 | } | ||
109 | |||
110 | /* | ||
111 | * Destroys the object and frees any allocated resources | ||
112 | */ | ||
113 | NewTaskDialog::~NewTaskDialog() | ||
114 | { | ||
115 | // no need to delete child widgets, Qt does it all for us | ||
116 | } | ||
117 | void NewTaskDialog::dateChanged( int y, int m, int d ) | ||
118 | { | ||
119 | date = QDate( y, m, d ); | ||
120 | buttonDate->setText( TimeString::longDateString( date ) ); | ||
121 | } | ||
122 | void NewTaskDialog::groupButtonClicked () | ||
123 | { | ||
124 | /*OContactSelectorDialog cd( this ); | ||
125 | QArray<int> todo_relations = todo.relations ( "addressbook" ); | ||
126 | QValueList<int> selectedContacts; | ||
127 | |||
128 | for ( uint i=0; i < todo_relations.size(); i++ ){ | ||
129 | printf ("old: %d\n", todo_relations[i]); | ||
130 | selectedContacts.append( todo_relations[i] ); | ||
131 | } | ||
132 | cd.setSelected (selectedContacts); | ||
133 | cd.showMaximized(); | ||
134 | if ( cd.exec() == QDialog::Accepted ){ | ||
135 | selectedContacts = cd.selected (); | ||
136 | QValueListIterator<int> it; | ||
137 | todo.clearRelated("addressbook"); | ||
138 | for( it = selectedContacts.begin(); it != selectedContacts.end(); ++it ){ | ||
139 | printf ("Adding: %d\n", (*it)); | ||
140 | todo.addRelated( "addressbook", (*it) ); | ||
141 | } | ||
142 | |||
143 | } | ||
144 | */ | ||
145 | } | ||
146 | |||
147 | OTodo NewTaskDialog::todoEntry() | ||
148 | { | ||
149 | if( checkDate->isChecked() ){ | ||
150 | todo.setDueDate( date ); | ||
151 | todo.setHasDueDate( true ); | ||
152 | }else{ | ||
153 | todo.setHasDueDate( false ); | ||
154 | } | ||
155 | if ( comboCategory->currentCategory() != -1 ) { | ||
156 | QArray<int> arr = comboCategory->currentCategories(); | ||
157 | QStringList list; | ||
158 | todo.setCategories( arr ); | ||
159 | } | ||
160 | todo.setPriority( comboPriority->currentItem() + 1 ); | ||
161 | todo.setCompleted( checkCompleted->isChecked() ); | ||
162 | |||
163 | todo.setDescription( txtTodo->text() ); | ||
164 | todo.setSummary( lneSum->text() ); | ||
165 | QString text = cmbProg->currentText(); | ||
166 | todo.setProgress( text.remove( text.length()-1, 1 ).toUShort() ); | ||
167 | return todo; | ||
168 | } | ||
169 | void NewTaskDialog::slotCopy() | ||
170 | { | ||
171 | txtTodo->clear(); | ||
172 | txtTodo->setText( lneSum->text() ); | ||
173 | } | ||
174 | |||
175 | /*! | ||
176 | |||
177 | */ | ||
178 | |||
179 | void NewTaskDialog::accept() | ||
180 | { | ||
181 | QString strText = txtTodo->text(); | ||
182 | QString strSumm = lneSum->text(); | ||
183 | if ( strSumm.isEmpty() && strText.isEmpty() ) { | ||
184 | // hmm... just decline it then, the user obviously didn't care about it | ||
185 | QDialog::reject(); | ||
186 | return; | ||
187 | } | ||
188 | QDialog::accept(); | ||
189 | } | ||
diff --git a/core/pim/todo/todoentryimpl.h b/core/pim/todo/todoentryimpl.h deleted file mode 100644 index 2dfdd22..0000000 --- a/core/pim/todo/todoentryimpl.h +++ b/dev/null | |||
@@ -1,65 +0,0 @@ | |||
1 | /********************************************************************** | ||
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | ||
3 | ** | ||
4 | ** This file is part of Qtopia Environment. | ||
5 | ** | ||
6 | ** This file may be distributed and/or modified under the terms of the | ||
7 | ** GNU General Public License version 2 as published by the Free Software | ||
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | ||
9 | ** packaging of this file. | ||
10 | ** | ||
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | ||
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | ||
13 | ** | ||
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | ||
15 | ** | ||
16 | ** Contact info@trolltech.com if any conditions of this licensing are | ||
17 | ** not clear to you. | ||
18 | ** | ||
19 | **********************************************************************/ | ||
20 | |||
21 | #ifndef NEWTASKDIALOG_H | ||
22 | #define NEWTASKDIALOG_H | ||
23 | |||
24 | #include "todoentry.h" | ||
25 | |||
26 | #include <opie/otodo.h> | ||
27 | //#include <opie/ocontactselector.h> | ||
28 | |||
29 | #include <qdatetime.h> | ||
30 | #include <qpalette.h> | ||
31 | |||
32 | class QLabel; | ||
33 | class QTimer; | ||
34 | class DateBookMonth; | ||
35 | |||
36 | |||
37 | |||
38 | class NewTaskDialog : public NewTaskDialogBase | ||
39 | { | ||
40 | Q_OBJECT | ||
41 | |||
42 | public: | ||
43 | NewTaskDialog( const OTodo& task, QWidget *parent = 0, const char* name = 0, | ||
44 | bool modal = FALSE, WFlags fl = 0 ); | ||
45 | NewTaskDialog( int id, QWidget* parent = 0, const char* name = 0, | ||
46 | bool modal = FALSE, WFlags fl = 0 ); | ||
47 | ~NewTaskDialog(); | ||
48 | |||
49 | OTodo todoEntry(); | ||
50 | |||
51 | protected slots: | ||
52 | void dateChanged( int y, int m, int d ); | ||
53 | void groupButtonClicked (); | ||
54 | void slotCopy(); | ||
55 | protected: | ||
56 | virtual void accept(); | ||
57 | |||
58 | private: | ||
59 | void init(); | ||
60 | OTodo todo; | ||
61 | QDate date; | ||
62 | DateBookMonth *picker; | ||
63 | }; | ||
64 | |||
65 | #endif // NEWTASKDIALOG_H | ||