当前位置: 首页>>代码示例>>Python>>正文


Python Settings.setValue方法代码示例

本文整理汇总了Python中openlp.core.lib.Settings.setValue方法的典型用法代码示例。如果您正苦于以下问题:Python Settings.setValue方法的具体用法?Python Settings.setValue怎么用?Python Settings.setValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在openlp.core.lib.Settings的用法示例。


在下文中一共展示了Settings.setValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: save

# 需要导入模块: from openlp.core.lib import Settings [as 别名]
# 或者: from openlp.core.lib.Settings import setValue [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')
开发者ID:marmyshev,项目名称:transitions,代码行数:9,代码来源:imagetab.py

示例2: save

# 需要导入模块: from openlp.core.lib import Settings [as 别名]
# 或者: from openlp.core.lib.Settings import setValue [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')
开发者ID:marmyshev,项目名称:bug_1117098,代码行数:9,代码来源:imagetab.py

示例3: save

# 需要导入模块: from openlp.core.lib import Settings [as 别名]
# 或者: from openlp.core.lib.Settings import setValue [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)
开发者ID:marmyshev,项目名称:transitions,代码行数:14,代码来源:themestab.py

示例4: save

# 需要导入模块: from openlp.core.lib import Settings [as 别名]
# 或者: from openlp.core.lib.Settings import setValue [as 别名]
 def save(self):
     """
     Save the settings
     """
     settings = Settings()
     settings.beginGroup(self.settings_section)
     settings.setValue('theme level', self.theme_level)
     settings.setValue('global theme', self.global_theme)
     settings.endGroup()
     self.renderer.set_theme_level(self.theme_level)
     if self.tab_visited:
         self.settings_form.register_post_process('theme_update_global')
     self.tab_visited = False
开发者ID:marmyshev,项目名称:bug_1117098,代码行数:15,代码来源:themestab.py

示例5: save

# 需要导入模块: from openlp.core.lib import Settings [as 别名]
# 或者: from openlp.core.lib.Settings import setValue [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()
开发者ID:marmyshev,项目名称:transitions,代码行数:10,代码来源:songstab.py

示例6: save

# 需要导入模块: from openlp.core.lib import Settings [as 别名]
# 或者: from openlp.core.lib.Settings import setValue [as 别名]
 def save(self):
     """
     Save the settings
     """
     settings = Settings()
     settings.beginGroup(self.settings_section)
     settings.setValue('background color', self.background_color)
     settings.endGroup()
     old_players, override_player = get_media_players()
     if self.used_players != old_players:
         # clean old Media stuff
         set_media_players(self.used_players, override_player)
         self.settings_form.register_post_process('mediaitem_suffix_reset')
         self.settings_form.register_post_process('mediaitem_media_rebuild')
         self.settings_form.register_post_process('config_screen_changed')
开发者ID:marmyshev,项目名称:bug_1117098,代码行数:17,代码来源:playertab.py

示例7: save

# 需要导入模块: from openlp.core.lib import Settings [as 别名]
# 或者: from openlp.core.lib.Settings import setValue [as 别名]
 def save(self):
     """
     Save the settings
     """
     player_string_changed = False
     settings = Settings()
     settings.beginGroup(self.settingsSection)
     settings.setValue(u'background color', self.bg_color)
     settings.endGroup()
     old_players, override_player = get_media_players()
     if self.usedPlayers != old_players:
         # clean old Media stuff
         set_media_players(self.usedPlayers, override_player)
         player_string_changed = True
     if player_string_changed:
         self.service_manager.reset_supported_suffixes()
         Receiver.send_message(u'mediaitem_media_rebuild')
         Receiver.send_message(u'config_screen_changed')
开发者ID:marmyshev,项目名称:transitions,代码行数:20,代码来源:playertab.py

示例8: save

# 需要导入模块: from openlp.core.lib import Settings [as 别名]
# 或者: from openlp.core.lib.Settings import setValue [as 别名]
 def save(self):
     """
     Save the shortcuts. **Note**, that we do not have to load the shortcuts, as they are loaded in
     :class:`~openlp.core.utils.ActionList`.
     """
     settings = Settings()
     settings.beginGroup('shortcuts')
     for category in self.action_list.categories:
         # Check if the category is for internal use only.
         if category.name is None:
             continue
         for action in category.actions:
             if action in self.changedActions:
                 old_shortcuts = list(map(QtGui.QKeySequence.toString, action.shortcuts()))
                 action.setShortcuts(self.changedActions[action])
                 self.action_list.update_shortcut_map(action, old_shortcuts)
             settings.setValue(action.objectName(), action.shortcuts())
     settings.endGroup()
开发者ID:marmyshev,项目名称:bug_1117098,代码行数:20,代码来源:shortcutlistform.py

示例9: save

# 需要导入模块: from openlp.core.lib import Settings [as 别名]
# 或者: from openlp.core.lib.Settings import setValue [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
开发者ID:marmyshev,项目名称:bug_1117098,代码行数:13,代码来源:songstab.py

示例10: check_latest_version

# 需要导入模块: from openlp.core.lib import Settings [as 别名]
# 或者: from openlp.core.lib.Settings import setValue [as 别名]
def check_latest_version(current_version):
    """
    Check the latest version of OpenLP against the version file on the OpenLP
    site.

    ``current_version``
        The current version of OpenLP.

    **Rules around versions and version files:**

    * If a version number has a build (i.e. -bzr1234), then it is a nightly.
    * If a version number's minor version is an odd number, it is a development release.
    * If a version number's minor version is an even number, it is a stable release.
    """
    version_string = current_version['full']
    # set to prod in the distribution config file.
    settings = Settings()
    settings.beginGroup('core')
    last_test = settings.value('last version test')
    this_test = str(datetime.now().date())
    settings.setValue('last version test', this_test)
    settings.endGroup()
    # Tell the main window whether there will ever be data to display
    Registry().get('main_window').version_update_running = last_test != this_test
    if last_test != this_test:
        if current_version['build']:
            req = urllib.request.Request('http://www.openlp.org/files/nightly_version.txt')
        else:
            version_parts = current_version['version'].split('.')
            if int(version_parts[1]) % 2 != 0:
                req = urllib.request.Request('http://www.openlp.org/files/dev_version.txt')
            else:
                req = urllib.request.Request('http://www.openlp.org/files/version.txt')
        req.add_header('User-Agent', 'OpenLP/%s' % current_version['full'])
        remote_version = None
        try:
            remote_version = str(urllib.request.urlopen(req, None).read().decode()).strip()
        except IOError:
            log.exception('Failed to download the latest OpenLP version file')
        if remote_version:
            version_string = remote_version
    return version_string
开发者ID:marmyshev,项目名称:item_title,代码行数:44,代码来源:__init__.py

示例11: app_startup

# 需要导入模块: from openlp.core.lib import Settings [as 别名]
# 或者: from openlp.core.lib.Settings import setValue [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()
开发者ID:marmyshev,项目名称:transitions,代码行数:26,代码来源:mediaplugin.py

示例12: save

# 需要导入模块: from openlp.core.lib import Settings [as 别名]
# 或者: from openlp.core.lib.Settings import setValue [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
开发者ID:marmyshev,项目名称:bug_1117098,代码行数:34,代码来源:biblestab.py

示例13: save

# 需要导入模块: from openlp.core.lib import Settings [as 别名]
# 或者: from openlp.core.lib.Settings import setValue [as 别名]
 def save(self):
     settings = Settings()
     settings.beginGroup(self.settingsSection)
     settings.setValue(u'display footer', self.displayFooter)
     settings.setValue(u'add custom from service', self.update_load)
     settings.endGroup()
开发者ID:marmyshev,项目名称:transitions,代码行数:8,代码来源:customtab.py

示例14: save

# 需要导入模块: from openlp.core.lib import Settings [as 别名]
# 或者: from openlp.core.lib.Settings import setValue [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)
开发者ID:marmyshev,项目名称:bug_1117098,代码行数:31,代码来源:generaltab.py

示例15: save

# 需要导入模块: from openlp.core.lib import Settings [as 别名]
# 或者: from openlp.core.lib.Settings import setValue [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()
开发者ID:marmyshev,项目名称:bug_1117098,代码行数:35,代码来源:advancedtab.py


注:本文中的openlp.core.lib.Settings.setValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。