action_list = ListProperty([])
def update_list(self, key, action_descriptions):
- self.action_title = _("actions linked to key {}:").format(key.key_sym)
+ if key.repeat_delay > 0:
+ self.action_title = _(
+ "actions linked to key {} (repeat protection {}s):"
+ ).format(key.key_sym, key.repeat_delay)
+ else:
+ self.action_title = _(
+ "actions linked to key {}:"
+ ).format(key.key_sym)
+
action_list = []
for [action, status] in action_descriptions:
self.key.parent.finished_running(self, start_time)
def on_enter_loaded_protecting_repeat(self, modifiers):
- if 'repeat_delay' in self.key.config['properties']:
+ if self.key.repeat_delay > 0:
self.key.protecting_repeat_timer = threading.Timer(
- self.key.config['properties']['repeat_delay'],
+ self.key.repeat_delay,
self.key.repeat_protection_finished)
self.key.protecting_repeat_timer.start()
else:
def unset_color(self):
self.custom_color = [0, 1, 0]
+ # Helpers
+ @property
+ def repeat_delay(self):
+ if 'repeat_delay' in self.key.config['properties']:
+ return self.key.config['properties']['repeat_delay']
+ else:
+ return 0
+
# Actions handling
def add_action(self, action_name, **arguments):
self.actions.append(Action(action_name, self, **arguments))
msgid "waiting the end of « {} » + {}s (setting id = {})"
msgstr "attend la fin de « {} » + {}s (définit l'identifiant {})"
+#: music_sampler/app_blocks/actionlist.py:18
+msgid "actions linked to key {} (repeat protection {}s):"
+msgstr "actions liées à la touche {} (protection de {}s contre les répétitions) :"
+
#: music_sampler/app_blocks/actionlist.py:18
msgid "actions linked to key {}:"
msgstr "actions liées à la touche {} :"