openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #15709
Re: [Merge] lp:~smpettit/openlp/portable into lp:openlp
Hi Stevan,
Did you know you can do: bzr diff?
http://doc.bazaar.canonical.com/bzr.2.2/en/user-reference/diff-help.html
Phill
On May 21, 2012 2:37 AM, "Stevan Pettit" <openlp@xxxxxxxxxxxxxxx> wrote:
> Stevan Pettit has proposed merging lp:~smpettit/openlp/portable into
> lp:openlp.
>
> Requested reviews:
> OpenLP Core (openlp-core)
>
> For more details, see:
> https://code.launchpad.net/~smpettit/openlp/portable/+merge/106555
>
> Dummy proposal to review changes made
> --
> https://code.launchpad.net/~smpettit/openlp/portable/+merge/106555
> You are subscribed to branch lp:openlp.
>
> === modified file 'openlp/core/__init__.py'
> --- openlp/core/__init__.py 2012-04-28 13:51:05 +0000
> +++ openlp/core/__init__.py 2012-05-21 01:36:20 +0000
> @@ -41,6 +41,7 @@
> from PyQt4 import QtCore, QtGui
>
> from openlp.core.lib import Receiver, check_directory_exists
> +from openlp.core.lib.settings import Settings
> from openlp.core.lib.ui import UiStrings
> from openlp.core.resources import qInitResources
> from openlp.core.ui.mainwindow import MainWindow
> @@ -48,7 +49,7 @@
> from openlp.core.ui.firsttimeform import FirstTimeForm
> from openlp.core.ui.exceptionform import ExceptionForm
> from openlp.core.ui import SplashScreen, ScreenList
> -from openlp.core.utils import AppLocation, LanguageManager,
> VersionThread, \
> +from openlp.core.utils import AppLocation, LanguageManager,
> VersionThread,\
> get_application_version
>
>
> @@ -111,15 +112,15 @@
> # Decide how many screens we have and their size
> screens = ScreenList(self.desktop())
> # First time checks in settings
> - has_run_wizard = QtCore.QSettings().value(
> + has_run_wizard = Settings().value(
> u'general/has run wizard', QtCore.QVariant(False)).toBool()
> if not has_run_wizard:
> if FirstTimeForm(screens).exec_() == QtGui.QDialog.Accepted:
> - QtCore.QSettings().setValue(u'general/has run wizard',
> + Settings().setValue(u'general/has run wizard',
> QtCore.QVariant(True))
> if os.name == u'nt':
> self.setStyleSheet(application_stylesheet)
> - show_splash = QtCore.QSettings().value(
> + show_splash = Settings().value(
> u'general/show splash', QtCore.QVariant(True)).toBool()
> if show_splash:
> self.splash = SplashScreen()
> @@ -139,7 +140,7 @@
> self.processEvents()
> if not has_run_wizard:
> self.mainWindow.firstTime()
> - update_check = QtCore.QSettings().value(
> + update_check = Settings().value(
> u'general/update check', QtCore.QVariant(True)).toBool()
> if update_check:
> VersionThread(self.mainWindow).start()
> @@ -256,7 +257,28 @@
> app = OpenLP(qt_args)
> app.setOrganizationName(u'OpenLP')
> app.setOrganizationDomain(u'openlp.org')
> - app.setApplicationName(u'OpenLP')
> + if options.portable:
> + log.info(u'Running portable')
> + app.setApplicationName(u'OpenLPPortable')
> + QtCore.QSettings.setDefaultFormat(QtCore.QSettings.IniFormat)
> + # Get location OpenLPPortable.ini
> + app_path = AppLocation.get_directory(AppLocation.AppDir)
> + portable_settings_file = os.path.abspath(os.path.join(app_path,
> u'..',
> + u'..', u'Data', u'OpenLP.ini'))
> + # Make this our settings file
> + log.info(u'INI file: %s' % portable_settings_file)
> + Settings.setFilename(portable_settings_file)
> + portable_settings = Settings()
> + # Set our data path
> + data_path = os.path.abspath(os.path.join(app_path,
> + u'..', u'..', u'Data',))
> + log.info(u'Data path: %s' % data_path)
> + # Point to our data path
> + portable_settings.setValue(u'advanced/data path',data_path)
> + portable_settings.setValue(u'advanced/is portable',True)
> + portable_settings.sync()
> + else:
> + app.setApplicationName(u'OpenLP')
> app.setApplicationVersion(get_application_version()[u'version'])
> # Instance check
> if not options.testing:
> @@ -264,7 +286,7 @@
> if app.isAlreadyRunning():
> sys.exit()
> # First time checks in settings
> - if not QtCore.QSettings().value(u'general/has run wizard',
> + if not Settings().value(u'general/has run wizard',
> QtCore.QVariant(False)).toBool():
> if not FirstTimeLanguageForm().exec_():
> # if cancel then stop processing
>
> === modified file 'openlp/core/lib/db.py'
> --- openlp/core/lib/db.py 2012-03-12 19:35:29 +0000
> +++ openlp/core/lib/db.py 2012-05-21 01:36:20 +0000
> @@ -41,6 +41,7 @@
> from openlp.core.lib import translate
> from openlp.core.lib.ui import critical_error_message_box
> from openlp.core.utils import AppLocation, delete_file
> +from openlp.core.lib.settings import Settings
>
> log = logging.getLogger(__name__)
>
> @@ -179,7 +180,7 @@
> The file name to use for this database. Defaults to None
> resulting
> in the plugin_name being used.
> """
> - settings = QtCore.QSettings()
> + settings = Settings()
> settings.beginGroup(plugin_name)
> self.db_url = u''
> self.is_dirty = False
>
> === modified file 'openlp/core/lib/formattingtags.py'
> --- openlp/core/lib/formattingtags.py 2012-05-05 16:03:40 +0000
> +++ openlp/core/lib/formattingtags.py 2012-05-21 01:36:20 +0000
> @@ -32,6 +32,7 @@
> from PyQt4 import QtCore
>
> from openlp.core.lib import translate
> +from openlp.core.lib.settings import Settings
>
>
> class FormattingTags(object):
> @@ -163,8 +164,43 @@
> FormattingTags.add_html_tags(base_tags)
> FormattingTags.add_html_tags(temporary_tags)
>
> - # Formatting Tags were also known as display tags.
> - user_expands = QtCore.QSettings().value(u'displayTags/html_tags',
> +<<<<<<< TREE
> +=======
> + @staticmethod
> + def save_html_tags():
> + """
> + Saves all formatting tags except protected ones.
> + """
> + tags = []
> + for tag in FormattingTags.html_expands:
> + if not tag[u'protected'] and not tag.get(u'temporary'):
> + # Using dict ensures that copy is made and encoding of
> values
> + # a little later does not affect tags in the original list
> + tags.append(dict(tag))
> + tag = tags[-1]
> + # Remove key 'temporary' from tags.
> + # It is not needed to be saved.
> + if u'temporary' in tag:
> + del tag[u'temporary']
> + for element in tag:
> + if isinstance(tag[element], unicode):
> + tag[element] = tag[element].encode('utf8')
> + # Formatting Tags were also known as display tags.
> + Settings().setValue(u'displayTags/html_tags',
> + QtCore.QVariant(cPickle.dumps(tags) if tags else u''))
> +
> + @staticmethod
> + def load_tags():
> + """
> + Load the Tags from store so can be used in the system or used to
> + update the display. If Cancel was selected this is needed to
> reset the
> + dsiplay to the correct version.
> + """
> + # Initial Load of the Tags
> + FormattingTags.reset_html_tags()
> +>>>>>>> MERGE-SOURCE
> + # Formatting Tags were also known as display tags.
> + user_expands = Settings().value(u'displayTags/html_tags',
> QtCore.QVariant(u'')).toString()
> # cPickle only accepts str not unicode strings
> user_expands_string = str(user_expands)
>
> === modified file 'openlp/core/lib/mediamanageritem.py'
> --- openlp/core/lib/mediamanageritem.py 2012-05-01 11:00:02 +0000
> +++ openlp/core/lib/mediamanageritem.py 2012-05-21 01:36:20 +0000
> @@ -38,6 +38,7 @@
> from openlp.core.lib.searchedit import SearchEdit
> from openlp.core.lib.ui import UiStrings, create_widget_action, \
> critical_error_message_box
> +from openlp.core.lib.settings import Settings
>
> log = logging.getLogger(__name__)
>
> @@ -462,7 +463,7 @@
> """
> Allows the list click action to be determined dynamically
> """
> - if QtCore.QSettings().value(u'advanced/double click live',
> + if Settings().value(u'advanced/double click live',
> QtCore.QVariant(False)).toBool():
> self.onLiveClick()
> else:
> @@ -472,7 +473,7 @@
> """
> Allows the change of current item in the list to be actioned
> """
> - if QtCore.QSettings().value(u'advanced/single click preview',
> + if Settings().value(u'advanced/single click preview',
> QtCore.QVariant(False)).toBool() and self.quickPreviewAllowed \
> and self.listView.selectedIndexes() \
> and self.autoSelectId == -1:
>
> === modified file 'openlp/core/lib/plugin.py'
> --- openlp/core/lib/plugin.py 2012-04-22 19:37:11 +0000
> +++ openlp/core/lib/plugin.py 2012-05-21 01:36:20 +0000
> @@ -32,6 +32,7 @@
> from PyQt4 import QtCore
>
> from openlp.core.lib import Receiver
> +from openlp.core.lib.settings import Settings
> from openlp.core.lib.ui import UiStrings
> from openlp.core.utils import get_application_version
>
> @@ -190,7 +191,7 @@
> """
> Sets the status of the plugin
> """
> - self.status = QtCore.QSettings().value(
> + self.status = Settings().value(
> self.settingsSection + u'/status',
> QtCore.QVariant(PluginStatus.Inactive)).toInt()[0]
>
> @@ -199,7 +200,7 @@
> Changes the status of the plugin and remembers it
> """
> self.status = new_status
> - QtCore.QSettings().setValue(
> + Settings().setValue(
> self.settingsSection + u'/status',
> QtCore.QVariant(self.status))
> if new_status == PluginStatus.Active:
> self.initialise()
>
> === added file 'openlp/core/lib/settings.py'
> --- openlp/core/lib/settings.py 1970-01-01 00:00:00 +0000
> +++ openlp/core/lib/settings.py 2012-05-21 01:36:20 +0000
> @@ -0,0 +1,67 @@
> +# -*- coding: utf-8 -*-
> +# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4
> softtabstop=4
> +
>
> +###############################################################################
> +# OpenLP - Open Source Lyrics Projection
> #
> +#
> ---------------------------------------------------------------------------
> #
> +# Copyright (c) 2008-2012 Raoul Snyman
> #
> +# Portions copyright (c) 2008-2012 Tim Bentley, Gerald Britton, Jonathan
> #
> +# Corwin, Michael Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan,
> #
> +# Armin Köhler, Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias
> #
> +# Põldaru, Christian Richter, Philip Ridout, Simon Scudder, Jeffrey
> Smith, #
> +# Maikel Stuivenberg, Martin Thompson, Jon Tibble, Frode Woldsund
> #
> +#
> ---------------------------------------------------------------------------
> #
> +# This program is free software; you can redistribute it and/or modify it
> #
> +# under the terms of the GNU General Public License as published by the
> Free #
> +# Software Foundation; version 2 of the License.
> #
> +#
> #
> +# This program is distributed in the hope that it will be useful, but
> WITHOUT #
> +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
> #
> +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
> for #
> +# more details.
> #
> +#
> #
> +# You should have received a copy of the GNU General Public License along
> #
> +# with this program; if not, write to the Free Software Foundation, Inc.,
> 59 #
> +# Temple Place, Suite 330, Boston, MA 02111-1307 USA
> #
>
> +###############################################################################
> +"""
> +The :mod:``settings`` module provides a thin wrapper for QSettings, which
> OpenLP
> +uses to manage settings persistence.
> +"""
> +
> +import logging
> +
> +from PyQt4 import QtCore
> +
> +log = logging.getLogger()
> +
> +class Settings(QtCore.QSettings):
> + """
> + Class to wrap QSettings.
> +
> + * Exposes all the methods of QSettings.
> + * Adds functionality for OpenLP Portable. If the ``defaultFormat`` is
> set to
> + ``IniFormat``, and the path to the Ini file is set using
> ``setFilename``,
> + then the Settings constructor will create a Settings object for
> accessing
> + settings stored in that Ini file.
> + """
> +
> + FilePath = u''
> +
> + @staticmethod
> + def setFilename(filepath):
> + """
> + Sets the complete path to an Ini file to be used by Settings
> objects.
> +
> + Does not affect existing Settings objects.
> + """
> + Settings.FilePath = filepath
> + log.info(u'Set Settings file: %s' % filepath)
> +
> + def __init__(self, *args):
> + if Settings.FilePath and (Settings.defaultFormat() ==
> + Settings.IniFormat):
> + QtCore.QSettings.__init__(self, Settings.FilePath,
> + Settings.IniFormat)
> + else:
> + QtCore.QSettings.__init__(self, *args)
>
> === modified file 'openlp/core/lib/settingsmanager.py'
> --- openlp/core/lib/settingsmanager.py 2012-04-16 07:02:24 +0000
> +++ openlp/core/lib/settingsmanager.py 2012-05-21 01:36:20 +0000
> @@ -34,6 +34,7 @@
>
> from PyQt4 import QtCore
>
> +from openlp.core.lib.settings import Settings
> from openlp.core.utils import AppLocation
>
> class SettingsManager(object):
> @@ -58,7 +59,7 @@
> name = u'last directory %d' % num
> else:
> name = u'last directory'
> - last_dir = unicode(QtCore.QSettings().value(
> + last_dir = unicode(Settings().value(
> section + u'/' + name, QtCore.QVariant(u'')).toString())
> return last_dir
>
> @@ -81,7 +82,7 @@
> name = u'last directory %d' % num
> else:
> name = u'last directory'
> - QtCore.QSettings().setValue(
> + Settings().setValue(
> section + u'/' + name, QtCore.QVariant(directory))
>
> @staticmethod
> @@ -98,7 +99,7 @@
> ``list``
> The list of values to save.
> """
> - settings = QtCore.QSettings()
> + settings = Settings()
> settings.beginGroup(section)
> old_count = settings.value(
> u'%s count' % name, QtCore.QVariant(0)).toInt()[0]
> @@ -124,7 +125,7 @@
> ``name``
> The name of the list.
> """
> - settings = QtCore.QSettings()
> + settings = Settings()
> settings.beginGroup(section)
> list_count = settings.value(
> u'%s count' % name, QtCore.QVariant(0)).toInt()[0]
>
> === modified file 'openlp/core/ui/advancedtab.py'
> --- openlp/core/ui/advancedtab.py 2012-04-22 19:37:11 +0000
> +++ openlp/core/ui/advancedtab.py 2012-05-21 01:36:20 +0000
> @@ -32,6 +32,7 @@
> from PyQt4 import QtCore, QtGui
>
> from openlp.core.lib import SettingsTab, translate, build_icon, Receiver
> +from openlp.core.lib.settings import Settings
> from openlp.core.lib.ui import UiStrings
> from openlp.core.lib import SlideLimits
> from openlp.core.utils import get_images_filter
> @@ -340,12 +341,12 @@
> """
> Load settings from disk.
> """
> - settings = QtCore.QSettings()
> + settings = Settings()
> settings.beginGroup(self.settingsSection)
> # The max recent files value does not have an interface and so
> never
> # gets actually stored in the settings therefore the default value
> of
> # 20 will always be used.
> - self.recentSpinBox.setMaximum(QtCore.QSettings().value(
> + self.recentSpinBox.setMaximum(Settings().value(
> u'max recent files', QtCore.QVariant(20)).toInt()[0])
> self.recentSpinBox.setValue(settings.value(u'recent file count',
> QtCore.QVariant(4)).toInt()[0])
> @@ -404,7 +405,7 @@
> """
> Save settings to disk.
> """
> - settings = QtCore.QSettings()
> + settings = Settings()
> settings.beginGroup(self.settingsSection)
> settings.setValue(u'default service enabled',
> self.serviceNameCheckBox.isChecked())
>
> === modified file 'openlp/core/ui/firsttimeform.py'
> --- openlp/core/ui/firsttimeform.py 2012-04-02 00:19:16 +0000
> +++ openlp/core/ui/firsttimeform.py 2012-05-21 01:36:20 +0000
> @@ -39,6 +39,7 @@
>
> from openlp.core.lib import translate, PluginStatus, Receiver,
> build_icon, \
> check_directory_exists
> +from openlp.core.lib.settings import Settings
> from openlp.core.utils import get_web_page, AppLocation
> from firsttimewizard import Ui_FirstTimeWizard, FirstTimePage
>
> @@ -113,7 +114,7 @@
> check_directory_exists(os.path.join(gettempdir(), u'openlp'))
> self.noInternetFinishButton.setVisible(False)
> # Check if this is a re-run of the wizard.
> - self.hasRunWizard = QtCore.QSettings().value(
> + self.hasRunWizard = Settings().value(
> u'general/has run wizard', QtCore.QVariant(False)).toBool()
> # Sort out internet access for downloads
> if self.webAccess:
> @@ -206,7 +207,7 @@
> index = self.themeComboBox.findText(theme)
> if index == -1:
> self.themeComboBox.addItem(theme)
> - default_theme = unicode(QtCore.QSettings().value(
> + default_theme = unicode(Settings().value(
> u'themes/global theme',
> QtCore.QVariant(u'')).toString())
> # Pre-select the current default theme.
> @@ -257,7 +258,7 @@
> self._performWizard()
> Receiver.send_message(u'openlp_process_events')
> Receiver.send_message(u'cursor_normal')
> - QtCore.QSettings().setValue(u'general/has run wizard',
> + Settings().setValue(u'general/has run wizard',
> QtCore.QVariant(True))
> self.close()
>
> @@ -456,16 +457,16 @@
> os.path.join(themes_destination, theme))
> # Set Default Display
> if self.displayComboBox.currentIndex() != -1:
> - QtCore.QSettings().setValue(u'General/monitor',
> + Settings().setValue(u'General/monitor',
> QtCore.QVariant(self.displayComboBox.currentIndex()))
> self.screens.set_current_display(
> self.displayComboBox.currentIndex())
> # Set Global Theme
> if self.themeComboBox.currentIndex() != -1:
> - QtCore.QSettings().setValue(u'themes/global theme',
> + Settings().setValue(u'themes/global theme',
> QtCore.QVariant(self.themeComboBox.currentText()))
>
> def _setPluginStatus(self, field, tag):
> status = PluginStatus.Active if field.checkState() \
> == QtCore.Qt.Checked else PluginStatus.Inactive
> - QtCore.QSettings().setValue(tag, QtCore.QVariant(status))
> + Settings().setValue(tag, QtCore.QVariant(status))
>
> === modified file 'openlp/core/ui/generaltab.py'
> --- openlp/core/ui/generaltab.py 2012-04-22 19:37:11 +0000
> +++ openlp/core/ui/generaltab.py 2012-05-21 01:36:20 +0000
> @@ -30,6 +30,7 @@
>
> from openlp.core.lib import SettingsTab, Receiver, translate
> from openlp.core.lib.ui import UiStrings
> +from openlp.core.lib.settings import Settings
> from openlp.core.ui import ScreenList
>
> log = logging.getLogger(__name__)
> @@ -265,7 +266,7 @@
> """
> Load the settings to populate the form
> """
> - settings = QtCore.QSettings()
> + settings = Settings()
> settings.beginGroup(self.settingsSection)
> self.monitorComboBox.clear()
> self.monitorComboBox.addItems(self.screens.get_screen_list())
> @@ -327,7 +328,7 @@
> """
> Save the settings from the form
> """
> - settings = QtCore.QSettings()
> + settings = Settings()
> settings.beginGroup(self.settingsSection)
> settings.setValue(u'monitor',
> QtCore.QVariant(self.monitorComboBox.currentIndex()))
>
> === modified file 'openlp/core/ui/maindisplay.py'
> --- openlp/core/ui/maindisplay.py 2012-04-09 10:22:47 +0000
> +++ openlp/core/ui/maindisplay.py 2012-05-21 01:36:20 +0000
> @@ -38,6 +38,7 @@
> from openlp.core.lib import Receiver, build_html, ServiceItem,
> image_to_byte, \
> translate, PluginManager, expand_tags
> from openlp.core.lib.theme import BackgroundType
> +from openlp.core.lib.settings import Settings
>
> from openlp.core.ui import HideMode, ScreenList, AlertLocation
>
> @@ -134,7 +135,7 @@
> self.setStyleSheet(u'border: 0px; margin: 0px; padding: 0px;')
> windowFlags = QtCore.Qt.FramelessWindowHint | QtCore.Qt.Tool | \
> QtCore.Qt.WindowStaysOnTopHint
> - if QtCore.QSettings().value(u'advanced/x11 bypass wm',
> + if Settings().value(u'advanced/x11 bypass wm',
> QtCore.QVariant(True)).toBool():
> windowFlags |= QtCore.Qt.X11BypassWindowManagerHint
> # FIXME: QtCore.Qt.SplashScreen is workaround to make display
> screen
> @@ -195,11 +196,11 @@
> Display.setup(self)
> if self.isLive:
> # Build the initial frame.
> - image_file = QtCore.QSettings().value(u'advanced/default
> image',
> + image_file = Settings().value(u'advanced/default image',
> QtCore.QVariant(u':/graphics/openlp-splash-screen.png'))\
> .toString()
> background_color = QtGui.QColor()
> - background_color.setNamedColor(QtCore.QSettings().value(
> + background_color.setNamedColor(Settings().value(
> u'advanced/default color',
> QtCore.QVariant(u'#ffffff')).toString())
> if not background_color.isValid():
> @@ -352,7 +353,7 @@
> # Single screen active
> if self.screens.display_count == 1:
> # Only make visible if setting enabled.
> - if QtCore.QSettings().value(u'general/display on
> monitor',
> + if Settings().value(u'general/display on monitor',
> QtCore.QVariant(True)).toBool():
> self.setVisible(True)
> else:
> @@ -401,7 +402,7 @@
> self.footer(serviceItem.foot_text)
> # if was hidden keep it hidden
> if self.hideMode and self.isLive and not serviceItem.is_media():
> - if QtCore.QSettings().value(u'general/auto unblank',
> + if Settings().value(u'general/auto unblank',
> QtCore.QVariant(False)).toBool():
> Receiver.send_message(u'slidecontroller_live_unblank')
> else:
> @@ -425,7 +426,7 @@
> log.debug(u'hideDisplay mode = %d', mode)
> if self.screens.display_count == 1:
> # Only make visible if setting enabled.
> - if not QtCore.QSettings().value(u'general/display on monitor',
> + if not Settings().value(u'general/display on monitor',
> QtCore.QVariant(True)).toBool():
> return
> if mode == HideMode.Screen:
> @@ -450,7 +451,7 @@
> log.debug(u'showDisplay')
> if self.screens.display_count == 1:
> # Only make visible if setting enabled.
> - if not QtCore.QSettings().value(u'general/display on monitor',
> + if not Settings().value(u'general/display on monitor',
> QtCore.QVariant(True)).toBool():
> return
> self.frame.evaluateJavaScript('show_blank("show");')
> @@ -465,7 +466,7 @@
> """
> Hide mouse cursor when moved over display.
> """
> - if QtCore.QSettings().value(u'advanced/hide mouse',
> + if Settings().value(u'advanced/hide mouse',
> QtCore.QVariant(False)).toBool():
> self.setCursor(QtCore.Qt.BlankCursor)
> self.frame.evaluateJavaScript('document.body.style.cursor =
> "none"')
>
> === modified file 'openlp/core/ui/mainwindow.py'
> --- openlp/core/ui/mainwindow.py 2012-04-29 15:31:56 +0000
> +++ openlp/core/ui/mainwindow.py 2012-05-21 01:36:20 +0000
> @@ -29,6 +29,8 @@
> import os
> import sys
> import shutil
> +from distutils import dir_util
> +from distutils.errors import DistutilsFileError
> from tempfile import gettempdir
> from datetime import datetime
>
> @@ -37,6 +39,7 @@
> from openlp.core.lib import Renderer, build_icon, OpenLPDockWidget, \
> PluginManager, Receiver, translate, ImageManager, PluginStatus
> from openlp.core.lib.ui import UiStrings, create_action
> +from openlp.core.lib.settings import Settings
> from openlp.core.lib import SlideLimits
> from openlp.core.ui import AboutForm, SettingsForm, ServiceManager, \
> ThemeManager, SlideController, PluginForm, MediaDockManager, \
> @@ -99,12 +102,12 @@
> # Create slide controllers
> self.previewController = SlideController(self)
> self.liveController = SlideController(self, True)
> - previewVisible = QtCore.QSettings().value(
> + previewVisible = Settings().value(
> u'user interface/preview panel',
> QtCore.QVariant(True)).toBool()
> self.previewController.panel.setVisible(previewVisible)
> - liveVisible = QtCore.QSettings().value(u'user interface/live
> panel',
> + liveVisible = Settings().value(u'user interface/live panel',
> QtCore.QVariant(True)).toBool()
> - panelLocked = QtCore.QSettings().value(u'user interface/lock
> panel',
> + panelLocked = Settings().value(u'user interface/lock panel',
> QtCore.QVariant(False)).toBool()
> self.liveController.panel.setVisible(liveVisible)
> # Create menu
> @@ -580,6 +583,8 @@
> # Once settings are loaded update the menu with the recent files.
> self.updateRecentFilesMenu()
> self.pluginForm = PluginForm(self)
> + self.newDataPath = u''
> + self.copyData = False
> # Set up signals and slots
> QtCore.QObject.connect(self.importThemeItem,
> QtCore.SIGNAL(u'triggered()'),
> @@ -632,6 +637,8 @@
> QtCore.SIGNAL(u'config_screen_changed'), self.screenChanged)
> QtCore.QObject.connect(Receiver.get_receiver(),
> QtCore.SIGNAL(u'mainwindow_status_text'),
> self.showStatusMessage)
> + QtCore.QObject.connect(Receiver.get_receiver(),
> + QtCore.SIGNAL(u'cleanup'), self.cleanUp)
> # Media Manager
> QtCore.QObject.connect(self.mediaToolBox,
> QtCore.SIGNAL(u'currentChanged(int)'),
> self.onMediaToolBoxChanged)
> @@ -644,6 +651,10 @@
> QtCore.QObject.connect(Receiver.get_receiver(),
> QtCore.SIGNAL(u'openlp_information_message'),
> self.onInformationMessage)
> + QtCore.QObject.connect(Receiver.get_receiver(),
> + QtCore.SIGNAL(u'set_new_data_path'), self.setNewDataPath)
> + QtCore.QObject.connect(Receiver.get_receiver(),
> + QtCore.SIGNAL(u'set_copy_data'), self.setCopyData)
> # warning cyclic dependency
> # renderer needs to call ThemeManager and
> # ThemeManager needs to call Renderer
> @@ -684,9 +695,9 @@
> self.previewController.screenSizeChanged()
> self.liveController.screenSizeChanged()
> log.info(u'Load data from Settings')
> - if QtCore.QSettings().value(u'advanced/save current plugin',
> + if Settings().value(u'advanced/save current plugin',
> QtCore.QVariant(False)).toBool():
> - savedPlugin = QtCore.QSettings().value(
> + savedPlugin = Settings().value(
> u'advanced/current media plugin',
> QtCore.QVariant()).toInt()[0]
> if savedPlugin != -1:
> self.mediaToolBox.setCurrentIndex(savedPlugin)
> @@ -738,11 +749,11 @@
> if not isinstance(filename, unicode):
> filename = unicode(filename, sys.getfilesystemencoding())
> self.serviceManagerContents.loadFile(filename)
> - elif QtCore.QSettings().value(
> + elif Settings().value(
> self.generalSettingsSection + u'/auto open',
> QtCore.QVariant(False)).toBool():
> self.serviceManagerContents.loadLastFile()
> - view_mode = QtCore.QSettings().value(u'%s/view mode' % \
> + view_mode = Settings().value(u'%s/view mode' % \
> self.generalSettingsSection, u'default').toString()
> if view_mode == u'default':
> self.modeDefaultItem.setChecked(True)
> @@ -820,7 +831,7 @@
> """
> Check and display message if screen blank on setup.
> """
> - settings = QtCore.QSettings()
> + settings = Settings()
> self.liveController.mainDisplaySetBackground()
> if settings.value(u'%s/screen blank' % self.generalSettingsSection,
> QtCore.QVariant(False)).toBool():
> @@ -954,9 +965,9 @@
> # Add plugin sections.
> for plugin in self.pluginManager.plugins:
> setting_sections.extend([plugin.name])
> - settings = QtCore.QSettings()
> + settings = Settings()
> import_settings = QtCore.QSettings(import_file_name,
> - QtCore.QSettings.IniFormat)
> + Settings.IniFormat)
> import_keys = import_settings.allKeys()
> for section_key in import_keys:
> # We need to handle the really bad files.
> @@ -1008,19 +1019,24 @@
> self.cleanUp()
> QtCore.QCoreApplication.exit()
>
> - def onSettingsExportItemClicked(self):
> - """
> - Export settings to a .conf file in INI format
> - """
> - export_file_name = unicode(QtGui.QFileDialog.getSaveFileName(self,
> - translate('OpenLP.MainWindow', 'Export Settings File'), '',
> - translate('OpenLP.MainWindow',
> - 'OpenLP Export Settings File (*.conf)')))
> - if not export_file_name:
> - return
> - # Make sure it's a .conf file.
> - if not export_file_name.endswith(u'conf'):
> - export_file_name = export_file_name + u'.conf'
> + def onSettingsExportItemClicked(self, export_file = None):
> + """
> + Export settings to a .conf file in INI format. If no filename is,
> + get one from the user. A filename is passed from self.cleanup if
> + OpenLP is running as a portable app.
> + """
> + if not export_file:
> + export_file_name =
> unicode(QtGui.QFileDialog.getSaveFileName(self,
> + translate('OpenLP.MainWindow', 'Export Settings File'),
> '',
> + translate('OpenLP.MainWindow',
> + 'OpenLP Export Settings File (*.conf)')))
> + if not export_file_name:
> + return
> + # Make sure it's a .conf file.
> + if not export_file_name.endswith(u'conf'):
> + export_file_name = export_file_name + u'.conf'
> + else:
> + export_file_name = unicode(export_file)
> temp_file = os.path.join(unicode(gettempdir()),
> u'openlp', u'exportConf.tmp')
> self.saveSettings()
> @@ -1041,12 +1057,12 @@
> os.remove(temp_file)
> if os.path.exists(export_file_name):
> os.remove(export_file_name)
> - settings = QtCore.QSettings()
> + settings = Settings()
> settings.remove(self.headerSection)
> # Get the settings.
> keys = settings.allKeys()
> export_settings = QtCore.QSettings(temp_file,
> - QtCore.QSettings.IniFormat)
> + Settings.IniFormat)
> # Add a header section.
> # This is to insure it's our conf file for import.
> now = datetime.now()
> @@ -1104,7 +1120,7 @@
> Set OpenLP to a different view mode.
> """
> if mode:
> - settings = QtCore.QSettings()
> + settings = Settings()
> settings.setValue(u'%s/view mode' %
> self.generalSettingsSection,
> mode)
> self.mediaManagerDock.setVisible(media)
> @@ -1149,7 +1165,7 @@
> else:
> event.ignore()
> else:
> - if QtCore.QSettings().value(u'advanced/enable exit
> confirmation',
> + if Settings().value(u'advanced/enable exit confirmation',
> QtCore.QVariant(True)).toBool():
> ret = QtGui.QMessageBox.question(self,
> translate('OpenLP.MainWindow', 'Close OpenLP'),
> @@ -1174,9 +1190,10 @@
> """
> # Clean temporary files used by services
> self.serviceManagerContents.cleanUp()
> - if QtCore.QSettings().value(u'advanced/save current plugin',
> + settings = Settings()
> + if Settings().value(u'advanced/save current plugin',
> QtCore.QVariant(False)).toBool():
> - QtCore.QSettings().setValue(u'advanced/current media plugin',
> + Settings().setValue(u'advanced/current media plugin',
> QtCore.QVariant(self.mediaToolBox.currentIndex()))
> # Call the cleanup method to shutdown plugins.
> log.info(u'cleanup plugins')
> @@ -1254,7 +1271,7 @@
> False - Hidden
> """
> self.previewController.panel.setVisible(visible)
> - QtCore.QSettings().setValue(u'user interface/preview panel',
> + Settings().setValue(u'user interface/preview panel',
> QtCore.QVariant(visible))
> self.viewPreviewPanel.setChecked(visible)
>
> @@ -1286,7 +1303,7 @@
> self.viewThemeManagerItem.setEnabled(True)
> self.viewPreviewPanel.setEnabled(True)
> self.viewLivePanel.setEnabled(True)
> - QtCore.QSettings().setValue(u'user interface/lock panel',
> + Settings().setValue(u'user interface/lock panel',
> QtCore.QVariant(lock))
>
> def setLivePanelVisibility(self, visible):
> @@ -1300,7 +1317,7 @@
> False - Hidden
> """
> self.liveController.panel.setVisible(visible)
> - QtCore.QSettings().setValue(u'user interface/live panel',
> + Settings().setValue(u'user interface/live panel',
> QtCore.QVariant(visible))
> self.viewLivePanel.setChecked(visible)
>
> @@ -1310,19 +1327,19 @@
> """
> log.debug(u'Loading QSettings')
> # Migrate Wrap Settings to Slide Limits Settings
> - if QtCore.QSettings().contains(self.generalSettingsSection +
> + if Settings().contains(self.generalSettingsSection +
> u'/enable slide loop'):
> - if QtCore.QSettings().value(self.generalSettingsSection +
> + if Settings().value(self.generalSettingsSection +
> u'/enable slide loop', QtCore.QVariant(True)).toBool():
> - QtCore.QSettings().setValue(self.advancedSettingsSection +
> + Settings().setValue(self.advancedSettingsSection +
> u'/slide limits', QtCore.QVariant(SlideLimits.Wrap))
> else:
> - QtCore.QSettings().setValue(self.advancedSettingsSection +
> + Settings().setValue(self.advancedSettingsSection +
> u'/slide limits', QtCore.QVariant(SlideLimits.End))
> - QtCore.QSettings().remove(self.generalSettingsSection +
> + Settings().remove(self.generalSettingsSection +
> u'/enable slide loop')
> Receiver.send_message(u'slidecontroller_update_slide_limits')
> - settings = QtCore.QSettings()
> + settings = Settings()
> # Remove obsolete entries.
> settings.remove(u'custom slide')
> settings.remove(u'service')
> @@ -1351,7 +1368,7 @@
> if self.settingsImported:
> return
> log.debug(u'Saving QSettings')
> - settings = QtCore.QSettings()
> + settings = Settings()
> settings.beginGroup(self.generalSettingsSection)
> recentFiles = QtCore.QVariant(self.recentFiles) \
> if self.recentFiles else QtCore.QVariant()
> @@ -1377,7 +1394,7 @@
> Updates the recent file menu with the latest list of service files
> accessed.
> """
> - recentFileCount = QtCore.QSettings().value(
> + recentFileCount = Settings().value(
> u'advanced/recent file count', QtCore.QVariant(4)).toInt()[0]
> existingRecentFiles = [recentFile for recentFile in
> self.recentFiles
> if os.path.isfile(unicode(recentFile))]
> @@ -1410,7 +1427,7 @@
> # The maxRecentFiles value does not have an interface and so never
> gets
> # actually stored in the settings therefore the default value of
> 20 will
> # always be used.
> - maxRecentFiles = QtCore.QSettings().value(u'advanced/max recent
> files',
> + maxRecentFiles = Settings().value(u'advanced/max recent files',
> QtCore.QVariant(20)).toInt()[0]
> if filename:
> # Add some cleanup to reduce duplication in the recent file
> list
> @@ -1457,3 +1474,10 @@
> self.timer_id = 0
> self.loadProgressBar.hide()
> Receiver.send_message(u'openlp_process_events')
> +
> + def setNewDataPath(self, new_data_path):
> + self.newDataPath = new_data_path
> +
> + def setCopyData(self, copy_data):
> + self.copyData = copy_data
> +
>
> === modified file 'openlp/core/ui/media/__init__.py'
> --- openlp/core/ui/media/__init__.py 2012-04-28 11:31:42 +0000
> +++ openlp/core/ui/media/__init__.py 2012-05-21 01:36:20 +0000
> @@ -26,6 +26,8 @@
>
> ###############################################################################
> import logging
>
> +from openlp.core.lib.settings import Settings
> +
> from PyQt4 import QtCore
>
> log = logging.getLogger(__name__)
> @@ -78,11 +80,11 @@
> Here an special media player is chosen for all media actions.
> """
> log.debug(u'get_media_players')
> - players =
> unicode(QtCore.QSettings().value(u'media/players').toString())
> + players = unicode(Settings().value(u'media/players').toString())
> if not players:
> players = u'webkit'
> reg_ex = QtCore.QRegExp(".*\[(.*)\].*")
> - if QtCore.QSettings().value(u'media/override player',
> + if Settings().value(u'media/override player',
> QtCore.QVariant(QtCore.Qt.Unchecked)).toInt()[0] ==
> QtCore.Qt.Checked:
> if reg_ex.exactMatch(players):
> overridden_player = u'%s' % reg_ex.cap(1)
> @@ -107,10 +109,10 @@
> """
> log.debug(u'set_media_players')
> players = u','.join(players_list)
> - if QtCore.QSettings().value(u'media/override player',
> + if Settings().value(u'media/override player',
> QtCore.QVariant(QtCore.Qt.Unchecked)).toInt()[0] == \
> QtCore.Qt.Checked and overridden_player != u'auto':
> players = players.replace(overridden_player, u'[%s]' %
> overridden_player)
> - QtCore.QSettings().setValue(u'media/players',
> QtCore.QVariant(players))
> + Settings().setValue(u'media/players', QtCore.QVariant(players))
>
> from mediacontroller import MediaController
>
> === modified file 'openlp/core/ui/media/mediacontroller.py'
> --- openlp/core/ui/media/mediacontroller.py 2012-05-01 11:21:57 +0000
> +++ openlp/core/ui/media/mediacontroller.py 2012-05-21 01:36:20 +0000
> @@ -30,6 +30,7 @@
> from PyQt4 import QtCore, QtGui
>
> from openlp.core.lib import OpenLPToolbar, Receiver, translate
> +from openlp.core.lib.settings import Settings
> from openlp.core.lib.mediaplayer import MediaPlayer
> from openlp.core.lib.ui import critical_error_message_box
> from openlp.core.ui.media import MediaState, MediaInfo, MediaType, \
> @@ -333,7 +334,7 @@
> "setBackBoard", null, null, null,"visible");')
> # now start playing
> if controller.isLive and \
> - (QtCore.QSettings().value(u'general/auto unblank',
> + (Settings().value(u'general/auto unblank',
> QtCore.QVariant(False)).toBool() or \
> controller.media_info.is_background == True) or \
> controller.isLive == False:
>
> === modified file 'openlp/core/ui/media/vlcplayer.py'
> --- openlp/core/ui/media/vlcplayer.py 2012-04-28 16:22:37 +0000
> +++ openlp/core/ui/media/vlcplayer.py 2012-05-21 01:36:20 +0000
> @@ -34,6 +34,7 @@
> from PyQt4 import QtCore, QtGui
>
> from openlp.core.lib import Receiver
> +from openlp.core.lib.settings import Settings
> from openlp.core.lib.mediaplayer import MediaPlayer
> from openlp.core.ui.media import MediaState
>
> @@ -114,7 +115,7 @@
> command_line_options = u'--no-video-title-show'
> if not display.hasAudio:
> command_line_options += u' --no-audio --no-video-title-show'
> - if QtCore.QSettings().value(u'advanced/hide mouse',
> + if Settings().value(u'advanced/hide mouse',
> QtCore.QVariant(False)).toBool() and \
> display.controller.isLive:
> command_line_options += u' --mouse-hide-timeout=0'
>
> === modified file 'openlp/core/ui/printserviceform.py'
> --- openlp/core/ui/printserviceform.py 2012-03-12 22:12:16 +0000
> +++ openlp/core/ui/printserviceform.py 2012-05-21 01:36:20 +0000
> @@ -33,6 +33,7 @@
>
> from openlp.core.lib import translate, get_text_file_string, Receiver
> from openlp.core.lib.ui import UiStrings
> +from openlp.core.lib.settings import Settings
> from openlp.core.ui.printservicedialog import Ui_PrintServiceDialog,
> ZoomSize
> from openlp.core.utils import AppLocation
>
> @@ -120,7 +121,7 @@
> self.zoom = 0
> self.setupUi(self)
> # Load the settings for the dialog.
> - settings = QtCore.QSettings()
> + settings = Settings()
> settings.beginGroup(u'advanced')
> self.slideTextCheckBox.setChecked(settings.value(
> u'print slide text', QtCore.QVariant(False)).toBool())
> @@ -318,7 +319,7 @@
> elif display == ZoomSize.TwentyFive:
> self.previewWidget.fitToWidth()
> self.previewWidget.zoomIn(0.25)
> - settings = QtCore.QSettings()
> + settings = Settings()
> settings.beginGroup(u'advanced')
> settings.setValue(u'display size', QtCore.QVariant(display))
> settings.endGroup()
> @@ -389,7 +390,7 @@
> Save the settings and close the dialog.
> """
> # Save the settings for this dialog.
> - settings = QtCore.QSettings()
> + settings = Settings()
> settings.beginGroup(u'advanced')
> settings.setValue(u'print slide text',
> QtCore.QVariant(self.slideTextCheckBox.isChecked()))
>
> === modified file 'openlp/core/ui/screen.py'
> --- openlp/core/ui/screen.py 2012-05-01 11:00:02 +0000
> +++ openlp/core/ui/screen.py 2012-05-21 01:36:20 +0000
> @@ -34,6 +34,7 @@
> from PyQt4 import QtCore
>
> from openlp.core.lib import Receiver, translate
> +from openlp.core.lib.settings import Settings
>
> log = logging.getLogger(__name__)
>
> @@ -241,7 +242,7 @@
> """
> Loads the screen size and the monitor number from the settings.
> """
> - settings = QtCore.QSettings()
> + settings = Settings()
> settings.beginGroup(u'general')
> self.set_current_display(settings.value(u'monitor',
> QtCore.QVariant(self.display_count - 1)).toInt()[0])
>
> === modified file 'openlp/core/ui/servicemanager.py'
> --- openlp/core/ui/servicemanager.py 2012-05-17 20:26:31 +0000
> +++ openlp/core/ui/servicemanager.py 2012-05-21 01:36:20 +0000
> @@ -40,6 +40,7 @@
> from openlp.core.lib import OpenLPToolbar, ServiceItem, Receiver,
> build_icon, \
> ItemCapabilities, SettingsManager, translate, str_to_bool
> from openlp.core.lib.theme import ThemeLevel
> +from openlp.core.lib.settings import Settings
> from openlp.core.lib.ui import UiStrings, critical_error_message_box, \
> create_widget_action, find_and_set_in_combo_box
> from openlp.core.ui import ServiceNoteForm, ServiceItemEditForm,
> StartTimeForm
> @@ -274,7 +275,7 @@
> QtCore.QObject.connect(Receiver.get_receiver(),
> QtCore.SIGNAL(u'service_item_update'), self.serviceItemUpdate)
> # Last little bits of setting up
> - self.service_theme = unicode(QtCore.QSettings().value(
> + self.service_theme = unicode(Settings().value(
> self.mainwindow.serviceManagerSettingsSection + u'/service
> theme',
> QtCore.QVariant(u'')).toString())
> self.servicePath =
> AppLocation.get_section_data_path(u'servicemanager')
> @@ -352,7 +353,7 @@
> self._fileName = unicode(fileName)
> self.mainwindow.setServiceModified(self.isModified(),
> self.shortFileName())
> - QtCore.QSettings(). \
> + Settings(). \
> setValue(u'servicemanager/last file',QtCore.QVariant(fileName))
>
> def fileName(self):
> @@ -371,7 +372,7 @@
> """
> Triggered when Config dialog is updated.
> """
> - self.expandTabs = QtCore.QSettings().value(
> + self.expandTabs = Settings().value(
> u'advanced/expand service item',
> QtCore.QVariant(u'False')).toBool()
>
> @@ -444,7 +445,7 @@
> self.setFileName(u'')
> self.serviceId += 1
> self.setModified(False)
> - QtCore.QSettings(). \
> + Settings(). \
> setValue(u'servicemanager/last file',QtCore.QVariant(u''))
> Receiver.send_message(u'servicemanager_new_service')
>
> @@ -591,17 +592,17 @@
> Get a file name and then call :func:`ServiceManager.saveFile` to
> save the file.
> """
> - default_service_enabled = QtCore.QSettings().value(
> + default_service_enabled = Settings().value(
> u'advanced/default service enabled',
> QtCore.QVariant(True)).toBool()
> if default_service_enabled:
> - service_day = QtCore.QSettings().value(
> + service_day = Settings().value(
> u'advanced/default service day', 7).toInt()[0]
> if service_day == 7:
> time = datetime.now()
> else:
> - service_hour = QtCore.QSettings().value(
> + service_hour = Settings().value(
> u'advanced/default service hour', 11).toInt()[0]
> - service_minute = QtCore.QSettings().value(
> + service_minute = Settings().value(
> u'advanced/default service minute', 0).toInt()[0]
> now = datetime.now()
> day_delta = service_day - now.weekday()
> @@ -609,7 +610,7 @@
> day_delta += 7
> time = now + timedelta(days=day_delta)
> time = time.replace(hour=service_hour,
> minute=service_minute)
> - default_pattern = unicode(QtCore.QSettings().value(
> + default_pattern = unicode(Settings().value(
> u'advanced/default service name',
> translate('OpenLP.AdvancedTab', 'Service %Y-%m-%d %H-%M',
> 'This may not contain any of the following characters:
> '
> @@ -690,7 +691,7 @@
> self.setFileName(fileName)
> self.mainwindow.addRecentFile(fileName)
> self.setModified(False)
> - QtCore.QSettings().setValue(
> + Settings().setValue(
> 'servicemanager/last file', QtCore.QVariant(fileName))
> else:
> critical_error_message_box(
> @@ -732,7 +733,7 @@
> service was last closed. Can be blank if there was no service
> present.
> """
> - fileName = QtCore.QSettings(). \
> + fileName = Settings(). \
> value(u'servicemanager/last
> file',QtCore.QVariant(u'')).toString()
> if fileName:
> self.loadFile(fileName)
> @@ -1104,7 +1105,7 @@
> log.debug(u'onThemeComboBoxSelected')
> self.service_theme = unicode(self.themeComboBox.currentText())
> self.mainwindow.renderer.set_service_theme(self.service_theme)
> - QtCore.QSettings().setValue(
> + Settings().setValue(
> self.mainwindow.serviceManagerSettingsSection +
> u'/service theme',
> QtCore.QVariant(self.service_theme))
> @@ -1285,7 +1286,7 @@
> if self.serviceItems[item][u'service_item'].is_valid:
> self.mainwindow.liveController.addServiceManagerItem(
> self.serviceItems[item][u'service_item'], child)
> - if QtCore.QSettings().value(
> + if Settings().value(
> self.mainwindow.generalSettingsSection + u'/auto preview',
> QtCore.QVariant(False)).toBool():
> item += 1
>
> === modified file 'openlp/core/ui/settingsform.py'
> --- openlp/core/ui/settingsform.py 2012-05-01 11:00:02 +0000
> +++ openlp/core/ui/settingsform.py 2012-05-21 01:36:20 +0000
> @@ -29,7 +29,7 @@
> """
> import logging
>
> -from PyQt4 import QtGui
> +from PyQt4 import QtCore, QtGui
>
> from openlp.core.lib import Receiver, build_icon, PluginStatus
> from openlp.core.ui import AdvancedTab, GeneralTab, ThemesTab
>
> === modified file 'openlp/core/ui/shortcutlistform.py'
> --- openlp/core/ui/shortcutlistform.py 2012-04-29 15:31:56 +0000
> +++ openlp/core/ui/shortcutlistform.py 2012-05-21 01:36:20 +0000
> @@ -31,6 +31,7 @@
> from PyQt4 import QtCore, QtGui
>
> from openlp.core.lib import Receiver
> +from openlp.core.lib.settings import Settings
> from openlp.core.utils import translate
> from openlp.core.utils.actions import ActionList
> from shortcutlistdialog import Ui_ShortcutListDialog
> @@ -337,7 +338,7 @@
> Save the shortcuts. **Note**, that we do not have to load the
> shortcuts,
> as they are loaded in :class:`~openlp.core.utils.ActionList`.
> """
> - settings = QtCore.QSettings()
> + settings = Settings()
> settings.beginGroup(u'shortcuts')
> for category in self.action_list.categories:
> # Check if the category is for internal use only.
>
> === modified file 'openlp/core/ui/slidecontroller.py'
> --- openlp/core/ui/slidecontroller.py 2012-05-01 20:35:42 +0000
> +++ openlp/core/ui/slidecontroller.py 2012-05-21 01:36:20 +0000
> @@ -35,6 +35,7 @@
> from openlp.core.lib import OpenLPToolbar, Receiver, ItemCapabilities, \
> translate, build_icon, build_html, PluginManager, ServiceItem
> from openlp.core.lib.ui import UiStrings, create_action
> +from openlp.core.lib.settings import Settings
> from openlp.core.lib import SlideLimits, ServiceItemAction
> from openlp.core.ui import HideMode, MainDisplay, Display, ScreenList
> from openlp.core.utils.actions import ActionList, CategoryOrder
> @@ -236,7 +237,7 @@
> text=UiStrings().PlaySlidesToEnd,
> icon=u':/media/media_time.png', checked=False,
> shortcuts=[],
> category=self.category, triggers=self.onPlaySlidesOnce)
> - if
> QtCore.QSettings().value(self.parent().generalSettingsSection +
> + if Settings().value(self.parent().generalSettingsSection +
> u'/enable slide loop', QtCore.QVariant(True)).toBool():
> self.playSlidesMenu.setDefaultAction(self.playSlidesLoop)
> else:
> @@ -662,7 +663,7 @@
> """
> Updates the Slide Limits variable from the settings.
> """
> - self.slide_limits = QtCore.QSettings().value(
> + self.slide_limits = Settings().value(
> self.parent().advancedSettingsSection + u'/slide limits',
> QtCore.QVariant(SlideLimits.End)).toInt()[0]
>
> @@ -692,7 +693,7 @@
> self.playSlidesLoop.setChecked(False)
> self.playSlidesLoop.setIcon(build_icon(u':/media/media_time.png'))
> if item.is_text():
> - if QtCore.QSettings().value(
> + if Settings().value(
> self.parent().songsSettingsSection + u'/display songbar',
> QtCore.QVariant(True)).toBool() and self.slideList:
> self.songMenu.show()
> @@ -813,11 +814,11 @@
> QtCore.QObject.connect(action,
> QtCore.SIGNAL(u'triggered(bool)'),
> self.onTrackTriggered)
> - self.display.audioPlayer.repeat =
> QtCore.QSettings().value(
> + self.display.audioPlayer.repeat = Settings().value(
> self.parent().generalSettingsSection + \
> u'/audio repeat list',
> QtCore.QVariant(False)).toBool()
> - if QtCore.QSettings().value(
> + if Settings().value(
> self.parent().generalSettingsSection + \
> u'/audio start paused',
> QtCore.QVariant(True)).toBool():
> @@ -930,7 +931,7 @@
> Allow the main display to blank the main display at startup time
> """
> log.debug(u'mainDisplaySetBackground live = %s' % self.isLive)
> - display_type = QtCore.QSettings().value(
> + display_type = Settings().value(
> self.parent().generalSettingsSection + u'/screen blank',
> QtCore.QVariant(u'')).toString()
> if self.screens.which_screen(self.window()) != \
> @@ -971,11 +972,11 @@
> self.themeScreen.setChecked(False)
> self.desktopScreen.setChecked(False)
> if checked:
> - QtCore.QSettings().setValue(
> + Settings().setValue(
> self.parent().generalSettingsSection + u'/screen blank',
> QtCore.QVariant(u'blanked'))
> else:
> - QtCore.QSettings().remove(
> + Settings().remove(
> self.parent().generalSettingsSection + u'/screen blank')
> self.blankPlugin()
> self.updatePreview()
> @@ -992,11 +993,11 @@
> self.themeScreen.setChecked(checked)
> self.desktopScreen.setChecked(False)
> if checked:
> - QtCore.QSettings().setValue(
> + Settings().setValue(
> self.parent().generalSettingsSection + u'/screen blank',
> QtCore.QVariant(u'themed'))
> else:
> - QtCore.QSettings().remove(
> + Settings().remove(
> self.parent().generalSettingsSection + u'/screen blank')
> self.blankPlugin()
> self.updatePreview()
> @@ -1013,11 +1014,11 @@
> self.themeScreen.setChecked(False)
> self.desktopScreen.setChecked(checked)
> if checked:
> - QtCore.QSettings().setValue(
> + Settings().setValue(
> self.parent().generalSettingsSection + u'/screen blank',
> QtCore.QVariant(u'hidden'))
> else:
> - QtCore.QSettings().remove(
> + Settings().remove(
> self.parent().generalSettingsSection + u'/screen blank')
> self.hidePlugin(checked)
> self.updatePreview()
> @@ -1311,7 +1312,7 @@
> """
> triggered by clicking the Preview slide items
> """
> - if QtCore.QSettings().value(u'advanced/double click live',
> + if Settings().value(u'advanced/double click live',
> QtCore.QVariant(False)).toBool():
> # Live and Preview have issues if we have video or
> presentations
> # playing in both at the same time.
>
> === modified file 'openlp/core/ui/thememanager.py'
> --- openlp/core/ui/thememanager.py 2012-04-29 15:31:56 +0000
> +++ openlp/core/ui/thememanager.py 2012-05-21 01:36:20 +0000
> @@ -40,6 +40,7 @@
> check_directory_exists, create_thumb, validate_thumb
> from openlp.core.lib.theme import ThemeXML, BackgroundType, VerticalType,
> \
> BackgroundGradientType
> +from openlp.core.lib.settings import Settings
> from openlp.core.lib.ui import UiStrings, critical_error_message_box, \
> create_widget_action
> from openlp.core.theme import Theme
> @@ -164,7 +165,7 @@
> """
> Triggered when Config dialog is updated.
> """
> - self.global_theme = unicode(QtCore.QSettings().value(
> + self.global_theme = unicode(Settings().value(
> self.settingsSection + u'/global theme',
> QtCore.QVariant(u'')).toString())
>
> @@ -244,7 +245,7 @@
> name = unicode(translate('OpenLP.ThemeManager',
> '%s (default)')) % self.global_theme
> self.themeListWidget.item(count).setText(name)
> - QtCore.QSettings().setValue(
> + Settings().setValue(
> self.settingsSection + u'/global theme',
> QtCore.QVariant(self.global_theme))
> Receiver.send_message(u'theme_update_global',
> @@ -448,7 +449,7 @@
> theme = ThemeXML()
> theme.theme_name = UiStrings().Default
> self._writeTheme(theme, None, None)
> - QtCore.QSettings().setValue(
> + Settings().setValue(
> self.settingsSection + u'/global theme',
> QtCore.QVariant(theme.theme_name))
> self.configUpdated()
> @@ -767,7 +768,7 @@
> Check to see if theme has been selected and the destructive action
> is allowed.
> """
> - self.global_theme = unicode(QtCore.QSettings().value(
> + self.global_theme = unicode(Settings().value(
> self.settingsSection + u'/global theme',
> QtCore.QVariant(u'')).toString())
> if check_item_selected(self.themeListWidget, select_text):
>
> === modified file 'openlp/core/ui/themestab.py'
> --- openlp/core/ui/themestab.py 2012-04-22 19:37:11 +0000
> +++ openlp/core/ui/themestab.py 2012-05-21 01:36:20 +0000
> @@ -30,6 +30,7 @@
> from openlp.core.lib import SettingsTab, Receiver, translate
> from openlp.core.lib.theme import ThemeLevel
> from openlp.core.lib.ui import UiStrings, find_and_set_in_combo_box
> +from openlp.core.lib.settings import Settings
>
> class ThemesTab(SettingsTab):
> """
> @@ -132,7 +133,7 @@
> 'any themes associated with either the service or the songs.'))
>
> def load(self):
> - settings = QtCore.QSettings()
> + settings = Settings()
> settings.beginGroup(self.settingsSection)
> self.theme_level = settings.value(
> u'theme level', ThemeLevel.Song).toInt()[0]
> @@ -146,7 +147,7 @@
> self.SongLevelRadioButton.setChecked(True)
>
> def save(self):
> - settings = QtCore.QSettings()
> + settings = Settings()
> settings.beginGroup(self.settingsSection)
> settings.setValue(u'theme level',
> QtCore.QVariant(self.theme_level))
> settings.setValue(u'global theme',
> QtCore.QVariant(self.global_theme))
> @@ -183,7 +184,7 @@
> [u'Bible Theme', u'Song Theme']
> """
> # Reload as may have been triggered by the ThemeManager.
> - self.global_theme = unicode(QtCore.QSettings().value(
> + self.global_theme = unicode(Settings().value(
> self.settingsSection + u'/global theme',
> QtCore.QVariant(u'')).toString())
> self.DefaultComboBox.clear()
>
> === modified file 'openlp/core/utils/__init__.py'
> --- openlp/core/utils/__init__.py 2012-05-01 12:58:22 +0000
> +++ openlp/core/utils/__init__.py 2012-05-21 01:36:20 +0000
> @@ -37,6 +37,8 @@
> import time
> import urllib2
>
> +from openlp.core.lib.settings import Settings
> +
> from PyQt4 import QtGui, QtCore
>
> if sys.platform != u'win32' and sys.platform != u'darwin':
> @@ -88,7 +90,7 @@
> VersionDir = 5
> CacheDir = 6
> LanguageDir = 7
> -
> +
> # Base path where data/config/cache dir is located
> BaseDir = None
>
> @@ -127,8 +129,13 @@
> """
> Return the path OpenLP stores all its data under.
> """
> - path = AppLocation.get_directory(AppLocation.DataDir)
> - check_directory_exists(path)
> + # Check if we have a different data location.
> + if Settings().contains(u'advanced/data path'):
> + path = unicode(Settings().value(
> + u'advanced/data path').toString())
> + else:
> + path = AppLocation.get_directory(AppLocation.DataDir)
> + check_directory_exists(path)
> return path
>
> @staticmethod
> @@ -281,7 +288,7 @@
> """
> version_string = current_version[u'full']
> # set to prod in the distribution config file.
> - settings = QtCore.QSettings()
> + settings = Settings()
> settings.beginGroup(u'general')
> last_test = unicode(settings.value(u'last version test',
> QtCore.QVariant(datetime.now().date())).toString())
>
> === modified file 'openlp/core/utils/actions.py'
> --- openlp/core/utils/actions.py 2012-04-29 15:31:56 +0000
> +++ openlp/core/utils/actions.py 2012-05-21 01:36:20 +0000
> @@ -30,6 +30,8 @@
> """
> from PyQt4 import QtCore, QtGui
>
> +from openlp.core.lib.settings import Settings
> +
> class ActionCategory(object):
> """
> The :class:`~openlp.core.utils.ActionCategory` class encapsulates a
> @@ -226,7 +228,7 @@
> else:
> self.categories[category].actions.add(action, weight)
> # Load the shortcut from the config.
> - settings = QtCore.QSettings()
> + settings = Settings()
> settings.beginGroup(u'shortcuts')
> shortcuts = settings.value(action.objectName(),
> QtCore.QVariant(action.shortcuts())).toStringList()
>
> === modified file 'openlp/core/utils/languagemanager.py'
> --- openlp/core/utils/languagemanager.py 2011-12-27 10:33:55 +0000
> +++ openlp/core/utils/languagemanager.py 2012-05-21 01:36:20 +0000
> @@ -35,6 +35,7 @@
>
> from openlp.core.utils import AppLocation
> from openlp.core.lib import translate
> +from openlp.core.lib.settings import Settings
>
> log = logging.getLogger(__name__)
>
> @@ -101,7 +102,7 @@
> """
> Retrieve a saved language to use from settings
> """
> - settings = QtCore.QSettings()
> + settings = Settings()
> language = unicode(settings.value(
> u'general/language', QtCore.QVariant(u'[en]')).toString())
> log.info(u'Language file: \'%s\' Loaded from conf file' %
> language)
> @@ -133,7 +134,7 @@
> language = unicode(qm_list[action_name])
> if LanguageManager.auto_language:
> language = u'[%s]' % language
> - QtCore.QSettings().setValue(
> + Settings().setValue(
> u'general/language', QtCore.QVariant(language))
> log.info(u'Language file: \'%s\' written to conf file' % language)
> if message:
>
> === modified file 'openlp/plugins/alerts/alertsplugin.py'
> --- openlp/plugins/alerts/alertsplugin.py 2012-04-22 19:37:11 +0000
> +++ openlp/plugins/alerts/alertsplugin.py 2012-05-21 01:36:20 +0000
> @@ -32,6 +32,7 @@
> from openlp.core.lib import Plugin, StringContent, build_icon, translate
> from openlp.core.lib.db import Manager
> from openlp.core.lib.ui import create_action, UiStrings
> +from openlp.core.lib.settings import Settings
> from openlp.core.lib.theme import VerticalType
> from openlp.core.utils.actions import ActionList
> from openlp.plugins.alerts.lib import AlertsManager, AlertsTab
> @@ -160,7 +161,7 @@
>
> def toggleAlertsState(self):
> self.alertsActive = not self.alertsActive
> - QtCore.QSettings().setValue(self.settingsSection + u'/active',
> + Settings().setValue(self.settingsSection + u'/active',
> QtCore.QVariant(self.alertsActive))
>
> def onAlertsTrigger(self):
>
> === modified file 'openlp/plugins/alerts/lib/alertstab.py'
> --- openlp/plugins/alerts/lib/alertstab.py 2012-04-02 00:19:16 +0000
> +++ openlp/plugins/alerts/lib/alertstab.py 2012-05-21 01:36:20 +0000
> @@ -30,6 +30,7 @@
> from openlp.core.lib import SettingsTab, translate, Receiver
> from openlp.core.ui import AlertLocation
> from openlp.core.lib.ui import UiStrings, create_valign_selection_widgets
> +from openlp.core.lib.settings import Settings
>
> class AlertsTab(SettingsTab):
> """
> @@ -152,7 +153,7 @@
> self.updateDisplay()
>
> def load(self):
> - settings = QtCore.QSettings()
> + settings = Settings()
> settings.beginGroup(self.settingsSection)
> self.timeout = settings.value(u'timeout',
> QtCore.QVariant(5)).toInt()[0]
> self.font_color = unicode(settings.value(
> @@ -180,7 +181,7 @@
> self.changed = False
>
> def save(self):
> - settings = QtCore.QSettings()
> + settings = Settings()
> settings.beginGroup(self.settingsSection)
> # Check value has changed as no event handles this field
> if settings.value(u'location', QtCore.QVariant(1)).toInt()[0] != \
>
> === modified file 'openlp/plugins/bibles/bibleplugin.py'
> --- openlp/plugins/bibles/bibleplugin.py 2012-04-29 15:31:56 +0000
> +++ openlp/plugins/bibles/bibleplugin.py 2012-05-21 01:36:20 +0000
> @@ -31,6 +31,7 @@
>
> from openlp.core.lib import Plugin, StringContent, build_icon, translate
> from openlp.core.lib.ui import create_action, UiStrings
> +from openlp.core.lib.settings import Settings
> from openlp.core.utils.actions import ActionList
> from openlp.plugins.bibles.lib import BibleManager, BiblesTab,
> BibleMediaItem
> from openlp.plugins.bibles.forms import BibleUpgradeForm
> @@ -91,7 +92,7 @@
> QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Yes |
> QtGui.QMessageBox.No)) == QtGui.QMessageBox.Yes:
> self.onToolsUpgradeItemTriggered()
> - settings = QtCore.QSettings()
> + settings = Settings()
> settings.beginGroup(self.settingsSection)
> if settings.contains(u'bookname language'):
> settings.setValue(u'book name language', settings.value(
>
> === modified file 'openlp/plugins/bibles/forms/bibleimportform.py'
> --- openlp/plugins/bibles/forms/bibleimportform.py 2012-04-12
> 14:16:12 +0000
> +++ openlp/plugins/bibles/forms/bibleimportform.py 2012-05-21
> 01:36:20 +0000
> @@ -36,6 +36,7 @@
> from openlp.core.lib import Receiver, translate
> from openlp.core.lib.db import delete_database
> from openlp.core.lib.ui import UiStrings, critical_error_message_box
> +from openlp.core.lib.settings import Settings
> from openlp.core.ui.wizard import OpenLPWizard, WizardStrings
> from openlp.core.utils import AppLocation
> from openlp.plugins.bibles.lib.manager import BibleFormat
> @@ -590,7 +591,7 @@
> """
> Set default values for the wizard pages.
> """
> - settings = QtCore.QSettings()
> + settings = Settings()
> settings.beginGroup(self.plugin.settingsSection)
> self.restart()
> self.finishButton.setVisible(False)
>
> === modified file 'openlp/plugins/bibles/forms/bibleupgradeform.py'
> --- openlp/plugins/bibles/forms/bibleupgradeform.py 2012-04-29
> 15:31:56 +0000
> +++ openlp/plugins/bibles/forms/bibleupgradeform.py 2012-05-21
> 01:36:20 +0000
> @@ -36,6 +36,7 @@
> from openlp.core.lib import Receiver, SettingsManager, translate, \
> check_directory_exists
> from openlp.core.lib.ui import UiStrings, critical_error_message_box
> +from openlp.core.lib.settings import Settings
> from openlp.core.ui.wizard import OpenLPWizard, WizardStrings
> from openlp.core.utils import AppLocation, delete_file
> from openlp.plugins.bibles.lib.db import BibleDB, BibleMeta, OldBibleDB, \
> @@ -341,7 +342,7 @@
> Set default values for the wizard pages.
> """
> log.debug(u'BibleUpgrade setDefaults')
> - settings = QtCore.QSettings()
> + settings = Settings()
> settings.beginGroup(self.plugin.settingsSection)
> self.stop_import_flag = False
> self.success.clear()
>
> === modified file 'openlp/plugins/bibles/lib/__init__.py'
> --- openlp/plugins/bibles/lib/__init__.py 2012-04-29 15:31:56 +0000
> +++ openlp/plugins/bibles/lib/__init__.py 2012-05-21 01:36:20 +0000
> @@ -34,6 +34,7 @@
> from PyQt4 import QtCore
>
> from openlp.core.lib import translate
> +from openlp.core.lib.settings import Settings
> from openlp.plugins.bibles.lib.db import BiblesResourcesDB
>
> log = logging.getLogger(__name__)
> @@ -185,7 +186,7 @@
> ':|v|V|verse|verses;;-|to;;,|and;;end',
> 'Double-semicolon delimited separators for parsing references. '
> 'Consult the developers for further information.')).split(u';;')
> - settings = QtCore.QSettings()
> + settings = Settings()
> settings.beginGroup(u'bibles')
> custom_separators = [
> unicode(settings.value(u'verse separator').toString()),
>
> === modified file 'openlp/plugins/bibles/lib/biblestab.py'
> --- openlp/plugins/bibles/lib/biblestab.py 2012-04-21 22:29:08 +0000
> +++ openlp/plugins/bibles/lib/biblestab.py 2012-05-21 01:36:20 +0000
> @@ -31,6 +31,7 @@
>
> from openlp.core.lib import Receiver, SettingsTab, translate
> from openlp.core.lib.ui import UiStrings, find_and_set_in_combo_box
> +from openlp.core.lib.settings import Settings
> from openlp.plugins.bibles.lib import LayoutStyle, DisplayStyle, \
> update_reference_separators, get_reference_separator, LanguageSelection
>
> @@ -414,7 +415,7 @@
> self.getGreyTextPalette(True))
>
> def load(self):
> - settings = QtCore.QSettings()
> + settings = Settings()
> settings.beginGroup(self.settingsSection)
> self.show_new_chapters = settings.value(
> u'display new chapter', QtCore.QVariant(False)).toBool()
> @@ -488,7 +489,7 @@
> settings.endGroup()
>
> def save(self):
> - settings = QtCore.QSettings()
> + settings = Settings()
> settings.beginGroup(self.settingsSection)
> settings.setValue(u'display new chapter',
> QtCore.QVariant(self.show_new_chapters))
>
> === modified file 'openlp/plugins/bibles/lib/manager.py'
> --- openlp/plugins/bibles/lib/manager.py 2012-05-15 21:06:09 +0000
> +++ openlp/plugins/bibles/lib/manager.py 2012-05-21 01:36:20 +0000
> @@ -32,6 +32,7 @@
>
> from openlp.core.lib import Receiver, SettingsManager, translate
> from openlp.core.utils import AppLocation, delete_file
> +from openlp.core.lib.settings import Settings
> from openlp.plugins.bibles.lib import parse_reference, \
> get_reference_separator, LanguageSelection
> from openlp.plugins.bibles.lib.db import BibleDB, BibleMeta
> @@ -126,7 +127,7 @@
> self.db_cache = None
> self.path = AppLocation.get_section_data_path(self.settingsSection)
> self.proxy_name = unicode(
> - QtCore.QSettings().value(self.settingsSection + u'/proxy
> name',
> + Settings().value(self.settingsSection + u'/proxy name',
> QtCore.QVariant(u'')).toString())
> self.suffix = u'.sqlite'
> self.import_wizard = None
> @@ -330,7 +331,17 @@
> 'Import Wizard to install one or more Bibles.')
> })
> return None
> +<<<<<<< TREE
> language_selection = self.get_language_selection(bible)
> +=======
> + language_selection = self.get_meta_data(bible,
> u'book_name_language')
> + if language_selection:
> + language_selection = int(language_selection.value)
> + if language_selection is None or language_selection == -1:
> + language_selection = Settings().value(
> + self.settingsSection + u'/bookname language',
> + QtCore.QVariant(0)).toInt()[0]
> +>>>>>>> MERGE-SOURCE
> reflist = parse_reference(versetext, self.db_cache[bible],
> language_selection, book_ref_id)
> if reflist:
> @@ -372,6 +383,7 @@
> """
> log.debug(u'BibleManager.get_language_selection("%s")', bible)
> language_selection = self.get_meta_data(bible,
> u'book_name_language')
> +<<<<<<< TREE
> if language_selection:
> try:
> language_selection = int(language_selection.value)
> @@ -379,6 +391,12 @@
> language_selection = LanguageSelection.Application
> if language_selection is None or language_selection == -1:
> language_selection = QtCore.QSettings().value(
> +=======
> + if language_selection and language_selection.value != u'None':
> + return int(language_selection.value)
> + if language_selection is None or language_selection.value ==
> u'None':
> + return Settings().value(
> +>>>>>>> MERGE-SOURCE
> self.settingsSection + u'/bookname language',
> QtCore.QVariant(0)).toInt()[0]
> return language_selection
>
> === modified file 'openlp/plugins/bibles/lib/mediaitem.py'
> --- openlp/plugins/bibles/lib/mediaitem.py 2012-05-16 16:42:33 +0000
> +++ openlp/plugins/bibles/lib/mediaitem.py 2012-05-21 01:36:20 +0000
> @@ -33,6 +33,7 @@
> from openlp.core.lib import MediaManagerItem, Receiver, ItemCapabilities,
> \
> translate, create_separated_list
> from openlp.core.lib.searchedit import SearchEdit
> +from openlp.core.lib.settings import Settings
> from openlp.core.lib.ui import UiStrings, set_case_insensitive_completer,
> \
> create_horizontal_adjusting_combo_box, critical_error_message_box, \
> find_and_set_in_combo_box, build_icon
> @@ -294,7 +295,7 @@
>
> def configUpdated(self):
> log.debug(u'configUpdated')
> - if QtCore.QSettings().value(self.settingsSection + u'/second
> bibles',
> + if Settings().value(self.settingsSection + u'/second bibles',
> QtCore.QVariant(True)).toBool():
> self.advancedSecondLabel.setVisible(True)
> self.advancedSecondComboBox.setVisible(True)
> @@ -362,7 +363,7 @@
> translate('BiblesPlugin.MediaItem', 'Text Search'),
> translate('BiblesPlugin.MediaItem', 'Search Text...'))
> ])
> -
> self.quickSearchEdit.setCurrentSearchType(QtCore.QSettings().value(
> + self.quickSearchEdit.setCurrentSearchType(Settings().value(
> u'%s/last search type' % self.settingsSection,
> QtCore.QVariant(BibleSearch.Reference)).toInt()[0])
> self.configUpdated()
> @@ -386,7 +387,7 @@
> self.advancedVersionComboBox.addItems(bibles)
> self.advancedSecondComboBox.addItems(bibles)
> # set the default value
> - bible = QtCore.QSettings().value(
> + bible = Settings().value(
> self.settingsSection + u'/advanced bible',
> QtCore.QVariant(u'')).toString()
> if bible in bibles:
> @@ -394,7 +395,7 @@
> self.initialiseAdvancedBible(unicode(bible))
> elif bibles:
> self.initialiseAdvancedBible(bibles[0])
> - bible = QtCore.QSettings().value(
> + bible = Settings().value(
> self.settingsSection + u'/quick bible', QtCore.QVariant(
> self.quickVersionComboBox.currentText())).toString()
> find_and_set_in_combo_box(self.quickVersionComboBox, bible)
> @@ -497,11 +498,11 @@
> """
> log.debug(u'updateAutoCompleter')
> # Save the current search type to the configuration.
> - QtCore.QSettings().setValue(u'%s/last search type' %
> + Settings().setValue(u'%s/last search type' %
> self.settingsSection,
> QtCore.QVariant(self.quickSearchEdit.currentSearchType()))
> # Save the current bible to the configuration.
> - QtCore.QSettings().setValue(self.settingsSection + u'/quick
> bible',
> + Settings().setValue(self.settingsSection + u'/quick bible',
> QtCore.QVariant(self.quickVersionComboBox.currentText()))
> books = []
> # We have to do a 'Reference Search'.
> @@ -596,7 +597,7 @@
>
> self.advancedStyleComboBox.setCurrentIndex(self.settings.layout_style)
> self.settings.layoutStyleComboBox.setCurrentIndex(
> self.settings.layout_style)
> - QtCore.QSettings().setValue(
> + Settings().setValue(
> self.settingsSection + u'/verse layout style',
> QtCore.QVariant(self.settings.layout_style))
>
> @@ -605,12 +606,12 @@
> self.quickStyleComboBox.setCurrentIndex(self.settings.layout_style)
> self.settings.layoutStyleComboBox.setCurrentIndex(
> self.settings.layout_style)
> - QtCore.QSettings().setValue(
> + Settings().setValue(
> self.settingsSection + u'/verse layout style',
> QtCore.QVariant(self.settings.layout_style))
>
> def onAdvancedVersionComboBox(self):
> - QtCore.QSettings().setValue(self.settingsSection + u'/advanced
> bible',
> + Settings().setValue(self.settingsSection + u'/advanced bible',
> QtCore.QVariant(self.advancedVersionComboBox.currentText()))
> self.initialiseAdvancedBible(
> unicode(self.advancedVersionComboBox.currentText()),
>
> === modified file 'openlp/plugins/custom/lib/customtab.py'
> --- openlp/plugins/custom/lib/customtab.py 2011-12-27 10:33:55 +0000
> +++ openlp/plugins/custom/lib/customtab.py 2012-05-21 01:36:20 +0000
> @@ -28,6 +28,7 @@
> from PyQt4 import QtCore, QtGui
>
> from openlp.core.lib import SettingsTab, translate
> +from openlp.core.lib.settings import Settings
>
> class CustomTab(SettingsTab):
> """
> @@ -66,11 +67,11 @@
> self.displayFooter = True
>
> def load(self):
> - self.displayFooter = QtCore.QSettings().value(
> + self.displayFooter = Settings().value(
> self.settingsSection + u'/display footer',
> QtCore.QVariant(True)).toBool()
> self.displayFooterCheckBox.setChecked(self.displayFooter)
>
> def save(self):
> - QtCore.QSettings().setValue(self.settingsSection + u'/display
> footer',
> + Settings().setValue(self.settingsSection + u'/display footer',
> QtCore.QVariant(self.displayFooter))
>
> === modified file 'openlp/plugins/custom/lib/mediaitem.py'
> --- openlp/plugins/custom/lib/mediaitem.py 2012-04-29 15:31:56 +0000
> +++ openlp/plugins/custom/lib/mediaitem.py 2012-05-21 01:36:20 +0000
> @@ -34,6 +34,7 @@
> from openlp.core.lib import MediaManagerItem, Receiver, ItemCapabilities,
> \
> check_item_selected, translate
> from openlp.core.lib.ui import UiStrings
> +from openlp.core.lib.settings import Settings
> from openlp.plugins.custom.forms import EditCustomForm
> from openlp.plugins.custom.lib import CustomXMLParser
> from openlp.plugins.custom.lib.db import CustomSlide
> @@ -99,7 +100,7 @@
> ])
> self.loadList(self.manager.get_all_objects(
> CustomSlide, order_by_ref=CustomSlide.title))
> - self.searchTextEdit.setCurrentSearchType(QtCore.QSettings().value(
> + self.searchTextEdit.setCurrentSearchType(Settings().value(
> u'%s/last search type' % self.settingsSection,
> QtCore.QVariant(CustomSearch.Titles)).toInt()[0])
>
> @@ -218,7 +219,7 @@
> service_item.title = title
> for slide in raw_slides:
> service_item.add_from_text(slide[:30], slide)
> - if QtCore.QSettings().value(self.settingsSection + u'/display
> footer',
> + if Settings().value(self.settingsSection + u'/display footer',
> QtCore.QVariant(True)).toBool() or credit:
> raw_footer.append(title + u' ' + credit)
> else:
> @@ -228,7 +229,7 @@
>
> def onSearchTextButtonClicked(self):
> # Save the current search type to the configuration.
> - QtCore.QSettings().setValue(u'%s/last search type' %
> + Settings().setValue(u'%s/last search type' %
> self.settingsSection,
> QtCore.QVariant(self.searchTextEdit.currentSearchType()))
> # Reload the list considering the new search type.
>
> === modified file 'openlp/plugins/images/imageplugin.py'
> --- openlp/plugins/images/imageplugin.py 2012-04-22 19:37:11 +0000
> +++ openlp/plugins/images/imageplugin.py 2012-05-21 01:36:20 +0000
> @@ -31,6 +31,7 @@
>
> from openlp.core.lib import Plugin, StringContent, build_icon, translate,
> \
> Receiver
> +from openlp.core.lib.settings import Settings
> from openlp.plugins.images.lib import ImageMediaItem, ImageTab
>
> log = logging.getLogger(__name__)
> @@ -94,6 +95,6 @@
> image manager to require updates. Actual update is triggered by
> the
> last part of saving the config.
> """
> - background =
> QtGui.QColor(QtCore.QSettings().value(self.settingsSection
> + background = QtGui.QColor(Settings().value(self.settingsSection
> + u'/background color', QtCore.QVariant(u'#000000')))
> self.liveController.imageManager.update_images(u'image',
> background)
>
> === modified file 'openlp/plugins/images/lib/imagetab.py'
> --- openlp/plugins/images/lib/imagetab.py 2012-04-03 17:59:34 +0000
> +++ openlp/plugins/images/lib/imagetab.py 2012-05-21 01:36:20 +0000
> @@ -28,6 +28,7 @@
> from PyQt4 import QtCore, QtGui
>
> from openlp.core.lib import SettingsTab, translate, Receiver
> +from openlp.core.lib.settings import Settings
>
> class ImageTab(SettingsTab):
> """
> @@ -82,7 +83,7 @@
> u'background-color: %s' % self.bg_color)
>
> def load(self):
> - settings = QtCore.QSettings()
> + settings = Settings()
> settings.beginGroup(self.settingsSection)
> self.bg_color = unicode(settings.value(
> u'background color', QtCore.QVariant(u'#000000')).toString())
> @@ -92,7 +93,7 @@
> u'background-color: %s' % self.bg_color)
>
> def save(self):
> - settings = QtCore.QSettings()
> + settings = Settings()
> settings.beginGroup(self.settingsSection)
> settings.setValue(u'background color',
> QtCore.QVariant(self.bg_color))
> settings.endGroup()
>
> === modified file 'openlp/plugins/images/lib/mediaitem.py'
> --- openlp/plugins/images/lib/mediaitem.py 2012-04-21 22:29:08 +0000
> +++ openlp/plugins/images/lib/mediaitem.py 2012-05-21 01:36:20 +0000
> @@ -35,6 +35,7 @@
> SettingsManager, translate, check_item_selected,
> check_directory_exists, \
> Receiver, create_thumb, validate_thumb
> from openlp.core.lib.ui import UiStrings, critical_error_message_box
> +from openlp.core.lib.settings import Settings
> from openlp.core.utils import AppLocation, delete_file, get_images_filter
>
> log = logging.getLogger(__name__)
> @@ -151,7 +152,7 @@
>
> def generateSlideData(self, service_item, item=None, xmlVersion=False,
> remote=False):
> - background =
> QtGui.QColor(QtCore.QSettings().value(self.settingsSection
> + background = QtGui.QColor(Settings().value(self.settingsSection
> + u'/background color', QtCore.QVariant(u'#000000')))
> if item:
> items = [item]
> @@ -220,7 +221,7 @@
> if check_item_selected(self.listView,
> translate('ImagePlugin.MediaItem',
> 'You must select an image to replace the background with.')):
> - background = QtGui.QColor(QtCore.QSettings().value(
> + background = QtGui.QColor(Settings().value(
> self.settingsSection + u'/background color',
> QtCore.QVariant(u'#000000')))
> item = self.listView.selectedIndexes()[0]
>
> === modified file 'openlp/plugins/media/lib/mediatab.py'
> --- openlp/plugins/media/lib/mediatab.py 2012-04-01 21:19:56 +0000
> +++ openlp/plugins/media/lib/mediatab.py 2012-05-21 01:36:20 +0000
> @@ -29,6 +29,7 @@
>
> from openlp.core.lib import SettingsTab, translate, Receiver
> from openlp.core.lib.ui import UiStrings, create_button
> +from openlp.core.lib.settings import Settings
> from openlp.core.ui.media import get_media_players, set_media_players
> class MediaQCheckBox(QtGui.QCheckBox):
> """
> @@ -186,7 +187,7 @@
> else:
> checkbox.setChecked(False)
> self.updatePlayerList()
> - self.overridePlayerCheckBox.setChecked(QtCore.QSettings().value(
> + self.overridePlayerCheckBox.setChecked(Settings().value(
> self.settingsSection + u'/override player',
> QtCore.QVariant(QtCore.Qt.Unchecked)).toInt()[0])
>
> @@ -200,9 +201,9 @@
> player_string_changed = True
> override_changed = True
> setting_key = self.settingsSection + u'/override player'
> - if QtCore.QSettings().value(setting_key).toInt()[0] != \
> + if Settings().value(setting_key).toInt()[0] != \
> self.overridePlayerCheckBox.checkState():
> - QtCore.QSettings().setValue(setting_key,
> + Settings().setValue(setting_key,
> QtCore.QVariant(self.overridePlayerCheckBox.checkState()))
> override_changed = True
> if override_changed:
>
> === modified file 'openlp/plugins/media/mediaplugin.py'
> --- openlp/plugins/media/mediaplugin.py 2012-04-22 19:37:11 +0000
> +++ openlp/plugins/media/mediaplugin.py 2012-05-21 01:36:20 +0000
> @@ -30,6 +30,7 @@
> from PyQt4 import QtCore
>
> from openlp.core.lib import Plugin, StringContent, build_icon, translate
> +from openlp.core.lib.settings import Settings
> from openlp.plugins.media.lib import MediaMediaItem, MediaTab
>
> log = logging.getLogger(__name__)
> @@ -126,7 +127,7 @@
> we want to check if we have the old "Use Phonon" setting, and
> convert
> it to "enable Phonon" and "make it the first one in the list".
> """
> - settings = QtCore.QSettings()
> + settings = Settings()
> settings.beginGroup(self.settingsSection)
> if settings.contains(u'use phonon'):
> log.info(u'Found old Phonon setting')
>
> === modified file 'openlp/plugins/presentations/lib/mediaitem.py'
> --- openlp/plugins/presentations/lib/mediaitem.py 2012-04-22
> 19:37:11 +0000
> +++ openlp/plugins/presentations/lib/mediaitem.py 2012-05-21
> 01:36:20 +0000
> @@ -36,6 +36,7 @@
> validate_thumb
> from openlp.core.lib.ui import UiStrings, critical_error_message_box, \
> create_horizontal_adjusting_combo_box
> +from openlp.core.lib.settings import Settings
> from openlp.plugins.presentations.lib import MessageListener
>
> log = logging.getLogger(__name__)
> @@ -149,7 +150,7 @@
> if self.displayTypeComboBox.count() > 1:
> self.displayTypeComboBox.insertItem(0, self.Automatic)
> self.displayTypeComboBox.setCurrentIndex(0)
> - if QtCore.QSettings().value(self.settingsSection + u'/override
> app',
> + if Settings().value(self.settingsSection + u'/override app',
> QtCore.QVariant(QtCore.Qt.Unchecked)) == QtCore.Qt.Checked:
> self.presentationWidget.show()
> else:
>
> === modified file
> 'openlp/plugins/presentations/lib/presentationcontroller.py'
> --- openlp/plugins/presentations/lib/presentationcontroller.py 2011-12-27
> 10:33:55 +0000
> +++ openlp/plugins/presentations/lib/presentationcontroller.py 2012-05-21
> 01:36:20 +0000
> @@ -33,6 +33,7 @@
>
> from openlp.core.lib import Receiver, check_directory_exists,
> create_thumb, \
> validate_thumb
> +from openlp.core.lib.settings import Settings
> from openlp.core.utils import AppLocation
>
> log = logging.getLogger(__name__)
> @@ -392,7 +393,7 @@
> """
> Return whether the controller is currently enabled
> """
> - if QtCore.QSettings().value(
> + if Settings().value(
> self.settings_section + u'/' + self.name,
> QtCore.QVariant(QtCore.Qt.Checked)).toInt()[0] == \
> QtCore.Qt.Checked:
>
> === modified file 'openlp/plugins/presentations/lib/presentationtab.py'
> --- openlp/plugins/presentations/lib/presentationtab.py 2012-03-10
> 18:36:59 +0000
> +++ openlp/plugins/presentations/lib/presentationtab.py 2012-05-21
> 01:36:20 +0000
> @@ -29,6 +29,7 @@
>
> from openlp.core.lib import Receiver, SettingsTab, translate
> from openlp.core.lib.ui import UiStrings
> +from openlp.core.lib.settings import Settings
>
> class PresentationTab(SettingsTab):
> """
> @@ -102,10 +103,10 @@
> for key in self.controllers:
> controller = self.controllers[key]
> checkbox = self.PresenterCheckboxes[controller.name]
> - checkbox.setChecked(QtCore.QSettings().value(
> + checkbox.setChecked(Settings().value(
> self.settingsSection + u'/' + controller.name,
> QtCore.QVariant(QtCore.Qt.Checked)).toInt()[0])
> - self.OverrideAppCheckBox.setChecked(QtCore.QSettings().value(
> + self.OverrideAppCheckBox.setChecked(Settings().value(
> self.settingsSection + u'/override app',
> QtCore.QVariant(QtCore.Qt.Unchecked)).toInt()[0])
>
> @@ -123,19 +124,19 @@
> if controller.is_available():
> checkbox = self.PresenterCheckboxes[controller.name]
> setting_key = self.settingsSection + u'/' +
> controller.name
> - if QtCore.QSettings().value(setting_key) != \
> + if Settings().value(setting_key) != \
> checkbox.checkState():
> changed = True
> - QtCore.QSettings().setValue(setting_key,
> + Settings().setValue(setting_key,
> QtCore.QVariant(checkbox.checkState()))
> if checkbox.isChecked():
> controller.start_process()
> else:
> controller.kill()
> setting_key = self.settingsSection + u'/override app'
> - if QtCore.QSettings().value(setting_key) != \
> + if Settings().value(setting_key) != \
> self.OverrideAppCheckBox.checkState():
> - QtCore.QSettings().setValue(setting_key,
> + Settings().setValue(setting_key,
> QtCore.QVariant(self.OverrideAppCheckBox.checkState()))
> changed = True
> if changed:
>
> === modified file 'openlp/plugins/remotes/lib/httpserver.py'
> --- openlp/plugins/remotes/lib/httpserver.py 2012-04-20 19:36:10 +0000
> +++ openlp/plugins/remotes/lib/httpserver.py 2012-05-21 01:36:20 +0000
> @@ -122,6 +122,7 @@
> from mako.template import Template
>
> from openlp.core.lib import Receiver, PluginStatus, StringContent
> +from openlp.core.lib.settings import Settings
> from openlp.core.utils import AppLocation, translate
>
> log = logging.getLogger(__name__)
> @@ -169,10 +170,10 @@
> clients. Listen out for socket connections.
> """
> log.debug(u'Start TCP server')
> - port = QtCore.QSettings().value(
> + port = Settings().value(
> self.plugin.settingsSection + u'/port',
> QtCore.QVariant(4316)).toInt()[0]
> - address = QtCore.QSettings().value(
> + address = Settings().value(
> self.plugin.settingsSection + u'/ip address',
> QtCore.QVariant(u'0.0.0.0')).toString()
> self.server = QtNetwork.QTcpServer()
> @@ -404,7 +405,7 @@
> u'slide': self.parent.current_slide or 0,
> u'item': self.parent.current_item._uuid \
> if self.parent.current_item else u'',
> - u'twelve':QtCore.QSettings().value(
> + u'twelve':Settings().value(
> u'remotes/twelve hour', QtCore.QVariant(True)).toBool(),
> u'blank': self.parent.plugin.liveController.blankScreen.\
> isChecked(),
>
> === modified file 'openlp/plugins/remotes/lib/remotetab.py'
> --- openlp/plugins/remotes/lib/remotetab.py 2012-03-18 09:33:05 +0000
> +++ openlp/plugins/remotes/lib/remotetab.py 2012-05-21 01:36:20 +0000
> @@ -28,6 +28,7 @@
> from PyQt4 import QtCore, QtGui, QtNetwork
>
> from openlp.core.lib import SettingsTab, translate, Receiver
> +from openlp.core.lib.settings import Settings
>
> ZERO_URL = u'0.0.0.0'
>
> @@ -149,12 +150,12 @@
>
> def load(self):
> self.portSpinBox.setValue(
> - QtCore.QSettings().value(self.settingsSection + u'/port',
> + Settings().value(self.settingsSection + u'/port',
> QtCore.QVariant(4316)).toInt()[0])
> self.addressEdit.setText(
> - QtCore.QSettings().value(self.settingsSection + u'/ip
> address',
> + Settings().value(self.settingsSection + u'/ip address',
> QtCore.QVariant(ZERO_URL)).toString())
> - self.twelveHour = QtCore.QSettings().value(
> + self.twelveHour = Settings().value(
> self.settingsSection + u'/twelve hour',
> QtCore.QVariant(True)).toBool()
> self.twelveHourCheckBox.setChecked(self.twelveHour)
> @@ -162,16 +163,16 @@
>
> def save(self):
> changed = False
> - if QtCore.QSettings().value(self.settingsSection + u'/ip address',
> + if Settings().value(self.settingsSection + u'/ip address',
> QtCore.QVariant(ZERO_URL).toString() !=
> self.addressEdit.text() or
> - QtCore.QSettings().value(self.settingsSection + u'/port',
> + Settings().value(self.settingsSection + u'/port',
> QtCore.QVariant(4316).toInt()[0]) != self.portSpinBox.value()):
> changed = True
> - QtCore.QSettings().setValue(self.settingsSection + u'/port',
> + Settings().setValue(self.settingsSection + u'/port',
> QtCore.QVariant(self.portSpinBox.value()))
> - QtCore.QSettings().setValue(self.settingsSection + u'/ip address',
> + Settings().setValue(self.settingsSection + u'/ip address',
> QtCore.QVariant(self.addressEdit.text()))
> - QtCore.QSettings().setValue(self.settingsSection + u'/twelve
> hour',
> + Settings().setValue(self.settingsSection + u'/twelve hour',
> QtCore.QVariant(self.twelveHour))
> if changed:
> Receiver.send_message(u'remotes_config_updated')
>
> === modified file 'openlp/plugins/songs/forms/songimportform.py'
> --- openlp/plugins/songs/forms/songimportform.py 2012-05-03
> 12:50:10 +0000
> +++ openlp/plugins/songs/forms/songimportform.py 2012-05-21
> 01:36:20 +0000
> @@ -35,6 +35,7 @@
>
> from openlp.core.lib import Receiver, SettingsManager, translate
> from openlp.core.lib.ui import UiStrings, critical_error_message_box
> +from openlp.core.lib.settings import Settings
> from openlp.core.ui.wizard import OpenLPWizard, WizardStrings
> from openlp.plugins.songs.lib.importer import SongFormat
>
> @@ -387,7 +388,7 @@
> return True
> elif self.currentPage() == self.sourcePage:
> source_format = self.formatComboBox.currentIndex()
> - QtCore.QSettings().setValue(u'songs/last import type',
> + Settings().setValue(u'songs/last import type',
> source_format)
> if source_format == SongFormat.OpenLP2:
> if self.openLP2FilenameEdit.text().isEmpty():
> @@ -740,7 +741,7 @@
> self.restart()
> self.finishButton.setVisible(False)
> self.cancelButton.setVisible(True)
> - last_import_type = QtCore.QSettings().value(
> + last_import_type = Settings().value(
> u'songs/last import type').toInt()[0]
> if last_import_type < 0 or \
> last_import_type >= self.formatComboBox.count():
>
> === modified file 'openlp/plugins/songs/lib/mediaitem.py'
> --- openlp/plugins/songs/lib/mediaitem.py 2012-04-29 15:31:56 +0000
> +++ openlp/plugins/songs/lib/mediaitem.py 2012-05-21 01:36:20 +0000
> @@ -37,6 +37,7 @@
> from openlp.core.lib import MediaManagerItem, Receiver, ItemCapabilities,
> \
> translate, check_item_selected, PluginStatus, create_separated_list
> from openlp.core.lib.ui import UiStrings, create_widget_action
> +from openlp.core.lib.settings import Settings
> from openlp.core.utils import AppLocation
> from openlp.plugins.songs.forms import EditSongForm, SongMaintenanceForm,
> \
> SongImportForm, SongExportForm
> @@ -131,13 +132,13 @@
> self.searchTextEdit.setFocus()
>
> def configUpdated(self):
> - self.searchAsYouType = QtCore.QSettings().value(
> + self.searchAsYouType = Settings().value(
> self.settingsSection + u'/search as type',
> QtCore.QVariant(u'False')).toBool()
> - self.updateServiceOnEdit = QtCore.QSettings().value(
> + self.updateServiceOnEdit = Settings().value(
> self.settingsSection + u'/update service on edit',
> QtCore.QVariant(u'False')).toBool()
> - self.addSongFromService = QtCore.QSettings().value(
> + self.addSongFromService = Settings().value(
> self.settingsSection + u'/add song from service',
> QtCore.QVariant(u'True')).toBool()
>
> @@ -168,14 +169,14 @@
> (SongSearch.Themes, u':/slides/slide_theme.png',
> UiStrings().Themes, UiStrings().SearchThemes)
> ])
> - self.searchTextEdit.setCurrentSearchType(QtCore.QSettings().value(
> + self.searchTextEdit.setCurrentSearchType(Settings().value(
> u'%s/last search type' % self.settingsSection,
> QtCore.QVariant(SongSearch.Entire)).toInt()[0])
> self.configUpdated()
>
> def onSearchTextButtonClicked(self):
> # Save the current search type to the configuration.
> - QtCore.QSettings().setValue(u'%s/last search type' %
> + Settings().setValue(u'%s/last search type' %
> self.settingsSection,
> QtCore.QVariant(self.searchTextEdit.currentSearchType()))
> # Reload the list considering the new search type.
> @@ -516,11 +517,11 @@
> service_item.raw_footer.append(song.title)
> service_item.raw_footer.append(create_separated_list(author_list))
> service_item.raw_footer.append(song.copyright)
> - if QtCore.QSettings().value(u'general/ccli number',
> + if Settings().value(u'general/ccli number',
> QtCore.QVariant(u'')).toString():
> service_item.raw_footer.append(unicode(
> translate('SongsPlugin.MediaItem', 'CCLI License: ') +
> - QtCore.QSettings().value(u'general/ccli number',
> + Settings().value(u'general/ccli number',
> QtCore.QVariant(u'')).toString()))
> service_item.audit = [
> song.title, author_list, song.copyright,
> unicode(song.ccli_number)
>
> === modified file 'openlp/plugins/songs/lib/songstab.py'
> --- openlp/plugins/songs/lib/songstab.py 2012-04-02 19:52:47 +0000
> +++ openlp/plugins/songs/lib/songstab.py 2012-05-21 01:36:20 +0000
> @@ -28,6 +28,7 @@
> from PyQt4 import QtCore, QtGui
>
> from openlp.core.lib import SettingsTab, translate
> +from openlp.core.lib.settings import Settings
>
> class SongsTab(SettingsTab):
> """
> @@ -110,7 +111,7 @@
> self.update_load = True
>
> def load(self):
> - settings = QtCore.QSettings()
> + settings = Settings()
> settings.beginGroup(self.settingsSection)
> self.song_search = settings.value(
> u'search as type', QtCore.QVariant(False)).toBool()
> @@ -127,7 +128,7 @@
> settings.endGroup()
>
> def save(self):
> - settings = QtCore.QSettings()
> + settings = Settings()
> settings.beginGroup(self.settingsSection)
> settings.setValue(u'search as type',
> QtCore.QVariant(self.song_search))
> settings.setValue(u'display songbar',
> QtCore.QVariant(self.tool_bar))
>
> === modified file 'openlp/plugins/songusage/forms/songusagedetailform.py'
> --- openlp/plugins/songusage/forms/songusagedetailform.py 2012-04-03
> 17:58:42 +0000
> +++ openlp/plugins/songusage/forms/songusagedetailform.py 2012-05-21
> 01:36:20 +0000
> @@ -33,6 +33,7 @@
>
> from openlp.core.lib import SettingsManager, translate, Receiver, \
> check_directory_exists
> +from openlp.core.lib.settings import Settings
> from openlp.plugins.songusage.lib.db import SongUsageItem
> from songusagedetaildialog import Ui_SongUsageDetailDialog
>
> @@ -59,10 +60,10 @@
> year = QtCore.QDate().currentDate().year()
> if QtCore.QDate().currentDate().month() < 9:
> year -= 1
> - toDate = QtCore.QSettings().value(
> + toDate = Settings().value(
> u'songusage/to date',
> QtCore.QVariant(QtCore.QDate(year, 8, 31))).toDate()
> - fromDate = QtCore.QSettings().value(
> + fromDate = Settings().value(
> u'songusage/from date',
> QtCore.QVariant(QtCore.QDate(year - 1, 9, 1))).toDate()
> self.fromDate.setSelectedDate(fromDate)
> @@ -103,9 +104,9 @@
> 'usage_detail_%s_%s.txt')) % (
> self.fromDate.selectedDate().toString(u'ddMMyyyy'),
> self.toDate.selectedDate().toString(u'ddMMyyyy'))
> - QtCore.QSettings().setValue(u'songusage/from date',
> + Settings().setValue(u'songusage/from date',
> QtCore.QVariant(self.fromDate.selectedDate()))
> - QtCore.QSettings().setValue(u'songusage/to date',
> + Settings().setValue(u'songusage/to date',
> QtCore.QVariant(self.toDate.selectedDate()))
> usage = self.plugin.manager.get_all_objects(
> SongUsageItem, and_(
>
> === modified file 'openlp/plugins/songusage/songusageplugin.py'
> --- openlp/plugins/songusage/songusageplugin.py 2012-04-21 22:29:08 +0000
> +++ openlp/plugins/songusage/songusageplugin.py 2012-05-21 01:36:20 +0000
> @@ -34,6 +34,7 @@
> translate
> from openlp.core.lib.db import Manager
> from openlp.core.lib.ui import create_action
> +from openlp.core.lib.settings import Settings
> from openlp.core.utils.actions import ActionList
> from openlp.plugins.songusage.forms import SongUsageDetailForm, \
> SongUsageDeleteForm
> @@ -125,7 +126,7 @@
> QtCore.QObject.connect(Receiver.get_receiver(),
> QtCore.SIGNAL(u'print_service_started'),
> self.printSongUsage)
> - self.songUsageActive = QtCore.QSettings().value(
> + self.songUsageActive = Settings().value(
> self.settingsSection + u'/active',
> QtCore.QVariant(False)).toBool()
> # Set the button and checkbox state
> @@ -168,7 +169,7 @@
> the UI when necessary,
> """
> self.songUsageActive = not self.songUsageActive
> - QtCore.QSettings().setValue(self.settingsSection + u'/active',
> + Settings().setValue(self.settingsSection + u'/active',
> QtCore.QVariant(self.songUsageActive))
> self.setButtonState()
>
>
>
> ...
--
https://code.launchpad.net/~smpettit/openlp/portable/+merge/106555
Your team OpenLP Core is requested to review the proposed merge of lp:~smpettit/openlp/portable into lp:openlp.
Follow ups
References