openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #02645
[Merge] lp:~meths/openlp/trivialfixes into lp:openlp
Jon Tibble has proposed merging lp:~meths/openlp/trivialfixes into lp:openlp.
Requested reviews:
OpenLP Core (openlp-core)
Cleanups and fixes including:
* Fix theme saving when editing default theme
* Fix v2 song DB importing
--
https://code.launchpad.net/~meths/openlp/trivialfixes/+merge/30518
Your team OpenLP Core is requested to review the proposed merge of lp:~meths/openlp/trivialfixes into lp:openlp.
=== modified file 'openlp/core/ui/generaltab.py'
--- openlp/core/ui/generaltab.py 2010-07-15 05:38:23 +0000
+++ openlp/core/ui/generaltab.py 2010-07-21 12:22:41 +0000
@@ -287,16 +287,16 @@
Translate the general settings tab to the currently selected language
"""
self.MonitorGroupBox.setTitle(translate('GeneralTab', 'Monitors'))
- self.MonitorLabel.setText(
- translate('OpenLP.GeneralTab', 'Select monitor for output display:'))
+ self.MonitorLabel.setText(translate('OpenLP.GeneralTab',
+ 'Select monitor for output display:'))
self.DisplayOnMonitorCheck.setText(
translate('OpenLP.GeneralTab', 'Display if a single screen'))
self.StartupGroupBox.setTitle(
translate('OpenLP.GeneralTab', 'Application Startup'))
self.WarningCheckBox.setText(
translate('OpenLP.GeneralTab', 'Show blank screen warning'))
- self.AutoOpenCheckBox.setText(
- translate('OpenLP.GeneralTab', 'Automatically open the last service'))
+ self.AutoOpenCheckBox.setText(translate('OpenLP.GeneralTab',
+ 'Automatically open the last service'))
self.ShowSplashCheckBox.setText(
translate('OpenLP.GeneralTab', 'Show the splash screen'))
self.SettingsGroupBox.setTitle(translate('OpenLP.GeneralTab',
@@ -318,7 +318,8 @@
self.currentXValueLabel.setText(u'0')
self.currentYLabel.setText(translate('OpenLP.GeneralTab', 'Y'))
self.currentYValueLabel.setText(u'0')
- self.currentHeightLabel.setText(translate('OpenLP.GeneralTab', 'Height'))
+ self.currentHeightLabel.setText(
+ translate('OpenLP.GeneralTab', 'Height'))
self.currentHeightValueLabel.setText(u'0')
self.currentWidthLabel.setText(translate('OpenLP.GeneralTab', 'Width'))
self.currentWidthValueLabel.setText(u'0')
@@ -375,10 +376,12 @@
QtCore.QVariant(self.screens.current[u'size'].x())).toString())
self.customYValueEdit.setText(settings.value(u'y position',
QtCore.QVariant(self.screens.current[u'size'].y())).toString())
- self.customHeightValueEdit.setText(settings.value(u'height',
- QtCore.QVariant(self.screens.current[u'size'].height())).toString())
- self.customWidthValueEdit.setText(settings.value(u'width',
- QtCore.QVariant(self.screens.current[u'size'].width())).toString())
+ self.customHeightValueEdit.setText(
+ settings.value(u'height', QtCore.QVariant(
+ self.screens.current[u'size'].height())).toString())
+ self.customWidthValueEdit.setText(
+ settings.value(u'width', QtCore.QVariant(
+ self.screens.current[u'size'].width())).toString())
else:
self.customXValueEdit.setText(
unicode(self.screens.current[u'size'].x()))
=== modified file 'openlp/core/ui/servicemanager.py'
--- openlp/core/ui/servicemanager.py 2010-07-15 00:06:20 +0000
+++ openlp/core/ui/servicemanager.py 2010-07-21 12:22:41 +0000
@@ -108,8 +108,8 @@
self.droppos = 0
#is a new service and has not been saved
self.isNew = True
- self.serviceNoteForm = ServiceNoteForm()
- self.serviceItemEditForm = ServiceItemEditForm()
+ self.serviceNoteForm = ServiceNoteForm(self.parent)
+ self.serviceItemEditForm = ServiceItemEditForm(self.parent)
#start with the layout
self.Layout = QtGui.QVBoxLayout(self)
self.Layout.setSpacing(0)
=== modified file 'openlp/core/ui/thememanager.py'
--- openlp/core/ui/thememanager.py 2010-07-18 07:07:01 +0000
+++ openlp/core/ui/thememanager.py 2010-07-21 12:22:41 +0000
@@ -1,3 +1,4 @@
+import os.path
# -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
@@ -253,15 +254,14 @@
The theme to delete.
"""
self.themelist.remove(theme)
- th = theme + u'.png'
+ thumb = theme + u'.png'
try:
- os.remove(os.path.join(self.path, th))
- os.remove(os.path.join(self.thumbPath, th))
+ os.remove(os.path.join(self.path, thumb))
+ os.remove(os.path.join(self.thumbPath, thumb))
encoding = get_filesystem_encoding()
shutil.rmtree(os.path.join(self.path, theme).encode(encoding))
except OSError:
- #if not present do not worry
- pass
+ log.exception(u'Error deleting theme %s', theme)
# As we do not reload the themes push out the change
# Reaload the list as the internal lists and events need
# to be triggered
@@ -605,19 +605,21 @@
if newThemeIndex != -1:
self.serviceComboBox.setCurrentIndex(newThemeIndex)
if self.editingDefault:
- newThemeItem = self.ThemeListWidget.findItems(name,
- QtCore.Qt.MatchExactly)[0]
- newThemeIndex = self.ThemeListWidget.indexFromItem(
- newThemeItem).row()
- self.global_theme = unicode(
- self.ThemeListWidget.item(newThemeIndex).text())
- newName = unicode(translate('ThemeManager', '%s (default)')) % \
- self.global_theme
- self.ThemeListWidget.item(newThemeIndex).setText(newName)
- QtCore.QSettings().setValue(
- self.settingsSection + u'/global theme',
- QtCore.QVariant(self.global_theme))
- Receiver.send_message(u'theme_update_global', self.global_theme)
+ if self.saveThemeName != name:
+ newThemeItem = self.ThemeListWidget.findItems(name,
+ QtCore.Qt.MatchExactly)[0]
+ newThemeIndex = self.ThemeListWidget.indexFromItem(
+ newThemeItem).row()
+ self.global_theme = unicode(
+ self.ThemeListWidget.item(newThemeIndex).text())
+ newName = unicode(translate('ThemeManager',
+ '%s (default)')) % self.global_theme
+ self.ThemeListWidget.item(newThemeIndex).setText(newName)
+ QtCore.QSettings().setValue(
+ self.settingsSection + u'/global theme',
+ QtCore.QVariant(self.global_theme))
+ Receiver.send_message(u'theme_update_global',
+ self.global_theme)
self.editingDefault = False
self.pushThemes()
else:
=== modified file 'openlp/plugins/songs/forms/editsongdialog.py'
--- openlp/plugins/songs/forms/editsongdialog.py 2010-07-17 16:03:59 +0000
+++ openlp/plugins/songs/forms/editsongdialog.py 2010-07-21 12:22:41 +0000
@@ -441,7 +441,8 @@
translate('SongsPlugin.EditSongForm', 'Song Book'))
self.SongTabWidget.setTabText(
self.SongTabWidget.indexOf(self.AuthorsTab),
- translate('SongsPlugin.EditSongForm', 'Authors, Topics && Song Book'))
+ translate('SongsPlugin.EditSongForm',
+ 'Authors, Topics && Song Book'))
self.ThemeGroupBox.setTitle(
translate('SongsPlugin.EditSongForm', 'Theme'))
self.ThemeAddButton.setText(
=== modified file 'openlp/plugins/songs/lib/olpimport.py'
--- openlp/plugins/songs/lib/olpimport.py 2010-07-20 12:43:21 +0000
+++ openlp/plugins/songs/lib/olpimport.py 2010-07-21 12:22:41 +0000
@@ -169,7 +169,7 @@
else:
new_song.authors.append(Author.populate(
display_name=u'Author Unknown'))
- if song.song_book_id != 0:
+ if song.book:
existing_song_book = self.master_manager.get_object_filtered(
Book, Book.name == song.book.name)
if existing_song_book:
=== modified file 'openlp/plugins/songs/lib/opensongimport.py'
--- openlp/plugins/songs/lib/opensongimport.py 2010-07-19 20:43:02 +0000
+++ openlp/plugins/songs/lib/opensongimport.py 2010-07-21 12:22:41 +0000
@@ -195,11 +195,12 @@
versetype is not None:
words = thisline
if versenum is not None:
- versetag = u'%s%s'%(versetype,versenum)
+ versetag = u'%s%s' % (versetype, versenum)
if not verses.has_key(versetype):
verses[versetype] = {}
if not verses[versetype].has_key(versenum):
- verses[versetype][versenum] = [] # storage for lines in this verse
+ # storage for lines in this verse
+ verses[versetype][versenum] = []
if not verses_seen.has_key(versetag):
verses_seen[versetag] = 1
our_verse_order.append(versetag)
@@ -216,10 +217,11 @@
versenums = verses[versetype].keys()
versenums.sort()
for num in versenums:
- versetag = u'%s%s' %(versetype,num)
+ versetag = u'%s%s' % (versetype, num)
lines = u'\n'.join(verses[versetype][num])
self.song_import.verses.append([versetag, lines])
- versetags[versetag] = 1 # keep track of what we have for error checking later
+ # Keep track of what we have for error checking later
+ versetags[versetag] = 1
# now figure out the presentation order
if u'presentation' in fields and root.presentation != u'':
order = unicode(root.presentation)
Follow ups