PluginForm naming

This commit is contained in:
Jon Tibble 2010-07-27 12:57:25 +01:00
parent 88be71f625
commit 62be523f10
2 changed files with 87 additions and 87 deletions

View File

@ -28,91 +28,91 @@ from PyQt4 import QtCore, QtGui
from openlp.core.lib import translate
class Ui_PluginViewDialog(object):
def setupUi(self, PluginViewDialog):
PluginViewDialog.setObjectName(u'PluginViewDialog')
PluginViewDialog.setWindowModality(QtCore.Qt.ApplicationModal)
PluginViewDialog.resize(554, 344)
self.PluginLayout = QtGui.QVBoxLayout(PluginViewDialog)
self.PluginLayout.setSpacing(8)
self.PluginLayout.setMargin(8)
self.PluginLayout.setObjectName(u'PluginLayout')
self.ListLayout = QtGui.QHBoxLayout()
self.ListLayout.setSpacing(8)
self.ListLayout.setObjectName(u'ListLayout')
self.PluginListWidget = QtGui.QListWidget(PluginViewDialog)
def setupUi(self, pluginViewDialog):
pluginViewDialog.setObjectName(u'pluginViewDialog')
pluginViewDialog.setWindowModality(QtCore.Qt.ApplicationModal)
pluginViewDialog.resize(554, 344)
self.pluginLayout = QtGui.QVBoxLayout(pluginViewDialog)
self.pluginLayout.setSpacing(8)
self.pluginLayout.setMargin(8)
self.pluginLayout.setObjectName(u'pluginLayout')
self.listLayout = QtGui.QHBoxLayout()
self.listLayout.setSpacing(8)
self.listLayout.setObjectName(u'listLayout')
self.pluginListWidget = QtGui.QListWidget(pluginViewDialog)
sizePolicy = QtGui.QSizePolicy(
QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(
self.PluginListWidget.sizePolicy().hasHeightForWidth())
self.PluginListWidget.setSizePolicy(sizePolicy)
self.PluginListWidget.setMaximumSize(QtCore.QSize(192, 16777215))
self.PluginListWidget.setObjectName(u'PluginListWidget')
self.ListLayout.addWidget(self.PluginListWidget)
self.PluginInfoGroupBox = QtGui.QGroupBox(PluginViewDialog)
self.PluginInfoGroupBox.setAlignment(
self.pluginListWidget.sizePolicy().hasHeightForWidth())
self.pluginListWidget.setSizePolicy(sizePolicy)
self.pluginListWidget.setMaximumSize(QtCore.QSize(192, 16777215))
self.pluginListWidget.setObjectName(u'pluginListWidget')
self.listLayout.addWidget(self.pluginListWidget)
self.pluginInfoGroupBox = QtGui.QGroupBox(pluginViewDialog)
self.pluginInfoGroupBox.setAlignment(
QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
self.PluginInfoGroupBox.setFlat(False)
self.PluginInfoGroupBox.setObjectName(u'PluginInfoGroupBox')
self.PluginInfoLayout = QtGui.QFormLayout(self.PluginInfoGroupBox)
self.PluginInfoLayout.setMargin(8)
self.PluginInfoLayout.setSpacing(8)
self.PluginInfoLayout.setObjectName(u'PluginInfoLayout')
self.VersionLabel = QtGui.QLabel(self.PluginInfoGroupBox)
self.VersionLabel.setObjectName(u'VersionLabel')
self.PluginInfoLayout.setWidget(
1, QtGui.QFormLayout.LabelRole, self.VersionLabel)
self.VersionNumberLabel = QtGui.QLabel(self.PluginInfoGroupBox)
self.VersionNumberLabel.setObjectName(u'VersionNumberLabel')
self.PluginInfoLayout.setWidget(
1, QtGui.QFormLayout.FieldRole, self.VersionNumberLabel)
self.AboutLabel = QtGui.QLabel(self.PluginInfoGroupBox)
self.AboutLabel.setObjectName(u'AboutLabel')
self.PluginInfoLayout.setWidget(
2, QtGui.QFormLayout.LabelRole, self.AboutLabel)
self.StatusLabel = QtGui.QLabel(self.PluginInfoGroupBox)
self.StatusLabel.setObjectName(u'StatusLabel')
self.PluginInfoLayout.setWidget(
0, QtGui.QFormLayout.LabelRole, self.StatusLabel)
self.StatusComboBox = QtGui.QComboBox(self.PluginInfoGroupBox)
self.StatusComboBox.setObjectName(u'StatusComboBox')
self.StatusComboBox.addItem(QtCore.QString())
self.StatusComboBox.addItem(QtCore.QString())
self.PluginInfoLayout.setWidget(
0, QtGui.QFormLayout.FieldRole, self.StatusComboBox)
self.AboutTextBrowser = QtGui.QTextBrowser(self.PluginInfoGroupBox)
self.AboutTextBrowser.setTextInteractionFlags(
self.pluginInfoGroupBox.setFlat(False)
self.pluginInfoGroupBox.setObjectName(u'pluginInfoGroupBox')
self.pluginInfoLayout = QtGui.QFormLayout(self.pluginInfoGroupBox)
self.pluginInfoLayout.setMargin(8)
self.pluginInfoLayout.setSpacing(8)
self.pluginInfoLayout.setObjectName(u'pluginInfoLayout')
self.versionLabel = QtGui.QLabel(self.pluginInfoGroupBox)
self.versionLabel.setObjectName(u'versionLabel')
self.pluginInfoLayout.setWidget(
1, QtGui.QFormLayout.LabelRole, self.versionLabel)
self.versionNumberLabel = QtGui.QLabel(self.pluginInfoGroupBox)
self.versionNumberLabel.setObjectName(u'versionNumberLabel')
self.pluginInfoLayout.setWidget(
1, QtGui.QFormLayout.FieldRole, self.versionNumberLabel)
self.aboutLabel = QtGui.QLabel(self.pluginInfoGroupBox)
self.aboutLabel.setObjectName(u'aboutLabel')
self.pluginInfoLayout.setWidget(
2, QtGui.QFormLayout.LabelRole, self.aboutLabel)
self.statusLabel = QtGui.QLabel(self.pluginInfoGroupBox)
self.statusLabel.setObjectName(u'statusLabel')
self.pluginInfoLayout.setWidget(
0, QtGui.QFormLayout.LabelRole, self.statusLabel)
self.statusComboBox = QtGui.QComboBox(self.pluginInfoGroupBox)
self.statusComboBox.setObjectName(u'statusComboBox')
self.statusComboBox.addItem(QtCore.QString())
self.statusComboBox.addItem(QtCore.QString())
self.pluginInfoLayout.setWidget(
0, QtGui.QFormLayout.FieldRole, self.statusComboBox)
self.aboutTextBrowser = QtGui.QTextBrowser(self.pluginInfoGroupBox)
self.aboutTextBrowser.setTextInteractionFlags(
QtCore.Qt.LinksAccessibleByMouse)
self.AboutTextBrowser.setObjectName(u'AboutTextBrowser')
self.PluginInfoLayout.setWidget(
2, QtGui.QFormLayout.FieldRole, self.AboutTextBrowser)
self.ListLayout.addWidget(self.PluginInfoGroupBox)
self.PluginLayout.addLayout(self.ListLayout)
self.PluginListButtonBox = QtGui.QDialogButtonBox(PluginViewDialog)
self.PluginListButtonBox.setStandardButtons(QtGui.QDialogButtonBox.Ok)
self.PluginListButtonBox.setObjectName(u'PluginListButtonBox')
self.PluginLayout.addWidget(self.PluginListButtonBox)
self.aboutTextBrowser.setObjectName(u'aboutTextBrowser')
self.pluginInfoLayout.setWidget(
2, QtGui.QFormLayout.FieldRole, self.aboutTextBrowser)
self.listLayout.addWidget(self.pluginInfoGroupBox)
self.pluginLayout.addLayout(self.listLayout)
self.pluginListButtonBox = QtGui.QDialogButtonBox(pluginViewDialog)
self.pluginListButtonBox.setStandardButtons(QtGui.QDialogButtonBox.Ok)
self.pluginListButtonBox.setObjectName(u'pluginListButtonBox')
self.pluginLayout.addWidget(self.pluginListButtonBox)
self.retranslateUi(PluginViewDialog)
QtCore.QObject.connect(self.PluginListButtonBox,
QtCore.SIGNAL(u'accepted()'), PluginViewDialog.close)
QtCore.QMetaObject.connectSlotsByName(PluginViewDialog)
self.retranslateUi(pluginViewDialog)
QtCore.QObject.connect(self.pluginListButtonBox,
QtCore.SIGNAL(u'accepted()'), pluginViewDialog.close)
QtCore.QMetaObject.connectSlotsByName(pluginViewDialog)
def retranslateUi(self, PluginViewDialog):
PluginViewDialog.setWindowTitle(
def retranslateUi(self, pluginViewDialog):
pluginViewDialog.setWindowTitle(
translate('OpenLP.PluginForm', 'Plugin List'))
self.PluginInfoGroupBox.setTitle(
self.pluginInfoGroupBox.setTitle(
translate('OpenLP.PluginForm', 'Plugin Details'))
self.VersionLabel.setText(
self.versionLabel.setText(
translate('OpenLP.PluginForm', 'Version:'))
self.VersionNumberLabel.setText(
self.versionNumberLabel.setText(
translate('OpenLP.PluginForm', 'TextLabel'))
self.AboutLabel.setText(
self.aboutLabel.setText(
translate('OpenLP.PluginForm', 'About:'))
self.StatusLabel.setText(
self.statusLabel.setText(
translate('OpenLP.PluginForm', 'Status:'))
self.StatusComboBox.setItemText(0,
self.statusComboBox.setItemText(0,
translate('OpenLP.PluginForm', 'Active'))
self.StatusComboBox.setItemText(1,
self.statusComboBox.setItemText(1,
translate('OpenLP.PluginForm', 'Inactive'))

View File

@ -45,11 +45,11 @@ class PluginForm(QtGui.QDialog, Ui_PluginViewDialog):
self._clearDetails()
# Right, now let's put some signals and slots together!
QtCore.QObject.connect(
self.PluginListWidget,
self.pluginListWidget,
QtCore.SIGNAL(u'itemSelectionChanged()'),
self.onPluginListWidgetSelectionChanged)
QtCore.QObject.connect(
self.StatusComboBox,
self.statusComboBox,
QtCore.SIGNAL(u'currentIndexChanged(int)'),
self.onStatusComboBoxChanged)
@ -57,9 +57,9 @@ class PluginForm(QtGui.QDialog, Ui_PluginViewDialog):
"""
Load the plugin details into the screen
"""
self.PluginListWidget.clear()
self.pluginListWidget.clear()
for plugin in self.parent.plugin_manager.plugins:
item = QtGui.QListWidgetItem(self.PluginListWidget)
item = QtGui.QListWidgetItem(self.pluginListWidget)
# We do this just to make 100% sure the status is an integer as
# sometimes when it's loaded from the config, it isn't cast to int.
plugin.status = int(plugin.status)
@ -79,31 +79,31 @@ class PluginForm(QtGui.QDialog, Ui_PluginViewDialog):
# If the plugin has an icon, set it!
if plugin.icon:
item.setIcon(plugin.icon)
self.PluginListWidget.addItem(item)
self.pluginListWidget.addItem(item)
def _clearDetails(self):
self.StatusComboBox.setCurrentIndex(-1)
self.VersionNumberLabel.setText(u'')
self.AboutTextBrowser.setHtml(u'')
self.StatusComboBox.setEnabled(False)
self.statusComboBox.setCurrentIndex(-1)
self.versionNumberLabel.setText(u'')
self.aboutTextBrowser.setHtml(u'')
self.statusComboBox.setEnabled(False)
def _setDetails(self):
log.debug('PluginStatus: %s', str(self.activePlugin.status))
self.VersionNumberLabel.setText(self.activePlugin.version)
self.AboutTextBrowser.setHtml(self.activePlugin.about())
self.versionNumberLabel.setText(self.activePlugin.version)
self.aboutTextBrowser.setHtml(self.activePlugin.about())
self.programaticChange = True
status = 1
if self.activePlugin.status == PluginStatus.Active:
status = 0
self.StatusComboBox.setCurrentIndex(status)
self.StatusComboBox.setEnabled(True)
self.statusComboBox.setCurrentIndex(status)
self.statusComboBox.setEnabled(True)
self.programaticChange = False
def onPluginListWidgetSelectionChanged(self):
if self.PluginListWidget.currentItem() is None:
if self.pluginListWidget.currentItem() is None:
self._clearDetails()
return
plugin_name = self.PluginListWidget.currentItem().text().split(u' ')[0]
plugin_name = self.pluginListWidget.currentItem().text().split(u' ')[0]
self.activePlugin = None
for plugin in self.parent.plugin_manager.plugins:
if plugin.name == plugin_name:
@ -134,5 +134,5 @@ class PluginForm(QtGui.QDialog, Ui_PluginViewDialog):
elif self.activePlugin.status == PluginStatus.Disabled:
status_text = unicode(
translate('OpenLP.PluginForm', '%s (Disabled)'))
self.PluginListWidget.currentItem().setText(
self.pluginListWidget.currentItem().setText(
status_text % self.activePlugin.name)