From 2a66427e7b20314f6f5e8ad1507e91b6ef0b15e0 Mon Sep 17 00:00:00 2001 From: Moritz Venn Date: Sat, 3 Jan 2009 12:23:58 +0000 Subject: [PATCH] allow to add a disabled timer if we encounter a conflict --- autotimer/src/AutoTimer.py | 6 +++++- autotimer/src/AutoTimerSettings.py | 1 + autotimer/src/plugin.py | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/autotimer/src/AutoTimer.py b/autotimer/src/AutoTimer.py index e4b11ab..819d2d9 100644 --- a/autotimer/src/AutoTimer.py +++ b/autotimer/src/AutoTimer.py @@ -291,7 +291,11 @@ class AutoTimer: newEntry.tags = timer.tags # This needs my enhanced tag support patch to work if isNew: - if NavigationInstance.instance.RecordTimer.record(newEntry) is None: + if conflicts and config.plugins.autotimer.disabled_on_conflict.value: + timer.disabled = True + # We might want to do the sanity check locally so we don't run it twice - but I consider this workaround a hack anyway + conflicts = NavigationInstance.instance.RecordTimer.record(newEntry) + if conflicts is None: timer.decrementCounter() new += 1 if recorddict.has_key(serviceref): diff --git a/autotimer/src/AutoTimerSettings.py b/autotimer/src/AutoTimerSettings.py index 90e7782..93a1fe4 100644 --- a/autotimer/src/AutoTimerSettings.py +++ b/autotimer/src/AutoTimerSettings.py @@ -38,6 +38,7 @@ class AutoTimerSettings(Screen, ConfigListScreen): getConfigListEntry(_("Poll Interval (in h)"), config.plugins.autotimer.interval), getConfigListEntry(_("Modify existing Timers"), config.plugins.autotimer.refresh), getConfigListEntry(_("Guess existing Timer based on Begin/End"), config.plugins.autotimer.try_guessing), + getConfigListEntry(_("Add timer as disabled on conflict"), config.plugins.autotimer.disabled_on_conflict), getConfigListEntry(_("Editor for new AutoTimers"), config.plugins.autotimer.editor), ] diff --git a/autotimer/src/plugin.py b/autotimer/src/plugin.py index 6d04252..bfd2c61 100644 --- a/autotimer/src/plugin.py +++ b/autotimer/src/plugin.py @@ -24,6 +24,7 @@ config.plugins.autotimer.editor = ConfigSelection(choices = [ ("wizard", _("Wizard")) ], default = "wizard" ) +config.plugins.autotimer.disabled_on_conflict = ConfigEnableDisable(default = False) autotimer = None autopoller = None -- 2.7.4