openlp/openlp/core/ui/shortcutlistdialog.py

93 lines
5.3 KiB
Python
Raw Normal View History

2010-10-07 21:27:26 +00:00
# -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
2010-12-26 11:04:47 +00:00
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
2011-03-24 19:04:02 +00:00
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, Frode Woldsund #
2010-10-07 21:27:26 +00:00
# --------------------------------------------------------------------------- #
# This program is free software; you can redistribute it and/or modify it #
# under the terms of the GNU General Public License as published by the Free #
# Software Foundation; version 2 of the License. #
# #
# This program is distributed in the hope that it will be useful, but WITHOUT #
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
# more details. #
# #
# You should have received a copy of the GNU General Public License along #
# with this program; if not, write to the Free Software Foundation, Inc., 59 #
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
###############################################################################
from PyQt4 import QtCore, QtGui
from openlp.core.lib import translate, build_icon
class Ui_ShortcutListDialog(object):
def setupUi(self, shortcutListDialog):
2011-03-29 19:52:21 +00:00
shortcutListDialog.resize(440, 450)
2010-10-07 21:27:26 +00:00
shortcutListDialog.setObjectName(u'shortcutListDialog')
self.dialogLayout = QtGui.QVBoxLayout(shortcutListDialog)
self.dialogLayout.setObjectName(u'dialogLayout')
self.descriptionLabel = QtGui.QLabel(shortcutListDialog)
2011-04-03 13:24:51 +00:00
self.descriptionLabel.setObjectName(u'descriptionLabel')
self.descriptionLabel.setWordWrap(True)
2011-04-03 13:24:51 +00:00
self.dialogLayout.addWidget(self.descriptionLabel)
self.treeWidget = QtGui.QTreeWidget(shortcutListDialog)
self.treeWidget.setAlternatingRowColors(True)
self.treeWidget.setObjectName(u'treeWidget')
2011-02-14 21:06:48 +00:00
self.treeWidget.setColumnCount(3)
self.dialogLayout.addWidget(self.treeWidget)
self.customLayout = QtGui.QHBoxLayout()
self.customLayout.setObjectName(u'customLayout')
self.shortcutButtonLabel = QtGui.QLabel(shortcutListDialog)
self.shortcutButtonLabel.setObjectName(u'descriptionLabel')
self.customLayout.addWidget(self.shortcutButtonLabel)
self.shortcutButton = QtGui.QPushButton(shortcutListDialog)
self.shortcutButton.setIcon(
build_icon(u':/system/system_configure_shortcuts.png'))
self.shortcutButton.setCheckable(True)
self.shortcutButton.setObjectName(u'shortcutButton')
2011-03-29 19:52:21 +00:00
self.shortcutButton.setFixedSize(150, 30)
self.customLayout.addWidget(self.shortcutButton)
self.clearShortcutButton = QtGui.QToolButton(shortcutListDialog)
self.clearShortcutButton.setIcon(
2010-10-07 21:27:26 +00:00
build_icon(u':/system/clear_shortcut.png'))
self.clearShortcutButton.setAutoRaise(True)
self.clearShortcutButton.setObjectName(u'clearShortcutButton')
self.customLayout.addWidget(self.clearShortcutButton)
self.customLayout.addStretch()
self.dialogLayout.addLayout(self.customLayout)
self.buttonBox = QtGui.QDialogButtonBox(shortcutListDialog)
2011-04-03 13:24:51 +00:00
self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel |
QtGui.QDialogButtonBox.Ok | QtGui.QDialogButtonBox.RestoreDefaults)
self.buttonBox.setObjectName(u'buttonBox')
self.dialogLayout.addWidget(self.buttonBox)
2010-10-07 21:27:26 +00:00
self.retranslateUi(shortcutListDialog)
QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(u'accepted()'),
shortcutListDialog.accept)
QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(u'rejected()'),
shortcutListDialog.reject)
2010-10-07 21:27:26 +00:00
QtCore.QMetaObject.connectSlotsByName(shortcutListDialog)
def retranslateUi(self, shortcutListDialog):
shortcutListDialog.setWindowTitle(
translate('OpenLP.ShortcutListDialog', 'Customize Shortcuts'))
2011-04-03 13:24:51 +00:00
self.descriptionLabel.setText(translate('OpenLP.ShortcutListDialog',
'Select an action and click the button below to start capturing '
'a new shortcut.'))
self.treeWidget.setHeaderLabels([
2010-10-30 07:51:34 +00:00
translate('OpenLP.ShortcutListDialog', 'Action'),
translate('OpenLP.ShortcutListDialog', 'Shortcut'),
2011-02-14 21:06:48 +00:00
translate('OpenLP.ShortcutListDialog', 'Alternate')])
self.shortcutButtonLabel.setText(
translate('OpenLP.ShortcutListDialog', 'Capture shortcut:'))
2011-04-03 13:24:51 +00:00
self.clearShortcutButton.setToolTip(
translate('OpenLP.ShortcutListDialog',
'Restore the default shortcut(s) of this action.'))