Diffstat (limited to 'korganizer/outgoingdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | korganizer/outgoingdialog.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/korganizer/outgoingdialog.cpp b/korganizer/outgoingdialog.cpp index 0fc90c4..7253c8e 100644 --- a/korganizer/outgoingdialog.cpp +++ b/korganizer/outgoingdialog.cpp | |||
@@ -34,100 +34,100 @@ | |||
34 | #include <libkcal/dummyscheduler.h> | 34 | #include <libkcal/dummyscheduler.h> |
35 | #include <libkcal/icalformat.h> | 35 | #include <libkcal/icalformat.h> |
36 | #include <libkcal/calendar.h> | 36 | #include <libkcal/calendar.h> |
37 | 37 | ||
38 | #ifndef KORG_NOMAIL | 38 | #ifndef KORG_NOMAIL |
39 | #include "mailscheduler.h" | 39 | #include "mailscheduler.h" |
40 | #endif | 40 | #endif |
41 | 41 | ||
42 | #include "koprefs.h" | 42 | #include "koprefs.h" |
43 | #include "outgoingdialog.h" | 43 | #include "outgoingdialog.h" |
44 | #include "koeventviewerdialog.h" | 44 | #include "koeventviewerdialog.h" |
45 | #include "docprefs.h" | 45 | #include "docprefs.h" |
46 | 46 | ||
47 | ScheduleItemOut::ScheduleItemOut(QListView *parent,IncidenceBase *ev, | 47 | ScheduleItemOut::ScheduleItemOut(QListView *parent,IncidenceBase *ev, |
48 | Scheduler::Method method, | 48 | Scheduler::Method method, |
49 | const QString &recipients) | 49 | const QString &recipients) |
50 | : QListViewItem(parent) | 50 | : QListViewItem(parent) |
51 | { | 51 | { |
52 | mIncidence = ev; | 52 | mIncidence = ev; |
53 | mMethod = method; | 53 | mMethod = method; |
54 | mRecipients = recipients; | 54 | mRecipients = recipients; |
55 | 55 | ||
56 | // kdDebug() << "ScheduleItemOut: setting the summary" << endl; | 56 | // kdDebug() << "ScheduleItemOut: setting the summary" << endl; |
57 | //Set the summary | 57 | //Set the summary |
58 | if(ev->type() != "FreeBusy") { | 58 | if(ev->typeID() != freebusyID ) { |
59 | Incidence *incidence = static_cast<Incidence *>(ev); | 59 | Incidence *incidence = static_cast<Incidence *>(ev); |
60 | setText(0,incidence->summary()); | 60 | setText(0,incidence->summary()); |
61 | } else { | 61 | } else { |
62 | setText(0,i18n("Free Busy Object")); | 62 | setText(0,i18n("Free Busy Object")); |
63 | } | 63 | } |
64 | 64 | ||
65 | // kdDebug() << "ScheduleItemOut: checking if the object is an event" << endl; | 65 | // kdDebug() << "ScheduleItemOut: checking if the object is an event" << endl; |
66 | //If the object is an event | 66 | //If the object is an event |
67 | if(ev->type()=="Event") { | 67 | if(ev->typeID()== eventID ) { |
68 | Event *event = static_cast<Event *>(ev); | 68 | Event *event = static_cast<Event *>(ev); |
69 | 69 | ||
70 | setText(1,event->dtStartDateStr()); | 70 | setText(1,event->dtStartDateStr()); |
71 | if (event->doesFloat()) { //If the event floats set the start and end times to no time | 71 | if (event->doesFloat()) { //If the event floats set the start and end times to no time |
72 | setText(2,i18n("no time")); | 72 | setText(2,i18n("no time")); |
73 | setText(4,i18n("no time")); | 73 | setText(4,i18n("no time")); |
74 | } else { //If it does not float | 74 | } else { //If it does not float |
75 | setText(2,event->dtStartTimeStr()); | 75 | setText(2,event->dtStartTimeStr()); |
76 | if (event->hasDuration()) { | 76 | if (event->hasDuration()) { |
77 | setText(4,event->dtEndTimeStr()); | 77 | setText(4,event->dtEndTimeStr()); |
78 | } else { | 78 | } else { |
79 | setText(4,i18n("no time")); | 79 | setText(4,i18n("no time")); |
80 | } | 80 | } |
81 | } | 81 | } |
82 | if (event->hasEndDate()) { | 82 | if (event->hasEndDate()) { |
83 | setText(3,event->dtEndDateStr()); | 83 | setText(3,event->dtEndDateStr()); |
84 | } | 84 | } |
85 | else { | 85 | else { |
86 | setText(3,i18n("no time")); | 86 | setText(3,i18n("no time")); |
87 | } | 87 | } |
88 | } | 88 | } |
89 | 89 | ||
90 | //If the object is an Todo | 90 | //If the object is an Todo |
91 | if(ev->type()=="Todo") { | 91 | if(ev->typeID() == todoID ) { |
92 | Todo *event = static_cast<Todo *>(ev); | 92 | Todo *event = static_cast<Todo *>(ev); |
93 | if (event->hasStartDate()) { | 93 | if (event->hasStartDate()) { |
94 | setText(1,event->dtStartDateStr()); | 94 | setText(1,event->dtStartDateStr()); |
95 | if (!event->doesFloat()) { | 95 | if (!event->doesFloat()) { |
96 | setText(2,event->dtStartTimeStr()); | 96 | setText(2,event->dtStartTimeStr()); |
97 | } | 97 | } |
98 | } | 98 | } |
99 | if (event->hasDueDate()) { | 99 | if (event->hasDueDate()) { |
100 | setText(3,event->dtDueDateStr()); | 100 | setText(3,event->dtDueDateStr()); |
101 | if (!event->doesFloat()) { | 101 | if (!event->doesFloat()) { |
102 | setText(4,event->dtDueTimeStr()); | 102 | setText(4,event->dtDueTimeStr()); |
103 | } | 103 | } |
104 | } | 104 | } |
105 | } | 105 | } |
106 | 106 | ||
107 | // kdDebug() << "ScheduleItemOut: checking if the object is a FreeBusy object" << endl; | 107 | // kdDebug() << "ScheduleItemOut: checking if the object is a FreeBusy object" << endl; |
108 | //If the object is a freebusy object | 108 | //If the object is a freebusy object |
109 | if(ev->type() == "FreeBusy") { | 109 | if(ev->typeID() == freebusyID ) { |
110 | FreeBusy *freebusy = static_cast<FreeBusy *>(ev); | 110 | FreeBusy *freebusy = static_cast<FreeBusy *>(ev); |
111 | 111 | ||
112 | setText(1,freebusy->dtStartDateStr()); | 112 | setText(1,freebusy->dtStartDateStr()); |
113 | setText(2,freebusy->dtStartTimeStr()); | 113 | setText(2,freebusy->dtStartTimeStr()); |
114 | //Must try and get this to the users local settings | 114 | //Must try and get this to the users local settings |
115 | setText(3,KGlobal::locale()->formatDate( freebusy->dtEnd().date() ) ); | 115 | setText(3,KGlobal::locale()->formatDate( freebusy->dtEnd().date() ) ); |
116 | setText(4,KGlobal::locale()->formatTime( freebusy->dtEnd().time() ) ); | 116 | setText(4,KGlobal::locale()->formatTime( freebusy->dtEnd().time() ) ); |
117 | } | 117 | } |
118 | 118 | ||
119 | // kdDebug() << "ScheduleItemOut: Setting the method" << endl; | 119 | // kdDebug() << "ScheduleItemOut: Setting the method" << endl; |
120 | //Set the Method | 120 | //Set the Method |
121 | setText(5,Scheduler::translatedMethodName(mMethod)); | 121 | setText(5,Scheduler::translatedMethodName(mMethod)); |
122 | } | 122 | } |
123 | 123 | ||
124 | OutgoingDialog::OutgoingDialog(Calendar *calendar,QWidget* parent, | 124 | OutgoingDialog::OutgoingDialog(Calendar *calendar,QWidget* parent, |
125 | const char* name,bool modal, | 125 | const char* name,bool modal, |
126 | WFlags fl) | 126 | WFlags fl) |
127 | : OutgoingDialog_base(parent,name,modal,fl) | 127 | : OutgoingDialog_base(parent,name,modal,fl) |
128 | { | 128 | { |
129 | mCalendar = calendar; | 129 | mCalendar = calendar; |
130 | 130 | ||
131 | mFormat = new ICalFormat; | 131 | mFormat = new ICalFormat; |
132 | 132 | ||
133 | if (KOPrefs::instance()->mIMIPScheduler == KOPrefs::IMIPDummy ) { | 133 | if (KOPrefs::instance()->mIMIPScheduler == KOPrefs::IMIPDummy ) { |
@@ -220,52 +220,52 @@ void OutgoingDialog::send() | |||
220 | delete (oldItem->event()); | 220 | delete (oldItem->event()); |
221 | delete oldItem; | 221 | delete oldItem; |
222 | } | 222 | } |
223 | } | 223 | } |
224 | 224 | ||
225 | emit numMessagesChanged(mMessageListView->childCount()); | 225 | emit numMessagesChanged(mMessageListView->childCount()); |
226 | } | 226 | } |
227 | 227 | ||
228 | void OutgoingDialog::deleteItem() | 228 | void OutgoingDialog::deleteItem() |
229 | { | 229 | { |
230 | ScheduleItemOut *item = (ScheduleItemOut *)(mMessageListView->selectedItem()); | 230 | ScheduleItemOut *item = (ScheduleItemOut *)(mMessageListView->selectedItem()); |
231 | if(!item) | 231 | if(!item) |
232 | return; | 232 | return; |
233 | deleteMessage(item->event()); | 233 | deleteMessage(item->event()); |
234 | delete(item->event()); | 234 | delete(item->event()); |
235 | mMessageListView->takeItem(item); | 235 | mMessageListView->takeItem(item); |
236 | emit numMessagesChanged(mMessageListView->childCount()); | 236 | emit numMessagesChanged(mMessageListView->childCount()); |
237 | } | 237 | } |
238 | 238 | ||
239 | void OutgoingDialog::showEvent(QListViewItem *qitem) | 239 | void OutgoingDialog::showEvent(QListViewItem *qitem) |
240 | { | 240 | { |
241 | ScheduleItemOut *item = (ScheduleItemOut *)qitem; | 241 | ScheduleItemOut *item = (ScheduleItemOut *)qitem; |
242 | Event *event = 0; | 242 | Event *event = 0; |
243 | Todo *todo = 0; | 243 | Todo *todo = 0; |
244 | if ( item->event()->type()=="Event" ) { | 244 | if ( item->event()->typeID() == eventID ) { |
245 | event = static_cast<Event *>(item->event()); | 245 | event = static_cast<Event *>(item->event()); |
246 | } | 246 | } |
247 | if ( item->event()->type()=="Todo" ) { | 247 | if ( item->event()->typeID() == todoID ) { |
248 | todo = static_cast<Todo *>(item->event()); | 248 | todo = static_cast<Todo *>(item->event()); |
249 | } | 249 | } |
250 | QString sendText; | 250 | QString sendText; |
251 | if (event || todo) { | 251 | if (event || todo) { |
252 | KOEventViewerDialog *eventViewer = new KOEventViewerDialog(this); | 252 | KOEventViewerDialog *eventViewer = new KOEventViewerDialog(this); |
253 | if (event) eventViewer->setEvent(event); | 253 | if (event) eventViewer->setEvent(event); |
254 | if (todo) eventViewer->setTodo(todo); | 254 | if (todo) eventViewer->setTodo(todo); |
255 | sendText = "<hr><h4>"+i18n("Event will be sent to:")+"</h4>"; | 255 | sendText = "<hr><h4>"+i18n("Event will be sent to:")+"</h4>"; |
256 | switch (item->method()) { | 256 | switch (item->method()) { |
257 | case Scheduler::Publish: { | 257 | case Scheduler::Publish: { |
258 | sendText += item->recipients(); | 258 | sendText += item->recipients(); |
259 | break; } | 259 | break; } |
260 | case Scheduler::Request: { | 260 | case Scheduler::Request: { |
261 | sendText += i18n("All attendees"); | 261 | sendText += i18n("All attendees"); |
262 | break; } | 262 | break; } |
263 | case Scheduler::Refresh: { | 263 | case Scheduler::Refresh: { |
264 | sendText += i18n("All attendees"); | 264 | sendText += i18n("All attendees"); |
265 | break; } | 265 | break; } |
266 | case Scheduler::Cancel: { | 266 | case Scheduler::Cancel: { |
267 | sendText += i18n("All attendees"); | 267 | sendText += i18n("All attendees"); |
268 | break; } | 268 | break; } |
269 | case Scheduler::Add: { | 269 | case Scheduler::Add: { |
270 | sendText += i18n("All attendees"); | 270 | sendText += i18n("All attendees"); |
271 | break; } | 271 | break; } |