Skip to content

Commit da28527

Browse files
committed
Merge remote-tracking branch 'origin/2.2' into 3.0
# Conflicts: # dev-requirements.txt # setup.py
2 parents 6468151 + 4743256 commit da28527

File tree

13 files changed

+96
-43
lines changed

13 files changed

+96
-43
lines changed

.github/workflows/add-new-issues-to-project.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
name: Add issue to project
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/add-to-project@v0.4.0
13+
- uses: actions/add-to-project@v1.0.1
1414
with:
1515
project-url: https://github.com/orgs/GNS3/projects/3
1616
github-token: ${{ secrets.ADD_NEW_ISSUES_TO_PROJECT }}

.github/workflows/codeql.yml

Lines changed: 45 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -15,62 +15,79 @@ on:
1515
push:
1616
branches: [ "master" ]
1717
pull_request:
18-
# The branches below must be a subset of the branches above
1918
branches: [ "master" ]
2019
schedule:
21-
- cron: '27 6 * * 2'
20+
- cron: '17 22 * * 6'
2221

2322
jobs:
2423
analyze:
25-
name: Analyze
26-
runs-on: ubuntu-latest
24+
name: Analyze (${{ matrix.language }})
25+
# Runner size impacts CodeQL analysis time. To learn more, please see:
26+
# - https://gh.io/recommended-hardware-resources-for-running-codeql
27+
# - https://gh.io/supported-runners-and-hardware-resources
28+
# - https://gh.io/using-larger-runners (GitHub.com only)
29+
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
30+
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
31+
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
2732
permissions:
33+
# required for all workflows
34+
security-events: write
35+
36+
# required to fetch internal or private CodeQL packs
37+
packages: read
38+
39+
# only required for workflows in private repositories
2840
actions: read
2941
contents: read
30-
security-events: write
3142

3243
strategy:
3344
fail-fast: false
3445
matrix:
35-
language: [ 'python' ]
36-
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
37-
# Use only 'java' to analyze code written in Java, Kotlin or both
38-
# Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
39-
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
40-
46+
include:
47+
- language: python
48+
build-mode: none
49+
# CodeQL supports the following values keywords for 'language': 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
50+
# Use `c-cpp` to analyze code written in C, C++ or both
51+
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
52+
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
53+
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
54+
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
55+
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
56+
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
4157
steps:
4258
- name: Checkout repository
43-
uses: actions/checkout@v3
59+
uses: actions/checkout@v4
4460

4561
# Initializes the CodeQL tools for scanning.
4662
- name: Initialize CodeQL
47-
uses: github/codeql-action/init@v2
63+
uses: github/codeql-action/init@v3
4864
with:
4965
languages: ${{ matrix.language }}
66+
build-mode: ${{ matrix.build-mode }}
5067
# If you wish to specify custom queries, you can do so here or in a config file.
5168
# By default, queries listed here will override any specified in a config file.
5269
# Prefix the list here with "+" to use these queries and those in the config file.
5370

54-
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
71+
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
5572
# queries: security-extended,security-and-quality
5673

57-
58-
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
59-
# If this step fails, then you should remove it and run the build manually (see below)
60-
- name: Autobuild
61-
uses: github/codeql-action/autobuild@v2
62-
74+
# If the analyze step fails for one of the languages you are analyzing with
75+
# "We were unable to automatically build your code", modify the matrix above
76+
# to set the build mode to "manual" for that language. Then modify this step
77+
# to build your code.
6378
# ℹ️ Command-line programs to run using the OS shell.
6479
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
65-
66-
# If the Autobuild fails above, remove it and uncomment the following three lines.
67-
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
68-
69-
# - run: |
70-
# echo "Run, Build Application using script"
71-
# ./location_of_script_within_repo/buildscript.sh
80+
- if: matrix.build-mode == 'manual'
81+
shell: bash
82+
run: |
83+
echo 'If you are using a "manual" build mode for one or more of the' \
84+
'languages you are analyzing, replace this with the commands to build' \
85+
'your code, for example:'
86+
echo ' make bootstrap'
87+
echo ' make release'
88+
exit 1
7289
7390
- name: Perform CodeQL Analysis
74-
uses: github/codeql-action/analyze@v2
91+
uses: github/codeql-action/analyze@v3
7592
with:
7693
category: "/language:${{matrix.language}}"

.github/workflows/testing.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
runs-on: ubuntu-latest
1313

1414
steps:
15-
- uses: actions/checkout@v3
15+
- uses: actions/checkout@v4
1616
- name: Build and run Docker image
1717
run: |
1818
docker build -t gns3-gui-test .

Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
# Run tests inside a container
2-
FROM ubuntu:18.04
2+
FROM ubuntu:latest
33
MAINTAINER GNS3 Team
44

55
RUN apt-get update
6-
RUN apt-get install -y --force-yes python3.6 python3-pyqt5 python3-pip python3-pyqt5.qtsvg python3-pyqt5.qtwebsockets python3.6-dev xvfb
6+
RUN apt-get install -y --force-yes python3 python3-pyqt5 python3-pip python3-pyqt5.qtsvg python3-pyqt5.qtwebsockets python3-dev xvfb
77
RUN apt-get clean
88

99
ADD dev-requirements.txt /dev-requirements.txt
1010
ADD requirements.txt /requirements.txt
11-
RUN pip3 install --no-cache-dir -r /dev-requirements.txt
11+
RUN python3 -m pip install --break-system-packages --no-cache-dir -r /dev-requirements.txt
1212

1313
ADD . /src
1414
WORKDIR /src
1515

16-
CMD xvfb-run python3.6 -m pytest -vv
16+
CMD xvfb-run python3 -m pytest -vv

dev-requirements.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
pytest==8.1.1
2-
flake8==5.0.4 # v5.0.4 is the last to support Python 3.7
1+
pytest==8.3.2
32
pytest-timeout==2.3.1

gns3/main_window.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,7 @@ def _connections(self):
287287
self.uiExportDebugInformationAction.triggered.connect(self._exportDebugInformationSlot)
288288
self.uiDoctorAction.triggered.connect(self._doctorSlot)
289289
self.uiAcademyAction.triggered.connect(self._academyActionSlot)
290+
self.uiShortcutsAction.triggered.connect(self._shortcutsActionSlot)
290291

291292
# browsers tool bar connections
292293
self.uiBrowseRoutersAction.triggered.connect(self._browseRoutersActionSlot)
@@ -1007,6 +1008,15 @@ def _setupWizardActionSlot(self):
10071008
setup_wizard.show()
10081009
setup_wizard.exec_()
10091010

1011+
def _shortcutsActionSlot(self):
1012+
1013+
shortcuts_text = ""
1014+
for action in self.findChildren(QtWidgets.QAction):
1015+
shortcut = action.shortcut().toString()
1016+
if shortcut:
1017+
shortcuts_text += f"{action.toolTip()}: {shortcut}\n"
1018+
QtWidgets.QMessageBox.information(self, "Shortcuts", shortcuts_text)
1019+
10101020
def _aboutQtActionSlot(self):
10111021
"""
10121022
Slot to display the Qt About dialog.

gns3/schemas/appliance_v8.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"enum": [
88
"router",
99
"multilayer_switch",
10+
"switch",
1011
"firewall",
1112
"guest"
1213
]

gns3/ui/main_window.ui

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ background-none;
113113
<addaction name="uiAcademyAction"/>
114114
<addaction name="uiDoctorAction"/>
115115
<addaction name="uiExportDebugInformationAction"/>
116+
<addaction name="uiShortcutsAction"/>
116117
<addaction name="uiAboutQtAction"/>
117118
<addaction name="uiAboutAction"/>
118119
</widget>
@@ -646,6 +647,9 @@ background-none;
646647
<property name="statusTip">
647648
<string>Start/Resume all devices</string>
648649
</property>
650+
<property name="shortcut">
651+
<string>Ctrl+B</string>
652+
</property>
649653
</action>
650654
<action name="uiStopAllAction">
651655
<property name="enabled">
@@ -665,6 +669,9 @@ background-none;
665669
<property name="statusTip">
666670
<string>Stop all devices</string>
667671
</property>
672+
<property name="shortcut">
673+
<string>Ctrl+E</string>
674+
</property>
668675
</action>
669676
<action name="uiConsoleAllAction">
670677
<property name="enabled">
@@ -799,6 +806,9 @@ background-none;
799806
<property name="statusTip">
800807
<string>Suspend all devices</string>
801808
</property>
809+
<property name="shortcut">
810+
<string>Ctrl+J</string>
811+
</property>
802812
</action>
803813
<action name="uiAddNoteAction">
804814
<property name="checkable">
@@ -1149,6 +1159,9 @@ background-none;
11491159
<property name="text">
11501160
<string>Fit in view</string>
11511161
</property>
1162+
<property name="shortcut">
1163+
<string>Ctrl+1</string>
1164+
</property>
11521165
</action>
11531166
<action name="uiActionFullscreen">
11541167
<property name="text">
@@ -1334,6 +1347,11 @@ background-none;
13341347
<string>Reset GUI state</string>
13351348
</property>
13361349
</action>
1350+
<action name="uiShortcutsAction">
1351+
<property name="text">
1352+
<string>&amp;Shortcuts</string>
1353+
</property>
1354+
</action>
13371355
</widget>
13381356
<customwidgets>
13391357
<customwidget>

gns3/ui/main_window_ui.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# Form implementation generated from reading ui file '/home/grossmj/PycharmProjects/gns3-gui/gns3/ui/main_window.ui'
44
#
5-
# Created by: PyQt5 UI code generator 5.15.9
5+
# Created by: PyQt5 UI code generator 5.15.10
66
#
77
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
88
# run again. Do not edit this file unless you know what you are doing.
@@ -463,6 +463,8 @@ def setupUi(self, MainWindow):
463463
self.uiResetConsoleAllAction.setObjectName("uiResetConsoleAllAction")
464464
self.uiResetGUIStateAction = QtWidgets.QAction(MainWindow)
465465
self.uiResetGUIStateAction.setObjectName("uiResetGUIStateAction")
466+
self.uiShortcutsAction = QtWidgets.QAction(MainWindow)
467+
self.uiShortcutsAction.setObjectName("uiShortcutsAction")
466468
self.uiEditMenu.addAction(self.uiSelectAllAction)
467469
self.uiEditMenu.addAction(self.uiSelectNoneAction)
468470
self.uiEditMenu.addSeparator()
@@ -488,6 +490,7 @@ def setupUi(self, MainWindow):
488490
self.uiHelpMenu.addAction(self.uiAcademyAction)
489491
self.uiHelpMenu.addAction(self.uiDoctorAction)
490492
self.uiHelpMenu.addAction(self.uiExportDebugInformationAction)
493+
self.uiHelpMenu.addAction(self.uiShortcutsAction)
491494
self.uiHelpMenu.addAction(self.uiAboutQtAction)
492495
self.uiHelpMenu.addAction(self.uiAboutAction)
493496
self.uiViewMenu.addAction(self.uiActionFullscreen)
@@ -614,9 +617,11 @@ def retranslateUi(self, MainWindow):
614617
self.uiStartAllAction.setText(_translate("MainWindow", "Start/Resume all nodes"))
615618
self.uiStartAllAction.setToolTip(_translate("MainWindow", "Start/Resume all nodes"))
616619
self.uiStartAllAction.setStatusTip(_translate("MainWindow", "Start/Resume all devices"))
620+
self.uiStartAllAction.setShortcut(_translate("MainWindow", "Ctrl+B"))
617621
self.uiStopAllAction.setText(_translate("MainWindow", "Stop all nodes"))
618622
self.uiStopAllAction.setToolTip(_translate("MainWindow", "Stop all nodes"))
619623
self.uiStopAllAction.setStatusTip(_translate("MainWindow", "Stop all devices"))
624+
self.uiStopAllAction.setShortcut(_translate("MainWindow", "Ctrl+E"))
620625
self.uiConsoleAllAction.setText(_translate("MainWindow", "Console connect to all nodes"))
621626
self.uiConsoleAllAction.setToolTip(_translate("MainWindow", "Console connect to all nodes"))
622627
self.uiConsoleAllAction.setStatusTip(_translate("MainWindow", "Console to all devices"))
@@ -645,6 +650,7 @@ def retranslateUi(self, MainWindow):
645650
self.uiSuspendAllAction.setText(_translate("MainWindow", "Suspend all nodes"))
646651
self.uiSuspendAllAction.setToolTip(_translate("MainWindow", "Suspend all nodes"))
647652
self.uiSuspendAllAction.setStatusTip(_translate("MainWindow", "Suspend all devices"))
653+
self.uiSuspendAllAction.setShortcut(_translate("MainWindow", "Ctrl+J"))
648654
self.uiAddNoteAction.setText(_translate("MainWindow", "Add note"))
649655
self.uiAddNoteAction.setToolTip(_translate("MainWindow", "Add a note"))
650656
self.uiAddNoteAction.setStatusTip(_translate("MainWindow", "Add a note"))
@@ -712,6 +718,7 @@ def retranslateUi(self, MainWindow):
712718
self.uiAddLinkAction.setToolTip(_translate("MainWindow", "Add a link"))
713719
self.uiAddLinkAction.setStatusTip(_translate("MainWindow", "Add a link"))
714720
self.uiFitInViewAction.setText(_translate("MainWindow", "Fit in view"))
721+
self.uiFitInViewAction.setShortcut(_translate("MainWindow", "Ctrl+1"))
715722
self.uiActionFullscreen.setText(_translate("MainWindow", "Fullscreen"))
716723
self.uiActionFullscreen.setShortcut(_translate("MainWindow", "Ctrl+F"))
717724
self.uiSetupWizard.setText(_translate("MainWindow", "&Setup Wizard"))
@@ -738,6 +745,7 @@ def retranslateUi(self, MainWindow):
738745
self.uiResetDocksAction.setText(_translate("MainWindow", "Reset docks"))
739746
self.uiResetConsoleAllAction.setText(_translate("MainWindow", "Reset all console connections"))
740747
self.uiResetGUIStateAction.setText(_translate("MainWindow", "Reset GUI state"))
748+
self.uiShortcutsAction.setText(_translate("MainWindow", "&Shortcuts"))
741749
from ..compute_summary_view import ComputeSummaryView
742750
from ..console_view import ConsoleView
743751
from ..graphics_view import GraphicsView

mac-requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
-r requirements.txt
22

3-
PyQt5==5.15.10
3+
PyQt5==5.15.11

0 commit comments

Comments
 (0)