renamed general settings to core

Fixes: https://launchpad.net/bugs/1133237
This commit is contained in:
Andreas Preikschat 2013-02-28 21:47:59 +01:00
parent 469d8b05c4
commit 40de8647cf
11 changed files with 78 additions and 51 deletions

View File

@ -113,10 +113,10 @@ class OpenLP(QtGui.QApplication):
# Decide how many screens we have and their size
screens = ScreenList.create(self.desktop())
# First time checks in settings
has_run_wizard = Settings().value(u'general/has run wizard')
has_run_wizard = Settings().value(u'core/has run wizard')
if not has_run_wizard:
if FirstTimeForm(screens).exec_() == QtGui.QDialog.Accepted:
Settings().setValue(u'general/has run wizard', True)
Settings().setValue(u'core/has run wizard', True)
# Correct stylesheet bugs
application_stylesheet = u''
if not Settings().value(u'advanced/alternate rows'):
@ -128,7 +128,7 @@ class OpenLP(QtGui.QApplication):
application_stylesheet += nt_repair_stylesheet
if application_stylesheet:
self.setStyleSheet(application_stylesheet)
show_splash = Settings().value(u'general/show splash')
show_splash = Settings().value(u'core/show splash')
if show_splash:
self.splash = SplashScreen()
self.splash.show()
@ -147,7 +147,7 @@ class OpenLP(QtGui.QApplication):
self.processEvents()
if not has_run_wizard:
self.main_window.first_time()
update_check = Settings().value(u'general/update check')
update_check = Settings().value(u'core/update check')
if update_check:
VersionThread(self.main_window).start()
self.main_window.is_display_blank()
@ -309,7 +309,7 @@ def main(args=None):
if application.is_already_running():
sys.exit()
# First time checks in settings
if not Settings().value(u'general/has run wizard'):
if not Settings().value(u'core/has run wizard'):
if not FirstTimeLanguageForm().exec_():
# if cancel then stop processing
sys.exit()

View File

@ -247,15 +247,15 @@ class ScreenList(object):
# Add the screen settings to the settings dict. This has to be done here due to cyclic dependency.
# Do not do this anywhere else.
screen_settings = {
u'general/x position': self.current[u'size'].x(),
u'general/y position': self.current[u'size'].y(),
u'general/monitor': self.display_count - 1,
u'general/height': self.current[u'size'].height(),
u'general/width': self.current[u'size'].width()
u'core/x position': self.current[u'size'].x(),
u'core/y position': self.current[u'size'].y(),
u'core/monitor': self.display_count - 1,
u'core/height': self.current[u'size'].height(),
u'core/width': self.current[u'size'].width()
}
Settings.extend_default_settings(screen_settings)
settings = Settings()
settings.beginGroup(u'general')
settings.beginGroup(u'core')
monitor = settings.value(u'monitor')
self.set_current_display(monitor)
self.display = settings.value(u'display on monitor')

View File

@ -116,30 +116,30 @@ class Settings(QtCore.QSettings):
u'advanced/x11 bypass wm': X11_BYPASS_DEFAULT,
u'crashreport/last directory': u'',
u'displayTags/html_tags': u'',
u'general/audio repeat list': False,
u'general/auto open': False,
u'general/auto preview': False,
u'general/audio start paused': True,
u'general/auto unblank': False,
u'general/blank warning': False,
u'general/ccli number': u'',
u'general/has run wizard': False,
u'general/language': u'[en]',
u'core/audio repeat list': False,
u'core/auto open': False,
u'core/auto preview': False,
u'core/audio start paused': True,
u'core/auto unblank': False,
u'core/blank warning': False,
u'core/ccli number': u'',
u'core/has run wizard': False,
u'core/language': u'[en]',
# This defaults to yesterday in order to force the update check to run when you've never run it before.
u'general/last version test': datetime.datetime.now().date() - datetime.timedelta(days=1),
u'general/loop delay': 5,
u'general/recent files': [],
u'general/save prompt': False,
u'general/screen blank': False,
u'general/show splash': True,
u'general/songselect password': u'',
u'general/songselect username': u'',
u'general/update check': True,
u'general/view mode': u'default',
u'core/last version test': datetime.datetime.now().date() - datetime.timedelta(days=1),
u'core/loop delay': 5,
u'core/recent files': [],
u'core/save prompt': False,
u'core/screen blank': False,
u'core/show splash': True,
u'core/songselect password': u'',
u'core/songselect username': u'',
u'core/update check': True,
u'core/view mode': u'default',
# The other display settings (display position and dimensions) are defined in the ScreenList class due to a
# circular dependency.
u'general/display on monitor': True,
u'general/override position': False,
u'core/display on monitor': True,
u'core/override position': False,
u'images/background color': u'#000000',
u'media/players': u'webkit',
u'media/override player': QtCore.Qt.Unchecked,
@ -304,7 +304,7 @@ class Settings(QtCore.QSettings):
# Changed during 1.9.x development.
(u'bibles/bookname language', u'bibles/book name language', []),
(u'general/enable slide loop', u'advanced/slide limits', [(SlideLimits.Wrap, True), (SlideLimits.End, False)]),
(u'songs/ccli number', u'general/ccli number', []),
(u'songs/ccli number', u'core/ccli number', []),
# Changed during 2.1.x development.
(u'advanced/stylesheet fix', u'', []),
(u'bibles/last directory 1', u'bibles/last directory import', []),
@ -314,7 +314,34 @@ class Settings(QtCore.QSettings):
(u'songs/last directory 1', u'songs/last directory import', []),
(u'songusage/last directory 1', u'songusage/last directory export', []),
(u'user interface/mainwindow splitter geometry', u'user interface/main window splitter geometry', []),
(u'shortcuts/makeLive', u'shortcuts/make_live', [])
(u'shortcuts/makeLive', u'shortcuts/make_live', []),
(u'general/audio repeat list', u'core/audio repeat list', []),
(u'general/auto open', u'core/auto open', []),
(u'general/auto preview', u'core/auto preview', []),
(u'general/audio start paused', u'core/audio start paused', []),
(u'general/auto unblank', u'core/auto unblank', []),
(u'general/blank warning', u'core/blank warning', []),
(u'general/ccli number', u'core/ccli number', []),
(u'general/has run wizard', u'core/has run wizard', []),
(u'general/language', u'core/language', []),
(u'general/last version test', u'core/last version test', []),
(u'general/loop delay', u'core/loop delay', []),
(u'general/recent files', u'core/recent files', []),
(u'general/save prompt', u'core/save prompt', []),
(u'general/screen blank', u'core/screen blank', []),
(u'general/show splash', u'core/show splash', []),
(u'general/songselect password', u'core/songselect password', []),
(u'general/songselect username', u'core/songselect username', []),
(u'general/update check', u'core/update check', []),
(u'general/view mode', u'core/view mode', []),
(u'general/display on monitor', u'core/display on monitor', []),
(u'general/override position', u'core/override position', []),
(u'general/x position', u'core/x position', []),
(u'general/y position', u'core/y position', []),
(u'general/monitor', u'core/monitor', []),
(u'general/height', u'core/height', []),
(u'general/monitor', u'core/monitor', []),
(u'general/width', u'core/width', [])
]
@staticmethod

View File

@ -120,7 +120,7 @@ class FirstTimeForm(QtGui.QWizard, Ui_FirstTimeWizard):
check_directory_exists(os.path.join(unicode(gettempdir(), get_filesystem_encoding()), u'openlp'))
self.noInternetFinishButton.setVisible(False)
# Check if this is a re-run of the wizard.
self.hasRunWizard = Settings().value(u'general/has run wizard')
self.hasRunWizard = Settings().value(u'core/has run wizard')
# Sort out internet access for downloads
if self.web_access:
songs = self.config.get(u'songs', u'languages')
@ -254,7 +254,7 @@ class FirstTimeForm(QtGui.QWizard, Ui_FirstTimeWizard):
self.application.set_busy_cursor()
self._performWizard()
self.application.set_normal_cursor()
Settings().setValue(u'general/has run wizard', True)
Settings().setValue(u'core/has run wizard', True)
self.close()
def urlGetFile(self, url, fpath):
@ -461,7 +461,7 @@ class FirstTimeForm(QtGui.QWizard, Ui_FirstTimeWizard):
self.urlGetFile(u'%s%s' % (self.web, theme), os.path.join(themes_destination, theme))
# Set Default Display
if self.displayComboBox.currentIndex() != -1:
Settings().setValue(u'General/monitor', self.displayComboBox.currentIndex())
Settings().setValue(u'core/monitor', self.displayComboBox.currentIndex())
self.screens.set_current_display(self.displayComboBox.currentIndex())
# Set Global Theme
if self.themeComboBox.currentIndex() != -1:

View File

@ -49,7 +49,7 @@ class GeneralTab(SettingsTab):
self.screens = ScreenList()
self.iconPath = u':/icon/openlp-logo-16x16.png'
generalTranslated = translate('OpenLP.GeneralTab', 'General')
SettingsTab.__init__(self, parent, u'General', generalTranslated)
SettingsTab.__init__(self, parent, u'Core', generalTranslated)
def setupUi(self):
"""

View File

@ -367,7 +367,7 @@ class MainDisplay(Display):
# Single screen active
if self.screens.display_count == 1:
# Only make visible if setting enabled.
if Settings().value(u'general/display on monitor'):
if Settings().value(u'core/display on monitor'):
self.setVisible(True)
else:
self.setVisible(True)
@ -416,7 +416,7 @@ class MainDisplay(Display):
self.footer(serviceItem.foot_text)
# if was hidden keep it hidden
if self.hideMode and self.isLive and not serviceItem.is_media():
if Settings().value(u'general/auto unblank'):
if Settings().value(u'core/auto unblank'):
Registry().execute(u'slidecontroller_live_unblank')
else:
self.hide_display(self.hideMode)
@ -438,7 +438,7 @@ class MainDisplay(Display):
log.debug(u'hide_display mode = %d', mode)
if self.screens.display_count == 1:
# Only make visible if setting enabled.
if not Settings().value(u'general/display on monitor'):
if not Settings().value(u'core/display on monitor'):
return
if mode == HideMode.Screen:
self.frame.evaluateJavaScript(u'show_blank("desktop");')
@ -462,7 +462,7 @@ class MainDisplay(Display):
log.debug(u'show_display')
if self.screens.display_count == 1:
# Only make visible if setting enabled.
if not Settings().value(u'general/display on monitor'):
if not Settings().value(u'core/display on monitor'):
return
self.frame.evaluateJavaScript('show_blank("show");')
if self.isHidden():

View File

@ -469,7 +469,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
self.arguments = self.application.args
# Set up settings sections for the main application (not for use by plugins).
self.uiSettingsSection = u'user interface'
self.generalSettingsSection = u'general'
self.generalSettingsSection = u'core'
self.advancedSettingsSection = u'advanced'
self.shortcutsSettingsSection = u'shortcuts'
self.serviceManagerSettingsSection = u'servicemanager'

View File

@ -417,7 +417,7 @@ class MediaController(object):
elif not hidden or controller.media_info.is_background or serviceItem.will_auto_start:
autoplay = True
# Unblank on load set
elif Settings().value(u'general/auto unblank'):
elif Settings().value(u'core/auto unblank'):
autoplay = True
if autoplay:
if not self.media_play(controller):

View File

@ -98,7 +98,7 @@ class LanguageManager(object):
"""
Retrieve a saved language to use from settings
"""
language = Settings().value(u'general/language')
language = Settings().value(u'core/language')
language = str(language)
log.info(u'Language file: \'%s\' Loaded from conf file' % language)
if re.match(r'[[].*[]]', language):
@ -128,7 +128,7 @@ class LanguageManager(object):
language = unicode(qm_list[action_name])
if LanguageManager.auto_language:
language = u'[%s]' % language
Settings().setValue(u'general/language', language)
Settings().setValue(u'core/language', language)
log.info(u'Language file: \'%s\' written to conf file' % language)
if message:
QtGui.QMessageBox.information(None,

View File

@ -457,9 +457,9 @@ class SongMediaItem(MediaManagerItem):
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 Settings().value(u'general/ccli number'):
if Settings().value(u'core/ccli number'):
service_item.raw_footer.append(translate('SongsPlugin.MediaItem', 'CCLI License: ') +
Settings().value(u'general/ccli number'))
Settings().value(u'core/ccli number'))
service_item.audit = [
song.title, author_list, song.copyright, unicode(song.ccli_number)
]

View File

@ -35,16 +35,16 @@ class TestSettings(TestCase):
# GIVEN: A new Settings setup
# WHEN reading a setting for the first time
default_value = Settings().value(u'general/has run wizard')
default_value = Settings().value(u'core/has run wizard')
# THEN the default value is returned
assert default_value is False, u'The default value should be False'
# WHEN a new value is saved into config
Settings().setValue(u'general/has run wizard', True)
Settings().setValue(u'core/has run wizard', True)
# THEN the new value is returned when re-read
assert Settings().value(u'general/has run wizard') is True, u'The saved value should have been returned'
assert Settings().value(u'core/has run wizard') is True, u'The saved value should have been returned'
def settings_override_test(self):
"""