openlp/openlp/core/ui/plugindialog.py

93 lines
5.2 KiB
Python
Raw Normal View History

2009-10-06 21:07:12 +00:00
# -*- coding: utf-8 -*-
2012-12-29 13:35:16 +00:00
# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
2009-10-06 21:07:12 +00:00
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
2013-12-24 08:56:50 +00:00
# Copyright (c) 2008-2014 Raoul Snyman #
# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
2012-11-11 21:16:14 +00:00
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
2012-10-21 13:16:22 +00:00
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
# Christian Richter, Philip Ridout, Simon Scudder, Jeffrey Smith, #
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, Dave Warnock, #
# Frode Woldsund, Martin Zibricky, Patrick Zimmermann #
2009-10-06 21:07:12 +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 #
###############################################################################
2013-02-01 20:52:42 +00:00
"""
The UI widgets of the plugin view dialog
#"""
2009-10-06 21:07:12 +00:00
from PyQt4 import QtCore, QtGui
2011-02-12 04:09:03 +00:00
2013-10-13 20:36:42 +00:00
from openlp.core.common import UiStrings, translate
from openlp.core.lib.ui import create_button_box
2009-10-06 21:07:12 +00:00
class Ui_PluginViewDialog(object):
2013-02-01 20:52:42 +00:00
"""
The UI of the plugin view dialog
"""
2010-07-27 11:57:25 +00:00
def setupUi(self, pluginViewDialog):
2013-02-01 20:52:42 +00:00
"""
Set up the UI
"""
2013-08-31 18:17:38 +00:00
pluginViewDialog.setObjectName('pluginViewDialog')
2010-07-27 11:57:25 +00:00
pluginViewDialog.setWindowModality(QtCore.Qt.ApplicationModal)
self.pluginLayout = QtGui.QVBoxLayout(pluginViewDialog)
2013-08-31 18:17:38 +00:00
self.pluginLayout.setObjectName('pluginLayout')
2010-07-27 11:57:25 +00:00
self.listLayout = QtGui.QHBoxLayout()
2013-08-31 18:17:38 +00:00
self.listLayout.setObjectName('listLayout')
2010-07-27 11:57:25 +00:00
self.pluginListWidget = QtGui.QListWidget(pluginViewDialog)
2013-08-31 18:17:38 +00:00
self.pluginListWidget.setObjectName('pluginListWidget')
2010-07-27 11:57:25 +00:00
self.listLayout.addWidget(self.pluginListWidget)
self.pluginInfoGroupBox = QtGui.QGroupBox(pluginViewDialog)
2013-08-31 18:17:38 +00:00
self.pluginInfoGroupBox.setObjectName('pluginInfoGroupBox')
2010-07-27 11:57:25 +00:00
self.pluginInfoLayout = QtGui.QFormLayout(self.pluginInfoGroupBox)
2013-08-31 18:17:38 +00:00
self.pluginInfoLayout.setObjectName('pluginInfoLayout')
self.statusLabel = QtGui.QLabel(self.pluginInfoGroupBox)
2013-08-31 18:17:38 +00:00
self.statusLabel.setObjectName('statusLabel')
self.statusComboBox = QtGui.QComboBox(self.pluginInfoGroupBox)
2013-08-31 18:17:38 +00:00
self.statusComboBox.addItems(('', ''))
self.statusComboBox.setObjectName('statusComboBox')
self.pluginInfoLayout.addRow(self.statusLabel, self.statusComboBox)
2010-07-27 11:57:25 +00:00
self.versionLabel = QtGui.QLabel(self.pluginInfoGroupBox)
2013-08-31 18:17:38 +00:00
self.versionLabel.setObjectName('versionLabel')
2010-07-27 11:57:25 +00:00
self.versionNumberLabel = QtGui.QLabel(self.pluginInfoGroupBox)
2013-08-31 18:17:38 +00:00
self.versionNumberLabel.setObjectName('versionNumberLabel')
self.pluginInfoLayout.addRow(self.versionLabel, self.versionNumberLabel)
2010-07-27 11:57:25 +00:00
self.aboutLabel = QtGui.QLabel(self.pluginInfoGroupBox)
2013-08-31 18:17:38 +00:00
self.aboutLabel.setObjectName('aboutLabel')
2010-07-27 11:57:25 +00:00
self.aboutTextBrowser = QtGui.QTextBrowser(self.pluginInfoGroupBox)
2012-12-29 13:35:16 +00:00
self.aboutTextBrowser.setTextInteractionFlags(QtCore.Qt.LinksAccessibleByMouse)
2013-08-31 18:17:38 +00:00
self.aboutTextBrowser.setObjectName('aboutTextBrowser')
self.pluginInfoLayout.addRow(self.aboutLabel, self.aboutTextBrowser)
2010-07-27 11:57:25 +00:00
self.listLayout.addWidget(self.pluginInfoGroupBox)
self.pluginLayout.addLayout(self.listLayout)
2013-08-31 18:17:38 +00:00
self.button_box = create_button_box(pluginViewDialog, 'button_box', ['ok'])
2013-01-27 20:36:18 +00:00
self.pluginLayout.addWidget(self.button_box)
2010-07-27 11:57:25 +00:00
self.retranslateUi(pluginViewDialog)
2009-10-06 21:07:12 +00:00
2010-07-27 11:57:25 +00:00
def retranslateUi(self, pluginViewDialog):
2013-02-01 20:52:42 +00:00
"""
Translate the UI on the fly
"""
2012-12-29 13:35:16 +00:00
pluginViewDialog.setWindowTitle(translate('OpenLP.PluginForm', 'Plugin List'))
self.pluginInfoGroupBox.setTitle(translate('OpenLP.PluginForm', 'Plugin Details'))
2013-08-31 18:17:38 +00:00
self.versionLabel.setText('%s:' % UiStrings().Version)
self.aboutLabel.setText('%s:' % UiStrings().About)
2012-12-29 13:35:16 +00:00
self.statusLabel.setText(translate('OpenLP.PluginForm', 'Status:'))
self.statusComboBox.setItemText(0, translate('OpenLP.PluginForm', 'Active'))
self.statusComboBox.setItemText(1, translate('OpenLP.PluginForm', 'Inactive'))