summaryrefslogtreecommitdiffabout
path: root/korganizer/koeventeditor.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/koeventeditor.cpp
parent14bd7cc7412ffdbca09e1cd63a230222a3fbfd53 (diff)
downloadkdepimpi-042f35a481acf6c4e711e98184abb6c9f6542429.zip
kdepimpi-042f35a481acf6c4e711e98184abb6c9f6542429.tar.gz
kdepimpi-042f35a481acf6c4e711e98184abb6c9f6542429.tar.bz2
commit
Diffstat (limited to 'korganizer/koeventeditor.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koeventeditor.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/korganizer/koeventeditor.cpp b/korganizer/koeventeditor.cpp
index 9ede543..3e87197 100644
--- a/korganizer/koeventeditor.cpp
+++ b/korganizer/koeventeditor.cpp
@@ -4,48 +4,49 @@
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <qtooltip.h> 24#include <qtooltip.h>
25#include <qframe.h> 25#include <qframe.h>
26#include <qpixmap.h> 26#include <qpixmap.h>
27#include <qhbox.h> 27#include <qhbox.h>
28#include <qtimer.h>
28#include <qdir.h> 29#include <qdir.h>
29#include <qlayout.h> 30#include <qlayout.h>
30#include <qwidgetstack.h> 31#include <qwidgetstack.h>
31#include <qapplication.h> 32#include <qapplication.h>
32 33
33#include <kiconloader.h> 34#include <kiconloader.h>
34#include <kstandarddirs.h> 35#include <kstandarddirs.h>
35#include <kdebug.h> 36#include <kdebug.h>
36#include <klocale.h> 37#include <klocale.h>
37#include <kfiledialog.h> 38#include <kfiledialog.h>
38#include <kmessagebox.h> 39#include <kmessagebox.h>
39#include <libkcal/calendarresources.h> 40#include <libkcal/calendarresources.h>
40#include <libkcal/resourcecalendar.h> 41#include <libkcal/resourcecalendar.h>
41#include <kresources/resourceselectdialog.h> 42#include <kresources/resourceselectdialog.h>
42 43
43#include <libkdepim/categoryselectdialog.h> 44#include <libkdepim/categoryselectdialog.h>
44#include <libkcal/calendarlocal.h> 45#include <libkcal/calendarlocal.h>
45#include <libkcal/icalformat.h> 46#include <libkcal/icalformat.h>
46 47
47#include "koprefs.h" 48#include "koprefs.h"
48 49
49#include "koeventeditor.h" 50#include "koeventeditor.h"
50extern int globalFlagBlockAgenda; 51extern int globalFlagBlockAgenda;
51 52
@@ -228,48 +229,51 @@ bool KOEventEditor::processInput( bool emitTime )
228 229
229 Event *event = 0; 230 Event *event = 0;
230 231
231 if (mEvent) event = mEvent; 232 if (mEvent) event = mEvent;
232 else { 233 else {
233 event = new Event; 234 event = new Event;
234 event->setOrganizer(KOPrefs::instance()->email()); 235 event->setOrganizer(KOPrefs::instance()->email());
235 } 236 }
236 237
237 writeEvent(event); 238 writeEvent(event);
238 if ( emitTime ) { 239 if ( emitTime ) {
239 globalFlagBlockAgenda = 1; 240 globalFlagBlockAgenda = 1;
240 emit showAgendaView( false ); 241 emit showAgendaView( false );
241 emit jumpToTime( event->dtStart().date() ); 242 emit jumpToTime( event->dtStart().date() );
242 globalFlagBlockAgenda = 2; 243 globalFlagBlockAgenda = 2;
243 244
244 } 245 }
245 if (mEvent) { 246 if (mEvent) {
246 event->setRevision(event->revision()+1); 247 event->setRevision(event->revision()+1);
247 emit eventChanged(event); 248 emit eventChanged(event);
248 } else { 249 } else {
249 mCalendar->addEvent(event); 250 mCalendar->addEvent(event);
250 mEvent = event; 251 mEvent = event;
251 emit eventAdded(event); 252 emit eventAdded(event);
253 if ( event->isAlarmEnabled () && !event->alarmEnabled () ) {
254 QTimer::singleShot( 0, this, SLOT ( alarmWarning() ) );
255 }
252 } 256 }
253 257
254 return true; 258 return true;
255} 259}
256 260
257void KOEventEditor::deleteEvent() 261void KOEventEditor::deleteEvent()
258{ 262{
259 kdDebug() << "Delete event" << endl; 263 kdDebug() << "Delete event" << endl;
260 264
261 if (mEvent) { 265 if (mEvent) {
262 if (KOPrefs::instance()->mConfirm) { 266 if (KOPrefs::instance()->mConfirm) {
263 switch (msgItemDelete()) { 267 switch (msgItemDelete()) {
264 case KMessageBox::Continue: // OK 268 case KMessageBox::Continue: // OK
265 emit eventToBeDeleted(mEvent); 269 emit eventToBeDeleted(mEvent);
266 emit dialogClose(mEvent); 270 emit dialogClose(mEvent);
267 mCalendar->deleteEvent(mEvent); 271 mCalendar->deleteEvent(mEvent);
268 emit eventDeleted(); 272 emit eventDeleted();
269 reject(); 273 reject();
270 break; 274 break;
271 } 275 }
272 } 276 }
273 else { 277 else {
274 emit eventToBeDeleted(mEvent); 278 emit eventToBeDeleted(mEvent);
275 emit dialogClose(mEvent); 279 emit dialogClose(mEvent);