From 042f35a481acf6c4e711e98184abb6c9f6542429 Mon Sep 17 00:00:00 2001 From: zautrix Date: Wed, 30 Nov 2005 08:30:24 +0000 Subject: commit --- (limited to 'korganizer') diff --git a/korganizer/koeditorgeneral.cpp b/korganizer/koeditorgeneral.cpp index 92e5a0f..21f220c 100644 --- a/korganizer/koeditorgeneral.cpp +++ b/korganizer/koeditorgeneral.cpp @@ -143,7 +143,6 @@ void KOEditorGeneral::setFocusOn( int i ) } void KOEditorGeneral::slotSetFocusOn() { - mNextFocus; if ( mNextFocus == 1 ) { mDescriptionEdit->setFocus(); mDescriptionEdit->setCursorPosition( mDescriptionEdit->numLines (), 333); @@ -355,7 +354,7 @@ void KOEditorGeneral::pickAlarmProgram() } -QString KOEditorGeneral::getFittingPath( const QString s ) +QString KOEditorGeneral::getFittingPath( const QString & s ) { int maxlen = 50; if ( QApplication::desktop()->width() < 640 ) { @@ -620,5 +619,7 @@ void KOEditorGeneral::writeIncidence(Incidence *event) alarm->setType(Alarm::Invalid); } } - event->setCalID( getCalendarID() ); + int id = getCalendarID(); + event->setCalID( id ); + event->setAlarmEnabled( KOPrefs::instance()->getCalendar( id )->isAlarmEnabled ); } diff --git a/korganizer/koeditorgeneral.h b/korganizer/koeditorgeneral.h index d8b15af..b10a5d4 100644 --- a/korganizer/koeditorgeneral.h +++ b/korganizer/koeditorgeneral.h @@ -116,7 +116,7 @@ class KOEditorGeneral : public QObject private: QPopupMenu * mCatPopup; - QString getFittingPath( const QString ) ; + QString getFittingPath( const QString &) ; QString mAlarmSound; QString mAlarmProgram; QString mAlarmMessage; diff --git a/korganizer/koeventeditor.cpp b/korganizer/koeventeditor.cpp index 9ede543..3e87197 100644 --- a/korganizer/koeventeditor.cpp +++ b/korganizer/koeventeditor.cpp @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -249,6 +250,9 @@ bool KOEventEditor::processInput( bool emitTime ) mCalendar->addEvent(event); mEvent = event; emit eventAdded(event); + if ( event->isAlarmEnabled () && !event->alarmEnabled () ) { + QTimer::singleShot( 0, this, SLOT ( alarmWarning() ) ); + } } return true; diff --git a/korganizer/koeventviewer.cpp b/korganizer/koeventviewer.cpp index 02b54da..607e549 100644 --- a/korganizer/koeventviewer.cpp +++ b/korganizer/koeventviewer.cpp @@ -404,6 +404,10 @@ void KOEventViewer::appendEvent(Event *event, int mode ) addTag("p", KGlobal::locale()->formatDateTime( t, shortDate )); } //addTag("p",s); + if ( !(event->alarmEnabled() ) ) { + addTag("p", "("+i18n("Enable alarm in resource settings") + ")"); + + } } addTag("p",""+i18n("Access: ") + "" + event->secrecyStr()); @@ -521,6 +525,10 @@ void KOEventViewer::appendTodo(Todo *event, int mode ) addTag("p",i18n("Alarm on: ") + s +" "); addTag("p", KGlobal::locale()->formatDateTime( t, shortDate )); } + if ( !(event->alarmEnabled() ) ) { + addTag("p", "("+i18n("Enable alarm in resource settings") + ")"); + + } } addTag("p",""+i18n("Access: ") + "" + event->secrecyStr()); diff --git a/korganizer/koincidenceeditor.cpp b/korganizer/koincidenceeditor.cpp index 9bc0302..236f6f9 100644 --- a/korganizer/koincidenceeditor.cpp +++ b/korganizer/koincidenceeditor.cpp @@ -90,6 +90,11 @@ void KOIncidenceEditor::setupAttendeesTab() topLayout->addWidget(mDetails); } +void KOIncidenceEditor::alarmWarning() +{ + KMessageBox::information( 0, i18n("The alarm for this calendar\nis currently disabled!\nEnable it in resource settings."), i18n("Alarm disabled warning")); + +} void KOIncidenceEditor::slotApply() { diff --git a/korganizer/koincidenceeditor.h b/korganizer/koincidenceeditor.h index bfd6cc6..2e4bbf8 100644 --- a/korganizer/koincidenceeditor.h +++ b/korganizer/koincidenceeditor.h @@ -65,7 +65,8 @@ class KOIncidenceEditor : public KDialogBase void dialogClose( Incidence * ); void jumpToTime( const QDate & ); - protected slots: + protected slots: + void alarmWarning(); void slotApply(); void slotOk(); void slotCancel(); diff --git a/korganizer/kotodoeditor.cpp b/korganizer/kotodoeditor.cpp index 682f83b..20a35d2 100644 --- a/korganizer/kotodoeditor.cpp +++ b/korganizer/kotodoeditor.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -259,6 +260,9 @@ bool KOTodoEditor::processInput( bool emitTime ) mCalendar->addTodo(todo); mTodo = todo; emit todoAdded(todo); + if ( todo->isAlarmEnabled () && !todo->alarmEnabled () ) { + QTimer::singleShot( 0, this, SLOT ( alarmWarning() ) ); + } } return true; -- cgit v0.9.0.2