From 1027d6063578f08c942a4d564eb465f75e17fbbc Mon Sep 17 00:00:00 2001 From: M2j Date: Wed, 22 Dec 2010 19:15:48 +0100 Subject: [PATCH 1/7] Fix: Bug in editsongform Fix: Bug in bibleserver import --- openlp/core/ui/mainwindow.py | 2 +- openlp/plugins/bibles/lib/http.py | 1 + openlp/plugins/songs/forms/editsongdialog.py | 6 ++++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index a319e005f..ed06877e5 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -148,7 +148,7 @@ class Ui_MainWindow(object): self.MediaManagerDock.setMinimumWidth( self.settingsmanager.mainwindow_left) self.MediaManagerDock.setObjectName(u'MediaManagerDock') - self.MediaManagerContents = QtGui.QWidget() + self.MediaManagerContents = QtGui.QWidget(MainWindow) self.MediaManagerContents.setObjectName(u'MediaManagerContents') self.MediaManagerLayout = QtGui.QHBoxLayout(self.MediaManagerContents) self.MediaManagerLayout.setContentsMargins(0, 2, 0, 0) diff --git a/openlp/plugins/bibles/lib/http.py b/openlp/plugins/bibles/lib/http.py index d3b14661b..79d3f311f 100644 --- a/openlp/plugins/bibles/lib/http.py +++ b/openlp/plugins/bibles/lib/http.py @@ -284,6 +284,7 @@ class BSExtract(object): if not soup: return None Receiver.send_message(u'openlp_process_events') + content = None try: content = soup.find(u'div', u'content').find(u'div').findAll(u'div') except: diff --git a/openlp/plugins/songs/forms/editsongdialog.py b/openlp/plugins/songs/forms/editsongdialog.py index 0d2e65f95..ffe05553b 100644 --- a/openlp/plugins/songs/forms/editsongdialog.py +++ b/openlp/plugins/songs/forms/editsongdialog.py @@ -146,8 +146,7 @@ class Ui_EditSongDialog(object): self.AuthorsSelectionComboItem.sizePolicy().hasHeightForWidth()) self.AuthorsSelectionComboItem.setSizePolicy(sizePolicy) self.AuthorsSelectionComboItem.setEditable(True) - self.AuthorsSelectionComboItem.setInsertPolicy( - QtGui.QComboBox.InsertAlphabetically) + self.AuthorsSelectionComboItem.setInsertPolicy(QtGui.QComboBox.NoInsert) self.AuthorsSelectionComboItem.setSizeAdjustPolicy( QtGui.QComboBox.AdjustToMinimumContentsLength) self.AuthorsSelectionComboItem.setMinimumContentsLength(8) @@ -224,6 +223,7 @@ class Ui_EditSongDialog(object): sizePolicy.setHeightForWidth( self.SongTopicCombo.sizePolicy().hasHeightForWidth()) self.SongTopicCombo.setEditable(True) + self.SongTopicCombo.setInsertPolicy(QtGui.QComboBox.NoInsert) self.SongTopicCombo.setSizePolicy(sizePolicy) self.SongTopicCombo.setObjectName(u'SongTopicCombo') self.TopicAddLayout.addWidget(self.SongTopicCombo) @@ -271,6 +271,7 @@ class Ui_EditSongDialog(object): sizePolicy.setHeightForWidth( self.SongbookCombo.sizePolicy().hasHeightForWidth()) self.SongbookCombo.setEditable(True) + self.SongbookCombe.setInsertPolicy(QtGui.QComboBox.NoInsert) self.SongbookCombo.setSizePolicy(sizePolicy) self.SongbookCombo.setObjectName(u'SongbookCombo') self.SongbookLayout.addRow(self.SongbookNameLabel, self.SongbookCombo) @@ -315,6 +316,7 @@ class Ui_EditSongDialog(object): self.ThemeLayout.setObjectName(u'ThemeLayout') self.ThemeSelectionComboItem = QtGui.QComboBox(self.ThemeGroupBox) self.ThemeSelectionComboItem.setEditable(True) + self.ThemeSelectionComboItem.setInsertPolicy(QtGui.QComboBox.NoInsert) self.ThemeSelectionComboItem.setObjectName(u'ThemeSelectionComboItem') self.ThemeLayout.addWidget(self.ThemeSelectionComboItem) self.ThemeAddButton = QtGui.QPushButton(self.ThemeGroupBox) From 0e064c992829ca8b485e3be44a0ee4de6751620d Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Wed, 22 Dec 2010 18:49:01 +0000 Subject: [PATCH 2/7] Fix theme delete / rename issue with plugin stored values Fixes: https://launchpad.net/bugs/693202 --- openlp/core/ui/thememanager.py | 110 +++++++++++++++++++-------------- 1 file changed, 62 insertions(+), 48 deletions(-) diff --git a/openlp/core/ui/thememanager.py b/openlp/core/ui/thememanager.py index 0b0d8281d..79e4a193c 100644 --- a/openlp/core/ui/thememanager.py +++ b/openlp/core/ui/thememanager.py @@ -223,15 +223,17 @@ class ThemeManager(QtGui.QWidget): """ Renames an existing theme to a new name """ - item = self.themeListWidget.currentItem() - oldThemeName = unicode(item.data(QtCore.Qt.UserRole).toString()) - self.fileRenameForm.fileNameEdit.setText(oldThemeName) - self.saveThemeName = u'' - if self.fileRenameForm.exec_(): - newThemeName = unicode(self.fileRenameForm.fileNameEdit.text()) - oldThemeData = self.getThemeData(oldThemeName) - self.deleteTheme(oldThemeName) - self.cloneThemeData(oldThemeData, newThemeName) + action = unicode(translate('OpenLP.ThemeManager', 'Rename')) + if self._validate_theme_action(action): + item = self.themeListWidget.currentItem() + oldThemeName = unicode(item.data(QtCore.Qt.UserRole).toString()) + self.fileRenameForm.fileNameEdit.setText(oldThemeName) + self.saveThemeName = u'' + if self.fileRenameForm.exec_(): + newThemeName = unicode(self.fileRenameForm.fileNameEdit.text()) + oldThemeData = self.getThemeData(oldThemeName) + self.deleteTheme(oldThemeName) + self.cloneThemeData(oldThemeData, newThemeName) def onCopyTheme(self): """ @@ -286,47 +288,13 @@ class ThemeManager(QtGui.QWidget): """ Delete a theme """ - self.global_theme = unicode(QtCore.QSettings().value( - self.settingsSection + u'/global theme', - QtCore.QVariant(u'')).toString()) - if check_item_selected(self.themeListWidget, - translate('OpenLP.ThemeManager', - 'You must select a theme to delete.')): + action = unicode(translate('OpenLP.ThemeManager', 'Delete')) + if self._validate_theme_action(action): item = self.themeListWidget.currentItem() theme = unicode(item.text()) - # confirm deletion - answer = QtGui.QMessageBox.question(self, - translate('OpenLP.ThemeManager', 'Delete Confirmation'), - unicode(translate('OpenLP.ThemeManager', 'Delete %s theme?')) - % theme, - QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Yes | - QtGui.QMessageBox.No), QtGui.QMessageBox.No) - if answer == QtGui.QMessageBox.No: - return - # should be the same unless default - if theme != unicode(item.data(QtCore.Qt.UserRole).toString()): - QtGui.QMessageBox.critical(self, - translate('OpenLP.ThemeManager', 'Error'), - translate('OpenLP.ThemeManager', - 'You are unable to delete the default theme.')) - else: - for plugin in self.parent.pluginManager.plugins: - if plugin.usesTheme(theme): - QtGui.QMessageBox.critical(self, - translate('OpenLP.ThemeManager', 'Error'), - unicode(translate('OpenLP.ThemeManager', - 'Theme %s is used in the %s plugin.')) % \ - (theme, plugin.name)) - return - if unicode(self.serviceComboBox.currentText()) == theme: - QtGui.QMessageBox.critical(self, - translate('OpenLP.ThemeManager', 'Error'), - unicode(translate('OpenLP.ThemeManager', - 'Theme %s is used by the service manager.')) % theme) - return - row = self.themeListWidget.row(item) - self.themeListWidget.takeItem(row) - self.deleteTheme(theme) + row = self.themeListWidget.row(item) + self.themeListWidget.takeItem(row) + self.deleteTheme(theme) def deleteTheme(self, theme): """ @@ -782,3 +750,49 @@ class ThemeManager(QtGui.QWidget): theme.parse(themeXml) theme.extend_image_filename(path) return theme + + def _validate_theme_action(self, action): + """ + Check to see if theme has been selected and the destructive action + is allowed. + """ + self.global_theme = unicode(QtCore.QSettings().value( + self.settingsSection + u'/global theme', + QtCore.QVariant(u'')).toString()) + if check_item_selected(self.themeListWidget, + unicode(translate('OpenLP.ThemeManager', + 'You must select a theme to %s.')) % action): + item = self.themeListWidget.currentItem() + theme = unicode(item.text()) + # confirm deletion + answer = QtGui.QMessageBox.question(self, + unicode(translate('OpenLP.ThemeManager', '%s Confirmation')) + % action, + unicode(translate('OpenLP.ThemeManager', '%s %s theme?')) + % (action, theme), + QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Yes | + QtGui.QMessageBox.No), QtGui.QMessageBox.No) + if answer == QtGui.QMessageBox.No: + return False + # should be the same unless default + if theme != unicode(item.data(QtCore.Qt.UserRole).toString()): + QtGui.QMessageBox.critical(self, + translate('OpenLP.ThemeManager', 'Error'), + translate('OpenLP.ThemeManager', + 'You are unable to delete the default theme.')) + else: + for plugin in self.parent.pluginManager.plugins: + if plugin.usesTheme(theme): + QtGui.QMessageBox.critical(self, + translate('OpenLP.ThemeManager', 'Error'), + unicode(translate('OpenLP.ThemeManager', + 'Theme %s is used in the %s plugin.')) % \ + (theme, plugin.name)) + return False + if unicode(self.serviceComboBox.currentText()) == theme: + QtGui.QMessageBox.critical(self, + translate('OpenLP.ThemeManager', 'Error'), + unicode(translate('OpenLP.ThemeManager', + 'Theme %s is used by the service manager.')) % theme) + return False + return True From 5dddb3a53df25d137486fce310d053bda599655f Mon Sep 17 00:00:00 2001 From: M2j Date: Wed, 22 Dec 2010 20:03:38 +0100 Subject: [PATCH 3/7] typo --- openlp/plugins/songs/forms/editsongdialog.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/plugins/songs/forms/editsongdialog.py b/openlp/plugins/songs/forms/editsongdialog.py index ffe05553b..66ade5bcd 100644 --- a/openlp/plugins/songs/forms/editsongdialog.py +++ b/openlp/plugins/songs/forms/editsongdialog.py @@ -271,7 +271,7 @@ class Ui_EditSongDialog(object): sizePolicy.setHeightForWidth( self.SongbookCombo.sizePolicy().hasHeightForWidth()) self.SongbookCombo.setEditable(True) - self.SongbookCombe.setInsertPolicy(QtGui.QComboBox.NoInsert) + self.SongbookCombo.setInsertPolicy(QtGui.QComboBox.NoInsert) self.SongbookCombo.setSizePolicy(sizePolicy) self.SongbookCombo.setObjectName(u'SongbookCombo') self.SongbookLayout.addRow(self.SongbookNameLabel, self.SongbookCombo) From 2d0acec7badbe1f6a6ef989317bb131226b2f75f Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Thu, 23 Dec 2010 10:43:00 +0200 Subject: [PATCH 4/7] Fix bug #693694 --- openlp/plugins/remotes/html/openlp.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/openlp/plugins/remotes/html/openlp.js b/openlp/plugins/remotes/html/openlp.js index 03e846376..0c7105a68 100644 --- a/openlp/plugins/remotes/html/openlp.js +++ b/openlp/plugins/remotes/html/openlp.js @@ -206,8 +206,12 @@ OpenLP.Namespace.create("OpenLP.Remote", { }, sendLiveSet: function (e) { - var id = OpenLP.Events.getElement(e).parent().attr("value"); - OpenLP.Remote.sendEvent("slidecontroller_live_set", id); + var tr = OpenLP.Events.getElement(e).parent(); + if (tr[0].tagName != "TR") + { + tr = tr.parent(); + } + OpenLP.Remote.sendEvent("slidecontroller_live_set", tr.attr("value")); return false; }, sendSetItem: function (e) From 085e746b4c5d6d12de5b05a292b489674fdd12a1 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Thu, 23 Dec 2010 10:44:57 +0100 Subject: [PATCH 5/7] fix for bug #598356 --- openlp/core/ui/generaltab.py | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/openlp/core/ui/generaltab.py b/openlp/core/ui/generaltab.py index b8894fe9a..f9b9f71cb 100644 --- a/openlp/core/ui/generaltab.py +++ b/openlp/core/ui/generaltab.py @@ -312,6 +312,18 @@ class GeneralTab(SettingsTab): # Signals and slots QtCore.QObject.connect(self.overrideCheckBox, QtCore.SIGNAL(u'toggled(bool)'), self.onOverrideCheckBoxToggled) + QtCore.QObject.connect(self.customHeightValueEdit, + QtCore.SIGNAL(u'textEdited(const QString&)'), + self.onDisplayPositionChanged) + QtCore.QObject.connect(self.customWidthValueEdit, + QtCore.SIGNAL(u'textEdited(const QString&)'), + self.onDisplayPositionChanged) + QtCore.QObject.connect(self.customYValueEdit, + QtCore.SIGNAL(u'textEdited(const QString&)'), + self.onDisplayPositionChanged) + QtCore.QObject.connect(self.customXValueEdit, + QtCore.SIGNAL(u'textEdited(const QString&)'), + self.onDisplayPositionChanged) def retranslateUi(self): """ @@ -503,10 +515,19 @@ class GeneralTab(SettingsTab): def onOverrideCheckBoxToggled(self, checked): """ - Toggle screen state depending on check box state + Toggle screen state depending on check box state. + + ``checked`` + The state of the check box (boolean). """ self.customXValueEdit.setEnabled(checked) self.customYValueEdit.setEnabled(checked) self.customHeightValueEdit.setEnabled(checked) self.customWidthValueEdit.setEnabled(checked) self.overrideChanged = True + + def onDisplayPositionChanged(self): + """ + Called when the width, height, x position or y position has changed. + """ + self.overrideChanged = True From ad36b2e83f1db22b27adbcce3fd8148e8d675a1f Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Fri, 24 Dec 2010 08:07:26 +0000 Subject: [PATCH 6/7] Theme handling cleanups --- openlp/core/lib/rendermanager.py | 2 +- openlp/core/ui/filerenamedialog.py | 2 -- openlp/core/ui/filerenameform.py | 14 ++++++++++++++ openlp/core/ui/thememanager.py | 26 +++++++++++++------------- 4 files changed, 28 insertions(+), 16 deletions(-) diff --git a/openlp/core/lib/rendermanager.py b/openlp/core/lib/rendermanager.py index fc7ba38b8..f448217ee 100644 --- a/openlp/core/lib/rendermanager.py +++ b/openlp/core/lib/rendermanager.py @@ -214,7 +214,7 @@ class RenderManager(object): if self.force_page: verse = verse + verse + verse else: - self.image_manager.del_image(self.theme_data.theme_name) + self.image_manager.del_image(theme_data.theme_name) footer = [] footer.append(u'Arky Arky (Unknown)' ) footer.append(u'Public Domain') diff --git a/openlp/core/ui/filerenamedialog.py b/openlp/core/ui/filerenamedialog.py index 600027940..8bc804bb3 100644 --- a/openlp/core/ui/filerenamedialog.py +++ b/openlp/core/ui/filerenamedialog.py @@ -53,7 +53,5 @@ class Ui_FileRenameDialog(object): QtCore.QMetaObject.connectSlotsByName(FileRenameDialog) def retranslateUi(self, FileRenameDialog): - FileRenameDialog.setWindowTitle(translate('OpenLP.FileRenameForm', - 'File Rename')) self.fileRenameLabel.setText(translate('OpenLP.FileRenameForm', 'New File Name:')) diff --git a/openlp/core/ui/filerenameform.py b/openlp/core/ui/filerenameform.py index 2a7f7bd7d..422d7ecb8 100644 --- a/openlp/core/ui/filerenameform.py +++ b/openlp/core/ui/filerenameform.py @@ -28,6 +28,8 @@ from PyQt4 import QtCore, QtGui from filerenamedialog import Ui_FileRenameDialog +from openlp.core.lib import translate + class FileRenameForm(QtGui.QDialog, Ui_FileRenameDialog): """ The exception dialog @@ -39,3 +41,15 @@ class FileRenameForm(QtGui.QDialog, Ui_FileRenameDialog): self.accept) QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(u'rejected()'), self.reject) + + def exec_(self, copy=False): + """ + Run the Dialog with correct heading. + """ + if copy: + self.setWindowTitle(translate('OpenLP.FileRenameForm', + 'File Copy')) + else: + self.setWindowTitle(translate('OpenLP.FileRenameForm', + 'File Rename')) + return QtGui.QDialog.exec_(self) diff --git a/openlp/core/ui/thememanager.py b/openlp/core/ui/thememanager.py index 79e4a193c..477b07422 100644 --- a/openlp/core/ui/thememanager.py +++ b/openlp/core/ui/thememanager.py @@ -224,11 +224,11 @@ class ThemeManager(QtGui.QWidget): Renames an existing theme to a new name """ action = unicode(translate('OpenLP.ThemeManager', 'Rename')) - if self._validate_theme_action(action): + if self._validate_theme_action(action, False): item = self.themeListWidget.currentItem() oldThemeName = unicode(item.data(QtCore.Qt.UserRole).toString()) self.fileRenameForm.fileNameEdit.setText(oldThemeName) - self.saveThemeName = u'' + self.saveThemeName = oldThemeName if self.fileRenameForm.exec_(): newThemeName = unicode(self.fileRenameForm.fileNameEdit.text()) oldThemeData = self.getThemeData(oldThemeName) @@ -243,7 +243,7 @@ class ThemeManager(QtGui.QWidget): oldThemeName = unicode(item.data(QtCore.Qt.UserRole).toString()) self.fileRenameForm.fileNameEdit.setText(oldThemeName) self.saveThemeName = u'' - if self.fileRenameForm.exec_(): + if self.fileRenameForm.exec_(True): newThemeName = unicode(self.fileRenameForm.fileNameEdit.text()) themeData = self.getThemeData(oldThemeName) self.cloneThemeData(themeData, newThemeName) @@ -636,7 +636,6 @@ class ThemeManager(QtGui.QWidget): plugin.renameTheme(self.saveThemeName, name) if unicode(self.serviceComboBox.currentText()) == name: editedServiceTheme = True - self.deleteTheme(self.saveThemeName) if result == QtGui.QMessageBox.Yes: # Save the theme, overwriting the existing theme if necessary. if imageTo and self.oldBackgroundImage and \ @@ -751,7 +750,7 @@ class ThemeManager(QtGui.QWidget): theme.extend_image_filename(path) return theme - def _validate_theme_action(self, action): + def _validate_theme_action(self, action, testPlugin=True): """ Check to see if theme has been selected and the destructive action is allowed. @@ -781,14 +780,15 @@ class ThemeManager(QtGui.QWidget): translate('OpenLP.ThemeManager', 'You are unable to delete the default theme.')) else: - for plugin in self.parent.pluginManager.plugins: - if plugin.usesTheme(theme): - QtGui.QMessageBox.critical(self, - translate('OpenLP.ThemeManager', 'Error'), - unicode(translate('OpenLP.ThemeManager', - 'Theme %s is used in the %s plugin.')) % \ - (theme, plugin.name)) - return False + if testPlugin: + for plugin in self.parent.pluginManager.plugins: + if plugin.usesTheme(theme): + QtGui.QMessageBox.critical(self, + translate('OpenLP.ThemeManager', 'Error'), + unicode(translate('OpenLP.ThemeManager', + 'Theme %s is used in the %s plugin.')) % \ + (theme, plugin.name)) + return False if unicode(self.serviceComboBox.currentText()) == theme: QtGui.QMessageBox.critical(self, translate('OpenLP.ThemeManager', 'Error'), From 46f93f1cd5c97419f3f004d3f8eb01e78880cb49 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Fri, 24 Dec 2010 12:36:40 +0000 Subject: [PATCH 7/7] Plugin names are singluar --- openlp/core/ui/pluginform.py | 8 ++++---- openlp/plugins/remotes/remoteplugin.py | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/openlp/core/ui/pluginform.py b/openlp/core/ui/pluginform.py index 3d3a814a0..f3caf67a8 100644 --- a/openlp/core/ui/pluginform.py +++ b/openlp/core/ui/pluginform.py @@ -79,7 +79,7 @@ class PluginForm(QtGui.QDialog, Ui_PluginViewDialog): status_text = unicode( translate('OpenLP.PluginForm', '%s (Disabled)')) name_string = plugin.getString(StringContent.Name) - item.setText(status_text % name_string[u'plural']) + item.setText(status_text % name_string[u'singular']) # If the plugin has an icon, set it! if plugin.icon: item.setIcon(plugin.icon) @@ -107,12 +107,12 @@ class PluginForm(QtGui.QDialog, Ui_PluginViewDialog): if self.pluginListWidget.currentItem() is None: self._clearDetails() return - plugin_name_plural = \ + plugin_name_singular = \ self.pluginListWidget.currentItem().text().split(u' ')[0] self.activePlugin = None for plugin in self.parent.pluginManager.plugins: name_string = plugin.getString(StringContent.Name) - if name_string[u'plural'] == plugin_name_plural: + if name_string[u'singular'] == plugin_name_singular: self.activePlugin = plugin break if self.activePlugin: @@ -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'plural']) + status_text % name_string[u'singular']) diff --git a/openlp/plugins/remotes/remoteplugin.py b/openlp/plugins/remotes/remoteplugin.py index fe2776802..4b6a57cad 100644 --- a/openlp/plugins/remotes/remoteplugin.py +++ b/openlp/plugins/remotes/remoteplugin.py @@ -89,5 +89,5 @@ class RemotesPlugin(Plugin): } ## Name for MediaDockManager, SettingsManager ## self.textStrings[StringContent.VisibleName] = { - u'title': translate('RemotePlugin', 'Remotes') - } \ No newline at end of file + u'title': translate('RemotePlugin', 'Remote') + }