diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 156269fd9..27850fe26 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Build and run Docker image run: | docker build -t gns3-gui-test . diff --git a/gns3/dialogs/style_editor_dialog.py b/gns3/dialogs/style_editor_dialog.py index 45a16c7b5..43496691e 100644 --- a/gns3/dialogs/style_editor_dialog.py +++ b/gns3/dialogs/style_editor_dialog.py @@ -78,8 +78,20 @@ def __init__(self, parent, items): if not corner_radius: corner_radius = first_item.verticalCornerRadius() self.uiCornerRadiusSpinBox.setValue(corner_radius) + else: + self.uiCornerRadiusLabel.hide() + self.uiCornerRadiusSpinBox.hide() self.uiRotationSpinBox.setValue(int(first_item.rotation())) self.uiBorderWidthSpinBox.setValue(pen.width()) + if isinstance(first_item, ShapeItem): + rect = first_item.rect() + self.uiWidthSpinBox.setValue(int(rect.width())) + self.uiHeightSpinBox.setValue(int(rect.height())) + else: + self.uiWidthSpinBox.hide() + self.uiWidthLabel.hide() + self.uiHeightSpinBox.hide() + self.uiHeightLabel.hide() index = self.uiBorderStyleComboBox.findData(pen.style()) if index != -1: self.uiBorderStyleComboBox.setCurrentIndex(index) @@ -134,6 +146,8 @@ def _applyPreferencesSlot(self): # maybe we support setting them separately in the future item.setHorizontalCornerRadius(corner_radius) item.setVerticalCornerRadius(corner_radius) + if isinstance(item, ShapeItem): + item.setWidthAndHeight(self.uiWidthSpinBox.value(), self.uiHeightSpinBox.value()) item.setRotation(self.uiRotationSpinBox.value()) def done(self, result): diff --git a/gns3/items/shape_item.py b/gns3/items/shape_item.py index a0f04873d..8aec16498 100644 --- a/gns3/items/shape_item.py +++ b/gns3/items/shape_item.py @@ -171,6 +171,9 @@ def hoverLeaveEvent(self, event): if not self.locked(): self._graphics_view.setCursor(QtCore.Qt.ArrowCursor) + def setWidthAndHeight(self, width, height): + self.setRect(0, 0, width, height) + def fromSvg(self, svg): """ Import element information from SVG diff --git a/gns3/schemas/appliance.json b/gns3/schemas/appliance.json index 2a9005fc1..78b7c004a 100644 --- a/gns3/schemas/appliance.json +++ b/gns3/schemas/appliance.json @@ -71,6 +71,11 @@ "format": "uri", "title": "Website of the vendor" }, + "vendor_logo_url": { + "type": "string", + "format": "uri", + "title": "Link to the vendor logo (used by the GNS3 marketplace)" + }, "documentation_url": { "type": "string", "format": "uri", diff --git a/gns3/schemas/appliance_v8.json b/gns3/schemas/appliance_v8.json index 4fb0db7b6..e120c8313 100644 --- a/gns3/schemas/appliance_v8.json +++ b/gns3/schemas/appliance_v8.json @@ -592,6 +592,11 @@ "format": "uri", "title": "Website of the vendor" }, + "vendor_logo_url": { + "type": "string", + "format": "uri", + "title": "Link to the vendor logo (used by the GNS3 marketplace)" + }, "documentation_url": { "type": "string", "format": "uri", diff --git a/gns3/ui/style_editor_dialog.ui b/gns3/ui/style_editor_dialog.ui index 7cacc2bf6..c704002a7 100755 --- a/gns3/ui/style_editor_dialog.ui +++ b/gns3/ui/style_editor_dialog.ui @@ -6,8 +6,8 @@ 0 0 - 270 - 294 + 288 + 358 @@ -84,14 +84,14 @@ - + Rotation: - + @@ -114,14 +114,14 @@ editing (notes only) with ALT and '+' (or P) / ALT and '-' (or M) - + Corner radius: - + ° @@ -131,6 +131,46 @@ editing (notes only) with ALT and '+' (or P) / ALT and '-' (or M) + + + + Width: + + + + + + + px + + + 10 + + + 1000 + + + + + + + Height: + + + + + + + px + + + 10 + + + 1000 + + + diff --git a/gns3/ui/style_editor_dialog_ui.py b/gns3/ui/style_editor_dialog_ui.py index 2c09265af..75966bae3 100644 --- a/gns3/ui/style_editor_dialog_ui.py +++ b/gns3/ui/style_editor_dialog_ui.py @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file '/home/grossmj/PycharmProjects/gns3-gui/gns3/ui/style_editor_dialog.ui' # -# Created by: PyQt5 UI code generator 5.15.9 +# Created by: PyQt5 UI code generator 5.15.6 # # WARNING: Any manual changes made to this file will be lost when pyuic5 is # run again. Do not edit this file unless you know what you are doing. @@ -14,7 +14,7 @@ class Ui_StyleEditorDialog(object): def setupUi(self, StyleEditorDialog): StyleEditorDialog.setObjectName("StyleEditorDialog") - StyleEditorDialog.resize(270, 294) + StyleEditorDialog.resize(288, 358) StyleEditorDialog.setModal(True) self.verticalLayout = QtWidgets.QVBoxLayout(StyleEditorDialog) self.verticalLayout.setObjectName("verticalLayout") @@ -53,7 +53,7 @@ def setupUi(self, StyleEditorDialog): self.formLayout.setWidget(3, QtWidgets.QFormLayout.FieldRole, self.uiBorderStyleComboBox) self.uiRotationLabel = QtWidgets.QLabel(self.uiStyleSettingsGroupBox) self.uiRotationLabel.setObjectName("uiRotationLabel") - self.formLayout.setWidget(5, QtWidgets.QFormLayout.LabelRole, self.uiRotationLabel) + self.formLayout.setWidget(7, QtWidgets.QFormLayout.LabelRole, self.uiRotationLabel) self.uiRotationSpinBox = QtWidgets.QSpinBox(self.uiStyleSettingsGroupBox) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) @@ -63,14 +63,30 @@ def setupUi(self, StyleEditorDialog): self.uiRotationSpinBox.setMinimum(-360) self.uiRotationSpinBox.setMaximum(360) self.uiRotationSpinBox.setObjectName("uiRotationSpinBox") - self.formLayout.setWidget(5, QtWidgets.QFormLayout.FieldRole, self.uiRotationSpinBox) + self.formLayout.setWidget(7, QtWidgets.QFormLayout.FieldRole, self.uiRotationSpinBox) self.uiCornerRadiusLabel = QtWidgets.QLabel(self.uiStyleSettingsGroupBox) self.uiCornerRadiusLabel.setObjectName("uiCornerRadiusLabel") - self.formLayout.setWidget(4, QtWidgets.QFormLayout.LabelRole, self.uiCornerRadiusLabel) + self.formLayout.setWidget(6, QtWidgets.QFormLayout.LabelRole, self.uiCornerRadiusLabel) self.uiCornerRadiusSpinBox = QtWidgets.QSpinBox(self.uiStyleSettingsGroupBox) self.uiCornerRadiusSpinBox.setMaximum(100) self.uiCornerRadiusSpinBox.setObjectName("uiCornerRadiusSpinBox") - self.formLayout.setWidget(4, QtWidgets.QFormLayout.FieldRole, self.uiCornerRadiusSpinBox) + self.formLayout.setWidget(6, QtWidgets.QFormLayout.FieldRole, self.uiCornerRadiusSpinBox) + self.uiWidthLabel = QtWidgets.QLabel(self.uiStyleSettingsGroupBox) + self.uiWidthLabel.setObjectName("uiWidthLabel") + self.formLayout.setWidget(4, QtWidgets.QFormLayout.LabelRole, self.uiWidthLabel) + self.uiWidthSpinBox = QtWidgets.QSpinBox(self.uiStyleSettingsGroupBox) + self.uiWidthSpinBox.setMinimum(10) + self.uiWidthSpinBox.setMaximum(1000) + self.uiWidthSpinBox.setObjectName("uiWidthSpinBox") + self.formLayout.setWidget(4, QtWidgets.QFormLayout.FieldRole, self.uiWidthSpinBox) + self.uiHeightLabel = QtWidgets.QLabel(self.uiStyleSettingsGroupBox) + self.uiHeightLabel.setObjectName("uiHeightLabel") + self.formLayout.setWidget(5, QtWidgets.QFormLayout.LabelRole, self.uiHeightLabel) + self.uiHeightSpinBox = QtWidgets.QSpinBox(self.uiStyleSettingsGroupBox) + self.uiHeightSpinBox.setMinimum(10) + self.uiHeightSpinBox.setMaximum(1000) + self.uiHeightSpinBox.setObjectName("uiHeightSpinBox") + self.formLayout.setWidget(5, QtWidgets.QFormLayout.FieldRole, self.uiHeightSpinBox) self.verticalLayout.addWidget(self.uiStyleSettingsGroupBox) self.uiButtonBox = QtWidgets.QDialogButtonBox(StyleEditorDialog) self.uiButtonBox.setOrientation(QtCore.Qt.Horizontal) @@ -100,4 +116,8 @@ def retranslateUi(self, StyleEditorDialog): self.uiRotationSpinBox.setSuffix(_translate("StyleEditorDialog", "°")) self.uiCornerRadiusLabel.setText(_translate("StyleEditorDialog", "Corner radius:")) self.uiCornerRadiusSpinBox.setSuffix(_translate("StyleEditorDialog", "°")) + self.uiWidthLabel.setText(_translate("StyleEditorDialog", "Width:")) + self.uiWidthSpinBox.setSuffix(_translate("StyleEditorDialog", " px")) + self.uiHeightLabel.setText(_translate("StyleEditorDialog", "Height:")) + self.uiHeightSpinBox.setSuffix(_translate("StyleEditorDialog", " px")) from . import resources_rc diff --git a/gns3/version.py b/gns3/version.py index b8c19a66e..56fc56cd3 100644 --- a/gns3/version.py +++ b/gns3/version.py @@ -23,9 +23,9 @@ # or negative for a release candidate or beta (after the base version # number has been incremented) -__version__ = "2.2.43" +__version__ = "2.2.44.dev1" -__version_info__ = (2, 2, 43, 0) +__version_info__ = (2, 2, 44, 99) if "dev" in __version__: try: diff --git a/mac-requirements.txt b/mac-requirements.txt index c0f718542..fa6d90645 100644 --- a/mac-requirements.txt +++ b/mac-requirements.txt @@ -1,3 +1,5 @@ -rrequirements.txt +PyQt5-Qt5==5.15.2 +PyQt5-sip==12.12.2 PyQt5==5.15.9 diff --git a/requirements.txt b/requirements.txt index 345b56fa7..5f5f1e58a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,9 +1,9 @@ jsonschema>=4.17.3,<4.18; python_version >= '3.7' # v4.17.3 is the last version to support Python 3.7 jsonschema==3.2.0; python_version < '3.7' # v3.2.0 is the last version to support Python 3.6 -sentry-sdk==1.31.0,<1.32 -psutil==5.9.5 +sentry-sdk==1.32.0,<1.33 +psutil==5.9.6 distro>=1.8.0 truststore>=0.8.0; python_version >= '3.10' -importlib-resources>=1.3; python_version <= '3.9' +importlib-resources>=1.3; python_version < '3.9' setuptools>=60.8.1; python_version >= '3.7' setuptools==59.6.0; python_version < '3.7' # v59.6.0 is the last version to support Python 3.6 diff --git a/setup.py b/setup.py index 82fe3b7a4..da8b2e99b 100644 --- a/setup.py +++ b/setup.py @@ -101,6 +101,7 @@ def run_tests(self): "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Programming Language :: Python :: Implementation :: CPython", ], ) diff --git a/win-requirements.txt b/win-requirements.txt index 4af4a9fc5..1caf5da9c 100644 --- a/win-requirements.txt +++ b/win-requirements.txt @@ -1,4 +1,4 @@ -rrequirements.txt -PyQt5==5.15.9 # pyup: ignore +PyQt5==5.15.10 # pyup: ignore pywin32==306 # pyup: ignore