コード例 #1
0
    def _populateGraphicsViewSettingWidgets(self, settings):
        """
        Populates the widgets with the settings.

        :param settings: Graphics view settings
        """

        self.uiSceneWidthSpinBox.setValue(settings["scene_width"])
        self.uiSceneHeightSpinBox.setValue(settings["scene_height"])
        self.uiNodeGridSizeSpinBox.setValue(settings["grid_size"])
        self.uiDrawingGridSizeSpinBox.setValue(settings["drawing_grid_size"])
        self.uiRectangleSelectedItemCheckBox.setChecked(settings["draw_rectangle_selected_item"])
        self.uiDrawLinkStatusPointsCheckBox.setChecked(settings["draw_link_status_points"])
        self.uiShowInterfaceLabelsOnNewProject.setChecked(settings["show_interface_labels_on_new_project"])
        self.uiLimitSizeNodeSymbolCheckBox.setChecked(settings["limit_size_node_symbols"])
        self.uiShowGridOnNewProject.setChecked(settings["show_grid_on_new_project"])
        self.uiSnapToGridOnNewProject.setChecked(settings["snap_to_grid_on_new_project"])

        qt_font = QtGui.QFont()
        if qt_font.fromString(settings["default_label_font"]):
            self.uiDefaultLabelStylePlainTextEdit.setFont(qt_font)
        qt_color = QtGui.QColor(settings["default_label_color"])
        if qt_color.isValid():
            self._default_label_color = qt_color
            self.uiDefaultLabelStylePlainTextEdit.setStyleSheet("color : {}".format(qt_color.name()))

        qt_font = QtGui.QFont()
        if qt_font.fromString(settings["default_note_font"]):
            self.uiDefaultNoteStylePlainTextEdit.setFont(qt_font)
        qt_color = QtGui.QColor(settings["default_note_color"])
        if qt_color.isValid():
            self._default_note_color = qt_color
            self.uiDefaultNoteStylePlainTextEdit.setStyleSheet("color : {}".format(qt_color.name()))
コード例 #2
0
    def __init__(self, parent=None):

        QtGui.QWidget.__init__(self)
        self.setupUi(self)
        self._remote_servers = {}
        self._preferences_dialog = parent

        # Load the pre-configured console commands
        for name, cmd in sorted(PRECONFIGURED_TELNET_CONSOLE_COMMANDS.items()):
            self.uiTelnetConsolePreconfiguredCommandComboBox.addItem(name, cmd)
        for name, cmd in sorted(PRECONFIGURED_SERIAL_CONSOLE_COMMANDS.items()):
            self.uiSerialConsolePreconfiguredCommandComboBox.addItem(name, cmd)

        # Display the path of the config file
        config_file_path = LocalConfig.instance().configFilePath()
        self.uiConfigurationFileLabel.setText(config_file_path)

        self.uiProjectsPathToolButton.clicked.connect(self._projectsPathSlot)
        self.uiImagesPathToolButton.clicked.connect(self._imagesPathSlot)
        self.uiImportConfigurationFilePushButton.clicked.connect(
            self._importConfigurationFileSlot)
        self.uiExportConfigurationFilePushButton.clicked.connect(
            self._exportConfigurationFileSlot)
        self.uiRestoreDefaultsPushButton.clicked.connect(
            self._restoreDefaultsSlot)
        self.uiTelnetConsolePreconfiguredCommandPushButton.clicked.connect(
            self._telnetConsolePreconfiguredCommandSlot)
        self.uiSerialConsolePreconfiguredCommandPushButton.clicked.connect(
            self._serialConsolePreconfiguredCommandSlot)
        self.uiDefaultLabelFontPushButton.clicked.connect(
            self._setDefaultLabelFontSlot)
        self.uiDefaultLabelColorPushButton.clicked.connect(
            self._setDefaultLabelColorSlot)
        self._default_label_color = QtGui.QColor(QtCore.Qt.black)
        self.uiStyleComboBox.addItems(STYLES)
コード例 #3
0
    def __init__(self, parent=None):

        super().__init__()
        self.setupUi(self)
        self._remote_servers = {}
        self._preferences_dialog = parent

        # Display the path of the config file
        config_file_path = LocalConfig.instance().configFilePath()
        self.uiConfigurationFileLabel.setText(config_file_path)

        self.uiProjectsPathToolButton.clicked.connect(self._projectsPathSlot)
        self.uiSymbolsPathToolButton.clicked.connect(self._symbolsPathSlot)
        self.uiImagesPathToolButton.clicked.connect(self._imagesPathSlot)
        self.uiConfigsPathToolButton.clicked.connect(self._configsPathSlot)
        self.uiImportConfigurationFilePushButton.clicked.connect(
            self._importConfigurationFileSlot)
        self.uiExportConfigurationFilePushButton.clicked.connect(
            self._exportConfigurationFileSlot)
        self.uiRestoreDefaultsPushButton.clicked.connect(
            self._restoreDefaultsSlot)
        self.uiTelnetConsolePreconfiguredCommandPushButton.clicked.connect(
            self._telnetConsolePreconfiguredCommandSlot)
        self.uiSerialConsolePreconfiguredCommandPushButton.clicked.connect(
            self._serialConsolePreconfiguredCommandSlot)
        self.uiVNCConsolePreconfiguredCommandPushButton.clicked.connect(
            self._vncConsolePreconfiguredCommandSlot)
        self.uiDefaultLabelFontPushButton.clicked.connect(
            self._setDefaultLabelFontSlot)
        self.uiDefaultLabelColorPushButton.clicked.connect(
            self._setDefaultLabelColorSlot)
        self._default_label_color = QtGui.QColor(QtCore.Qt.black)
        self.uiStyleComboBox.addItems(STYLES)
コード例 #4
0
    def _populateGraphicsViewSettingWidgets(self, settings):
        """
        Populates the widgets with the settings.

        :param settings: Graphics view settings
        """

        self.uiSceneWidthSpinBox.setValue(settings["scene_width"])
        self.uiSceneHeightSpinBox.setValue(settings["scene_height"])
        self.uiRectangleSelectedItemCheckBox.setChecked(settings["draw_rectangle_selected_item"])
        self.uiDrawLinkStatusPointsCheckBox.setChecked(settings["draw_link_status_points"])

        qt_font = QtGui.QFont()
        if qt_font.fromString(settings["default_label_font"]):
            self.uiDefaultLabelStylePlainTextEdit.setFont(qt_font)
        qt_color = QtGui.QColor(settings["default_label_color"])
        if qt_color.isValid():
            self._default_label_color = qt_color
            self.uiDefaultLabelStylePlainTextEdit.setStyleSheet("color : {}".format(qt_color.name()))