本文整理汇总了Python中ninja_ide.gui.ide.IDE.ninja_settings方法的典型用法代码示例。如果您正苦于以下问题:Python IDE.ninja_settings方法的具体用法?Python IDE.ninja_settings怎么用?Python IDE.ninja_settings使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ninja_ide.gui.ide.IDE
的用法示例。
在下文中一共展示了IDE.ninja_settings方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: toggle_tabs_and_spaces
# 需要导入模块: from ninja_ide.gui.ide import IDE [as 别名]
# 或者: from ninja_ide.gui.ide.IDE import ninja_settings [as 别名]
def toggle_tabs_and_spaces(self):
""" Toggle Show/Hide Tabs and Spaces """
settings.SHOW_TABS_AND_SPACES = not settings.SHOW_TABS_AND_SPACES
qsettings = IDE.ninja_settings()
qsettings.setValue('preferences/editor/showTabsAndSpaces',
settings.SHOW_TABS_AND_SPACES)
示例2: _save
# 需要导入模块: from ninja_ide.gui.ide import IDE [as 别名]
# 或者: from ninja_ide.gui.ide.IDE import ninja_settings [as 别名]
def _save(self):
qsettings = IDE.ninja_settings()
editor_settings = IDE.editor_settings()
qsettings.beginGroup("editor")
editor_settings.beginGroup("editor")
qsettings.beginGroup("behavior")
editor_settings.beginGroup("behavior")
settings.REMOVE_TRAILING_SPACES = self._check_remove_spaces.isChecked()
qsettings.setValue("removeTrailingSpaces",
settings.REMOVE_TRAILING_SPACES)
settings.ADD_NEW_LINE_AT_EOF = self._check_add_new_line.isChecked()
qsettings.setValue("addNewLineAtEnd", settings.ADD_NEW_LINE_AT_EOF)
settings.HIDE_MOUSE_CURSOR = self._check_hide_cursor.isChecked()
qsettings.setValue("hideMouseCursor", settings.HIDE_MOUSE_CURSOR)
settings.SCROLL_WHEEL_ZOMMING = self._check_scroll_wheel.isChecked()
qsettings.setValue("scrollWheelZomming", settings.SCROLL_WHEEL_ZOMMING)
settings.USE_TABS = bool(self._combo_tab_policy.currentIndex())
editor_settings.setValue("use_tabs", settings.USE_TABS)
settings.INDENT = self._spin_indent_size.value()
editor_settings.setValue("indentation_width", settings.INDENT)
qsettings.endGroup()
qsettings.endGroup()
editor_settings.endGroup()
editor_settings.endGroup()
示例3: save
# 需要导入模块: from ninja_ide.gui.ide import IDE [as 别名]
# 或者: from ninja_ide.gui.ide.IDE import ninja_settings [as 别名]
def save(self):
qsettings = IDE.ninja_settings()
settings.SHOW_MINIMAP = self._checkShowMinimap.isChecked()
settings.MINIMAP_MAX_OPACITY = self._spinMaxOpacity.value() / 100.0
settings.MINIMAP_MIN_OPACITY = self._spinMinOpacity.value() / 100.0
settings.SIZE_PROPORTION = self._spinSize.value() / 100.0
qsettings.setValue('preferences/editor/minimapShow',
settings.SHOW_MINIMAP)
qsettings.setValue('preferences/editor/minimapMaxOpacity',
settings.MINIMAP_MAX_OPACITY)
qsettings.setValue('preferences/editor/minimapMinOpacity',
settings.MINIMAP_MIN_OPACITY)
qsettings.setValue('preferences/editor/minimapSizeProportion',
settings.SIZE_PROPORTION)
fontText = self._btnEditorFont.text().replace(' ', '')
settings.FONT_FAMILY = fontText.split(',')[0]
settings.FONT_SIZE = int(fontText.split(',')[1])
qsettings.setValue('preferences/editor/fontFamily',
settings.FONT_FAMILY)
qsettings.setValue('preferences/editor/fontSize', settings.FONT_SIZE)
scheme = self._listScheme.currentItem().text()
self.original_style = resources.CUSTOM_SCHEME
qsettings.setValue('preferences/editor/scheme', scheme)
resources.CUSTOM_SCHEME = self._schemes.get(scheme,
resources.COLOR_SCHEME)
示例4: save_scheme
# 需要导入模块: from ninja_ide.gui.ide import IDE [as 别名]
# 或者: from ninja_ide.gui.ide.IDE import ninja_settings [as 别名]
def save_scheme(self):
name = self.line_name.text().strip()
if not self._is_valid_scheme_name(name):
QMessageBox.information(self, self.tr("Invalid Scheme Name"),
self.tr("The scheme name you have chosen is invalid.\nPlease "
"pick a different name."))
return
fileName = ('{0}.color'.format(
file_manager.create_path(resources.EDITOR_SKINS, name)))
answer = True
if file_manager.file_exists(fileName):
answer = QMessageBox.question(self,
self.tr("Scheme already exists"),
(self.tr("Do you want to override the file: %s?") % fileName),
QMessageBox.Yes, QMessageBox.No)
if answer in (QMessageBox.Yes, True):
scheme = self._preview_style()
self.original_style = copy.copy(scheme)
json_manager.save_editor_skins(fileName, scheme)
self._modified = False
self.saved = True
qsettings = IDE.ninja_settings()
qsettings.setValue('preferences/editor/scheme', name)
QMessageBox.information(self, self.tr("Scheme Saved"),
(self.tr("The scheme has been saved at: %s.") % fileName))
self.close()
elif answer == QMessageBox.Yes:
QMessageBox.information(self, self.tr("Scheme Not Saved"),
self.tr("The name probably is invalid."))
示例5: save
# 需要导入模块: from ninja_ide.gui.ide import IDE [as 别名]
# 或者: from ninja_ide.gui.ide.IDE import ninja_settings [as 别名]
def save(self):
"""Method to Save all preferences values"""
qsettings = IDE.ninja_settings()
qsettings.setValue('preferences/general/loadFiles',
self._checkLastSession.isChecked())
qsettings.setValue('preferences/general/activatePlugins',
self._checkActivatePlugins.isChecked())
qsettings.setValue('preferences/general/notifyUpdates',
self._checkNotifyUpdates.isChecked())
qsettings.setValue('preferences/general/showStartPage',
self._checkShowStartPage.isChecked())
qsettings.setValue('preferences/general/confirmExit',
self._checkConfirmExit.isChecked())
settings.CONFIRM_EXIT = self._checkConfirmExit.isChecked()
qsettings.setValue('preferences/general/workspace',
self._txtWorkspace.text())
settings.WORKSPACE = self._txtWorkspace.text()
extensions = str(self._txtExtensions.text()).split(',')
extensions = [e.strip() for e in extensions]
qsettings.setValue('preferences/general/supportedExtensions',
extensions)
settings.SUPPORTED_EXTENSIONS = list(extensions)
settings.NOTIFICATION_POSITION = self._notify_position.currentIndex()
qsettings.setValue('preferences/general/notification_position',
settings.NOTIFICATION_POSITION)
settings.NOTIFICATION_COLOR = self._notification_choosed_color
qsettings.setValue('preferences/general/notification_color',
settings.NOTIFICATION_COLOR)
示例6: save
# 需要导入模块: from ninja_ide.gui.ide import IDE [as 别名]
# 或者: from ninja_ide.gui.ide.IDE import ninja_settings [as 别名]
def save(self):
qsettings = IDE.ninja_settings()
qsettings.beginGroup("ide")
qsettings.beginGroup("interface")
ninja_theme = self._combobox_themes.currentText()
settings.NINJA_SKIN = ninja_theme
qsettings.setValue("skin", settings.NINJA_SKIN)
settings.SHOW_PROJECT_EXPLORER = self._checkProjectExplorer.isChecked()
qsettings.setValue("showProjectExplorer",
settings.SHOW_PROJECT_EXPLORER)
settings.SHOW_SYMBOLS_LIST = self._checkSymbols.isChecked()
qsettings.setValue("showSymbolsList", settings.SHOW_SYMBOLS_LIST)
if self._line_custom_hdpi.isEnabled():
screen_resolution = self._line_custom_hdpi.text().strip()
settings.CUSTOM_SCREEN_RESOLUTION = screen_resolution
else:
settings.HDPI = bool(self._combo_resolution.currentIndex())
qsettings.setValue("autoHdpi", settings.HDPI)
settings.CUSTOM_SCREEN_RESOLUTION = ""
qsettings.setValue("customScreenResolution",
settings.CUSTOM_SCREEN_RESOLUTION)
qsettings.endGroup()
qsettings.endGroup()
示例7: showEvent
# 需要导入模块: from ninja_ide.gui.ide import IDE [as 别名]
# 或者: from ninja_ide.gui.ide.IDE import ninja_settings [as 别名]
def showEvent(self, event):
#Show Event
super(CentralWidget, self).showEvent(event)
if bin(settings.UI_LAYOUT)[-1] == '1':
self.splitter_base_rotate()
if bin(settings.UI_LAYOUT >> 1)[-1] == '1':
self.splitter_inside_rotate()
if bin(settings.UI_LAYOUT >> 2)[-1] == '1':
self.splitter_base_orientation()
#Rearrange widgets on Window
qsettings = IDE.ninja_settings()
#Lists of sizes as list of QVariant- heightList = [QVariant, QVariant]
heightSize = qsettings.value("window/central/insideSplitterSize", None)
widthSize = qsettings.value("window/central/baseSplitterSize", None)
lateralVisible = qsettings.value("window/central/lateralVisible", True,
type=bool)
if heightSize is None:
self._splitterInside.setSizes([(self.height() / 3) * 2,
self.height() / 3])
else:
self._splitterInside.restoreState(heightSize)
if widthSize is None:
self._splitterBase.setSizes([900, 100])
else:
self._splitterBase.restoreState(widthSize)
if not lateralVisible:
self.lateralPanel.hide()
示例8: save
# 需要导入模块: from ninja_ide.gui.ide import IDE [as 别名]
# 或者: from ninja_ide.gui.ide.IDE import ninja_settings [as 别名]
def save(self):
"""Save all Execution Preferences"""
qsettings = IDE.ninja_settings()
qsettings.beginGroup("execution")
# Python executable
settings.PYTHON_EXEC = self._combo_python_path.currentText()
qsettings.setValue("pythonExec", settings.PYTHON_EXEC)
# Execution options
options = ""
if self._check_B.isChecked():
options += " -B"
if self._check_d.isChecked():
options += " -d"
if self._check_E.isChecked():
options += " -E"
if self._check_O.isChecked():
options += " -O"
if self._check_OO.isChecked():
options += " -OO"
if self._check_s.isChecked():
options += " -s"
if self._check_S.isChecked():
options += " -S"
if self._check_v.isChecked():
options += " -v"
if self._check_W.isChecked():
options += " -W" + self._combo_warning.currentText()
settings.EXECUTION_OPTIONS = options
qsettings.setValue("executionOptions", options)
qsettings.endGroup()
示例9: activate_plugin
# 需要导入模块: from ninja_ide.gui.ide import IDE [as 别名]
# 或者: from ninja_ide.gui.ide.IDE import ninja_settings [as 别名]
def activate_plugin(self, plugin):
"""
Receives PluginMetadata instance and activates its given plugin
BEWARE: We do not do any kind of checking about if the plugin is
actually installed.
"""
qsettings = IDE.ninja_settings()
activated = qsettings.value('plugins/registry/activated', [])
failure = qsettings.value('plugins/registry/failure', [])
plugin_name = plugin.name
try:
plugin.activate()
except Exception:
#This plugin can no longer be activated
if plugin.name in activated:
activated.remove(plugin_name)
if plugin.name not in failure:
failure.append(plugin_name)
else:
activated.append(plugin_name)
if plugin_name in failure:
failure.remove(plugin_name)
finally:
qsettings.setValue('plugins/registry/activated', activated)
qsettings.setValue('plugins/registry/failure', failure)
示例10: save
# 需要导入模块: from ninja_ide.gui.ide import IDE [as 别名]
# 或者: from ninja_ide.gui.ide.IDE import ninja_settings [as 别名]
def save(self):
qsettings = IDE.ninja_settings()
settings.TOOLBAR_ITEMS = self.toolbar_settings
lang = self._comboLang.currentText()
#preferences/interface
qsettings.setValue('preferences/interface/showProjectExplorer',
self._checkProjectExplorer.isChecked())
settings.SHOW_PROJECT_EXPLORER = self._checkProjectExplorer.isChecked()
qsettings.setValue('preferences/interface/showSymbolsList',
self._checkSymbols.isChecked())
settings.SHOW_SYMBOLS_LIST = self._checkSymbols.isChecked()
qsettings.setValue('preferences/interface/showWebInspector',
self._checkWebInspetor.isChecked())
settings.SHOW_WEB_INSPECTOR = self._checkWebInspetor.isChecked()
qsettings.setValue('preferences/interface/showErrorsList',
self._checkFileErrors.isChecked())
settings.SHOW_ERRORS_LIST = self._checkFileErrors.isChecked()
qsettings.setValue('preferences/interface/showMigrationList',
self._checkMigrationTips.isChecked())
settings.SHOW_MIGRATION_LIST = self._checkMigrationTips.isChecked()
#qsettings.setValue('preferences/interface/toolbar',
#settings.TOOLBAR_ITEMS)
qsettings.setValue('preferences/interface/language', lang)
lang = lang + '.qm'
settings.LANGUAGE = os.path.join(resources.LANGS, lang)
示例11: save_scheme
# 需要导入模块: from ninja_ide.gui.ide import IDE [as 别名]
# 或者: from ninja_ide.gui.ide.IDE import ninja_settings [as 别名]
def save_scheme(self):
"""Save current scheme."""
name = self.line_name.text().strip()
if not self._is_valid_scheme_name(name):
QMessageBox.information(
self, translations.TR_PREFERENCES_EDITOR_SCHEME_DESIGNER,
translations.TR_SCHEME_INVALID_NAME)
return
fileName = ('{0}.color'.format(
file_manager.create_path(resources.EDITOR_SKINS, name)))
answer = True
if file_manager.file_exists(fileName):
answer = QMessageBox.question(
self, translations.TR_PREFERENCES_EDITOR_SCHEME_DESIGNER,
translations.TR_WANT_OVERWRITE_FILE + ": {0}?".format(fileName),
QMessageBox.Yes, QMessageBox.No)
if answer in (QMessageBox.Yes, True):
scheme = self._preview_style()
self.original_style = copy.copy(scheme)
json_manager.save_editor_skins(fileName, scheme)
self._modified = False
self.saved = True
qsettings = IDE.ninja_settings()
qsettings.setValue('preferences/editor/scheme', name)
QMessageBox.information(
self, translations.TR_PREFERENCES_EDITOR_SCHEME_DESIGNER,
translations.TR_SCHEME_SAVED + ": {0}.".format(fileName))
self.close()
elif answer == QMessageBox.Yes:
QMessageBox.information(
self, translations.TR_PREFERENCES_EDITOR_SCHEME_DESIGNER,
translations.TR_INVALID_FILENAME)
示例12: _get_editor_skins
# 需要导入模块: from ninja_ide.gui.ide import IDE [as 别名]
# 或者: from ninja_ide.gui.ide.IDE import ninja_settings [as 别名]
def _get_editor_skins(self):
qsettings = IDE.ninja_settings()
qsettings.beginGroup('preferences')
qsettings.beginGroup('editor')
self._schemes = json_manager.load_editor_skins()
self._selected_scheme = qsettings.value('scheme', defaultValue='',
type='QString')
qsettings.endGroup()
qsettings.endGroup()
示例13: _reset_preferences
# 需要导入模块: from ninja_ide.gui.ide import IDE [as 别名]
# 或者: from ninja_ide.gui.ide.IDE import ninja_settings [as 别名]
def _reset_preferences(self):
result = QMessageBox.question(self,
translations.TR_PREFERENCES_GENERAL_RESET_TITLE,
translations.TR_PREFERENCES_GENERAL_RESET_BODY,
buttons=QMessageBox.Yes | QMessageBox.No)
if result == QMessageBox.Yes:
qsettings = IDE.ninja_settings()
qsettings.clear()
self._preferences.close()
示例14: save_configuration
# 需要导入模块: from ninja_ide.gui.ide import IDE [as 别名]
# 或者: from ninja_ide.gui.ide.IDE import ninja_settings [as 别名]
def save_configuration(self):
qsettings = IDE.ninja_settings()
#Save the size of de splitters
qsettings.setValue("window/central/baseSplitterSize",
self._splitterBase.saveState())
qsettings.setValue("window/central/insideSplitterSize",
self._splitterInside.saveState())
qsettings.setValue("window/central/lateralVisible",
self.lateralPanel.isVisible())
示例15: save_configuration
# 需要导入模块: from ninja_ide.gui.ide import IDE [as 别名]
# 或者: from ninja_ide.gui.ide.IDE import ninja_settings [as 别名]
def save_configuration(self):
"""Save the size of the splitters"""
qsettings = IDE.ninja_settings()
qsettings.setValue("window/central/base_splitter_size",
self._splitter_base.saveState())
qsettings.setValue("window/central/inside_splitter_size",
self._splitter_inside.saveState())
qsettings.setValue("window/central/lateral_visible",
self.lateral_panel.isVisible())