forked from openlp/openlp
Merge branch 'settings4' into 'master'
Settings4 See merge request openlp/openlp!108
This commit is contained in:
commit
a82846c60e
@ -93,6 +93,16 @@ class LanguageSelection(IntEnum):
|
||||
English = 2
|
||||
|
||||
|
||||
@unique
|
||||
class PluginStatus(IntEnum):
|
||||
"""
|
||||
Defines the status of the plugin
|
||||
"""
|
||||
Active = 1
|
||||
Inactive = 0
|
||||
Disabled = -1
|
||||
|
||||
|
||||
@unique
|
||||
class SongSearch(IntEnum):
|
||||
"""
|
||||
|
@ -251,7 +251,7 @@ class RegistryProperties(object):
|
||||
@property
|
||||
def settings(self):
|
||||
"""
|
||||
Adds the projector manager to the class dynamically
|
||||
Adds the settings object to the class dynamically
|
||||
"""
|
||||
if not hasattr(self, '_settings') or not self._settings:
|
||||
self._settings = Registry().get('settings')
|
||||
|
@ -32,6 +32,8 @@ from tempfile import gettempdir
|
||||
from PyQt5 import QtCore, QtGui
|
||||
|
||||
from openlp.core.common import SlideLimits, ThemeLevel, is_linux, is_win
|
||||
from openlp.core.common.enum import AlertLocation, BibleSearch, CustomSearch, LayoutStyle, DisplayStyle, \
|
||||
LanguageSelection, SongSearch, PluginStatus
|
||||
from openlp.core.common.json import OpenLPJSONDecoder, OpenLPJSONEncoder, is_serializable
|
||||
from openlp.core.common.path import files_to_paths, str_to_path
|
||||
|
||||
@ -47,6 +49,8 @@ class ProxyMode(IntEnum):
|
||||
MANUAL_PROXY = 3
|
||||
|
||||
|
||||
TODAY = QtCore.QDate.currentDate()
|
||||
|
||||
# Fix for bug #1014422.
|
||||
X11_BYPASS_DEFAULT = True
|
||||
if is_linux(): # pragma: no cover
|
||||
@ -168,6 +172,20 @@ class Settings(QtCore.QSettings):
|
||||
'advanced/x11 bypass wm': X11_BYPASS_DEFAULT,
|
||||
'advanced/search as type': True,
|
||||
'advanced/use_dark_style': False,
|
||||
'alerts/font face': QtGui.QFont().family(),
|
||||
'alerts/font size': 40,
|
||||
'alerts/db type': 'sqlite',
|
||||
'alerts/db username': '',
|
||||
'alerts/db password': '',
|
||||
'alerts/db hostname': '',
|
||||
'alerts/db database': '',
|
||||
'alerts/location': AlertLocation.Bottom,
|
||||
'alerts/background color': '#660000',
|
||||
'alerts/font color': '#ffffff',
|
||||
'alerts/status': PluginStatus.Inactive,
|
||||
'alerts/timeout': 10,
|
||||
'alerts/repeat': 1,
|
||||
'alerts/scroll': True,
|
||||
'api/twelve hour': True,
|
||||
'api/port': 4316,
|
||||
'api/websocket port': 4317,
|
||||
@ -176,7 +194,39 @@ class Settings(QtCore.QSettings):
|
||||
'api/authentication enabled': False,
|
||||
'api/ip address': '0.0.0.0',
|
||||
'api/thumbnails': True,
|
||||
'bibles/db type': 'sqlite',
|
||||
'bibles/db username': '',
|
||||
'bibles/db password': '',
|
||||
'bibles/db hostname': '',
|
||||
'bibles/db database': '',
|
||||
'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,
|
||||
'bibles/display brackets': DisplayStyle.NoBrackets,
|
||||
'bibles/is verse number visible': True,
|
||||
'bibles/display new chapter': False,
|
||||
'bibles/second bibles': True,
|
||||
'bibles/status': PluginStatus.Inactive,
|
||||
'bibles/primary bible': '',
|
||||
'bibles/bible theme': '',
|
||||
'bibles/verse separator': '',
|
||||
'bibles/range separator': '',
|
||||
'bibles/list separator': '',
|
||||
'bibles/end separator': '',
|
||||
'bibles/last directory import': None,
|
||||
'bibles/hide combined quick error': False,
|
||||
'bibles/is search while typing enabled': True,
|
||||
'crashreport/last directory': None,
|
||||
'custom/db type': 'sqlite',
|
||||
'custom/db username': '',
|
||||
'custom/db password': '',
|
||||
'custom/db hostname': '',
|
||||
'custom/db database': '',
|
||||
'custom/last used search type': CustomSearch.Titles,
|
||||
'custom/display footer': True,
|
||||
'custom/add custom from service': True,
|
||||
'custom/status': PluginStatus.Inactive,
|
||||
'formattingTags/html_tags': '',
|
||||
'core/auto open': False,
|
||||
'core/auto preview': False,
|
||||
@ -207,6 +257,16 @@ class Settings(QtCore.QSettings):
|
||||
'core/monitor': {},
|
||||
'core/application version': '0.0',
|
||||
'images/background color': '#000000',
|
||||
'images/db type': 'sqlite',
|
||||
'images/db username': '',
|
||||
'images/db password': '',
|
||||
'images/db hostname': '',
|
||||
'images/db database': '',
|
||||
'images/last directory': None,
|
||||
'images/status': PluginStatus.Inactive,
|
||||
'media/status': PluginStatus.Inactive,
|
||||
'media/media files': [],
|
||||
'media/last directory': None,
|
||||
'media/media auto start': QtCore.Qt.Unchecked,
|
||||
'media/stream command': '',
|
||||
'media/vlc arguments': '',
|
||||
@ -216,6 +276,22 @@ class Settings(QtCore.QSettings):
|
||||
'media/preview volume': 0,
|
||||
'remotes/download version': '0.0',
|
||||
'players/background color': '#000000',
|
||||
'planningcenter/status': PluginStatus.Inactive,
|
||||
'planningcenter/application_id': '',
|
||||
'planningcenter/secret': '',
|
||||
'presentations/status': PluginStatus.Inactive,
|
||||
'presentations/override app': QtCore.Qt.Unchecked,
|
||||
'presentations/enable_pdf_program': QtCore.Qt.Unchecked,
|
||||
'presentations/pdf_program': None,
|
||||
'presentations/maclo': QtCore.Qt.Checked,
|
||||
'presentations/Impress': QtCore.Qt.Checked,
|
||||
'presentations/Powerpoint': QtCore.Qt.Checked,
|
||||
'presentations/Pdf': QtCore.Qt.Checked,
|
||||
'presentations/presentations files': [],
|
||||
'presentations/thumbnail_scheme': '',
|
||||
'presentations/powerpoint slide click advance': QtCore.Qt.Unchecked,
|
||||
'presentations/powerpoint control window': QtCore.Qt.Unchecked,
|
||||
'presentations/last directory': None,
|
||||
'servicemanager/last directory': None,
|
||||
'servicemanager/last file': None,
|
||||
'servicemanager/service theme': None,
|
||||
@ -223,6 +299,37 @@ class Settings(QtCore.QSettings):
|
||||
'SettingsImport/Make_Changes': 'At_Own_RISK',
|
||||
'SettingsImport/type': 'OpenLP_settings_export',
|
||||
'SettingsImport/version': '',
|
||||
'songs/status': PluginStatus.Inactive,
|
||||
'songs/db type': 'sqlite',
|
||||
'songs/db username': '',
|
||||
'songs/db password': '',
|
||||
'songs/db hostname': '',
|
||||
'songs/db database': '',
|
||||
'songs/last used search type': SongSearch.Entire,
|
||||
'songs/last import type': None,
|
||||
'songs/update service on edit': False,
|
||||
'songs/add song from service': True,
|
||||
'songs/add songbook slide': False,
|
||||
'songs/display songbar': True,
|
||||
'songs/last directory import': None,
|
||||
'songs/last directory export': None,
|
||||
'songs/songselect username': '',
|
||||
'songs/songselect password': '',
|
||||
'songs/songselect searches': '',
|
||||
'songs/enable chords': True,
|
||||
'songs/chord notation': 'english', # Can be english, german or neo-latin
|
||||
'songs/mainview chords': False,
|
||||
'songs/disable chords import': False,
|
||||
'songusage/status': PluginStatus.Inactive,
|
||||
'songusage/db type': 'sqlite',
|
||||
'songusage/db username': '',
|
||||
'songusage/db password': '',
|
||||
'songusage/db hostname': '',
|
||||
'songusage/db database': '',
|
||||
'songusage/active': False,
|
||||
'songusage/to date': TODAY,
|
||||
'songusage/from date': TODAY.addYears(-1),
|
||||
'songusage/last directory export': None,
|
||||
'themes/global theme': '',
|
||||
'themes/last directory': None,
|
||||
'themes/last directory export': None,
|
||||
|
@ -23,6 +23,7 @@ Provide the generic plugin functionality for OpenLP plugins.
|
||||
"""
|
||||
import logging
|
||||
|
||||
from openlp.core.common.enum import PluginStatus
|
||||
from openlp.core.common.i18n import UiStrings
|
||||
from openlp.core.common.mixins import RegistryProperties
|
||||
from openlp.core.common.registry import Registry, RegistryBase
|
||||
@ -33,15 +34,6 @@ from openlp.core.version import get_version
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class PluginStatus(object):
|
||||
"""
|
||||
Defines the status of the plugin
|
||||
"""
|
||||
Active = 1
|
||||
Inactive = 0
|
||||
Disabled = -1
|
||||
|
||||
|
||||
class StringContent(object):
|
||||
"""
|
||||
Provide standard strings for objects to use.
|
||||
@ -145,15 +137,17 @@ class Plugin(RegistryBase, RegistryProperties):
|
||||
self.media_item = None
|
||||
self.weight = 0
|
||||
self.status = PluginStatus.Inactive
|
||||
# Add the default status to the default settings.
|
||||
default_settings[name + '/status'] = PluginStatus.Inactive
|
||||
default_settings[name + '/last directory'] = None
|
||||
# Append a setting for files in the mediamanager (note not all plugins
|
||||
# which have a mediamanager need this).
|
||||
if media_item_class is not None:
|
||||
default_settings['{name}/{name} files'.format(name=name)] = []
|
||||
# Add settings to the dict of all settings.
|
||||
Settings.extend_default_settings(default_settings)
|
||||
if default_settings:
|
||||
# Add the default status to the default settings.
|
||||
default_settings[name + '/status'] = PluginStatus.Inactive
|
||||
default_settings[name + '/last directory'] = None
|
||||
# Add settings to the dict of all settings.
|
||||
Settings.extend_default_settings(default_settings)
|
||||
# Append a setting for files in the mediamanager (note not all plugins
|
||||
# which have a mediamanager need this).
|
||||
if media_item_class is not None:
|
||||
default_settings['{name}/{name} files'.format(name=name)] = []
|
||||
|
||||
Registry().register_function('{name}_add_service_item'.format(name=self.name), self.process_add_service_event)
|
||||
Registry().register_function('{name}_config_updated'.format(name=self.name), self.config_update)
|
||||
self._setup(version)
|
||||
|
@ -21,12 +21,9 @@
|
||||
|
||||
import logging
|
||||
|
||||
from PyQt5 import QtGui
|
||||
|
||||
from openlp.core.state import State
|
||||
from openlp.core.api.http import register_endpoint
|
||||
from openlp.core.common.actions import ActionList
|
||||
from openlp.core.common.enum import AlertLocation
|
||||
from openlp.core.common.i18n import UiStrings, translate
|
||||
from openlp.core.common.settings import Settings
|
||||
from openlp.core.lib.db import Manager
|
||||
@ -114,22 +111,6 @@ HTML = """
|
||||
<div id="alert" style="visibility:hidden"></div>
|
||||
"""
|
||||
|
||||
__default_settings__ = {
|
||||
'alerts/font face': QtGui.QFont().family(),
|
||||
'alerts/font size': 40,
|
||||
'alerts/db type': 'sqlite',
|
||||
'alerts/db username': '',
|
||||
'alerts/db password': '',
|
||||
'alerts/db hostname': '',
|
||||
'alerts/db database': '',
|
||||
'alerts/location': AlertLocation.Bottom,
|
||||
'alerts/background color': '#660000',
|
||||
'alerts/font color': '#ffffff',
|
||||
'alerts/timeout': 10,
|
||||
'alerts/repeat': 1,
|
||||
'alerts/scroll': True
|
||||
}
|
||||
|
||||
|
||||
class AlertsPlugin(Plugin):
|
||||
"""
|
||||
@ -141,7 +122,7 @@ class AlertsPlugin(Plugin):
|
||||
"""
|
||||
Class __init__ method
|
||||
"""
|
||||
super(AlertsPlugin, self).__init__('alerts', __default_settings__, settings_tab_class=AlertsTab)
|
||||
super(AlertsPlugin, self).__init__('alerts', None, settings_tab_class=AlertsTab)
|
||||
self.weight = -3
|
||||
self.icon_path = UiIcons().alert
|
||||
self.icon = self.icon_path
|
||||
|
@ -24,7 +24,6 @@ import logging
|
||||
from openlp.core.state import State
|
||||
from openlp.core.api.http import register_endpoint
|
||||
from openlp.core.common.actions import ActionList
|
||||
from openlp.core.common.enum import BibleSearch, LayoutStyle, DisplayStyle, LanguageSelection
|
||||
from openlp.core.common.i18n import UiStrings, translate
|
||||
from openlp.core.ui.icons import UiIcons
|
||||
from openlp.core.lib.plugin import Plugin, StringContent
|
||||
@ -38,32 +37,6 @@ from openlp.plugins.bibles.lib.mediaitem import BibleMediaItem
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
__default_settings__ = {
|
||||
'bibles/db type': 'sqlite',
|
||||
'bibles/db username': '',
|
||||
'bibles/db password': '',
|
||||
'bibles/db hostname': '',
|
||||
'bibles/db database': '',
|
||||
'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,
|
||||
'bibles/display brackets': DisplayStyle.NoBrackets,
|
||||
'bibles/is verse number visible': True,
|
||||
'bibles/display new chapter': False,
|
||||
'bibles/second bibles': True,
|
||||
'bibles/primary bible': '',
|
||||
'bibles/bible theme': '',
|
||||
'bibles/verse separator': '',
|
||||
'bibles/range separator': '',
|
||||
'bibles/list separator': '',
|
||||
'bibles/end separator': '',
|
||||
'bibles/last directory import': None,
|
||||
'bibles/hide combined quick error': False,
|
||||
'bibles/is search while typing enabled': True
|
||||
}
|
||||
|
||||
|
||||
class BiblePlugin(Plugin):
|
||||
"""
|
||||
The Bible plugin provides a plugin for managing and displaying Bibles.
|
||||
@ -71,7 +44,7 @@ class BiblePlugin(Plugin):
|
||||
log.info('Bible Plugin loaded')
|
||||
|
||||
def __init__(self):
|
||||
super(BiblePlugin, self).__init__('bibles', __default_settings__, BibleMediaItem, BiblesTab)
|
||||
super(BiblePlugin, self).__init__('bibles', None, BibleMediaItem, BiblesTab)
|
||||
self.weight = -9
|
||||
self.icon_path = UiIcons().bible
|
||||
self.icon = UiIcons().bible
|
||||
|
@ -27,7 +27,6 @@ import logging
|
||||
|
||||
from openlp.core.state import State
|
||||
from openlp.core.api.http import register_endpoint
|
||||
from openlp.core.common.enum import CustomSearch
|
||||
from openlp.core.common.i18n import translate
|
||||
from openlp.core.lib import build_icon
|
||||
from openlp.core.lib.db import Manager
|
||||
@ -41,17 +40,6 @@ from openlp.plugins.custom.lib.customtab import CustomTab
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
__default_settings__ = {
|
||||
'custom/db type': 'sqlite',
|
||||
'custom/db username': '',
|
||||
'custom/db password': '',
|
||||
'custom/db hostname': '',
|
||||
'custom/db database': '',
|
||||
'custom/last used search type': CustomSearch.Titles,
|
||||
'custom/display footer': True,
|
||||
'custom/add custom from service': True
|
||||
}
|
||||
|
||||
|
||||
class CustomPlugin(Plugin):
|
||||
"""
|
||||
@ -63,7 +51,7 @@ class CustomPlugin(Plugin):
|
||||
log.info('Custom Plugin loaded')
|
||||
|
||||
def __init__(self):
|
||||
super(CustomPlugin, self).__init__('custom', __default_settings__, CustomMediaItem, CustomTab)
|
||||
super(CustomPlugin, self).__init__('custom', None, CustomMediaItem, CustomTab)
|
||||
self.weight = -5
|
||||
self.db_manager = Manager('custom', init_schema)
|
||||
self.icon_path = UiIcons().clone
|
||||
|
@ -40,22 +40,12 @@ from openlp.plugins.images.lib.db import init_schema
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
__default_settings__ = {
|
||||
'images/db type': 'sqlite',
|
||||
'images/db username': '',
|
||||
'images/db password': '',
|
||||
'images/db hostname': '',
|
||||
'images/db database': '',
|
||||
'images/background color': '#000000',
|
||||
'images/last directory': None
|
||||
}
|
||||
|
||||
|
||||
class ImagePlugin(Plugin):
|
||||
log.info('Image Plugin loaded')
|
||||
|
||||
def __init__(self):
|
||||
super(ImagePlugin, self).__init__('images', __default_settings__, ImageMediaItem, ImageTab)
|
||||
super(ImagePlugin, self).__init__('images', None, ImageMediaItem, ImageTab)
|
||||
self.manager = Manager('images', init_schema, upgrade_mod=upgrade)
|
||||
self.weight = -7
|
||||
self.icon_path = UiIcons().picture
|
||||
|
@ -37,11 +37,6 @@ log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
# Some settings starting with "media" are in core, because they are needed for core functionality.
|
||||
__default_settings__ = {
|
||||
'media/media files': [],
|
||||
'media/last directory': None
|
||||
}
|
||||
|
||||
|
||||
class MediaPlugin(Plugin):
|
||||
"""
|
||||
@ -50,7 +45,7 @@ class MediaPlugin(Plugin):
|
||||
log.info('{name} MediaPlugin loaded'.format(name=__name__))
|
||||
|
||||
def __init__(self):
|
||||
super(MediaPlugin, self).__init__('media', __default_settings__, MediaMediaItem)
|
||||
super(MediaPlugin, self).__init__('media', None, MediaMediaItem)
|
||||
self.weight = -6
|
||||
self.icon_path = UiIcons().video
|
||||
self.icon = build_icon(self.icon_path)
|
||||
|
@ -38,11 +38,6 @@ from openlp.plugins.songs.lib.db import Song
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
__default_settings__ = {
|
||||
'planningcenter/application_id': '',
|
||||
'planningcenter/secret': ''
|
||||
}
|
||||
|
||||
|
||||
class PlanningCenterPlugin(Plugin):
|
||||
"""
|
||||
@ -54,8 +49,7 @@ class PlanningCenterPlugin(Plugin):
|
||||
"""
|
||||
Create and set up the PlanningCenter plugin.
|
||||
"""
|
||||
super(PlanningCenterPlugin, self).__init__('planningcenter', __default_settings__,
|
||||
settings_tab_class=PlanningCenterTab)
|
||||
super(PlanningCenterPlugin, self).__init__('planningcenter', None, settings_tab_class=PlanningCenterTab)
|
||||
self.planningcenter_form = None
|
||||
self.icon = UiIcons().planning_center
|
||||
self.icon_path = self.icon
|
||||
|
@ -25,8 +25,6 @@ presentations from a variety of document formats.
|
||||
import logging
|
||||
import os
|
||||
|
||||
from PyQt5 import QtCore
|
||||
|
||||
from openlp.core.api.http import register_endpoint
|
||||
from openlp.core.common import extension_loader
|
||||
from openlp.core.common.i18n import translate
|
||||
@ -44,22 +42,6 @@ from openlp.plugins.presentations.lib.presentationtab import PresentationTab
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
__default_settings__ = {
|
||||
'presentations/override app': QtCore.Qt.Unchecked,
|
||||
'presentations/enable_pdf_program': QtCore.Qt.Unchecked,
|
||||
'presentations/pdf_program': None,
|
||||
'presentations/maclo': QtCore.Qt.Checked,
|
||||
'presentations/Impress': QtCore.Qt.Checked,
|
||||
'presentations/Powerpoint': QtCore.Qt.Checked,
|
||||
'presentations/Pdf': QtCore.Qt.Checked,
|
||||
'presentations/presentations files': [],
|
||||
'presentations/thumbnail_scheme': '',
|
||||
'presentations/powerpoint slide click advance': QtCore.Qt.Unchecked,
|
||||
'presentations/powerpoint control window': QtCore.Qt.Unchecked,
|
||||
'presentations/last directory': None
|
||||
}
|
||||
|
||||
|
||||
class PresentationPlugin(Plugin):
|
||||
"""
|
||||
This plugin allowed a Presentation to be opened, controlled and displayed on the output display. The plugin controls
|
||||
@ -73,7 +55,7 @@ class PresentationPlugin(Plugin):
|
||||
"""
|
||||
log.debug('Initialised')
|
||||
self.controllers = {}
|
||||
Plugin.__init__(self, 'presentations', __default_settings__, __default_settings__)
|
||||
Plugin.__init__(self, 'presentations', None, None)
|
||||
self.weight = -8
|
||||
self.icon_path = UiIcons().presentation
|
||||
self.icon = build_icon(self.icon_path)
|
||||
|
@ -33,7 +33,6 @@ from PyQt5 import QtCore, QtWidgets
|
||||
from openlp.core.state import State
|
||||
from openlp.core.api.http import register_endpoint
|
||||
from openlp.core.common.actions import ActionList
|
||||
from openlp.core.common.enum import SongSearch
|
||||
from openlp.core.common.i18n import UiStrings, translate
|
||||
from openlp.core.common.registry import Registry
|
||||
from openlp.core.lib import build_icon
|
||||
@ -55,26 +54,6 @@ from openlp.plugins.songs.lib.songstab import SongsTab
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
__default_settings__ = {
|
||||
'songs/db type': 'sqlite',
|
||||
'songs/db username': '',
|
||||
'songs/db password': '',
|
||||
'songs/db hostname': '',
|
||||
'songs/db database': '',
|
||||
'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,
|
||||
'songs/add songbook slide': False,
|
||||
'songs/display songbar': True,
|
||||
'songs/last directory import': None,
|
||||
'songs/last directory export': None,
|
||||
'songs/songselect username': '',
|
||||
'songs/songselect password': '',
|
||||
'songs/songselect searches': '',
|
||||
'songs/enable chords': True,
|
||||
'songs/chord notation': 'english', # Can be english, german or neo-latin
|
||||
'songs/mainview chords': False,
|
||||
'songs/disable chords import': False,
|
||||
'songs/footer template': """\
|
||||
${title}<br/>
|
||||
|
||||
@ -152,6 +131,8 @@ class SongsPlugin(Plugin):
|
||||
register_endpoint(api_songs_endpoint)
|
||||
State().add_service(self.name, self.weight, is_plugin=True)
|
||||
State().update_pre_conditions(self.name, self.check_pre_conditions())
|
||||
if not self.settings.value('songs/last import type'):
|
||||
self.settings.setValue('songs/last import type', SongFormat.OpenLyrics)
|
||||
|
||||
def check_pre_conditions(self):
|
||||
"""
|
||||
|
@ -43,18 +43,6 @@ log = logging.getLogger(__name__)
|
||||
|
||||
TODAY = QtCore.QDate.currentDate()
|
||||
|
||||
__default_settings__ = {
|
||||
'songusage/db type': 'sqlite',
|
||||
'songusage/db username': '',
|
||||
'songusage/db password': '',
|
||||
'songusage/db hostname': '',
|
||||
'songusage/db database': '',
|
||||
'songusage/active': False,
|
||||
'songusage/to date': TODAY,
|
||||
'songusage/from date': TODAY.addYears(-1),
|
||||
'songusage/last directory export': None
|
||||
}
|
||||
|
||||
|
||||
class SongUsagePlugin(Plugin):
|
||||
"""
|
||||
@ -63,7 +51,7 @@ class SongUsagePlugin(Plugin):
|
||||
log.info('SongUsage Plugin loaded')
|
||||
|
||||
def __init__(self):
|
||||
super(SongUsagePlugin, self).__init__('songusage', __default_settings__)
|
||||
super(SongUsagePlugin, self).__init__('songusage', None)
|
||||
self.manager = Manager('songusage', init_schema, upgrade_mod=upgrade)
|
||||
self.weight = -4
|
||||
self.icon = UiIcons().song_usage
|
||||
|
11300
resources/i18n/af.ts
11300
resources/i18n/af.ts
File diff suppressed because it is too large
Load Diff
11296
resources/i18n/bg.ts
11296
resources/i18n/bg.ts
File diff suppressed because it is too large
Load Diff
11333
resources/i18n/cs.ts
11333
resources/i18n/cs.ts
File diff suppressed because it is too large
Load Diff
11303
resources/i18n/da.ts
11303
resources/i18n/da.ts
File diff suppressed because it is too large
Load Diff
11354
resources/i18n/de.ts
11354
resources/i18n/de.ts
File diff suppressed because it is too large
Load Diff
11293
resources/i18n/el.ts
11293
resources/i18n/el.ts
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
11376
resources/i18n/en_GB.ts
11376
resources/i18n/en_GB.ts
File diff suppressed because it is too large
Load Diff
11498
resources/i18n/fi.ts
11498
resources/i18n/fi.ts
File diff suppressed because it is too large
Load Diff
11308
resources/i18n/fr.ts
11308
resources/i18n/fr.ts
File diff suppressed because it is too large
Load Diff
11371
resources/i18n/hu.ts
11371
resources/i18n/hu.ts
File diff suppressed because it is too large
Load Diff
11311
resources/i18n/id.ts
11311
resources/i18n/id.ts
File diff suppressed because it is too large
Load Diff
11318
resources/i18n/ja.ts
11318
resources/i18n/ja.ts
File diff suppressed because it is too large
Load Diff
11295
resources/i18n/ko.ts
11295
resources/i18n/ko.ts
File diff suppressed because it is too large
Load Diff
11350
resources/i18n/nb.ts
11350
resources/i18n/nb.ts
File diff suppressed because it is too large
Load Diff
11307
resources/i18n/nl.ts
11307
resources/i18n/nl.ts
File diff suppressed because it is too large
Load Diff
11344
resources/i18n/pl.ts
11344
resources/i18n/pl.ts
File diff suppressed because it is too large
Load Diff
11351
resources/i18n/pt_BR.ts
11351
resources/i18n/pt_BR.ts
File diff suppressed because it is too large
Load Diff
11302
resources/i18n/ro.ts
11302
resources/i18n/ro.ts
File diff suppressed because it is too large
Load Diff
11302
resources/i18n/ru.ts
11302
resources/i18n/ru.ts
File diff suppressed because it is too large
Load Diff
11349
resources/i18n/sk.ts
11349
resources/i18n/sk.ts
File diff suppressed because it is too large
Load Diff
11307
resources/i18n/sl.ts
11307
resources/i18n/sl.ts
File diff suppressed because it is too large
Load Diff
11334
resources/i18n/sv.ts
11334
resources/i18n/sv.ts
File diff suppressed because it is too large
Load Diff
11294
resources/i18n/ta_LK.ts
11294
resources/i18n/ta_LK.ts
File diff suppressed because it is too large
Load Diff
11294
resources/i18n/th_TH.ts
11294
resources/i18n/th_TH.ts
File diff suppressed because it is too large
Load Diff
11297
resources/i18n/zh_TW.ts
11297
resources/i18n/zh_TW.ts
File diff suppressed because it is too large
Load Diff
@ -50,6 +50,7 @@ class TestPluginManager(TestCase):
|
||||
Registry().register('service_list', MagicMock())
|
||||
Registry().register('main_window', self.mocked_main_window)
|
||||
Registry().register('settings_form', self.mocked_settings_form)
|
||||
Registry().register('settings', MagicMock())
|
||||
|
||||
def test_bootstrap_initialise(self):
|
||||
"""
|
||||
|
@ -26,9 +26,7 @@ from tempfile import mkdtemp
|
||||
from unittest import TestCase
|
||||
from unittest.mock import MagicMock, call, patch
|
||||
|
||||
from openlp.core.common.settings import Settings
|
||||
from openlp.plugins.presentations.lib.impresscontroller import ImpressController, ImpressDocument, TextType
|
||||
from openlp.plugins.presentations.presentationplugin import __default_settings__
|
||||
from tests.helpers.testmixin import TestMixin
|
||||
from tests.utils.constants import RESOURCE_PATH
|
||||
|
||||
@ -168,7 +166,6 @@ class TestImpressDocument(TestCase):
|
||||
def setUp(self):
|
||||
mocked_plugin = MagicMock()
|
||||
mocked_plugin.settings_section = 'presentations'
|
||||
Settings().extend_default_settings(__default_settings__)
|
||||
self.file_name = RESOURCE_PATH / 'presentations' / 'test.pptx'
|
||||
self.ppc = ImpressController(mocked_plugin)
|
||||
self.doc = ImpressDocument(self.ppc, self.file_name)
|
||||
|
@ -27,10 +27,8 @@ from unittest import TestCase, SkipTest
|
||||
from unittest.mock import MagicMock, patch, call
|
||||
|
||||
from openlp.core.common import is_macosx
|
||||
from openlp.core.common.settings import Settings
|
||||
from openlp.core.common.path import Path
|
||||
from openlp.plugins.presentations.lib.maclocontroller import MacLOController, MacLODocument
|
||||
from openlp.plugins.presentations.presentationplugin import __default_settings__
|
||||
|
||||
from tests.helpers.testmixin import TestMixin
|
||||
from tests.utils.constants import TEST_RESOURCES_PATH
|
||||
@ -159,7 +157,6 @@ class TestMacLODocument(TestCase):
|
||||
def setUp(self):
|
||||
mocked_plugin = MagicMock()
|
||||
mocked_plugin.settings_section = 'presentations'
|
||||
Settings().extend_default_settings(__default_settings__)
|
||||
self.file_name = Path(TEST_RESOURCES_PATH) / 'presentations' / 'test.odp'
|
||||
self.mocked_client = MagicMock()
|
||||
with patch('openlp.plugins.presentations.lib.maclocontroller.MacLOController._start_server'):
|
||||
|
Loading…
Reference in New Issue
Block a user