forked from openlp/openlp
ThemeWizard: Show theme name in title and hide themeNameEdit if wizard is in editing mode.
ThemeWizard: Changed transitionsComboBox to align with the FormLayout. (change some log.debug() arguments to avoid UnicodeError exceptions)
This commit is contained in:
parent
1a31bf2047
commit
557a66db9d
@ -445,7 +445,7 @@ class MediaManagerItem(QtGui.QWidget):
|
||||
translate('OpenLP.MediaManagerItem',
|
||||
'You must select one or more items to preview.'))
|
||||
else:
|
||||
log.debug(self.plugin.name + u' Preview requested')
|
||||
log.debug(u'%s Preview requested', self.plugin.name)
|
||||
serviceItem = self.buildServiceItem()
|
||||
if serviceItem:
|
||||
serviceItem.from_plugin = True
|
||||
@ -462,7 +462,7 @@ class MediaManagerItem(QtGui.QWidget):
|
||||
translate('OpenLP.MediaManagerItem',
|
||||
'You must select one or more items to send live.'))
|
||||
else:
|
||||
log.debug(self.plugin.name + u' Live requested')
|
||||
log.debug(u'%s Live requested', self.plugin.name)
|
||||
serviceItem = self.buildServiceItem()
|
||||
if serviceItem:
|
||||
serviceItem.from_plugin = True
|
||||
@ -481,7 +481,7 @@ class MediaManagerItem(QtGui.QWidget):
|
||||
# Is it posssible to process multiple list items to generate
|
||||
# multiple service items?
|
||||
if self.singleServiceItem or self.remoteTriggered:
|
||||
log.debug(self.plugin.name + u' Add requested')
|
||||
log.debug(u'%s Add requested', self.plugin.name)
|
||||
serviceItem = self.buildServiceItem(None, True)
|
||||
if serviceItem:
|
||||
serviceItem.from_plugin = False
|
||||
@ -505,7 +505,7 @@ class MediaManagerItem(QtGui.QWidget):
|
||||
translate('OpenLP.MediaManagerItem',
|
||||
'You must select one or more items'))
|
||||
else:
|
||||
log.debug(self.plugin.name + u' Add requested')
|
||||
log.debug(u'%s Add requested', self.plugin.name)
|
||||
serviceItem = self.parent.serviceManager.getServiceItem()
|
||||
if not serviceItem:
|
||||
QtGui.QMessageBox.information(self,
|
||||
@ -544,4 +544,4 @@ class MediaManagerItem(QtGui.QWidget):
|
||||
Method to add processing when a service has been loaded and
|
||||
individual service items need to be processed by the plugins
|
||||
"""
|
||||
pass
|
||||
pass
|
||||
|
@ -92,7 +92,7 @@ class PluginForm(QtGui.QDialog, Ui_PluginViewDialog):
|
||||
self.statusComboBox.setEnabled(False)
|
||||
|
||||
def _setDetails(self):
|
||||
log.debug('PluginStatus: %s', str(self.activePlugin.status))
|
||||
log.debug(u'PluginStatus: %s', str(self.activePlugin.status))
|
||||
self.versionNumberLabel.setText(self.activePlugin.version)
|
||||
self.aboutTextBrowser.setHtml(self.activePlugin.about())
|
||||
self.programaticChange = True
|
||||
@ -142,4 +142,4 @@ class PluginForm(QtGui.QDialog, Ui_PluginViewDialog):
|
||||
translate('OpenLP.PluginForm', '%s (Disabled)'))
|
||||
name_string = self.activePlugin.getString(StringContent.Name)
|
||||
self.pluginListWidget.currentItem().setText(
|
||||
status_text % name_string[u'singular'])
|
||||
status_text % name_string[u'singular'])
|
||||
|
@ -127,12 +127,12 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard):
|
||||
"""
|
||||
self.restart()
|
||||
self.accepted = False
|
||||
self.setBackgroundTabValues()
|
||||
self.setMainAreaTabValues()
|
||||
self.setFooterAreaTabValues()
|
||||
self.setAlignmentTabValues()
|
||||
self.setPositionTabValues()
|
||||
self.setPreviewTabValues()
|
||||
self.setBackgroundPageValues()
|
||||
self.setMainAreaPageValues()
|
||||
self.setFooterAreaPageValues()
|
||||
self.setAlignmentPageValues()
|
||||
self.setPositionPageValues()
|
||||
self.setPreviewPageValues()
|
||||
|
||||
def registerFields(self):
|
||||
"""
|
||||
@ -268,8 +268,15 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard):
|
||||
self.updateThemeAllowed = False
|
||||
self.setDefaults()
|
||||
self.updateThemeAllowed = True
|
||||
self.themeNameLabel.setVisible(not edit)
|
||||
self.themeNameEdit.setVisible(not edit)
|
||||
if edit:
|
||||
self.setWindowTitle(unicode(translate('OpenLP.ThemeWizard',
|
||||
'Edit Theme %s - OpenLP')) % self.theme.theme_name)
|
||||
self.next()
|
||||
else:
|
||||
self.setWindowTitle(translate('OpenLP.ThemeWizard',
|
||||
'New Theme - OpenLP'))
|
||||
return QtGui.QWizard.exec_(self)
|
||||
|
||||
def initializePage(self, id):
|
||||
@ -279,19 +286,19 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard):
|
||||
log.debug(u'initializePage %s' % id)
|
||||
wizardPage = self.page(id)
|
||||
if wizardPage == self.backgroundPage:
|
||||
self.setBackgroundTabValues()
|
||||
self.setBackgroundPageValues()
|
||||
elif wizardPage == self.mainAreaPage:
|
||||
self.setMainAreaTabValues()
|
||||
self.setMainAreaPageValues()
|
||||
elif wizardPage == self.footerAreaPage:
|
||||
self.setFooterAreaTabValues()
|
||||
self.setFooterAreaPageValues()
|
||||
elif wizardPage == self.alignmentPage:
|
||||
self.setAlignmentTabValues()
|
||||
self.setAlignmentPageValues()
|
||||
elif wizardPage == self.areaPositionPage:
|
||||
self.setPositionTabValues()
|
||||
self.setPositionPageValues()
|
||||
|
||||
def setBackgroundTabValues(self):
|
||||
def setBackgroundPageValues(self):
|
||||
"""
|
||||
Handle the display and State of the background display tab.
|
||||
Handle the display and state of the Background page.
|
||||
"""
|
||||
if self.theme.background_type == \
|
||||
BackgroundType.to_string(BackgroundType.Solid):
|
||||
@ -323,9 +330,9 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard):
|
||||
else:
|
||||
self.setField(u'gradient', QtCore.QVariant(4))
|
||||
|
||||
def setMainAreaTabValues(self):
|
||||
def setMainAreaPageValues(self):
|
||||
"""
|
||||
Handle the display and State of the Main Area tab.
|
||||
Handle the display and state of the Main Area page.
|
||||
"""
|
||||
self.mainFontComboBox.setCurrentFont(
|
||||
QtGui.QFont(self.theme.font_main_name))
|
||||
@ -352,9 +359,9 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard):
|
||||
self.setField(u'mainItalicsCheckBox',
|
||||
QtCore.QVariant(self.theme.font_main_italics))
|
||||
|
||||
def setFooterAreaTabValues(self):
|
||||
def setFooterAreaPageValues(self):
|
||||
"""
|
||||
Handle the display and State of the Footer Area tab.
|
||||
Handle the display and state of the Footer Area page.
|
||||
"""
|
||||
self.footerFontComboBox.setCurrentFont(
|
||||
QtGui.QFont(self.theme.font_main_name))
|
||||
@ -363,9 +370,9 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard):
|
||||
self.setField(u'footerSizeSpinBox',
|
||||
QtCore.QVariant(self.theme.font_footer_size))
|
||||
|
||||
def setPositionTabValues(self):
|
||||
def setPositionPageValues(self):
|
||||
"""
|
||||
Handle the display and State of the Position tab.
|
||||
Handle the display and state of the Position page.
|
||||
"""
|
||||
# Main Area
|
||||
self.mainPositionCheckBox.setChecked(not self.theme.font_main_override)
|
||||
@ -387,9 +394,9 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard):
|
||||
self.setField(u'footerPositionWidth',
|
||||
QtCore.QVariant(self.theme.font_footer_width))
|
||||
|
||||
def setAlignmentTabValues(self):
|
||||
def setAlignmentPageValues(self):
|
||||
"""
|
||||
Define the Tab Alignments Page
|
||||
Handle the display and state of the Alignments page.
|
||||
"""
|
||||
self.setField(u'horizontal',
|
||||
QtCore.QVariant(self.theme.display_horizontal_align))
|
||||
@ -398,17 +405,18 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard):
|
||||
self.setField(u'slideTransition',
|
||||
QtCore.QVariant(self.theme.display_slide_transition))
|
||||
|
||||
def setPreviewTabValues(self):
|
||||
def setPreviewPageValues(self):
|
||||
"""
|
||||
Handle the display and state of the Preview page.
|
||||
"""
|
||||
self.setField(u'name', QtCore.QVariant(self.theme.theme_name))
|
||||
self.themeNameEdit.setReadOnly(len(self.theme.theme_name) != 0)
|
||||
self.themeNameEdit.setFrame(len(self.theme.theme_name) == 0)
|
||||
|
||||
def onBackgroundComboBoxCurrentIndexChanged(self, index):
|
||||
"""
|
||||
Background style Combo box has changed.
|
||||
"""
|
||||
self.theme.background_type = BackgroundType.to_string(index)
|
||||
self.setBackgroundTabValues()
|
||||
self.setBackgroundPageValues()
|
||||
|
||||
def onGradientComboBoxCurrentIndexChanged(self, index):
|
||||
"""
|
||||
@ -416,7 +424,7 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard):
|
||||
"""
|
||||
self.theme.background_direction = \
|
||||
BackgroundGradientType.to_string(index)
|
||||
self.setBackgroundTabValues()
|
||||
self.setBackgroundPageValues()
|
||||
|
||||
def onColorButtonClicked(self):
|
||||
"""
|
||||
@ -424,7 +432,7 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard):
|
||||
"""
|
||||
self.theme.background_color = \
|
||||
self._colorButton(self.theme.background_color)
|
||||
self.setBackgroundTabValues()
|
||||
self.setBackgroundPageValues()
|
||||
|
||||
def onGradientStartButtonClicked(self):
|
||||
"""
|
||||
@ -432,7 +440,7 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard):
|
||||
"""
|
||||
self.theme.background_start_color = \
|
||||
self._colorButton(self.theme.background_start_color)
|
||||
self.setBackgroundTabValues()
|
||||
self.setBackgroundPageValues()
|
||||
|
||||
def onGradientEndButtonClicked(self):
|
||||
"""
|
||||
@ -440,7 +448,7 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard):
|
||||
"""
|
||||
self.theme.background_end_color = \
|
||||
self._colorButton(self.theme.background_end_color)
|
||||
self.setBackgroundTabValues()
|
||||
self.setBackgroundPageValues()
|
||||
|
||||
def onImageBrowseButtonClicked(self):
|
||||
"""
|
||||
@ -454,27 +462,27 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard):
|
||||
images_filter)
|
||||
if filename:
|
||||
self.theme.background_filename = unicode(filename)
|
||||
self.setBackgroundTabValues()
|
||||
self.setBackgroundPageValues()
|
||||
|
||||
def onMainColorButtonClicked(self):
|
||||
self.theme.font_main_color = \
|
||||
self._colorButton(self.theme.font_main_color)
|
||||
self.setMainAreaTabValues()
|
||||
self.setMainAreaPageValues()
|
||||
|
||||
def onOutlineColorButtonClicked(self):
|
||||
self.theme.font_main_outline_color = \
|
||||
self._colorButton(self.theme.font_main_outline_color)
|
||||
self.setMainAreaTabValues()
|
||||
self.setMainAreaPageValues()
|
||||
|
||||
def onShadowColorButtonClicked(self):
|
||||
self.theme.font_main_shadow_color = \
|
||||
self._colorButton(self.theme.font_main_shadow_color)
|
||||
self.setMainAreaTabValues()
|
||||
self.setMainAreaPageValues()
|
||||
|
||||
def onFooterColorButtonClicked(self):
|
||||
self.theme.font_footer_color = \
|
||||
self._colorButton(self.theme.font_footer_color)
|
||||
self.setFooterAreaTabValues()
|
||||
self.setFooterAreaPageValues()
|
||||
|
||||
def updateTheme(self):
|
||||
"""
|
||||
|
@ -269,9 +269,12 @@ class Ui_ThemeWizard(object):
|
||||
self.verticalComboBox.addItems([u'', u'', u''])
|
||||
self.verticalComboBox.setObjectName(u'VerticalComboBox')
|
||||
self.alignmentLayout.addRow(self.verticalLabel, self.verticalComboBox)
|
||||
self.transitionsLabel = QtGui.QLabel(self.alignmentPage)
|
||||
self.transitionsLabel.setObjectName(u'TransitionsLabel')
|
||||
self.transitionsCheckBox = QtGui.QCheckBox(self.alignmentPage)
|
||||
self.transitionsCheckBox.setObjectName(u'TransitionsCheckBox')
|
||||
self.alignmentLayout.addRow(self.transitionsCheckBox)
|
||||
self.alignmentLayout.addRow(self.transitionsLabel,
|
||||
self.transitionsCheckBox)
|
||||
ThemeWizard.addPage(self.alignmentPage)
|
||||
# Area Position Page
|
||||
self.areaPositionPage = QtGui.QWizardPage()
|
||||
@ -517,8 +520,8 @@ class Ui_ThemeWizard(object):
|
||||
translate('OpenLP.ThemeWizard', 'Middle'))
|
||||
self.verticalComboBox.setItemText(2,
|
||||
translate('OpenLP.ThemeWizard', 'Bottom'))
|
||||
self.transitionsCheckBox.setText(
|
||||
translate('OpenLP.ThemeWizard', 'Transitions'))
|
||||
self.transitionsLabel.setText(
|
||||
translate('OpenLP.ThemeWizard', 'Transitions:'))
|
||||
self.areaPositionPage.setTitle(
|
||||
translate('OpenLP.ThemeWizard', 'Output Area Locations'))
|
||||
self.areaPositionPage.setSubTitle(
|
||||
|
@ -127,7 +127,7 @@ class BibleImportForm(QtGui.QWizard, Ui_BibleImportWizard):
|
||||
"""
|
||||
Stop the import on cancel button, close button or ESC key.
|
||||
"""
|
||||
log.debug('Import canceled by user.')
|
||||
log.debug(u'Import canceled by user.')
|
||||
if self.currentPage() == self.importPage:
|
||||
Receiver.send_message(u'bibles_stop_import')
|
||||
self.done(QtGui.QDialog.Rejected)
|
||||
|
@ -126,7 +126,7 @@ def parse_reference(reference):
|
||||
|
||||
Returns None or a reference list.
|
||||
"""
|
||||
log.debug('parse_reference("%s")', reference)
|
||||
log.debug(u'parse_reference("%s")', reference)
|
||||
match = get_reference_match(u'full').match(reference)
|
||||
if match:
|
||||
log.debug(u'Matched reference %s' % reference)
|
||||
|
@ -166,7 +166,7 @@ class BibleDB(QtCore.QObject, Manager):
|
||||
"""
|
||||
Stops the import of the Bible.
|
||||
"""
|
||||
log.debug('Stopping import')
|
||||
log.debug(u'Stopping import')
|
||||
self.stop_import_flag = True
|
||||
|
||||
def get_name(self):
|
||||
@ -430,9 +430,9 @@ class BibleDB(QtCore.QObject, Manager):
|
||||
Utility debugging method to dump the contents of a bible.
|
||||
"""
|
||||
log.debug(u'.........Dumping Bible Database')
|
||||
log.debug('...............................Books ')
|
||||
log.debug(u'...............................Books ')
|
||||
books = self.session.query(Book).all()
|
||||
log.debug(books)
|
||||
log.debug(u'...............................Verses ')
|
||||
verses = self.session.query(Verse).all()
|
||||
log.debug(verses)
|
||||
log.debug(verses)
|
||||
|
@ -447,7 +447,7 @@ class HTTPBible(BibleDB):
|
||||
[(u'Genesis', 1, 1, 1), (u'Genesis', 2, 2, 3)]
|
||||
"""
|
||||
for reference in reference_list:
|
||||
log.debug('Reference: %s', reference)
|
||||
log.debug(u'Reference: %s', reference)
|
||||
book = reference[0]
|
||||
db_book = self.get_book(book)
|
||||
if not db_book:
|
||||
@ -522,4 +522,4 @@ class HTTPBible(BibleDB):
|
||||
``chapter``
|
||||
The chapter whose verses are being counted.
|
||||
"""
|
||||
return HTTPBooks.get_verse_count(book, chapter)
|
||||
return HTTPBooks.get_verse_count(book, chapter)
|
||||
|
@ -125,7 +125,7 @@ class OSISBible(BibleDB):
|
||||
verse = int(match.group(3))
|
||||
verse_text = match.group(4)
|
||||
if not db_book or db_book.name != self.books[book][0]:
|
||||
log.debug('New book: "%s"', self.books[book][0])
|
||||
log.debug(u'New book: "%s"', self.books[book][0])
|
||||
if book == u'Matt':
|
||||
testament += 1
|
||||
db_book = self.create_book(
|
||||
@ -180,4 +180,4 @@ class OSISBible(BibleDB):
|
||||
if self.stop_import_flag:
|
||||
return False
|
||||
else:
|
||||
return success
|
||||
return success
|
||||
|
@ -133,7 +133,7 @@ class SongImportForm(QtGui.QWizard, Ui_SongImportWizard):
|
||||
"""
|
||||
Stop the import on cancel button, close button or ESC key.
|
||||
"""
|
||||
log.debug('Import canceled by user.')
|
||||
log.debug(u'Import canceled by user.')
|
||||
if self.currentPage() == self.importPage:
|
||||
Receiver.send_message(u'songs_stop_import')
|
||||
self.done(QtGui.QDialog.Rejected)
|
||||
|
@ -128,7 +128,7 @@ class OpenSongImport(SongImport):
|
||||
numfiles += len(z.infolist())
|
||||
else:
|
||||
numfiles += 1
|
||||
log.debug("Total number of files: %d", numfiles)
|
||||
log.debug(u'Total number of files: %d', numfiles)
|
||||
self.import_wizard.importProgressBar.setMaximum(numfiles)
|
||||
for filename in self.filenames:
|
||||
if self.stop_import_flag:
|
||||
@ -159,7 +159,7 @@ class OpenSongImport(SongImport):
|
||||
break
|
||||
else:
|
||||
# not a zipfile
|
||||
log.info('Direct import %s', filename)
|
||||
log.info(u'Direct import %s', filename)
|
||||
self.import_wizard.incrementProgressBar(
|
||||
unicode(translate('SongsPlugin.ImportWizardForm',
|
||||
'Importing %s...')) % os.path.split(filename)[-1])
|
||||
@ -306,4 +306,4 @@ class OpenSongImport(SongImport):
|
||||
log.info(u'Got order %s but not in versetags, dropping this'
|
||||
u'item from presentation order', tag)
|
||||
else:
|
||||
self.verse_order_list.append(tag)
|
||||
self.verse_order_list.append(tag)
|
||||
|
Loading…
Reference in New Issue
Block a user