r1456 + resolved conflict

This commit is contained in:
Andreas Preikschat 2011-04-12 23:07:08 +02:00
commit 1968991239
20 changed files with 233 additions and 215 deletions

View File

@ -5,32 +5,6 @@ Frequently Asked Questions
General Questions General Questions
================= =================
What is OpenLP?
---------------
OpenLP stands for "Open source Lyric Projection" and is presentation software
developed for Churches to provide a single easy to use interface for the
projection needs of a typical act of Worship. First created in 2004, it has
steadily grown in features and maturity such that is it now a mainstay in
hundreds of churches around the world.
It can hold a searchable database of song lyrics and Bible verses allowing them
to be projected instantly or saved in a pre-prepared order of service file.
Themes allow song backgrounds to be changed instantly. PowerPoint presentations,
videos and audio files can be run from within the program removing the need to
switch between different programs. Alert messages can be displayed so the
Nursery or Car park stewards can notify the congregation easily. Remote
capability allows the worship leader to change songs, or for alert messages to
be sent from anywhere on the network, even via a phone.
Being free, this software can be installed on as many computers as required,
even on the home computers of worship leaders without additional cost. Compared
to the expensive site licenses or restrictions of commercial software we believe
OpenLP cannot be beaten for value. Still in active development by a growing team
of enthusiastic developers, features are being added all the time, meaning the
software just improves all the time.
When is the release date for OpenLP 2.0? When is the release date for OpenLP 2.0?
---------------------------------------- ----------------------------------------
@ -67,7 +41,7 @@ A variety of places!
it, then perhaps review the software or ask others to review it. it, then perhaps review the software or ask others to review it.
What operating systems will OpenLP 2.0 support? What operating systems will OpenLP 2.0 support?
=============================================== -----------------------------------------------
OpenLP 2.0 is designed to be cross platform. Currently it has been known to run OpenLP 2.0 is designed to be cross platform. Currently it has been known to run
on Windows (XP, Vista, 7), Linux (Ubuntu/Kubuntu, Fedora), FreeBSD & Mac OSX. on Windows (XP, Vista, 7), Linux (Ubuntu/Kubuntu, Fedora), FreeBSD & Mac OSX.
@ -377,7 +351,7 @@ please post a new bug report.
``bugs (at) openlp.org``. ``bugs (at) openlp.org``.
What information should I include in a bug report? What information should I include in a bug report?
================================================== --------------------------------------------------
Since OpenLP 1.9.4, there is a bug report dialog which automatically opens when Since OpenLP 1.9.4, there is a bug report dialog which automatically opens when
OpenLP hits a serious bug. However, this doesn't appear all the time, and in OpenLP hits a serious bug. However, this doesn't appear all the time, and in
@ -595,4 +569,4 @@ First of all check it isn't on the `Feature Requests <http://wiki.openlp.org/Fea
page. If it is, then you need to say no more, it's already been suggested! If it page. If it is, then you need to say no more, it's already been suggested! If it
isn't on the list, then head to the isn't on the list, then head to the
`feature request forum <http://openlp.org/en/forums/openlp_20/feature_requests.html>`_ `feature request forum <http://openlp.org/en/forums/openlp_20/feature_requests.html>`_
and post the idea there. and post the idea there.

View File

@ -8,7 +8,7 @@ About
OpenLP stands for "Open Source Lyrics Projection" and is presentation software OpenLP stands for "Open Source Lyrics Projection" and is presentation software
developed for churches to provide a single easy to use interface for the developed for churches to provide a single easy to use interface for the
projection needs of a typical worship service. First created in 2004, it has projection needs of a typical worship service. First created in 2004, it has
steadily grown in features and maturity such that is it now a mainstay in steadily grown in features and maturity such that it is now a mainstay in
hundreds of churches around the world. hundreds of churches around the world.
OpenLP has searchable databases of songs and Bible verses allowing them to be OpenLP has searchable databases of songs and Bible verses allowing them to be
@ -40,5 +40,4 @@ to charge for the software, and that you have to distribute the source code as
well. well.
You can find a copy of the GNU General Public License from the Help menu You can find a copy of the GNU General Public License from the Help menu
selecting about OpenLP or on-line at: selecting about OpenLP or `view the license on-line <http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt>`_.
`<http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt>`_.

View File

@ -1,3 +1,5 @@
.. _themes:
====== ======
Themes Themes
====== ======

View File

@ -126,7 +126,7 @@ I can not see the book, chapter, and verse when I display scripture
The book, chapter, and verse should be displayed when you display scripture. If The book, chapter, and verse should be displayed when you display scripture. If
you can not see this your theme probably has the text size too small for the you can not see this your theme probably has the text size too small for the
info to be seen. See the section of the manual on themes if you need more info info to be seen. See the section of the manual on :ref:`themes` if you need more info
on text sizes in themes. on text sizes in themes.
I am running Mac OS X and I do not have a presentations plugin I am running Mac OS X and I do not have a presentations plugin
@ -173,4 +173,5 @@ I chose to use a web Bible but it did not download the entire Bible
Due to copyright restrictions OpenLP cannot download an entire Bible. It can Due to copyright restrictions OpenLP cannot download an entire Bible. It can
only download the section you search for. If you do not have an internet only download the section you search for. If you do not have an internet
connection where you intend to use OpenLP you will need another scripture connection where you intend to use OpenLP you will need another scripture
source. For more information about acquiring bibles please see :ref:`bibleimporter`. source. For more information about acquiring Bibles please see :ref:`bibleimporter`.

View File

@ -23,7 +23,7 @@
# with this program; if not, write to the Free Software Foundation, Inc., 59 # # with this program; if not, write to the Free Software Foundation, Inc., 59 #
# Temple Place, Suite 330, Boston, MA 02111-1307 USA # # Temple Place, Suite 330, Boston, MA 02111-1307 USA #
############################################################################### ###############################################################################
import logging
import re import re
try: try:
import enchant import enchant
@ -38,20 +38,24 @@ except ImportError:
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from openlp.core.lib import translate, DisplayTags from openlp.core.lib import translate, DisplayTags
log = logging.getLogger(__name__)
class SpellTextEdit(QtGui.QPlainTextEdit): class SpellTextEdit(QtGui.QPlainTextEdit):
""" """
Spell checking widget based on QPlanTextEdit. Spell checking widget based on QPlanTextEdit.
""" """
def __init__(self, *args): def __init__(self, *args):
global ENCHANT_AVAILABLE
QtGui.QPlainTextEdit.__init__(self, *args) QtGui.QPlainTextEdit.__init__(self, *args)
# Default dictionary based on the current locale. # Default dictionary based on the current locale.
if ENCHANT_AVAILABLE: if ENCHANT_AVAILABLE:
try: try:
self.dictionary = enchant.Dict() self.dictionary = enchant.Dict()
self.highlighter = Highlighter(self.document())
self.highlighter.spellingDictionary = self.dictionary
except DictNotFoundError: except DictNotFoundError:
self.dictionary = enchant.Dict(u'en_US') ENCHANT_AVAILABLE = False
self.highlighter = Highlighter(self.document()) log.debug(u'Could not load default dictionary')
self.highlighter.spellingDictionary = self.dictionary
def mousePressEvent(self, event): def mousePressEvent(self, event):
""" """

View File

@ -50,8 +50,10 @@ class UiStrings(object):
Cancel = translate('OpenLP.Ui', 'Cancel') Cancel = translate('OpenLP.Ui', 'Cancel')
CCLINumberLabel = translate('OpenLP.Ui', 'CCLI number:') CCLINumberLabel = translate('OpenLP.Ui', 'CCLI number:')
CreateService = translate('OpenLP.Ui', 'Create a new service.') CreateService = translate('OpenLP.Ui', 'Create a new service.')
Continuous = translate('OpenLP.Ui', 'Continuous')
Default = unicode(translate('OpenLP.Ui', 'Default')) Default = unicode(translate('OpenLP.Ui', 'Default'))
Delete = translate('OpenLP.Ui', '&Delete') Delete = translate('OpenLP.Ui', '&Delete')
DisplayStyle = translate('OpenLP.Ui', 'Display style:')
Edit = translate('OpenLP.Ui', '&Edit') Edit = translate('OpenLP.Ui', '&Edit')
EmptyField = translate('OpenLP.Ui', 'Empty Field') EmptyField = translate('OpenLP.Ui', 'Empty Field')
Error = translate('OpenLP.Ui', 'Error') Error = translate('OpenLP.Ui', 'Error')
@ -104,6 +106,8 @@ class UiStrings(object):
Themes = translate('OpenLP.Ui', 'Themes', 'Plural') Themes = translate('OpenLP.Ui', 'Themes', 'Plural')
Tools = translate('OpenLP.Ui', 'Tools') Tools = translate('OpenLP.Ui', 'Tools')
Top = translate('OpenLP.Ui', 'Top') Top = translate('OpenLP.Ui', 'Top')
VersePerSlide = translate('OpenLP.Ui', 'Verse Per Slide')
VersePerLine = translate('OpenLP.Ui', 'Verse Per Line')
Version = translate('OpenLP.Ui', 'Version') Version = translate('OpenLP.Ui', 'Version')
View = translate('OpenLP.Ui', 'View') View = translate('OpenLP.Ui', 'View')
ViewMode = translate('OpenLP.Ui', 'View Model') ViewMode = translate('OpenLP.Ui', 'View Model')
@ -407,3 +411,20 @@ def create_valign_combo(form, parent, layout):
form.verticalComboBox.addItem(UiStrings.Bottom) form.verticalComboBox.addItem(UiStrings.Bottom)
verticalLabel.setBuddy(form.verticalComboBox) verticalLabel.setBuddy(form.verticalComboBox)
layout.addRow(verticalLabel, form.verticalComboBox) layout.addRow(verticalLabel, form.verticalComboBox)
def find_and_set_in_combo_box(combo_box, value_to_find):
"""
Find a string in a combo box and set it as the selected item if present
``combo_box``
The combo box to check for selected items
``value_to_find``
The value to find
"""
index = combo_box.findText(value_to_find,
QtCore.Qt.MatchExactly)
if index == -1:
# Not Found.
index = 0
combo_box.setCurrentIndex(index)

View File

@ -35,7 +35,8 @@ from PyQt4 import QtCore, QtGui
from openlp.core.lib import OpenLPToolbar, ServiceItem, Receiver, build_icon, \ from openlp.core.lib import OpenLPToolbar, ServiceItem, Receiver, build_icon, \
ItemCapabilities, SettingsManager, translate ItemCapabilities, SettingsManager, translate
from openlp.core.lib.theme import ThemeLevel from openlp.core.lib.theme import ThemeLevel
from openlp.core.lib.ui import UiStrings, critical_error_message_box, context_menu_action from openlp.core.lib.ui import UiStrings, critical_error_message_box, \
context_menu_action, find_and_set_in_combo_box
from openlp.core.ui import ServiceNoteForm, ServiceItemEditForm, StartTimeForm from openlp.core.ui import ServiceNoteForm, ServiceItemEditForm, StartTimeForm
from openlp.core.ui.printserviceform import PrintServiceForm from openlp.core.ui.printserviceform import PrintServiceForm
from openlp.core.utils import AppLocation, delete_file, file_is_unicode, \ from openlp.core.utils import AppLocation, delete_file, file_is_unicode, \
@ -701,9 +702,9 @@ class ServiceManager(QtGui.QWidget):
Called by the SlideController to request a preview item be made live Called by the SlideController to request a preview item be made live
and allows the next preview to be updated if relevent. and allows the next preview to be updated if relevent.
""" """
id, row = message.split(u':') uuid, row = message.split(u':')
for sitem in self.serviceItems: for sitem in self.serviceItems:
if sitem[u'service_item']._uuid == id: if sitem[u'service_item']._uuid == uuid:
item = self.serviceManagerList.topLevelItem(sitem[u'order'] - 1) item = self.serviceManagerList.topLevelItem(sitem[u'order'] - 1)
self.serviceManagerList.setCurrentItem(item) self.serviceManagerList.setCurrentItem(item)
self.makeLive(int(row)) self.makeLive(int(row))
@ -1031,7 +1032,7 @@ class ServiceManager(QtGui.QWidget):
editId, uuid = message.split(u':') editId, uuid = message.split(u':')
for item in self.serviceItems: for item in self.serviceItems:
if item[u'service_item']._uuid == uuid: if item[u'service_item']._uuid == uuid:
item[u'service_item'].edit_id = editId item[u'service_item'].edit_id = int(editId)
self.setModified(True) self.setModified(True)
def replaceServiceItem(self, newItem): def replaceServiceItem(self, newItem):
@ -1271,13 +1272,7 @@ class ServiceManager(QtGui.QWidget):
action = context_menu_action(self.serviceManagerList, None, theme, action = context_menu_action(self.serviceManagerList, None, theme,
self.onThemeChangeAction, context=QtCore.Qt.WidgetShortcut) self.onThemeChangeAction, context=QtCore.Qt.WidgetShortcut)
self.themeMenu.addAction(action) self.themeMenu.addAction(action)
index = self.themeComboBox.findText(self.service_theme, find_and_set_in_combo_box(self.themeComboBox, self.service_theme)
QtCore.Qt.MatchExactly)
# Not Found
if index == -1:
index = 0
self.service_theme = u''
self.themeComboBox.setCurrentIndex(index)
self.mainwindow.renderManager.set_service_theme(self.service_theme) self.mainwindow.renderManager.set_service_theme(self.service_theme)
self.regenerateServiceItems() self.regenerateServiceItems()

View File

@ -63,26 +63,19 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard):
QtCore.SIGNAL(u'currentIndexChanged(int)'), QtCore.SIGNAL(u'currentIndexChanged(int)'),
self.onGradientComboBoxCurrentIndexChanged) self.onGradientComboBoxCurrentIndexChanged)
QtCore.QObject.connect(self.colorButton, QtCore.QObject.connect(self.colorButton,
QtCore.SIGNAL(u'clicked()'), QtCore.SIGNAL(u'clicked()'), self.onColorButtonClicked)
self.onColorButtonClicked)
QtCore.QObject.connect(self.gradientStartButton, QtCore.QObject.connect(self.gradientStartButton,
QtCore.SIGNAL(u'clicked()'), QtCore.SIGNAL(u'clicked()'), self.onGradientStartButtonClicked)
self.onGradientStartButtonClicked)
QtCore.QObject.connect(self.gradientEndButton, QtCore.QObject.connect(self.gradientEndButton,
QtCore.SIGNAL(u'clicked()'), QtCore.SIGNAL(u'clicked()'), self.onGradientEndButtonClicked)
self.onGradientEndButtonClicked)
QtCore.QObject.connect(self.imageBrowseButton, QtCore.QObject.connect(self.imageBrowseButton,
QtCore.SIGNAL(u'clicked()'), QtCore.SIGNAL(u'clicked()'), self.onImageBrowseButtonClicked)
self.onImageBrowseButtonClicked)
QtCore.QObject.connect(self.mainColorButton, QtCore.QObject.connect(self.mainColorButton,
QtCore.SIGNAL(u'clicked()'), QtCore.SIGNAL(u'clicked()'), self.onMainColorButtonClicked)
self.onMainColorButtonClicked)
QtCore.QObject.connect(self.outlineColorButton, QtCore.QObject.connect(self.outlineColorButton,
QtCore.SIGNAL(u'clicked()'), QtCore.SIGNAL(u'clicked()'), self.onOutlineColorButtonClicked)
self.onOutlineColorButtonClicked)
QtCore.QObject.connect(self.shadowColorButton, QtCore.QObject.connect(self.shadowColorButton,
QtCore.SIGNAL(u'clicked()'), QtCore.SIGNAL(u'clicked()'), self.onShadowColorButtonClicked)
self.onShadowColorButtonClicked)
QtCore.QObject.connect(self.outlineCheckBox, QtCore.QObject.connect(self.outlineCheckBox,
QtCore.SIGNAL(u'stateChanged(int)'), QtCore.SIGNAL(u'stateChanged(int)'),
self.onOutlineCheckCheckBoxStateChanged) self.onOutlineCheckCheckBoxStateChanged)
@ -90,8 +83,7 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard):
QtCore.SIGNAL(u'stateChanged(int)'), QtCore.SIGNAL(u'stateChanged(int)'),
self.onShadowCheckCheckBoxStateChanged) self.onShadowCheckCheckBoxStateChanged)
QtCore.QObject.connect(self.footerColorButton, QtCore.QObject.connect(self.footerColorButton,
QtCore.SIGNAL(u'clicked()'), QtCore.SIGNAL(u'clicked()'), self.onFooterColorButtonClicked)
self.onFooterColorButtonClicked)
QtCore.QObject.connect(self.mainPositionCheckBox, QtCore.QObject.connect(self.mainPositionCheckBox,
QtCore.SIGNAL(u'stateChanged(int)'), QtCore.SIGNAL(u'stateChanged(int)'),
self.onMainPositionCheckBoxStateChanged) self.onMainPositionCheckBoxStateChanged)
@ -99,26 +91,23 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard):
QtCore.SIGNAL(u'stateChanged(int)'), QtCore.SIGNAL(u'stateChanged(int)'),
self.onFooterPositionCheckBoxStateChanged) self.onFooterPositionCheckBoxStateChanged)
QtCore.QObject.connect(self, QtCore.QObject.connect(self,
QtCore.SIGNAL(u'currentIdChanged(int)'), QtCore.SIGNAL(u'currentIdChanged(int)'), self.onCurrentIdChanged)
self.onCurrentIdChanged)
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'theme_line_count'), QtCore.SIGNAL(u'theme_line_count'), self.updateLinesText)
self.updateLinesText)
QtCore.QObject.connect(self.mainSizeSpinBox, QtCore.QObject.connect(self.mainSizeSpinBox,
QtCore.SIGNAL(u'valueChanged(int)'), QtCore.SIGNAL(u'valueChanged(int)'), self.calculateLines)
self.calculateLines)
QtCore.QObject.connect(self.lineSpacingSpinBox, QtCore.QObject.connect(self.lineSpacingSpinBox,
QtCore.SIGNAL(u'valueChanged(int)'), QtCore.SIGNAL(u'valueChanged(int)'), self.calculateLines)
self.calculateLines)
QtCore.QObject.connect(self.outlineSizeSpinBox, QtCore.QObject.connect(self.outlineSizeSpinBox,
QtCore.SIGNAL(u'valueChanged(int)'), QtCore.SIGNAL(u'valueChanged(int)'), self.calculateLines)
self.calculateLines)
QtCore.QObject.connect(self.shadowSizeSpinBox, QtCore.QObject.connect(self.shadowSizeSpinBox,
QtCore.SIGNAL(u'valueChanged(int)'), QtCore.SIGNAL(u'valueChanged(int)'), self.calculateLines)
self.calculateLines)
QtCore.QObject.connect(self.mainFontComboBox, QtCore.QObject.connect(self.mainFontComboBox,
QtCore.SIGNAL(u'activated(int)'), QtCore.SIGNAL(u'activated(int)'), self.calculateLines)
self.calculateLines) QtCore.QObject.connect(self.footerFontComboBox,
QtCore.SIGNAL(u'activated(int)'), self.updateTheme)
QtCore.QObject.connect(self.footerSizeSpinBox,
QtCore.SIGNAL(u'valueChanged(int)'), self.updateTheme)
def setDefaults(self): def setDefaults(self):
""" """
@ -389,7 +378,7 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard):
Handle the display and state of the Footer Area page. Handle the display and state of the Footer Area page.
""" """
self.footerFontComboBox.setCurrentFont( self.footerFontComboBox.setCurrentFont(
QtGui.QFont(self.theme.font_main_name)) QtGui.QFont(self.theme.font_footer_name))
self.footerColorButton.setStyleSheet(u'background-color: %s' % self.footerColorButton.setStyleSheet(u'background-color: %s' %
self.theme.font_footer_color) self.theme.font_footer_color)
self.setField(u'footerSizeSpinBox', self.setField(u'footerSizeSpinBox',

View File

@ -445,6 +445,7 @@ class ThemeManager(QtGui.QWidget):
files = SettingsManager.get_files(self.settingsSection, u'.png') files = SettingsManager.get_files(self.settingsSection, u'.png')
if firstTime: if firstTime:
self.firstTime() self.firstTime()
files = SettingsManager.get_files(self.settingsSection, u'.png')
# No themes have been found so create one # No themes have been found so create one
if len(files) == 0: if len(files) == 0:
theme = ThemeXML() theme = ThemeXML()

View File

@ -28,7 +28,7 @@ from PyQt4 import QtCore, QtGui
from openlp.core.lib import SettingsTab, Receiver, translate from openlp.core.lib import SettingsTab, Receiver, translate
from openlp.core.lib.theme import ThemeLevel from openlp.core.lib.theme import ThemeLevel
from openlp.core.lib.ui import UiStrings from openlp.core.lib.ui import UiStrings, find_and_set_in_combo_box
class ThemesTab(SettingsTab): class ThemesTab(SettingsTab):
""" """
@ -185,12 +185,7 @@ class ThemesTab(SettingsTab):
self.DefaultComboBox.clear() self.DefaultComboBox.clear()
for theme in theme_list: for theme in theme_list:
self.DefaultComboBox.addItem(theme) self.DefaultComboBox.addItem(theme)
id = self.DefaultComboBox.findText( find_and_set_in_combo_box(self.DefaultComboBox, self.global_theme)
self.global_theme, QtCore.Qt.MatchExactly)
if id == -1:
id = 0 # Not Found
self.global_theme = u''
self.DefaultComboBox.setCurrentIndex(id)
self.parent.renderManager.set_global_theme( self.parent.renderManager.set_global_theme(
self.global_theme, self.theme_level) self.global_theme, self.theme_level)
if self.global_theme is not u'': if self.global_theme is not u'':
@ -206,4 +201,4 @@ class ThemesTab(SettingsTab):
if not preview.isNull(): if not preview.isNull():
preview = preview.scaled(300, 255, QtCore.Qt.KeepAspectRatio, preview = preview.scaled(300, 255, QtCore.Qt.KeepAspectRatio,
QtCore.Qt.SmoothTransformation) QtCore.Qt.SmoothTransformation)
self.DefaultListView.setPixmap(preview) self.DefaultListView.setPixmap(preview)

View File

@ -85,8 +85,18 @@ class BibleImportForm(OpenLPWizard):
""" """
OpenLPWizard.setupUi(self, image) OpenLPWizard.setupUi(self, image)
QtCore.QObject.connect(self.formatComboBox, QtCore.QObject.connect(self.formatComboBox,
QtCore.SIGNAL(u'currentIndexChanged(int)'), self.selectStack, QtCore.SIGNAL(u'currentIndexChanged(int)'),
QtCore.SLOT(u'setCurrentIndex(int)')) self.onCurrentIndexChanged)
def onCurrentIndexChanged(self, index):
"""
Called when the format combo box's index changed. We have to check if
the import is available and accordingly to disable or enable the next
button.
"""
self.selectStack.setCurrentIndex(index)
next_button = self.button(QtGui.QWizard.NextButton)
next_button.setEnabled(BibleFormat.get_availability(index))
def customInit(self): def customInit(self):
""" """

View File

@ -30,6 +30,7 @@ from PyQt4 import QtCore, QtGui
from openlp.core.lib import Receiver, SettingsTab, translate from openlp.core.lib import Receiver, SettingsTab, translate
from openlp.plugins.bibles.lib import LayoutStyle, DisplayStyle from openlp.plugins.bibles.lib import LayoutStyle, DisplayStyle
from openlp.core.lib.ui import UiStrings, find_and_set_in_combo_box
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
@ -48,108 +49,107 @@ class BiblesTab(SettingsTab):
def setupUi(self): def setupUi(self):
self.setObjectName(u'BiblesTab') self.setObjectName(u'BiblesTab')
SettingsTab.setupUi(self) SettingsTab.setupUi(self)
self.VerseDisplayGroupBox = QtGui.QGroupBox(self.leftColumn) self.verseDisplayGroupBox = QtGui.QGroupBox(self.leftColumn)
self.VerseDisplayGroupBox.setObjectName(u'VerseDisplayGroupBox') self.verseDisplayGroupBox.setObjectName(u'verseDisplayGroupBox')
self.VerseDisplayLayout = QtGui.QFormLayout(self.VerseDisplayGroupBox) self.verseDisplayLayout = QtGui.QFormLayout(self.verseDisplayGroupBox)
self.VerseDisplayLayout.setObjectName(u'VerseDisplayLayout') self.verseDisplayLayout.setObjectName(u'verseDisplayLayout')
self.NewChaptersCheckBox = QtGui.QCheckBox(self.VerseDisplayGroupBox) self.newChaptersCheckBox = QtGui.QCheckBox(self.verseDisplayGroupBox)
self.NewChaptersCheckBox.setObjectName(u'NewChaptersCheckBox') self.newChaptersCheckBox.setObjectName(u'newChaptersCheckBox')
self.VerseDisplayLayout.addRow(self.NewChaptersCheckBox) self.verseDisplayLayout.addRow(self.newChaptersCheckBox)
self.DisplayStyleLabel = QtGui.QLabel(self.VerseDisplayGroupBox) self.displayStyleLabel = QtGui.QLabel(self.verseDisplayGroupBox)
self.DisplayStyleLabel.setObjectName(u'DisplayStyleLabel') self.displayStyleLabel.setObjectName(u'displayStyleLabel')
self.DisplayStyleComboBox = QtGui.QComboBox(self.VerseDisplayGroupBox) self.displayStyleComboBox = QtGui.QComboBox(self.verseDisplayGroupBox)
self.DisplayStyleComboBox.addItems([u'', u'', u'', u'']) self.displayStyleComboBox.addItems([u'', u'', u'', u''])
self.DisplayStyleComboBox.setObjectName(u'DisplayStyleComboBox') self.displayStyleComboBox.setObjectName(u'displayStyleComboBox')
self.VerseDisplayLayout.addRow(self.DisplayStyleLabel, self.verseDisplayLayout.addRow(self.displayStyleLabel,
self.DisplayStyleComboBox) self.displayStyleComboBox)
self.LayoutStyleLabel = QtGui.QLabel(self.VerseDisplayGroupBox) self.layoutStyleLabel = QtGui.QLabel(self.verseDisplayGroupBox)
self.LayoutStyleLabel.setObjectName(u'LayoutStyleLabel') self.layoutStyleLabel.setObjectName(u'layoutStyleLabel')
self.LayoutStyleComboBox = QtGui.QComboBox(self.VerseDisplayGroupBox) self.layoutStyleComboBox = QtGui.QComboBox(self.verseDisplayGroupBox)
self.LayoutStyleComboBox.setObjectName(u'LayoutStyleComboBox') self.layoutStyleComboBox.setObjectName(u'layoutStyleComboBox')
self.LayoutStyleComboBox.addItems([u'', u'', u'']) self.layoutStyleComboBox.addItems([u'', u'', u''])
self.VerseDisplayLayout.addRow(self.LayoutStyleLabel, self.verseDisplayLayout.addRow(self.layoutStyleLabel,
self.LayoutStyleComboBox) self.layoutStyleComboBox)
self.BibleSecondCheckBox = QtGui.QCheckBox(self.VerseDisplayGroupBox) self.bibleSecondCheckBox = QtGui.QCheckBox(self.verseDisplayGroupBox)
self.BibleSecondCheckBox.setObjectName(u'BibleSecondCheckBox') self.bibleSecondCheckBox.setObjectName(u'bibleSecondCheckBox')
self.VerseDisplayLayout.addRow(self.BibleSecondCheckBox) self.verseDisplayLayout.addRow(self.bibleSecondCheckBox)
self.BibleThemeLabel = QtGui.QLabel(self.VerseDisplayGroupBox) self.bibleThemeLabel = QtGui.QLabel(self.verseDisplayGroupBox)
self.BibleThemeLabel.setObjectName(u'BibleThemeLabel') self.bibleThemeLabel.setObjectName(u'BibleThemeLabel')
self.BibleThemeComboBox = QtGui.QComboBox(self.VerseDisplayGroupBox) self.bibleThemeComboBox = QtGui.QComboBox(self.verseDisplayGroupBox)
self.BibleThemeComboBox.setSizeAdjustPolicy( self.bibleThemeComboBox.setSizeAdjustPolicy(
QtGui.QComboBox.AdjustToMinimumContentsLength) QtGui.QComboBox.AdjustToMinimumContentsLength)
self.BibleThemeComboBox.setSizePolicy( self.bibleThemeComboBox.setSizePolicy(
QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed) QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed)
self.BibleThemeComboBox.addItem(u'') self.bibleThemeComboBox.addItem(u'')
self.BibleThemeComboBox.setObjectName(u'BibleThemeComboBox') self.bibleThemeComboBox.setObjectName(u'BibleThemeComboBox')
self.VerseDisplayLayout.addRow(self.BibleThemeLabel, self.verseDisplayLayout.addRow(self.bibleThemeLabel,
self.BibleThemeComboBox) self.bibleThemeComboBox)
self.ChangeNoteLabel = QtGui.QLabel(self.VerseDisplayGroupBox) self.changeNoteLabel = QtGui.QLabel(self.verseDisplayGroupBox)
self.ChangeNoteLabel.setWordWrap(True) self.changeNoteLabel.setWordWrap(True)
self.ChangeNoteLabel.setObjectName(u'ChangeNoteLabel') self.changeNoteLabel.setObjectName(u'changeNoteLabel')
self.VerseDisplayLayout.addRow(self.ChangeNoteLabel) self.verseDisplayLayout.addRow(self.changeNoteLabel)
self.leftLayout.addWidget(self.VerseDisplayGroupBox) self.leftLayout.addWidget(self.verseDisplayGroupBox)
self.leftLayout.addStretch() self.leftLayout.addStretch()
self.rightColumn.setSizePolicy( self.rightColumn.setSizePolicy(
QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Preferred) QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Preferred)
self.rightLayout.addStretch() self.rightLayout.addStretch()
# Signals and slots # Signals and slots
QtCore.QObject.connect( QtCore.QObject.connect(
self.NewChaptersCheckBox, QtCore.SIGNAL(u'stateChanged(int)'), self.newChaptersCheckBox, QtCore.SIGNAL(u'stateChanged(int)'),
self.onNewChaptersCheckBoxChanged) self.onNewChaptersCheckBoxChanged)
QtCore.QObject.connect( QtCore.QObject.connect(
self.DisplayStyleComboBox, QtCore.SIGNAL(u'activated(int)'), self.displayStyleComboBox, QtCore.SIGNAL(u'activated(int)'),
self.onDisplayStyleComboBoxChanged) self.onDisplayStyleComboBoxChanged)
QtCore.QObject.connect( QtCore.QObject.connect(
self.BibleThemeComboBox, QtCore.SIGNAL(u'activated(int)'), self.bibleThemeComboBox, QtCore.SIGNAL(u'activated(int)'),
self.onBibleThemeComboBoxChanged) self.onBibleThemeComboBoxChanged)
QtCore.QObject.connect( QtCore.QObject.connect(
self.LayoutStyleComboBox, QtCore.SIGNAL(u'activated(int)'), self.layoutStyleComboBox, QtCore.SIGNAL(u'activated(int)'),
self.onLayoutStyleComboBoxChanged) self.onLayoutStyleComboBoxChanged)
QtCore.QObject.connect( QtCore.QObject.connect(
self.BibleSecondCheckBox, QtCore.SIGNAL(u'stateChanged(int)'), self.bibleSecondCheckBox, QtCore.SIGNAL(u'stateChanged(int)'),
self.onBibleSecondCheckBox) self.onBibleSecondCheckBox)
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'theme_update_list'), self.updateThemeList) QtCore.SIGNAL(u'theme_update_list'), self.updateThemeList)
def retranslateUi(self): def retranslateUi(self):
self.VerseDisplayGroupBox.setTitle( self.verseDisplayGroupBox.setTitle(
translate('BiblesPlugin.BiblesTab', 'Verse Display')) translate('BiblesPlugin.BiblesTab', 'Verse Display'))
self.NewChaptersCheckBox.setText( self.newChaptersCheckBox.setText(
translate('BiblesPlugin.BiblesTab', translate('BiblesPlugin.BiblesTab',
'Only show new chapter numbers')) 'Only show new chapter numbers'))
self.LayoutStyleLabel.setText( self.layoutStyleLabel.setText(
translate('BiblesPlugin.BiblesTab', 'Layout style:')) translate('BiblesPlugin.BiblesTab', 'Layout style:'))
self.DisplayStyleLabel.setText( self.displayStyleLabel.setText(UiStrings.DisplayStyle)
translate('BiblesPlugin.BiblesTab', 'Display style:')) self.bibleThemeLabel.setText(
self.BibleThemeLabel.setText(
translate('BiblesPlugin.BiblesTab', 'Bible theme:')) translate('BiblesPlugin.BiblesTab', 'Bible theme:'))
self.LayoutStyleComboBox.setItemText(LayoutStyle.VersePerSlide, self.layoutStyleComboBox.setItemText(LayoutStyle.VersePerSlide,
translate('BiblesPlugin.BiblesTab', 'Verse Per Slide')) UiStrings.VersePerSlide)
self.LayoutStyleComboBox.setItemText(LayoutStyle.VersePerLine, self.layoutStyleComboBox.setItemText(LayoutStyle.VersePerLine,
translate('BiblesPlugin.BiblesTab', 'Verse Per Line')) UiStrings.VersePerLine)
self.LayoutStyleComboBox.setItemText(LayoutStyle.Continuous, self.layoutStyleComboBox.setItemText(LayoutStyle.Continuous,
translate('BiblesPlugin.BiblesTab', 'Continuous')) UiStrings.Continuous)
self.DisplayStyleComboBox.setItemText(DisplayStyle.NoBrackets, self.displayStyleComboBox.setItemText(DisplayStyle.NoBrackets,
translate('BiblesPlugin.BiblesTab', 'No Brackets')) translate('BiblesPlugin.BiblesTab', 'No Brackets'))
self.DisplayStyleComboBox.setItemText(DisplayStyle.Round, self.displayStyleComboBox.setItemText(DisplayStyle.Round,
translate('BiblesPlugin.BiblesTab', '( And )')) translate('BiblesPlugin.BiblesTab', '( And )'))
self.DisplayStyleComboBox.setItemText(DisplayStyle.Curly, self.displayStyleComboBox.setItemText(DisplayStyle.Curly,
translate('BiblesPlugin.BiblesTab', '{ And }')) translate('BiblesPlugin.BiblesTab', '{ And }'))
self.DisplayStyleComboBox.setItemText(DisplayStyle.Square, self.displayStyleComboBox.setItemText(DisplayStyle.Square,
translate('BiblesPlugin.BiblesTab', '[ And ]')) translate('BiblesPlugin.BiblesTab', '[ And ]'))
self.ChangeNoteLabel.setText(translate('BiblesPlugin.BiblesTab', self.changeNoteLabel.setText(translate('BiblesPlugin.BiblesTab',
'Note:\nChanges do not affect verses already in the service.')) 'Note:\nChanges do not affect verses already in the service.'))
self.BibleSecondCheckBox.setText( self.bibleSecondCheckBox.setText(
translate('BiblesPlugin.BiblesTab', 'Display second Bible verses')) translate('BiblesPlugin.BiblesTab', 'Display second Bible verses'))
def onBibleThemeComboBoxChanged(self): def onBibleThemeComboBoxChanged(self):
self.bible_theme = self.BibleThemeComboBox.currentText() self.bible_theme = self.bibleThemeComboBox.currentText()
def onDisplayStyleComboBoxChanged(self): def onDisplayStyleComboBoxChanged(self):
self.display_style = self.DisplayStyleComboBox.currentIndex() self.display_style = self.displayStyleComboBox.currentIndex()
def onLayoutStyleComboBoxChanged(self): def onLayoutStyleComboBoxChanged(self):
self.layout_style = self.LayoutStyleComboBox.currentIndex() self.layout_style = self.layoutStyleComboBox.currentIndex()
def onNewChaptersCheckBoxChanged(self, check_state): def onNewChaptersCheckBoxChanged(self, check_state):
self.show_new_chapters = False self.show_new_chapters = False
@ -176,10 +176,10 @@ class BiblesTab(SettingsTab):
settings.value(u'bible theme', QtCore.QVariant(u'')).toString()) settings.value(u'bible theme', QtCore.QVariant(u'')).toString())
self.second_bibles = settings.value( self.second_bibles = settings.value(
u'second bibles', QtCore.QVariant(True)).toBool() u'second bibles', QtCore.QVariant(True)).toBool()
self.NewChaptersCheckBox.setChecked(self.show_new_chapters) self.newChaptersCheckBox.setChecked(self.show_new_chapters)
self.DisplayStyleComboBox.setCurrentIndex(self.display_style) self.displayStyleComboBox.setCurrentIndex(self.display_style)
self.LayoutStyleComboBox.setCurrentIndex(self.layout_style) self.layoutStyleComboBox.setCurrentIndex(self.layout_style)
self.BibleSecondCheckBox.setChecked(self.second_bibles) self.bibleSecondCheckBox.setChecked(self.second_bibles)
settings.endGroup() settings.endGroup()
def save(self): def save(self):
@ -204,14 +204,8 @@ class BiblesTab(SettingsTab):
[u'Bible Theme', u'Song Theme'] [u'Bible Theme', u'Song Theme']
""" """
self.BibleThemeComboBox.clear() self.bibleThemeComboBox.clear()
self.BibleThemeComboBox.addItem(u'') self.bibleThemeComboBox.addItem(u'')
for theme in theme_list: for theme in theme_list:
self.BibleThemeComboBox.addItem(theme) self.bibleThemeComboBox.addItem(theme)
index = self.BibleThemeComboBox.findText( find_and_set_in_combo_box(self.bibleThemeComboBox, self.bible_theme)
unicode(self.bible_theme), QtCore.Qt.MatchExactly)
if index == -1:
# Not Found.
index = 0
self.bible_theme = u''
self.BibleThemeComboBox.setCurrentIndex(index)

View File

@ -32,7 +32,7 @@ from openlp.core.lib import MediaManagerItem, Receiver, ItemCapabilities, \
translate translate
from openlp.core.lib.searchedit import SearchEdit from openlp.core.lib.searchedit import SearchEdit
from openlp.core.lib.ui import UiStrings, add_widget_completer, \ from openlp.core.lib.ui import UiStrings, add_widget_completer, \
media_item_combo_box, critical_error_message_box media_item_combo_box, critical_error_message_box, find_and_set_in_combo_box
from openlp.plugins.bibles.forms import BibleImportForm from openlp.plugins.bibles.forms import BibleImportForm
from openlp.plugins.bibles.lib import LayoutStyle, DisplayStyle, \ from openlp.plugins.bibles.lib import LayoutStyle, DisplayStyle, \
VerseReferenceList, get_reference_match VerseReferenceList, get_reference_match
@ -106,6 +106,12 @@ class BibleMediaItem(MediaManagerItem):
translate('BiblesPlugin.MediaItem', 'Text Search')) translate('BiblesPlugin.MediaItem', 'Text Search'))
]) ])
self.quickLayout.addRow(self.quickSearchLabel, self.quickSearchEdit) self.quickLayout.addRow(self.quickSearchLabel, self.quickSearchEdit)
self.quickLayoutLabel = QtGui.QLabel(self.quickTab)
self.quickLayoutLabel.setObjectName(u'quickClearLabel')
self.quickLayoutComboBox = media_item_combo_box(self.quickTab,
u'quickLayoutComboBox')
self.quickLayoutComboBox.addItems([u'', u'', u''])
self.quickLayout.addRow(self.quickLayoutLabel, self.quickLayoutComboBox)
self.quickClearLabel = QtGui.QLabel(self.quickTab) self.quickClearLabel = QtGui.QLabel(self.quickTab)
self.quickClearLabel.setObjectName(u'quickClearLabel') self.quickClearLabel.setObjectName(u'quickClearLabel')
self.quickClearComboBox = media_item_combo_box(self.quickTab, self.quickClearComboBox = media_item_combo_box(self.quickTab,
@ -210,6 +216,9 @@ class BibleMediaItem(MediaManagerItem):
QtCore.SIGNAL(u'searchTypeChanged(int)'), self.updateAutoCompleter) QtCore.SIGNAL(u'searchTypeChanged(int)'), self.updateAutoCompleter)
QtCore.QObject.connect(self.quickVersionComboBox, QtCore.QObject.connect(self.quickVersionComboBox,
QtCore.SIGNAL(u'activated(int)'), self.updateAutoCompleter) QtCore.SIGNAL(u'activated(int)'), self.updateAutoCompleter)
QtCore.QObject.connect(
self.quickLayoutComboBox, QtCore.SIGNAL(u'activated(int)'),
self.onlayoutStyleComboBoxChanged)
# Buttons # Buttons
QtCore.QObject.connect(self.advancedSearchButton, QtCore.QObject.connect(self.advancedSearchButton,
QtCore.SIGNAL(u'pressed()'), self.onAdvancedSearchButton) QtCore.SIGNAL(u'pressed()'), self.onAdvancedSearchButton)
@ -234,6 +243,7 @@ class BibleMediaItem(MediaManagerItem):
self.advancedSecondComboBox.setVisible(False) self.advancedSecondComboBox.setVisible(False)
self.quickSecondLabel.setVisible(False) self.quickSecondLabel.setVisible(False)
self.quickSecondComboBox.setVisible(False) self.quickSecondComboBox.setVisible(False)
self.quickLayoutComboBox.setCurrentIndex(self.settings.layout_style)
def retranslateUi(self): def retranslateUi(self):
log.debug(u'retranslateUi') log.debug(u'retranslateUi')
@ -269,12 +279,19 @@ class BibleMediaItem(MediaManagerItem):
translate('BiblesPlugin.MediaItem', 'Clear')) translate('BiblesPlugin.MediaItem', 'Clear'))
self.advancedClearComboBox.addItem( self.advancedClearComboBox.addItem(
translate('BiblesPlugin.MediaItem', 'Keep')) translate('BiblesPlugin.MediaItem', 'Keep'))
self.quickLayoutLabel.setText(UiStrings.DisplayStyle)
self.quickLayoutComboBox.setItemText(LayoutStyle.VersePerSlide,
UiStrings.VersePerSlide)
self.quickLayoutComboBox.setItemText(LayoutStyle.VersePerLine,
UiStrings.VersePerLine)
self.quickLayoutComboBox.setItemText(LayoutStyle.Continuous,
UiStrings.Continuous)
def initialise(self): def initialise(self):
log.debug(u'bible manager initialise') log.debug(u'bible manager initialise')
self.parent.manager.media = self self.parent.manager.media = self
self.loadBibles() self.loadBibles()
self.updateAutoCompleter() self.updateAutoCompleter(False)
self.configUpdated() self.configUpdated()
log.debug(u'bible manager initialise complete') log.debug(u'bible manager initialise complete')
@ -298,23 +315,26 @@ class BibleMediaItem(MediaManagerItem):
bibles = self.parent.manager.get_bibles().keys() bibles = self.parent.manager.get_bibles().keys()
bibles.sort() bibles.sort()
# Load the bibles into the combo boxes. # Load the bibles into the combo boxes.
first = True
for bible in bibles: for bible in bibles:
if bible: if bible:
self.quickVersionComboBox.addItem(bible) self.quickVersionComboBox.addItem(bible)
self.quickSecondComboBox.addItem(bible) self.quickSecondComboBox.addItem(bible)
self.advancedVersionComboBox.addItem(bible) self.advancedVersionComboBox.addItem(bible)
self.advancedSecondComboBox.addItem(bible) self.advancedSecondComboBox.addItem(bible)
if first: # set the default value
first = False bible = QtCore.QSettings().value(
self.initialiseBible(bible) self.settingsSection + u'/advanced bible',
QtCore.QVariant(u'')).toString()
if bible in bibles:
find_and_set_in_combo_box(self.advancedVersionComboBox, bible)
self.initialiseAdvancedBible(unicode(bible))
def reloadBibles(self): def reloadBibles(self):
log.debug(u'Reloading Bibles') log.debug(u'Reloading Bibles')
self.parent.manager.reload_bibles() self.parent.manager.reload_bibles()
self.loadBibles() self.loadBibles()
def initialiseBible(self, bible): def initialiseAdvancedBible(self, bible):
""" """
This initialises the given bible, which means that its book names and This initialises the given bible, which means that its book names and
their chapter numbers is added to the combo boxes on the their chapter numbers is added to the combo boxes on the
@ -324,7 +344,7 @@ class BibleMediaItem(MediaManagerItem):
``bible`` ``bible``
The bible to initialise (unicode). The bible to initialise (unicode).
""" """
log.debug(u'initialiseBible %s', bible) log.debug(u'initialiseAdvancedBible %s', bible)
book_data = self.parent.manager.get_books(bible) book_data = self.parent.manager.get_books(bible)
self.advancedBookComboBox.clear() self.advancedBookComboBox.clear()
first = True first = True
@ -354,12 +374,20 @@ class BibleMediaItem(MediaManagerItem):
self.adjustComboBox(1, verse_count, self.advancedFromVerse) self.adjustComboBox(1, verse_count, self.advancedFromVerse)
self.adjustComboBox(1, verse_count, self.advancedToVerse) self.adjustComboBox(1, verse_count, self.advancedToVerse)
def updateAutoCompleter(self): def updateAutoCompleter(self, updateConfig=True):
""" """
This updates the bible book completion list for the search field. The This updates the bible book completion list for the search field. The
completion depends on the bible. It is only updated when we are doing a completion depends on the bible. It is only updated when we are doing a
reference search, otherwise the auto completion list is removed. reference search, otherwise the auto completion list is removed.
""" """
if updateConfig:
QtCore.QSettings().setValue(self.settingsSection + u'/quick bible',
QtCore.QVariant(self.quickVersionComboBox.currentText()))
else:
book = QtCore.QSettings().value(
self.settingsSection + u'/quick bible',
QtCore.QVariant(u'')).toString()
find_and_set_in_combo_box(self.quickVersionComboBox, book)
books = [] books = []
# We have to do a 'Reference Search'. # We have to do a 'Reference Search'.
if self.quickSearchEdit.currentSearchType() == BibleSearch.Reference: if self.quickSearchEdit.currentSearchType() == BibleSearch.Reference:
@ -372,7 +400,9 @@ class BibleMediaItem(MediaManagerItem):
add_widget_completer(books, self.quickSearchEdit) add_widget_completer(books, self.quickSearchEdit)
def onAdvancedVersionComboBox(self): def onAdvancedVersionComboBox(self):
self.initialiseBible( QtCore.QSettings().setValue(self.settingsSection + u'/advanced bible',
QtCore.QVariant(self.advancedVersionComboBox.currentText()))
self.initialiseAdvancedBible(
unicode(self.advancedVersionComboBox.currentText())) unicode(self.advancedVersionComboBox.currentText()))
def onAdvancedBookComboBox(self): def onAdvancedBookComboBox(self):
@ -804,3 +834,11 @@ class BibleMediaItem(MediaManagerItem):
if self.settings.display_style == DisplayStyle.Square: if self.settings.display_style == DisplayStyle.Square:
return u'{su}[%s]{/su}' % verse_text return u'{su}[%s]{/su}' % verse_text
return u'{su}%s{/su}' % verse_text return u'{su}%s{/su}' % verse_text
def onlayoutStyleComboBoxChanged(self):
self.settings.layout_style = self.quickLayoutComboBox.currentIndex()
self.settings.layoutStyleComboBox.setCurrentIndex(
self.settings.layout_style)
QtCore.QSettings().setValue(
self.settingsSection + u'/verse layout style',
QtCore.QVariant(self.settings.layout_style))

View File

@ -96,4 +96,7 @@ class VerseReferenceList(object):
version[u'copyright']) version[u'copyright'])
if version[u'permission'].strip(): if version[u'permission'].strip():
result = result + u', ' + version[u'permission'] result = result + u', ' + version[u'permission']
result = result.rstrip()
if result.endswith(u','):
return result[:len(result)-1]
return result return result

View File

@ -29,7 +29,7 @@ import logging
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from openlp.core.lib import Receiver, translate from openlp.core.lib import Receiver, translate
from openlp.core.lib.ui import critical_error_message_box from openlp.core.lib.ui import critical_error_message_box, find_and_set_in_combo_box
from openlp.plugins.custom.lib import CustomXMLBuilder, CustomXMLParser from openlp.plugins.custom.lib import CustomXMLBuilder, CustomXMLParser
from openlp.plugins.custom.lib.db import CustomSlide from openlp.plugins.custom.lib.db import CustomSlide
from editcustomdialog import Ui_CustomEditDialog from editcustomdialog import Ui_CustomEditDialog
@ -98,11 +98,7 @@ class EditCustomForm(QtGui.QDialog, Ui_CustomEditDialog):
for slide in slideList: for slide in slideList:
self.slideListView.addItem(slide[1]) self.slideListView.addItem(slide[1])
theme = self.customSlide.theme_name theme = self.customSlide.theme_name
id = self.themeComboBox.findText(theme, QtCore.Qt.MatchExactly) find_and_set_in_combo_box(self.themeComboBox, theme)
# No theme match
if id == -1:
id = 0
self.themeComboBox.setCurrentIndex(id)
# If not preview hide the preview button. # If not preview hide the preview button.
self.previewButton.setVisible(False) self.previewButton.setVisible(False)
if preview: if preview:
@ -265,4 +261,4 @@ class EditCustomForm(QtGui.QDialog, Ui_CustomEditDialog):
message=translate('CustomPlugin.EditCustomForm', message=translate('CustomPlugin.EditCustomForm',
'You need to add at least one slide')) 'You need to add at least one slide'))
return False return False
return True return True

View File

@ -105,7 +105,7 @@ class PresentationDocument(object):
Loads the presentation and starts it Loads the presentation and starts it
``presentation`` ``presentation``
The file name of the presentations to the run. The file name of the presentations to the run.
Returns False if the file could not be opened Returns False if the file could not be opened
""" """

View File

@ -31,7 +31,7 @@ from PyQt4 import QtCore, QtGui
from openlp.core.lib import Receiver, translate from openlp.core.lib import Receiver, translate
from openlp.core.lib.ui import UiStrings, add_widget_completer, \ from openlp.core.lib.ui import UiStrings, add_widget_completer, \
critical_error_message_box critical_error_message_box, find_and_set_in_combo_box
from openlp.plugins.songs.forms import EditVerseForm from openlp.plugins.songs.forms import EditVerseForm
from openlp.plugins.songs.lib import SongXML, VerseType, clean_song from openlp.plugins.songs.lib import SongXML, VerseType, clean_song
from openlp.plugins.songs.lib.db import Book, Song, Author, Topic from openlp.plugins.songs.lib.db import Book, Song, Author, Topic
@ -208,20 +208,9 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
self.alternativeEdit.setText(u'') self.alternativeEdit.setText(u'')
if self.song.song_book_id != 0: if self.song.song_book_id != 0:
book_name = self.manager.get_object(Book, self.song.song_book_id) book_name = self.manager.get_object(Book, self.song.song_book_id)
id = self.songBookComboBox.findText( find_and_set_in_combo_box(self.songBookComboBox, unicode(book_name.name))
unicode(book_name.name), QtCore.Qt.MatchExactly)
if id == -1:
# Not Found
id = 0
self.songBookComboBox.setCurrentIndex(id)
if self.song.theme_name: if self.song.theme_name:
id = self.themeComboBox.findText( find_and_set_in_combo_box(self.themeComboBox, unicode(self.song.theme_name))
unicode(self.song.theme_name), QtCore.Qt.MatchExactly)
if id == -1:
# Not Found
id = 0
self.song.theme_name = None
self.themeComboBox.setCurrentIndex(id)
if self.song.copyright: if self.song.copyright:
self.copyrightEdit.setText(self.song.copyright) self.copyrightEdit.setText(self.song.copyright)
else: else:
@ -790,4 +779,4 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
self.song.verse_order) self.song.verse_order)
except: except:
log.exception(u'Problem processing song Lyrics \n%s', log.exception(u'Problem processing song Lyrics \n%s',
sxml.dump_xml()) sxml.dump_xml())

View File

@ -66,7 +66,17 @@ class SongImportForm(OpenLPWizard):
self.formatStack.setCurrentIndex(0) self.formatStack.setCurrentIndex(0)
QtCore.QObject.connect(self.formatComboBox, QtCore.QObject.connect(self.formatComboBox,
QtCore.SIGNAL(u'currentIndexChanged(int)'), QtCore.SIGNAL(u'currentIndexChanged(int)'),
self.formatStack.setCurrentIndex) self.onCurrentIndexChanged)
def onCurrentIndexChanged(self, index):
"""
Called when the format combo box's index changed. We have to check if
the import is available and accordingly to disable or enable the next
button.
"""
self.formatStack.setCurrentIndex(index)
next_button = self.button(QtGui.QWizard.NextButton)
next_button.setEnabled(SongFormat.get_availability(index))
def customInit(self): def customInit(self):
""" """

View File

@ -283,19 +283,20 @@ class SongMediaItem(MediaManagerItem):
self.remoteTriggered = None self.remoteTriggered = None
self.remoteSong = -1 self.remoteSong = -1
def onRemoteEdit(self, songid): def onRemoteEdit(self, message):
""" """
Called by ServiceManager or SlideController by event passing Called by ServiceManager or SlideController by event passing
the Song Id in the payload along with an indicator to say which the Song Id in the payload along with an indicator to say which
type of display is required. type of display is required.
""" """
log.debug(u'onRemoteEdit %s' % songid) log.debug(u'onRemoteEdit %s' % message)
fields = songid.split(u':') remote_type, song_id = message.split(u':')
valid = self.parent.manager.get_object(Song, fields[1]) song_id = int(song_id)
valid = self.parent.manager.get_object(Song, song_id)
if valid: if valid:
self.remoteSong = fields[1] self.remoteSong = song_id
self.remoteTriggered = fields[0] self.remoteTriggered = remote_type
self.edit_song_form.loadSong(fields[1], (fields[0] == u'P')) self.edit_song_form.loadSong(song_id, (remote_type == u'P'))
self.edit_song_form.exec_() self.edit_song_form.exec_()
def onEditClick(self): def onEditClick(self):

View File

@ -39,12 +39,8 @@ if os.name == u'nt':
PAGE_AFTER = 5 PAGE_AFTER = 5
PAGE_BOTH = 6 PAGE_BOTH = 6
else: else:
try: import uno
import uno from com.sun.star.style.BreakType import PAGE_BEFORE, PAGE_AFTER, PAGE_BOTH
from com.sun.star.style.BreakType import PAGE_BEFORE, PAGE_AFTER, \
PAGE_BOTH
except ImportError:
pass
class OooImport(SongImport): class OooImport(SongImport):
""" """