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


Python KeywordIO.default_keyword_db_path方法代码示例

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


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

示例1: OptionsDialog

# 需要导入模块: from safe_qgis.utilities.keyword_io import KeywordIO [as 别名]
# 或者: from safe_qgis.utilities.keyword_io.KeywordIO import default_keyword_db_path [as 别名]
class OptionsDialog(QtGui.QDialog, Ui_OptionsDialogBase):
    """Options dialog for the InaSAFE plugin."""

    def __init__(self, iface, dock=None, parent=None):
        """Constructor for the dialog.

        :param iface: A Quantum GIS QGisAppInterface instance.
        :type iface: QGisAppInterface

        :param parent: Parent widget of this dialog
        :type parent: QWidget

        :param dock: Optional dock widget instance that we can notify of
            changes to the keywords.
        :type dock: Dock
        """

        QtGui.QDialog.__init__(self, parent)
        self.setupUi(self)
        self.setWindowTitle(self.tr('InaSAFE %s Options' % get_version()))
        # Save reference to the QGIS interface and parent
        self.iface = iface
        self.parent = parent
        self.dock = dock
        self.keyword_io = KeywordIO()
        # Set up things for context help
        button = self.buttonBox.button(QtGui.QDialogButtonBox.Help)
        button.clicked.connect(self.show_help)
        self.grpNotImplemented.hide()
        self.adjustSize()
        self.restore_state()
        # hack prevent showing use thread visible and set it false see #557
        self.cbxUseThread.setChecked(True)
        self.cbxUseThread.setVisible(False)

    def restore_state(self):
        """Reinstate the options based on the user's stored session info.
        """
        settings = QtCore.QSettings()
        # flag = settings.value(
        #     'inasafe/useThreadingFlag', False)
        # hack set use thread to false see #557
        flag = False
        self.cbxUseThread.setChecked(flag)

        flag = bool(settings.value(
            'inasafe/visibleLayersOnlyFlag', True, type=bool))
        self.cbxVisibleLayersOnly.setChecked(flag)

        flag = bool(settings.value(
            'inasafe/set_layer_from_title_flag', True, type=bool))
        self.cbxSetLayerNameFromTitle.setChecked(flag)

        flag = bool(settings.value(
            'inasafe/setZoomToImpactFlag', True, type=bool))
        self.cbxZoomToImpact.setChecked(flag)
        # whether exposure layer should be hidden after model completes
        flag = bool(settings.value(
            'inasafe/setHideExposureFlag', False, type=bool))
        self.cbxHideExposure.setChecked(flag)

        flag = bool(settings.value(
            'inasafe/clip_to_viewport', True, type=bool))
        self.cbxClipToViewport.setChecked(flag)

        flag = bool(settings.value(
            'inasafe/clip_hard', False, type=bool))
        self.cbxClipHard.setChecked(flag)

        flag = bool(settings.value(
            'inasafe/useSentry', False, type=bool))
        self.cbxUseSentry.setChecked(flag)

        flag = bool(settings.value(
            'inasafe/show_intermediate_layers', False, type=bool))
        self.cbxShowPostprocessingLayers.setChecked(flag)

        ratio = float(settings.value(
            'inasafe/defaultFemaleRatio',
            DEFAULTS['FEM_RATIO'], type=float))
        self.dsbFemaleRatioDefault.setValue(ratio)

        path = settings.value(
            'inasafe/keywordCachePath',
            self.keyword_io.default_keyword_db_path(), type=str)
        self.leKeywordCachePath.setText(path)

        path = settings.value('inasafe/northArrowPath', '', type=str)
        self.leNorthArrowPath.setText(path)

        path = settings.value(
            'inasafe/organisationLogoPath',
            ':/plugins/inasafe/bnpb_logo_64.png',
            type=str)
        self.leOrganisationLogoPath.setText(path)

        flag = bool(settings.value(
            'inasafe/showOrganisationLogoInDockFlag', True, type=bool))
        self.organisation_on_dock_checkbox.setChecked(flag)

#.........这里部分代码省略.........
开发者ID:FlavioFalcao,项目名称:inasafe,代码行数:103,代码来源:options_dialog.py

示例2: OptionsDialog

# 需要导入模块: from safe_qgis.utilities.keyword_io import KeywordIO [as 别名]
# 或者: from safe_qgis.utilities.keyword_io.KeywordIO import default_keyword_db_path [as 别名]
class OptionsDialog(QtGui.QDialog, Ui_OptionsDialogBase):
    """Options dialog for the InaSAFE plugin."""

    def __init__(self, iface, dock=None, parent=None):
        """Constructor for the dialog.

        :param iface: A Quantum GIS QGisAppInterface instance.
        :type iface: QGisAppInterface

        :param parent: Parent widget of this dialog
        :type parent: QWidget

        :param dock: Optional dock widget instance that we can notify of
            changes to the keywords.
        :type dock: Dock
        """

        QtGui.QDialog.__init__(self, parent)
        self.setupUi(self)
        self.setWindowTitle(self.tr('InaSAFE %s Options' % get_version()))
        # Save reference to the QGIS interface and parent
        self.iface = iface
        self.parent = parent
        self.dock = dock
        self.keywordIO = KeywordIO()
        # Set up things for context help
        myButton = self.buttonBox.button(QtGui.QDialogButtonBox.Help)
        myButton.clicked.connect(self.show_help)
        self.grpNotImplemented.hide()
        self.adjustSize()
        self.restore_state()
        # hack prevent showing use thread visible and set it false see #557
        self.cbxUseThread.setChecked(True)
        self.cbxUseThread.setVisible(False)

    def restore_state(self):
        """Reinstate the options based on the user's stored session info.
        """
        mySettings = QtCore.QSettings()
        # myFlag = mySettings.value(
        #     'inasafe/useThreadingFlag', False)
        # hack set use thread to false see #557
        myFlag = False
        self.cbxUseThread.setChecked(myFlag)

        myFlag = bool(mySettings.value(
            'inasafe/visibleLayersOnlyFlag', True))
        self.cbxVisibleLayersOnly.setChecked(myFlag)

        myFlag = bool(mySettings.value(
            'inasafe/setLayerNameFromTitleFlag', True))
        self.cbxSetLayerNameFromTitle.setChecked(myFlag)

        myFlag = bool(mySettings.value(
            'inasafe/setZoomToImpactFlag', True))
        self.cbxZoomToImpact.setChecked(myFlag)
        # whether exposure layer should be hidden after model completes
        myFlag = bool(mySettings.value(
            'inasafe/setHideExposureFlag', False))
        self.cbxHideExposure.setChecked(myFlag)

        myFlag = bool(mySettings.value(
            'inasafe/clipToViewport', True))
        self.cbxClipToViewport.setChecked(myFlag)

        myFlag = bool(mySettings.value(
            'inasafe/clipHard', False))
        self.cbxClipHard.setChecked(myFlag)

        myFlag = bool(mySettings.value(
            'inasafe/useSentry', False))
        self.cbxUseSentry.setChecked(myFlag)

        myFlag = bool(mySettings.value(
            'inasafe/showIntermediateLayers', False))
        self.cbxShowPostprocessingLayers.setChecked(myFlag)

        myRatio = float(mySettings.value(
            'inasafe/defaultFemaleRatio',
            DEFAULTS['FEM_RATIO']))
        self.dsbFemaleRatioDefault.setValue(myRatio)

        myPath = mySettings.value(
            'inasafe/keywordCachePath',
            self.keywordIO.default_keyword_db_path())
        self.leKeywordCachePath.setText(myPath)

        myFlag = bool(mySettings.value(
            'inasafe/devMode', False))
        self.cbxDevMode.setChecked(myFlag)

        myFlag = bool(mySettings.value(
            'inasafe/useNativeZonalStats', False))
        self.cbxNativeZonalStats.setChecked(myFlag)

    def save_state(self):
        """Store the options into the user's stored session info.
        """
        mySettings = QtCore.QSettings()
        mySettings.setValue('inasafe/useThreadingFlag',
#.........这里部分代码省略.........
开发者ID:CharlesRethman,项目名称:inasafe,代码行数:103,代码来源:options_dialog.py

示例3: OptionsDialog

# 需要导入模块: from safe_qgis.utilities.keyword_io import KeywordIO [as 别名]
# 或者: from safe_qgis.utilities.keyword_io.KeywordIO import default_keyword_db_path [as 别名]
class OptionsDialog(QtGui.QDialog, Ui_OptionsDialogBase):
    """Options dialog for the InaSAFE plugin."""

    def __init__(self, iface, dock=None, parent=None):
        """Constructor for the dialog.

        :param iface: A Quantum GIS QGisAppInterface instance.
        :type iface: QGisAppInterface

        :param parent: Parent widget of this dialog
        :type parent: QWidget

        :param dock: Optional dock widget instance that we can notify of
            changes to the keywords.
        :type dock: Dock
        """

        QtGui.QDialog.__init__(self, parent)
        self.setupUi(self)
        self.setWindowTitle(self.tr('InaSAFE %s Options' % get_version()))
        # Save reference to the QGIS interface and parent
        self.iface = iface
        self.parent = parent
        self.dock = dock
        self.keyword_io = KeywordIO()
        self.defaults = get_defaults()

        # Set up things for context help
        button = self.buttonBox.button(QtGui.QDialogButtonBox.Help)
        button.clicked.connect(self.show_help)
        self.grpNotImplemented.hide()
        self.adjustSize()
        self.restore_state()
        # hack prevent showing use thread visible and set it false see #557
        self.cbxUseThread.setChecked(True)
        self.cbxUseThread.setVisible(False)

        # Set up listener for various UI
        self.custom_org_logo_checkbox.toggled.connect(
            self.set_organisation_logo)
        self.custom_north_arrow_checkbox.toggled.connect(self.set_north_arrow)
        self.custom_templates_dir_checkbox.toggled.connect(
            self.set_templates_dir)
        self.custom_org_disclaimer_checkbox.toggled.connect(
            self.set_org_disclaimer)

    def restore_state(self):
        """Reinstate the options based on the user's stored session info.
        """
        settings = QtCore.QSettings()
        # flag = settings.value(
        #     'inasafe/useThreadingFlag', False)
        # hack set use thread to false see #557
        flag = False
        self.cbxUseThread.setChecked(flag)

        flag = bool(settings.value(
            'inasafe/visibleLayersOnlyFlag', True, type=bool))
        self.cbxVisibleLayersOnly.setChecked(flag)

        flag = bool(settings.value(
            'inasafe/set_layer_from_title_flag', True, type=bool))
        self.cbxSetLayerNameFromTitle.setChecked(flag)

        flag = bool(settings.value(
            'inasafe/setZoomToImpactFlag', True, type=bool))
        self.cbxZoomToImpact.setChecked(flag)
        # whether exposure layer should be hidden after model completes
        flag = bool(settings.value(
            'inasafe/setHideExposureFlag', False, type=bool))
        self.cbxHideExposure.setChecked(flag)

        flag = bool(settings.value(
            'inasafe/clip_to_viewport', True, type=bool))
        self.cbxClipToViewport.setChecked(flag)

        flag = bool(settings.value(
            'inasafe/clip_hard', False, type=bool))
        self.cbxClipHard.setChecked(flag)

        flag = bool(settings.value(
            'inasafe/useSentry', False, type=bool))
        self.cbxUseSentry.setChecked(flag)

        flag = bool(settings.value(
            'inasafe/show_intermediate_layers', False, type=bool))
        self.cbxShowPostprocessingLayers.setChecked(flag)

        ratio = self.defaults['FEMALE_RATIO']
        self.dsbFemaleRatioDefault.setValue(ratio)

        path = settings.value(
            'inasafe/keywordCachePath',
            self.keyword_io.default_keyword_db_path(), type=str)
        self.leKeywordCachePath.setText(path)

        flag = bool(settings.value(
            'inasafe/template_warning_verbose', True, type=bool))
        self.template_warning_checkbox.setChecked(flag)

#.........这里部分代码省略.........
开发者ID:cccs-ip,项目名称:inasafe,代码行数:103,代码来源:options_dialog.py


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