Slowly making progress.

This commit is contained in:
Raoul Snyman 2013-02-01 22:52:42 +02:00
parent 439fc9b8f0
commit 4bd77075f3
5 changed files with 68 additions and 10 deletions

View File

@ -26,13 +26,16 @@
# with this program; if not, write to the Free Software Foundation, Inc., 59 #
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
###############################################################################
"""
The media manager dock.
"""
import logging
from openlp.core.lib import StringContent
log = logging.getLogger(__name__)
class MediaDockManager(object):
"""
Provide a repository for MediaManagerItems

View File

@ -26,7 +26,9 @@
# with this program; if not, write to the Free Software Foundation, Inc., 59 #
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
###############################################################################
"""
The UI widgets of the plugin view dialog
#"""
from PyQt4 import QtCore, QtGui
from openlp.core.lib import translate, UiStrings
@ -34,7 +36,13 @@ from openlp.core.lib.ui import create_button_box
class Ui_PluginViewDialog(object):
"""
The UI of the plugin view dialog
"""
def setupUi(self, pluginViewDialog):
"""
Set up the UI
"""
pluginViewDialog.setObjectName(u'pluginViewDialog')
pluginViewDialog.setWindowModality(QtCore.Qt.ApplicationModal)
self.pluginLayout = QtGui.QVBoxLayout(pluginViewDialog)
@ -72,6 +80,9 @@ class Ui_PluginViewDialog(object):
self.retranslateUi(pluginViewDialog)
def retranslateUi(self, pluginViewDialog):
"""
Translate the UI on the fly
"""
pluginViewDialog.setWindowTitle(translate('OpenLP.PluginForm', 'Plugin List'))
self.pluginInfoGroupBox.setTitle(translate('OpenLP.PluginForm', 'Plugin Details'))
self.versionLabel.setText(u'%s:' % UiStrings().Version)

View File

@ -26,7 +26,9 @@
# with this program; if not, write to the Free Software Foundation, Inc., 59 #
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
###############################################################################
"""
The actual plugin view form
"""
import logging
from PyQt4 import QtCore, QtGui
@ -36,11 +38,15 @@ from plugindialog import Ui_PluginViewDialog
log = logging.getLogger(__name__)
class PluginForm(QtGui.QDialog, Ui_PluginViewDialog):
"""
The plugin form provides user control over the plugins OpenLP uses.
"""
def __init__(self, parent=None):
"""
Constructor
"""
QtGui.QDialog.__init__(self, parent)
self.activePlugin = None
self.programaticChange = False
@ -85,12 +91,18 @@ class PluginForm(QtGui.QDialog, Ui_PluginViewDialog):
self.pluginListWidget.setFixedWidth(pluginListWidth + self.pluginListWidget.iconSize().width() + 48)
def _clearDetails(self):
"""
Clear the plugin details widgets
"""
self.statusComboBox.setCurrentIndex(-1)
self.versionNumberLabel.setText(u'')
self.aboutTextBrowser.setHtml(u'')
self.statusComboBox.setEnabled(False)
def _setDetails(self):
"""
Set the details of the currently selected plugin
"""
log.debug(u'PluginStatus: %s', str(self.activePlugin.status))
self.versionNumberLabel.setText(self.activePlugin.version)
self.aboutTextBrowser.setHtml(self.activePlugin.about())
@ -103,6 +115,9 @@ class PluginForm(QtGui.QDialog, Ui_PluginViewDialog):
self.programaticChange = False
def onPluginListWidgetSelectionChanged(self):
"""
If the selected plugin changes, update the form
"""
if self.pluginListWidget.currentItem() is None:
self._clearDetails()
return
@ -120,6 +135,9 @@ class PluginForm(QtGui.QDialog, Ui_PluginViewDialog):
self._clearDetails()
def onStatusComboBoxChanged(self, status):
"""
If the status of a plugin is altered, apply the change
"""
if self.programaticChange or status == PluginStatus.Disabled:
return
if status == PluginStatus.Inactive:

View File

@ -26,11 +26,14 @@
# with this program; if not, write to the Free Software Foundation, Inc., 59 #
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
###############################################################################
"""
The UI widgets of the print service dialog.
"""
from PyQt4 import QtCore, QtGui
from openlp.core.lib import build_icon, translate, SpellTextEdit, UiStrings
class ZoomSize(object):
"""
Type enumeration for Combo Box sizes
@ -44,7 +47,13 @@ class ZoomSize(object):
class Ui_PrintServiceDialog(object):
"""
The UI of the print service dialog
"""
def setupUi(self, printServiceDialog):
"""
Set up the UI
"""
printServiceDialog.setObjectName(u'printServiceDialog')
printServiceDialog.resize(664, 594)
self.mainLayout = QtGui.QVBoxLayout(printServiceDialog)
@ -121,9 +130,12 @@ class Ui_PrintServiceDialog(object):
self.optionsLayout.addWidget(self.optionsGroupBox)
self.retranslateUi(printServiceDialog)
QtCore.QObject.connect(self.optionsButton,QtCore.SIGNAL(u'toggled(bool)'), self.toggleOptions)
QtCore.QObject.connect(self.optionsButton, QtCore.SIGNAL(u'toggled(bool)'), self.toggleOptions)
def retranslateUi(self, printServiceDialog):
"""
Translate the UI on the fly
"""
printServiceDialog.setWindowTitle(UiStrings().PrintService)
self.zoomOutButton.setToolTip(translate('OpenLP.PrintServiceForm', 'Zoom Out'))
self.zoomOriginalButton.setToolTip(translate('OpenLP.PrintServiceForm', 'Zoom Original'))
@ -131,7 +143,7 @@ class Ui_PrintServiceDialog(object):
self.optionsButton.setText(translate('OpenLP.PrintServiceForm', 'Options'))
self.titleLabel.setText(translate('OpenLP.PrintServiceForm', 'Title:'))
self.footerLabel.setText(translate('OpenLP.PrintServiceForm', 'Custom Footer Text:'))
self.optionsGroupBox.setTitle(translate('OpenLP.PrintServiceForm','Other Options'))
self.optionsGroupBox.setTitle(translate('OpenLP.PrintServiceForm', 'Other Options'))
self.slideTextCheckBox.setText(translate('OpenLP.PrintServiceForm', 'Include slide text if available'))
self.pageBreakAfterText.setText(translate('OpenLP.PrintServiceForm', 'Add page break before each text item'))
self.notesCheckBox.setText(translate('OpenLP.PrintServiceForm', 'Include service item notes'))
@ -144,6 +156,5 @@ class Ui_PrintServiceDialog(object):
u'100%',
u'75%',
u'50%',
u'25%']
)
u'25%'
])

View File

@ -26,6 +26,9 @@
# with this program; if not, write to the Free Software Foundation, Inc., 59 #
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
###############################################################################
"""
The actual print service dialog
"""
import cgi
import datetime
import os
@ -106,8 +109,11 @@ http://doc.trolltech.com/4.7/richtext-html-subset.html#css-properties
}
"""
class PrintServiceForm(QtGui.QDialog, Ui_PrintServiceDialog):
class PrintServiceForm(QtGui.QDialog, Ui_PrintServiceDialog):
"""
The :class:`~openlp.core.ui.printserviceform.PrintServiceForm` class displays a dialog for printing the service.
"""
def __init__(self):
"""
Constructor
@ -143,6 +149,9 @@ class PrintServiceForm(QtGui.QDialog, Ui_PrintServiceDialog):
self.updatePreviewText()
def toggleOptions(self, checked):
"""
Toggle various options
"""
self.optionsWidget.setVisible(checked)
if checked:
left = self.optionsButton.pos().x()
@ -181,6 +190,9 @@ class PrintServiceForm(QtGui.QDialog, Ui_PrintServiceDialog):
self.previewWidget.updatePreview()
def _addPreviewItem(self, body, item, index):
"""
Add a preview item
"""
div = self._addElement(u'div', classId=u'item', parent=body)
# Add the title of the service item.
item_title = self._addElement(u'h2', parent=div, classId=u'itemTitle')
@ -388,6 +400,9 @@ class PrintServiceForm(QtGui.QDialog, Ui_PrintServiceDialog):
settings.endGroup()
def update_song_usage(self):
"""
Update the song usage
"""
# Only continue when we include the song's text.
if not self.slideTextCheckBox.isChecked():
return