forked from openlp/openlp
Fixed bugs:
Bug #1639860: Close button is disabled in numerous windows Bug #1652559: Find duplicates wizard does not reset cursor if closed from "x" instead of "cancel" button and causes traceback on exit Bug #1666272: Linked audio "next" button results in traceback Bug #1678292: Space after Bible book name auto-completion is missing Bug #1694732: wizard sub title does not wrap Bug #1695268: Bibles plugin fails to load due to invalid "last search type" Bug: If Bible book name contains dot aft... bzr-revno: 2749
This commit is contained in:
commit
80d30bf272
@ -219,7 +219,11 @@ class Settings(QtCore.QSettings):
|
|||||||
('shortcuts/offlineHelpItem', 'shortcuts/userManualItem', []), # Online and Offline help were combined in 2.6.
|
('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.
|
('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/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', '', []),
|
||||||
|
('custom/last search type', 'custom/last used search type', [])
|
||||||
]
|
]
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
@ -105,7 +105,7 @@ class SearchEdit(QtWidgets.QLineEdit):
|
|||||||
self.setPlaceholderText(action.placeholder_text)
|
self.setPlaceholderText(action.placeholder_text)
|
||||||
self.menu_button.setDefaultAction(action)
|
self.menu_button.setDefaultAction(action)
|
||||||
self._current_search_type = identifier
|
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)
|
self.searchTypeChanged.emit(identifier)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
@ -141,7 +141,7 @@ class SearchEdit(QtWidgets.QLineEdit):
|
|||||||
self.menu_button.resize(QtCore.QSize(28, 18))
|
self.menu_button.resize(QtCore.QSize(28, 18))
|
||||||
self.menu_button.setMenu(menu)
|
self.menu_button.setMenu(menu)
|
||||||
self.set_current_search_type(
|
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.menu_button.show()
|
||||||
self._update_style_sheet()
|
self._update_style_sheet()
|
||||||
|
|
||||||
|
@ -49,6 +49,7 @@ def add_welcome_page(parent, image):
|
|||||||
parent.title_label = QtWidgets.QLabel(parent.welcome_page)
|
parent.title_label = QtWidgets.QLabel(parent.welcome_page)
|
||||||
parent.title_label.setObjectName('title_label')
|
parent.title_label.setObjectName('title_label')
|
||||||
parent.welcome_layout.addWidget(parent.title_label)
|
parent.welcome_layout.addWidget(parent.title_label)
|
||||||
|
parent.title_label.setWordWrap(True)
|
||||||
parent.welcome_layout.addSpacing(40)
|
parent.welcome_layout.addSpacing(40)
|
||||||
parent.information_label = QtWidgets.QLabel(parent.welcome_page)
|
parent.information_label = QtWidgets.QLabel(parent.welcome_page)
|
||||||
parent.information_label.setWordWrap(True)
|
parent.information_label.setWordWrap(True)
|
||||||
|
@ -99,7 +99,7 @@ from .themelayoutform import ThemeLayoutForm
|
|||||||
from .themeform import ThemeForm
|
from .themeform import ThemeForm
|
||||||
from .filerenameform import FileRenameForm
|
from .filerenameform import FileRenameForm
|
||||||
from .starttimeform import StartTimeForm
|
from .starttimeform import StartTimeForm
|
||||||
from .maindisplay import MainDisplay, Display
|
from .maindisplay import MainDisplay, Display, AudioPlayer
|
||||||
from .servicenoteform import ServiceNoteForm
|
from .servicenoteform import ServiceNoteForm
|
||||||
from .serviceitemeditform import ServiceItemEditForm
|
from .serviceitemeditform import ServiceItemEditForm
|
||||||
from .slidecontroller import SlideController, DisplayController, PreviewController, LiveController
|
from .slidecontroller import SlideController, DisplayController, PreviewController, LiveController
|
||||||
@ -120,8 +120,8 @@ from .projector.tab import ProjectorTab
|
|||||||
from .projector.editform import ProjectorEditForm
|
from .projector.editform import ProjectorEditForm
|
||||||
|
|
||||||
__all__ = ['SplashScreen', 'AboutForm', 'SettingsForm', 'MainDisplay', 'SlideController', 'ServiceManager', 'ThemeForm',
|
__all__ = ['SplashScreen', 'AboutForm', 'SettingsForm', 'MainDisplay', 'SlideController', 'ServiceManager', 'ThemeForm',
|
||||||
'ThemeManager', 'ServiceItemEditForm', 'FirstTimeForm', 'FirstTimeLanguageForm',
|
'ThemeManager', 'ServiceItemEditForm', 'FirstTimeForm', 'FirstTimeLanguageForm', 'Display', 'AudioPlayer',
|
||||||
'Display', 'ServiceNoteForm', 'ThemeLayoutForm', 'FileRenameForm', 'StartTimeForm', 'MainDisplay',
|
'ServiceNoteForm', 'ThemeLayoutForm', 'FileRenameForm', 'StartTimeForm', 'MainDisplay',
|
||||||
'SlideController', 'DisplayController', 'GeneralTab', 'ThemesTab', 'AdvancedTab', 'PluginForm',
|
'SlideController', 'DisplayController', 'GeneralTab', 'ThemesTab', 'AdvancedTab', 'PluginForm',
|
||||||
'FormattingTagForm', 'ShortcutListForm', 'FormattingTagController', 'SingleColumnTableWidget',
|
'FormattingTagForm', 'ShortcutListForm', 'FormattingTagController', 'SingleColumnTableWidget',
|
||||||
'ProjectorManager', 'ProjectorTab', 'ProjectorEditForm']
|
'ProjectorManager', 'ProjectorTab', 'ProjectorEditForm']
|
||||||
|
@ -40,7 +40,8 @@ class AboutForm(QtWidgets.QDialog, UiAboutDialog):
|
|||||||
"""
|
"""
|
||||||
Do some initialisation stuff
|
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()
|
self._setup()
|
||||||
|
|
||||||
def _setup(self):
|
def _setup(self):
|
||||||
|
@ -38,8 +38,8 @@ class FileRenameForm(QtWidgets.QDialog, Ui_FileRenameDialog, RegistryProperties)
|
|||||||
"""
|
"""
|
||||||
Constructor
|
Constructor
|
||||||
"""
|
"""
|
||||||
super(FileRenameForm, self).__init__(Registry().get('main_window'),
|
super(FileRenameForm, self).__init__(Registry().get('main_window'), QtCore.Qt.WindowSystemMenuHint |
|
||||||
QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint)
|
QtCore.Qt.WindowTitleHint | QtCore.Qt.WindowCloseButtonHint)
|
||||||
self._setup()
|
self._setup()
|
||||||
|
|
||||||
def _setup(self):
|
def _setup(self):
|
||||||
|
@ -37,7 +37,8 @@ class FirstTimeLanguageForm(QtWidgets.QDialog, Ui_FirstTimeLanguageDialog):
|
|||||||
"""
|
"""
|
||||||
Constructor
|
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.setupUi(self)
|
||||||
self.qm_list = LanguageManager.get_qm_list()
|
self.qm_list = LanguageManager.get_qm_list()
|
||||||
self.language_combo_box.addItem('Autodetect')
|
self.language_combo_box.addItem('Autodetect')
|
||||||
|
@ -51,7 +51,8 @@ class FormattingTagForm(QtWidgets.QDialog, Ui_FormattingTagDialog, FormattingTag
|
|||||||
"""
|
"""
|
||||||
Constructor
|
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.setupUi(self)
|
||||||
self._setup()
|
self._setup()
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ The :mod:``wizard`` module provides generic wizard tools for OpenLP.
|
|||||||
import logging
|
import logging
|
||||||
import os
|
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.common import Registry, RegistryProperties, Settings, UiStrings, translate, is_macosx
|
||||||
from openlp.core.lib import build_icon
|
from openlp.core.lib import build_icon
|
||||||
@ -93,7 +93,10 @@ class OpenLPWizard(QtWidgets.QWizard, RegistryProperties):
|
|||||||
"""
|
"""
|
||||||
Constructor
|
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.plugin = plugin
|
||||||
self.with_progress_page = add_progress_page
|
self.with_progress_page = add_progress_page
|
||||||
self.setFixedWidth(640)
|
self.setFixedWidth(640)
|
||||||
|
@ -689,7 +689,7 @@ class AudioPlayer(OpenLPMixin, QtCore.QObject):
|
|||||||
"""
|
"""
|
||||||
Skip forward to the next track in the list
|
Skip forward to the next track in the list
|
||||||
"""
|
"""
|
||||||
self.playerlist.next()
|
self.playlist.next()
|
||||||
|
|
||||||
def go_to(self, index):
|
def go_to(self, index):
|
||||||
"""
|
"""
|
||||||
|
@ -41,7 +41,8 @@ class PluginForm(QtWidgets.QDialog, Ui_PluginViewDialog, RegistryProperties):
|
|||||||
"""
|
"""
|
||||||
Constructor
|
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.active_plugin = None
|
||||||
self.programatic_change = False
|
self.programatic_change = False
|
||||||
self.setupUi(self)
|
self.setupUi(self)
|
||||||
|
@ -125,8 +125,8 @@ class PrintServiceForm(QtWidgets.QDialog, Ui_PrintServiceDialog, RegistryPropert
|
|||||||
"""
|
"""
|
||||||
Constructor
|
Constructor
|
||||||
"""
|
"""
|
||||||
super(PrintServiceForm, self).__init__(Registry().get('main_window'),
|
super(PrintServiceForm, self).__init__(Registry().get('main_window'), QtCore.Qt.WindowSystemMenuHint |
|
||||||
QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint)
|
QtCore.Qt.WindowTitleHint | QtCore.Qt.WindowCloseButtonHint)
|
||||||
self.printer = QtPrintSupport.QPrinter()
|
self.printer = QtPrintSupport.QPrinter()
|
||||||
self.print_dialog = QtPrintSupport.QPrintDialog(self.printer, self)
|
self.print_dialog = QtPrintSupport.QPrintDialog(self.printer, self)
|
||||||
self.document = QtGui.QTextDocument()
|
self.document = QtGui.QTextDocument()
|
||||||
|
@ -142,7 +142,8 @@ class ProjectorEditForm(QtWidgets.QDialog, Ui_ProjectorEditForm):
|
|||||||
editProjector = QtCore.pyqtSignal(object)
|
editProjector = QtCore.pyqtSignal(object)
|
||||||
|
|
||||||
def __init__(self, parent=None, projectordb=None):
|
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.projectordb = projectordb
|
||||||
self.setupUi(self)
|
self.setupUi(self)
|
||||||
self.button_box.accepted.connect(self.accept_me)
|
self.button_box.accepted.connect(self.accept_me)
|
||||||
|
@ -233,7 +233,8 @@ class SourceSelectTabs(QtWidgets.QDialog):
|
|||||||
:param projectordb: ProjectorDB session to use
|
:param projectordb: ProjectorDB session to use
|
||||||
"""
|
"""
|
||||||
log.debug('Initializing SourceSelectTabs()')
|
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.setMinimumWidth(350)
|
||||||
self.projectordb = projectordb
|
self.projectordb = projectordb
|
||||||
self.edit = edit
|
self.edit = edit
|
||||||
@ -388,7 +389,8 @@ class SourceSelectSingle(QtWidgets.QDialog):
|
|||||||
"""
|
"""
|
||||||
log.debug('Initializing SourceSelectSingle()')
|
log.debug('Initializing SourceSelectSingle()')
|
||||||
self.projectordb = projectordb
|
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
|
self.edit = edit
|
||||||
if self.edit:
|
if self.edit:
|
||||||
title = translate('OpenLP.SourceSelectForm', 'Edit Projector Source Text')
|
title = translate('OpenLP.SourceSelectForm', 'Edit Projector Source Text')
|
||||||
|
@ -37,8 +37,8 @@ class ServiceItemEditForm(QtWidgets.QDialog, Ui_ServiceItemEditDialog, RegistryP
|
|||||||
"""
|
"""
|
||||||
Constructor
|
Constructor
|
||||||
"""
|
"""
|
||||||
super(ServiceItemEditForm, self).__init__(Registry().get('main_window'),
|
super(ServiceItemEditForm, self).__init__(Registry().get('main_window'), QtCore.Qt.WindowSystemMenuHint |
|
||||||
QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint)
|
QtCore.Qt.WindowTitleHint | QtCore.Qt.WindowCloseButtonHint)
|
||||||
self.setupUi(self)
|
self.setupUi(self)
|
||||||
self.item_list = []
|
self.item_list = []
|
||||||
self.list_widget.currentRowChanged.connect(self.on_current_row_changed)
|
self.list_widget.currentRowChanged.connect(self.on_current_row_changed)
|
||||||
|
@ -37,8 +37,8 @@ class ServiceNoteForm(QtWidgets.QDialog, RegistryProperties):
|
|||||||
"""
|
"""
|
||||||
Constructor
|
Constructor
|
||||||
"""
|
"""
|
||||||
super(ServiceNoteForm, self).__init__(Registry().get('main_window'),
|
super(ServiceNoteForm, self).__init__(Registry().get('main_window'), QtCore.Qt.WindowSystemMenuHint |
|
||||||
QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint)
|
QtCore.Qt.WindowTitleHint | QtCore.Qt.WindowCloseButtonHint)
|
||||||
self.setupUi()
|
self.setupUi()
|
||||||
self.retranslateUi()
|
self.retranslateUi()
|
||||||
|
|
||||||
|
@ -46,7 +46,8 @@ class SettingsForm(QtWidgets.QDialog, Ui_SettingsDialog, RegistryProperties):
|
|||||||
"""
|
"""
|
||||||
Registry().register('settings_form', self)
|
Registry().register('settings_form', self)
|
||||||
Registry().register_function('bootstrap_post_set_up', self.bootstrap_post_set_up)
|
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.processes = []
|
||||||
self.setupUi(self)
|
self.setupUi(self)
|
||||||
self.setting_list_widget.currentRowChanged.connect(self.list_item_changed)
|
self.setting_list_widget.currentRowChanged.connect(self.list_item_changed)
|
||||||
|
@ -44,7 +44,8 @@ class ShortcutListForm(QtWidgets.QDialog, Ui_ShortcutListDialog, RegistryPropert
|
|||||||
"""
|
"""
|
||||||
Constructor
|
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.setupUi(self)
|
||||||
self.changed_actions = {}
|
self.changed_actions = {}
|
||||||
self.action_list = ActionList.get_instance()
|
self.action_list = ActionList.get_instance()
|
||||||
|
@ -38,8 +38,8 @@ class StartTimeForm(QtWidgets.QDialog, Ui_StartTimeDialog, RegistryProperties):
|
|||||||
"""
|
"""
|
||||||
Constructor
|
Constructor
|
||||||
"""
|
"""
|
||||||
super(StartTimeForm, self).__init__(Registry().get('main_window'),
|
super(StartTimeForm, self).__init__(Registry().get('main_window'), QtCore.Qt.WindowSystemMenuHint |
|
||||||
QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint)
|
QtCore.Qt.WindowTitleHint | QtCore.Qt.WindowCloseButtonHint)
|
||||||
self.setupUi(self)
|
self.setupUi(self)
|
||||||
|
|
||||||
def exec(self):
|
def exec(self):
|
||||||
|
@ -36,8 +36,8 @@ class AlertForm(QtWidgets.QDialog, Ui_AlertDialog):
|
|||||||
"""
|
"""
|
||||||
Initialise the alert form
|
Initialise the alert form
|
||||||
"""
|
"""
|
||||||
super(AlertForm, self).__init__(Registry().get('main_window'),
|
super(AlertForm, self).__init__(Registry().get('main_window'), QtCore.Qt.WindowSystemMenuHint |
|
||||||
QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint)
|
QtCore.Qt.WindowTitleHint | QtCore.Qt.WindowCloseButtonHint)
|
||||||
self.manager = plugin.manager
|
self.manager = plugin.manager
|
||||||
self.plugin = plugin
|
self.plugin = plugin
|
||||||
self.item_id = None
|
self.item_id = None
|
||||||
|
@ -38,7 +38,7 @@ __default_settings__ = {
|
|||||||
'bibles/db password': '',
|
'bibles/db password': '',
|
||||||
'bibles/db hostname': '',
|
'bibles/db hostname': '',
|
||||||
'bibles/db database': '',
|
'bibles/db database': '',
|
||||||
'bibles/last search type': BibleSearch.Combined,
|
'bibles/last used search type': BibleSearch.Combined,
|
||||||
'bibles/reset to combined quick search': True,
|
'bibles/reset to combined quick search': True,
|
||||||
'bibles/verse layout style': LayoutStyle.VersePerSlide,
|
'bibles/verse layout style': LayoutStyle.VersePerSlide,
|
||||||
'bibles/book name language': LanguageSelection.Bible,
|
'bibles/book name language': LanguageSelection.Bible,
|
||||||
|
@ -49,7 +49,8 @@ class BookNameForm(QDialog, Ui_BookNameDialog):
|
|||||||
"""
|
"""
|
||||||
Constructor
|
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.setupUi(self)
|
||||||
self.custom_signals()
|
self.custom_signals()
|
||||||
self.book_names = BibleStrings().BookNames
|
self.book_names = BibleStrings().BookNames
|
||||||
|
@ -45,7 +45,8 @@ class EditBibleForm(QtWidgets.QDialog, Ui_EditBibleDialog, RegistryProperties):
|
|||||||
"""
|
"""
|
||||||
Constructor
|
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.media_item = media_item
|
||||||
self.book_names = BibleStrings().BookNames
|
self.book_names = BibleStrings().BookNames
|
||||||
self.setupUi(self)
|
self.setupUi(self)
|
||||||
|
@ -47,7 +47,8 @@ class LanguageForm(QDialog, Ui_LanguageDialog):
|
|||||||
"""
|
"""
|
||||||
Constructor
|
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)
|
self.setupUi(self)
|
||||||
|
|
||||||
def exec(self, bible_name):
|
def exec(self, bible_name):
|
||||||
|
@ -230,7 +230,7 @@ def update_reference_separators():
|
|||||||
REFERENCE_MATCHES['range_separator'] = re.compile(REFERENCE_SEPARATORS['sep_l'], re.UNICODE)
|
REFERENCE_MATCHES['range_separator'] = re.compile(REFERENCE_SEPARATORS['sep_l'], re.UNICODE)
|
||||||
# full reference match: <book>(<range>(,(?!$)|(?=$)))+
|
# full reference match: <book>(<range>(,(?!$)|(?=$)))+
|
||||||
REFERENCE_MATCHES['full'] = \
|
REFERENCE_MATCHES['full'] = \
|
||||||
re.compile('^\s*(?!\s)(?P<book>[\d]*[^\d\.]+)\.*(?<!\s)\s*'
|
re.compile('^\s*(?!\s)(?P<book>[\d]*[.]?[^\d\.]+)\.*(?<!\s)\s*'
|
||||||
'(?P<ranges>(?:%(range_regex)s(?:%(sep_l)s(?!\s*$)|(?=\s*$)))+)\s*$'
|
'(?P<ranges>(?:%(range_regex)s(?:%(sep_l)s(?!\s*$)|(?=\s*$)))+)\s*$'
|
||||||
% dict(list(REFERENCE_SEPARATORS.items()) + [('range_regex', range_regex)]), re.UNICODE)
|
% 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<book>[\d]*[^\d]+)(?<!\s)\s*``
|
``^\s*(?!\s)(?P<book>[\d]*[^\d]+)(?<!\s)\s*``
|
||||||
The ``book`` group starts with the first non-whitespace character. There are optional leading digits followed by
|
The ``book`` group starts with the first non-whitespace character. There are optional leading digits followed by
|
||||||
non-digits. The group ends before the whitspace, or a full stop in front of the next digit.
|
non-digits. The group ends before the whitespace, or a full stop in front of the next digit.
|
||||||
|
|
||||||
``(?P<ranges>(?:%(range_regex)s(?:%(sep_l)s(?!\s*$)|(?=\s*$)))+)\s*$``
|
``(?P<ranges>(?:%(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
|
The second group contains all ``ranges``. This can be multiple declarations of range_regex separated by a list
|
||||||
|
@ -414,7 +414,9 @@ class BibleMediaItem(MediaManagerItem):
|
|||||||
if self.bible:
|
if self.bible:
|
||||||
book_data = self.get_common_books(self.bible, self.second_bible)
|
book_data = self.get_common_books(self.bible, self.second_bible)
|
||||||
language_selection = self.plugin.manager.get_language_selection(self.bible.name)
|
language_selection = self.plugin.manager.get_language_selection(self.bible.name)
|
||||||
books = [book.get_name(language_selection) for book in book_data]
|
# 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)
|
books.sort(key=get_locale_key)
|
||||||
set_case_insensitive_completer(books, self.search_edit)
|
set_case_insensitive_completer(books, self.search_edit)
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@ __default_settings__ = {
|
|||||||
'custom/db password': '',
|
'custom/db password': '',
|
||||||
'custom/db hostname': '',
|
'custom/db hostname': '',
|
||||||
'custom/db database': '',
|
'custom/db database': '',
|
||||||
'custom/last search type': CustomSearch.Titles,
|
'custom/last used search type': CustomSearch.Titles,
|
||||||
'custom/display footer': True,
|
'custom/display footer': True,
|
||||||
'custom/add custom from service': True
|
'custom/add custom from service': True
|
||||||
}
|
}
|
||||||
|
@ -44,7 +44,8 @@ class EditCustomForm(QtWidgets.QDialog, Ui_CustomEditDialog):
|
|||||||
"""
|
"""
|
||||||
Constructor
|
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.manager = manager
|
||||||
self.media_item = media_item
|
self.media_item = media_item
|
||||||
self.setupUi(self)
|
self.setupUi(self)
|
||||||
|
@ -39,7 +39,8 @@ class EditCustomSlideForm(QtWidgets.QDialog, Ui_CustomSlideEditDialog):
|
|||||||
"""
|
"""
|
||||||
Constructor
|
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)
|
self.setupUi(self)
|
||||||
# Connecting signals and slots
|
# Connecting signals and slots
|
||||||
self.insert_button.clicked.connect(self.on_insert_button_clicked)
|
self.insert_button.clicked.connect(self.on_insert_button_clicked)
|
||||||
|
@ -35,7 +35,8 @@ class AddGroupForm(QtWidgets.QDialog, Ui_AddGroupDialog):
|
|||||||
"""
|
"""
|
||||||
Constructor
|
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)
|
self.setupUi(self)
|
||||||
|
|
||||||
def exec(self, clear=True, show_top_level_group=False, selected_group=None):
|
def exec(self, clear=True, show_top_level_group=False, selected_group=None):
|
||||||
|
@ -33,7 +33,8 @@ class ChooseGroupForm(QtWidgets.QDialog, Ui_ChooseGroupDialog):
|
|||||||
"""
|
"""
|
||||||
Constructor
|
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)
|
self.setupUi(self)
|
||||||
|
|
||||||
def exec(self, selected_group=None):
|
def exec(self, selected_group=None):
|
||||||
|
@ -52,7 +52,8 @@ class MediaClipSelectorForm(QtWidgets.QDialog, Ui_MediaClipSelector, RegistryPro
|
|||||||
"""
|
"""
|
||||||
Constructor
|
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_instance = None
|
||||||
self.vlc_media_player = None
|
self.vlc_media_player = None
|
||||||
self.vlc_media = None
|
self.vlc_media = None
|
||||||
|
@ -35,7 +35,8 @@ class AuthorsForm(QtWidgets.QDialog, Ui_AuthorsDialog):
|
|||||||
"""
|
"""
|
||||||
Set up the screen and common data
|
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.setupUi(self)
|
||||||
self.auto_display_name = False
|
self.auto_display_name = False
|
||||||
self.first_name_edit.textEdited.connect(self.on_first_name_edited)
|
self.first_name_edit.textEdited.connect(self.on_first_name_edited)
|
||||||
|
@ -82,6 +82,9 @@ class DuplicateSongRemovalForm(OpenLPWizard, RegistryProperties):
|
|||||||
self.finish_button.clicked.connect(self.on_wizard_exit)
|
self.finish_button.clicked.connect(self.on_wizard_exit)
|
||||||
self.cancel_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):
|
def add_custom_pages(self):
|
||||||
"""
|
"""
|
||||||
Add song wizard specific pages.
|
Add song wizard specific pages.
|
||||||
|
@ -56,7 +56,8 @@ class EditSongForm(QtWidgets.QDialog, Ui_EditSongDialog, RegistryProperties):
|
|||||||
"""
|
"""
|
||||||
Constructor
|
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.media_item = media_item
|
||||||
self.song = None
|
self.song = None
|
||||||
# can this be automated?
|
# can this be automated?
|
||||||
|
@ -43,7 +43,8 @@ class EditVerseForm(QtWidgets.QDialog, Ui_EditVerseDialog):
|
|||||||
"""
|
"""
|
||||||
Constructor
|
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.setupUi(self)
|
||||||
self.has_single_verse = False
|
self.has_single_verse = False
|
||||||
self.insert_button.clicked.connect(self.on_insert_button_clicked)
|
self.insert_button.clicked.connect(self.on_insert_button_clicked)
|
||||||
|
@ -37,7 +37,8 @@ class MediaFilesForm(QtWidgets.QDialog, Ui_MediaFilesDialog):
|
|||||||
log.info('{name} MediaFilesForm loaded'.format(name=__name__))
|
log.info('{name} MediaFilesForm loaded'.format(name=__name__))
|
||||||
|
|
||||||
def __init__(self, parent):
|
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)
|
self.setupUi(self)
|
||||||
|
|
||||||
def populate_files(self, files):
|
def populate_files(self, files):
|
||||||
|
@ -38,7 +38,8 @@ class SongBookForm(QtWidgets.QDialog, Ui_SongBookDialog):
|
|||||||
"""
|
"""
|
||||||
Constructor
|
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)
|
self.setupUi(self)
|
||||||
|
|
||||||
def exec(self, clear=True):
|
def exec(self, clear=True):
|
||||||
|
@ -39,7 +39,7 @@ class Ui_SongMaintenanceDialog(object):
|
|||||||
song_maintenance_dialog.setObjectName('song_maintenance_dialog')
|
song_maintenance_dialog.setObjectName('song_maintenance_dialog')
|
||||||
song_maintenance_dialog.setWindowIcon(build_icon(':/icon/openlp-logo.svg'))
|
song_maintenance_dialog.setWindowIcon(build_icon(':/icon/openlp-logo.svg'))
|
||||||
song_maintenance_dialog.setWindowModality(QtCore.Qt.ApplicationModal)
|
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 = QtWidgets.QGridLayout(song_maintenance_dialog)
|
||||||
self.dialog_layout.setObjectName('dialog_layout')
|
self.dialog_layout.setObjectName('dialog_layout')
|
||||||
self.type_list_widget = QtWidgets.QListWidget(song_maintenance_dialog)
|
self.type_list_widget = QtWidgets.QListWidget(song_maintenance_dialog)
|
||||||
|
@ -44,7 +44,8 @@ class SongMaintenanceForm(QtWidgets.QDialog, Ui_SongMaintenanceDialog, RegistryP
|
|||||||
"""
|
"""
|
||||||
Constructor
|
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.setupUi(self)
|
||||||
self.manager = manager
|
self.manager = manager
|
||||||
self.author_form = AuthorsForm(self)
|
self.author_form = AuthorsForm(self)
|
||||||
|
@ -81,7 +81,8 @@ class SongSelectForm(QtWidgets.QDialog, Ui_SongSelectDialog):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, parent=None, plugin=None, db_manager=None):
|
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.plugin = plugin
|
||||||
self.db_manager = db_manager
|
self.db_manager = db_manager
|
||||||
self.setup_ui(self)
|
self.setup_ui(self)
|
||||||
|
@ -38,7 +38,8 @@ class TopicsForm(QtWidgets.QDialog, Ui_TopicsDialog):
|
|||||||
"""
|
"""
|
||||||
Constructor
|
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)
|
self.setupUi(self)
|
||||||
|
|
||||||
def exec(self, clear=True):
|
def exec(self, clear=True):
|
||||||
|
@ -54,7 +54,7 @@ __default_settings__ = {
|
|||||||
'songs/db password': '',
|
'songs/db password': '',
|
||||||
'songs/db hostname': '',
|
'songs/db hostname': '',
|
||||||
'songs/db database': '',
|
'songs/db database': '',
|
||||||
'songs/last search type': SongSearch.Entire,
|
'songs/last used search type': SongSearch.Entire,
|
||||||
'songs/last import type': SongFormat.OpenLyrics,
|
'songs/last import type': SongFormat.OpenLyrics,
|
||||||
'songs/update service on edit': False,
|
'songs/update service on edit': False,
|
||||||
'songs/add song from service': True,
|
'songs/add song from service': True,
|
||||||
|
@ -37,7 +37,7 @@ class SongUsageDeleteForm(QtWidgets.QDialog, Ui_SongUsageDeleteDialog, RegistryP
|
|||||||
"""
|
"""
|
||||||
self.manager = manager
|
self.manager = manager
|
||||||
super(SongUsageDeleteForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint |
|
super(SongUsageDeleteForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint |
|
||||||
QtCore.Qt.WindowTitleHint)
|
QtCore.Qt.WindowTitleHint | QtCore.Qt.WindowCloseButtonHint)
|
||||||
self.setupUi(self)
|
self.setupUi(self)
|
||||||
self.button_box.clicked.connect(self.on_button_box_clicked)
|
self.button_box.clicked.connect(self.on_button_box_clicked)
|
||||||
|
|
||||||
|
@ -44,7 +44,8 @@ class SongUsageDetailForm(QtWidgets.QDialog, Ui_SongUsageDetailDialog, RegistryP
|
|||||||
"""
|
"""
|
||||||
Initialise the form
|
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.plugin = plugin
|
||||||
self.setupUi(self)
|
self.setupUi(self)
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ from PyQt5 import QtCore
|
|||||||
|
|
||||||
from openlp.core.common import Registry, is_macosx, Settings
|
from openlp.core.common import Registry, is_macosx, Settings
|
||||||
from openlp.core.lib import ScreenList, PluginManager
|
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.media import MediaController
|
||||||
from openlp.core.ui.maindisplay import TRANSPARENT_STYLESHEET, OPAQUE_STYLESHEET
|
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.web_view.setHtml.call_count, 1, 'setHTML should be called once')
|
||||||
self.assertEquals(main_display.media_controller.video.call_count, 1,
|
self.assertEquals(main_display.media_controller.video.call_count, 1,
|
||||||
'Media Controller video should have been called once')
|
'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()
|
||||||
|
@ -68,7 +68,8 @@ class TestLib(TestCase, TestMixin):
|
|||||||
"""
|
"""
|
||||||
# GIVEN: Some test data which contains different references to parse, with the expected results.
|
# 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': ''})):
|
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 = [
|
test_data = [
|
||||||
# Input reference, book name, chapter + verse reference
|
# Input reference, book name, chapter + verse reference
|
||||||
('Psalm 23', 'Psalm', '23'),
|
('Psalm 23', 'Psalm', '23'),
|
||||||
@ -84,6 +85,8 @@ class TestLib(TestCase, TestMixin):
|
|||||||
('Psalm 23{_and}24', 'Psalm', '23,24'),
|
('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', '1. John', '23'),
|
||||||
|
('1. John. 23', '1. John', '23'),
|
||||||
('1 John 23{to}24', '1 John', '23-24'),
|
('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}2', '1 John', '23:1-2'),
|
||||||
('1 John 23{verse}1{to}{end}', '1 John', '23:1-end'),
|
('1 John 23{verse}1{to}{end}', '1 John', '23:1-end'),
|
||||||
|
@ -480,9 +480,9 @@ class TestMediaItem(TestCase, TestMixin):
|
|||||||
# WHEN: Calling update_auto_completer
|
# WHEN: Calling update_auto_completer
|
||||||
self.media_item.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(
|
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):
|
def test_update_auto_completer_search_combined_type(self):
|
||||||
"""
|
"""
|
||||||
@ -500,11 +500,11 @@ class TestMediaItem(TestCase, TestMixin):
|
|||||||
# WHEN: Calling update_auto_completer
|
# WHEN: Calling update_auto_completer
|
||||||
self.media_item.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(
|
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):
|
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.
|
Test on_import_click when media_item does not have the `import_wizard` attribute. And the wizard was canceled.
|
||||||
"""
|
"""
|
||||||
@ -521,9 +521,9 @@ class TestMediaItem(TestCase, TestMixin):
|
|||||||
self.assertTrue(mocked_bible_import_form.called)
|
self.assertTrue(mocked_bible_import_form.called)
|
||||||
self.assertFalse(mocked_reload_bibles.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
|
# GIVEN: An instance of :class:`MediaManagerItem` and a mocked import_wizard
|
||||||
mocked_import_wizard = MagicMock(**{'exec.return_value': True})
|
mocked_import_wizard = MagicMock(**{'exec.return_value': True})
|
||||||
|
@ -88,7 +88,7 @@ class TestSearchEdit(TestCase, TestMixin):
|
|||||||
# settings
|
# settings
|
||||||
self.assertEqual(self.search_edit.current_search_type(), SearchTypes.First,
|
self.assertEqual(self.search_edit.current_search_type(), SearchTypes.First,
|
||||||
"The first search type should be selected.")
|
"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):
|
def test_set_current_search_type(self):
|
||||||
"""
|
"""
|
||||||
@ -105,7 +105,7 @@ class TestSearchEdit(TestCase, TestMixin):
|
|||||||
self.assertEqual(self.search_edit.placeholderText(), SECOND_PLACEHOLDER_TEXT,
|
self.assertEqual(self.search_edit.placeholderText(), SECOND_PLACEHOLDER_TEXT,
|
||||||
"The correct placeholder text should be 'Second Placeholder Text'.")
|
"The correct placeholder text should be 'Second Placeholder Text'.")
|
||||||
self.mocked_settings().setValue.assert_has_calls(
|
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):
|
def test_clear_button_visibility(self):
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user