From 2db3e8afead0a9ee14871c8436691755be22a5ca Mon Sep 17 00:00:00 2001 From: Felix Domke Date: Thu, 6 Nov 2008 00:17:52 +0100 Subject: Patch by Anders Holst: * ConfigElement.addNotifier takes a new optional argument immediate_feedback (which is True by default). If True the notifier is called whenever an editing key is pressed in the element. When False, the notifier is only called when editing is finished, i.e the element is deselected or the dialog closed. * ConfigSet is updated in accordance with Teros suggestion so that it behaves like the others and feedback can be given immediately. * All ConfigElements are modified to check whether they have changed since last selected (by a new variable last_value). * UsageConfig.py is updated to use immediate_feedback=False in the case of validating the speeds. (The only case so far where this setting is needed, but with the possibility more uses may follow.) --- lib/python/Components/UsageConfig.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/python/Components/UsageConfig.py') diff --git a/lib/python/Components/UsageConfig.py b/lib/python/Components/UsageConfig.py index 6ed87840..2ea91aeb 100644 --- a/lib/python/Components/UsageConfig.py +++ b/lib/python/Components/UsageConfig.py @@ -89,8 +89,8 @@ def InitUsageConfig(): config.seek.speeds_backward = ConfigSet(default=[8, 16, 32, 64, 128], choices=[1, 2, 4, 6, 8, 12, 16, 24, 32, 48, 64, 96, 128]) config.seek.speeds_slowmotion = ConfigSet(default=[2, 4, 8], choices=[2, 4, 6, 8, 12, 16, 25]) - config.seek.enter_forward = ConfigSelection(default = "2", choices = ["2"]) - config.seek.enter_backward = ConfigSelection(default = "2", choices = ["2"]) + config.seek.enter_forward = ConfigSelection(default = "2", choices = ["2", "4", "6", "8", "12", "16", "24", "32", "48", "64", "96", "128"]) + config.seek.enter_backward = ConfigSelection(default = "1", choices = ["1", "2", "4", "6", "8", "12", "16", "24", "32", "48", "64", "96", "128"]) config.seek.stepwise_minspeed = ConfigSelection(default = "16", choices = ["Never", "2", "4", "6", "8", "12", "16", "24", "32", "48", "64", "96", "128"]) config.seek.stepwise_repeat = ConfigSelection(default = "3", choices = ["2", "3", "4", "5", "6"]) @@ -104,14 +104,14 @@ def InitUsageConfig(): configElement.value = [2] updateChoices(config.seek.enter_forward, configElement.value) - config.seek.speeds_forward.addNotifier(updateEnterForward) + config.seek.speeds_forward.addNotifier(updateEnterForward, immediate_feedback = False) def updateEnterBackward(configElement): if not configElement.value: configElement.value = [2] updateChoices(config.seek.enter_backward, configElement.value) - config.seek.speeds_backward.addNotifier(updateEnterBackward) + config.seek.speeds_backward.addNotifier(updateEnterBackward, immediate_feedback = False) def updateChoices(sel, choices): if choices: -- cgit v1.2.3