make slideShortcutActivated private

This commit is contained in:
M2j 2012-02-28 10:47:34 +01:00
parent d13ec2184a
commit fe2966ac9e
1 changed files with 8 additions and 7 deletions

View File

@ -350,10 +350,10 @@ class SlideController(Controller):
context=QtCore.Qt.WidgetWithChildrenShortcut, context=QtCore.Qt.WidgetWithChildrenShortcut,
category=unicode(UiStrings().LiveToolbar) \ category=unicode(UiStrings().LiveToolbar) \
if s.get(u'configurable') else None, if s.get(u'configurable') else None,
triggers=self.slideShortcutActivated) for s in shortcuts]) triggers=self._slideShortcutActivated) for s in shortcuts])
QtCore.QObject.connect( QtCore.QObject.connect(
self.shortcutTimer, QtCore.SIGNAL(u'timeout()'), self.shortcutTimer, QtCore.SIGNAL(u'timeout()'),
self.slideShortcutActivated) self._slideShortcutActivated)
# Signals # Signals
QtCore.QObject.connect(self.previewListWidget, QtCore.QObject.connect(self.previewListWidget,
QtCore.SIGNAL(u'clicked(QModelIndex)'), self.onSlideSelected) QtCore.SIGNAL(u'clicked(QModelIndex)'), self.onSlideSelected)
@ -403,7 +403,7 @@ class SlideController(Controller):
QtCore.SIGNAL(u'slidecontroller_update_slide_limits'), QtCore.SIGNAL(u'slidecontroller_update_slide_limits'),
self.updateSlideLimits) self.updateSlideLimits)
def slideShortcutActivated(self): def _slideShortcutActivated(self):
""" """
Called, when a shortcut has been activated to jump to a chorus, verse, Called, when a shortcut has been activated to jump to a chorus, verse,
etc. etc.
@ -419,8 +419,9 @@ class SlideController(Controller):
SONGS_PLUGIN_AVAILABLE = True SONGS_PLUGIN_AVAILABLE = True
except ImportError: except ImportError:
SONGS_PLUGIN_AVAILABLE = False SONGS_PLUGIN_AVAILABLE = False
verse_type = \ sender_name = unicode(self.sender().objectName())
unicode(self.sender().objectName())[len(u'shortcutAction_'):] verse_type = sender_name[15:] \
if sender_name[:15] == u'shortcutAction_' else u''
if SONGS_PLUGIN_AVAILABLE: if SONGS_PLUGIN_AVAILABLE:
if verse_type == u'V': if verse_type == u'V':
self.current_shortcut = \ self.current_shortcut = \
@ -448,7 +449,7 @@ class SlideController(Controller):
self.current_shortcut = self.current_shortcut.upper() self.current_shortcut = self.current_shortcut.upper()
elif verse_type.isnumeric(): elif verse_type.isnumeric():
self.current_shortcut += verse_type self.current_shortcut += verse_type
else: elif verse_type:
self.current_shortcut = verse_type self.current_shortcut = verse_type
keys = self.slideList.keys() keys = self.slideList.keys()
matches = [match for match in keys matches = [match for match in keys
@ -458,7 +459,7 @@ class SlideController(Controller):
self.current_shortcut = u'' self.current_shortcut = u''
self.__checkUpdateSelectedSlide(self.slideList[matches[0]]) self.__checkUpdateSelectedSlide(self.slideList[matches[0]])
self.slideSelected() self.slideSelected()
elif verse_type != u'shortcutTimer': elif sender_name != u'shortcutTimer':
# Start the time as we did not have any match. # Start the time as we did not have any match.
self.shortcutTimer.start(350) self.shortcutTimer.start(350)
else: else: