summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--bin/kdepim/korganizer/1leftrightarrow.pngbin0 -> 148 bytes
-rw-r--r--bin/kdepim/korganizer/1updownarrow.pngbin0 -> 164 bytes
-rw-r--r--bin/kdepim/korganizer/3leftarrow.pngbin0 -> 151 bytes
-rw-r--r--bin/kdepim/korganizer/3leftarrowB.pngbin0 -> 668 bytes
-rw-r--r--bin/kdepim/korganizer/3rightarrow.pngbin0 -> 147 bytes
-rw-r--r--bin/kdepim/korganizer/3rightarrowB.pngbin0 -> 673 bytes
-rw-r--r--bin/kdepim/pwmanager/icons22/decrypted.pngbin1117 -> 988 bytes
-rw-r--r--korganizer/koagendaview.cpp2
-rw-r--r--korganizer/koeditorgeneral.cpp4
9 files changed, 5 insertions, 1 deletions
diff --git a/bin/kdepim/korganizer/1leftrightarrow.png b/bin/kdepim/korganizer/1leftrightarrow.png
new file mode 100644
index 0000000..867f1f0
--- a/dev/null
+++ b/bin/kdepim/korganizer/1leftrightarrow.png
Binary files differ
diff --git a/bin/kdepim/korganizer/1updownarrow.png b/bin/kdepim/korganizer/1updownarrow.png
new file mode 100644
index 0000000..8171ec1
--- a/dev/null
+++ b/bin/kdepim/korganizer/1updownarrow.png
Binary files differ
diff --git a/bin/kdepim/korganizer/3leftarrow.png b/bin/kdepim/korganizer/3leftarrow.png
new file mode 100644
index 0000000..32ceec1
--- a/dev/null
+++ b/bin/kdepim/korganizer/3leftarrow.png
Binary files differ
diff --git a/bin/kdepim/korganizer/3leftarrowB.png b/bin/kdepim/korganizer/3leftarrowB.png
new file mode 100644
index 0000000..5f8fc82
--- a/dev/null
+++ b/bin/kdepim/korganizer/3leftarrowB.png
Binary files differ
diff --git a/bin/kdepim/korganizer/3rightarrow.png b/bin/kdepim/korganizer/3rightarrow.png
new file mode 100644
index 0000000..a1db245
--- a/dev/null
+++ b/bin/kdepim/korganizer/3rightarrow.png
Binary files differ
diff --git a/bin/kdepim/korganizer/3rightarrowB.png b/bin/kdepim/korganizer/3rightarrowB.png
new file mode 100644
index 0000000..7fc4b0c
--- a/dev/null
+++ b/bin/kdepim/korganizer/3rightarrowB.png
Binary files differ
diff --git a/bin/kdepim/pwmanager/icons22/decrypted.png b/bin/kdepim/pwmanager/icons22/decrypted.png
index ea770ea..de67872 100644
--- a/bin/kdepim/pwmanager/icons22/decrypted.png
+++ b/bin/kdepim/pwmanager/icons22/decrypted.png
Binary files differ
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp
index b9c7dec..8001c8f 100644
--- a/korganizer/koagendaview.cpp
+++ b/korganizer/koagendaview.cpp
@@ -42,192 +42,194 @@
42#include <kdebug.h> 42#include <kdebug.h>
43#include <kstandarddirs.h> 43#include <kstandarddirs.h>
44#include <kiconloader.h> 44#include <kiconloader.h>
45#include <klocale.h> 45#include <klocale.h>
46#include <kconfig.h> 46#include <kconfig.h>
47#include <kglobal.h> 47#include <kglobal.h>
48#include "calendarview.h" 48#include "calendarview.h"
49#include "koviewmanager.h" 49#include "koviewmanager.h"
50 50
51#include <libkcal/calendar.h> 51#include <libkcal/calendar.h>
52#include <libkcal/icaldrag.h> 52#include <libkcal/icaldrag.h>
53#include <libkcal/dndfactory.h> 53#include <libkcal/dndfactory.h>
54 54
55#include <kcalendarsystem.h> 55#include <kcalendarsystem.h>
56 56
57#include "koglobals.h" 57#include "koglobals.h"
58#ifndef KORG_NOPLUGINS 58#ifndef KORG_NOPLUGINS
59#include "kocore.h" 59#include "kocore.h"
60#endif 60#endif
61#include "koprefs.h" 61#include "koprefs.h"
62#include "koagenda.h" 62#include "koagenda.h"
63#include "koagendaitem.h" 63#include "koagendaitem.h"
64#ifndef KORG_NOPRINTER 64#ifndef KORG_NOPRINTER
65#include "calprinter.h" 65#include "calprinter.h"
66#endif 66#endif
67 67
68#include "koagendaview.h" 68#include "koagendaview.h"
69//#include "koagendaview.moc" 69//#include "koagendaview.moc"
70 70
71//extern bool globalFlagBlockPainting; 71//extern bool globalFlagBlockPainting;
72extern int globalFlagBlockAgenda; 72extern int globalFlagBlockAgenda;
73extern int globalFlagBlockStartup; 73extern int globalFlagBlockStartup;
74extern int globalFlagBlockAgendaItemPaint; 74extern int globalFlagBlockAgendaItemPaint;
75extern int globalFlagBlockAgendaItemUpdate; 75extern int globalFlagBlockAgendaItemUpdate;
76extern int globalFlagBlockLabel; 76extern int globalFlagBlockLabel;
77using namespace KOrg; 77using namespace KOrg;
78 78
79 79
80 80
81TimeLabels::TimeLabels(int rows,QWidget *parent,const char *name,WFlags f) : 81TimeLabels::TimeLabels(int rows,QWidget *parent,const char *name,WFlags f) :
82 QScrollView(parent,name,f) 82 QScrollView(parent,name,f)
83{ 83{
84 mRows = rows; 84 mRows = rows;
85 85
86 setMinimumHeight( 20 ); 86 setMinimumHeight( 20 );
87 mCellHeight = KOPrefs::instance()->mHourSize*4; 87 mCellHeight = KOPrefs::instance()->mHourSize*4;
88 88
89 enableClipper(true); 89 enableClipper(true);
90 90
91 setHScrollBarMode(AlwaysOff); 91 setHScrollBarMode(AlwaysOff);
92 setVScrollBarMode(AlwaysOff); 92 setVScrollBarMode(AlwaysOff);
93 93
94 resizeContents(50,mRows * mCellHeight); 94 resizeContents(50,mRows * mCellHeight);
95 95
96 viewport()->setBackgroundMode( PaletteBackground ); 96 viewport()->setBackgroundMode( PaletteBackground );
97} 97}
98 98
99void TimeLabels::setCellHeight(int height) 99void TimeLabels::setCellHeight(int height)
100{ 100{
101 mCellHeight = height; 101 mCellHeight = height;
102} 102}
103 103
104/* 104/*
105 Optimization so that only the "dirty" portion of the scroll view 105 Optimization so that only the "dirty" portion of the scroll view
106 is redrawn. Unfortunately, this is not called by default paintEvent() method. 106 is redrawn. Unfortunately, this is not called by default paintEvent() method.
107*/ 107*/
108void TimeLabels::drawContents(QPainter *p,int cx, int cy, int cw, int ch) 108void TimeLabels::drawContents(QPainter *p,int cx, int cy, int cw, int ch)
109{ 109{
110 110
111 // if ( globalFlagBlockAgenda ) 111 // if ( globalFlagBlockAgenda )
112 // return; 112 // return;
113 // bug: the parameters cx, cy, cw, ch are the areas that need to be 113 // bug: the parameters cx, cy, cw, ch are the areas that need to be
114 // redrawn, not the area of the widget. unfortunately, this 114 // redrawn, not the area of the widget. unfortunately, this
115 // code assumes the latter... 115 // code assumes the latter...
116 116
117 // now, for a workaround... 117 // now, for a workaround...
118 // these two assignments fix the weird redraw bug 118 // these two assignments fix the weird redraw bug
119 cx = contentsX() + 2; 119 cx = contentsX() + 2;
120 cw = contentsWidth() - 2; 120 cw = contentsWidth() - 2;
121 // end of workaround 121 // end of workaround
122 122
123 int cell = ((int)(cy/mCellHeight)); 123 int cell = ((int)(cy/mCellHeight));
124 int y = cell * mCellHeight; 124 int y = cell * mCellHeight;
125 QFontMetrics fm = fontMetrics(); 125 QFontMetrics fm = fontMetrics();
126 QString hour; 126 QString hour;
127 QString suffix; 127 QString suffix;
128 QString fullTime; 128 QString fullTime;
129 int tW = fm.width("24:00i"); 129 int tW = fm.width("24:00i");
130 int timeHeight = fm.height(); 130 int timeHeight = fm.height();
131 timeHeight -= (timeHeight/4-2); 131 timeHeight -= (timeHeight/4-2);
132 int borderWidth = 2; 132 int borderWidth = 2;
133 QFont nFont = p->font(); 133 QFont nFont = p->font();
134 QFont sFont = nFont; 134 QFont sFont = nFont;
135 sFont.setPointSize( sFont.pointSize()/2+2 ); 135 sFont.setPointSize( sFont.pointSize()/2+2 );
136 if (!KGlobal::locale()->use12Clock()) 136 if (!KGlobal::locale()->use12Clock())
137 suffix = "00"; 137 suffix = "00";
138 else
139 borderWidth = 0;
138 QFontMetrics fmS( sFont ); 140 QFontMetrics fmS( sFont );
139 int sHei = fmS.height(); 141 int sHei = fmS.height();
140 if ( timeHeight > mCellHeight ) { 142 if ( timeHeight > mCellHeight ) {
141 timeHeight = mCellHeight-1; 143 timeHeight = mCellHeight-1;
142 sHei -= 2; 144 sHei -= 2;
143 } 145 }
144 146
145 while (y < cy + ch) { 147 while (y < cy + ch) {
146 p->drawLine(cx,y,cx+tW,y); 148 p->drawLine(cx,y,cx+tW,y);
147 hour.setNum(cell); 149 hour.setNum(cell);
148 150
149 // handle 24h and am/pm time formats 151 // handle 24h and am/pm time formats
150 if (KGlobal::locale()->use12Clock()) { 152 if (KGlobal::locale()->use12Clock()) {
151 if (cell > 11) suffix = "pm"; 153 if (cell > 11) suffix = "pm";
152 else 154 else
153 suffix = "am"; 155 suffix = "am";
154 if (cell == 0) hour.setNum(12); 156 if (cell == 0) hour.setNum(12);
155 if (cell > 12) hour.setNum(cell - 12); 157 if (cell > 12) hour.setNum(cell - 12);
156 } 158 }
157 159
158 // create string in format of "XX:XX" or "XXpm/am" 160 // create string in format of "XX:XX" or "XXpm/am"
159 fullTime = hour;// + suffix; 161 fullTime = hour;// + suffix;
160 162
161 // center and draw the time label 163 // center and draw the time label
162 int timeWidth = fm.width(fullTime+"i"); 164 int timeWidth = fm.width(fullTime+"i");
163 int tw2 = fm.width(suffix); 165 int tw2 = fm.width(suffix);
164 int offset = this->width() - timeWidth - tw2; 166 int offset = this->width() - timeWidth - tw2;
165 p->setFont( nFont ); 167 p->setFont( nFont );
166 p->drawText(cx - borderWidth + offset, y+ timeHeight, fullTime); 168 p->drawText(cx - borderWidth + offset, y+ timeHeight, fullTime);
167 p->setFont( sFont ); 169 p->setFont( sFont );
168 offset += timeWidth; 170 offset += timeWidth;
169 p->drawText(cx - borderWidth + offset, y+ sHei, suffix); 171 p->drawText(cx - borderWidth + offset, y+ sHei, suffix);
170 172
171 // increment indices 173 // increment indices
172 y += mCellHeight; 174 y += mCellHeight;
173 cell++; 175 cell++;
174 } 176 }
175} 177}
176 178
177/** 179/**
178 Calculates the minimum width. 180 Calculates the minimum width.
179*/ 181*/
180int TimeLabels::minimumWidth() const 182int TimeLabels::minimumWidth() const
181{ 183{
182 return mMiniWidth; 184 return mMiniWidth;
183} 185}
184 186
185/** updates widget's internal state */ 187/** updates widget's internal state */
186void TimeLabels::updateConfig() 188void TimeLabels::updateConfig()
187{ 189{
188 // set the font 190 // set the font
189 // config->setGroup("Fonts"); 191 // config->setGroup("Fonts");
190 // QFont font = config->readFontEntry("TimeBar Font"); 192 // QFont font = config->readFontEntry("TimeBar Font");
191 setFont(KOPrefs::instance()->mTimeBarFont); 193 setFont(KOPrefs::instance()->mTimeBarFont);
192 mMiniWidth = fontMetrics().width("88:88") + 2 ; 194 mMiniWidth = fontMetrics().width("88:88") + 2 ;
193 // update geometry restrictions based on new settings 195 // update geometry restrictions based on new settings
194 setFixedWidth(minimumWidth()); 196 setFixedWidth(minimumWidth());
195 197
196 // update HourSize 198 // update HourSize
197 mCellHeight = KOPrefs::instance()->mHourSize*4; 199 mCellHeight = KOPrefs::instance()->mHourSize*4;
198 resizeContents(50,mRows * mCellHeight); 200 resizeContents(50,mRows * mCellHeight);
199} 201}
200 202
201/** update time label positions */ 203/** update time label positions */
202void TimeLabels::positionChanged() 204void TimeLabels::positionChanged()
203{ 205{
204 int adjustment = mAgenda->contentsY(); 206 int adjustment = mAgenda->contentsY();
205 setContentsPos(0, adjustment); 207 setContentsPos(0, adjustment);
206} 208}
207 209
208/** */ 210/** */
209void TimeLabels::setAgenda(KOAgenda* agenda) 211void TimeLabels::setAgenda(KOAgenda* agenda)
210{ 212{
211 mAgenda = agenda; 213 mAgenda = agenda;
212} 214}
213 215
214void TimeLabels::contentsMousePressEvent ( QMouseEvent * e) 216void TimeLabels::contentsMousePressEvent ( QMouseEvent * e)
215{ 217{
216 mMouseDownY = e->pos().y(); 218 mMouseDownY = e->pos().y();
217 mOrgCap = topLevelWidget()->caption(); 219 mOrgCap = topLevelWidget()->caption();
218} 220}
219 221
220void TimeLabels::contentsMouseMoveEvent ( QMouseEvent * e ) 222void TimeLabels::contentsMouseMoveEvent ( QMouseEvent * e )
221{ 223{
222 int diff = mMouseDownY - e->pos().y(); 224 int diff = mMouseDownY - e->pos().y();
223 if ( diff < 10 && diff > -10 ) 225 if ( diff < 10 && diff > -10 )
224 return; 226 return;
225 int tSize = KOPrefs::instance()->mHourSize + (diff/10) ; 227 int tSize = KOPrefs::instance()->mHourSize + (diff/10) ;
226 if ( tSize < 4 ) 228 if ( tSize < 4 )
227 tSize = 4; 229 tSize = 4;
228 if ( tSize > 22 ) 230 if ( tSize > 22 )
229 tSize = 22; 231 tSize = 22;
230 tSize = (tSize-2)/2; 232 tSize = (tSize-2)/2;
231 topLevelWidget()->setCaption(i18n("New Agendasize: %1").arg(tSize)); 233 topLevelWidget()->setCaption(i18n("New Agendasize: %1").arg(tSize));
232 234
233} 235}
diff --git a/korganizer/koeditorgeneral.cpp b/korganizer/koeditorgeneral.cpp
index cf0d4ae..92fcd1c 100644
--- a/korganizer/koeditorgeneral.cpp
+++ b/korganizer/koeditorgeneral.cpp
@@ -293,193 +293,195 @@ QString KOEditorGeneral::getFittingPath( const QString s )
293 } 293 }
294 if ( s.length() > maxlen ) { 294 if ( s.length() > maxlen ) {
295 return "..."+s.right(maxlen -3); 295 return "..."+s.right(maxlen -3);
296 } 296 }
297 return s; 297 return s;
298} 298}
299 299
300void KOEditorGeneral::enableAlarmEdit(bool enable) 300void KOEditorGeneral::enableAlarmEdit(bool enable)
301{ 301{
302 if ( enable ) { 302 if ( enable ) {
303 if (!mAlarmProgramButton->isOn() && !mAlarmSoundButton->isOn()) { 303 if (!mAlarmProgramButton->isOn() && !mAlarmSoundButton->isOn()) {
304 mAlarmSoundButton->setOn( true ); 304 mAlarmSoundButton->setOn( true );
305 if ( mAlarmSound.isEmpty() ) 305 if ( mAlarmSound.isEmpty() )
306 mAlarmSound = KOPrefs::instance()->mDefaultAlarmFile; 306 mAlarmSound = KOPrefs::instance()->mDefaultAlarmFile;
307 else { 307 else {
308 if ( ! QFile::exists( mAlarmSound ) ) 308 if ( ! QFile::exists( mAlarmSound ) )
309 mAlarmSound = KOPrefs::instance()->mDefaultAlarmFile; 309 mAlarmSound = KOPrefs::instance()->mDefaultAlarmFile;
310 } 310 }
311 } 311 }
312 } 312 }
313 ((QWidget*)parent())->topLevelWidget()->setCaption(mAlarmMessage); 313 ((QWidget*)parent())->topLevelWidget()->setCaption(mAlarmMessage);
314 mAlarmTimeEdit->setEnabled(enable); 314 mAlarmTimeEdit->setEnabled(enable);
315 mAlarmSoundButton->setEnabled(enable); 315 mAlarmSoundButton->setEnabled(enable);
316 mAlarmProgramButton->setEnabled(enable); 316 mAlarmProgramButton->setEnabled(enable);
317 mAlarmIncrCombo->setEnabled(enable); 317 mAlarmIncrCombo->setEnabled(enable);
318} 318}
319 319
320void KOEditorGeneral::disableAlarmEdit(bool disable) 320void KOEditorGeneral::disableAlarmEdit(bool disable)
321{ 321{
322 enableAlarmEdit( !disable ); 322 enableAlarmEdit( !disable );
323} 323}
324 324
325void KOEditorGeneral::enableAlarm( bool enable ) 325void KOEditorGeneral::enableAlarm( bool enable )
326{ 326{
327 enableAlarmEdit( enable ); 327 enableAlarmEdit( enable );
328} 328}
329 329
330void KOEditorGeneral::alarmDisable(bool disable) 330void KOEditorGeneral::alarmDisable(bool disable)
331{ 331{
332 if (!disable) { 332 if (!disable) {
333 //mAlarmBell->setEnabled(true); 333 //mAlarmBell->setEnabled(true);
334 mAlarmButton->setEnabled(true); 334 mAlarmButton->setEnabled(true);
335 } else { 335 } else {
336 //mAlarmBell->setEnabled(false); 336 //mAlarmBell->setEnabled(false);
337 mAlarmButton->setEnabled(false); 337 mAlarmButton->setEnabled(false);
338 mAlarmButton->setChecked(false); 338 mAlarmButton->setChecked(false);
339 mAlarmTimeEdit->setEnabled(false); 339 mAlarmTimeEdit->setEnabled(false);
340 mAlarmSoundButton->setEnabled(false); 340 mAlarmSoundButton->setEnabled(false);
341 mAlarmProgramButton->setEnabled(false); 341 mAlarmProgramButton->setEnabled(false);
342 mAlarmIncrCombo->setEnabled(false); 342 mAlarmIncrCombo->setEnabled(false);
343 } 343 }
344} 344}
345 345
346void KOEditorGeneral::setCategories(const QString &str) 346void KOEditorGeneral::setCategories(const QString &str)
347{ 347{
348 mCategoriesLabel->setText(str); 348 mCategoriesLabel->setText(str);
349} 349}
350 350
351void KOEditorGeneral::setDefaults(bool allDay) 351void KOEditorGeneral::setDefaults(bool allDay)
352{ 352{
353#if 0 353#if 0
354 mOwnerLabel->setText(i18n("Owner: ") + KOPrefs::instance()->fullName()); 354 mOwnerLabel->setText(i18n("Owner: ") + KOPrefs::instance()->fullName());
355#endif 355#endif
356 356
357 mAlarmMessage = i18n("Edit new item"); 357 mAlarmMessage = i18n("Edit new item");
358 enableAlarmEdit( !allDay ); 358 enableAlarmEdit( !allDay );
359 359
360 // TODO: Implement a KPrefsComboItem to solve this in a clean way. 360 // TODO: Implement a KPrefsComboItem to solve this in a clean way.
361 int alarmTime; 361 int alarmTime;
362 int a[] = { 1,5,10,15,30,60,180, 1440 }; 362 int a[] = { 1,5,10,15,30,60,180, 1440 };
363 int index = KOPrefs::instance()->mAlarmTime; 363 int index = KOPrefs::instance()->mAlarmTime;
364 if (index < 0 || index > 7) { 364 if (index < 0 || index > 7) {
365 alarmTime = 15; 365 alarmTime = 15;
366 } else { 366 } else {
367 alarmTime = a[index]; 367 alarmTime = a[index];
368 } 368 }
369 mAlarmButton ->setChecked( false ); 369 mAlarmButton ->setChecked( false );
370 mAlarmTimeEdit->setValue(alarmTime); 370 mAlarmTimeEdit->setValue(alarmTime);
371 mAlarmIncrCombo->setCurrentItem(0); 371 mAlarmIncrCombo->setCurrentItem(0);
372 enableAlarmEdit( false ); 372 enableAlarmEdit( false );
373 //alarmDisable (false); 373 //alarmDisable (false);
374 mSecrecyCombo->setCurrentItem(Incidence::SecrecyPublic); 374 mSecrecyCombo->setCurrentItem(Incidence::SecrecyPublic);
375 mCancelBox->setChecked( false ); 375 mCancelBox->setChecked( false );
376 mSummaryEdit->setEditText(""); 376 mSummaryEdit->setEditText("");
377 mLocationEdit->setEditText(""); 377 mLocationEdit->setEditText("");
378 mDescriptionEdit->setText(""); 378 mDescriptionEdit->setText("");
379 mAlarmSound = KOPrefs::instance()->mDefaultAlarmFile; 379 mAlarmSound = KOPrefs::instance()->mDefaultAlarmFile;
380 setCategories(""); 380 setCategories("");
381} 381}
382void KOEditorGeneral::setSecrecy( int num ) 382void KOEditorGeneral::setSecrecy( int num )
383{ 383{
384 mSecrecyCombo->setCurrentItem(num); 384 mSecrecyCombo->setCurrentItem(num);
385} 385}
386void KOEditorGeneral::readIncidence(Incidence *event) 386void KOEditorGeneral::readIncidence(Incidence *event)
387{ 387{
388 388
389 mAlarmMessage = event->summary(); 389 mAlarmMessage = event->summary();
390 if ( ! event->location().isEmpty() )
391 mAlarmMessage += " ("+event->location()+")";
390 mAlarmIncrCombo->setCurrentItem(0); 392 mAlarmIncrCombo->setCurrentItem(0);
391 mSummaryEdit->setEditText(event->summary()); 393 mSummaryEdit->setEditText(event->summary());
392 mLocationEdit->setEditText(event->location()); 394 mLocationEdit->setEditText(event->location());
393 mDescriptionEdit->setText(event->description()); 395 mDescriptionEdit->setText(event->description());
394 396
395#if 0 397#if 0
396 // organizer information 398 // organizer information
397 mOwnerLabel->setText(i18n("Owner: ") + event->organizer()); 399 mOwnerLabel->setText(i18n("Owner: ") + event->organizer());
398#endif 400#endif
399 401
400 enableAlarmEdit( event->isAlarmEnabled() ); 402 enableAlarmEdit( event->isAlarmEnabled() );
401 //qDebug("KOEditorGeneral::readIncidence(Incidence *event) "); 403 //qDebug("KOEditorGeneral::readIncidence(Incidence *event) ");
402 if(!event->isAlarmEnabled()) { 404 if(!event->isAlarmEnabled()) {
403 // TODO: Implement a KPrefsComboItem to solve this in a clean way. 405 // TODO: Implement a KPrefsComboItem to solve this in a clean way.
404 int alarmTime; 406 int alarmTime;
405 int a[] = { 1,5,10,15,30,60,180, 1440 }; 407 int a[] = { 1,5,10,15,30,60,180, 1440 };
406 int index = KOPrefs::instance()->mAlarmTime; 408 int index = KOPrefs::instance()->mAlarmTime;
407 if (index < 0 || index > 7) { 409 if (index < 0 || index > 7) {
408 alarmTime = 15; 410 alarmTime = 15;
409 } else { 411 } else {
410 alarmTime = a[index]; 412 alarmTime = a[index];
411 } 413 }
412 mAlarmTimeEdit->setValue(alarmTime); 414 mAlarmTimeEdit->setValue(alarmTime);
413 } 415 }
414 mAlarmButton->setChecked( event->isAlarmEnabled() ); 416 mAlarmButton->setChecked( event->isAlarmEnabled() );
415 mSecrecyCombo->setCurrentItem(event->secrecy()); 417 mSecrecyCombo->setCurrentItem(event->secrecy());
416 mCancelBox->setChecked( event->cancelled() ); 418 mCancelBox->setChecked( event->cancelled() );
417 mAlarmProgramButton->setOn(false); 419 mAlarmProgramButton->setOn(false);
418 mAlarmSoundButton->setOn(false); 420 mAlarmSoundButton->setOn(false);
419 421
420 // set up alarm stuff 422 // set up alarm stuff
421 QPtrList<Alarm> alarms = event->alarms(); 423 QPtrList<Alarm> alarms = event->alarms();
422 Alarm* alarm; 424 Alarm* alarm;
423 mAlarmIncrCombo->setCurrentItem(0); 425 mAlarmIncrCombo->setCurrentItem(0);
424 for ( alarm = alarms.first(); alarm; alarm = alarms.next() ) { 426 for ( alarm = alarms.first(); alarm; alarm = alarms.next() ) {
425 int offset; 427 int offset;
426 if ( alarm->hasTime() ) { 428 if ( alarm->hasTime() ) {
427 QDateTime t = alarm->time(); 429 QDateTime t = alarm->time();
428 offset = event->dtStart().secsTo( t ); 430 offset = event->dtStart().secsTo( t );
429 } else { 431 } else {
430 offset = alarm->startOffset().asSeconds(); 432 offset = alarm->startOffset().asSeconds();
431 } 433 }
432 if ( offset != 0 ) { 434 if ( offset != 0 ) {
433 offset = offset / -60; // make minutes 435 offset = offset / -60; // make minutes
434 if (offset % 60 == 0) { // divides evenly into hours? 436 if (offset % 60 == 0) { // divides evenly into hours?
435 offset = offset / 60; 437 offset = offset / 60;
436 mAlarmIncrCombo->setCurrentItem(1); 438 mAlarmIncrCombo->setCurrentItem(1);
437 if (offset % 24 == 0) { // divides evenly into days? 439 if (offset % 24 == 0) { // divides evenly into days?
438 offset = offset / 24; 440 offset = offset / 24;
439 mAlarmIncrCombo->setCurrentItem(2); 441 mAlarmIncrCombo->setCurrentItem(2);
440 } 442 }
441 } 443 }
442 } 444 }
443 mAlarmTimeEdit->setValue( offset ); 445 mAlarmTimeEdit->setValue( offset );
444 if (alarm->type() == Alarm::Procedure) { 446 if (alarm->type() == Alarm::Procedure) {
445 447
446 mAlarmProgram = alarm->programFile(); 448 mAlarmProgram = alarm->programFile();
447 mAlarmProgramButton->setOn(true); 449 mAlarmProgramButton->setOn(true);
448 QString dispStr = i18n("Running '%1'").arg(mAlarmProgram); 450 QString dispStr = i18n("Running '%1'").arg(mAlarmProgram);
449 QToolTip::add(mAlarmProgramButton, dispStr); 451 QToolTip::add(mAlarmProgramButton, dispStr);
450 } 452 }
451 else if (alarm->type() == Alarm::Audio) { 453 else if (alarm->type() == Alarm::Audio) {
452 mAlarmSound = alarm->audioFile(); 454 mAlarmSound = alarm->audioFile();
453 if ( ! QFile::exists( mAlarmSound ) ) 455 if ( ! QFile::exists( mAlarmSound ) )
454 mAlarmSound = KOPrefs::instance()->mDefaultAlarmFile; 456 mAlarmSound = KOPrefs::instance()->mDefaultAlarmFile;
455 mAlarmSoundButton->setOn(true); 457 mAlarmSoundButton->setOn(true);
456 QString dispStr = i18n("Playing '%1'").arg(mAlarmSound); 458 QString dispStr = i18n("Playing '%1'").arg(mAlarmSound);
457 QToolTip::add(mAlarmSoundButton, dispStr); 459 QToolTip::add(mAlarmSoundButton, dispStr);
458 } 460 }
459 mAlarmButton->setChecked(alarm->enabled()); 461 mAlarmButton->setChecked(alarm->enabled());
460 enableAlarmEdit( alarm->enabled() ); 462 enableAlarmEdit( alarm->enabled() );
461 //qDebug("nableAlarmEdit( alarm->enabled() )********* "); 463 //qDebug("nableAlarmEdit( alarm->enabled() )********* ");
462 // TODO: Deal with multiple alarms 464 // TODO: Deal with multiple alarms
463 break; // For now, stop after the first alarm 465 break; // For now, stop after the first alarm
464 } 466 }
465 467
466 setCategories(event->categoriesStr()); 468 setCategories(event->categoriesStr());
467} 469}
468 470
469void KOEditorGeneral::writeIncidence(Incidence *event) 471void KOEditorGeneral::writeIncidence(Incidence *event)
470{ 472{
471 // kdDebug() << "KOEditorGeneral::writeEvent()" << endl; 473 // kdDebug() << "KOEditorGeneral::writeEvent()" << endl;
472 mLocationEdit->save(KOLocationBox::LOCATION); 474 mLocationEdit->save(KOLocationBox::LOCATION);
473 event->setSummary(mSummaryEdit->currentText()); 475 event->setSummary(mSummaryEdit->currentText());
474 event->setLocation(mLocationEdit->currentText()); 476 event->setLocation(mLocationEdit->currentText());
475 event->setDescription(mDescriptionEdit->text()); 477 event->setDescription(mDescriptionEdit->text());
476 event->setCategories(mCategoriesLabel->text()); 478 event->setCategories(mCategoriesLabel->text());
477 event->setSecrecy(mSecrecyCombo->currentItem()); 479 event->setSecrecy(mSecrecyCombo->currentItem());
478 event->setCancelled(mCancelBox->isChecked() );; 480 event->setCancelled(mCancelBox->isChecked() );;
479 // alarm stuff 481 // alarm stuff
480 if (mAlarmButton->isChecked()) { 482 if (mAlarmButton->isChecked()) {
481 if (event->alarms().count() == 0) 483 if (event->alarms().count() == 0)
482 event->newAlarm(); 484 event->newAlarm();
483 QPtrList<Alarm> alarms = event->alarms(); 485 QPtrList<Alarm> alarms = event->alarms();
484 Alarm *alarm; 486 Alarm *alarm;
485 for (alarm = alarms.first(); alarm; alarm = alarms.next() ) { 487 for (alarm = alarms.first(); alarm; alarm = alarms.next() ) {