summaryrefslogtreecommitdiffabout
path: root/korganizer
Unidiff
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koeditorgeneral.cpp7
-rw-r--r--korganizer/koeditorgeneral.h2
-rw-r--r--korganizer/koeventeditor.cpp4
-rw-r--r--korganizer/koeventviewer.cpp8
-rw-r--r--korganizer/koincidenceeditor.cpp5
-rw-r--r--korganizer/koincidenceeditor.h3
-rw-r--r--korganizer/kotodoeditor.cpp4
7 files changed, 28 insertions, 5 deletions
diff --git a/korganizer/koeditorgeneral.cpp b/korganizer/koeditorgeneral.cpp
index 92e5a0f..21f220c 100644
--- a/korganizer/koeditorgeneral.cpp
+++ b/korganizer/koeditorgeneral.cpp
@@ -134,25 +134,24 @@ void KOEditorGeneral::initHeader(QWidget *parent,QBoxLayout *topLayout)
134 headerLayout->setColStretch( 1, str); 134 headerLayout->setColStretch( 1, str);
135 headerLayout->setColStretch( 2, 1); 135 headerLayout->setColStretch( 2, 1);
136 } 136 }
137 137
138} 138}
139void KOEditorGeneral::setFocusOn( int i ) 139void KOEditorGeneral::setFocusOn( int i )
140{ 140{
141 mNextFocus = i; 141 mNextFocus = i;
142 QTimer::singleShot( 0, this, SLOT ( slotSetFocusOn() )); 142 QTimer::singleShot( 0, this, SLOT ( slotSetFocusOn() ));
143} 143}
144void KOEditorGeneral::slotSetFocusOn() 144void KOEditorGeneral::slotSetFocusOn()
145{ 145{
146 mNextFocus;
147 if ( mNextFocus == 1 ) { 146 if ( mNextFocus == 1 ) {
148 mDescriptionEdit->setFocus(); 147 mDescriptionEdit->setFocus();
149 mDescriptionEdit->setCursorPosition( mDescriptionEdit->numLines (), 333); 148 mDescriptionEdit->setCursorPosition( mDescriptionEdit->numLines (), 333);
150 } 149 }
151 if ( mNextFocus == 2 ) { 150 if ( mNextFocus == 2 ) {
152 mSummaryEdit->setFocus(); 151 mSummaryEdit->setFocus();
153 } 152 }
154} 153}
155void KOEditorGeneral::editCategories() 154void KOEditorGeneral::editCategories()
156{ 155{
157 // qDebug("KOEditorGeneral::editCategories() "); 156 // qDebug("KOEditorGeneral::editCategories() ");
158 KPIM::CategorySelectDialog* csd = new KPIM::CategorySelectDialog( KOPrefs::instance(), 0 ); 157 KPIM::CategorySelectDialog* csd = new KPIM::CategorySelectDialog( KOPrefs::instance(), 0 );
@@ -346,25 +345,25 @@ void KOEditorGeneral::pickAlarmProgram()
346 mAlarmProgramButton->setOn(!oldState); 345 mAlarmProgramButton->setOn(!oldState);
347 mAlarmSoundButton->setOn(oldState); 346 mAlarmSoundButton->setOn(oldState);
348 } 347 }
349 348
350 if (mAlarmProgramButton->isOn()) 349 if (mAlarmProgramButton->isOn())
351 ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Proc.Al.: ") + getFittingPath(mAlarmProgram) ); 350 ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Proc.Al.: ") + getFittingPath(mAlarmProgram) );
352 if ( mAlarmSoundButton->isOn()) 351 if ( mAlarmSoundButton->isOn())
353 ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Audio Al.: ") + getFittingPath(mAlarmSound) ); 352 ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Audio Al.: ") + getFittingPath(mAlarmSound) );
354 353
355} 354}
356 355
357 356
358QString KOEditorGeneral::getFittingPath( const QString s ) 357QString KOEditorGeneral::getFittingPath( const QString & s )
359{ 358{
360 int maxlen = 50; 359 int maxlen = 50;
361 if ( QApplication::desktop()->width() < 640 ) { 360 if ( QApplication::desktop()->width() < 640 ) {
362 if ( QApplication::desktop()->width() < 320 ) 361 if ( QApplication::desktop()->width() < 320 )
363 maxlen = 22; 362 maxlen = 22;
364 else 363 else
365 maxlen = 35; 364 maxlen = 35;
366 } 365 }
367 if ( s.length() > maxlen ) { 366 if ( s.length() > maxlen ) {
368 return "..."+s.right(maxlen -3); 367 return "..."+s.right(maxlen -3);
369 } 368 }
370 return s; 369 return s;
@@ -611,14 +610,16 @@ void KOEditorGeneral::writeIncidence(Incidence *event)
611 alarm->setType(Alarm::Invalid); 610 alarm->setType(Alarm::Invalid);
612 //alarm->setAudioAlarm("default"); 611 //alarm->setAudioAlarm("default");
613 // TODO: Deal with multiple alarms 612 // TODO: Deal with multiple alarms
614 break; // For now, stop after the first alarm 613 break; // For now, stop after the first alarm
615 } 614 }
616 } else { 615 } else {
617 Alarm* alarm = event->alarms().first(); 616 Alarm* alarm = event->alarms().first();
618 if ( alarm ) { 617 if ( alarm ) {
619 alarm->setEnabled(false); 618 alarm->setEnabled(false);
620 alarm->setType(Alarm::Invalid); 619 alarm->setType(Alarm::Invalid);
621 } 620 }
622 } 621 }
623 event->setCalID( getCalendarID() ); 622 int id = getCalendarID();
623 event->setCalID( id );
624 event->setAlarmEnabled( KOPrefs::instance()->getCalendar( id )->isAlarmEnabled );
624} 625}
diff --git a/korganizer/koeditorgeneral.h b/korganizer/koeditorgeneral.h
index d8b15af..b10a5d4 100644
--- a/korganizer/koeditorgeneral.h
+++ b/korganizer/koeditorgeneral.h
@@ -107,19 +107,19 @@ class KOEditorGeneral : public QObject
107 QPushButton *mAlarmSoundButton; 107 QPushButton *mAlarmSoundButton;
108 QPushButton *mAlarmProgramButton; 108 QPushButton *mAlarmProgramButton;
109 QComboBox *mAlarmIncrCombo; 109 QComboBox *mAlarmIncrCombo;
110 KTextEdit *mDescriptionEdit; 110 KTextEdit *mDescriptionEdit;
111 QLabel *mOwnerLabel; 111 QLabel *mOwnerLabel;
112 QComboBox *mSecrecyCombo; 112 QComboBox *mSecrecyCombo;
113 QCheckBox *mCancelBox; 113 QCheckBox *mCancelBox;
114 QPushButton *mCategoriesButton; 114 QPushButton *mCategoriesButton;
115 QPushButton *mCategoriesLabel; 115 QPushButton *mCategoriesLabel;
116 116
117 private: 117 private:
118 QPopupMenu * mCatPopup; 118 QPopupMenu * mCatPopup;
119 QString getFittingPath( const QString ) ; 119 QString getFittingPath( const QString &) ;
120 QString mAlarmSound; 120 QString mAlarmSound;
121 QString mAlarmProgram; 121 QString mAlarmProgram;
122 QString mAlarmMessage; 122 QString mAlarmMessage;
123}; 123};
124 124
125#endif 125#endif
diff --git a/korganizer/koeventeditor.cpp b/korganizer/koeventeditor.cpp
index 9ede543..3e87197 100644
--- a/korganizer/koeventeditor.cpp
+++ b/korganizer/koeventeditor.cpp
@@ -16,24 +16,25 @@
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>
@@ -240,24 +241,27 @@ bool KOEventEditor::processInput( bool emitTime )
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()) {
diff --git a/korganizer/koeventviewer.cpp b/korganizer/koeventviewer.cpp
index 02b54da..607e549 100644
--- a/korganizer/koeventviewer.cpp
+++ b/korganizer/koeventviewer.cpp
@@ -395,24 +395,28 @@ void KOEventViewer::appendEvent(Event *event, int mode )
395 395
396 if (event->isAlarmEnabled()) { 396 if (event->isAlarmEnabled()) {
397 Alarm *alarm =event->alarms().first() ; 397 Alarm *alarm =event->alarms().first() ;
398 QDateTime t = alarm->time(); 398 QDateTime t = alarm->time();
399 QString s =i18n("( %1 before )").arg( alarm->offsetText() ); 399 QString s =i18n("( %1 before )").arg( alarm->offsetText() );
400 if(wideScreen ){ 400 if(wideScreen ){
401 addTag("p",i18n("<b>Alarm on: ") + s +" </b>"+ KGlobal::locale()->formatDateTime( t, shortDate )); 401 addTag("p",i18n("<b>Alarm on: ") + s +" </b>"+ KGlobal::locale()->formatDateTime( t, shortDate ));
402 }else{ 402 }else{
403 addTag("p",i18n("<b>Alarm on: ") + s +" </b>"); 403 addTag("p",i18n("<b>Alarm on: ") + s +" </b>");
404 addTag("p", KGlobal::locale()->formatDateTime( t, shortDate )); 404 addTag("p", KGlobal::locale()->formatDateTime( t, shortDate ));
405 } 405 }
406 //addTag("p",s); 406 //addTag("p",s);
407 if ( !(event->alarmEnabled() ) ) {
408 addTag("p", "<em>("+i18n("Enable alarm in resource settings") + ")</em>");
409
410 }
407 } 411 }
408 412
409 addTag("p","<b>"+i18n("Access: ") + "</b>" + event->secrecyStr()); 413 addTag("p","<b>"+i18n("Access: ") + "</b>" + event->secrecyStr());
410 414
411 formatCategories(event); 415 formatCategories(event);
412 416
413 formatAttendees(event); 417 formatAttendees(event);
414 418
415 if ( KOPrefs::instance()->mEVshowCreated ) { 419 if ( KOPrefs::instance()->mEVshowCreated ) {
416 if(wideScreen ){ 420 if(wideScreen ){
417 addTag("p",i18n("<b>Created: ") +" </b>"+KGlobal::locale()->formatDateTime( event->created(), shortDate )); 421 addTag("p",i18n("<b>Created: ") +" </b>"+KGlobal::locale()->formatDateTime( event->created(), shortDate ));
418 }else{ 422 }else{
@@ -512,24 +516,28 @@ void KOEventViewer::appendTodo(Todo *event, int mode )
512 .arg(QString::number(event->priority()))); 516 .arg(QString::number(event->priority())));
513 517
514 if (event->isAlarmEnabled()) { 518 if (event->isAlarmEnabled()) {
515 Alarm *alarm =event->alarms().first() ; 519 Alarm *alarm =event->alarms().first() ;
516 QDateTime t = alarm->time(); 520 QDateTime t = alarm->time();
517 QString s =i18n("( %1 before )").arg( alarm->offsetText() ); 521 QString s =i18n("( %1 before )").arg( alarm->offsetText() );
518 if ( wideScreen ) { 522 if ( wideScreen ) {
519 addTag("p",i18n("<b>Alarm on: ") + s +" </b>"+ KGlobal::locale()->formatDateTime( t, shortDate )); 523 addTag("p",i18n("<b>Alarm on: ") + s +" </b>"+ KGlobal::locale()->formatDateTime( t, shortDate ));
520 } else { 524 } else {
521 addTag("p",i18n("<b>Alarm on: ") + s +" </b>"); 525 addTag("p",i18n("<b>Alarm on: ") + s +" </b>");
522 addTag("p", KGlobal::locale()->formatDateTime( t, shortDate )); 526 addTag("p", KGlobal::locale()->formatDateTime( t, shortDate ));
523 } 527 }
528 if ( !(event->alarmEnabled() ) ) {
529 addTag("p", "<em>("+i18n("Enable alarm in resource settings") + ")</em>");
530
531 }
524 } 532 }
525 533
526 addTag("p","<b>"+i18n("Access: ") + "</b>" + event->secrecyStr()); 534 addTag("p","<b>"+i18n("Access: ") + "</b>" + event->secrecyStr());
527 535
528 formatCategories(event); 536 formatCategories(event);
529 537
530 formatAttendees(event); 538 formatAttendees(event);
531 539
532 if ( KOPrefs::instance()->mEVshowCreated ) { 540 if ( KOPrefs::instance()->mEVshowCreated ) {
533 if(wideScreen ){ 541 if(wideScreen ){
534 542
535 addTag("p",i18n("<b>Created: ") +" </b>"+KGlobal::locale()->formatDateTime( event->created(), shortDate )); 543 addTag("p",i18n("<b>Created: ") +" </b>"+KGlobal::locale()->formatDateTime( event->created(), shortDate ));
diff --git a/korganizer/koincidenceeditor.cpp b/korganizer/koincidenceeditor.cpp
index 9bc0302..236f6f9 100644
--- a/korganizer/koincidenceeditor.cpp
+++ b/korganizer/koincidenceeditor.cpp
@@ -81,24 +81,29 @@ KOIncidenceEditor::~KOIncidenceEditor()
81} 81}
82 82
83void KOIncidenceEditor::setupAttendeesTab() 83void KOIncidenceEditor::setupAttendeesTab()
84{ 84{
85 QFrame *topFrame = addPage(i18n("Attendees")); 85 QFrame *topFrame = addPage(i18n("Attendees"));
86 86
87 QBoxLayout *topLayout = new QVBoxLayout(topFrame); 87 QBoxLayout *topLayout = new QVBoxLayout(topFrame);
88 88
89 mDetails = new KOEditorDetails(spacingHint()-2,topFrame); 89 mDetails = new KOEditorDetails(spacingHint()-2,topFrame);
90 topLayout->addWidget(mDetails); 90 topLayout->addWidget(mDetails);
91} 91}
92 92
93void KOIncidenceEditor::alarmWarning()
94{
95 KMessageBox::information( 0, i18n("The alarm for this calendar\nis currently disabled!\nEnable it in resource settings."), i18n("Alarm disabled warning"));
96
97}
93 98
94void KOIncidenceEditor::slotApply() 99void KOIncidenceEditor::slotApply()
95{ 100{
96 processInput( false ); 101 processInput( false );
97} 102}
98void KOIncidenceEditor::accept() 103void KOIncidenceEditor::accept()
99{ 104{
100 slotOk(); 105 slotOk();
101} 106}
102void KOIncidenceEditor::slotOk() 107void KOIncidenceEditor::slotOk()
103{ 108{
104 if ( processInput( false ) ) QDialog::accept(); 109 if ( processInput( false ) ) QDialog::accept();
diff --git a/korganizer/koincidenceeditor.h b/korganizer/koincidenceeditor.h
index bfd6cc6..2e4bbf8 100644
--- a/korganizer/koincidenceeditor.h
+++ b/korganizer/koincidenceeditor.h
@@ -56,25 +56,26 @@ class KOIncidenceEditor : public KDialogBase
56 56
57 virtual void reload() = 0; 57 virtual void reload() = 0;
58 58
59 public slots: 59 public slots:
60 void updateCategoryConfig(); 60 void updateCategoryConfig();
61 61
62 signals: 62 signals:
63 void editCategories(); 63 void editCategories();
64 void showAgendaView( bool ); 64 void showAgendaView( bool );
65 void dialogClose( Incidence * ); 65 void dialogClose( Incidence * );
66 void jumpToTime( const QDate & ); 66 void jumpToTime( const QDate & );
67 67
68 protected slots: 68 protected slots:
69 void alarmWarning();
69 void slotApply(); 70 void slotApply();
70 void slotOk(); 71 void slotOk();
71 void slotCancel(); 72 void slotCancel();
72 void slotShowIncidence(); 73 void slotShowIncidence();
73 74
74 virtual void slotLoadTemplate(); 75 virtual void slotLoadTemplate();
75 virtual void slotSaveTemplate(); 76 virtual void slotSaveTemplate();
76 77
77 virtual void saveTemplate( const QString & ) = 0; 78 virtual void saveTemplate( const QString & ) = 0;
78 79
79 protected: 80 protected:
80 void setupAttendeesTab(); 81 void setupAttendeesTab();
diff --git a/korganizer/kotodoeditor.cpp b/korganizer/kotodoeditor.cpp
index 682f83b..20a35d2 100644
--- a/korganizer/kotodoeditor.cpp
+++ b/korganizer/kotodoeditor.cpp
@@ -18,24 +18,25 @@
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>
@@ -250,24 +251,27 @@ bool KOTodoEditor::processInput( bool emitTime )
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);