fixed strange save bug

This commit is contained in:
Andreas Preikschat 2011-04-02 17:37:14 +02:00
parent 7260f91825
commit e3d822f07a
2 changed files with 13 additions and 10 deletions

View File

@ -280,17 +280,18 @@ def shortcut_action(parent, name, shortcuts, function, icon=None, checked=None,
""" """
Return a shortcut enabled action. Return a shortcut enabled action.
""" """
action = QtGui.QAction(parent)
action.setObjectName(name)
if icon is not None: if icon is not None:
action = icon_action(parent, name, icon, checked, category) action.setIcon(build_icon(icon))
elif checked is not None: if checked is not None:
action = checkable_action(parent, name, checked, category) action.setCheckable(True)
else: action.setChecked(checked)
action = base_action(parent, name, category) action.setCheckable(True)
action.setShortcuts(shortcuts) action.setShortcuts(shortcuts)
action.setShortcutContext(QtCore.Qt.WindowShortcut) action.setShortcutContext(QtCore.Qt.WindowShortcut)
# We have to save the default shortcut again, as the action's shortcut was if category is not None:
# set after adding the shortcut to the action list. ActionList.add_action(action, category)
action.defaultShortcuts = action.shortcuts()
QtCore.QObject.connect(action, QtCore.SIGNAL(u'triggered()'), function) QtCore.QObject.connect(action, QtCore.SIGNAL(u'triggered()'), function)
return action return action

View File

@ -144,7 +144,6 @@ class SlideController(QtGui.QWidget):
self.onSlideSelectedPrevious, self.onSlideSelectedPrevious,
shortcuts=[QtCore.Qt.Key_Up, QtCore.Qt.Key_PageUp], shortcuts=[QtCore.Qt.Key_Up, QtCore.Qt.Key_PageUp],
context=QtCore.Qt.WidgetWithChildrenShortcut) context=QtCore.Qt.WidgetWithChildrenShortcut)
self.previousItem.setObjectName(u'previousItem')
self.nextItem = self.toolbar.addToolbarButton( self.nextItem = self.toolbar.addToolbarButton(
translate('OpenLP.SlideController', 'Next Slide'), translate('OpenLP.SlideController', 'Next Slide'),
u':/slides/slide_next.png', u':/slides/slide_next.png',
@ -152,7 +151,6 @@ class SlideController(QtGui.QWidget):
self.onSlideSelectedNext, self.onSlideSelectedNext,
shortcuts=[QtCore.Qt.Key_Down, QtCore.Qt.Key_PageDown], shortcuts=[QtCore.Qt.Key_Down, QtCore.Qt.Key_PageDown],
context=QtCore.Qt.WidgetWithChildrenShortcut) context=QtCore.Qt.WidgetWithChildrenShortcut)
self.nextItem.setObjectName(u'nextItem')
self.toolbar.addToolbarSeparator(u'Close Separator') self.toolbar.addToolbarSeparator(u'Close Separator')
if self.isLive: if self.isLive:
self.hideMenu = QtGui.QToolButton(self.toolbar) self.hideMenu = QtGui.QToolButton(self.toolbar)
@ -367,10 +365,14 @@ class SlideController(QtGui.QWidget):
QtCore.SIGNAL(u'config_screen_changed'), self.screenSizeChanged) QtCore.SIGNAL(u'config_screen_changed'), self.screenSizeChanged)
def setPreviewHotkeys(self, parent=None): def setPreviewHotkeys(self, parent=None):
self.previousItem.setObjectName(u'previousItemPreview')
self.nextItem.setObjectName(u'nextItemPreview')
ActionList.add_action(self.previousItem, u'Preview Toolbar') ActionList.add_action(self.previousItem, u'Preview Toolbar')
ActionList.add_action(self.nextItem, u'Preview Toolbar') ActionList.add_action(self.nextItem, u'Preview Toolbar')
def setLiveHotkeys(self, parent=None): def setLiveHotkeys(self, parent=None):
self.previousItem.setObjectName(u'previousItemLive')
self.nextItem.setObjectName(u'nextItemLive')
ActionList.add_action(self.previousItem, u'Live Toolbar') ActionList.add_action(self.previousItem, u'Live Toolbar')
ActionList.add_action(self.nextItem, u'Live Toolbar') ActionList.add_action(self.nextItem, u'Live Toolbar')
self.previousService = shortcut_action(parent, u'previousService', self.previousService = shortcut_action(parent, u'previousService',