allow to add a disabled timer if we encounter a conflict
authorMoritz Venn <ritzmo@users.schwerkraft.elitedvb.net>
Sat, 3 Jan 2009 12:23:58 +0000 (12:23 +0000)
committerMoritz Venn <ritzmo@users.schwerkraft.elitedvb.net>
Sat, 3 Jan 2009 12:23:58 +0000 (12:23 +0000)
autotimer/src/AutoTimer.py
autotimer/src/AutoTimerSettings.py
autotimer/src/plugin.py

index e4b11ab..819d2d9 100644 (file)
@@ -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):
index 90e7782..93a1fe4 100644 (file)
@@ -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),
                ]
 
index 6d04252..bfd2c61 100644 (file)
@@ -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