Merge trunk.

This commit is contained in:
Patrick Zimmermann 2013-01-31 00:31:57 +01:00
commit bc93e5e3e2
4 changed files with 18 additions and 11 deletions

View File

@ -99,6 +99,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',
@ -141,7 +142,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',
@ -228,7 +228,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'servicemanager/last directory', u'', []),
(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'songusage/last directory 1', u'songusage/last directory export', []),
(u'advanced/stylesheet fix', u'', []),
(u'media/background color', u'players/background color', [])
]
@staticmethod

View File

@ -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):
"""

View File

@ -848,7 +848,8 @@ class ServiceManager(QtGui.QWidget):
service_item.auto_play_slides_loop = False
self.autoPlaySlidesLoop.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.mainwindow.generalSettingsSection + u'/loop delay')
self.setModified()
def toggleAutoPlaySlidesLoop(self):
@ -862,7 +863,8 @@ class ServiceManager(QtGui.QWidget):
service_item.auto_play_slides_once = False
self.autoPlaySlidesOnce.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.mainwindow.generalSettingsSection + u'/loop delay')
self.setModified()
def onTimedSlideInterval(self):
@ -873,7 +875,7 @@ class ServiceManager(QtGui.QWidget):
item = self.findServiceItem()[0]
service_item = self.serviceItems[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',

View File

@ -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"'