openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #02453
[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)
Cleanup theme background file button
Fix bug #594911
--
https://code.launchpad.net/~meths/openlp/trivialfixes/+merge/29754
Your team OpenLP Core is requested to review the proposed merge of lp:~meths/openlp/trivialfixes into lp:openlp.
=== modified file 'openlp/core/ui/amendthemedialog.py'
--- openlp/core/ui/amendthemedialog.py 2010-07-06 12:58:33 +0000
+++ openlp/core/ui/amendthemedialog.py 2010-07-12 22:38:42 +0000
@@ -130,9 +130,9 @@
self.ImageLineEdit.setObjectName(u'ImageLineEdit')
self.horizontalLayout_2.addWidget(self.ImageLineEdit)
self.ImageToolButton = QtGui.QToolButton(self.ImageFilenameWidget)
- icon1 = build_icon(u':/general/general_open.png')
- self.ImageToolButton.setIcon(icon1)
+ self.ImageToolButton.setIcon(build_icon(u':/general/general_open.png'))
self.ImageToolButton.setObjectName(u'ImageToolButton')
+ self.ImageToolButton.setAutoRaise(True)
self.horizontalLayout_2.addWidget(self.ImageToolButton)
self.BackgroundLayout.setWidget(4, QtGui.QFormLayout.FieldRole,
self.ImageFilenameWidget)
=== modified file 'openlp/core/ui/amendthemeform.py'
--- openlp/core/ui/amendthemeform.py 2010-07-06 12:58:33 +0000
+++ openlp/core/ui/amendthemeform.py 2010-07-12 22:38:42 +0000
@@ -59,7 +59,7 @@
QtCore.QObject.connect(self.ShadowColorPushButton,
QtCore.SIGNAL(u'pressed()'), self.onShadowColorPushButtonClicked)
QtCore.QObject.connect(self.ImageToolButton,
- QtCore.SIGNAL(u'pressed()'), self.onImageToolButtonClicked)
+ QtCore.SIGNAL(u'clicked()'), self.onImageToolButtonClicked)
#Combo boxes
QtCore.QObject.connect(self.BackgroundComboBox,
QtCore.SIGNAL(u'activated(int)'), self.onBackgroundComboBoxSelected)
=== modified file 'openlp/core/ui/thememanager.py'
--- openlp/core/ui/thememanager.py 2010-07-05 16:00:48 +0000
+++ openlp/core/ui/thememanager.py 2010-07-12 22:38:42 +0000
@@ -116,6 +116,7 @@
self.thumbPath = os.path.join(self.path, u'thumbnails')
self.checkThemesExists(self.thumbPath)
self.amendThemeForm.path = self.path
+ self.oldBackgroundImage = None
# Last little bits of setting up
self.global_theme = unicode(QtCore.QSettings().value(
self.settingsSection + u'/global theme',
@@ -187,6 +188,8 @@
item = self.ThemeListWidget.currentItem()
theme = self.getThemeData(
unicode(item.data(QtCore.Qt.UserRole).toString()))
+ if theme.background_type == u'image':
+ self.oldBackgroundImage = theme.background_filename
self.amendThemeForm.loadTheme(theme)
self.saveThemeName = unicode(
item.data(QtCore.Qt.UserRole).toString())
@@ -544,6 +547,12 @@
QtGui.QMessageBox.No)
if result == QtGui.QMessageBox.Yes:
# Save the theme, overwriting the existing theme if necessary.
+ if image_to and self.oldBackgroundImage and \
+ image_to != self.oldBackgroundImage:
+ try:
+ os.remove(self.oldBackgroundImage)
+ except OSError:
+ log.exception(u'Unable to remove old theme background')
outfile = None
try:
outfile = open(theme_file, u'w')
Follow ups