From 1a13e55dd4726cc03c756412fe27b3144a43fc4c Mon Sep 17 00:00:00 2001 From: zautrix Date: Wed, 10 Aug 2005 17:39:44 +0000 Subject: alarm save as file --- (limited to 'korganizer') diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index d51187a..316826a 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp @@ -1251,6 +1251,21 @@ void CalendarView::addSuspendAlarm(const QDateTime &qdt, const QString ¬i ) int ms = QDateTime::currentDateTime().secsTo( qdt )*1000; //qDebug("Suspend Alarm timer started with secs: %d ", ms/1000); mSuspendTimer->start( ms , true ); +#ifdef DESKTOP_VERSION + if ( QApplication::desktop()->width() < 1024 ) { + QString mess = qdt.toString( "yyyy-MM-dd hh:mm:ss" ) + "\n" + noti; + //qDebug("nextsuspendalarm = \n%s ",mess.latin1() ); + QString fn = QDir::homeDirPath() + "/.kopi_suspend_alarm"; + QFile file( fn ); + if (!file.open( IO_WriteOnly ) ) { + qDebug("KO: Error writing next suspend alarm file %s\nContent: \n%s ", fn.latin1(), mess.latin1()); + } else { + QTextStream ts( &file ); + ts << mess; + file.close(); + } + } +#endif } @@ -1264,6 +1279,21 @@ void CalendarView::addAlarm(const QDateTime &qdt, const QString ¬i ) #endif return; } +#ifdef DESKTOP_VERSION + if ( QApplication::desktop()->width() < 1024 ) { + QString mess = qdt.toString( "yyyy-MM-dd hh:mm:ss" ) + "\n" + noti; + //qDebug("nextalarm = \n%s ",mess.latin1() ); + QString fn = QDir::homeDirPath() + "/.kopi_next_alarm"; + QFile file( fn ); + if (!file.open( IO_WriteOnly ) ) { + qDebug("KO: Error writing next alarm file %s\nContent: \n%s ", fn.latin1(), mess.latin1()); + } else { + QTextStream ts( &file ); + ts << mess; + file.close(); + } + } +#endif int maxSec; //maxSec = 5; //testing only maxSec = 86400+3600; // one day+1hour @@ -1277,7 +1307,7 @@ void CalendarView::addAlarm(const QDateTime &qdt, const QString ¬i ) mRecheckAlarmTimer->stop(); } //qDebug("Alarm timer started with secs: %d ", sec); - mAlarmTimer->start( sec *1000 , true ); + mAlarmTimer->start( sec * 1000 , true ); } // called by mRecheckAlarmTimer to get next alarm -- cgit v0.9.0.2