From a61f3ee4e41a1c8b575e657a99f8e7ac4276ed17 Mon Sep 17 00:00:00 2001 From: Dieter Hametner Date: Mon, 25 Feb 2008 01:56:41 +0100 Subject: Added new image for timer conflict notification. Added a Force function to TimerConflicNotifier. Added the force notification to timer creation. First tests with this weren't very promising. Needs some thorough testing also at timer modification and deletion. Regenerated language header for backwards compatibilty. --- timerconflict.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'timerconflict.cpp') diff --git a/timerconflict.cpp b/timerconflict.cpp index 14f42f9..4943d54 100644 --- a/timerconflict.cpp +++ b/timerconflict.cpp @@ -87,6 +87,7 @@ namespace vdrlive { TimerConflictNotifier::TimerConflictNotifier() : lastCheck(0) + , lastTimerModification(0) , conflicts() { } @@ -99,8 +100,9 @@ namespace vdrlive { { time_t now = time(0); bool reCheckAdvised((now - lastCheck) > CHECKINTERVAL); + bool recentTimerChange((now - lastTimerModification) <= CHECKINTERVAL); - if (reCheckAdvised && TimerConflicts::CheckAdvised()) { + if (recentTimerChange || (reCheckAdvised && TimerConflicts::CheckAdvised())) { lastCheck = now; conflicts.reset(new TimerConflicts()); return conflicts->size() > 0; @@ -108,15 +110,22 @@ namespace vdrlive { return false; } + void TimerConflictNotifier::SetTimerModification() + { + lastTimerModification = time(0); + } + std::string TimerConflictNotifier::Message() const { int count = conflicts ? conflicts->size() : 0; std::string msg = tr("Timer conflict check detected "); + msg += ConvertToString(count) + " "; if (count == 1) - msg += ConvertToString(count) + tr(" conflict"); + msg += tr("conflict"); else - msg += ConvertToString(count) + tr(" conflicts"); - return count > 0 ? msg : ""; + msg += tr("conflicts"); + + return count > 0 ? msg + "!" : ""; } std::string TimerConflictNotifier::Url() const -- cgit v1.2.3