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


Python Settings.getOption方法代码示例

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


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

示例1: __init__

# 需要导入模块: from mcedit2.util.settings import Settings [as 别名]
# 或者: from mcedit2.util.settings.Settings import getOption [as 别名]
    def __init__(self, name, parent, shortcutName=None, *args, **kwargs):
        super(MCEAction, self).__init__(name, parent, *args, **kwargs)
        self.shortcutName = shortcutName
        if shortcutName:
            settings = Settings()
            settingsKey = "keybinding/" + shortcutName
            option = settings.getOption(settingsKey)

            _binding_names[shortcutName] = name

            shortcutString = option.value()
            if shortcutString is not None:
                self.setShortcut(QtGui.QKeySequence(shortcutString))

            option.valueChanged.connect(self.shortcutChanged)
开发者ID:101baja202,项目名称:mcedit2,代码行数:17,代码来源:mceaction.py

示例2: Settings

# 需要导入模块: from mcedit2.util.settings import Settings [as 别名]
# 或者: from mcedit2.util.settings.Settings import getOption [as 别名]
from mcedit2.widgets.layout import Column, Row, setWidgetError
from mcedit2.worldview.minimap import MinimapWorldView
from mceditlib.anvil.adapter import AnvilWorldAdapter
from mceditlib.geometry import Vector
from mceditlib.exceptions import LevelFormatError, PlayerNotFound
from mceditlib import worldeditor

import logging
from mceditlib.findadapter import isLevel
from mceditlib.worldeditor import WorldEditor

log = logging.getLogger(__name__)

WorldListSettings = Settings().getNamespace('world_list')
WorldListSettings.allSavesFolders = WorldListSettings.getOption('saves_folders', 'json', [])
WorldListSettings.currentSavesFolder = WorldListSettings.getOption('current_saves_folder', unicode, '')
WorldListSettings.lastChosenSavesFolder = WorldListSettings.getOption('last_chosen_saves_folder', unicode, '')

class WorldListItemWidget(QtGui.QWidget):
    doubleClicked = QtCore.Signal()

    def __init__(self, parent=None):
        QtGui.QWidget.__init__(self, parent)

        self.displayNameLabel = QtGui.QLabel("namenamename")
        self.lastPlayedLabel = QtGui.QLabel("lastplayed")
        self.versionInfoLabel = QtGui.QLabel("version")

        #self.sizeLabel = QtGui.QLabel(self.tr("Calculating area..."))
        # areaText = self.tr("%.02f million square meters") % (world.chunkCount * 0.25)
开发者ID:KevinKelley,项目名称:mcedit2,代码行数:32,代码来源:worldlist.py

示例3: Settings

# 需要导入模块: from mcedit2.util.settings import Settings [as 别名]
# 或者: from mcedit2.util.settings.Settings import getOption [as 别名]
from mcedit2.worldview.overhead import OverheadWorldViewFrame
from mceditlib import util, nbt, faces
from mceditlib.anvil.biome_types import BiomeTypes
from mceditlib.geometry import Vector
from mceditlib.operations import ComposeOperations
from mceditlib.operations.entity import RemoveEntitiesOperation
from mceditlib.selection import BoundingBox
from mceditlib.exceptions import PlayerNotFound, ChunkNotPresent
from mceditlib.revisionhistory import UndoFolderExists, RevisionChanges
from mceditlib.worldeditor import WorldEditor
from mceditlib.blocktypes import BlockType

log = logging.getLogger(__name__)

sessionSettings = Settings().getNamespace("editorsession")
currentViewSetting = sessionSettings.getOption("currentview", unicode, "cam")

# An EditorSession is a world currently opened for editing, the state of the editor including the
# current selection box, the editor tab containing its viewports, its command history, its shared OpenGL context,
# a separate instance of each editor tool (why?), and the ChunkLoader that coordinates loading
# chunks into its viewports.

class PendingImport(object):
    def __init__(self, schematic, pos, text):
        self.text = text
        self.pos = pos
        self.schematic = schematic

    def __repr__(self):
        return "%s(%r, %r)" % (self.__class__.__name__, self.schematic, self.pos)
开发者ID:EvilSupahFly,项目名称:mcedit2,代码行数:32,代码来源:editorsession.py

示例4: Settings

# 需要导入模块: from mcedit2.util.settings import Settings [as 别名]
# 或者: from mcedit2.util.settings.Settings import getOption [as 别名]
from mcedit2.sentry import get_sentry_client
from mcedit2.ui.dialogs.error_dialog import Ui_errorDialog
from mcedit2.util import qglcontext
from mcedit2.util.resources import isSrcCheckout
from mcedit2.util.screen import centerWidgetInScreen
from mcedit2.util.settings import Settings
from mcedit2.util.showprogress import MCEProgressDialog

log = logging.getLogger(__name__)

_errorShown = False

settings = Settings()

ReportErrorSetting = settings.getOption("errors/reporting_enabled", bool, True)


def showErrorDialog(text, tb=None, fatal=True, report=True):
    global _errorShown
    if tb is None:
        tb = sys.exc_info()
    _errorShown = True
    grabber = QtGui.QWidget.mouseGrabber()
    if grabber:
        grabber.releaseMouse()
        
    dialog = ErrorDialog(text, tb, fatal, report)
    dialog.exec_()
    _errorShown = False
开发者ID:mcedit,项目名称:mcedit2,代码行数:31,代码来源:error_dialog.py

示例5: Settings

# 需要导入模块: from mcedit2.util.settings import Settings [as 别名]
# 或者: from mcedit2.util.settings.Settings import getOption [as 别名]
from mcedit2.util import profiler
from mcedit2.util.settings import Settings
from mcedit2.widgets.layout import Column, Row
from mcedit2.widgets.spinslider import SpinSlider
from mceditlib import faces
from mceditlib.geometry import Vector
from mceditlib.util.lazyprop import lazyprop
from mcedit2.worldview.viewcontrols import ViewControls
from mcedit2.worldview.worldview import WorldView, iterateChunks, anglesToVector
from mcedit2.worldview.viewaction import ViewAction


log = logging.getLogger(__name__)

settings = Settings().getNamespace("worldview/camera")
ViewDistanceSetting = settings.getOption("view_distance", int, 12)
PerspectiveSetting = settings.getOption("perspective", bool, True)

class CameraWorldViewFrame(QtGui.QWidget):
    def __init__(self, dimension, textureAtlas, geometryCache, shareGLWidget, *args, **kwargs):
        super(CameraWorldViewFrame, self).__init__(*args, **kwargs)

        self.worldView = view = CameraWorldView(dimension, textureAtlas, geometryCache, shareGLWidget)

        self.viewControls = ViewControls(view)

        ViewDistanceSetting.connectAndCall(view.setViewDistance)

        viewDistanceInput = QtGui.QSpinBox(minimum=2, maximum=64, singleStep=2)
        viewDistanceInput.setValue(self.worldView.viewDistance)
        viewDistanceInput.valueChanged.connect(ViewDistanceSetting.setValue)
开发者ID:pamunoz,项目名称:mcedit2,代码行数:33,代码来源:camera.py

示例6: Settings

# 需要导入模块: from mcedit2.util.settings import Settings [as 别名]
# 或者: from mcedit2.util.settings.Settings import getOption [as 别名]
from mcedit2 import editortools
from mcedit2.editortools import generate
from mcedit2.util import load_ui
from mcedit2.util.settings import Settings
from mcedit2.widgets import inspector
from mceditlib.anvil import entities

log = logging.getLogger(__name__)

import sys

sys.dont_write_bytecode = True

settings = Settings().getNamespace("plugins")

enabledPluginsSetting = settings.getOption("enabled_plugins", "json", {})
autoReloadSetting = settings.getOption("auto_reload", bool, True)

# *** plugins dialog will need to:
# v get a list of (plugin display name, plugin reference, isEnabled) tuples for loaded and
#       unloaded plugins.
# v enable or disable a plugin using its reference
# - reload a plugin
# - find out if a plugin was removed from the folder or failed to compile or run
# - install a new plugin using a file chooser
# - open the plugins folder(s) in Finder/Explorer

# *** on startup:
# v scan all plugins dirs for plugins
# - check if a plugin is enabled (without executing it?)
# - load plugins set to "enabled" in settings
开发者ID:pamunoz,项目名称:mcedit2,代码行数:33,代码来源:plugins.py

示例7: Settings

# 需要导入模块: from mcedit2.util.settings import Settings [as 别名]
# 或者: from mcedit2.util.settings.Settings import getOption [as 别名]
from mcedit2.rendering.selection import SelectionScene, SelectionFaceNode
from mcedit2.ui.selection_coord_widget import Ui_selectionCoordWidget
from mcedit2.util.glutils import gl
from mcedit2.rendering.depths import DepthOffsets
from mcedit2.rendering.scenegraph import scenenode, rendernode
from mcedit2.util.settings import Settings
from mcedit2.widgets.layout import Column
from mcedit2.widgets.shapewidget import ShapeWidget
from mceditlib import faces
from mceditlib.geometry import Vector
from mceditlib.selection import BoundingBox

log = logging.getLogger(__name__)

SelectionOptions = Settings().getNamespace("select_tool")
ClassicSelectionOption = SelectionOptions.getOption("classic_selection", bool, False)
StickySelectionOption = SelectionOptions.getOption("sticky_selection", bool, False)


class SelectionCoordinateWidget(QtGui.QWidget, Ui_selectionCoordWidget):
    def __init__(self, *args, **kwargs):
        super(SelectionCoordinateWidget, self).__init__(*args, **kwargs)
        self.setupUi(self)

        self.xMinInput.valueChanged.connect(self.setMinX)
        self.yMinInput.valueChanged.connect(self.setMinY)
        self.zMinInput.valueChanged.connect(self.setMinZ)
        self.xMaxInput.valueChanged.connect(self.setMaxX)
        self.yMaxInput.valueChanged.connect(self.setMaxY)
        self.zMaxInput.valueChanged.connect(self.setMaxZ)
开发者ID:qtx0213,项目名称:mcedit2,代码行数:32,代码来源:select.py

示例8: Settings

# 需要导入模块: from mcedit2.util.settings import Settings [as 别名]
# 或者: from mcedit2.util.settings.Settings import getOption [as 别名]
from mcedit2.util import profiler
from mcedit2.util.settings import Settings
from mcedit2.widgets.layout import Column, Row
from mcedit2.widgets.spinslider import SpinSlider
from mceditlib import faces
from mceditlib.geometry import Vector
from mceditlib.util.lazyprop import lazyprop
from mcedit2.worldview.viewcontrols import ViewControls
from mcedit2.worldview.worldview import WorldView, iterateChunks, anglesToVector
from mcedit2.worldview.viewaction import ViewAction


log = logging.getLogger(__name__)

settings = Settings().getNamespace("worldview/camera")
ViewDistanceSetting = settings.getOption("view_distance", int, 12)
PerspectiveSetting = settings.getOption("perspective", bool, True)
StickyMouselookSetting = settings.getOption("sticky_mouselook", bool, True)


class CameraWorldViewFrame(QtGui.QWidget):
    def __init__(self, dimension, textureAtlas, geometryCache, shareGLWidget, *args, **kwargs):
        super(CameraWorldViewFrame, self).__init__(*args, **kwargs)

        self.worldView = view = CameraWorldView(dimension, textureAtlas, geometryCache, shareGLWidget)

        auxControlWidget = QtGui.QWidget()
        
        StickyMouselookSetting.connectAndCall(view.setStickyMouselook)
        
        stickyCheckbox = QtGui.QCheckBox(self.tr("Sticky Mouselook"))
开发者ID:KevinKelley,项目名称:mcedit2,代码行数:33,代码来源:camera.py

示例9: Settings

# 需要导入模块: from mcedit2.util.settings import Settings [as 别名]
# 或者: from mcedit2.util.settings.Settings import getOption [as 别名]
from PySide import QtGui, QtCore

from mcedit2.rendering.layers import Layer
from mcedit2.util import profiler
from mcedit2.util.settings import Settings
from mcedit2.widgets.layout import Column, Row
from mcedit2.util.lazyprop import lazyprop
from mcedit2.worldview.viewcontrols import ViewControls
from mcedit2.worldview.worldview import WorldView, iterateChunks, LayerToggleGroup
from mcedit2.worldview.viewaction import ViewAction


log = logging.getLogger(__name__)

settings = Settings()
ViewDistanceSetting = settings.getOption("worldview/camera/view_distance", int, 32)
PerspectiveSetting = settings.getOption("worldview/camera/perspective", bool, True)

class CameraWorldViewFrame(QtGui.QWidget):
    def __init__(self, dimension, geometryCache, resourceLoader, shareGLWidget, *args, **kwargs):
        super(CameraWorldViewFrame, self).__init__(*args, **kwargs)

        self.worldView = view = CameraWorldView(dimension, geometryCache, resourceLoader, shareGLWidget)

        self.viewControls = ViewControls(view)

        ViewDistanceSetting.connectAndCall(view.setViewDistance)

        viewDistanceInput = QtGui.QSpinBox(minimum=2, maximum=64, singleStep=2)
        viewDistanceInput.setValue(self.worldView.viewDistance)
        viewDistanceInput.valueChanged.connect(ViewDistanceSetting.setValue)
开发者ID:skinny121,项目名称:mcedit2,代码行数:33,代码来源:camera.py


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