本文整理汇总了Python中openlp.core.lib.Settings.remove方法的典型用法代码示例。如果您正苦于以下问题:Python Settings.remove方法的具体用法?Python Settings.remove怎么用?Python Settings.remove使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类openlp.core.lib.Settings
的用法示例。
在下文中一共展示了Settings.remove方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: save
# 需要导入模块: from openlp.core.lib import Settings [as 别名]
# 或者: from openlp.core.lib.Settings import remove [as 别名]
def save(self):
"""
Save settings to disk.
"""
settings = Settings()
settings.beginGroup(self.settings_section)
settings.setValue('default service enabled', self.service_name_check_box.isChecked())
service_name = self.service_name_edit.text()
preset_is_valid = self.generate_service_name_example()[0]
if service_name == UiStrings().DefaultServiceName or not preset_is_valid:
settings.remove('default service name')
self.service_name_edit.setText(service_name)
else:
settings.setValue('default service name', service_name)
settings.setValue('default service day', self.service_name_day.currentIndex())
settings.setValue('default service hour', self.service_name_time.time().hour())
settings.setValue('default service minute', self.service_name_time.time().minute())
settings.setValue('recent file count', self.recent_spin_box.value())
settings.setValue('save current plugin', self.media_plugin_check_box.isChecked())
settings.setValue('double click live', self.double_click_live_check_box.isChecked())
settings.setValue('single click preview', self.single_click_preview_check_box.isChecked())
settings.setValue('expand service item', self.expand_service_item_check_box.isChecked())
settings.setValue('enable exit confirmation', self.enable_auto_close_check_box.isChecked())
settings.setValue('hide mouse', self.hide_mouse_check_box.isChecked())
settings.setValue('alternate rows', self.alternate_rows_check_box.isChecked())
settings.setValue('default color', self.default_color)
settings.setValue('default image', self.default_file_edit.text())
settings.setValue('slide limits', self.slide_limits)
if self.x11_bypass_check_box.isChecked() != settings.value('x11 bypass wm'):
settings.setValue('x11 bypass wm', self.x11_bypass_check_box.isChecked())
self.settings_form.register_post_process('config_screen_changed')
self.settings_form.register_post_process('slidecontroller_update_slide_limits')
settings.endGroup()
示例2: save
# 需要导入模块: from openlp.core.lib import Settings [as 别名]
# 或者: from openlp.core.lib.Settings import remove [as 别名]
def save(self):
settings = Settings()
settings.beginGroup(self.settings_section)
settings.setValue('display new chapter', self.show_new_chapters)
settings.setValue('display brackets', self.display_style)
settings.setValue('verse layout style', self.layout_style)
settings.setValue('second bibles', self.second_bibles)
settings.setValue('bible theme', self.bible_theme)
if self.verse_separator_check_box.isChecked():
settings.setValue('verse separator', self.verse_separator_line_edit.text())
else:
settings.remove('verse separator')
if self.range_separator_check_box.isChecked():
settings.setValue('range separator', self.range_separator_line_edit.text())
else:
settings.remove('range separator')
if self.list_separator_check_box.isChecked():
settings.setValue('list separator', self.list_separator_line_edit.text())
else:
settings.remove('list separator')
if self.end_separator_check_box.isChecked():
settings.setValue('end separator', self.end_separator_line_edit.text())
else:
settings.remove('end separator')
update_reference_separators()
if self.language_selection != settings.value('book name language'):
settings.setValue('book name language', self.language_selection)
self.settings_form.register_post_process('bibles_load_list')
settings.endGroup()
if self.tab_visited:
self.settings_form.register_post_process('bibles_config_updated')
self.tab_visited = False
示例3: save
# 需要导入模块: from openlp.core.lib import Settings [as 别名]
# 或者: from openlp.core.lib.Settings import remove [as 别名]
def save(self):
settings = Settings()
settings.beginGroup(self.settingsSection)
settings.setValue(u'display new chapter', self.show_new_chapters)
settings.setValue(u'display brackets', self.display_style)
settings.setValue(u'verse layout style', self.layout_style)
settings.setValue(u'book name language', self.language_selection)
settings.setValue(u'second bibles', self.second_bibles)
settings.setValue(u'bible theme', self.bible_theme)
if self.verseSeparatorCheckBox.isChecked():
settings.setValue(u'verse separator', self.verseSeparatorLineEdit.text())
else:
settings.remove(u'verse separator')
if self.rangeSeparatorCheckBox.isChecked():
settings.setValue(u'range separator', self.rangeSeparatorLineEdit.text())
else:
settings.remove(u'range separator')
if self.listSeparatorCheckBox.isChecked():
settings.setValue(u'list separator', self.listSeparatorLineEdit.text())
else:
settings.remove(u'list separator')
if self.endSeparatorCheckBox.isChecked():
settings.setValue(u'end separator', self.endSeparatorLineEdit.text())
else:
settings.remove(u'end separator')
update_reference_separators()
Receiver.send_message(u'bibles_load_list')
settings.endGroup()
示例4: app_startup
# 需要导入模块: from openlp.core.lib import Settings [as 别名]
# 或者: from openlp.core.lib.Settings import remove [as 别名]
def app_startup(self):
"""
Do a couple of things when the app starts up. In this particular case
we want to check if we have the old "Use Phonon" setting, and convert
it to "enable Phonon" and "make it the first one in the list".
"""
Plugin.app_startup(self)
settings = Settings()
settings.beginGroup(self.settingsSection)
if settings.contains(u'use phonon'):
log.info(u'Found old Phonon setting')
players = self.media_controller.mediaPlayers.keys()
has_phonon = u'phonon' in players
if settings.value(u'use phonon') and has_phonon:
log.debug(u'Converting old setting to new setting')
new_players = []
if players:
new_players = [player for player in players if player != u'phonon']
new_players.insert(0, u'phonon')
self.media_controller.mediaPlayers[u'phonon'].isActive = True
settings.setValue(u'players', u','.join(new_players))
self.settingsTab.load()
settings.remove(u'use phonon')
settings.endGroup()
示例5: load
# 需要导入模块: from openlp.core.lib import Settings [as 别名]
# 或者: from openlp.core.lib.Settings import remove [as 别名]
def load(self):
"""
Load settings from disk.
"""
settings = Settings()
settings.beginGroup(self.settings_section)
# The max recent files value does not have an interface and so never
# gets actually stored in the settings therefore the default value of
# 20 will always be used.
self.recent_spin_box.setMaximum(settings.value('max recent files'))
self.recent_spin_box.setValue(settings.value('recent file count'))
self.media_plugin_check_box.setChecked(settings.value('save current plugin'))
self.double_click_live_check_box.setChecked(settings.value('double click live'))
self.single_click_preview_check_box.setChecked(settings.value('single click preview'))
self.expand_service_item_check_box.setChecked(settings.value('expand service item'))
self.enable_auto_close_check_box.setChecked(settings.value('enable exit confirmation'))
self.hide_mouse_check_box.setChecked(settings.value('hide mouse'))
self.service_name_day.setCurrentIndex(settings.value('default service day'))
self.service_name_time.setTime(QtCore.QTime(settings.value('default service hour'),
settings.value('default service minute')))
self.should_update_service_name_example = True
self.service_name_edit.setText(settings.value('default service name'))
default_service_enabled = settings.value('default service enabled')
self.service_name_check_box.setChecked(default_service_enabled)
self.service_name_check_box_toggled(default_service_enabled)
self.x11_bypass_check_box.setChecked(settings.value('x11 bypass wm'))
self.default_color = settings.value('default color')
self.default_file_edit.setText(settings.value('default image'))
self.slide_limits = settings.value('slide limits')
# Prevent the dialog displayed by the alternate_rows_check_box to display.
self.alternate_rows_check_box.blockSignals(True)
self.alternate_rows_check_box.setChecked(settings.value('alternate rows'))
self.alternate_rows_check_box.blockSignals(False)
if self.slide_limits == SlideLimits.End:
self.end_slide_radio_button.setChecked(True)
elif self.slide_limits == SlideLimits.Wrap:
self.wrap_slide_radio_button.setChecked(True)
else:
self.next_item_radio_button.setChecked(True)
settings.endGroup()
self.data_directory_copy_check_box.hide()
self.new_data_directory_has_files_label.hide()
self.data_directory_cancel_button.hide()
# Since data location can be changed, make sure the path is present.
self.current_data_path = AppLocation.get_data_path()
if not os.path.exists(self.current_data_path):
log.error('Data path not found %s' % self.current_data_path)
answer = QtGui.QMessageBox.critical(self,
translate('OpenLP.AdvancedTab', 'Data Directory Error'),
translate('OpenLP.AdvancedTab', 'OpenLP data directory was not found\n\n%s\n\n'
'This data directory was previously changed from the OpenLP '
'default location. If the new location was on removable '
'media, that media needs to be made available.\n\n'
'Click "No" to stop loading OpenLP. allowing you to fix the the problem.\n\n'
'Click "Yes" to reset the data directory to the default '
'location.').replace('%s', self.current_data_path),
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Yes | QtGui.QMessageBox.No),
QtGui.QMessageBox.No)
if answer == QtGui.QMessageBox.No:
log.info('User requested termination')
self.main_window.clean_up()
sys.exit()
# Set data location to default.
settings.remove('advanced/data path')
self.current_data_path = AppLocation.get_data_path()
log.warning('User requested data path set to default %s' % self.current_data_path)
self.data_directory_label.setText(os.path.abspath(self.current_data_path))
self.default_color_button.setStyleSheet('background-color: %s' % self.default_color)
# Don't allow data directory move if running portable.
if settings.value('advanced/is portable'):
self.data_directory_group_box.hide()