forked from openlp/openlp
fixed 'song/ccli number' setting; do not change setting.ini when IMPORTING
This commit is contained in:
parent
827f978970
commit
cc5776c7d3
@ -227,10 +227,7 @@ class Settings(QtCore.QSettings):
|
|||||||
u'user interface/live splitter geometry': QtCore.QByteArray(),
|
u'user interface/live splitter geometry': QtCore.QByteArray(),
|
||||||
u'user interface/main window state': QtCore.QByteArray(),
|
u'user interface/main window state': QtCore.QByteArray(),
|
||||||
u'media/players': u'webkit',
|
u'media/players': u'webkit',
|
||||||
u'media/override player': QtCore.Qt.Unchecked,
|
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''
|
|
||||||
}
|
}
|
||||||
__file_path__ = u''
|
__file_path__ = u''
|
||||||
__obsolete_settings__ = [
|
__obsolete_settings__ = [
|
||||||
@ -243,7 +240,8 @@ class Settings(QtCore.QSettings):
|
|||||||
(u'bibles/last directory 1', u'bibles/last directory import', []),
|
(u'bibles/last directory 1', u'bibles/last directory import', []),
|
||||||
(u'songusage/last directory 1', u'songusage/last directory export', []),
|
(u'songusage/last directory 1', u'songusage/last directory export', []),
|
||||||
(u'advanced/stylesheet fix', u'', []),
|
(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
|
@staticmethod
|
||||||
|
@ -40,7 +40,7 @@ from datetime import datetime
|
|||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from openlp.core.lib import Renderer, build_icon, OpenLPDockWidget, PluginManager, Receiver, translate, ImageManager, \
|
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.lib.ui import UiStrings, create_action
|
||||||
from openlp.core.ui import AboutForm, SettingsForm, ServiceManager, ThemeManager, SlideController, PluginForm, \
|
from openlp.core.ui import AboutForm, SettingsForm, ServiceManager, ThemeManager, SlideController, PluginForm, \
|
||||||
MediaDockManager, ShortcutListForm, FormattingTagForm
|
MediaDockManager, ShortcutListForm, FormattingTagForm
|
||||||
@ -819,8 +819,15 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
|||||||
# Add plugin sections.
|
# Add plugin sections.
|
||||||
for plugin in self.pluginManager.plugins:
|
for plugin in self.pluginManager.plugins:
|
||||||
setting_sections.extend([plugin.name])
|
setting_sections.extend([plugin.name])
|
||||||
|
# Copy the settings file to the tmp dir, because we do not want to overwrite 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()
|
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
|
# 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
|
# 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
|
# from it, and just silently ignore anything we don't recognise
|
||||||
|
Loading…
Reference in New Issue
Block a user