openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #00586
[Merge] lp:~trb143/openlp/bitsandbobs into lp:openlp
Tim Bentley has proposed merging lp:~trb143/openlp/bitsandbobs into lp:openlp.
Requested reviews:
OpenLP Core (openlp-core)
Various bug fixes around themes.
* Images appear in them editor
* "Do you want to save" restricted to only when changing name and new name exists
Presentations not can be Inactive - Lets see what breaks
--
https://code.launchpad.net/~trb143/openlp/bitsandbobs/+merge/13533
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/core/lib/plugin.py'
--- openlp/core/lib/plugin.py 2009-10-10 13:14:09 +0000
+++ openlp/core/lib/plugin.py 2009-10-18 13:15:21 +0000
@@ -250,7 +250,7 @@
"""
Called by the plugin to remove toolbar
"""
- self.mediadock.removeDock(self.name)
+ self.mediadock.remove_dock(self.name)
self.settings.removeTab(self.name)
def insert_toolbox_item(self):
@@ -258,6 +258,6 @@
Called by plugin to replace toolbar
"""
if self.media_item is not None:
- self.mediadock.insertDock(self.media_item, self.icon, self.weight)
+ self.mediadock.insert_dock(self.media_item, self.icon, self.weight)
if self.settings_tab is not None:
self.settings.insertTab(self.settings_tab, self.weight)
=== modified file 'openlp/core/lib/pluginmanager.py'
--- openlp/core/lib/pluginmanager.py 2009-10-11 19:31:46 +0000
+++ openlp/core/lib/pluginmanager.py 2009-10-18 13:15:21 +0000
@@ -140,7 +140,7 @@
if plugin.media_item is not None:
log.debug(u'Inserting media manager item from %s' % \
plugin.name)
- mediadock.addDock(plugin.media_item, plugin.icon, plugin.weight)
+ mediadock.add_dock(plugin.media_item, plugin.icon, plugin.weight)
def hook_settings_tabs(self, settingsform=None):
"""
=== modified file 'openlp/core/lib/themexmlhandler.py'
--- openlp/core/lib/themexmlhandler.py 2009-09-29 02:54:32 +0000
+++ openlp/core/lib/themexmlhandler.py 2009-10-18 13:15:21 +0000
@@ -90,6 +90,8 @@
The path name to be added.
"""
if self.background_filename is not None and path is not None:
+ self.theme_name = self.theme_name.rstrip().lstrip()
+ self.background_filename = self.background_filename.rstrip().lstrip()
self.background_filename = os.path.join(path, self.theme_name,
self.background_filename)
=== modified file 'openlp/core/ui/maindisplay.py'
--- openlp/core/ui/maindisplay.py 2009-10-17 16:11:41 +0000
+++ openlp/core/ui/maindisplay.py 2009-10-18 13:15:21 +0000
@@ -108,6 +108,7 @@
Sets up the screen on a particular screen.
@param (integer) screen This is the screen number.
"""
+ log.debug(u'Setup %s for %s ' %(self.screens, screenNumber) )
screen = self.screens[screenNumber]
if screen[u'number'] != screenNumber:
# We will most probably never actually hit this bit, but just in
=== modified file 'openlp/core/ui/mediadockmanager.py'
--- openlp/core/ui/mediadockmanager.py 2009-10-10 14:06:59 +0000
+++ openlp/core/ui/mediadockmanager.py 2009-10-18 13:15:21 +0000
@@ -24,19 +24,19 @@
import logging
-log = logging.getLogger(u'MediaDockManager')
+log = logging.getLogger(u'media_dockManager')
class MediaDockManager(object):
- def __init__(self, mediaDock):
- self.mediaDock = mediaDock
+ def __init__(self, media_dock):
+ self.media_dock = media_dock
- def addDock(self, media_item, icon, weight):
+ def add_dock(self, media_item, icon, weight):
log.info(u'Adding %s dock' % media_item.title)
- id = self.mediaDock.addItem(
+ id = self.media_dock.addItem(
media_item, icon, media_item.title)
- def insertDock(self, media_item, icon, weight):
+ def insert_dock(self, media_item, icon, weight):
"""
This should insert a dock item at a given location
This does not work as it gives a Segmentation error.
@@ -44,18 +44,18 @@
"""
log.debug(u'Inserting %s dock' % media_item.title)
match = False
- for dock_index in range(0, self.mediaDock.count()):
- if self.mediaDock.widget(dock_index).ConfigSection == media_item.title.lower():
+ for dock_index in range(0, self.media_dock.count()):
+ if self.media_dock.widget(dock_index).ConfigSection == media_item.title.lower():
match = True
break
if not match:
- self.mediaDock.addItem(media_item, icon, media_item.title)
-
-
- def removeDock(self, name):
+ self.media_dock.addItem(media_item, icon, media_item.title)
+
+
+ def remove_dock(self, name):
log.debug(u'remove %s dock' % name)
- for dock_index in range(0, self.mediaDock.count()):
- if self.mediaDock.widget(dock_index) is not None:
- if self.mediaDock.widget(dock_index).ConfigSection == name.lower():
- self.mediaDock.widget(dock_index).hide()
- self.mediaDock.removeItem(dock_index)
+ for dock_index in range(0, self.media_dock.count()):
+ if self.media_dock.widget(dock_index) is not None:
+ if self.media_dock.widget(dock_index).ConfigSection == name.lower():
+ self.media_dock.widget(dock_index).hide()
+ self.media_dock.removeItem(dock_index)
=== modified file 'openlp/core/ui/thememanager.py'
--- openlp/core/ui/thememanager.py 2009-10-16 04:46:32 +0000
+++ openlp/core/ui/thememanager.py 2009-10-18 13:15:21 +0000
@@ -153,6 +153,7 @@
def onAddTheme(self):
self.amendThemeForm.loadTheme(None)
+ self.saveThemeName = u''
self.amendThemeForm.exec_()
def onEditTheme(self):
@@ -160,6 +161,7 @@
if item is not None:
self.amendThemeForm.loadTheme(
unicode(item.data(QtCore.Qt.UserRole).toString()))
+ self.saveThemeName = unicode(item.data(QtCore.Qt.UserRole).toString())
self.amendThemeForm.exec_()
def onDeleteTheme(self):
@@ -412,23 +414,26 @@
os.mkdir(os.path.join(self.path, name))
theme_file = os.path.join(theme_dir, name + u'.xml')
log.debug(theme_file)
-
result = QtGui.QMessageBox.Yes
- if os.path.exists(theme_file):
- result = QtGui.QMessageBox.question(
- self,
- translate(u'ThemeManager', u'Theme Exists'),
- translate(u'ThemeManager', u'A theme with this name already exists, would you like to overwrite it?'),
- (QtGui.QMessageBox.Yes | QtGui.QMessageBox.No),
- QtGui.QMessageBox.No)
+ if self.saveThemeName != name:
+ if os.path.exists(theme_file):
+ result = QtGui.QMessageBox.question(
+ self,
+ translate(u'ThemeManager', u'Theme Exists'),
+ translate(u'ThemeManager', u'A theme with this name already exists, would you like to overwrite it?'),
+ (QtGui.QMessageBox.Yes | QtGui.QMessageBox.No),
+ QtGui.QMessageBox.No)
+ else:
+ result == QtGui.QMessageBox.Yes
if result == QtGui.QMessageBox.Yes:
# Save the theme, overwriting the existing theme if necessary.
outfile = open(theme_file, u'w')
outfile.write(theme_pretty_xml)
outfile.close()
if image_from is not None and image_from != image_to:
+ print "if", image_from
+ print "it", image_to
shutil.copyfile(image_from, image_to)
-
self.generateAndSaveImage(self.path, name, theme_xml)
self.loadThemes()
else:
=== modified file 'openlp/plugins/bibles/lib/biblestab.py'
--- openlp/plugins/bibles/lib/biblestab.py 2009-10-17 06:12:38 +0000
+++ openlp/plugins/bibles/lib/biblestab.py 2009-10-18 13:15:21 +0000
@@ -110,9 +110,9 @@
self.BibleThemeComboBox.setObjectName(u'BibleThemeComboBox')
self.BibleThemeComboBox.addItem(QtCore.QString())
self.BibleThemeLayout.addWidget(self.BibleThemeComboBox)
- self.BibleDuelCheckBox = QtGui.QCheckBox(self.VerseDisplayGroupBox)
- self.BibleDuelCheckBox.setObjectName(u'BibleDuelCheckBox')
- self.VerseDisplayLayout.addWidget(self.BibleDuelCheckBox, 3, 0, 1, 1)
+ self.BibleDualCheckBox = QtGui.QCheckBox(self.VerseDisplayGroupBox)
+ self.BibleDualCheckBox.setObjectName(u'BibleDualCheckBox')
+ self.VerseDisplayLayout.addWidget(self.BibleDualCheckBox, 3, 0, 1, 1)
self.VerseDisplayLayout.addWidget(self.BibleThemeWidget, 4, 0, 1, 1)
self.ChangeNoteLabel = QtGui.QLabel(self.VerseDisplayGroupBox)
self.ChangeNoteLabel.setObjectName(u'ChangeNoteLabel')
@@ -141,9 +141,9 @@
QtCore.QObject.connect(self.LayoutStyleComboBox,
QtCore.SIGNAL(u'activated(int)'),
self.onLayoutStyleComboBoxChanged)
- QtCore.QObject.connect(self.BibleDuelCheckBox,
+ QtCore.QObject.connect(self.BibleDualCheckBox,
QtCore.SIGNAL(u'stateChanged(int)'),
- self.onBibleDuelCheckBox)
+ self.onBibleDualCheckBox)
QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'update_themes'), self.updateThemeList)
@@ -174,8 +174,8 @@
3, translate(u'SettingsForm', u'[ and ]'))
self.ChangeNoteLabel.setText(translate(u'SettingsForm',
u'Note:\nChanges don\'t affect verses already in the service'))
- self.BibleDuelCheckBox.setText(
- translate(u'SettingsForm', u'Display Duel Bible Verses'))
+ self.BibleDualCheckBox.setText(
+ translate(u'SettingsForm', u'Display Dual Bible Verses'))
def onBibleThemeComboBoxChanged(self):
self.bible_theme = self.BibleThemeComboBox.currentText()
@@ -192,7 +192,7 @@
if check_state == QtCore.Qt.Checked:
self.show_new_chapters = True
- def onBibleDuelCheckBox(self, check_state):
+ def onBibleDualCheckBox(self, check_state):
self.duel_bibles = False
# we have a set value convert to True/False
if check_state == QtCore.Qt.Checked:
@@ -207,11 +207,11 @@
self.config.get_config(u'verse layout style', u'0'))
self.bible_theme = self.config.get_config(u'bible theme', u'0')
self.duel_bibles = str_to_bool(
- self.config.get_config(u'duel bibles', u'True'))
+ self.config.get_config(u'dual bibles', u'True'))
self.NewChaptersCheckBox.setChecked(self.show_new_chapters)
self.DisplayStyleComboBox.setCurrentIndex(self.display_style)
self.LayoutStyleComboBox.setCurrentIndex(self.layout_style)
- self.BibleDuelCheckBox.setChecked(self.duel_bibles)
+ self.BibleDualCheckBox.setChecked(self.duel_bibles)
def save(self):
self.config.set_config(
@@ -220,7 +220,7 @@
u'display brackets', unicode(self.display_style))
self.config.set_config(
u'verse layout style', unicode(self.layout_style))
- self.config.set_config(u'duel bibles', unicode(self.duel_bibles))
+ self.config.set_config(u'dual bibles', unicode(self.duel_bibles))
self.config.set_config(u'bible theme', unicode(self.bible_theme))
def updateThemeList(self, theme_list):
=== modified file 'openlp/plugins/bibles/lib/mediaitem.py'
--- openlp/plugins/bibles/lib/mediaitem.py 2009-10-17 18:16:27 +0000
+++ openlp/plugins/bibles/lib/mediaitem.py 2009-10-18 13:15:21 +0000
@@ -208,7 +208,7 @@
def configUpdated(self):
if str_to_bool(
- self.parent.config.get_config(u'duel bibles', u'False')):
+ self.parent.config.get_config(u'dual bibles', u'False')):
self.AdvancedSecondBibleComboBox.setVisible(True)
self.QuickSecondBibleComboBox.setVisible(True)
else:
=== modified file 'openlp/plugins/presentations/presentationplugin.py'
--- openlp/plugins/presentations/presentationplugin.py 2009-10-08 17:31:21 +0000
+++ openlp/plugins/presentations/presentationplugin.py 2009-10-18 13:15:21 +0000
@@ -51,19 +51,19 @@
Create the settings Tab
"""
return PresentationTab(self.controllers)
-#
-# def can_be_disabled(self):
-# return True
-#
-# def initialise(self):
-# log.info(u'Presentations Initialising')
-# Plugin.initialise(self)
-# self.insert_toolbox_item()
-#
-# def finalise(self):
-# log.info(u'Plugin Finalise')
-# Plugin.finalise(self)
-# self.remove_toolbox_item()
+
+ def can_be_disabled(self):
+ return True
+
+ def initialise(self):
+ log.info(u'Presentations Initialising')
+ Plugin.initialise(self)
+ self.insert_toolbox_item()
+
+ def finalise(self):
+ log.info(u'Plugin Finalise')
+ Plugin.finalise(self)
+ self.remove_toolbox_item()
def get_media_manager_item(self):
"""
Follow ups