summaryrefslogtreecommitdiffabout
path: root/korganizer
authorzautrix <zautrix>2005-11-30 08:30:24 (UTC)
committer zautrix <zautrix>2005-11-30 08:30:24 (UTC)
commit042f35a481acf6c4e711e98184abb6c9f6542429 (patch) (side-by-side diff)
tree47622f89ebfb6c677797d7906f167ba80976ab7d /korganizer
parent14bd7cc7412ffdbca09e1cd63a230222a3fbfd53 (diff)
downloadkdepimpi-042f35a481acf6c4e711e98184abb6c9f6542429.zip
kdepimpi-042f35a481acf6c4e711e98184abb6c9f6542429.tar.gz
kdepimpi-042f35a481acf6c4e711e98184abb6c9f6542429.tar.bz2
commit
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
@@ -140,13 +140,12 @@ void KOEditorGeneral::setFocusOn( int i )
{
mNextFocus = i;
QTimer::singleShot( 0, this, SLOT ( slotSetFocusOn() ));
}
void KOEditorGeneral::slotSetFocusOn()
{
- mNextFocus;
if ( mNextFocus == 1 ) {
mDescriptionEdit->setFocus();
mDescriptionEdit->setCursorPosition( mDescriptionEdit->numLines (), 333);
}
if ( mNextFocus == 2 ) {
mSummaryEdit->setFocus();
@@ -352,13 +351,13 @@ void KOEditorGeneral::pickAlarmProgram()
if ( mAlarmSoundButton->isOn())
((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Audio Al.: ") + getFittingPath(mAlarmSound) );
}
-QString KOEditorGeneral::getFittingPath( const QString s )
+QString KOEditorGeneral::getFittingPath( const QString & s )
{
int maxlen = 50;
if ( QApplication::desktop()->width() < 640 ) {
if ( QApplication::desktop()->width() < 320 )
maxlen = 22;
else
@@ -617,8 +616,10 @@ void KOEditorGeneral::writeIncidence(Incidence *event)
Alarm* alarm = event->alarms().first();
if ( alarm ) {
alarm->setEnabled(false);
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
@@ -113,13 +113,13 @@ class KOEditorGeneral : public QObject
QCheckBox *mCancelBox;
QPushButton *mCategoriesButton;
QPushButton *mCategoriesLabel;
private:
QPopupMenu * mCatPopup;
- QString getFittingPath( const QString ) ;
+ QString getFittingPath( const QString &) ;
QString mAlarmSound;
QString mAlarmProgram;
QString mAlarmMessage;
};
#endif
diff --git a/korganizer/koeventeditor.cpp b/korganizer/koeventeditor.cpp
index 9ede543..3e87197 100644
--- a/korganizer/koeventeditor.cpp
+++ b/korganizer/koeventeditor.cpp
@@ -22,12 +22,13 @@
*/
#include <qtooltip.h>
#include <qframe.h>
#include <qpixmap.h>
#include <qhbox.h>
+#include <qtimer.h>
#include <qdir.h>
#include <qlayout.h>
#include <qwidgetstack.h>
#include <qapplication.h>
#include <kiconloader.h>
@@ -246,12 +247,15 @@ bool KOEventEditor::processInput( bool emitTime )
event->setRevision(event->revision()+1);
emit eventChanged(event);
} else {
mCalendar->addEvent(event);
mEvent = event;
emit eventAdded(event);
+ if ( event->isAlarmEnabled () && !event->alarmEnabled () ) {
+ QTimer::singleShot( 0, this, SLOT ( alarmWarning() ) );
+ }
}
return true;
}
void KOEventEditor::deleteEvent()
diff --git a/korganizer/koeventviewer.cpp b/korganizer/koeventviewer.cpp
index 02b54da..607e549 100644
--- a/korganizer/koeventviewer.cpp
+++ b/korganizer/koeventviewer.cpp
@@ -401,12 +401,16 @@ void KOEventViewer::appendEvent(Event *event, int mode )
addTag("p",i18n("<b>Alarm on: ") + s +" </b>"+ KGlobal::locale()->formatDateTime( t, shortDate ));
}else{
addTag("p",i18n("<b>Alarm on: ") + s +" </b>");
addTag("p", KGlobal::locale()->formatDateTime( t, shortDate ));
}
//addTag("p",s);
+ if ( !(event->alarmEnabled() ) ) {
+ addTag("p", "<em>("+i18n("Enable alarm in resource settings") + ")</em>");
+
+ }
}
addTag("p","<b>"+i18n("Access: ") + "</b>" + event->secrecyStr());
formatCategories(event);
@@ -518,12 +522,16 @@ void KOEventViewer::appendTodo(Todo *event, int mode )
if ( wideScreen ) {
addTag("p",i18n("<b>Alarm on: ") + s +" </b>"+ KGlobal::locale()->formatDateTime( t, shortDate ));
} else {
addTag("p",i18n("<b>Alarm on: ") + s +" </b>");
addTag("p", KGlobal::locale()->formatDateTime( t, shortDate ));
}
+ if ( !(event->alarmEnabled() ) ) {
+ addTag("p", "<em>("+i18n("Enable alarm in resource settings") + ")</em>");
+
+ }
}
addTag("p","<b>"+i18n("Access: ") + "</b>" + event->secrecyStr());
formatCategories(event);
diff --git a/korganizer/koincidenceeditor.cpp b/korganizer/koincidenceeditor.cpp
index 9bc0302..236f6f9 100644
--- a/korganizer/koincidenceeditor.cpp
+++ b/korganizer/koincidenceeditor.cpp
@@ -87,12 +87,17 @@ void KOIncidenceEditor::setupAttendeesTab()
QBoxLayout *topLayout = new QVBoxLayout(topFrame);
mDetails = new KOEditorDetails(spacingHint()-2,topFrame);
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()
{
processInput( false );
}
void KOIncidenceEditor::accept()
diff --git a/korganizer/koincidenceeditor.h b/korganizer/koincidenceeditor.h
index bfd6cc6..2e4bbf8 100644
--- a/korganizer/koincidenceeditor.h
+++ b/korganizer/koincidenceeditor.h
@@ -62,13 +62,14 @@ class KOIncidenceEditor : public KDialogBase
signals:
void editCategories();
void showAgendaView( bool );
void dialogClose( Incidence * );
void jumpToTime( const QDate & );
- protected slots:
+ protected slots:
+ void alarmWarning();
void slotApply();
void slotOk();
void slotCancel();
void slotShowIncidence();
virtual void slotLoadTemplate();
diff --git a/korganizer/kotodoeditor.cpp b/korganizer/kotodoeditor.cpp
index 682f83b..20a35d2 100644
--- a/korganizer/kotodoeditor.cpp
+++ b/korganizer/kotodoeditor.cpp
@@ -24,12 +24,13 @@
#include <qtooltip.h>
#include <qframe.h>
#include <qpixmap.h>
#include <qlayout.h>
#include <qhbox.h>
+#include <qtimer.h>
#include <qdir.h>
#include <qdatetime.h>
#include <qapplication.h>
#include <qtabwidget.h>
#include <kiconloader.h>
@@ -256,12 +257,15 @@ bool KOTodoEditor::processInput( bool emitTime )
todo->setRevision(todo->revision()+1);
emit todoChanged(todo);
} else {
mCalendar->addTodo(todo);
mTodo = todo;
emit todoAdded(todo);
+ if ( todo->isAlarmEnabled () && !todo->alarmEnabled () ) {
+ QTimer::singleShot( 0, this, SLOT ( alarmWarning() ) );
+ }
}
return true;
}
void KOTodoEditor::deleteTodo()