Andreas Preikschat has proposed merging lp:~googol/openlp/bug-1133237 into lp:openlp.
Requested reviews: OpenLP Core (openlp-core) Related bugs: Bug #1133237 in OpenLP: "Our "General" settings section conflicts with Qt" https://bugs.launchpad.net/openlp/+bug/1133237 For more details, see: https://code.launchpad.net/~googol/openlp/bug-1133237/+merge/156063 Hello, I know this is missing a test, but I still want you to review it. - removed "General" section and introduced a "Core" section -- https://code.launchpad.net/~googol/openlp/bug-1133237/+merge/156063 Your team OpenLP Core is requested to review the proposed merge of lp:~googol/openlp/bug-1133237 into lp:openlp.
=== modified file 'openlp/core/__init__.py' --- openlp/core/__init__.py 2013-03-23 07:07:06 +0000 +++ openlp/core/__init__.py 2013-03-28 20:26:35 +0000 @@ -111,10 +111,10 @@ # 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'): @@ -126,7 +126,7 @@ 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 @@ 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() @@ -305,8 +305,10 @@ # Instance check if application.is_already_running(): sys.exit() + # Remove/convert obsolete settings. + Settings().remove_obsolete_settings() # 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() === modified file 'openlp/core/lib/screen.py' --- openlp/core/lib/screen.py 2013-03-08 08:14:39 +0000 +++ openlp/core/lib/screen.py 2013-03-28 20:26:35 +0000 @@ -247,15 +247,15 @@ # 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') === modified file 'openlp/core/lib/settings.py' --- openlp/core/lib/settings.py 2013-03-19 19:43:22 +0000 +++ openlp/core/lib/settings.py 2013-03-28 20:26:35 +0000 @@ -116,30 +116,30 @@ 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 @@ # 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 @@ (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 === modified file 'openlp/core/ui/firsttimeform.py' --- openlp/core/ui/firsttimeform.py 2013-03-14 22:22:18 +0000 +++ openlp/core/ui/firsttimeform.py 2013-03-28 20:26:35 +0000 @@ -118,7 +118,7 @@ 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') @@ -252,7 +252,7 @@ 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): @@ -459,7 +459,7 @@ 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: === modified file 'openlp/core/ui/generaltab.py' --- openlp/core/ui/generaltab.py 2013-03-17 09:21:18 +0000 +++ openlp/core/ui/generaltab.py 2013-03-28 20:26:35 +0000 @@ -49,7 +49,7 @@ self.screens = ScreenList() self.icon_path = u':/icon/openlp-logo-16x16.png' general_translated = translate('OpenLP.GeneralTab', 'General') - SettingsTab.__init__(self, parent, u'General', general_translated) + SettingsTab.__init__(self, parent, u'Core', general_translated) def setupUi(self): """ === modified file 'openlp/core/ui/maindisplay.py' --- openlp/core/ui/maindisplay.py 2013-03-10 20:19:42 +0000 +++ openlp/core/ui/maindisplay.py 2013-03-28 20:26:35 +0000 @@ -357,7 +357,7 @@ # 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) @@ -405,7 +405,7 @@ self.footer(service_item.foot_text) # if was hidden keep it hidden if self.hide_mode and self.is_live and not service_item.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.hide_mode) @@ -427,7 +427,7 @@ 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");') @@ -450,7 +450,7 @@ 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(): === modified file 'openlp/core/ui/mainwindow.py' --- openlp/core/ui/mainwindow.py 2013-03-19 17:53:51 +0000 +++ openlp/core/ui/mainwindow.py 2013-03-28 20:26:35 +0000 @@ -328,7 +328,7 @@ # Order things differently in OS X so that Preferences menu item in the # app menu is correct (this gets picked up automatically by Qt). if sys.platform == u'darwin': - add_actions(self.settings_menu, (self.settingsPluginListItem, self.settings_language_menu.menuAction(), + add_actions(self.settings_menu, (self.settingsPluginListItem, self.settings_language_menu.menuAction(), None, self.settings_configure_item, self.settings_shortcuts_item, self.formatting_tag_item)) else: add_actions(self.settings_menu, (self.settingsPluginListItem, self.settings_language_menu.menuAction(), @@ -342,7 +342,7 @@ self.about_item)) else: add_actions(self.help_menu, (self.on_line_help_item, None, self.web_site_item, self.about_item)) - add_actions(self.menuBar, (self.file_menu.menuAction(), self.view_menu.menuAction(), + add_actions(self.menuBar, (self.file_menu.menuAction(), self.view_menu.menuAction(), self.tools_menu.menuAction(), self.settings_menu.menuAction(), self.help_menu.menuAction())) # Initialise the translation self.retranslateUi(main_window) @@ -386,7 +386,7 @@ self.file_save_item.setStatusTip(translate('OpenLP.MainWindow', 'Save the current service to disk.')) self.file_save_as_item.setText(translate('OpenLP.MainWindow', 'Save &As...')) self.file_save_as_item.setToolTip(translate('OpenLP.MainWindow', 'Save Service As')) - self.file_save_as_item.setStatusTip(translate('OpenLP.MainWindow', + self.file_save_as_item.setStatusTip(translate('OpenLP.MainWindow', 'Save the current service under a new name.')) self.print_service_order_item.setText(UiStrings().PrintService) self.print_service_order_item.setStatusTip(translate('OpenLP.MainWindow', 'Print the current service.')) @@ -449,7 +449,7 @@ self.tools_first_time_wizard.setStatusTip(translate('OpenLP.MainWindow', 'Re-run the First Time Wizard, importing songs, Bibles and themes.')) self.update_theme_images.setText(translate('OpenLP.MainWindow', 'Update Theme Images')) - self.update_theme_images.setStatusTip(translate('OpenLP.MainWindow', + self.update_theme_images.setStatusTip(translate('OpenLP.MainWindow', 'Update the preview images for all themes.')) self.mode_default_Item.setText(translate('OpenLP.MainWindow', '&Default')) self.mode_default_Item.setStatusTip(translate('OpenLP.MainWindow', 'Set the view mode back to the default.')) @@ -476,7 +476,7 @@ self.arguments = self.application.args # Set up settings sections for the main application (not for use by plugins). self.ui_settings_section = u'user interface' - self.general_settings_section = u'general' + self.general_settings_section = u'core' self.advanced_settings_section = u'advanced' self.shortcuts_settings_section = u'shortcuts' self.service_manager_settings_section = u'servicemanager' @@ -491,7 +491,6 @@ self.new_data_path = None self.copy_data = False Settings().set_up_default_values() - Settings().remove_obsolete_settings() self.service_not_saved = False self.about_form = AboutForm(self) self.media_controller = MediaController() === modified file 'openlp/core/ui/media/mediacontroller.py' --- openlp/core/ui/media/mediacontroller.py 2013-03-23 07:07:06 +0000 +++ openlp/core/ui/media/mediacontroller.py 2013-03-28 20:26:35 +0000 @@ -415,7 +415,7 @@ elif not hidden or controller.media_info.is_background or service_item.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): === modified file 'openlp/core/utils/languagemanager.py' --- openlp/core/utils/languagemanager.py 2013-02-05 08:05:28 +0000 +++ openlp/core/utils/languagemanager.py 2013-03-28 20:26:35 +0000 @@ -98,7 +98,7 @@ """ 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 @@ 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, === modified file 'openlp/plugins/songs/lib/mediaitem.py' --- openlp/plugins/songs/lib/mediaitem.py 2013-03-23 06:46:41 +0000 +++ openlp/plugins/songs/lib/mediaitem.py 2013-03-28 20:26:35 +0000 @@ -467,9 +467,9 @@ 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) ] === modified file 'tests/functional/openlp_core_lib/test_settings.py' --- tests/functional/openlp_core_lib/test_settings.py 2013-02-21 07:33:21 +0000 +++ tests/functional/openlp_core_lib/test_settings.py 2013-03-28 20:26:35 +0000 @@ -35,16 +35,16 @@ # 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): """
_______________________________________________ Mailing list: https://launchpad.net/~openlp-core Post to : openlp-core@lists.launchpad.net Unsubscribe : https://launchpad.net/~openlp-core More help : https://help.launchpad.net/ListHelp