openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #19031
[Merge] lp:~googol/openlp/central-settings-place into lp:openlp
Andreas Preikschat has proposed merging lp:~googol/openlp/central-settings-place into lp:openlp.
Requested reviews:
OpenLP Core (openlp-core)
Related bugs:
Bug #1096559 in OpenLP: "Central place for default settings"
https://bugs.launchpad.net/openlp/+bug/1096559
For more details, see:
https://code.launchpad.net/~googol/openlp/central-settings-place/+merge/145720
Hello,
- fixed old "songs/ccli number" setting
- do not make changes to the settings file when importing
- move settings file to the tmp dir and clean it up there (so that old config files are "converted" to a state where they look as if they were just exported)
--
https://code.launchpad.net/~googol/openlp/central-settings-place/+merge/145720
Your team OpenLP Core is requested to review the proposed merge of lp:~googol/openlp/central-settings-place into lp:openlp.
=== modified file 'openlp/core/lib/settings.py'
--- openlp/core/lib/settings.py 2013-01-30 19:16:51 +0000
+++ openlp/core/lib/settings.py 2013-01-30 20:36:24 +0000
@@ -227,10 +227,7 @@
u'user interface/live splitter geometry': QtCore.QByteArray(),
u'user interface/main window state': QtCore.QByteArray(),
u'media/players': u'webkit',
- u'media/override player': QtCore.Qt.Unchecked,
- # Old settings (not used anymore). Have to be here, so that old setting.config backups can be imported.
- u'advanced/stylesheet fix': u'',
- u'servicemanager/last directory': u''
+ u'media/override player': QtCore.Qt.Unchecked
}
__file_path__ = u''
__obsolete_settings__ = [
@@ -243,7 +240,8 @@
(u'bibles/last directory 1', u'bibles/last directory import', []),
(u'songusage/last directory 1', u'songusage/last directory export', []),
(u'advanced/stylesheet fix', u'', []),
- (u'media/background color', u'players/background color', [])
+ (u'media/background color', u'players/background color', []),
+ (u'songs/ccli number', u'general/ccli number', [])
]
@staticmethod
=== modified file 'openlp/core/ui/mainwindow.py'
--- openlp/core/ui/mainwindow.py 2013-01-30 18:29:10 +0000
+++ openlp/core/ui/mainwindow.py 2013-01-30 20:36:24 +0000
@@ -40,7 +40,7 @@
from PyQt4 import QtCore, QtGui
from openlp.core.lib import Renderer, build_icon, OpenLPDockWidget, PluginManager, Receiver, translate, ImageManager, \
- PluginStatus, Registry, Settings, ScreenList
+ PluginStatus, Registry, Settings, ScreenList, check_directory_exists
from openlp.core.lib.ui import UiStrings, create_action
from openlp.core.ui import AboutForm, SettingsForm, ServiceManager, ThemeManager, SlideController, PluginForm, \
MediaDockManager, ShortcutListForm, FormattingTagForm
@@ -819,8 +819,15 @@
# Add plugin sections.
for plugin in self.pluginManager.plugins:
setting_sections.extend([plugin.name])
+ # Copy the settings file to the tmp dir, because we do not want to change the original one.
+ temp_directory = os.path.join(unicode(gettempdir()), u'openlp')
+ check_directory_exists(temp_directory)
+ temp_config = os.path.join(temp_directory, os.path.basename(import_file_name))
+ shutil.copyfile(import_file_name, temp_config)
settings = Settings()
- import_settings = Settings(import_file_name, Settings.IniFormat)
+ import_settings = Settings(temp_config, Settings.IniFormat)
+ # Remove/rename old settings to prepare the import.
+ import_settings.remove_obsolete_settings()
# Lets do a basic sanity check. If it contains this string we can
# assume it was created by OpenLP and so we'll load what we can
# from it, and just silently ignore anything we don't recognise
Follow ups