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

View File

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