summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp32
1 files changed, 31 insertions, 1 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index d51187a..316826a 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -1250,8 +1250,23 @@ void CalendarView::addSuspendAlarm(const QDateTime &qdt, const QString &noti )
mSuspendAlarmNotification = noti;
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
}
void CalendarView::addAlarm(const QDateTime &qdt, const QString &noti )
@@ -1263,8 +1278,23 @@ void CalendarView::addAlarm(const QDateTime &qdt, const QString &noti )
AlarmServer::addAlarm ( qdt,"koalarm", noti.utf8() );
#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
mAlarmNotification = noti;
@@ -1276,9 +1306,9 @@ void CalendarView::addAlarm(const QDateTime &qdt, const QString &noti )
} else {
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
// we need this, because a QTimer has only a max range of 25 days