本文整理匯總了Python中openlp.core.lib.Settings.beginGroup方法的典型用法代碼示例。如果您正苦於以下問題:Python Settings.beginGroup方法的具體用法?Python Settings.beginGroup怎麽用?Python Settings.beginGroup使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類openlp.core.lib.Settings
的用法示例。
在下文中一共展示了Settings.beginGroup方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: load
# 需要導入模塊: from openlp.core.lib import Settings [as 別名]
# 或者: from openlp.core.lib.Settings import beginGroup [as 別名]
def load(self):
settings = Settings()
settings.beginGroup(self.settingsSection)
self.bg_color = settings.value(u'background color')
self.initial_color = self.bg_color
settings.endGroup()
self.backgroundColorButton.setStyleSheet(u'background-color: %s' % self.bg_color)
示例2: save
# 需要導入模塊: from openlp.core.lib import Settings [as 別名]
# 或者: from openlp.core.lib.Settings import beginGroup [as 別名]
def save(self):
settings = Settings()
settings.beginGroup(self.settingsSection)
settings.setValue(u'background color', self.bg_color)
settings.endGroup()
if self.initial_color != self.bg_color:
Receiver.send_message(u'image_updated')
示例3: setDefaults
# 需要導入模塊: from openlp.core.lib import Settings [as 別名]
# 或者: from openlp.core.lib.Settings import beginGroup [as 別名]
def setDefaults(self):
"""
Set default values for the wizard pages.
"""
settings = Settings()
settings.beginGroup(self.plugin.settingsSection)
self.restart()
self.finishButton.setVisible(False)
self.cancelButton.setVisible(True)
self.setField(u'source_format', 0)
self.setField(u'osis_location', '')
self.setField(u'csv_booksfile', '')
self.setField(u'csv_versefile', '')
self.setField(u'opensong_file', '')
self.setField(u'web_location', WebDownload.Crosswalk)
self.setField(u'web_biblename', self.webTranslationComboBox.currentIndex())
self.setField(u'proxy_server', settings.value(u'proxy address'))
self.setField(u'proxy_username', settings.value(u'proxy username'))
self.setField(u'proxy_password', settings.value(u'proxy password'))
self.setField(u'openlp1_location', '')
self.setField(u'license_version', self.versionNameEdit.text())
self.setField(u'license_copyright', self.copyrightEdit.text())
self.setField(u'license_permissions', self.permissionsEdit.text())
self.onWebSourceComboBoxIndexChanged(WebDownload.Crosswalk)
settings.endGroup()
示例4: save
# 需要導入模塊: from openlp.core.lib import Settings [as 別名]
# 或者: from openlp.core.lib.Settings import beginGroup [as 別名]
def save(self):
"""
Save the settings from the form
"""
settings = Settings()
settings.beginGroup(self.settings_section)
settings.setValue('monitor', self.monitor_combo_box.currentIndex())
settings.setValue('display on monitor', self.display_on_monitor_check.isChecked())
settings.setValue('blank warning', self.warning_check_box.isChecked())
settings.setValue('auto open', self.auto_open_check_box.isChecked())
settings.setValue('show splash', self.show_splash_check_box.isChecked())
settings.setValue('update check', self.check_for_updates_check_box.isChecked())
settings.setValue('save prompt', self.save_check_service_check_box.isChecked())
settings.setValue('auto unblank', self.auto_unblank_check_box.isChecked())
settings.setValue('auto preview', self.auto_preview_check_box.isChecked())
settings.setValue('loop delay', self.timeout_spin_box.value())
settings.setValue('ccli number', self.number_edit.displayText())
settings.setValue('songselect username', self.username_edit.displayText())
settings.setValue('songselect password', self.password_edit.displayText())
settings.setValue('x position', self.custom_X_value_edit.value())
settings.setValue('y position', self.custom_Y_value_edit.value())
settings.setValue('height', self.custom_height_value_edit.value())
settings.setValue('width', self.custom_width_value_edit.value())
settings.setValue('override position', self.override_radio_button.isChecked())
settings.setValue('audio start paused', self.start_paused_check_box.isChecked())
settings.setValue('audio repeat list', self.repeat_list_check_box.isChecked())
settings.endGroup()
# On save update the screens as well
self.post_set_up(True)
示例5: save
# 需要導入模塊: from openlp.core.lib import Settings [as 別名]
# 或者: from openlp.core.lib.Settings import beginGroup [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()
示例6: save
# 需要導入模塊: from openlp.core.lib import Settings [as 別名]
# 或者: from openlp.core.lib.Settings import beginGroup [as 別名]
def save(self):
"""
Save the settings from the form
"""
settings = Settings()
settings.beginGroup(self.settingsSection)
settings.setValue(u'monitor', self.monitorComboBox.currentIndex())
settings.setValue(u'display on monitor', self.displayOnMonitorCheck.isChecked())
settings.setValue(u'blank warning', self.warningCheckBox.isChecked())
settings.setValue(u'auto open', self.autoOpenCheckBox.isChecked())
settings.setValue(u'show splash', self.showSplashCheckBox.isChecked())
settings.setValue(u'update check', self.checkForUpdatesCheckBox.isChecked())
settings.setValue(u'save prompt', self.saveCheckServiceCheckBox.isChecked())
settings.setValue(u'auto unblank', self.autoUnblankCheckBox.isChecked())
settings.setValue(u'auto preview', self.autoPreviewCheckBox.isChecked())
settings.setValue(u'loop delay', self.timeoutSpinBox.value())
settings.setValue(u'ccli number', self.numberEdit.displayText())
settings.setValue(u'songselect username', self.usernameEdit.displayText())
settings.setValue(u'songselect password', self.passwordEdit.displayText())
settings.setValue(u'x position', self.customXValueEdit.value())
settings.setValue(u'y position', self.customYValueEdit.value())
settings.setValue(u'height', self.customHeightValueEdit.value())
settings.setValue(u'width', self.customWidthValueEdit.value())
settings.setValue(u'override position', self.overrideRadioButton.isChecked())
settings.setValue(u'audio start paused', self.startPausedCheckBox.isChecked())
settings.setValue(u'audio repeat list', self.repeatListCheckBox.isChecked())
settings.endGroup()
# On save update the screens as well
self.postSetUp(True)
示例7: save
# 需要導入模塊: from openlp.core.lib import Settings [as 別名]
# 或者: from openlp.core.lib.Settings import beginGroup [as 別名]
def save(self):
settings = Settings()
settings.beginGroup(self.settings_section)
settings.setValue('background color', self.background_color)
settings.endGroup()
if self.initial_color != self.background_color:
self.settings_form.register_post_process('images_config_updated')
示例8: save
# 需要導入模塊: from openlp.core.lib import Settings [as 別名]
# 或者: from openlp.core.lib.Settings import beginGroup [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
示例9: save
# 需要導入模塊: from openlp.core.lib import Settings [as 別名]
# 或者: from openlp.core.lib.Settings import beginGroup [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()
示例10: load_screen_settings
# 需要導入模塊: from openlp.core.lib import Settings [as 別名]
# 或者: from openlp.core.lib.Settings import beginGroup [as 別名]
def load_screen_settings(self):
"""
Loads the screen size and the monitor number from the settings.
"""
from openlp.core.lib import Settings
# Add the screen settings to the settings dict. This has to be done here due to crycle 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()
}
Settings.extend_default_settings(screen_settings)
settings = Settings()
settings.beginGroup(u'general')
monitor = settings.value(u'monitor')
self.set_current_display(monitor)
self.display = settings.value(u'display on monitor')
override_display = settings.value(u'override position')
x = settings.value(u'x position')
y = settings.value(u'y position')
width = settings.value(u'width')
height = settings.value(u'height')
self.override[u'size'] = QtCore.QRect(x, y, width, height)
self.override[u'primary'] = False
settings.endGroup()
if override_display:
self.set_override_display()
else:
self.reset_current_display()
示例11: load
# 需要導入模塊: from openlp.core.lib import Settings [as 別名]
# 或者: from openlp.core.lib.Settings import beginGroup [as 別名]
def load(self):
settings = Settings()
settings.beginGroup(self.settingsSection)
self.displayFooter = settings.value(u'display footer')
self.update_load = settings.value(u'add custom from service')
self.displayFooterCheckBox.setChecked(self.displayFooter)
self.add_from_service_checkbox.setChecked(self.update_load)
settings.endGroup()
示例12: save
# 需要導入模塊: from openlp.core.lib import Settings [as 別名]
# 或者: from openlp.core.lib.Settings import beginGroup [as 別名]
def save(self):
settings = Settings()
settings.beginGroup(self.settingsSection)
settings.setValue(u'search as type', self.song_search)
settings.setValue(u'display songbar', self.tool_bar)
settings.setValue(u'update service on edit', self.update_edit)
settings.setValue(u'add song from service', self.update_load)
settings.endGroup()
示例13: __init__
# 需要導入模塊: from openlp.core.lib import Settings [as 別名]
# 或者: from openlp.core.lib.Settings import beginGroup [as 別名]
def __init__(self, plugin_name, init_schema, db_file_name=None, upgrade_mod=None):
"""
Runs the initialisation process that includes creating the connection to the database and the tables if they do
not exist.
``plugin_name``
The name to setup paths and settings section names
``init_schema``
The init_schema function for this database
``upgrade_schema``
The upgrade_schema function for this database
``db_file_name``
The file name to use for this database. Defaults to None resulting in the plugin_name being used.
"""
settings = Settings()
settings.beginGroup(plugin_name)
self.db_url = ''
self.is_dirty = False
self.session = None
db_type = settings.value('db type')
if db_type == 'sqlite':
if db_file_name:
self.db_url = 'sqlite:///%s/%s' % (AppLocation.get_section_data_path(plugin_name), db_file_name)
else:
self.db_url = 'sqlite:///%s/%s.sqlite' % (AppLocation.get_section_data_path(plugin_name), plugin_name)
else:
self.db_url = '%s://%s:%[email protected]%s/%s' % (db_type,
urlquote(settings.value('db username')),
urlquote(settings.value('db password')),
urlquote(settings.value('db hostname')),
urlquote(settings.value('db database')))
if db_type == 'mysql':
db_encoding = settings.value('db encoding')
self.db_url += '?charset=%s' % urlquote(db_encoding)
settings.endGroup()
if upgrade_mod:
db_ver, up_ver = upgrade_db(self.db_url, upgrade_mod)
if db_ver > up_ver:
critical_error_message_box(
translate('OpenLP.Manager', 'Database Error'),
translate('OpenLP.Manager', 'The database being loaded was created in a more recent version of '
'OpenLP. The database is version %d, while OpenLP expects version %d. The database will not '
'be loaded.\n\nDatabase: %s') % (db_ver, up_ver, self.db_url)
)
return
try:
self.session = init_schema(self.db_url)
except (SQLAlchemyError, DBAPIError):
log.exception('Error loading database: %s', self.db_url)
critical_error_message_box(
translate('OpenLP.Manager', 'Database Error'),
translate('OpenLP.Manager', 'OpenLP cannot load your database.\n\nDatabase: %s') % self.db_url
)
示例14: save
# 需要導入模塊: from openlp.core.lib import Settings [as 別名]
# 或者: from openlp.core.lib.Settings import beginGroup [as 別名]
def save(self):
settings = Settings()
settings.beginGroup(self.settings_section)
settings.setValue('search as type', self.song_search)
settings.setValue('display songbar', self.tool_bar)
settings.setValue('update service on edit', self.update_edit)
settings.setValue('add song from service', self.update_load)
settings.endGroup()
if self.tab_visited:
self.settings_form.register_post_process('songs_config_updated')
self.tab_visited = False
示例15: save
# 需要導入模塊: from openlp.core.lib import Settings [as 別名]
# 或者: from openlp.core.lib.Settings import beginGroup [as 別名]
def save(self):
"""
Save the settings
"""
settings = Settings()
settings.beginGroup(self.settingsSection)
settings.setValue(u'theme level', self.theme_level)
settings.setValue(u'global theme', self.global_theme)
settings.endGroup()
self.renderer.set_global_theme(self.global_theme)
self.renderer.set_theme_level(self.theme_level)
Receiver.send_message(u'theme_update_global', self.global_theme)