From 3e70173be47f89acf776d65b57585abe216748e8 Mon Sep 17 00:00:00 2001 From: Olli Suutari Date: Sun, 4 Jun 2017 12:52:15 +0300 Subject: [PATCH 01/19] Renamed "last search type" to "last used search type" --- openlp/core/lib/searchedit.py | 4 ++-- openlp/plugins/bibles/bibleplugin.py | 2 +- openlp/plugins/custom/customplugin.py | 2 +- openlp/plugins/songs/songsplugin.py | 2 +- tests/interfaces/openlp_core_lib/test_searchedit.py | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/openlp/core/lib/searchedit.py b/openlp/core/lib/searchedit.py index 52baf0d2c..e2e70a934 100644 --- a/openlp/core/lib/searchedit.py +++ b/openlp/core/lib/searchedit.py @@ -105,7 +105,7 @@ class SearchEdit(QtWidgets.QLineEdit): self.setPlaceholderText(action.placeholder_text) self.menu_button.setDefaultAction(action) self._current_search_type = identifier - Settings().setValue('{section}/last search type'.format(section=self.settings_section), identifier) + Settings().setValue('{section}/last used search type'.format(section=self.settings_section), identifier) self.searchTypeChanged.emit(identifier) return True @@ -141,7 +141,7 @@ class SearchEdit(QtWidgets.QLineEdit): self.menu_button.resize(QtCore.QSize(28, 18)) self.menu_button.setMenu(menu) self.set_current_search_type( - Settings().value('{section}/last search type'.format(section=self.settings_section))) + Settings().value('{section}/last used search type'.format(section=self.settings_section))) self.menu_button.show() self._update_style_sheet() diff --git a/openlp/plugins/bibles/bibleplugin.py b/openlp/plugins/bibles/bibleplugin.py index 8157dc087..3c321329b 100644 --- a/openlp/plugins/bibles/bibleplugin.py +++ b/openlp/plugins/bibles/bibleplugin.py @@ -38,7 +38,7 @@ __default_settings__ = { 'bibles/db password': '', 'bibles/db hostname': '', 'bibles/db database': '', - 'bibles/last search type': BibleSearch.Combined, + 'bibles/last used search type': BibleSearch.Combined, 'bibles/reset to combined quick search': True, 'bibles/verse layout style': LayoutStyle.VersePerSlide, 'bibles/book name language': LanguageSelection.Bible, diff --git a/openlp/plugins/custom/customplugin.py b/openlp/plugins/custom/customplugin.py index b38f52023..652aa8b9a 100644 --- a/openlp/plugins/custom/customplugin.py +++ b/openlp/plugins/custom/customplugin.py @@ -40,7 +40,7 @@ __default_settings__ = { 'custom/db password': '', 'custom/db hostname': '', 'custom/db database': '', - 'custom/last search type': CustomSearch.Titles, + 'custom/last used search type': CustomSearch.Titles, 'custom/display footer': True, 'custom/add custom from service': True } diff --git a/openlp/plugins/songs/songsplugin.py b/openlp/plugins/songs/songsplugin.py index 4494ade49..41655284f 100644 --- a/openlp/plugins/songs/songsplugin.py +++ b/openlp/plugins/songs/songsplugin.py @@ -54,7 +54,7 @@ __default_settings__ = { 'songs/db password': '', 'songs/db hostname': '', 'songs/db database': '', - 'songs/last search type': SongSearch.Entire, + 'songs/last used search type': SongSearch.Entire, 'songs/last import type': SongFormat.OpenLyrics, 'songs/update service on edit': False, 'songs/add song from service': True, diff --git a/tests/interfaces/openlp_core_lib/test_searchedit.py b/tests/interfaces/openlp_core_lib/test_searchedit.py index e2a01a450..4f4c4d68c 100644 --- a/tests/interfaces/openlp_core_lib/test_searchedit.py +++ b/tests/interfaces/openlp_core_lib/test_searchedit.py @@ -88,7 +88,7 @@ class TestSearchEdit(TestCase, TestMixin): # settings self.assertEqual(self.search_edit.current_search_type(), SearchTypes.First, "The first search type should be selected.") - self.mocked_settings().setValue.assert_called_once_with('settings_section/last search type', 0) + self.mocked_settings().setValue.assert_called_once_with('settings_section/last used search type', 0) def test_set_current_search_type(self): """ @@ -105,7 +105,7 @@ class TestSearchEdit(TestCase, TestMixin): self.assertEqual(self.search_edit.placeholderText(), SECOND_PLACEHOLDER_TEXT, "The correct placeholder text should be 'Second Placeholder Text'.") self.mocked_settings().setValue.assert_has_calls( - [call('settings_section/last search type', 0), call('settings_section/last search type', 1)]) + [call('settings_section/last used search type', 0), call('settings_section/last used search type', 1)]) def test_clear_button_visibility(self): """ From 7a27a4adbe84578cdaa594680adc0ba7ffc09884 Mon Sep 17 00:00:00 2001 From: Olli Suutari Date: Sun, 4 Jun 2017 13:13:10 +0300 Subject: [PATCH 02/19] Fixed bug #1678292 --- openlp/plugins/bibles/lib/mediaitem.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/plugins/bibles/lib/mediaitem.py b/openlp/plugins/bibles/lib/mediaitem.py index f0ef34dd6..acc7d1736 100755 --- a/openlp/plugins/bibles/lib/mediaitem.py +++ b/openlp/plugins/bibles/lib/mediaitem.py @@ -414,7 +414,7 @@ class BibleMediaItem(MediaManagerItem): if self.bible: book_data = self.get_common_books(self.bible, self.second_bible) language_selection = self.plugin.manager.get_language_selection(self.bible.name) - books = [book.get_name(language_selection) for book in book_data] + books = [book.get_name(language_selection) + ' ' for book in book_data] books.sort(key=get_locale_key) set_case_insensitive_completer(books, self.search_edit) From c14398b91295ba1b78cc73ad3549fe185c957deb Mon Sep 17 00:00:00 2001 From: Olli Suutari Date: Sun, 4 Jun 2017 13:43:41 +0300 Subject: [PATCH 03/19] Fixed bug: https://bugs.launchpad.net/openlp/+bug/1652559 --- openlp/plugins/songs/forms/duplicatesongremovalform.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/openlp/plugins/songs/forms/duplicatesongremovalform.py b/openlp/plugins/songs/forms/duplicatesongremovalform.py index dbebf19bc..fc3d5b279 100644 --- a/openlp/plugins/songs/forms/duplicatesongremovalform.py +++ b/openlp/plugins/songs/forms/duplicatesongremovalform.py @@ -82,6 +82,9 @@ class DuplicateSongRemovalForm(OpenLPWizard, RegistryProperties): self.finish_button.clicked.connect(self.on_wizard_exit) self.cancel_button.clicked.connect(self.on_wizard_exit) + def closeEvent(self, event): + self.on_wizard_exit() + def add_custom_pages(self): """ Add song wizard specific pages. From 3ae8caceb0271edb37c03846ac8c83ddc30a8590 Mon Sep 17 00:00:00 2001 From: Olli Suutari Date: Sun, 4 Jun 2017 14:19:19 +0300 Subject: [PATCH 04/19] Added "last search type" to obsolete settings list. --- openlp/core/common/settings.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/openlp/core/common/settings.py b/openlp/core/common/settings.py index d931b06df..36f566147 100644 --- a/openlp/core/common/settings.py +++ b/openlp/core/common/settings.py @@ -219,7 +219,11 @@ class Settings(QtCore.QSettings): ('shortcuts/offlineHelpItem', 'shortcuts/userManualItem', []), # Online and Offline help were combined in 2.6. ('shortcuts/onlineHelpItem', 'shortcuts/userManualItem', []), # Online and Offline help were combined in 2.6. ('bibles/advanced bible', '', []), # Common bible search widgets combined in 2.6 - ('bibles/quick bible', 'bibles/primary bible', []) # Common bible search widgets combined in 2.6 + ('bibles/quick bible', 'bibles/primary bible', []), # Common bible search widgets combined in 2.6 + # Last search type was renamed to last used search type in 2.6 since Bible search value type changed in 2.6. + ('songs/last search type', 'songs/last used search type', []), + ('bibles/last search type', 'bibles/last used search type', []), + ('custom/last search type', 'custom/last used search type', []) ] @staticmethod From f8b32578f420c62b320ea49715eaedc91f9d0861 Mon Sep 17 00:00:00 2001 From: Olli Suutari Date: Sun, 4 Jun 2017 15:14:23 +0300 Subject: [PATCH 05/19] Fixed 32 missing "x" buttons for closing windows and forms. (Left it unavailable for bug report.) --- openlp/core/ui/aboutform.py | 3 ++- openlp/core/ui/filerenameform.py | 4 ++-- openlp/core/ui/firsttimelanguageform.py | 3 ++- openlp/core/ui/formattingtagform.py | 3 ++- openlp/core/ui/pluginform.py | 3 ++- openlp/core/ui/printserviceform.py | 4 ++-- openlp/core/ui/projector/editform.py | 3 ++- openlp/core/ui/projector/sourceselectform.py | 6 ++++-- openlp/core/ui/serviceitemeditform.py | 4 ++-- openlp/core/ui/servicenoteform.py | 4 ++-- openlp/core/ui/settingsform.py | 3 ++- openlp/core/ui/shortcutlistform.py | 3 ++- openlp/core/ui/starttimeform.py | 4 ++-- openlp/plugins/alerts/forms/alertform.py | 4 ++-- openlp/plugins/bibles/forms/booknameform.py | 3 ++- openlp/plugins/bibles/forms/editbibleform.py | 3 ++- openlp/plugins/bibles/forms/languageform.py | 3 ++- openlp/plugins/custom/forms/editcustomform.py | 3 ++- openlp/plugins/custom/forms/editcustomslideform.py | 3 ++- openlp/plugins/images/forms/addgroupform.py | 3 ++- openlp/plugins/images/forms/choosegroupform.py | 3 ++- openlp/plugins/media/forms/mediaclipselectorform.py | 3 ++- openlp/plugins/songs/forms/authorsform.py | 3 ++- openlp/plugins/songs/forms/editsongform.py | 3 ++- openlp/plugins/songs/forms/editverseform.py | 3 ++- openlp/plugins/songs/forms/mediafilesform.py | 3 ++- openlp/plugins/songs/forms/songbookform.py | 3 ++- openlp/plugins/songs/forms/songmaintenanceform.py | 3 ++- openlp/plugins/songs/forms/songselectform.py | 3 ++- openlp/plugins/songs/forms/topicsform.py | 3 ++- openlp/plugins/songusage/forms/songusagedeleteform.py | 2 +- openlp/plugins/songusage/forms/songusagedetailform.py | 3 ++- 32 files changed, 65 insertions(+), 39 deletions(-) diff --git a/openlp/core/ui/aboutform.py b/openlp/core/ui/aboutform.py index f4f9b06a0..e1768b127 100644 --- a/openlp/core/ui/aboutform.py +++ b/openlp/core/ui/aboutform.py @@ -40,7 +40,8 @@ class AboutForm(QtWidgets.QDialog, UiAboutDialog): """ Do some initialisation stuff """ - super(AboutForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint) + super(AboutForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint | + QtCore.Qt.WindowCloseButtonHint) self._setup() def _setup(self): diff --git a/openlp/core/ui/filerenameform.py b/openlp/core/ui/filerenameform.py index 0fb9c8668..2314fda43 100644 --- a/openlp/core/ui/filerenameform.py +++ b/openlp/core/ui/filerenameform.py @@ -38,8 +38,8 @@ class FileRenameForm(QtWidgets.QDialog, Ui_FileRenameDialog, RegistryProperties) """ Constructor """ - super(FileRenameForm, self).__init__(Registry().get('main_window'), - QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint) + super(FileRenameForm, self).__init__(Registry().get('main_window'), QtCore.Qt.WindowSystemMenuHint | + QtCore.Qt.WindowTitleHint | QtCore.Qt.WindowCloseButtonHint) self._setup() def _setup(self): diff --git a/openlp/core/ui/firsttimelanguageform.py b/openlp/core/ui/firsttimelanguageform.py index 9e9d664ca..f4b73390b 100644 --- a/openlp/core/ui/firsttimelanguageform.py +++ b/openlp/core/ui/firsttimelanguageform.py @@ -37,7 +37,8 @@ class FirstTimeLanguageForm(QtWidgets.QDialog, Ui_FirstTimeLanguageDialog): """ Constructor """ - super(FirstTimeLanguageForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint) + super(FirstTimeLanguageForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint + | QtCore.Qt.WindowCloseButtonHint) self.setupUi(self) self.qm_list = LanguageManager.get_qm_list() self.language_combo_box.addItem('Autodetect') diff --git a/openlp/core/ui/formattingtagform.py b/openlp/core/ui/formattingtagform.py index 1aeda9bc3..f05f42187 100644 --- a/openlp/core/ui/formattingtagform.py +++ b/openlp/core/ui/formattingtagform.py @@ -51,7 +51,8 @@ class FormattingTagForm(QtWidgets.QDialog, Ui_FormattingTagDialog, FormattingTag """ Constructor """ - super(FormattingTagForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint) + super(FormattingTagForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint | + QtCore.Qt.WindowCloseButtonHint) self.setupUi(self) self._setup() diff --git a/openlp/core/ui/pluginform.py b/openlp/core/ui/pluginform.py index 69b96a7ac..974cccfd4 100644 --- a/openlp/core/ui/pluginform.py +++ b/openlp/core/ui/pluginform.py @@ -41,7 +41,8 @@ class PluginForm(QtWidgets.QDialog, Ui_PluginViewDialog, RegistryProperties): """ Constructor """ - super(PluginForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint) + super(PluginForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint | + QtCore.Qt.WindowCloseButtonHint) self.active_plugin = None self.programatic_change = False self.setupUi(self) diff --git a/openlp/core/ui/printserviceform.py b/openlp/core/ui/printserviceform.py index 7b3d80c8b..5a26a001d 100644 --- a/openlp/core/ui/printserviceform.py +++ b/openlp/core/ui/printserviceform.py @@ -125,8 +125,8 @@ class PrintServiceForm(QtWidgets.QDialog, Ui_PrintServiceDialog, RegistryPropert """ Constructor """ - super(PrintServiceForm, self).__init__(Registry().get('main_window'), - QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint) + super(PrintServiceForm, self).__init__(Registry().get('main_window'), QtCore.Qt.WindowSystemMenuHint | + QtCore.Qt.WindowTitleHint | QtCore.Qt.WindowCloseButtonHint) self.printer = QtPrintSupport.QPrinter() self.print_dialog = QtPrintSupport.QPrintDialog(self.printer, self) self.document = QtGui.QTextDocument() diff --git a/openlp/core/ui/projector/editform.py b/openlp/core/ui/projector/editform.py index eec7a19de..6a6f0a362 100644 --- a/openlp/core/ui/projector/editform.py +++ b/openlp/core/ui/projector/editform.py @@ -142,7 +142,8 @@ class ProjectorEditForm(QtWidgets.QDialog, Ui_ProjectorEditForm): editProjector = QtCore.pyqtSignal(object) def __init__(self, parent=None, projectordb=None): - super(ProjectorEditForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint) + super(ProjectorEditForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint | + QtCore.Qt.WindowCloseButtonHint) self.projectordb = projectordb self.setupUi(self) self.button_box.accepted.connect(self.accept_me) diff --git a/openlp/core/ui/projector/sourceselectform.py b/openlp/core/ui/projector/sourceselectform.py index c9fe4e1f1..1d17c07cd 100644 --- a/openlp/core/ui/projector/sourceselectform.py +++ b/openlp/core/ui/projector/sourceselectform.py @@ -233,7 +233,8 @@ class SourceSelectTabs(QtWidgets.QDialog): :param projectordb: ProjectorDB session to use """ log.debug('Initializing SourceSelectTabs()') - super(SourceSelectTabs, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint) + super(SourceSelectTabs, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint | + QtCore.Qt.WindowCloseButtonHint) self.setMinimumWidth(350) self.projectordb = projectordb self.edit = edit @@ -388,7 +389,8 @@ class SourceSelectSingle(QtWidgets.QDialog): """ log.debug('Initializing SourceSelectSingle()') self.projectordb = projectordb - super(SourceSelectSingle, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint) + super(SourceSelectSingle, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint | + QtCore.Qt.WindowCloseButtonHint) self.edit = edit if self.edit: title = translate('OpenLP.SourceSelectForm', 'Edit Projector Source Text') diff --git a/openlp/core/ui/serviceitemeditform.py b/openlp/core/ui/serviceitemeditform.py index dead6160a..f23956e70 100644 --- a/openlp/core/ui/serviceitemeditform.py +++ b/openlp/core/ui/serviceitemeditform.py @@ -37,8 +37,8 @@ class ServiceItemEditForm(QtWidgets.QDialog, Ui_ServiceItemEditDialog, RegistryP """ Constructor """ - super(ServiceItemEditForm, self).__init__(Registry().get('main_window'), - QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint) + super(ServiceItemEditForm, self).__init__(Registry().get('main_window'), QtCore.Qt.WindowSystemMenuHint | + QtCore.Qt.WindowTitleHint | QtCore.Qt.WindowCloseButtonHint) self.setupUi(self) self.item_list = [] self.list_widget.currentRowChanged.connect(self.on_current_row_changed) diff --git a/openlp/core/ui/servicenoteform.py b/openlp/core/ui/servicenoteform.py index dd1f42674..fc4da438a 100644 --- a/openlp/core/ui/servicenoteform.py +++ b/openlp/core/ui/servicenoteform.py @@ -37,8 +37,8 @@ class ServiceNoteForm(QtWidgets.QDialog, RegistryProperties): """ Constructor """ - super(ServiceNoteForm, self).__init__(Registry().get('main_window'), - QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint) + super(ServiceNoteForm, self).__init__(Registry().get('main_window'), QtCore.Qt.WindowSystemMenuHint | + QtCore.Qt.WindowTitleHint | QtCore.Qt.WindowCloseButtonHint) self.setupUi() self.retranslateUi() diff --git a/openlp/core/ui/settingsform.py b/openlp/core/ui/settingsform.py index 119fd875f..906a7c97f 100644 --- a/openlp/core/ui/settingsform.py +++ b/openlp/core/ui/settingsform.py @@ -46,7 +46,8 @@ class SettingsForm(QtWidgets.QDialog, Ui_SettingsDialog, RegistryProperties): """ Registry().register('settings_form', self) Registry().register_function('bootstrap_post_set_up', self.bootstrap_post_set_up) - super(SettingsForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint) + super(SettingsForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint | + QtCore.Qt.WindowCloseButtonHint) self.processes = [] self.setupUi(self) self.setting_list_widget.currentRowChanged.connect(self.list_item_changed) diff --git a/openlp/core/ui/shortcutlistform.py b/openlp/core/ui/shortcutlistform.py index a42600193..378d339a1 100644 --- a/openlp/core/ui/shortcutlistform.py +++ b/openlp/core/ui/shortcutlistform.py @@ -44,7 +44,8 @@ class ShortcutListForm(QtWidgets.QDialog, Ui_ShortcutListDialog, RegistryPropert """ Constructor """ - super(ShortcutListForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint) + super(ShortcutListForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint | + QtCore.Qt.WindowCloseButtonHint) self.setupUi(self) self.changed_actions = {} self.action_list = ActionList.get_instance() diff --git a/openlp/core/ui/starttimeform.py b/openlp/core/ui/starttimeform.py index 1b453a9c2..ae82d4c9e 100644 --- a/openlp/core/ui/starttimeform.py +++ b/openlp/core/ui/starttimeform.py @@ -38,8 +38,8 @@ class StartTimeForm(QtWidgets.QDialog, Ui_StartTimeDialog, RegistryProperties): """ Constructor """ - super(StartTimeForm, self).__init__(Registry().get('main_window'), - QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint) + super(StartTimeForm, self).__init__(Registry().get('main_window'), QtCore.Qt.WindowSystemMenuHint | + QtCore.Qt.WindowTitleHint | QtCore.Qt.WindowCloseButtonHint) self.setupUi(self) def exec(self): diff --git a/openlp/plugins/alerts/forms/alertform.py b/openlp/plugins/alerts/forms/alertform.py index 88f44210e..ebdaf95ef 100644 --- a/openlp/plugins/alerts/forms/alertform.py +++ b/openlp/plugins/alerts/forms/alertform.py @@ -36,8 +36,8 @@ class AlertForm(QtWidgets.QDialog, Ui_AlertDialog): """ Initialise the alert form """ - super(AlertForm, self).__init__(Registry().get('main_window'), - QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint) + super(AlertForm, self).__init__(Registry().get('main_window'), QtCore.Qt.WindowSystemMenuHint | + QtCore.Qt.WindowTitleHint | QtCore.Qt.WindowCloseButtonHint) self.manager = plugin.manager self.plugin = plugin self.item_id = None diff --git a/openlp/plugins/bibles/forms/booknameform.py b/openlp/plugins/bibles/forms/booknameform.py index 0a2411131..588ba96d4 100644 --- a/openlp/plugins/bibles/forms/booknameform.py +++ b/openlp/plugins/bibles/forms/booknameform.py @@ -49,7 +49,8 @@ class BookNameForm(QDialog, Ui_BookNameDialog): """ Constructor """ - super(BookNameForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint) + super(BookNameForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint | + QtCore.Qt.WindowCloseButtonHint) self.setupUi(self) self.custom_signals() self.book_names = BibleStrings().BookNames diff --git a/openlp/plugins/bibles/forms/editbibleform.py b/openlp/plugins/bibles/forms/editbibleform.py index c0570e772..543531c2d 100644 --- a/openlp/plugins/bibles/forms/editbibleform.py +++ b/openlp/plugins/bibles/forms/editbibleform.py @@ -45,7 +45,8 @@ class EditBibleForm(QtWidgets.QDialog, Ui_EditBibleDialog, RegistryProperties): """ Constructor """ - super(EditBibleForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint) + super(EditBibleForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint | + QtCore.Qt.WindowCloseButtonHint) self.media_item = media_item self.book_names = BibleStrings().BookNames self.setupUi(self) diff --git a/openlp/plugins/bibles/forms/languageform.py b/openlp/plugins/bibles/forms/languageform.py index 46571e262..6494950c8 100644 --- a/openlp/plugins/bibles/forms/languageform.py +++ b/openlp/plugins/bibles/forms/languageform.py @@ -47,7 +47,8 @@ class LanguageForm(QDialog, Ui_LanguageDialog): """ Constructor """ - super(LanguageForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint) + super(LanguageForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint | + QtCore.Qt.WindowCloseButtonHint) self.setupUi(self) def exec(self, bible_name): diff --git a/openlp/plugins/custom/forms/editcustomform.py b/openlp/plugins/custom/forms/editcustomform.py index 993acc688..1bd2187f2 100644 --- a/openlp/plugins/custom/forms/editcustomform.py +++ b/openlp/plugins/custom/forms/editcustomform.py @@ -44,7 +44,8 @@ class EditCustomForm(QtWidgets.QDialog, Ui_CustomEditDialog): """ Constructor """ - super(EditCustomForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint) + super(EditCustomForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint | + QtCore.Qt.WindowCloseButtonHint) self.manager = manager self.media_item = media_item self.setupUi(self) diff --git a/openlp/plugins/custom/forms/editcustomslideform.py b/openlp/plugins/custom/forms/editcustomslideform.py index b3c77e859..77f086dbb 100644 --- a/openlp/plugins/custom/forms/editcustomslideform.py +++ b/openlp/plugins/custom/forms/editcustomslideform.py @@ -39,7 +39,8 @@ class EditCustomSlideForm(QtWidgets.QDialog, Ui_CustomSlideEditDialog): """ Constructor """ - super(EditCustomSlideForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint) + super(EditCustomSlideForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint | + QtCore.Qt.WindowCloseButtonHint) self.setupUi(self) # Connecting signals and slots self.insert_button.clicked.connect(self.on_insert_button_clicked) diff --git a/openlp/plugins/images/forms/addgroupform.py b/openlp/plugins/images/forms/addgroupform.py index 3ea91c29e..953d02339 100644 --- a/openlp/plugins/images/forms/addgroupform.py +++ b/openlp/plugins/images/forms/addgroupform.py @@ -35,7 +35,8 @@ class AddGroupForm(QtWidgets.QDialog, Ui_AddGroupDialog): """ Constructor """ - super(AddGroupForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint) + super(AddGroupForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint | + QtCore.Qt.WindowCloseButtonHint) self.setupUi(self) def exec(self, clear=True, show_top_level_group=False, selected_group=None): diff --git a/openlp/plugins/images/forms/choosegroupform.py b/openlp/plugins/images/forms/choosegroupform.py index 88f4e72de..5867481b9 100644 --- a/openlp/plugins/images/forms/choosegroupform.py +++ b/openlp/plugins/images/forms/choosegroupform.py @@ -33,7 +33,8 @@ class ChooseGroupForm(QtWidgets.QDialog, Ui_ChooseGroupDialog): """ Constructor """ - super(ChooseGroupForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint) + super(ChooseGroupForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint | + QtCore.Qt.WindowCloseButtonHint) self.setupUi(self) def exec(self, selected_group=None): diff --git a/openlp/plugins/media/forms/mediaclipselectorform.py b/openlp/plugins/media/forms/mediaclipselectorform.py index c02e79232..135c50a89 100644 --- a/openlp/plugins/media/forms/mediaclipselectorform.py +++ b/openlp/plugins/media/forms/mediaclipselectorform.py @@ -52,7 +52,8 @@ class MediaClipSelectorForm(QtWidgets.QDialog, Ui_MediaClipSelector, RegistryPro """ Constructor """ - super(MediaClipSelectorForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint) + super(MediaClipSelectorForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint + | QtCore.Qt.WindowCloseButtonHint) self.vlc_instance = None self.vlc_media_player = None self.vlc_media = None diff --git a/openlp/plugins/songs/forms/authorsform.py b/openlp/plugins/songs/forms/authorsform.py index bec967561..84e0343e9 100644 --- a/openlp/plugins/songs/forms/authorsform.py +++ b/openlp/plugins/songs/forms/authorsform.py @@ -35,7 +35,8 @@ class AuthorsForm(QtWidgets.QDialog, Ui_AuthorsDialog): """ Set up the screen and common data """ - super(AuthorsForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint) + super(AuthorsForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint | + QtCore.Qt.WindowCloseButtonHint) self.setupUi(self) self.auto_display_name = False self.first_name_edit.textEdited.connect(self.on_first_name_edited) diff --git a/openlp/plugins/songs/forms/editsongform.py b/openlp/plugins/songs/forms/editsongform.py index d7f614245..f4e9352aa 100644 --- a/openlp/plugins/songs/forms/editsongform.py +++ b/openlp/plugins/songs/forms/editsongform.py @@ -56,7 +56,8 @@ class EditSongForm(QtWidgets.QDialog, Ui_EditSongDialog, RegistryProperties): """ Constructor """ - super(EditSongForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint) + super(EditSongForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint | + QtCore.Qt.WindowCloseButtonHint) self.media_item = media_item self.song = None # can this be automated? diff --git a/openlp/plugins/songs/forms/editverseform.py b/openlp/plugins/songs/forms/editverseform.py index f033f47d9..1e36df1e4 100644 --- a/openlp/plugins/songs/forms/editverseform.py +++ b/openlp/plugins/songs/forms/editverseform.py @@ -43,7 +43,8 @@ class EditVerseForm(QtWidgets.QDialog, Ui_EditVerseDialog): """ Constructor """ - super(EditVerseForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint) + super(EditVerseForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint | + QtCore.Qt.WindowCloseButtonHint) self.setupUi(self) self.has_single_verse = False self.insert_button.clicked.connect(self.on_insert_button_clicked) diff --git a/openlp/plugins/songs/forms/mediafilesform.py b/openlp/plugins/songs/forms/mediafilesform.py index 0839b273e..10e9334f7 100644 --- a/openlp/plugins/songs/forms/mediafilesform.py +++ b/openlp/plugins/songs/forms/mediafilesform.py @@ -37,7 +37,8 @@ class MediaFilesForm(QtWidgets.QDialog, Ui_MediaFilesDialog): log.info('{name} MediaFilesForm loaded'.format(name=__name__)) def __init__(self, parent): - super(MediaFilesForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint) + super(MediaFilesForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint | + QtCore.Qt.WindowCloseButtonHint) self.setupUi(self) def populate_files(self, files): diff --git a/openlp/plugins/songs/forms/songbookform.py b/openlp/plugins/songs/forms/songbookform.py index 132611d65..fc1b87c09 100644 --- a/openlp/plugins/songs/forms/songbookform.py +++ b/openlp/plugins/songs/forms/songbookform.py @@ -38,7 +38,8 @@ class SongBookForm(QtWidgets.QDialog, Ui_SongBookDialog): """ Constructor """ - super(SongBookForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint) + super(SongBookForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint | + QtCore.Qt.WindowCloseButtonHint) self.setupUi(self) def exec(self, clear=True): diff --git a/openlp/plugins/songs/forms/songmaintenanceform.py b/openlp/plugins/songs/forms/songmaintenanceform.py index a29c048e2..766231712 100644 --- a/openlp/plugins/songs/forms/songmaintenanceform.py +++ b/openlp/plugins/songs/forms/songmaintenanceform.py @@ -44,7 +44,8 @@ class SongMaintenanceForm(QtWidgets.QDialog, Ui_SongMaintenanceDialog, RegistryP """ Constructor """ - super(SongMaintenanceForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint) + super(SongMaintenanceForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint | + QtCore.Qt.WindowCloseButtonHint) self.setupUi(self) self.manager = manager self.author_form = AuthorsForm(self) diff --git a/openlp/plugins/songs/forms/songselectform.py b/openlp/plugins/songs/forms/songselectform.py index 1169cb672..d7b21e9d1 100644 --- a/openlp/plugins/songs/forms/songselectform.py +++ b/openlp/plugins/songs/forms/songselectform.py @@ -81,7 +81,8 @@ class SongSelectForm(QtWidgets.QDialog, Ui_SongSelectDialog): """ def __init__(self, parent=None, plugin=None, db_manager=None): - QtWidgets.QDialog.__init__(self, parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint) + QtWidgets.QDialog.__init__(self, parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint | + QtCore.Qt.WindowCloseButtonHint) self.plugin = plugin self.db_manager = db_manager self.setup_ui(self) diff --git a/openlp/plugins/songs/forms/topicsform.py b/openlp/plugins/songs/forms/topicsform.py index a811b277a..f0c7f0ab1 100644 --- a/openlp/plugins/songs/forms/topicsform.py +++ b/openlp/plugins/songs/forms/topicsform.py @@ -38,7 +38,8 @@ class TopicsForm(QtWidgets.QDialog, Ui_TopicsDialog): """ Constructor """ - super(TopicsForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint) + super(TopicsForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint | + QtCore.Qt.WindowCloseButtonHint) self.setupUi(self) def exec(self, clear=True): diff --git a/openlp/plugins/songusage/forms/songusagedeleteform.py b/openlp/plugins/songusage/forms/songusagedeleteform.py index 108ccb438..a41bb7679 100644 --- a/openlp/plugins/songusage/forms/songusagedeleteform.py +++ b/openlp/plugins/songusage/forms/songusagedeleteform.py @@ -37,7 +37,7 @@ class SongUsageDeleteForm(QtWidgets.QDialog, Ui_SongUsageDeleteDialog, RegistryP """ self.manager = manager super(SongUsageDeleteForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | - QtCore.Qt.WindowTitleHint) + QtCore.Qt.WindowTitleHint | QtCore.Qt.WindowCloseButtonHint) self.setupUi(self) self.button_box.clicked.connect(self.on_button_box_clicked) diff --git a/openlp/plugins/songusage/forms/songusagedetailform.py b/openlp/plugins/songusage/forms/songusagedetailform.py index 8a270598e..172cca6b1 100644 --- a/openlp/plugins/songusage/forms/songusagedetailform.py +++ b/openlp/plugins/songusage/forms/songusagedetailform.py @@ -44,7 +44,8 @@ class SongUsageDetailForm(QtWidgets.QDialog, Ui_SongUsageDetailDialog, RegistryP """ Initialise the form """ - super(SongUsageDetailForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint) + super(SongUsageDetailForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint | + QtCore.Qt.WindowCloseButtonHint) self.plugin = plugin self.setupUi(self) From c135028b4664768bdaa8e2a433f2524ecb015a8c Mon Sep 17 00:00:00 2001 From: Olli Suutari Date: Sun, 4 Jun 2017 15:26:50 +0300 Subject: [PATCH 06/19] Fixed bug https://bugs.launchpad.net/openlp/+bug/1666272 By renaming: self.playerlist.next() to self.playlist.next() in maindisplay.py derf next(self) --- openlp/core/ui/maindisplay.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index a40ade826..23151395c 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -689,7 +689,7 @@ class AudioPlayer(OpenLPMixin, QtCore.QObject): """ Skip forward to the next track in the list """ - self.playerlist.next() + self.playlist.next() def go_to(self, index): """ From 731ce0c338df38dfeebac970cc6057bdfc2b4e74 Mon Sep 17 00:00:00 2001 From: Olli Suutari Date: Sun, 4 Jun 2017 16:20:59 +0300 Subject: [PATCH 07/19] Increased the size of the songmaintancedialogue form for better visual user interface. --- openlp/plugins/songs/forms/songmaintenancedialog.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/plugins/songs/forms/songmaintenancedialog.py b/openlp/plugins/songs/forms/songmaintenancedialog.py index 2ed284298..be226f55e 100644 --- a/openlp/plugins/songs/forms/songmaintenancedialog.py +++ b/openlp/plugins/songs/forms/songmaintenancedialog.py @@ -39,7 +39,7 @@ class Ui_SongMaintenanceDialog(object): song_maintenance_dialog.setObjectName('song_maintenance_dialog') song_maintenance_dialog.setWindowIcon(build_icon(':/icon/openlp-logo.svg')) song_maintenance_dialog.setWindowModality(QtCore.Qt.ApplicationModal) - song_maintenance_dialog.resize(10, 350) + song_maintenance_dialog.resize(600, 600) self.dialog_layout = QtWidgets.QGridLayout(song_maintenance_dialog) self.dialog_layout.setObjectName('dialog_layout') self.type_list_widget = QtWidgets.QListWidget(song_maintenance_dialog) From d247cf2388c7077f10850d21bc1af1fd9015883f Mon Sep 17 00:00:00 2001 From: Olli Suutari Date: Sun, 4 Jun 2017 17:03:41 +0300 Subject: [PATCH 08/19] Fixed bug: https://bugs.launchpad.net/openlp/+bug/1694732 --- openlp/core/lib/ui.py | 1 + openlp/core/ui/lib/wizard.py | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/openlp/core/lib/ui.py b/openlp/core/lib/ui.py index 8cd68384f..fe67c53ba 100644 --- a/openlp/core/lib/ui.py +++ b/openlp/core/lib/ui.py @@ -49,6 +49,7 @@ def add_welcome_page(parent, image): parent.title_label = QtWidgets.QLabel(parent.welcome_page) parent.title_label.setObjectName('title_label') parent.welcome_layout.addWidget(parent.title_label) + parent.title_label.setWordWrap(True) parent.welcome_layout.addSpacing(40) parent.information_label = QtWidgets.QLabel(parent.welcome_page) parent.information_label.setWordWrap(True) diff --git a/openlp/core/ui/lib/wizard.py b/openlp/core/ui/lib/wizard.py index 088bc3c1f..c62a65cc7 100644 --- a/openlp/core/ui/lib/wizard.py +++ b/openlp/core/ui/lib/wizard.py @@ -25,7 +25,7 @@ The :mod:``wizard`` module provides generic wizard tools for OpenLP. import logging import os -from PyQt5 import QtGui, QtWidgets +from PyQt5 import QtCore, QtGui, QtWidgets from openlp.core.common import Registry, RegistryProperties, Settings, UiStrings, translate, is_macosx from openlp.core.lib import build_icon @@ -93,7 +93,10 @@ class OpenLPWizard(QtWidgets.QWizard, RegistryProperties): """ Constructor """ - super(OpenLPWizard, self).__init__(parent) + # QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint remove the "?" buttons from windows, + # QtCore.Qt.WindowCloseButtonHint enables the "x" button to close these windows. + super(OpenLPWizard, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint | + QtCore.Qt.WindowCloseButtonHint) self.plugin = plugin self.with_progress_page = add_progress_page self.setFixedWidth(640) From 89856d78b2785e803a2c8de23ca2d8d9a00c161a Mon Sep 17 00:00:00 2001 From: Olli Suutari Date: Sun, 4 Jun 2017 17:30:10 +0300 Subject: [PATCH 09/19] two pep8 fixes --- openlp/core/ui/firsttimelanguageform.py | 4 ++-- openlp/plugins/media/forms/mediaclipselectorform.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/openlp/core/ui/firsttimelanguageform.py b/openlp/core/ui/firsttimelanguageform.py index f4b73390b..bfe593b83 100644 --- a/openlp/core/ui/firsttimelanguageform.py +++ b/openlp/core/ui/firsttimelanguageform.py @@ -37,8 +37,8 @@ class FirstTimeLanguageForm(QtWidgets.QDialog, Ui_FirstTimeLanguageDialog): """ Constructor """ - super(FirstTimeLanguageForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint - | QtCore.Qt.WindowCloseButtonHint) + super(FirstTimeLanguageForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | + QtCore.Qt.WindowTitleHint | QtCore.Qt.WindowCloseButtonHint) self.setupUi(self) self.qm_list = LanguageManager.get_qm_list() self.language_combo_box.addItem('Autodetect') diff --git a/openlp/plugins/media/forms/mediaclipselectorform.py b/openlp/plugins/media/forms/mediaclipselectorform.py index 135c50a89..66ccaca9b 100644 --- a/openlp/plugins/media/forms/mediaclipselectorform.py +++ b/openlp/plugins/media/forms/mediaclipselectorform.py @@ -52,8 +52,8 @@ class MediaClipSelectorForm(QtWidgets.QDialog, Ui_MediaClipSelector, RegistryPro """ Constructor """ - super(MediaClipSelectorForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint - | QtCore.Qt.WindowCloseButtonHint) + super(MediaClipSelectorForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | + QtCore.Qt.WindowTitleHint | QtCore.Qt.WindowCloseButtonHint) self.vlc_instance = None self.vlc_media_player = None self.vlc_media = None From 5270b1a716bb915e476ae34c79d92b2a45e95c33 Mon Sep 17 00:00:00 2001 From: Olli Suutari Date: Sun, 4 Jun 2017 17:46:04 +0300 Subject: [PATCH 10/19] Fixed the new trailing space added by previous pep fix --- openlp/plugins/media/forms/mediaclipselectorform.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/plugins/media/forms/mediaclipselectorform.py b/openlp/plugins/media/forms/mediaclipselectorform.py index 66ccaca9b..d6e6fd352 100644 --- a/openlp/plugins/media/forms/mediaclipselectorform.py +++ b/openlp/plugins/media/forms/mediaclipselectorform.py @@ -52,7 +52,7 @@ class MediaClipSelectorForm(QtWidgets.QDialog, Ui_MediaClipSelector, RegistryPro """ Constructor """ - super(MediaClipSelectorForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | + super(MediaClipSelectorForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint | QtCore.Qt.WindowCloseButtonHint) self.vlc_instance = None self.vlc_media_player = None From 3918027ff11107dedb6d072817dbe17879644348 Mon Sep 17 00:00:00 2001 From: Olli Suutari Date: Sun, 4 Jun 2017 18:21:25 +0300 Subject: [PATCH 11/19] - Fixed 2 tests --- tests/functional/openlp_plugins/bibles/test_mediaitem.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/functional/openlp_plugins/bibles/test_mediaitem.py b/tests/functional/openlp_plugins/bibles/test_mediaitem.py index f9c5f64d0..d1ecba0a9 100755 --- a/tests/functional/openlp_plugins/bibles/test_mediaitem.py +++ b/tests/functional/openlp_plugins/bibles/test_mediaitem.py @@ -480,9 +480,9 @@ class TestMediaItem(TestCase, TestMixin): # WHEN: Calling update_auto_completer self.media_item.update_auto_completer() - # THEN: set_case_insensitive_completer should have been called with the names of the books in order + # THEN: set_case_insensitive_completer should have been called with the names of the books + space in order mocked_set_case_insensitive_completer.assert_called_once_with( - ['Book 1', 'Book 2', 'Book 3'], mocked_search_edit) + ['Book 1 ', 'Book 2 ', 'Book 3 '], mocked_search_edit) def test_update_auto_completer_search_combined_type(self): """ @@ -500,9 +500,9 @@ class TestMediaItem(TestCase, TestMixin): # WHEN: Calling update_auto_completer self.media_item.update_auto_completer() - # THEN: set_case_insensitive_completer should have been called with the names of the books in order + # THEN: set_case_insensitive_completer should have been called with the names of the books + space in order mocked_set_case_insensitive_completer.assert_called_once_with( - ['Book 1', 'Book 2', 'Book 3'], mocked_search_edit) + ['Book 1 ', 'Book 2 ', 'Book 3 '], mocked_search_edit) def test_on_import_click_no_import_wizzard_attr(self): """ From 191f9c64d882bacfa164c0dc0e7948104a32c51c Mon Sep 17 00:00:00 2001 From: Olli Suutari Date: Sun, 4 Jun 2017 18:22:23 +0300 Subject: [PATCH 12/19] Renamed test: def test_on_import_click_no_import_wizzard_attr(self): to: def test_on_import_click_no_import_wizard_attr(self): --- tests/functional/openlp_plugins/bibles/test_mediaitem.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/functional/openlp_plugins/bibles/test_mediaitem.py b/tests/functional/openlp_plugins/bibles/test_mediaitem.py index d1ecba0a9..c197e6cda 100755 --- a/tests/functional/openlp_plugins/bibles/test_mediaitem.py +++ b/tests/functional/openlp_plugins/bibles/test_mediaitem.py @@ -504,7 +504,7 @@ class TestMediaItem(TestCase, TestMixin): mocked_set_case_insensitive_completer.assert_called_once_with( ['Book 1 ', 'Book 2 ', 'Book 3 '], mocked_search_edit) - def test_on_import_click_no_import_wizzard_attr(self): + def test_on_import_click_no_import_wizard_attr(self): """ Test on_import_click when media_item does not have the `import_wizard` attribute. And the wizard was canceled. """ From 8f5b28026a7c4e2f6542407d6967ef86fedfe172 Mon Sep 17 00:00:00 2001 From: Olli Suutari Date: Sun, 4 Jun 2017 18:23:30 +0300 Subject: [PATCH 13/19] Renamed another wizzard test + comment. --- tests/functional/openlp_plugins/bibles/test_mediaitem.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/functional/openlp_plugins/bibles/test_mediaitem.py b/tests/functional/openlp_plugins/bibles/test_mediaitem.py index c197e6cda..ee54a23bc 100755 --- a/tests/functional/openlp_plugins/bibles/test_mediaitem.py +++ b/tests/functional/openlp_plugins/bibles/test_mediaitem.py @@ -521,9 +521,9 @@ class TestMediaItem(TestCase, TestMixin): self.assertTrue(mocked_bible_import_form.called) self.assertFalse(mocked_reload_bibles.called) - def test_on_import_click_wizzard_not_canceled(self): + def test_on_import_click_wizard_not_canceled(self): """ - Test on_import_click when the media item has the import_wizzard attr set and wizard completes sucessfully. + Test on_import_click when the media item has the import_wizard attr set and wizard completes sucessfully. """ # GIVEN: An instance of :class:`MediaManagerItem` and a mocked import_wizard mocked_import_wizard = MagicMock(**{'exec.return_value': True}) From dd603f6486c51bf4b747e08c4ab53c73bd82b517 Mon Sep 17 00:00:00 2001 From: Olli Suutari Date: Sun, 4 Jun 2017 23:40:18 +0300 Subject: [PATCH 14/19] Fixed the issue where books with "." can't be used in reference search. --- openlp/plugins/bibles/lib/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openlp/plugins/bibles/lib/__init__.py b/openlp/plugins/bibles/lib/__init__.py index e4025411c..14db1e711 100644 --- a/openlp/plugins/bibles/lib/__init__.py +++ b/openlp/plugins/bibles/lib/__init__.py @@ -230,7 +230,7 @@ def update_reference_separators(): REFERENCE_MATCHES['range_separator'] = re.compile(REFERENCE_SEPARATORS['sep_l'], re.UNICODE) # full reference match: ((,(?!$)|(?=$)))+ REFERENCE_MATCHES['full'] = \ - re.compile('^\s*(?!\s)(?P[\d]*[^\d\.]+)\.*(?[\d]*[^\d]+)(?(?:%(range_regex)s(?:%(sep_l)s(?!\s*$)|(?=\s*$)))+)\s*$' % dict(list(REFERENCE_SEPARATORS.items()) + [('range_regex', range_regex)]), re.UNICODE) @@ -326,7 +326,7 @@ def parse_reference(reference, bible, language_selection, book_ref_id=False): ``^\s*(?!\s)(?P[\d]*[^\d]+)(?(?:%(range_regex)s(?:%(sep_l)s(?!\s*$)|(?=\s*$)))+)\s*$`` The second group contains all ``ranges``. This can be multiple declarations of range_regex separated by a list From dae544abc1cf3f959f0e0bf1787345c31ca55b94 Mon Sep 17 00:00:00 2001 From: Olli Suutari Date: Mon, 5 Jun 2017 00:22:13 +0300 Subject: [PATCH 15/19] Improved the regex to check dot after book number and after book name. --- openlp/plugins/bibles/lib/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/plugins/bibles/lib/__init__.py b/openlp/plugins/bibles/lib/__init__.py index 14db1e711..898dbac1c 100644 --- a/openlp/plugins/bibles/lib/__init__.py +++ b/openlp/plugins/bibles/lib/__init__.py @@ -230,7 +230,7 @@ def update_reference_separators(): REFERENCE_MATCHES['range_separator'] = re.compile(REFERENCE_SEPARATORS['sep_l'], re.UNICODE) # full reference match: ((,(?!$)|(?=$)))+ REFERENCE_MATCHES['full'] = \ - re.compile('^\s*(?!\s)(?P[\d]*[^\d]+)(?[\d]*[.]?[^\d\.]+)\.*(?(?:%(range_regex)s(?:%(sep_l)s(?!\s*$)|(?=\s*$)))+)\s*$' % dict(list(REFERENCE_SEPARATORS.items()) + [('range_regex', range_regex)]), re.UNICODE) From db86f45bd7c2a650c1a9546eeb762b0218dce3da Mon Sep 17 00:00:00 2001 From: Olli Suutari Date: Mon, 5 Jun 2017 05:58:38 +0300 Subject: [PATCH 16/19] Expanded the test_reference_matched_full to include results with dots after numbers, eg. 1. Kings --- tests/functional/openlp_plugins/bibles/test_lib.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/functional/openlp_plugins/bibles/test_lib.py b/tests/functional/openlp_plugins/bibles/test_lib.py index 2c2615a7a..5ae8ae85d 100644 --- a/tests/functional/openlp_plugins/bibles/test_lib.py +++ b/tests/functional/openlp_plugins/bibles/test_lib.py @@ -68,7 +68,8 @@ class TestLib(TestCase, TestMixin): """ # GIVEN: Some test data which contains different references to parse, with the expected results. with patch('openlp.plugins.bibles.lib.Settings', return_value=MagicMock(**{'value.return_value': ''})): - # The following test data tests with 222 variants when using the default 'separators' + # The following test data tests with about 240 variants when using the default 'separators' + # The amount is exactly 222 without '1. John 23' and'1. John. 23' test_data = [ # Input reference, book name, chapter + verse reference ('Psalm 23', 'Psalm', '23'), @@ -84,6 +85,8 @@ class TestLib(TestCase, TestMixin): ('Psalm 23{_and}24', 'Psalm', '23,24'), ('1 John 23', '1 John', '23'), ('1 John. 23', '1 John', '23'), + ('1. John 23', '1. John', '23'), + ('1. John. 23', '1. John', '23'), ('1 John 23{to}24', '1 John', '23-24'), ('1 John 23{verse}1{to}2', '1 John', '23:1-2'), ('1 John 23{verse}1{to}{end}', '1 John', '23:1-end'), From a703294db2ce321ce029db77e4f324b35bed5650 Mon Sep 17 00:00:00 2001 From: Olli Suutari Date: Mon, 5 Jun 2017 08:53:47 +0300 Subject: [PATCH 17/19] - Fixed over idented line on def closeEvent(self, event): - Added a comment explaing the ' ' in Bible book name auto completion. --- openlp/plugins/bibles/lib/mediaitem.py | 2 ++ openlp/plugins/songs/forms/duplicatesongremovalform.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/openlp/plugins/bibles/lib/mediaitem.py b/openlp/plugins/bibles/lib/mediaitem.py index acc7d1736..1c210c9ed 100755 --- a/openlp/plugins/bibles/lib/mediaitem.py +++ b/openlp/plugins/bibles/lib/mediaitem.py @@ -414,6 +414,8 @@ class BibleMediaItem(MediaManagerItem): if self.bible: book_data = self.get_common_books(self.bible, self.second_bible) language_selection = self.plugin.manager.get_language_selection(self.bible.name) + # Get book names + add a space to the end. Thus Psalm23 becomes Psalm 23 + # when auto complete is used and user does not need to add the space manually. books = [book.get_name(language_selection) + ' ' for book in book_data] books.sort(key=get_locale_key) set_case_insensitive_completer(books, self.search_edit) diff --git a/openlp/plugins/songs/forms/duplicatesongremovalform.py b/openlp/plugins/songs/forms/duplicatesongremovalform.py index fc3d5b279..1a9440317 100644 --- a/openlp/plugins/songs/forms/duplicatesongremovalform.py +++ b/openlp/plugins/songs/forms/duplicatesongremovalform.py @@ -83,7 +83,7 @@ class DuplicateSongRemovalForm(OpenLPWizard, RegistryProperties): self.cancel_button.clicked.connect(self.on_wizard_exit) def closeEvent(self, event): - self.on_wizard_exit() + self.on_wizard_exit() def add_custom_pages(self): """ From 798f3738b8468caf089b0851927e74c3e711c545 Mon Sep 17 00:00:00 2001 From: Olli Suutari Date: Mon, 5 Jun 2017 09:05:54 +0300 Subject: [PATCH 18/19] Value of old last used Bible search type is no longer transferred to settings since it's invalid and gets replaced on boot anyways. --- openlp/core/common/settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/core/common/settings.py b/openlp/core/common/settings.py index 36f566147..226ef0954 100644 --- a/openlp/core/common/settings.py +++ b/openlp/core/common/settings.py @@ -222,7 +222,7 @@ class Settings(QtCore.QSettings): ('bibles/quick bible', 'bibles/primary bible', []), # Common bible search widgets combined in 2.6 # Last search type was renamed to last used search type in 2.6 since Bible search value type changed in 2.6. ('songs/last search type', 'songs/last used search type', []), - ('bibles/last search type', 'bibles/last used search type', []), + ('bibles/last search type', '', []), ('custom/last search type', 'custom/last used search type', []) ] From 48c6810f0c06659149ae820fe6759acdd60da6d5 Mon Sep 17 00:00:00 2001 From: Olli Suutari Date: Mon, 5 Jun 2017 21:22:14 +0300 Subject: [PATCH 19/19] - Added a test for checking that next calls the next playlist item --- openlp/core/ui/__init__.py | 6 +++--- .../openlp_core_ui/test_maindisplay.py | 17 ++++++++++++++++- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/openlp/core/ui/__init__.py b/openlp/core/ui/__init__.py index 1b71229b5..2b8383755 100644 --- a/openlp/core/ui/__init__.py +++ b/openlp/core/ui/__init__.py @@ -99,7 +99,7 @@ from .themelayoutform import ThemeLayoutForm from .themeform import ThemeForm from .filerenameform import FileRenameForm from .starttimeform import StartTimeForm -from .maindisplay import MainDisplay, Display +from .maindisplay import MainDisplay, Display, AudioPlayer from .servicenoteform import ServiceNoteForm from .serviceitemeditform import ServiceItemEditForm from .slidecontroller import SlideController, DisplayController, PreviewController, LiveController @@ -120,8 +120,8 @@ from .projector.tab import ProjectorTab from .projector.editform import ProjectorEditForm __all__ = ['SplashScreen', 'AboutForm', 'SettingsForm', 'MainDisplay', 'SlideController', 'ServiceManager', 'ThemeForm', - 'ThemeManager', 'ServiceItemEditForm', 'FirstTimeForm', 'FirstTimeLanguageForm', - 'Display', 'ServiceNoteForm', 'ThemeLayoutForm', 'FileRenameForm', 'StartTimeForm', 'MainDisplay', + 'ThemeManager', 'ServiceItemEditForm', 'FirstTimeForm', 'FirstTimeLanguageForm', 'Display', 'AudioPlayer', + 'ServiceNoteForm', 'ThemeLayoutForm', 'FileRenameForm', 'StartTimeForm', 'MainDisplay', 'SlideController', 'DisplayController', 'GeneralTab', 'ThemesTab', 'AdvancedTab', 'PluginForm', 'FormattingTagForm', 'ShortcutListForm', 'FormattingTagController', 'SingleColumnTableWidget', 'ProjectorManager', 'ProjectorTab', 'ProjectorEditForm'] diff --git a/tests/functional/openlp_core_ui/test_maindisplay.py b/tests/functional/openlp_core_ui/test_maindisplay.py index 86aaf5ea7..e9ec825d2 100644 --- a/tests/functional/openlp_core_ui/test_maindisplay.py +++ b/tests/functional/openlp_core_ui/test_maindisplay.py @@ -29,7 +29,7 @@ from PyQt5 import QtCore from openlp.core.common import Registry, is_macosx, Settings from openlp.core.lib import ScreenList, PluginManager -from openlp.core.ui import MainDisplay +from openlp.core.ui import MainDisplay, AudioPlayer from openlp.core.ui.media import MediaController from openlp.core.ui.maindisplay import TRANSPARENT_STYLESHEET, OPAQUE_STYLESHEET @@ -283,3 +283,18 @@ class TestMainDisplay(TestCase, TestMixin): self.assertEquals(main_display.web_view.setHtml.call_count, 1, 'setHTML should be called once') self.assertEquals(main_display.media_controller.video.call_count, 1, 'Media Controller video should have been called once') + + +def test_calling_next_item_in_playlist(): + """ + Test the AudioPlayer.next() method + """ + # GIVEN: An instance of AudioPlayer with a mocked out playlist + audio_player = AudioPlayer(None) + + # WHEN: next is called. + with patch.object(audio_player, 'playlist') as mocked_playlist: + audio_player.next() + + # THEN: playlist.next should had been called once. + mocked_playlist.next.assert_called_once_with()