diff --git a/openlp/core/lib/settings.py b/openlp/core/lib/settings.py index 55d87f142..0591871cc 100644 --- a/openlp/core/lib/settings.py +++ b/openlp/core/lib/settings.py @@ -98,6 +98,7 @@ class Settings(QtCore.QSettings): u'advanced/hide mouse': True, u'advanced/current media plugin': -1, u'advanced/double click live': False, + u'advanced/data path': u'', u'advanced/default service hour': 11, u'advanced/default color': u'#ffffff', u'advanced/default image': u':/graphics/openlp-splash-screen.png', @@ -140,7 +141,6 @@ class Settings(QtCore.QSettings): u'general/blank warning': False, u'players/background color': u'#000000', u'servicemanager/service theme': u'', - u'servicemanager/last directory': u'', u'servicemanager/last file': u'', u'SettingsImport/Make_Changes': u'At_Own_RISK', u'SettingsImport/type': u'OpenLP_settings_export', @@ -227,7 +227,10 @@ class Settings(QtCore.QSettings): 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 + 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'' __obsolete_settings__ = [ @@ -239,7 +242,9 @@ class Settings(QtCore.QSettings): (u'songs/last directory 1', u'songs/last directory import', []), (u'bibles/last directory 1', u'bibles/last directory import', []), (u'songusage/last directory 1', u'songusage/last directory export', []), - (u'shortcuts/makeLive', u'shortcuts/make_live', []) + (u'shortcuts/makeLive', u'shortcuts/make_live', []), + (u'advanced/stylesheet fix', u'', []), + (u'media/background color', u'players/background color', []) ] @staticmethod diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index 75ad56d8a..77e954943 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -921,7 +921,8 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): # Write all the sections and keys. for section_key in keys: # FIXME: We are conflicting with the standard "General" section. - section_key = section_key.lower() + if u'eneral' in section_key: + section_key = section_key.lower() key_value = settings.value(section_key) if key_value is not None: export_settings.setValue(section_key, key_value) @@ -939,7 +940,6 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): temp_conf.close() export_conf.close() os.remove(temp_file) - return def onModeDefaultItemClicked(self): """ diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index 0074fd18f..fe1023bbf 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -872,9 +872,11 @@ class ServiceManager(QtGui.QWidget, ServiceManagerDialog): service_item.auto_play_slides_loop = False self.auto_play_slides_loop.setChecked(False) if service_item.auto_play_slides_once and service_item.timed_slide_interval == 0: - service_item.timed_slide_interval = Settings().value(u'loop delay') + service_item.timed_slide_interval = Settings().value( + self.main_window.generalSettingsSection + u'/loop delay') self.set_modified() + def toggle_auto_play_slides_loop(self): """ Toggle Auto play slide loop. @@ -886,9 +888,11 @@ class ServiceManager(QtGui.QWidget, ServiceManagerDialog): service_item.auto_play_slides_once = False self.auto_play_slides_once.setChecked(False) if service_item.auto_play_slides_loop and service_item.timed_slide_interval == 0: - service_item.timed_slide_interval = Settings().value(u'loop delay') + service_item.timed_slide_interval = Settings().value( + self.main_window.generalSettingsSection + u'/loop delay') self.set_modified() + def on_timed_slide_interval(self): """ Shows input dialog for enter interval in seconds for delay @@ -896,7 +900,7 @@ class ServiceManager(QtGui.QWidget, ServiceManagerDialog): item = self.find_service_item()[0] service_item = self.service_items[item][u'service_item'] if service_item.timed_slide_interval == 0: - timed_slide_interval = Settings().value(u'loop delay') + timed_slide_interval = Settings().value(self.mainwindow.generalSettingsSection + u'/loop delay') else: timed_slide_interval = service_item.timed_slide_interval timed_slide_interval, ok = QtGui.QInputDialog.getInteger(self, translate('OpenLP.ServiceManager', diff --git a/tests/functional/openlp_core_utils/test_applocation.py b/tests/functional/openlp_core_utils/test_applocation.py index 38cc57d70..f874de4db 100644 --- a/tests/functional/openlp_core_utils/test_applocation.py +++ b/tests/functional/openlp_core_utils/test_applocation.py @@ -48,7 +48,7 @@ class TestAppLocation(TestCase): data_path = AppLocation.get_data_path() # THEN: the mocked Settings methods were called and the value returned was our set up value mocked_settings.contains.assert_called_with(u'advanced/data path') - mocked_settings.value.assert_called_with(u'advanced/data path', u'') + mocked_settings.value.assert_called_with(u'advanced/data path') assert data_path == u'custom/dir', u'Result should be "custom/dir"' def get_section_data_path_test(self): @@ -76,7 +76,7 @@ class TestAppLocation(TestCase): directory = AppLocation.get_directory(AppLocation.AppDir) # THEN: assert directory == u'app/dir', u'Directory should be "app/dir"' - + def get_directory_for_plugins_dir_test(self): """ Test the AppLocation.get_directory() method for AppLocation.PluginsDir @@ -94,4 +94,4 @@ class TestAppLocation(TestCase): directory = AppLocation.get_directory(AppLocation.PluginsDir) # THEN: assert directory == u'plugins/dir', u'Directory should be "plugins/dir"' - +