openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #28028
[Merge] lp:~springermac/openlp/keyboard_shortcuts into lp:openlp
Jonathan Springer has proposed merging lp:~springermac/openlp/keyboard_shortcuts into lp:openlp.
Requested reviews:
OpenLP Core (openlp-core)
For more details, see:
https://code.launchpad.net/~springermac/openlp/keyboard_shortcuts/+merge/281337
Change some keyboard shortcuts to use predefined platform dependent shortcuts from Qt.
Display keyboard shortcuts with modifiers in their platform native form.
--
Your team OpenLP Core is requested to review the proposed merge of lp:~springermac/openlp/keyboard_shortcuts into lp:openlp.
=== modified file 'openlp/core/common/settings.py'
--- openlp/core/common/settings.py 2015-12-07 21:41:15 +0000
+++ openlp/core/common/settings.py 2015-12-24 04:28:48 +0000
@@ -26,7 +26,7 @@
import logging
import os
-from PyQt5 import QtCore, QtGui
+from PyQt5 import QtCore, QtGui, QtWidgets
from openlp.core.common import ThemeLevel, SlideLimits, UiStrings, is_win, is_linux
@@ -170,142 +170,6 @@
'SettingsImport/Make_Changes': 'At_Own_RISK',
'SettingsImport/type': 'OpenLP_settings_export',
'SettingsImport/version': '',
- 'shortcuts/aboutItem': [QtGui.QKeySequence('Ctrl+F1')],
- 'shortcuts/addToService': [],
- 'shortcuts/audioPauseItem': [],
- 'shortcuts/displayTagItem': [],
- 'shortcuts/blankScreen': [QtGui.QKeySequence(QtCore.Qt.Key_Period)],
- 'shortcuts/collapse': [QtGui.QKeySequence(QtCore.Qt.Key_Minus)],
- 'shortcuts/desktopScreen': [QtGui.QKeySequence('D')],
- 'shortcuts/delete': [],
- 'shortcuts/down': [QtGui.QKeySequence(QtCore.Qt.Key_Down)],
- 'shortcuts/editSong': [],
- 'shortcuts/escapeItem': [QtGui.QKeySequence(QtCore.Qt.Key_Escape)],
- 'shortcuts/expand': [QtGui.QKeySequence(QtCore.Qt.Key_Plus)],
- 'shortcuts/exportThemeItem': [],
- 'shortcuts/fileNewItem': [QtGui.QKeySequence('Ctrl+N')],
- 'shortcuts/fileSaveAsItem': [QtGui.QKeySequence('Ctrl+Shift+S')],
- 'shortcuts/fileExitItem': [QtGui.QKeySequence('Alt+F4')],
- 'shortcuts/fileSaveItem': [QtGui.QKeySequence('Ctrl+S')],
- 'shortcuts/fileOpenItem': [QtGui.QKeySequence('Ctrl+O')],
- 'shortcuts/goLive': [],
- 'shortcuts/importThemeItem': [],
- 'shortcuts/importBibleItem': [],
- 'shortcuts/listViewBiblesDeleteItem': [QtGui.QKeySequence(QtCore.Qt.Key_Delete)],
- 'shortcuts/listViewBiblesPreviewItem': [QtGui.QKeySequence(QtCore.Qt.Key_Enter),
- QtGui.QKeySequence(QtCore.Qt.Key_Return)],
- 'shortcuts/listViewBiblesLiveItem': [QtGui.QKeySequence(QtCore.Qt.ShiftModifier | QtCore.Qt.Key_Enter),
- QtGui.QKeySequence(QtCore.Qt.ShiftModifier | QtCore.Qt.Key_Return)],
- 'shortcuts/listViewBiblesServiceItem': [QtGui.QKeySequence(QtCore.Qt.Key_Plus),
- QtGui.QKeySequence(QtCore.Qt.Key_Equal)],
- 'shortcuts/listViewCustomDeleteItem': [QtGui.QKeySequence(QtCore.Qt.Key_Delete)],
- 'shortcuts/listViewCustomPreviewItem': [QtGui.QKeySequence(QtCore.Qt.Key_Enter),
- QtGui.QKeySequence(QtCore.Qt.Key_Return)],
- 'shortcuts/listViewCustomLiveItem': [QtGui.QKeySequence(QtCore.Qt.ShiftModifier | QtCore.Qt.Key_Enter),
- QtGui.QKeySequence(QtCore.Qt.ShiftModifier | QtCore.Qt.Key_Return)],
- 'shortcuts/listViewCustomServiceItem': [QtGui.QKeySequence(QtCore.Qt.Key_Plus),
- QtGui.QKeySequence(QtCore.Qt.Key_Equal)],
- 'shortcuts/listViewImagesDeleteItem': [QtGui.QKeySequence(QtCore.Qt.Key_Delete)],
- 'shortcuts/listViewImagesPreviewItem': [QtGui.QKeySequence(QtCore.Qt.Key_Enter),
- QtGui.QKeySequence(QtCore.Qt.Key_Return)],
- 'shortcuts/listViewImagesLiveItem': [QtGui.QKeySequence(QtCore.Qt.ShiftModifier | QtCore.Qt.Key_Enter),
- QtGui.QKeySequence(QtCore.Qt.ShiftModifier | QtCore.Qt.Key_Return)],
- 'shortcuts/listViewImagesServiceItem': [QtGui.QKeySequence(QtCore.Qt.Key_Plus),
- QtGui.QKeySequence(QtCore.Qt.Key_Equal)],
- 'shortcuts/listViewMediaDeleteItem': [QtGui.QKeySequence(QtCore.Qt.Key_Delete)],
- 'shortcuts/listViewMediaPreviewItem': [QtGui.QKeySequence(QtCore.Qt.Key_Enter),
- QtGui.QKeySequence(QtCore.Qt.Key_Return)],
- 'shortcuts/listViewMediaLiveItem': [QtGui.QKeySequence(QtCore.Qt.ShiftModifier | QtCore.Qt.Key_Enter),
- QtGui.QKeySequence(QtCore.Qt.ShiftModifier | QtCore.Qt.Key_Return)],
- 'shortcuts/listViewMediaServiceItem': [QtGui.QKeySequence(QtCore.Qt.Key_Plus),
- QtGui.QKeySequence(QtCore.Qt.Key_Equal)],
- 'shortcuts/listViewPresentationsDeleteItem': [QtGui.QKeySequence(QtCore.Qt.Key_Delete)],
- 'shortcuts/listViewPresentationsPreviewItem': [QtGui.QKeySequence(QtCore.Qt.Key_Enter),
- QtGui.QKeySequence(QtCore.Qt.Key_Return)],
- 'shortcuts/listViewPresentationsLiveItem': [QtGui.QKeySequence(QtCore.Qt.ShiftModifier | QtCore.Qt.Key_Enter),
- QtGui.QKeySequence(QtCore.Qt.ShiftModifier | QtCore.Qt.Key_Return)],
- 'shortcuts/listViewPresentationsServiceItem': [QtGui.QKeySequence(QtCore.Qt.Key_Plus),
- QtGui.QKeySequence(QtCore.Qt.Key_Equal)],
- 'shortcuts/listViewSongsDeleteItem': [QtGui.QKeySequence(QtCore.Qt.Key_Delete)],
- 'shortcuts/listViewSongsPreviewItem': [QtGui.QKeySequence(QtCore.Qt.Key_Enter),
- QtGui.QKeySequence(QtCore.Qt.Key_Return)],
- 'shortcuts/listViewSongsLiveItem': [QtGui.QKeySequence(QtCore.Qt.ShiftModifier | QtCore.Qt.Key_Enter),
- QtGui.QKeySequence(QtCore.Qt.ShiftModifier | QtCore.Qt.Key_Return)],
- 'shortcuts/listViewSongsServiceItem': [QtGui.QKeySequence(QtCore.Qt.Key_Plus),
- QtGui.QKeySequence(QtCore.Qt.Key_Equal)],
- 'shortcuts/lockPanel': [],
- 'shortcuts/modeDefaultItem': [],
- 'shortcuts/modeLiveItem': [],
- 'shortcuts/make_live': [QtGui.QKeySequence(QtCore.Qt.Key_Enter), QtGui.QKeySequence(QtCore.Qt.Key_Return)],
- 'shortcuts/moveUp': [QtGui.QKeySequence(QtCore.Qt.Key_PageUp)],
- 'shortcuts/moveTop': [QtGui.QKeySequence(QtCore.Qt.Key_Home)],
- 'shortcuts/modeSetupItem': [],
- 'shortcuts/moveBottom': [QtGui.QKeySequence(QtCore.Qt.Key_End)],
- 'shortcuts/moveDown': [QtGui.QKeySequence(QtCore.Qt.Key_PageDown)],
- 'shortcuts/nextTrackItem': [],
- 'shortcuts/nextItem_live': [QtGui.QKeySequence(QtCore.Qt.Key_Down), QtGui.QKeySequence(QtCore.Qt.Key_PageDown)],
- 'shortcuts/nextItem_preview': [QtGui.QKeySequence(QtCore.Qt.Key_Down),
- QtGui.QKeySequence(QtCore.Qt.Key_PageDown)],
- 'shortcuts/nextService': [QtGui.QKeySequence(QtCore.Qt.Key_Right)],
- 'shortcuts/newService': [],
- 'shortcuts/offlineHelpItem': [],
- 'shortcuts/onlineHelpItem': [QtGui.QKeySequence('Alt+F1')],
- 'shortcuts/openService': [],
- 'shortcuts/saveService': [],
- 'shortcuts/previousItem_live': [QtGui.QKeySequence(QtCore.Qt.Key_Up), QtGui.QKeySequence(QtCore.Qt.Key_PageUp)],
- 'shortcuts/playbackPause': [],
- 'shortcuts/playbackPlay': [],
- 'shortcuts/playbackStop': [],
- 'shortcuts/playSlidesLoop': [],
- 'shortcuts/playSlidesOnce': [],
- 'shortcuts/previousService': [QtGui.QKeySequence(QtCore.Qt.Key_Left)],
- 'shortcuts/previousItem_preview': [QtGui.QKeySequence(QtCore.Qt.Key_Up),
- QtGui.QKeySequence(QtCore.Qt.Key_PageUp)],
- 'shortcuts/printServiceItem': [QtGui.QKeySequence('Ctrl+P')],
- 'shortcuts/songExportItem': [],
- 'shortcuts/songUsageStatus': [QtGui.QKeySequence(QtCore.Qt.Key_F4)],
- 'shortcuts/searchShortcut': [QtGui.QKeySequence('Ctrl+F')],
- 'shortcuts/settingsShortcutsItem': [],
- 'shortcuts/settingsImportItem': [],
- 'shortcuts/settingsPluginListItem': [QtGui.QKeySequence('Alt+F7')],
- 'shortcuts/songUsageDelete': [],
- 'shortcuts/settingsConfigureItem': [],
- 'shortcuts/shortcutAction_B': [QtGui.QKeySequence('B')],
- 'shortcuts/shortcutAction_C': [QtGui.QKeySequence('C')],
- 'shortcuts/shortcutAction_E': [QtGui.QKeySequence('E')],
- 'shortcuts/shortcutAction_I': [QtGui.QKeySequence('I')],
- 'shortcuts/shortcutAction_O': [QtGui.QKeySequence('O')],
- 'shortcuts/shortcutAction_P': [QtGui.QKeySequence('P')],
- 'shortcuts/shortcutAction_V': [QtGui.QKeySequence('V')],
- 'shortcuts/shortcutAction_0': [QtGui.QKeySequence('0')],
- 'shortcuts/shortcutAction_1': [QtGui.QKeySequence('1')],
- 'shortcuts/shortcutAction_2': [QtGui.QKeySequence('2')],
- 'shortcuts/shortcutAction_3': [QtGui.QKeySequence('3')],
- 'shortcuts/shortcutAction_4': [QtGui.QKeySequence('4')],
- 'shortcuts/shortcutAction_5': [QtGui.QKeySequence('5')],
- 'shortcuts/shortcutAction_6': [QtGui.QKeySequence('6')],
- 'shortcuts/shortcutAction_7': [QtGui.QKeySequence('7')],
- 'shortcuts/shortcutAction_8': [QtGui.QKeySequence('8')],
- 'shortcuts/shortcutAction_9': [QtGui.QKeySequence('9')],
- 'shortcuts/settingsExportItem': [],
- 'shortcuts/songUsageReport': [],
- 'shortcuts/songImportItem': [],
- 'shortcuts/themeScreen': [QtGui.QKeySequence('T')],
- 'shortcuts/toolsReindexItem': [],
- 'shortcuts/toolsFindDuplicates': [],
- 'shortcuts/toolsAlertItem': [QtGui.QKeySequence('F7')],
- 'shortcuts/toolsFirstTimeWizard': [],
- 'shortcuts/toolsOpenDataFolder': [],
- 'shortcuts/toolsAddToolItem': [],
- 'shortcuts/updateThemeImages': [],
- 'shortcuts/up': [QtGui.QKeySequence(QtCore.Qt.Key_Up)],
- 'shortcuts/viewProjectorManagerItem': [QtGui.QKeySequence('F6')],
- 'shortcuts/viewThemeManagerItem': [QtGui.QKeySequence('F10')],
- 'shortcuts/viewMediaManagerItem': [QtGui.QKeySequence('F8')],
- 'shortcuts/viewPreviewPanel': [QtGui.QKeySequence('F11')],
- 'shortcuts/viewLivePanel': [QtGui.QKeySequence('F12')],
- 'shortcuts/viewServiceManagerItem': [QtGui.QKeySequence('F9')],
- 'shortcuts/webSiteItem': [],
'themes/global theme': '',
'themes/last directory': '',
'themes/last directory export': '',
@@ -379,6 +243,158 @@
QtCore.QSettings.__init__(self, Settings.__file_path__, Settings.IniFormat)
else:
QtCore.QSettings.__init__(self, *args)
+ Settings.__default_settings__.update({
+ 'shortcuts/aboutItem': [QtGui.QKeySequence(QtCore.Qt.CTRL + QtCore.Qt.Key_F1)],
+ 'shortcuts/addToService': [],
+ 'shortcuts/audioPauseItem': [],
+ 'shortcuts/displayTagItem': [],
+ 'shortcuts/blankScreen': [QtGui.QKeySequence(QtCore.Qt.Key_Period)],
+ 'shortcuts/collapse': [QtGui.QKeySequence(QtCore.Qt.Key_Minus)],
+ 'shortcuts/desktopScreen': [QtGui.QKeySequence(QtCore.Qt.Key_D)],
+ 'shortcuts/delete': [QtGui.QKeySequence(QtGui.QKeySequence.Delete), QtGui.QKeySequence(QtCore.Qt.Key_Delete)],
+ 'shortcuts/down': [QtGui.QKeySequence(QtCore.Qt.Key_Down)],
+ 'shortcuts/editSong': [],
+ 'shortcuts/escapeItem': [QtGui.QKeySequence(QtCore.Qt.Key_Escape)],
+ 'shortcuts/expand': [QtGui.QKeySequence(QtCore.Qt.Key_Plus)],
+ 'shortcuts/exportThemeItem': [],
+ 'shortcuts/fileNewItem': [QtGui.QKeySequence(QtGui.QKeySequence.New),
+ QtGui.QKeySequence(QtCore.Qt.CTRL + QtCore.Qt.Key_N)],
+ 'shortcuts/fileSaveAsItem': [QtGui.QKeySequence(QtGui.QKeySequence.SaveAs),
+ QtGui.QKeySequence(QtCore.Qt.CTRL + QtCore.Qt.SHIFT + QtCore.Qt.Key_S)],
+ 'shortcuts/fileExitItem': [QtGui.QKeySequence(QtGui.QKeySequence.Quit),
+ QtGui.QKeySequence(QtCore.Qt.ALT + QtCore.Qt.Key_F4)],
+ 'shortcuts/fileSaveItem': [QtGui.QKeySequence(QtGui.QKeySequence.Save),
+ QtGui.QKeySequence(QtCore.Qt.CTRL + QtCore.Qt.Key_S)],
+ 'shortcuts/fileOpenItem': [QtGui.QKeySequence(QtGui.QKeySequence.Open),
+ QtGui.QKeySequence(QtCore.Qt.CTRL + QtCore.Qt.Key_O)],
+ 'shortcuts/goLive': [],
+ 'shortcuts/importThemeItem': [],
+ 'shortcuts/importBibleItem': [],
+ 'shortcuts/listViewBiblesDeleteItem': [QtGui.QKeySequence(QtGui.QKeySequence.Delete),
+ QtGui.QKeySequence(QtCore.Qt.Key_Delete)],
+ 'shortcuts/listViewBiblesPreviewItem': [QtGui.QKeySequence(QtCore.Qt.Key_Return),
+ QtGui.QKeySequence(QtCore.Qt.Key_Enter)],
+ 'shortcuts/listViewBiblesLiveItem': [QtGui.QKeySequence(QtCore.Qt.SHIFT + QtCore.Qt.Key_Return),
+ QtGui.QKeySequence(QtCore.Qt.SHIFT + QtCore.Qt.Key_Enter)],
+ 'shortcuts/listViewBiblesServiceItem': [QtGui.QKeySequence(QtCore.Qt.Key_Plus),
+ QtGui.QKeySequence(QtCore.Qt.Key_Equal)],
+ 'shortcuts/listViewCustomDeleteItem': [QtGui.QKeySequence(QtGui.QKeySequence.Delete),
+ QtGui.QKeySequence(QtCore.Qt.Key_Delete)],
+ 'shortcuts/listViewCustomPreviewItem': [QtGui.QKeySequence(QtCore.Qt.Key_Return),
+ QtGui.QKeySequence(QtCore.Qt.Key_Enter)],
+ 'shortcuts/listViewCustomLiveItem': [QtGui.QKeySequence(QtCore.Qt.SHIFT + QtCore.Qt.Key_Return),
+ QtGui.QKeySequence(QtCore.Qt.SHIFT + QtCore.Qt.Key_Enter)],
+ 'shortcuts/listViewCustomServiceItem': [QtGui.QKeySequence(QtCore.Qt.Key_Plus),
+ QtGui.QKeySequence(QtCore.Qt.Key_Equal)],
+ 'shortcuts/listViewImagesDeleteItem': [QtGui.QKeySequence(QtGui.QKeySequence.Delete),
+ QtGui.QKeySequence(QtCore.Qt.Key_Delete)],
+ 'shortcuts/listViewImagesPreviewItem': [QtGui.QKeySequence(QtCore.Qt.Key_Return),
+ QtGui.QKeySequence(QtCore.Qt.Key_Enter)],
+ 'shortcuts/listViewImagesLiveItem': [QtGui.QKeySequence(QtCore.Qt.SHIFT + QtCore.Qt.Key_Return),
+ QtGui.QKeySequence(QtCore.Qt.SHIFT + QtCore.Qt.Key_Enter)],
+ 'shortcuts/listViewImagesServiceItem': [QtGui.QKeySequence(QtCore.Qt.Key_Plus),
+ QtGui.QKeySequence(QtCore.Qt.Key_Equal)],
+ 'shortcuts/listViewMediaDeleteItem': [QtGui.QKeySequence(QtGui.QKeySequence.Delete),
+ QtGui.QKeySequence(QtCore.Qt.Key_Delete)],
+ 'shortcuts/listViewMediaPreviewItem': [QtGui.QKeySequence(QtCore.Qt.Key_Return),
+ QtGui.QKeySequence(QtCore.Qt.Key_Enter)],
+ 'shortcuts/listViewMediaLiveItem': [QtGui.QKeySequence(QtCore.Qt.SHIFT + QtCore.Qt.Key_Return),
+ QtGui.QKeySequence(QtCore.Qt.SHIFT + QtCore.Qt.Key_Enter)],
+ 'shortcuts/listViewMediaServiceItem': [QtGui.QKeySequence(QtCore.Qt.Key_Plus),
+ QtGui.QKeySequence(QtCore.Qt.Key_Equal)],
+ 'shortcuts/listViewPresentationsDeleteItem': [QtGui.QKeySequence(QtGui.QKeySequence.Delete),
+ QtGui.QKeySequence(QtCore.Qt.Key_Delete)],
+ 'shortcuts/listViewPresentationsPreviewItem': [QtGui.QKeySequence(QtCore.Qt.Key_Return),
+ QtGui.QKeySequence(QtCore.Qt.Key_Enter)],
+ 'shortcuts/listViewPresentationsLiveItem': [QtGui.QKeySequence(QtCore.Qt.SHIFT + QtCore.Qt.Key_Return),
+ QtGui.QKeySequence(QtCore.Qt.SHIFT + QtCore.Qt.Key_Enter)],
+ 'shortcuts/listViewPresentationsServiceItem': [QtGui.QKeySequence(QtCore.Qt.Key_Plus),
+ QtGui.QKeySequence(QtCore.Qt.Key_Equal)],
+ 'shortcuts/listViewSongsDeleteItem': [QtGui.QKeySequence(QtGui.QKeySequence.Delete),
+ QtGui.QKeySequence(QtCore.Qt.Key_Delete)],
+ 'shortcuts/listViewSongsPreviewItem': [QtGui.QKeySequence(QtCore.Qt.Key_Return),
+ QtGui.QKeySequence(QtCore.Qt.Key_Enter)],
+ 'shortcuts/listViewSongsLiveItem': [QtGui.QKeySequence(QtCore.Qt.SHIFT + QtCore.Qt.Key_Return),
+ QtGui.QKeySequence(QtCore.Qt.SHIFT + QtCore.Qt.Key_Enter)],
+ 'shortcuts/listViewSongsServiceItem': [QtGui.QKeySequence(QtCore.Qt.Key_Plus),
+ QtGui.QKeySequence(QtCore.Qt.Key_Equal)],
+ 'shortcuts/lockPanel': [],
+ 'shortcuts/modeDefaultItem': [],
+ 'shortcuts/modeLiveItem': [],
+ 'shortcuts/make_live': [QtGui.QKeySequence(QtCore.Qt.Key_Return), QtGui.QKeySequence(QtCore.Qt.Key_Enter)],
+ 'shortcuts/moveUp': [QtGui.QKeySequence(QtCore.Qt.Key_PageUp)],
+ 'shortcuts/moveTop': [QtGui.QKeySequence(QtCore.Qt.Key_Home)],
+ 'shortcuts/modeSetupItem': [],
+ 'shortcuts/moveBottom': [QtGui.QKeySequence(QtCore.Qt.Key_End)],
+ 'shortcuts/moveDown': [QtGui.QKeySequence(QtCore.Qt.Key_PageDown)],
+ 'shortcuts/nextTrackItem': [],
+ 'shortcuts/nextItem_live': [QtGui.QKeySequence(QtCore.Qt.Key_Down), QtGui.QKeySequence(QtCore.Qt.Key_PageDown)],
+ 'shortcuts/nextItem_preview': [QtGui.QKeySequence(QtCore.Qt.Key_Down),
+ QtGui.QKeySequence(QtCore.Qt.Key_PageDown)],
+ 'shortcuts/nextService': [QtGui.QKeySequence(QtCore.Qt.Key_Right)],
+ 'shortcuts/newService': [],
+ 'shortcuts/offlineHelpItem': [QtGui.QKeySequence(QtGui.QKeySequence.HelpContents)],
+ 'shortcuts/onlineHelpItem': [QtGui.QKeySequence(QtGui.QKeySequence.HelpContents),
+ QtGui.QKeySequence(QtCore.Qt.ALT + QtCore.Qt.Key_F1)],
+ 'shortcuts/openService': [],
+ 'shortcuts/saveService': [],
+ 'shortcuts/previousItem_live': [QtGui.QKeySequence(QtCore.Qt.Key_Up), QtGui.QKeySequence(QtCore.Qt.Key_PageUp)],
+ 'shortcuts/playbackPause': [],
+ 'shortcuts/playbackPlay': [],
+ 'shortcuts/playbackStop': [],
+ 'shortcuts/playSlidesLoop': [],
+ 'shortcuts/playSlidesOnce': [],
+ 'shortcuts/previousService': [QtGui.QKeySequence(QtCore.Qt.Key_Left)],
+ 'shortcuts/previousItem_preview': [QtGui.QKeySequence(QtCore.Qt.Key_Up),
+ QtGui.QKeySequence(QtCore.Qt.Key_PageUp)],
+ 'shortcuts/printServiceItem': [QtGui.QKeySequence(QtGui.QKeySequence.Print),
+ QtGui.QKeySequence(QtCore.Qt.CTRL + QtCore.Qt.Key_P)],
+ 'shortcuts/songExportItem': [],
+ 'shortcuts/songUsageStatus': [QtGui.QKeySequence(QtCore.Qt.Key_F4)],
+ 'shortcuts/searchShortcut': [QtGui.QKeySequence(QtGui.QKeySequence.Find),
+ QtGui.QKeySequence(QtCore.Qt.CTRL + QtCore.Qt.Key_F)],
+ 'shortcuts/settingsShortcutsItem': [],
+ 'shortcuts/settingsImportItem': [],
+ 'shortcuts/settingsPluginListItem': [QtGui.QKeySequence(QtCore.Qt.ALT + QtCore.Qt.Key_F7)],
+ 'shortcuts/songUsageDelete': [],
+ 'shortcuts/settingsConfigureItem': [QtGui.QKeySequence(QtGui.QKeySequence.Preferences)],
+ 'shortcuts/shortcutAction_B': [QtGui.QKeySequence(QtCore.Qt.Key_B)],
+ 'shortcuts/shortcutAction_C': [QtGui.QKeySequence(QtCore.Qt.Key_C)],
+ 'shortcuts/shortcutAction_E': [QtGui.QKeySequence(QtCore.Qt.Key_E)],
+ 'shortcuts/shortcutAction_I': [QtGui.QKeySequence(QtCore.Qt.Key_I)],
+ 'shortcuts/shortcutAction_O': [QtGui.QKeySequence(QtCore.Qt.Key_O)],
+ 'shortcuts/shortcutAction_P': [QtGui.QKeySequence(QtCore.Qt.Key_P)],
+ 'shortcuts/shortcutAction_V': [QtGui.QKeySequence(QtCore.Qt.Key_V)],
+ 'shortcuts/shortcutAction_0': [QtGui.QKeySequence(QtCore.Qt.Key_0)],
+ 'shortcuts/shortcutAction_1': [QtGui.QKeySequence(QtCore.Qt.Key_1)],
+ 'shortcuts/shortcutAction_2': [QtGui.QKeySequence(QtCore.Qt.Key_2)],
+ 'shortcuts/shortcutAction_3': [QtGui.QKeySequence(QtCore.Qt.Key_3)],
+ 'shortcuts/shortcutAction_4': [QtGui.QKeySequence(QtCore.Qt.Key_4)],
+ 'shortcuts/shortcutAction_5': [QtGui.QKeySequence(QtCore.Qt.Key_5)],
+ 'shortcuts/shortcutAction_6': [QtGui.QKeySequence(QtCore.Qt.Key_6)],
+ 'shortcuts/shortcutAction_7': [QtGui.QKeySequence(QtCore.Qt.Key_7)],
+ 'shortcuts/shortcutAction_8': [QtGui.QKeySequence(QtCore.Qt.Key_8)],
+ 'shortcuts/shortcutAction_9': [QtGui.QKeySequence(QtCore.Qt.Key_9)],
+ 'shortcuts/settingsExportItem': [],
+ 'shortcuts/songUsageReport': [],
+ 'shortcuts/songImportItem': [],
+ 'shortcuts/themeScreen': [QtGui.QKeySequence(QtCore.Qt.Key_T)],
+ 'shortcuts/toolsReindexItem': [],
+ 'shortcuts/toolsFindDuplicates': [],
+ 'shortcuts/toolsAlertItem': [QtGui.QKeySequence(QtCore.Qt.Key_F7)],
+ 'shortcuts/toolsFirstTimeWizard': [],
+ 'shortcuts/toolsOpenDataFolder': [],
+ 'shortcuts/toolsAddToolItem': [],
+ 'shortcuts/updateThemeImages': [],
+ 'shortcuts/up': [QtGui.QKeySequence(QtCore.Qt.Key_Up)],
+ 'shortcuts/viewProjectorManagerItem': [QtGui.QKeySequence(QtCore.Qt.Key_F6)],
+ 'shortcuts/viewThemeManagerItem': [QtGui.QKeySequence(QtCore.Qt.Key_F10)],
+ 'shortcuts/viewMediaManagerItem': [QtGui.QKeySequence(QtCore.Qt.Key_F8)],
+ 'shortcuts/viewPreviewPanel': [QtGui.QKeySequence(QtCore.Qt.Key_F11)],
+ 'shortcuts/viewLivePanel': [QtGui.QKeySequence(QtCore.Qt.Key_F12)],
+ 'shortcuts/viewServiceManagerItem': [QtGui.QKeySequence(QtCore.Qt.Key_F9)],
+ 'shortcuts/webSiteItem': []
+ })
def get_default_value(self, key):
"""
=== modified file 'openlp/core/ui/shortcutlistdialog.py'
--- openlp/core/ui/shortcutlistdialog.py 2015-11-07 00:49:40 +0000
+++ openlp/core/ui/shortcutlistdialog.py 2015-12-24 04:28:48 +0000
@@ -50,6 +50,14 @@
event.ignore()
+class ShortcutTreeWidget(QtWidgets.QTreeWidget):
+ def __init__(self, *args):
+ super(ShortcutTreeWidget, self).__init__(*args)
+
+ def keyboardSearch(self, search):
+ pass
+
+
class Ui_ShortcutListDialog(object):
"""
The UI widgets for the shortcut dialog.
@@ -67,7 +75,7 @@
self.description_label.setObjectName('description_label')
self.description_label.setWordWrap(True)
self.shortcut_list_layout.addWidget(self.description_label)
- self.tree_widget = QtWidgets.QTreeWidget(shortcutListDialog)
+ self.tree_widget = ShortcutTreeWidget(shortcutListDialog)
self.tree_widget.setObjectName('tree_widget')
self.tree_widget.setAlternatingRowColors(True)
self.tree_widget.setColumnCount(3)
=== modified file 'openlp/core/ui/shortcutlistform.py'
--- openlp/core/ui/shortcutlistform.py 2015-11-07 00:49:40 +0000
+++ openlp/core/ui/shortcutlistform.py 2015-12-24 04:28:48 +0000
@@ -96,9 +96,11 @@
key_sequence = QtGui.QKeySequence(key_string)
if self._validiate_shortcut(self._current_item_action(), key_sequence):
if self.primary_push_button.isChecked():
- self._adjust_button(self.primary_push_button, False, text=key_sequence.toString())
+ self._adjust_button(self.primary_push_button, False,
+ text=self.get_shortcut_string(key_sequence, for_display=True))
elif self.alternate_push_button.isChecked():
- self._adjust_button(self.alternate_push_button, False, text=key_sequence.toString())
+ self._adjust_button(self.alternate_push_button, False,
+ text=self.get_shortcut_string(key_sequence, for_display=True))
def exec(self):
"""
@@ -154,11 +156,11 @@
item.setText(1, '')
item.setText(2, '')
elif len(shortcuts) == 1:
- item.setText(1, shortcuts[0].toString())
+ item.setText(1, self.get_shortcut_string(shortcuts[0], for_display=True))
item.setText(2, '')
else:
- item.setText(1, shortcuts[0].toString())
- item.setText(2, shortcuts[1].toString())
+ item.setText(1, self.get_shortcut_string(shortcuts[0], for_display=True))
+ item.setText(2, self.get_shortcut_string(shortcuts[1], for_display=True))
self.on_current_item_changed()
def on_primary_push_button_clicked(self, toggled):
@@ -238,9 +240,9 @@
self.alternate_push_button.setChecked(False)
else:
if action.default_shortcuts:
- primary_label_text = action.default_shortcuts[0].toString()
+ primary_label_text = self.get_shortcut_string(action.default_shortcuts[0], for_display=True)
if len(action.default_shortcuts) == 2:
- alternate_label_text = action.default_shortcuts[1].toString()
+ alternate_label_text = self.get_shortcut_string(action.default_shortcuts[1], for_display=True)
shortcuts = self._action_shortcuts(action)
# We do not want to loose pending changes, that is why we have to keep the text when, this function has not
# been triggered by a signal.
@@ -248,10 +250,10 @@
primary_text = self.primary_push_button.text()
alternate_text = self.alternate_push_button.text()
elif len(shortcuts) == 1:
- primary_text = shortcuts[0].toString()
+ primary_text = self.get_shortcut_string(shortcuts[0], for_display=True)
elif len(shortcuts) == 2:
- primary_text = shortcuts[0].toString()
- alternate_text = shortcuts[1].toString()
+ primary_text = self.get_shortcut_string(shortcuts[0], for_display=True)
+ alternate_text = self.get_shortcut_string(shortcuts[1], for_display=True)
# When we are capturing a new shortcut, we do not want, the buttons to display the current shortcut.
if self.primary_push_button.isChecked():
primary_text = ''
@@ -305,9 +307,9 @@
primary_button_text = ''
alternate_button_text = ''
if temp_shortcuts:
- primary_button_text = temp_shortcuts[0].toString()
+ primary_button_text = self.get_shortcut_string(temp_shortcuts[0], for_display=True)
if len(temp_shortcuts) == 2:
- alternate_button_text = temp_shortcuts[1].toString()
+ alternate_button_text = self.get_shortcut_string(temp_shortcuts[1], for_display=True)
self.primary_push_button.setText(primary_button_text)
self.alternate_push_button.setText(alternate_button_text)
@@ -335,7 +337,7 @@
continue
for action in category.actions:
if action in self.changed_actions:
- old_shortcuts = list(map(QtGui.QKeySequence.toString, action.shortcuts()))
+ old_shortcuts = list(map(self.get_shortcut_string, action.shortcuts()))
action.setShortcuts(self.changed_actions[action])
self.action_list.update_shortcut_map(action, old_shortcuts)
settings.setValue(action.objectName(), action.shortcuts())
@@ -418,14 +420,15 @@
self.main_window.warning_message(translate('OpenLP.ShortcutListDialog', 'Duplicate Shortcut'),
translate('OpenLP.ShortcutListDialog',
'The shortcut "%s" is already assigned to another action, please'
- ' use a different shortcut.') % key_sequence.toString())
+ ' use a different shortcut.') %
+ self.get_shortcut_string(key_sequence, for_display=True))
self.dialog_was_shown = True
return is_valid
def _action_shortcuts(self, action):
"""
This returns the shortcuts for the given ``action``, which also includes those shortcuts which are not saved
- yet but already assigned (as changes yre applied when closing the dialog).
+ yet but already assigned (as changes are applied when closing the dialog).
"""
if action in self.changed_actions:
return self.changed_actions[action]
@@ -453,3 +456,14 @@
button.setChecked(checked)
if enabled is not None:
button.setEnabled(enabled)
+
+ @staticmethod
+ def get_shortcut_string(shortcut, for_display=False):
+ if for_display:
+ if any(modifier in shortcut.toString() for modifier in ['Ctrl', 'Alt', 'Meta', 'Shift']):
+ sequence_format = QtGui.QKeySequence.NativeText
+ else:
+ sequence_format = QtGui.QKeySequence.PortableText
+ else:
+ sequence_format = QtGui.QKeySequence.PortableText
+ return shortcut.toString(sequence_format)
=== modified file 'tests/functional/openlp_core_utils/test_actions.py'
--- tests/functional/openlp_core_utils/test_actions.py 2015-11-07 00:49:40 +0000
+++ tests/functional/openlp_core_utils/test_actions.py 2015-12-24 04:28:48 +0000
@@ -163,8 +163,9 @@
action_with_same_shortcuts1.setObjectName('action_with_same_shortcuts1')
# Add default shortcuts to Settings class.
default_shortcuts = {
- 'shortcuts/action1': [QtGui.QKeySequence('a'), QtGui.QKeySequence('b')],
- 'shortcuts/action_with_same_shortcuts1': [QtGui.QKeySequence('b'), QtGui.QKeySequence('a')]
+ 'shortcuts/action1': [QtGui.QKeySequence(QtCore.Qt.Key_A), QtGui.QKeySequence(QtCore.Qt.Key_B)],
+ 'shortcuts/action_with_same_shortcuts1': [QtGui.QKeySequence(QtCore.Qt.Key_B),
+ QtGui.QKeySequence(QtCore.Qt.Key_A)]
}
Settings.extend_default_settings(default_shortcuts)
@@ -193,8 +194,9 @@
action_with_same_shortcuts2.setObjectName('action_with_same_shortcuts2')
# Add default shortcuts to Settings class.
default_shortcuts = {
- 'shortcuts/action2': [QtGui.QKeySequence('c'), QtGui.QKeySequence('d')],
- 'shortcuts/action_with_same_shortcuts2': [QtGui.QKeySequence('d'), QtGui.QKeySequence('c')]
+ 'shortcuts/action2': [QtGui.QKeySequence(QtCore.Qt.Key_C), QtGui.QKeySequence(QtCore.Qt.Key_D)],
+ 'shortcuts/action_with_same_shortcuts2': [QtGui.QKeySequence(QtCore.Qt.Key_D),
+ QtGui.QKeySequence(QtCore.Qt.Key_C)]
}
Settings.extend_default_settings(default_shortcuts)
@@ -225,8 +227,9 @@
action_with_same_shortcuts3.setShortcutContext(QtCore.Qt.WidgetShortcut)
# Add default shortcuts to Settings class.
default_shortcuts = {
- 'shortcuts/action3': [QtGui.QKeySequence('e'), QtGui.QKeySequence('f')],
- 'shortcuts/action_with_same_shortcuts3': [QtGui.QKeySequence('e'), QtGui.QKeySequence('f')]
+ 'shortcuts/action3': [QtGui.QKeySequence(QtCore.Qt.Key_E), QtGui.QKeySequence(QtCore.Qt.Key_F)],
+ 'shortcuts/action_with_same_shortcuts3': [QtGui.QKeySequence(QtCore.Qt.Key_E),
+ QtGui.QKeySequence(QtCore.Qt.Key_F)]
}
Settings.extend_default_settings(default_shortcuts)
Follow ups