forked from openlp/openlp
restore butto nnow works
This commit is contained in:
parent
4badce0205
commit
7260f91825
@ -58,7 +58,7 @@ class Ui_ShortcutListDialog(object):
|
|||||||
self.dialogLayout.addLayout(self.customLayout)
|
self.dialogLayout.addLayout(self.customLayout)
|
||||||
self.buttonBox = QtGui.QDialogButtonBox(shortcutListDialog)
|
self.buttonBox = QtGui.QDialogButtonBox(shortcutListDialog)
|
||||||
self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel |
|
self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel |
|
||||||
QtGui.QDialogButtonBox.Ok | QtGui.QDialogButtonBox.Reset)
|
QtGui.QDialogButtonBox.Ok | QtGui.QDialogButtonBox.RestoreDefaults)
|
||||||
self.buttonBox.setObjectName(u'buttonBox')
|
self.buttonBox.setObjectName(u'buttonBox')
|
||||||
self.dialogLayout.addWidget(self.buttonBox)
|
self.dialogLayout.addWidget(self.buttonBox)
|
||||||
self.retranslateUi(shortcutListDialog)
|
self.retranslateUi(shortcutListDialog)
|
||||||
|
@ -41,7 +41,7 @@ class ShortcutListForm(QtGui.QDialog, Ui_ShortcutListDialog):
|
|||||||
"""
|
"""
|
||||||
The shortcut list dialog
|
The shortcut list dialog
|
||||||
"""
|
"""
|
||||||
#TODO: do not close on ESC
|
|
||||||
def __init__(self, parent=None):
|
def __init__(self, parent=None):
|
||||||
QtGui.QDialog.__init__(self, parent)
|
QtGui.QDialog.__init__(self, parent)
|
||||||
self.setupUi(self)
|
self.setupUi(self)
|
||||||
@ -58,6 +58,16 @@ class ShortcutListForm(QtGui.QDialog, Ui_ShortcutListDialog):
|
|||||||
self.onItemDoubleClicked)
|
self.onItemDoubleClicked)
|
||||||
QtCore.QObject.connect(self.clearShortcutButton,
|
QtCore.QObject.connect(self.clearShortcutButton,
|
||||||
QtCore.SIGNAL(u'clicked(bool)'), self.onClearShortcutButtonClicked)
|
QtCore.SIGNAL(u'clicked(bool)'), self.onClearShortcutButtonClicked)
|
||||||
|
QtCore.QObject.connect(self.buttonBox,
|
||||||
|
QtCore.SIGNAL(u'clicked(QAbstractButton*)'),
|
||||||
|
self.onRestoreDefaultsClicked)
|
||||||
|
|
||||||
|
def keyPressEvent(self, event):
|
||||||
|
if self.shortcutButton.isChecked():
|
||||||
|
event.ignore()
|
||||||
|
elif event.key() == QtCore.Qt.Key_Escape:
|
||||||
|
event.accept()
|
||||||
|
self.close()
|
||||||
|
|
||||||
def keyReleaseEvent(self, event):
|
def keyReleaseEvent(self, event):
|
||||||
Qt = QtCore.Qt
|
Qt = QtCore.Qt
|
||||||
@ -229,6 +239,26 @@ class ShortcutListForm(QtGui.QDialog, Ui_ShortcutListDialog):
|
|||||||
self.refreshShortcutList()
|
self.refreshShortcutList()
|
||||||
self.onItemPressed(item, self.column)
|
self.onItemPressed(item, self.column)
|
||||||
|
|
||||||
|
def onRestoreDefaultsClicked(self, button):
|
||||||
|
"""
|
||||||
|
Restores all default shortcuts.
|
||||||
|
"""
|
||||||
|
if self.buttonBox.buttonRole(button) != QtGui.QDialogButtonBox.ResetRole:
|
||||||
|
return
|
||||||
|
if QtGui.QMessageBox.question(self,
|
||||||
|
translate('OpenLP.ShortcutListDialog', 'Restore Default Shortcuts'),
|
||||||
|
translate('OpenLP.ShortcutListDialog', 'Do you want to restore all '
|
||||||
|
'shortcuts to their defaults?'), QtGui.QMessageBox.StandardButtons(
|
||||||
|
QtGui.QMessageBox.Yes |
|
||||||
|
QtGui.QMessageBox.No)) == QtGui.QMessageBox.No:
|
||||||
|
return
|
||||||
|
self.shortcutButton.setChecked(False)
|
||||||
|
self.shortcutButton.setText(u'')
|
||||||
|
for category in ActionList.categories:
|
||||||
|
for action in category.actions:
|
||||||
|
action.setShortcuts(action.defaultShortcuts)
|
||||||
|
self.refreshShortcutList()
|
||||||
|
|
||||||
def save(self):
|
def save(self):
|
||||||
"""
|
"""
|
||||||
Save the shortcuts. **Note**, that we do not have to load the shortcuts,
|
Save the shortcuts. **Note**, that we do not have to load the shortcuts,
|
||||||
|
@ -141,19 +141,18 @@ class SlideController(QtGui.QWidget):
|
|||||||
translate('OpenLP.SlideController', 'Previous Slide'),
|
translate('OpenLP.SlideController', 'Previous Slide'),
|
||||||
u':/slides/slide_previous.png',
|
u':/slides/slide_previous.png',
|
||||||
translate('OpenLP.SlideController', 'Move to previous'),
|
translate('OpenLP.SlideController', 'Move to previous'),
|
||||||
self.onSlideSelectedPrevious)
|
self.onSlideSelectedPrevious,
|
||||||
|
shortcuts=[QtCore.Qt.Key_Up, QtCore.Qt.Key_PageUp],
|
||||||
|
context=QtCore.Qt.WidgetWithChildrenShortcut)
|
||||||
self.previousItem.setObjectName(u'previousItem')
|
self.previousItem.setObjectName(u'previousItem')
|
||||||
self.previousItem.setShortcuts([QtCore.Qt.Key_Up, QtCore.Qt.Key_PageUp])
|
|
||||||
self.previousItem.setShortcutContext(
|
|
||||||
QtCore.Qt.WidgetWithChildrenShortcut)
|
|
||||||
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',
|
||||||
translate('OpenLP.SlideController', 'Move to next'),
|
translate('OpenLP.SlideController', 'Move to next'),
|
||||||
self.onSlideSelectedNext)
|
self.onSlideSelectedNext,
|
||||||
|
shortcuts=[QtCore.Qt.Key_Down, QtCore.Qt.Key_PageDown],
|
||||||
|
context=QtCore.Qt.WidgetWithChildrenShortcut)
|
||||||
self.nextItem.setObjectName(u'nextItem')
|
self.nextItem.setObjectName(u'nextItem')
|
||||||
self.nextItem.setShortcuts([QtCore.Qt.Key_Down, QtCore.Qt.Key_PageDown])
|
|
||||||
self.nextItem.setShortcutContext(QtCore.Qt.WidgetWithChildrenShortcut)
|
|
||||||
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)
|
||||||
|
Loading…
Reference in New Issue
Block a user