diff options
author | Dieter Hametner <dh (plus) vdr (at) gekrumbel (dot) de> | 2008-02-25 01:56:41 +0100 |
---|---|---|
committer | Dieter Hametner <dh (plus) vdr (at) gekrumbel (dot) de> | 2008-02-25 01:56:41 +0100 |
commit | a61f3ee4e41a1c8b575e657a99f8e7ac4276ed17 (patch) | |
tree | 2605f9a7b4f9d6451e370622b93be4fc973cb351 /timerconflict.cpp | |
parent | 41298f1f32e40644b2837c96c45b02e9ad27f95f (diff) | |
download | vdr-plugin-live-a61f3ee4e41a1c8b575e657a99f8e7ac4276ed17.tar.gz vdr-plugin-live-a61f3ee4e41a1c8b575e657a99f8e7ac4276ed17.tar.bz2 |
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.
Diffstat (limited to 'timerconflict.cpp')
-rw-r--r-- | timerconflict.cpp | 17 |
1 files changed, 13 insertions, 4 deletions
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 |