summaryrefslogtreecommitdiffabout
path: root/korganizer/kotodoeditor.cpp
authorzautrix <zautrix>2005-11-30 08:30:24 (UTC)
committer zautrix <zautrix>2005-11-30 08:30:24 (UTC)
commit042f35a481acf6c4e711e98184abb6c9f6542429 (patch) (unidiff)
tree47622f89ebfb6c677797d7906f167ba80976ab7d /korganizer/kotodoeditor.cpp
parent14bd7cc7412ffdbca09e1cd63a230222a3fbfd53 (diff)
downloadkdepimpi-042f35a481acf6c4e711e98184abb6c9f6542429.zip
kdepimpi-042f35a481acf6c4e711e98184abb6c9f6542429.tar.gz
kdepimpi-042f35a481acf6c4e711e98184abb6c9f6542429.tar.bz2
commit
Diffstat (limited to 'korganizer/kotodoeditor.cpp') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/kotodoeditor.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/korganizer/kotodoeditor.cpp b/korganizer/kotodoeditor.cpp
index 682f83b..20a35d2 100644
--- a/korganizer/kotodoeditor.cpp
+++ b/korganizer/kotodoeditor.cpp
@@ -6,48 +6,49 @@
6 This program is free software; you can redistribute it and/or modify 6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by 7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or 8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version. 9 (at your option) any later version.
10 10
11 This program is distributed in the hope that it will be useful, 11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details. 14 GNU General Public License for more details.
15 15
16 You should have received a copy of the GNU General Public License 16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software 17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 19
20 As a special exception, permission is given to link this program 20 As a special exception, permission is given to link this program
21 with any edition of Qt, and distribute the resulting executable, 21 with any edition of Qt, and distribute the resulting executable,
22 without including the source code for Qt in the source distribution. 22 without including the source code for Qt in the source distribution.
23*/ 23*/
24 24
25#include <qtooltip.h> 25#include <qtooltip.h>
26#include <qframe.h> 26#include <qframe.h>
27#include <qpixmap.h> 27#include <qpixmap.h>
28#include <qlayout.h> 28#include <qlayout.h>
29#include <qhbox.h> 29#include <qhbox.h>
30#include <qtimer.h>
30#include <qdir.h> 31#include <qdir.h>
31#include <qdatetime.h> 32#include <qdatetime.h>
32#include <qapplication.h> 33#include <qapplication.h>
33#include <qtabwidget.h> 34#include <qtabwidget.h>
34 35
35#include <kiconloader.h> 36#include <kiconloader.h>
36#include <klocale.h> 37#include <klocale.h>
37#include <kfiledialog.h> 38#include <kfiledialog.h>
38#include <kstandarddirs.h> 39#include <kstandarddirs.h>
39#include <kmessagebox.h> 40#include <kmessagebox.h>
40 41
41#include <libkdepim/categoryselectdialog.h> 42#include <libkdepim/categoryselectdialog.h>
42#include <libkcal/calendarlocal.h> 43#include <libkcal/calendarlocal.h>
43#include <libkcal/calendarresources.h> 44#include <libkcal/calendarresources.h>
44#include <libkcal/resourcecalendar.h> 45#include <libkcal/resourcecalendar.h>
45#include <libkcal/icalformat.h> 46#include <libkcal/icalformat.h>
46#include <kresources/resourceselectdialog.h> 47#include <kresources/resourceselectdialog.h>
47#include <libkdepim/kdateedit.h> 48#include <libkdepim/kdateedit.h>
48 49
49#include "koprefs.h" 50#include "koprefs.h"
50#include "kolocationbox.h" 51#include "kolocationbox.h"
51 52
52#include "kotodoeditor.h" 53#include "kotodoeditor.h"
53extern int globalFlagBlockAgenda; 54extern int globalFlagBlockAgenda;
@@ -238,48 +239,51 @@ bool KOTodoEditor::processInput( bool emitTime )
238 239
239 Todo *todo = 0; 240 Todo *todo = 0;
240 241
241 if (mTodo) todo = mTodo; 242 if (mTodo) todo = mTodo;
242 else { 243 else {
243 todo = new Todo; 244 todo = new Todo;
244 todo->setOrganizer(KOPrefs::instance()->email()); 245 todo->setOrganizer(KOPrefs::instance()->email());
245 } 246 }
246 247
247 writeTodo(todo); 248 writeTodo(todo);
248 if ( emitTime ) { 249 if ( emitTime ) {
249 globalFlagBlockAgenda = 1; 250 globalFlagBlockAgenda = 1;
250 emit showAgendaView( false ); 251 emit showAgendaView( false );
251 if ( todo->hasDueDate() ) 252 if ( todo->hasDueDate() )
252 emit jumpToTime( todo->dtDue().date() ); 253 emit jumpToTime( todo->dtDue().date() );
253 globalFlagBlockAgenda = 2; 254 globalFlagBlockAgenda = 2;
254 } 255 }
255 if (mTodo) { 256 if (mTodo) {
256 todo->setRevision(todo->revision()+1); 257 todo->setRevision(todo->revision()+1);
257 emit todoChanged(todo); 258 emit todoChanged(todo);
258 } else { 259 } else {
259 mCalendar->addTodo(todo); 260 mCalendar->addTodo(todo);
260 mTodo = todo; 261 mTodo = todo;
261 emit todoAdded(todo); 262 emit todoAdded(todo);
263 if ( todo->isAlarmEnabled () && !todo->alarmEnabled () ) {
264 QTimer::singleShot( 0, this, SLOT ( alarmWarning() ) );
265 }
262 } 266 }
263 267
264 return true; 268 return true;
265} 269}
266 270
267void KOTodoEditor::deleteTodo() 271void KOTodoEditor::deleteTodo()
268{ 272{
269 if (mTodo) { 273 if (mTodo) {
270 if (KOPrefs::instance()->mConfirm) { 274 if (KOPrefs::instance()->mConfirm) {
271 switch (msgItemDelete()) { 275 switch (msgItemDelete()) {
272 case KMessageBox::Continue: // OK 276 case KMessageBox::Continue: // OK
273 emit todoToBeDeleted(mTodo); 277 emit todoToBeDeleted(mTodo);
274 emit dialogClose(mTodo); 278 emit dialogClose(mTodo);
275 mCalendar->deleteTodo(mTodo); 279 mCalendar->deleteTodo(mTodo);
276 emit todoDeleted(); 280 emit todoDeleted();
277 reject(); 281 reject();
278 break; 282 break;
279 } 283 }
280 } 284 }
281 else { 285 else {
282 emit todoToBeDeleted(mTodo); 286 emit todoToBeDeleted(mTodo);
283 emit dialogClose(mTodo); 287 emit dialogClose(mTodo);
284 mCalendar->deleteTodo(mTodo); 288 mCalendar->deleteTodo(mTodo);
285 emit todoDeleted(); 289 emit todoDeleted();