mirror of
https://github.com/GNS3/gns3-gui.git
synced 2026-05-30 15:30:31 +03:00
Compare commits
355 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f90267b4f0 | ||
|
|
8f16706a22 | ||
|
|
2d3ee3abf9 | ||
|
|
b8b209fa55 | ||
|
|
18129e3d29 | ||
|
|
7a2b9c024f | ||
|
|
4923a6dc17 | ||
|
|
73dfc047aa | ||
|
|
fe0a70c4be | ||
|
|
f14cb43404 | ||
|
|
f8517ee5ac | ||
|
|
7dc607b4c5 | ||
|
|
882fa76550 | ||
|
|
1490a1ad8f | ||
|
|
aab0c99cc6 | ||
|
|
a6a987d74c | ||
|
|
9c58b18c20 | ||
|
|
8bc499c68f | ||
|
|
bd5eb288b7 | ||
|
|
465a289568 | ||
|
|
d240ba3056 | ||
|
|
3cedfd3649 | ||
|
|
276d7abdd9 | ||
|
|
927e38bd6d | ||
|
|
376cc29995 | ||
|
|
1f8ebeb084 | ||
|
|
0212755c78 | ||
|
|
2f7d75eae9 | ||
|
|
fc1c060922 | ||
|
|
0ea72ce782 | ||
|
|
3de2d2eda2 | ||
|
|
c08262f8af | ||
|
|
9ae70bf2fe | ||
|
|
fa6d250602 | ||
|
|
0668840a2b | ||
|
|
8b25d1b06c | ||
|
|
58c3ba0755 | ||
|
|
5a91c9aaf8 | ||
|
|
0fc3f4ef16 | ||
|
|
f0e5cd2ba2 | ||
|
|
f59ef6378a | ||
|
|
61ef08d1b7 | ||
|
|
e812c000fd | ||
|
|
d3d9e1e8ae | ||
|
|
05f8df345a | ||
|
|
4b0cc11cab | ||
|
|
b5285cd142 | ||
|
|
69482343ba | ||
|
|
d4639c2e61 | ||
|
|
b85ade9dd7 | ||
|
|
e191cb8aa3 | ||
|
|
e6bc75ce26 | ||
|
|
bc1df346f2 | ||
|
|
27c35321f0 | ||
|
|
3e212fc629 | ||
|
|
25e41dc0f1 | ||
|
|
c58c7774c4 | ||
|
|
bd2bc8265c | ||
|
|
f2209a2780 | ||
|
|
7b99ba325b | ||
|
|
74763287fb | ||
|
|
737ff42d64 | ||
|
|
5656bd2d48 | ||
|
|
058c069394 | ||
|
|
926ec48d00 | ||
|
|
410e5353b2 | ||
|
|
bfb90406ed | ||
|
|
439cdce287 | ||
|
|
4e50c2a4b1 | ||
|
|
94c636ae61 | ||
|
|
f53b9a266e | ||
|
|
2476448032 | ||
|
|
a34cd742e3 | ||
|
|
39698196ac | ||
|
|
61432ced4f | ||
|
|
2ddd13c445 | ||
|
|
af6c4c5b3e | ||
|
|
d4012294bf | ||
|
|
4b04b0e855 | ||
|
|
1bec5019bf | ||
|
|
ec6b876baa | ||
|
|
7cee0d01ab | ||
|
|
dd3314d06b | ||
|
|
9c58b26265 | ||
|
|
83c26f47da | ||
|
|
8ed2f55600 | ||
|
|
b435317904 | ||
|
|
acb8aa8ca2 | ||
|
|
c55d6b8a6f | ||
|
|
a4039a254e | ||
|
|
85ed4b3026 | ||
|
|
5207a99692 | ||
|
|
d69527995d | ||
|
|
4b000ba2f7 | ||
|
|
1b302b77a0 | ||
|
|
a5b5c404ec | ||
|
|
6b97b0c6cd | ||
|
|
115dd43eee | ||
|
|
2530bf97a8 | ||
|
|
9892fd0654 | ||
|
|
c71ee73da8 | ||
|
|
0643fd516d | ||
|
|
a25680f2ce | ||
|
|
58bd5be920 | ||
|
|
d95633ba2c | ||
|
|
dfea6d1723 | ||
|
|
ddeb95cb0a | ||
|
|
5f7ff0d70d | ||
|
|
a00e039cec | ||
|
|
a24e9adef1 | ||
|
|
ee5f8e8edd | ||
|
|
f5470130f5 | ||
|
|
1ff405885e | ||
|
|
9fb42ead9f | ||
|
|
2ea1946c0f | ||
|
|
963e054918 | ||
|
|
0f5f6ab645 | ||
|
|
8a905b5c39 | ||
|
|
e917193f06 | ||
|
|
16846ce49c | ||
|
|
624a670ae7 | ||
|
|
406326ccd8 | ||
|
|
24bc15fb73 | ||
|
|
348d8b9438 | ||
|
|
6787982408 | ||
|
|
c2384917fa | ||
|
|
b80178d0cf | ||
|
|
e6084ed834 | ||
|
|
ba924cd0d9 | ||
|
|
0c3d43346f | ||
|
|
fcf6ef3027 | ||
|
|
e0f87e573d | ||
|
|
3ec068f0cb | ||
|
|
37f1fcf6f7 | ||
|
|
c51dd1605d | ||
|
|
4ebf3b4e1c | ||
|
|
b1ec9d535c | ||
|
|
7fc9087cf0 | ||
|
|
5dc2c77806 | ||
|
|
4972d460d2 | ||
|
|
c388836be7 | ||
|
|
18ae4a6ce9 | ||
|
|
3020e1fc9f | ||
|
|
fe2f8424db | ||
|
|
a744f65199 | ||
|
|
d27578f0fc | ||
|
|
b01c11f19b | ||
|
|
fb269da4d3 | ||
|
|
ab15f96bb5 | ||
|
|
5bb8b8e8bd | ||
|
|
3f9632fae0 | ||
|
|
b5f8195abb | ||
|
|
73a293bd17 | ||
|
|
0a1dfb99e9 | ||
|
|
d352919264 | ||
|
|
65f2a1e461 | ||
|
|
71f289721b | ||
|
|
c28089d400 | ||
|
|
64f009bf71 | ||
|
|
edb2fd7fd9 | ||
|
|
62e7ad8c8a | ||
|
|
caeb5d71c3 | ||
|
|
cfe96b2311 | ||
|
|
8955b9ee29 | ||
|
|
e727abf27a | ||
|
|
f209bf7644 | ||
|
|
5860dedc32 | ||
|
|
9e2df17a4e | ||
|
|
a95761437a | ||
|
|
626510865f | ||
|
|
2e248aa340 | ||
|
|
e306f73f01 | ||
|
|
0c4367d77e | ||
|
|
6dda0ff787 | ||
|
|
d7d4b84309 | ||
|
|
7b57983699 | ||
|
|
bb89fe2275 | ||
|
|
7eb2a923b2 | ||
|
|
58052e3cce | ||
|
|
e431104f6b | ||
|
|
a4e9d6b8ce | ||
|
|
f58f5c7b95 | ||
|
|
37faa39309 | ||
|
|
4d64598ed2 | ||
|
|
5132c4e172 | ||
|
|
3c3fdd9ffd | ||
|
|
efa50571c6 | ||
|
|
ca9b10fcca | ||
|
|
8660161b10 | ||
|
|
50ebfb9c06 | ||
|
|
26df59d6b6 | ||
|
|
b903e2ad73 | ||
|
|
b2fe7eb643 | ||
|
|
8095fef228 | ||
|
|
b8da5440f5 | ||
|
|
6cea094e4e | ||
|
|
9ac46c9d50 | ||
|
|
c8a8663ff0 | ||
|
|
d27e5c1795 | ||
|
|
0d2f91709c | ||
|
|
6dc44d5108 | ||
|
|
9c6be0341b | ||
|
|
011a49e998 | ||
|
|
e18c2df5f5 | ||
|
|
1794b8389f | ||
|
|
0379c370eb | ||
|
|
e03550a89b | ||
|
|
c6ea775e81 | ||
|
|
38233ba5e9 | ||
|
|
89c1272bc1 | ||
|
|
8bbb46c599 | ||
|
|
74fca3d736 | ||
|
|
7aeed7aa59 | ||
|
|
aa15ace887 | ||
|
|
2d0a7b5f58 | ||
|
|
20a09b56c1 | ||
|
|
1938cdabae | ||
|
|
8d1bff782c | ||
|
|
4e3eee2383 | ||
|
|
da8aa0d2fd | ||
|
|
5b4481c43a | ||
|
|
593cb8c1fd | ||
|
|
210cf63fe2 | ||
|
|
3b178013c0 | ||
|
|
6e44d6b919 | ||
|
|
6b520b8036 | ||
|
|
803782b9d8 | ||
|
|
d3d6ca3f2e | ||
|
|
f545c793f8 | ||
|
|
47d6a4fef6 | ||
|
|
8862b608cf | ||
|
|
76832ab83f | ||
|
|
fed245fd34 | ||
|
|
3e0f1affd0 | ||
|
|
2110c2805e | ||
|
|
46cfdd8314 | ||
|
|
f8f648c2b6 | ||
|
|
7cd0187f33 | ||
|
|
4d8f362f11 | ||
|
|
469eaa4737 | ||
|
|
c921224b30 | ||
|
|
61487b2e2f | ||
|
|
9affca495e | ||
|
|
9d8886a640 | ||
|
|
98cfec1b77 | ||
|
|
aed174953e | ||
|
|
f0feea8262 | ||
|
|
e2aeaf0a78 | ||
|
|
b92bb94875 | ||
|
|
c56db59353 | ||
|
|
a87c4e21d7 | ||
|
|
ed99a989d7 | ||
|
|
f9a4c9399a | ||
|
|
efb5c8ca9a | ||
|
|
0946dff3a0 | ||
|
|
d7d96b10e5 | ||
|
|
0c0b2d5cb3 | ||
|
|
450fbc9af3 | ||
|
|
469ee8fab8 | ||
|
|
6ccfcaf76e | ||
|
|
520e857874 | ||
|
|
012c7b4241 | ||
|
|
1d71cd5bf0 | ||
|
|
17d1a7f4ed | ||
|
|
0cd5c08c6b | ||
|
|
20ac503fe9 | ||
|
|
5f737c2c7c | ||
|
|
eb1a37be36 | ||
|
|
07c64b5432 | ||
|
|
ce981d1c49 | ||
|
|
32a9f2556e | ||
|
|
7f08675121 | ||
|
|
1dc3c13df2 | ||
|
|
6a6e86b325 | ||
|
|
d96277882a | ||
|
|
ecec917752 | ||
|
|
ea9c1a8ee1 | ||
|
|
cfbb09fb57 | ||
|
|
dc8aa1fb92 | ||
|
|
786cc8aa65 | ||
|
|
4a353e08e3 | ||
|
|
1371921586 | ||
|
|
cd8696a714 | ||
|
|
17799719d6 | ||
|
|
2a59013604 | ||
|
|
1c46299dd9 | ||
|
|
628d7cb909 | ||
|
|
b23c92c0fb | ||
|
|
49ce5a9f38 | ||
|
|
4575ea9f6d | ||
|
|
fd6a00df6a | ||
|
|
58ab4b424a | ||
|
|
1ea1abf582 | ||
|
|
e8caab74f4 | ||
|
|
9fce393fd1 | ||
|
|
827c11ae97 | ||
|
|
eb370d5672 | ||
|
|
7732aaf9a5 | ||
|
|
63161eb760 | ||
|
|
5dba814d1b | ||
|
|
aecdc71f3a | ||
|
|
3209c1d0e6 | ||
|
|
2b3fb53ef2 | ||
|
|
cbbbece0e5 | ||
|
|
56d742b19f | ||
|
|
1f566a31cf | ||
|
|
10d75e15da | ||
|
|
17def7e00a | ||
|
|
106afd0987 | ||
|
|
bba9c5e1d8 | ||
|
|
ae8e8013d4 | ||
|
|
3a5f1d60f9 | ||
|
|
3f6eb61382 | ||
|
|
32bfff381d | ||
|
|
f68a8ea829 | ||
|
|
50066b2f12 | ||
|
|
21a99d4376 | ||
|
|
f97d3041b8 | ||
|
|
31d6a065b0 | ||
|
|
20bf63dbbf | ||
|
|
1c3e0ef640 | ||
|
|
5b58d3ab6d | ||
|
|
554c9205f3 | ||
|
|
543a8e7c33 | ||
|
|
69ef35c674 | ||
|
|
45102a07b6 | ||
|
|
f0b8b22e8a | ||
|
|
d94f5a2d8c | ||
|
|
a768661c05 | ||
|
|
4657b005b6 | ||
|
|
e71da830b0 | ||
|
|
ebf2563200 | ||
|
|
e8eaa00244 | ||
|
|
d750e7a427 | ||
|
|
bfc8adc904 | ||
|
|
4de38ea590 | ||
|
|
cc0c6d0a7a | ||
|
|
d1d0810233 | ||
|
|
ee3c758bb7 | ||
|
|
8f077456b1 | ||
|
|
a29f3e35c0 | ||
|
|
b12cb5c939 | ||
|
|
ba646f5efa | ||
|
|
edafc29cdc | ||
|
|
5aa67d18c0 | ||
|
|
8067aaadd4 | ||
|
|
a9a2a541c0 | ||
|
|
8998c07e0e | ||
|
|
ba01a89af1 | ||
|
|
eae07d62ad | ||
|
|
23903cf0c9 | ||
|
|
4d908fd855 | ||
|
|
bb0e67be4f | ||
|
|
0410c446fc | ||
|
|
18486e4772 |
34
.github/ISSUE_TEMPLATE/gns3-bug-report.md
vendored
Normal file
34
.github/ISSUE_TEMPLATE/gns3-bug-report.md
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
---
|
||||
name: GNS3 bug report
|
||||
about: Create a report to help us fix a bug
|
||||
title: 'Short description of the bug'
|
||||
labels: Bug
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Before you start**
|
||||
Please open an issue only if you suspect there is a bug or any problem with GNS3. Go to https://gns3.com/community for any other questions or for requesting help with GNS3.
|
||||
|
||||
You may also post this issue directly on the GNS3 server repository if you know the bug comes from the server: https://github.com/GNS3/gns3-server/issues/new
|
||||
|
||||
**Describe the bug**
|
||||
Please provide a clear and detailed description of what the bug is.
|
||||
|
||||
**GNS3 version and operating system (please complete the following information):**
|
||||
- OS: [e.g. Windows, Linux or macOS]
|
||||
- GNS3 version [e.g. 2.1.14]
|
||||
- Any use of the GNS3 VM or remote server (ESXi, bare metal etc.)
|
||||
|
||||
**To Reproduce**
|
||||
Steps to reproduce the behavior:
|
||||
1. Go to '...'
|
||||
2. Click on '....'
|
||||
3. Scroll down to '....'
|
||||
4. See error
|
||||
|
||||
**Screenshots or videos**
|
||||
If applicable, add screenshots (e.g. of the topology and/or error message) or links to videos to help explain the problem. This will help us a lot to quickly find the bug and fix it.
|
||||
|
||||
**Additional context**
|
||||
Add any other context about the problem here.
|
||||
10
.github/ISSUE_TEMPLATE/gns3-development.md
vendored
Normal file
10
.github/ISSUE_TEMPLATE/gns3-development.md
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
---
|
||||
name: GNS3 development
|
||||
about: Any question or discussion regarding GNS3 development
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
|
||||
25
.github/ISSUE_TEMPLATE/gns3-feature-request.md
vendored
Normal file
25
.github/ISSUE_TEMPLATE/gns3-feature-request.md
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
---
|
||||
name: GNS3 feature request
|
||||
about: Suggest an idea for GNS3
|
||||
title: 'Short description of the feature request'
|
||||
labels: Enhancement
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Before you start**
|
||||
Please check if a similar feature request has already been submitted.
|
||||
|
||||
You may also post this issue directly on the GNS3 server repository if you know the feature request only applies to the server: https://github.com/GNS3/gns3-server/issues/new
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||
|
||||
**Describe the solution you'd like**
|
||||
A clear and concise description of what you want to happen. If applicable, please provide screenshots
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
A clear and concise description of any alternative solutions or features you've considered.
|
||||
|
||||
**Additional context**
|
||||
Add any other context or screenshots about the feature request here.
|
||||
19
.github/workflows/testing.yml
vendored
Normal file
19
.github/workflows/testing.yml
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
name: testing
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Build and run Docker image
|
||||
run: |
|
||||
docker build -t gns3-gui-test .
|
||||
docker run gns3-gui-test
|
||||
21
.travis.yml
21
.travis.yml
@@ -1,21 +0,0 @@
|
||||
sudo: required
|
||||
services:
|
||||
- docker
|
||||
notifications:
|
||||
email: false
|
||||
script:
|
||||
- docker build -t gns3-gui-test .
|
||||
- docker run gns3-gui-test
|
||||
before_deploy:
|
||||
- sudo pip install twine
|
||||
- sudo pip install urllib3[secure]
|
||||
deploy:
|
||||
provider: pypi
|
||||
edge:
|
||||
branch: v1.8.45
|
||||
user: noplay
|
||||
password:
|
||||
secure: FofcqlJjgqf2jaDaXpLHeigVoexbrOz3WwnDuiJpwJxeFUlPY8s2cQs/Bm+dzxzZaOaGiVE0A83v/Xa10yD5tflThHt4sqYJK3iQCinA7wgeAlDimB4xrWUNplfNJZ/Eod5Ssa++E02W+3i29PxpXY//mjCY7qDxaoxul1gnFJY=
|
||||
on:
|
||||
tags: true
|
||||
repo: GNS3/gns3-gui
|
||||
13
.whitesource
Normal file
13
.whitesource
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"scanSettings": {
|
||||
"configMode": "AUTO",
|
||||
"configExternalURL": "",
|
||||
"projectToken" : ""
|
||||
},
|
||||
"checkRunSettings": {
|
||||
"vulnerableCheckRunConclusionLevel": "failure"
|
||||
},
|
||||
"issueSettings": {
|
||||
"minSeverityLevel": "LOW"
|
||||
}
|
||||
}
|
||||
294
CHANGELOG
294
CHANGELOG
@@ -1,5 +1,299 @@
|
||||
# Change Log
|
||||
|
||||
## 2.2.20 09/04/2021
|
||||
|
||||
* Fix project does not load anymore. Fixes #3140
|
||||
* Do not connect to server while waiting for user to accept/reject SSL certificate. Fixes #3144
|
||||
* Fix invalid server version check request. Fixes #3144
|
||||
* Upgrade dependencies
|
||||
* Add terminator as a predefined custom console option
|
||||
|
||||
## 2.2.19 05/03/2021
|
||||
|
||||
* No changes
|
||||
|
||||
## 2.2.18 16/02/2021
|
||||
|
||||
* SSL support.
|
||||
* Remove the useless file "zoom-in (copy).svg". Fixes #3114
|
||||
* Use HDD disk image as startup QEMU config disk
|
||||
* Edit only text mode config files
|
||||
* Hide config import/export when configFiles attribute is empty
|
||||
* Qemu disk interfaces must be set to "none" by default. Ref #3035
|
||||
* Do not allow image to be configured on Qemu VM secondary slave disk if create config disk option is enabled.
|
||||
* Add explicit option to automatically create or not the config disk. Off by default.
|
||||
* QEMU config disk support
|
||||
|
||||
## 2.2.17 04/12/2020
|
||||
|
||||
* Remove "-nographic" option by default for Qemu VM. Fixes #3094
|
||||
* Fix app cannot start on macOS Big Sur. Ref #3037
|
||||
* Require confirmation before stopping all devices.
|
||||
|
||||
## 2.2.16 05/11/2020
|
||||
|
||||
* Fix packets capture stops after some time. Fixes #3067
|
||||
* Option to allocate or not the vCPUs and RAM settings for the GNS3 VM. Fixes https://github.com/GNS3/gns3-gui/issues/3069
|
||||
|
||||
## 2.2.15 07/10/2020
|
||||
|
||||
* Fix custom symbol not sent to remote controller when installing appliance
|
||||
|
||||
## 2.2.14 14/09/2020
|
||||
|
||||
* Improvements to add a new version of an appliance from wizard. Fixes #3002.
|
||||
|
||||
## 2.2.13 04/09/2020
|
||||
|
||||
* No changes
|
||||
|
||||
## 2.2.12 07/08/2020
|
||||
|
||||
* Downgrade psutil to version 5.6.7
|
||||
* Fix log shows the GUI command line without spaces between its arguments. Fixes #3026
|
||||
* Use server host is console host is equal to "0:0:0:0:0:0:0:0"
|
||||
* Remove VMware promotion.
|
||||
|
||||
## 2.2.11 09/07/2020
|
||||
|
||||
* Try to fix "Recent project" selection not working. Ref #3007
|
||||
* Fix debug entries shown twice in console window and double error messages with remote GNS3VM. Fixes #3010
|
||||
* Fix deprecation warning. Ref #3009
|
||||
* Fix tests on macOS. Ref #3009
|
||||
* Fix sentry SDK is configured twice.
|
||||
|
||||
## 2.2.10 18/06/2020
|
||||
|
||||
* New fix for multi-device selection/deselection not working as expected with right click. Fixes #2986
|
||||
* Optimize snap-to-grid code for drawing items. Fixes #2997
|
||||
* Move jsonschema 2.6.0 requirement in build repository.
|
||||
* Only use jsonschema 2.6.0 on Windows and macOS.
|
||||
* Disable default integrations for sentry sdk.
|
||||
|
||||
## 2.2.9 04/06/2020
|
||||
|
||||
* Fix GUI doesn't detect another GUI on macOS. Fixes #2994
|
||||
* Support to activate/deactive network connection state replication in Qemu.
|
||||
* Option to reset or not all MAC addresses when exporting or duplicating a project.
|
||||
* Fix Multi-device selection/deselection not working as expected with right click. Fixes #2986
|
||||
* Replace Raven by Sentry SDK. Fixes https://github.com/GNS3/gns3-server/issues/1758
|
||||
* Fix online help menu URL. Fixes #2984
|
||||
* Require setuptools>=17.1 in setup.py. Ref https://github.com/GNS3/gns3-server/issues/1751 This is to support environmental markers. https://github.com/pypa/setuptools/blob/master/CHANGES.rst#171
|
||||
* Update README. Ref https://github.com/GNS3/gns3-server/issues/1719
|
||||
* Restore editReadme attribute which was removed in Change 'New export project wizard'
|
||||
* Updated GUI pyqt files from Tab Order 'fixes' in "Tab Order in Preferences and Project Dialog #2872"
|
||||
|
||||
## 2.2.8 07/05/2020
|
||||
|
||||
* Default port set to 80 for server running in the GNS3 VM. Fixes #1737
|
||||
* Make the Web UI the default page. Ref https://github.com/GNS3/gns3-server/issues/1737
|
||||
* Fix "export portable project forgets contents of README". Fixes #1724
|
||||
* Activate unified title and toolbar on MacOS. Fixes #2968
|
||||
* Confirmation dialog for "console connect to all nodes". Fixes #2971
|
||||
* Add "Resume all suspended links". Fixes #2858
|
||||
* Revert "Change default path for SecureCRT. Fixes #2896"
|
||||
* Remove @property from ConfigurationDialog(). Fixes #2819 #2965
|
||||
* Use Environmental Markers to force jsonschema version. Fixes https://github.com/GNS3/gns3-gui/issues/2849 Version 3.2.0 with Python >= 3.8 Version 2.6.0 with Python < 3.8
|
||||
* Use Environmental Markers to force jsonschema version 2.6.0 on Windows/macOS. Ref https://github.com/GNS3/gns3-gui/issues/2849
|
||||
* Remove preferences dialog geometry restoration. Fixes #2807
|
||||
* Fix unable to configure custom adapters for Qemu VMs. Fixes #2961
|
||||
|
||||
## 2.2.7 07/04/2020
|
||||
|
||||
* Fix VNC console template doesn't extract %i (Project UUID). Fixes #2960
|
||||
* Fix contextual menu issues. Ref #2955
|
||||
|
||||
## 2.2.6 26/03/2020
|
||||
|
||||
* Prevent locked drawings to be deleted. Fixes https://github.com/GNS3/gns3-gui/issues/2948
|
||||
* Fix issues with empty project variables. Fixes https://github.com/GNS3/gns3-gui/issues/2941
|
||||
* Upgrade psutil to version 5.6.6 due to CVE-2019-18874 https://github.com/advisories/GHSA-qfc5-mcwq-26q8
|
||||
* Use existing README.txt if existing when exporting portable project. Fixes https://github.com/GNS3/gns3-server/issues/1724
|
||||
* Allow creation of a diskless Qemu VMs. Fixes #2939
|
||||
* Re-enable "create new version" in appliance wizard. Fixes #2837
|
||||
* Fix unable to load project from project library. Fixes #2932
|
||||
* Fix some permission denied errors when loading remote project. Ref #2871 Fixes #2901
|
||||
* Add 'Royal TS V5' to predefined console list
|
||||
* Disallow invalid grid sized. Fixes #2908
|
||||
* Check if hostname is blank. Fixes #2924
|
||||
* Add nvme disk interface and fix scsi disk interface for Qemu VMs.
|
||||
* Add latest Qemu nic models.
|
||||
* Upgrade Qt version to 5.14.1. Ref #2778 #2903
|
||||
|
||||
## 2.2.5 09/01/2020
|
||||
|
||||
* Add gns3-gui.xml and update Linux icons paths & permissions. Ref #2919
|
||||
|
||||
## 2.2.4 08/01/2020
|
||||
|
||||
* Fix "Console to all nodes" doesn't open cloud objects with console configured. Fixes #2902
|
||||
* Change default path for SecureCRT. Fixes #2896
|
||||
* Add icons in setup.py Ref #2898
|
||||
* Add remote viewer as a VNC console for Linux. Fixes #2913
|
||||
|
||||
## 2.2.3 12/11/2019
|
||||
|
||||
* Fix issue when binding on 0.0.0.0. Fixes #2892
|
||||
* Allow double click on cloud with configured console to open session. Fixes #2894
|
||||
* Officially support Python 3.8. Ref https://github.com/GNS3/gns3-gui/issues/2895
|
||||
* Set psutil to version 5.6.3 in requirements.txt
|
||||
|
||||
## 2.2.2 04/11/2019
|
||||
|
||||
* Fix KeyError: 'spice+agent'. Fixes #2890
|
||||
* Fix wrong log.error() call when exporting file.
|
||||
* Revert "Explicitly cleanup the cache directory."
|
||||
* Fix "UnboundLocalError: local variable 'pywintypes' referenced before assignment"
|
||||
* Fix GUI uses only telnet console. Fixes #2885
|
||||
* Fix missing sys module in sudo.py Fixes #2886
|
||||
|
||||
## 2.2.1 01/11/2019
|
||||
|
||||
* Check if console_type is None.
|
||||
* Explicitly cleanup the cache directory.
|
||||
* Get Windows interface from registry if cannot load win32com module.
|
||||
* Ignore OSError returned by psutil when bringing console to front.
|
||||
* Catch error if NPF or NPCAP service cannot be detected. Ref https://github.com/GNS3/gns3-server/issues/1670
|
||||
* Better handling for reading synchronous JSON response from server. Ref #2874
|
||||
* Fix JSONDecodeError when getting server version. Fixes #2874
|
||||
* Fix FileNotFoundError exceptions when launching SPICE or VNC clients.
|
||||
* Fix UnboundLocalError local variable 'win32serviceutil' referenced before assignment
|
||||
* 'Fix' tab order in preferences dialog so it follows the layout
|
||||
* 'Fix' tab order in edit project dialog so it follows the layout
|
||||
* Use compatible shlex_quote to handle case where Windows needs double quotes around file names, not single quotes. Ref https://github.com/GNS3/gns3-gui/issues/2866
|
||||
* Use 0.0.0.0 by default for server host. Fixes https://github.com/GNS3/gns3-server/issues/1663
|
||||
* Catch IndexError when configuring port names. Fixes #2865
|
||||
|
||||
## 2.2.0 30/09/2019
|
||||
|
||||
* No changes
|
||||
|
||||
## 2.2.0rc5 09/09/2019
|
||||
|
||||
* Adjust size for setup dialog and remove question about running the wizard again. Ref #2846
|
||||
|
||||
## 2.2.0rc4 30/08/2019
|
||||
|
||||
* Fix issue when asking to run the setup wizard again. Ref #2846
|
||||
* Remove warning about VirtualBox not supporting nested virtualization. Ref https://github.com/GNS3/gns3-server/issues/1610
|
||||
* Ask user if they want to see the wizard again. Ref #2846
|
||||
|
||||
## 2.2.0rc3 12/08/2019
|
||||
|
||||
* Revert to jsonschema 2.6.0 due to packaging problem.
|
||||
|
||||
## 2.2.0rc2 10/08/2019
|
||||
|
||||
* Bump jsonschema to version 3.0.2
|
||||
* Fix "Unable to change Remote Main Server IP". Fixes #2823
|
||||
* Fix "AttributeError: 'QGraphicsTextItem' object has no attribute 'locked'". Fixes #2814
|
||||
* Fix a minor typo in the setup wizard
|
||||
|
||||
## 2.2.0b4 11/07/2019
|
||||
|
||||
* Fix issue preventing to open the QFileDialog in the correct directory.
|
||||
* Remove unused edit readme action. Fixes #2816
|
||||
* Remove deprecated Qemu parameter to run legacy ASA VMs. Fixes #2827
|
||||
* Upload images on remote controller. Fixes #2828
|
||||
* Preferences dialog: send API request only if connected to controller
|
||||
* Fix AttributeError: 'QGraphicsTextItem' object has no attribute 'locked'. Fixes #2814
|
||||
* Fix KeyError: 'chassis' when converting old IOS templates. Fixes #2813
|
||||
|
||||
## 2.2.0b3 15/06/2019
|
||||
|
||||
* Fix template migration issues from GUI to controller. Fixes https://github.com/GNS3/gns3-gui/issues/2803
|
||||
* %guest-cid% variable implementation for Qemu VMs. Fixes https://github.com/GNS3/gns3-gui/issues/2804
|
||||
* Increase timeout from 2 to 5 seconds for synchronous check. Ref #2805
|
||||
|
||||
## 2.2.0b2 29/05/2019
|
||||
|
||||
* Fix KeyError: 'endpoint' issue. Fixes #2802
|
||||
* Fix wrong aligment of symbols in saved/exported projects. Fixes #2800
|
||||
* Replace urllib.request by Qt implementation for local server synchronous check. Fixes #2793
|
||||
* Support snapshots for portable projects. Fixes https://github.com/GNS3/gns3-gui/issues/2792
|
||||
* Fix event notification problem for projects and how snapshots are restored.
|
||||
* Do not close the nodes dock widget when creating project.
|
||||
* Fix no scan for images on remote controller. Fixes #2799
|
||||
* Use QNetworkAccessManager to download custom appliance symbols.
|
||||
* Experimental auto upgrade should not be available for "frozen" app. Fixes #2797
|
||||
* Don't allow link labels to be moved for locked nodes. Fixes #2794
|
||||
* Catch more OSError/PermissionError when checking md5 on remote images. Fixes #2582
|
||||
* Fix exception when grid size is 0. Fixes #2790
|
||||
* Catch PermissionError when scanning local image directories. Fixes #2791
|
||||
|
||||
## 2.1.20 29/05/2019
|
||||
|
||||
* Fix KeyError: 'endpoint' issue. Fixes #2802
|
||||
|
||||
## 2.1.19 28/05/2019
|
||||
|
||||
* Fix wrong aligment of symbols in saved/exported projects. Fixes #2800
|
||||
* Replace urllib.request by Qt implementation for local server synchronous check. Fixes #2793
|
||||
* Set grid's minimum to 5. Fixes #2795
|
||||
|
||||
## 2.1.18 22/05/2019
|
||||
|
||||
* Fix error in HTTPConnection.request for Python3.6. Fixes #2793
|
||||
* Catch more OSError/PermissionError when checking md5 on remote images. Fixes #2582
|
||||
* Fix exception when grid size is 0. Fixes #2790
|
||||
* Catch PermissionError when scanning local image directories. Fixes #2791
|
||||
* Revert "Make sure the latest PyQt5 version 5.12.x is used on Windows." Ref #2778
|
||||
|
||||
## 2.2.0b1 21/05/2019
|
||||
|
||||
* Change behavior when an IOU license is verified. Fixes https://github.com/GNS3/gns3-server/issues/1555
|
||||
* Fix cannot load new profile. Fixes #2784
|
||||
* Fix remote packet capture when controller is also remote. Fixes #2785
|
||||
* Set console type to "none" by default for Ethernet switches and add a warning if trying to use "telnet". Fixes https://github.com/GNS3/gns3-gui/issues/2776
|
||||
* Add tooltip for symbol theme support in general preferences. Fixes #2770
|
||||
* Support for persistent docker volumes
|
||||
|
||||
## 2.1.17 17/05/2019
|
||||
|
||||
* No changes.
|
||||
|
||||
## 2.2.0a5 15/04/2019
|
||||
|
||||
* Revert "Drop old Qemu support (Windows and macOS) and legacy ASA support." Ref https://github.com/GNS3/gns3-server/issues/1579
|
||||
* Do not make NPF or NPCAP service mandatory to start the local server on Windows.
|
||||
* Do not try to upload a local image that is already installed on the local server.
|
||||
* Back to the major.minor version for config files. Ref https://github.com/GNS3/gns3-gui/issues/2756
|
||||
* Some adjustments with compute WebSocket handling. Ref https://github.com/GNS3/gns3-server/issues/1564
|
||||
* Fix AttributeError: 'GraphicsView' object has no attribute '_import_config_dir'. Fixes #2768
|
||||
* Do not try to lock a SvgIconItem. Fixes #2766
|
||||
* Prevent locked nodes to be deleted. Fixes https://github.com/GNS3/gns3-gui/issues/2764
|
||||
* Add PuTTY 0.71 and mark GNS3 PuTTY as deprecated. Fixes #2758
|
||||
* Fix bug with IOS platform detection. Fixes #2760
|
||||
|
||||
## 2.1.16 15/04/2019
|
||||
|
||||
* Do not make NPF or NPCAP service mandatory to start the local server on Windows.
|
||||
* Fix OverflowError error with progress dialog. Fixes #2767
|
||||
* More fixes for stuck progress window. Fixes #2765
|
||||
* Fix adding multiple devices - stuck progress window. Fixes #2765
|
||||
* Make sure the latest PyQt5 version 5.12.x is used on Windows.
|
||||
* Show a warning when a config export is not supported. Ref #2762
|
||||
|
||||
## 2.1.15 21/03/2019
|
||||
|
||||
* No changes on the GUI.
|
||||
|
||||
## 2.2.0a4 05/04/2019
|
||||
|
||||
* Use the full version number for path to config files. Ref https://github.com/GNS3/gns3-gui/issues/2756
|
||||
* Fix error message when shutting down GUI without a started server.
|
||||
* Fix remote packet capture and make sure packet capture is stopped when deleting an NIO. Fixes https://github.com/GNS3/gns3-gui/issues/2753
|
||||
* Store config files in version specific location
|
||||
* Update pytest from 4.3.1 to 4.4.0
|
||||
* Fix error messages on closing GNS3 application. Fixes https://github.com/GNS3/gns3-gui/issues/2750
|
||||
* Fix bug when list of files for an appliance is not displayed.
|
||||
* Update 'local' to 'bundled' in server & gui, Fixes: #1561
|
||||
|
||||
## 2.2.0a3 25/03/2019
|
||||
|
||||
* Fix bug when changing symbol. Fixes #2740
|
||||
* Fix issue when images are not uploaded from appliance wizard. Ref https://github.com/GNS3/gns3-gui/issues/2738
|
||||
|
||||
## 2.2.0a2 14/03/2019
|
||||
|
||||
* Try to handle stacked widget layout differently. Ref #2605
|
||||
|
||||
@@ -1,22 +1,16 @@
|
||||
# Run tests inside a container
|
||||
FROM ubuntu:17.10
|
||||
|
||||
FROM ubuntu:18.04
|
||||
MAINTAINER GNS3 Team
|
||||
|
||||
#ENV DEBIAN_FRONTEND noninteractive
|
||||
|
||||
RUN apt-get update
|
||||
RUN apt-get install -y --force-yes python3.6 python3-pyqt5 python3-pip python3-pyqt5.qtsvg python3-pyqt5.qtwebsockets python3.6-dev xvfb
|
||||
RUN apt-get clean
|
||||
|
||||
|
||||
ADD dev-requirements.txt /dev-requirements.txt
|
||||
ADD requirements.txt /requirements.txt
|
||||
RUN pip3 install -r /dev-requirements.txt
|
||||
|
||||
|
||||
ADD . /src
|
||||
|
||||
WORKDIR /src
|
||||
|
||||
CMD xvfb-run python3.6 -m pytest -vv
|
||||
|
||||
@@ -3,7 +3,6 @@ include AUTHORS
|
||||
include LICENSE
|
||||
include MANIFEST.in
|
||||
include requirements.txt
|
||||
include tox.ini
|
||||
recursive-include tests *
|
||||
recursive-include gns3 *
|
||||
recursive-include resources *
|
||||
|
||||
21
README.rst
21
README.rst
@@ -1,12 +1,15 @@
|
||||
GNS3-gui
|
||||
========
|
||||
|
||||
.. image:: https://travis-ci.org/GNS3/gns3-gui.svg?branch=master
|
||||
:target: https://travis-ci.org/GNS3/gns3-gui
|
||||
.. image:: https://github.com/GNS3/gns3-gui/workflows/testing/badge.svg
|
||||
:target: https://github.com/GNS3/gns3-gui/actions?query=workflow%3Atesting
|
||||
|
||||
.. image:: https://img.shields.io/pypi/v/gns3-gui.svg
|
||||
:target: https://pypi.python.org/pypi/gns3-gui
|
||||
|
||||
.. image:: https://snyk.io/test/github/GNS3/gns3-gui/badge.svg
|
||||
:target: https://snyk.io/test/github/GNS3/gns3-gui
|
||||
|
||||
|
||||
GNS3 GUI repository.
|
||||
|
||||
@@ -15,6 +18,15 @@ Installation
|
||||
|
||||
Please see https://docs.gns3.com/
|
||||
|
||||
Software dependencies
|
||||
---------------------
|
||||
|
||||
PyQt5 which is either part of the Linux distribution or installable from PyPi. The other Python dependencies are automatically installed during the GNS3 GUI installation and are listed `here <https://github.com/GNS3/gns3-gui/blob/master/requirements.txt>`_
|
||||
|
||||
For connecting to nodes using Telnet, a Telnet client is required. On Linux that's a terminal emulator like xterm, gnome-terminal, konsole plus the telnet program. For connecting to nodes with a GUI, a VNC client is required, optionally a SPICE client can be used for Qemu nodes.
|
||||
|
||||
For using packet captures within GNS3, Wireshark should be installed. It's recommended, but if you don't need that functionality you can go without it.
|
||||
|
||||
Development
|
||||
-------------
|
||||
|
||||
@@ -42,6 +54,7 @@ https://github.com/Kozea/wdb
|
||||
|
||||
Security issues
|
||||
----------------
|
||||
Please contact us using contact informations available here:
|
||||
http://docs.gns3.com/1ON9JBXSeR7Nt2-Qum2o3ZX0GU86BZwlmNSUgvmqNWGY/index.html
|
||||
|
||||
Please contact us at security@gns3.net
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
-rrequirements.txt
|
||||
|
||||
pep8==1.7.0
|
||||
pytest==4.3.1
|
||||
pytest-pythonpath==0.7.3 # useful for running tests outside tox
|
||||
pytest-timeout==1.3.3
|
||||
pytest==5.4.3
|
||||
flake8==3.8.3
|
||||
pytest-timeout==1.4.1
|
||||
|
||||
@@ -223,17 +223,10 @@ class ConsoleCmd(cmd.Cmd):
|
||||
level = int(args[0])
|
||||
if level == 0:
|
||||
print("Deactivating debugging")
|
||||
for handler in root.handlers:
|
||||
if isinstance(handler, logging.StreamHandler):
|
||||
root.removeHandler(handler)
|
||||
root.setLevel(logging.INFO)
|
||||
else:
|
||||
root.addHandler(logging.StreamHandler(sys.stdout))
|
||||
if level == 1:
|
||||
print("Activating debugging")
|
||||
else:
|
||||
print("Activating full debugging")
|
||||
root.setLevel(logging.DEBUG)
|
||||
print("Activating debugging")
|
||||
root.setLevel(logging.DEBUG)
|
||||
from .main_window import MainWindow
|
||||
MainWindow.instance().setSettings({"debug_level": level})
|
||||
else:
|
||||
|
||||
@@ -46,6 +46,7 @@ class Controller(QtCore.QObject):
|
||||
super().__init__()
|
||||
self._connected = False
|
||||
self._connecting = False
|
||||
self._notification_stream = None
|
||||
self._version = None
|
||||
self._cache_directory = tempfile.TemporaryDirectory(suffix="-gns3")
|
||||
self._http_client = None
|
||||
@@ -53,8 +54,7 @@ class Controller(QtCore.QObject):
|
||||
self._error_dialog = None
|
||||
self._display_error = True
|
||||
self._projects = []
|
||||
self._controller_websocket = QtWebSockets.QWebSocket()
|
||||
self._project_websocket = QtWebSockets.QWebSocket()
|
||||
self._websocket = QtWebSockets.QWebSocket()
|
||||
|
||||
# If we do multiple call in order to download the same symbol we queue them
|
||||
self._static_asset_download_queue = {}
|
||||
@@ -130,7 +130,8 @@ class Controller(QtCore.QObject):
|
||||
|
||||
self._connected = False
|
||||
self._connecting = True
|
||||
self.get('/version', self._versionGetSlot)
|
||||
status, json_data = self.httpClient().getSynchronous('GET', '/version', timeout=60)
|
||||
self._versionGetSlot(json_data, status is None or status >= 300)
|
||||
|
||||
def _httpClientDisconnectedSlot(self):
|
||||
if self._connected:
|
||||
@@ -148,11 +149,14 @@ class Controller(QtCore.QObject):
|
||||
if self._first_error:
|
||||
self._connecting = False
|
||||
self.connection_failed_signal.emit()
|
||||
if "message" in result and self._display_error:
|
||||
if self._display_error:
|
||||
self._error_dialog = QtWidgets.QMessageBox(self.parent())
|
||||
self._error_dialog.setWindowModality(QtCore.Qt.ApplicationModal)
|
||||
self._error_dialog.setWindowTitle("Connection to server")
|
||||
self._error_dialog.setText("Error when connecting to the GNS3 server:\n{}".format(result["message"]))
|
||||
if result and "message" in result:
|
||||
self._error_dialog.setText("Error when connecting to the GNS3 server:\n{}".format(result["message"]))
|
||||
else:
|
||||
self._error_dialog.setText("Cannot connect to the GNS3 server")
|
||||
self._error_dialog.setIcon(QtWidgets.QMessageBox.Critical)
|
||||
self._error_dialog.show()
|
||||
# Try to connect again in 5 seconds
|
||||
@@ -164,6 +168,7 @@ class Controller(QtCore.QObject):
|
||||
self._error_dialog.reject()
|
||||
self._error_dialog = None
|
||||
self._version = result.get("version")
|
||||
self._http_client.connection_connected_signal.emit()
|
||||
|
||||
def _httpClientConnectedSlot(self):
|
||||
|
||||
@@ -246,12 +251,6 @@ class Controller(QtCore.QObject):
|
||||
if self._http_client:
|
||||
return self._http_client.createHTTPQuery(method, path, *args, **kwargs)
|
||||
|
||||
def getSynchronous(self, endpoint, timeout=2):
|
||||
return self._http_client.getSynchronous(endpoint, timeout)
|
||||
|
||||
def connectProjectWebSocket(self, path, *args):
|
||||
return self._http_client.connectWebSocket(self._project_websocket, path)
|
||||
|
||||
@staticmethod
|
||||
def instance():
|
||||
"""
|
||||
@@ -426,9 +425,10 @@ class Controller(QtCore.QObject):
|
||||
ignoreErrors=True)
|
||||
|
||||
else:
|
||||
self._notification_stream = self._http_client.connectWebSocket(self._controller_websocket, "/notifications/ws")
|
||||
self._notification_stream = self._http_client.connectWebSocket(self._websocket, "/notifications/ws")
|
||||
self._notification_stream.textMessageReceived.connect(self._websocket_event_received)
|
||||
self._notification_stream.error.connect(self._websocket_error)
|
||||
self._notification_stream.sslErrors.connect(self._sslErrorsSlot)
|
||||
|
||||
def stopListenNotifications(self):
|
||||
if self._notification_stream:
|
||||
@@ -449,10 +449,15 @@ class Controller(QtCore.QObject):
|
||||
@qslot
|
||||
def _websocket_error(self, error):
|
||||
if self._notification_stream:
|
||||
log.error(self._notification_stream.errorString())
|
||||
log.error("Websocket notification stream error: {}".format(self._notification_stream.errorString()))
|
||||
self._notification_stream = None
|
||||
self._startListenNotifications()
|
||||
|
||||
@qslot
|
||||
def _sslErrorsSlot(self, ssl_errors):
|
||||
|
||||
self._http_client.handleSslError(self._notification_stream, ssl_errors)
|
||||
|
||||
@qslot
|
||||
def _websocket_event_received(self, event):
|
||||
try:
|
||||
|
||||
@@ -16,19 +16,18 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import sys
|
||||
import psutil
|
||||
import os
|
||||
import platform
|
||||
import struct
|
||||
import distro
|
||||
|
||||
try:
|
||||
import raven
|
||||
from raven.transport.http import HTTPTransport
|
||||
RAVEN_AVAILABLE = True
|
||||
import sentry_sdk
|
||||
from sentry_sdk.integrations.logging import LoggingIntegration
|
||||
SENTRY_SDK_AVAILABLE = True
|
||||
except ImportError:
|
||||
# raven is not installed with deb package in order to simplify packaging
|
||||
RAVEN_AVAILABLE = False
|
||||
# Sentry SDK is not installed with deb package in order to simplify packaging
|
||||
SENTRY_SDK_AVAILABLE = False
|
||||
|
||||
from .utils.get_resource import get_resource
|
||||
from .version import __version__, __version_info__
|
||||
@@ -52,66 +51,67 @@ class CrashReport:
|
||||
Report crash to a third party service
|
||||
"""
|
||||
|
||||
DSN = "https://cc555ea871c3443b8ef31f6bf2bb0d7a:5b6b0f2388bd4838a5c9187aae03fcad@sentry.io/38506"
|
||||
if hasattr(sys, "frozen"):
|
||||
cacert = get_resource("cacert.pem")
|
||||
if cacert is not None and os.path.isfile(cacert):
|
||||
DSN += "?ca_certs={}".format(cacert)
|
||||
else:
|
||||
log.warning("The SSL certificate bundle file '{}' could not be found".format(cacert))
|
||||
DSN = "https://0f28484e29214863871742a8c4054327:cd002a1193c7458fbde34db6fec80b9b@o19455.ingest.sentry.io/38506"
|
||||
_instance = None
|
||||
|
||||
def __init__(self):
|
||||
# We don't want sentry making noise if an error is catched when you don't have internet
|
||||
# We don't want sentry making noise if an error is caught when we don't have internet
|
||||
sentry_errors = logging.getLogger('sentry.errors')
|
||||
sentry_errors.disabled = True
|
||||
|
||||
sentry_uncaught = logging.getLogger('sentry.errors.uncaught')
|
||||
sentry_uncaught.disabled = True
|
||||
self._sentry_initialized = False
|
||||
|
||||
def captureException(self, exception, value, tb):
|
||||
from .local_server import LocalServer
|
||||
from .local_config import LocalConfig
|
||||
from .controller import Controller
|
||||
from .compute_manager import ComputeManager
|
||||
if SENTRY_SDK_AVAILABLE:
|
||||
cacert = None
|
||||
if hasattr(sys, "frozen"):
|
||||
cacert_resource = get_resource("cacert.pem")
|
||||
if cacert_resource is not None and os.path.isfile(cacert_resource):
|
||||
cacert = cacert_resource
|
||||
else:
|
||||
log.error("The SSL certificate bundle file '{}' could not be found".format(cacert_resource))
|
||||
|
||||
local_server = LocalServer.instance().localServerSettings()
|
||||
if local_server["report_errors"]:
|
||||
if not RAVEN_AVAILABLE:
|
||||
return
|
||||
# Don't send log records as events.
|
||||
sentry_logging = LoggingIntegration(level=logging.INFO, event_level=None)
|
||||
|
||||
if os.path.exists(LocalConfig.instance().runAsRootPath()):
|
||||
log.warning("User has run application as root. Crash reports are disabled.")
|
||||
sys.exit(1)
|
||||
return
|
||||
sentry_sdk.init(dsn=CrashReport.DSN,
|
||||
release=__version__,
|
||||
ca_certs=cacert,
|
||||
default_integrations=False,
|
||||
integrations=[sentry_logging])
|
||||
|
||||
if os.path.exists(".git"):
|
||||
log.warning("A .git directory exist crash report is turn off for developers. Instant exit")
|
||||
sys.exit(1)
|
||||
return
|
||||
|
||||
if hasattr(exception, "fingerprint"):
|
||||
client = raven.Client(CrashReport.DSN, release=__version__, fingerprint=['{{ default }}', exception.fingerprint], transport=HTTPTransport)
|
||||
else:
|
||||
client = raven.Client(CrashReport.DSN, release=__version__, transport=HTTPTransport)
|
||||
context = {
|
||||
tags = {
|
||||
"os:name": platform.system(),
|
||||
"os:release": platform.release(),
|
||||
"os:win_32": " ".join(platform.win32_ver()),
|
||||
"os:mac": "{} {}".format(platform.mac_ver()[0], platform.mac_ver()[2]),
|
||||
"os:linux": " ".join(distro.linux_distribution()),
|
||||
|
||||
}
|
||||
|
||||
self._add_qt_information(tags)
|
||||
|
||||
with sentry_sdk.configure_scope() as scope:
|
||||
for key, value in tags.items():
|
||||
scope.set_tag(key, value)
|
||||
|
||||
extra_context = {
|
||||
"python:version": "{}.{}.{}".format(sys.version_info[0],
|
||||
sys.version_info[1],
|
||||
sys.version_info[2]),
|
||||
"python:bit": struct.calcsize("P") * 8,
|
||||
"python:encoding": sys.getdefaultencoding(),
|
||||
"python:frozen": "{}".format(hasattr(sys, "frozen")),
|
||||
"python:frozen": "{}".format(hasattr(sys, "frozen"))
|
||||
}
|
||||
|
||||
# extra controller and compute information
|
||||
extra_context = {"controller:version": Controller.instance().version(),
|
||||
"controller:host": Controller.instance().host(),
|
||||
"controller:connected": Controller.instance().connected()}
|
||||
from .controller import Controller
|
||||
from .compute_manager import ComputeManager
|
||||
extra_context["controller:version"] = Controller.instance().version()
|
||||
extra_context["controller:host"] = Controller.instance().host()
|
||||
extra_context["controller:connected"] = Controller.instance().connected()
|
||||
|
||||
for index, compute in enumerate(ComputeManager.instance().computes()):
|
||||
extra_context["compute{}:id".format(index)] = compute.id()
|
||||
extra_context["compute{}:name".format(index)] = compute.name(),
|
||||
@@ -120,27 +120,48 @@ class CrashReport:
|
||||
extra_context["compute{}:platform".format(index)] = compute.capabilities().get("platform")
|
||||
extra_context["compute{}:version".format(index)] = compute.capabilities().get("version")
|
||||
|
||||
context = self._add_qt_information(context)
|
||||
client.tags_context(context)
|
||||
client.extra_context(extra_context)
|
||||
try:
|
||||
report = client.captureException((exception, value, tb))
|
||||
except Exception as e:
|
||||
log.error("Can't send crash report to Sentry: {}".format(e))
|
||||
return
|
||||
log.debug("Crash report sent with event ID: {}".format(client.get_ident(report)))
|
||||
with sentry_sdk.configure_scope() as scope:
|
||||
for key, value in extra_context.items():
|
||||
scope.set_extra(key, value)
|
||||
|
||||
def captureException(self, exception, value, tb):
|
||||
|
||||
from .local_server import LocalServer
|
||||
from .local_config import LocalConfig
|
||||
|
||||
local_server = LocalServer.instance().localServerSettings()
|
||||
if local_server["report_errors"]:
|
||||
|
||||
if not SENTRY_SDK_AVAILABLE:
|
||||
log.warning("Cannot capture exception: Sentry SDK is not available")
|
||||
return
|
||||
|
||||
if os.path.exists(LocalConfig.instance().runAsRootPath()):
|
||||
log.warning("User is running application as root. Crash reports disabled.")
|
||||
return
|
||||
|
||||
if not hasattr(sys, "frozen") and os.path.exists(os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", ".git")):
|
||||
log.warning(".git directory detected, crash reporting is turned off for developers.")
|
||||
return
|
||||
|
||||
try:
|
||||
error = (exception, value, tb)
|
||||
sentry_sdk.capture_exception(error=error)
|
||||
log.info("Crash report sent with event ID: {}".format(sentry_sdk.last_event_id()))
|
||||
except Exception as e:
|
||||
log.warning("Can't send crash report to Sentry: {}".format(e))
|
||||
|
||||
def _add_qt_information(self, tags):
|
||||
|
||||
def _add_qt_information(self, context):
|
||||
try:
|
||||
from .qt import QtCore
|
||||
from .qt import sip
|
||||
except ImportError:
|
||||
return context
|
||||
context["psutil:version"] = psutil.__version__
|
||||
context["pyqt:version"] = QtCore.PYQT_VERSION_STR
|
||||
context["qt:version"] = QtCore.QT_VERSION_STR
|
||||
context["sip:version"] = sip.SIP_VERSION_STR
|
||||
return context
|
||||
return tags
|
||||
tags["pyqt:version"] = QtCore.PYQT_VERSION_STR
|
||||
tags["qt:version"] = QtCore.QT_VERSION_STR
|
||||
tags["sip:version"] = sip.SIP_VERSION_STR
|
||||
return tags
|
||||
|
||||
@classmethod
|
||||
def instance(cls):
|
||||
|
||||
@@ -36,6 +36,7 @@ from ..compute_manager import ComputeManager
|
||||
from ..controller import Controller
|
||||
from ..local_config import LocalConfig
|
||||
from ..image_upload_manager import ImageUploadManager
|
||||
from ..image_manager import ImageManager
|
||||
|
||||
import logging
|
||||
log = logging.getLogger(__name__)
|
||||
@@ -71,11 +72,14 @@ class ApplianceWizard(QtWidgets.QWizard, Ui_ApplianceWizard):
|
||||
self.uiCreateVersionPushButton.clicked.connect(self._createVersionPushButtonClickedSlot)
|
||||
self.allowCustomFiles.clicked.connect(self._allowCustomFilesChangedSlot)
|
||||
|
||||
#FIXME: deactivate the create version feature (confusing and maybe not necessary, TBD)
|
||||
self.uiCreateVersionPushButton.hide()
|
||||
|
||||
# directories where to search for images
|
||||
images_directories = list()
|
||||
|
||||
for emulator in ("QEMU", "IOU", "DYNAMIPS"):
|
||||
emulator_images_dir = ImageManager.instance().getDirectoryForType(emulator)
|
||||
if os.path.exists(emulator_images_dir):
|
||||
images_directories.append(emulator_images_dir)
|
||||
|
||||
images_directories.append(os.path.dirname(self._path))
|
||||
download_directory = QtCore.QStandardPaths.writableLocation(QtCore.QStandardPaths.DownloadLocation)
|
||||
if download_directory != "" and download_directory != os.path.dirname(self._path):
|
||||
@@ -190,7 +194,10 @@ class ApplianceWizard(QtWidgets.QWizard, Ui_ApplianceWizard):
|
||||
QtWidgets.QMessageBox.warning(self, "GNS3 VM", "The GNS3 VM is not available, please configure the GNS3 VM before adding a new appliance.")
|
||||
|
||||
elif self.page(page_id) == self.uiFilesWizardPage:
|
||||
self._registry.getRemoteImageList(self._appliance.emulator(), self._compute_id)
|
||||
if Controller.instance().isRemote() or self._compute_id != "local":
|
||||
self._registry.getRemoteImageList(self._appliance.emulator(), self._compute_id)
|
||||
else:
|
||||
self.images_changed_signal.emit()
|
||||
|
||||
elif self.page(page_id) == self.uiQemuWizardPage:
|
||||
if self._appliance['qemu'].get('kvm', 'require') == 'require':
|
||||
@@ -221,8 +228,15 @@ class ApplianceWizard(QtWidgets.QWizard, Ui_ApplianceWizard):
|
||||
def _uiServerWizardPage_isComplete(self):
|
||||
return self.uiRemoteRadioButton.isEnabled() or self.uiVMRadioButton.isEnabled() or self.uiLocalRadioButton.isEnabled()
|
||||
|
||||
def _imageUploadedCallback(self, result, error=False, **kwargs):
|
||||
self._registry.getRemoteImageList(self._appliance.emulator(), self._compute_id)
|
||||
def _imageUploadedCallback(self, result, error=False, context=None, **kwargs):
|
||||
if context is None:
|
||||
context = {}
|
||||
image_path = context.get("image_path", "unknown")
|
||||
if error:
|
||||
log.error("Error while uploading image '{}': {}".format(image_path, result["message"]))
|
||||
else:
|
||||
log.info("Image '{}' has been successfully uploaded".format(image_path))
|
||||
self._registry.getRemoteImageList(self._appliance.emulator(), self._compute_id)
|
||||
|
||||
def _showApplianceInfoSlot(self):
|
||||
"""
|
||||
@@ -339,6 +353,7 @@ class ApplianceWizard(QtWidgets.QWizard, Ui_ApplianceWizard):
|
||||
image_widget.setForeground(2, QtGui.QBrush(QtGui.QColor("red")))
|
||||
else:
|
||||
image_widget.setForeground(2, QtGui.QBrush(QtGui.QColor("green")))
|
||||
image_widget.setToolTip(2, image["path"])
|
||||
|
||||
# Associated data stored are col 0: version, col 1: image
|
||||
image_widget.setData(0, QtCore.Qt.UserRole, version)
|
||||
@@ -398,9 +413,14 @@ class ApplianceWizard(QtWidgets.QWizard, Ui_ApplianceWizard):
|
||||
image.get("filesize"),
|
||||
strict_md5_check=not self.allowCustomFiles.isChecked())
|
||||
if img:
|
||||
image["status"] = "Found"
|
||||
if img.location == "local":
|
||||
image["status"] = "Found locally"
|
||||
else:
|
||||
compute = ComputeManager.instance().getCompute(self._compute_id)
|
||||
image["status"] = "Found on {}".format(compute.name())
|
||||
image["md5sum"] = img.md5sum
|
||||
image["filesize"] = img.filesize
|
||||
image["path"] = img.path
|
||||
else:
|
||||
image["status"] = "Missing"
|
||||
self._refreshing = False
|
||||
@@ -455,8 +475,24 @@ class ApplianceWizard(QtWidgets.QWizard, Ui_ApplianceWizard):
|
||||
Allow user to create a new version of an appliance
|
||||
"""
|
||||
|
||||
new_version, ok = QtWidgets.QInputDialog.getText(self, "Creating a new version", "Creating a new version allows to import unknown files to use with this appliance.\nPlease share your experience on the GNS3 community if this version works.\n\nVersion name:", QtWidgets.QLineEdit.Normal)
|
||||
current = self.uiApplianceVersionTreeWidget.currentItem()
|
||||
if current is None:
|
||||
QtWidgets.QMessageBox.critical(self.parent(), "Base version", "Please select a base version")
|
||||
return
|
||||
base_version = current.data(0, QtCore.Qt.UserRole)
|
||||
|
||||
new_version_name, ok = QtWidgets.QInputDialog.getText(self, "Creating a new version", "Create a new version for this appliance.\nPlease share your experience on the GNS3 community if this version works.\n\nVersion name:", QtWidgets.QLineEdit.Normal, base_version.get("name"))
|
||||
if ok:
|
||||
new_version = {"name": new_version_name}
|
||||
new_version["images"] = {}
|
||||
|
||||
for disk_type in base_version["images"]:
|
||||
base_filename = base_version["images"][disk_type]["filename"]
|
||||
filename, ok = QtWidgets.QInputDialog.getText(self, "Image", "Disk image filename for {}".format(disk_type), QtWidgets.QLineEdit.Normal, base_filename)
|
||||
if not ok:
|
||||
filename = base_filename
|
||||
new_version["images"][disk_type] = {"filename": filename, "version": new_version_name}
|
||||
|
||||
try:
|
||||
self._appliance.create_new_version(new_version)
|
||||
except ApplianceError as e:
|
||||
@@ -495,9 +531,7 @@ class ApplianceWizard(QtWidgets.QWizard, Ui_ApplianceWizard):
|
||||
QtWidgets.QMessageBox.warning(self.parent(), "Add appliance", "Can't access to the image file {}: {}.".format(path, str(e)))
|
||||
return
|
||||
|
||||
image_upload_manger = ImageUploadManager(
|
||||
image, Controller.instance(), self._compute_id,
|
||||
self._imageUploadedCallback, LocalConfig.instance().directFileUpload())
|
||||
image_upload_manger = ImageUploadManager(image, Controller.instance(), self._compute_id, self._imageUploadedCallback, LocalConfig.instance().directFileUpload())
|
||||
image_upload_manger.upload()
|
||||
|
||||
def _getQemuBinariesFromServerCallback(self, result, error=False, **kwargs):
|
||||
@@ -533,7 +567,7 @@ class ApplianceWizard(QtWidgets.QWizard, Ui_ApplianceWizard):
|
||||
|
||||
if version is None:
|
||||
appliance_configuration = self._appliance.copy()
|
||||
if not "docker" in appliance_configuration:
|
||||
if "docker" not in appliance_configuration:
|
||||
# only Docker do not have version
|
||||
return False
|
||||
else:
|
||||
@@ -554,7 +588,7 @@ class ApplianceWizard(QtWidgets.QWizard, Ui_ApplianceWizard):
|
||||
if "qemu" in appliance_configuration:
|
||||
appliance_configuration["qemu"]["path"] = self.uiQemuListComboBox.currentData()
|
||||
|
||||
new_template = ApplianceToTemplate().new_template(appliance_configuration, self._compute_id, self._symbols)
|
||||
new_template = ApplianceToTemplate().new_template(appliance_configuration, self._compute_id, self._symbols, parent=self)
|
||||
TemplateManager.instance().createTemplate(Template(new_template), callback=self._templateCreatedCallback)
|
||||
return False
|
||||
|
||||
@@ -583,24 +617,35 @@ class ApplianceWizard(QtWidgets.QWizard, Ui_ApplianceWizard):
|
||||
self._template_created = True
|
||||
self.done(True)
|
||||
|
||||
def _uploadImages(self, version):
|
||||
def _uploadImages(self, name, version):
|
||||
"""
|
||||
Upload an image the compute.
|
||||
"""
|
||||
|
||||
appliance_configuration = self._appliance.search_images_for_version(version)
|
||||
try:
|
||||
appliance_configuration = self._appliance.search_images_for_version(version)
|
||||
except ApplianceError as e:
|
||||
QtWidgets.QMessageBox.critical(self, "Appliance","Cannot install {} version {}: {}".format(name, version, e))
|
||||
return
|
||||
for image in appliance_configuration["images"]:
|
||||
if image["location"] == "local":
|
||||
if not Controller.instance().isRemote() and self._compute_id == "local" and image["path"].startswith(ImageManager.instance().getDirectory()):
|
||||
log.debug("{} is already on the local server".format(image["path"]))
|
||||
return
|
||||
image = Image(self._appliance.emulator(), image["path"], filename=image["filename"])
|
||||
|
||||
image_upload_manger = ImageUploadManager(
|
||||
image, Controller.instance(), self._compute_id,
|
||||
self._applianceImageUploadedCallback, LocalConfig.instance().directFileUpload())
|
||||
image_upload_manger.upload()
|
||||
image_upload_manager = ImageUploadManager(image, Controller.instance(), self._compute_id, self._applianceImageUploadedCallback, LocalConfig.instance().directFileUpload())
|
||||
image_upload_manager.upload()
|
||||
self._image_uploading_count += 1
|
||||
|
||||
def _applianceImageUploadedCallback(self, result, error=False, **kwargs):
|
||||
self._image_uploading_count -= 1
|
||||
def _applianceImageUploadedCallback(self, result, error=False, context=None, **kwargs):
|
||||
if context is None:
|
||||
context = {}
|
||||
image_path = context.get("image_path", "unknown")
|
||||
if error:
|
||||
log.error("Error while uploading image '{}': {}".format(image_path, result["message"]))
|
||||
else:
|
||||
log.info("Image '{}' has been successfully uploaded".format(image_path))
|
||||
self._image_uploading_count -= 1
|
||||
|
||||
def nextId(self):
|
||||
if self.currentPage() == self.uiServerWizardPage:
|
||||
@@ -638,7 +683,8 @@ class ApplianceWizard(QtWidgets.QWizard, Ui_ApplianceWizard):
|
||||
QtWidgets.QMessageBox.Yes, QtWidgets.QMessageBox.No)
|
||||
if reply == QtWidgets.QMessageBox.No:
|
||||
return False
|
||||
self._uploadImages(version["name"])
|
||||
|
||||
self._uploadImages(appliance["name"], version["name"])
|
||||
|
||||
elif self.currentPage() == self.uiUsageWizardPage:
|
||||
# validate the usage page
|
||||
|
||||
@@ -49,7 +49,6 @@ class ConfigurationDialog(QtWidgets.QDialog, Ui_configurationDialog):
|
||||
self._settings = settings
|
||||
self._configuration_page = configuration_page
|
||||
|
||||
@property
|
||||
def settings(self):
|
||||
return self._settings
|
||||
|
||||
|
||||
@@ -44,6 +44,9 @@ class ConsoleCommandDialog(QtWidgets.QDialog, Ui_uiConsoleCommandDialog):
|
||||
"""
|
||||
super().__init__(parent)
|
||||
self.setupUi(self)
|
||||
if console_type == "spice+agent":
|
||||
# special case for spice+agent, use the spice console type
|
||||
console_type = "spice"
|
||||
self._console_type = console_type
|
||||
self._current = current
|
||||
|
||||
@@ -63,7 +66,7 @@ class ConsoleCommandDialog(QtWidgets.QDialog, Ui_uiConsoleCommandDialog):
|
||||
elif self._console_type == "vnc":
|
||||
self._consoles = copy.copy(PRECONFIGURED_VNC_CONSOLE_COMMANDS)
|
||||
self._consoles.update(self._settings[self._console_type])
|
||||
elif self._console_type.startswith("spice"):
|
||||
elif self._console_type == "spice":
|
||||
self._consoles = copy.copy(PRECONFIGURED_SPICE_CONSOLE_COMMANDS)
|
||||
self._consoles.update(self._settings[self._console_type])
|
||||
|
||||
@@ -121,8 +124,8 @@ class ConsoleCommandDialog(QtWidgets.QDialog, Ui_uiConsoleCommandDialog):
|
||||
dialog = ConsoleCommandDialog(parent, console_type=console_type, current=current)
|
||||
dialog.show()
|
||||
if dialog.exec_():
|
||||
return (True, dialog.uiCommandPlainTextEdit.toPlainText().replace("\n", " "))
|
||||
return (False, None)
|
||||
return True, dialog.uiCommandPlainTextEdit.toPlainText().replace("\n", " ")
|
||||
return False, None
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
@@ -41,6 +41,9 @@ class EditComputeDialog(QtWidgets.QDialog, Ui_EditComputeDialog):
|
||||
self.uiServerHostLineEdit.setText(self._compute.host())
|
||||
self.uiServerPortSpinBox.setValue(self._compute.port())
|
||||
|
||||
index = self.uiServerProtocolComboBox.findText(self._compute.protocol().upper())
|
||||
self.uiServerProtocolComboBox.setCurrentIndex(index)
|
||||
|
||||
if self._compute.user():
|
||||
self.uiEnableAuthenticationCheckBox.setChecked(True)
|
||||
self.uiServerUserLineEdit.setText(self._compute.user())
|
||||
@@ -78,7 +81,7 @@ class EditComputeDialog(QtWidgets.QDialog, Ui_EditComputeDialog):
|
||||
|
||||
host = self.uiServerHostLineEdit.text().strip()
|
||||
name = self.uiServerNameLineEdit.text().strip()
|
||||
protocol = "http"
|
||||
protocol = self.uiServerProtocolComboBox.currentText().lower()
|
||||
port = self.uiServerPortSpinBox.value()
|
||||
user = self.uiServerUserLineEdit.text().strip()
|
||||
password = self.uiServerPasswordLineEdit.text().strip()
|
||||
|
||||
@@ -108,14 +108,19 @@ class EditProjectDialog(QtWidgets.QDialog, Ui_EditProjectDialog):
|
||||
"""
|
||||
|
||||
if result:
|
||||
self._project.setName(self.uiProjectNameLineEdit.text())
|
||||
self._project.setAutoOpen(self.uiProjectAutoOpenCheckBox.isChecked())
|
||||
self._project.setAutoClose(not self.uiProjectAutoCloseCheckBox.isChecked())
|
||||
self._project.setAutoStart(self.uiProjectAutoStartCheckBox.isChecked())
|
||||
self._project.setSceneHeight(self.uiSceneHeightSpinBox.value())
|
||||
self._project.setSceneWidth(self.uiSceneWidthSpinBox.value())
|
||||
self._project.setNodeGridSize(self.uiNodeGridSizeSpinBox.value())
|
||||
self._project.setDrawingGridSize(self.uiDrawingGridSizeSpinBox.value())
|
||||
self._project.setVariables(self._cleanVariables())
|
||||
self._project.update()
|
||||
node_grid_size = self.uiNodeGridSizeSpinBox.value()
|
||||
drawing_grid_size = self.uiDrawingGridSizeSpinBox.value()
|
||||
if node_grid_size % drawing_grid_size != 0:
|
||||
QtWidgets.QMessageBox.critical(self, "Grid sizes", "Invalid grid sizes which will create overlapping lines")
|
||||
else:
|
||||
self._project.setNodeGridSize(node_grid_size)
|
||||
self._project.setDrawingGridSize(drawing_grid_size)
|
||||
self._project.setName(self.uiProjectNameLineEdit.text())
|
||||
self._project.setAutoOpen(self.uiProjectAutoOpenCheckBox.isChecked())
|
||||
self._project.setAutoClose(not self.uiProjectAutoCloseCheckBox.isChecked())
|
||||
self._project.setAutoStart(self.uiProjectAutoStartCheckBox.isChecked())
|
||||
self._project.setSceneHeight(self.uiSceneHeightSpinBox.value())
|
||||
self._project.setSceneWidth(self.uiSceneWidthSpinBox.value())
|
||||
self._project.setVariables(self._cleanVariables())
|
||||
self._project.update()
|
||||
super().done(result)
|
||||
|
||||
@@ -152,18 +152,18 @@ class NewTemplateWizard(QtWidgets.QWizard, Ui_NewTemplateWizard):
|
||||
"""
|
||||
|
||||
self.uiAppliancesTreeWidget.clear()
|
||||
parent_routers = QtWidgets.QTreeWidgetItem(self.uiAppliancesTreeWidget)
|
||||
parent_routers.setText(0, "Routers")
|
||||
parent_routers.setFlags(parent_routers.flags() & ~QtCore.Qt.ItemIsSelectable)
|
||||
parent_switches = QtWidgets.QTreeWidgetItem(self.uiAppliancesTreeWidget)
|
||||
parent_switches.setText(0, "Switches")
|
||||
parent_switches.setFlags(parent_switches.flags() & ~QtCore.Qt.ItemIsSelectable)
|
||||
parent_guests = QtWidgets.QTreeWidgetItem(self.uiAppliancesTreeWidget)
|
||||
parent_guests.setText(0, "Guests")
|
||||
parent_guests.setFlags(parent_guests.flags() & ~QtCore.Qt.ItemIsSelectable)
|
||||
parent_firewalls = QtWidgets.QTreeWidgetItem(self.uiAppliancesTreeWidget)
|
||||
parent_firewalls.setText(0, "Firewalls")
|
||||
parent_firewalls.setFlags(parent_guests.flags() & ~QtCore.Qt.ItemIsSelectable)
|
||||
parent_switches = QtWidgets.QTreeWidgetItem(self.uiAppliancesTreeWidget)
|
||||
parent_switches.setText(0, "Switches")
|
||||
parent_switches.setFlags(parent_guests.flags() & ~QtCore.Qt.ItemIsSelectable)
|
||||
parent_routers = QtWidgets.QTreeWidgetItem(self.uiAppliancesTreeWidget)
|
||||
parent_routers.setText(0, "Routers")
|
||||
parent_routers.setFlags(parent_guests.flags() & ~QtCore.Qt.ItemIsSelectable)
|
||||
parent_firewalls.setFlags(parent_firewalls.flags() & ~QtCore.Qt.ItemIsSelectable)
|
||||
self.uiAppliancesTreeWidget.expandAll()
|
||||
|
||||
for appliance in ApplianceManager.instance().appliances():
|
||||
@@ -268,7 +268,7 @@ class NewTemplateWizard(QtWidgets.QWizard, Ui_NewTemplateWizard):
|
||||
|
||||
super().done(result)
|
||||
if result:
|
||||
ApplianceManager.instance().appliances_changed_signal.disconnect(self._appliancesChangedSlot)
|
||||
#ApplianceManager.instance().appliances_changed_signal.disconnect(self._appliancesChangedSlot)
|
||||
from gns3.main_window import MainWindow
|
||||
if self.currentPage() == self.uiApplianceFromServerWizardPage:
|
||||
items = self.uiAppliancesTreeWidget.selectedItems()
|
||||
|
||||
@@ -128,7 +128,7 @@ class PreferencesDialog(QtWidgets.QDialog, Ui_PreferencesDialog):
|
||||
|
||||
# Class name, changed signal
|
||||
widget_to_watch = {
|
||||
#QtWidgets.QLineEdit: "textChanged",
|
||||
QtWidgets.QLineEdit: "textChanged",
|
||||
QtWidgets.QPlainTextEdit: "textChanged",
|
||||
# QtWidgets.QTreeWidget: "itemChanged",
|
||||
QtWidgets.QComboBox: "currentIndexChanged",
|
||||
|
||||
@@ -22,6 +22,7 @@ import shutil
|
||||
from gns3.qt import QtWidgets
|
||||
from gns3.local_config import LocalConfig
|
||||
from gns3.ui.profile_select_dialog_ui import Ui_ProfileSelectDialog
|
||||
from gns3.version import __version_info__
|
||||
|
||||
import logging
|
||||
log = logging.getLogger(__name__)
|
||||
@@ -39,8 +40,8 @@ class ProfileSelectDialog(QtWidgets.QDialog, Ui_ProfileSelectDialog):
|
||||
self._main.hide()
|
||||
parent = self._main
|
||||
super().__init__(parent)
|
||||
self.setupUi(self)
|
||||
|
||||
self.setupUi(self)
|
||||
self.uiNewPushButton.clicked.connect(self._newPushButtonSlot)
|
||||
self.uiDeletePushButton.clicked.connect(self._deletePushButtonSlot)
|
||||
|
||||
@@ -48,12 +49,13 @@ class ProfileSelectDialog(QtWidgets.QDialog, Ui_ProfileSelectDialog):
|
||||
screen = QtWidgets.QApplication.desktop().screenGeometry()
|
||||
self.move(screen.center() - self.rect().center())
|
||||
|
||||
version = "{}.{}".format(__version_info__[0], __version_info__[1])
|
||||
if sys.platform.startswith("win"):
|
||||
appdata = os.path.expandvars("%APPDATA%")
|
||||
path = os.path.join(appdata, "GNS3")
|
||||
path = os.path.join(appdata, "GNS3", version)
|
||||
else:
|
||||
home = os.path.expanduser("~")
|
||||
path = os.path.join(home, ".config", "GNS3")
|
||||
path = os.path.join(home, ".config", "GNS3", version)
|
||||
self.profiles_path = os.path.join(path, "profiles")
|
||||
|
||||
self.uiShowAtStartupCheckBox.setChecked(LocalConfig.instance().multiProfiles())
|
||||
@@ -65,9 +67,9 @@ class ProfileSelectDialog(QtWidgets.QDialog, Ui_ProfileSelectDialog):
|
||||
|
||||
try:
|
||||
if os.path.exists(self.profiles_path):
|
||||
for profil in sorted(os.listdir(self.profiles_path)):
|
||||
if not profil.startswith("."):
|
||||
self.uiProfileSelectComboBox.addItem(profil)
|
||||
for profile in sorted(os.listdir(self.profiles_path)):
|
||||
if not profile.startswith("."):
|
||||
self.uiProfileSelectComboBox.addItem(profile)
|
||||
except OSError:
|
||||
pass
|
||||
|
||||
@@ -79,7 +81,7 @@ class ProfileSelectDialog(QtWidgets.QDialog, Ui_ProfileSelectDialog):
|
||||
super().accept()
|
||||
|
||||
def _newPushButtonSlot(self):
|
||||
profile, ok = QtWidgets.QInputDialog.getText(self.parent(), "New profile", "Profile name:")
|
||||
profile, ok = QtWidgets.QInputDialog.getText(self, "New profile", "Profile name:")
|
||||
if ok:
|
||||
self.uiProfileSelectComboBox.addItem(profile)
|
||||
self.uiProfileSelectComboBox.setCurrentText(profile)
|
||||
@@ -88,13 +90,13 @@ class ProfileSelectDialog(QtWidgets.QDialog, Ui_ProfileSelectDialog):
|
||||
def _deletePushButtonSlot(self):
|
||||
profile = self.uiProfileSelectComboBox.currentText()
|
||||
if profile == "default":
|
||||
QtWidgets.QMessageBox.critical(self.parentWidget(), "Delete profile", "You can't delete the default profile")
|
||||
QtWidgets.QMessageBox.critical(self, "Delete profile", "The default profile cannot be deleted")
|
||||
else:
|
||||
try:
|
||||
shutil.rmtree(os.path.join(self.profiles_path, profile))
|
||||
self._refresh()
|
||||
except (OSError, PermissionError) as e:
|
||||
QtWidgets.QMessageBox.critical(self.parentWidget(), "Delete profile", str(e))
|
||||
QtWidgets.QMessageBox.critical(self, "Cannot delete profile", str(e))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
@@ -135,17 +135,20 @@ class ProjectDialog(QtWidgets.QDialog, Ui_ProjectDialog):
|
||||
new_project_name)
|
||||
name = name.strip()
|
||||
if reply and len(name) > 0:
|
||||
|
||||
reset_mac_addresses = self.uiResetMacAddressesCheckBox.isChecked()
|
||||
|
||||
if Controller.instance().isRemote():
|
||||
Controller.instance().post("/projects/{project_id}/duplicate".format(project_id=project_id),
|
||||
self._duplicateCallback,
|
||||
body={"name": name},
|
||||
body={"name": name, "reset_mac_addresses": reset_mac_addresses},
|
||||
progressText="Duplicating project '{}'...".format(name),
|
||||
timeout=None)
|
||||
else:
|
||||
project_location = os.path.join(Topology.instance().projectsDirPath(), name)
|
||||
Controller.instance().post("/projects/{project_id}/duplicate".format(project_id=project_id),
|
||||
self._duplicateCallback,
|
||||
body={"name": name, "path": project_location},
|
||||
body={"name": name, "path": project_location, "reset_mac_addresses": reset_mac_addresses},
|
||||
progressText="Duplicating project '{}'...".format(name),
|
||||
timeout=None)
|
||||
|
||||
@@ -234,13 +237,13 @@ class ProjectDialog(QtWidgets.QDialog, Ui_ProjectDialog):
|
||||
"""
|
||||
|
||||
menu = QtWidgets.QMenu()
|
||||
menu.triggered.connect(self._menuTriggeredSlot)
|
||||
if Controller.instance().isRemote():
|
||||
for action in self._main_window.recent_project_actions:
|
||||
menu.addAction(action)
|
||||
else:
|
||||
for action in self._main_window.recent_file_actions:
|
||||
menu.addAction(action)
|
||||
menu.triggered.connect(self._menuTriggeredSlot)
|
||||
menu.exec_(QtGui.QCursor.pos())
|
||||
|
||||
def _overwriteProjectCallback(self, result, error=False, **kwargs):
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import sys
|
||||
import os
|
||||
import datetime
|
||||
|
||||
from gns3.qt import QtCore, QtWidgets
|
||||
@@ -54,9 +55,19 @@ class ExportProjectWizard(QtWidgets.QWizard, Ui_ExportProjectWizard):
|
||||
self.uiCompressionComboBox.setCurrentIndex(1)
|
||||
self.helpRequested.connect(self._showHelpSlot)
|
||||
self.uiPathBrowserToolButton.clicked.connect(self._pathBrowserSlot)
|
||||
self._loadReadme()
|
||||
|
||||
readme_text = "Project: '{}' created on {}\nAuthor: John Doe <john.doe@example.com>\n\nNo project description was given".format(self._project.name(), datetime.date.today())
|
||||
self.uiReadmeTextEdit.setPlainText(readme_text)
|
||||
def _loadReadme(self):
|
||||
|
||||
self._project.get("/files/README.txt", self._loadedReadme)
|
||||
|
||||
def _loadedReadme(self, result, error=False, raw_body=None, context={}, **kwargs):
|
||||
|
||||
if not error:
|
||||
self.uiReadmeTextEdit.setPlainText(raw_body.decode("utf-8", errors="replace"))
|
||||
else:
|
||||
readme_text = "Project: '{}' created on {}\nAuthor: John Doe <john.doe@example.com>\n\nNo project description was given".format(self._project.name(), datetime.date.today())
|
||||
self.uiReadmeTextEdit.setPlainText(readme_text)
|
||||
|
||||
def _pathBrowserSlot(self):
|
||||
|
||||
@@ -119,8 +130,16 @@ class ExportProjectWizard(QtWidgets.QWizard, Ui_ExportProjectWizard):
|
||||
include_images = "yes"
|
||||
else:
|
||||
include_images = "no"
|
||||
if self.uiIncludeSnapshotsCheckBox.isChecked():
|
||||
include_snapshots = "yes"
|
||||
else:
|
||||
include_snapshots = "no"
|
||||
if self.uiResetMacAddressesCheckBox.isChecked():
|
||||
reset_mac_addresses = "yes"
|
||||
else:
|
||||
reset_mac_addresses = "no"
|
||||
compression = self.uiCompressionComboBox.currentData()
|
||||
export_worker = ExportProjectWorker(self._project, self._path, include_images, compression)
|
||||
export_worker = ExportProjectWorker(self._project, self._path, include_images, include_snapshots, reset_mac_addresses, compression)
|
||||
progress_dialog = ProgressDialog(export_worker, "Exporting project", "Exporting portable project files...", "Cancel", parent=self, create_thread=False)
|
||||
progress_dialog.show()
|
||||
progress_dialog.exec_()
|
||||
|
||||
@@ -37,9 +37,7 @@ class ProjectWelcomeDialog(QtWidgets.QDialog, Ui_ProjectWelcomeDialog):
|
||||
self.uiOkButton.clicked.connect(self._okButtonClickedSlot)
|
||||
self.gridLayout.setAlignment(QtCore.Qt.AlignTop)
|
||||
self.label.setOpenExternalLinks(True)
|
||||
|
||||
self._variables = self._getVariables(project)
|
||||
|
||||
self._loadReadme()
|
||||
self._addMisingVariablesEdits()
|
||||
|
||||
@@ -50,10 +48,11 @@ class ProjectWelcomeDialog(QtWidgets.QDialog, Ui_ProjectWelcomeDialog):
|
||||
return variables
|
||||
|
||||
def _addMisingVariablesEdits(self):
|
||||
missing = [v for v in self._variables if v.get("value", "").strip() == ""]
|
||||
#TODO: refactor this to use a QListWidget
|
||||
missing = [v for v in self._variables if v.get("name") and v.get("value", "").strip() == ""]
|
||||
for i, variable in enumerate(missing, start=0):
|
||||
nameLabel = QtWidgets.QLabel()
|
||||
nameLabel.setText(variable.get("name", ""))
|
||||
nameLabel.setText(variable.get("name") + ":")
|
||||
self.gridLayout.addWidget(nameLabel, i, 0)
|
||||
|
||||
valueEdit = QtWidgets.QLineEdit()
|
||||
@@ -72,13 +71,13 @@ class ProjectWelcomeDialog(QtWidgets.QDialog, Ui_ProjectWelcomeDialog):
|
||||
variable["value"] = text
|
||||
|
||||
def _okButtonClickedSlot(self):
|
||||
missing = [v for v in self._variables if v.get("value", "").strip() == ""]
|
||||
missing = [v for v in self._variables if v.get("name") and v.get("value", "").strip() == ""]
|
||||
if len(missing) > 0:
|
||||
reply = QtWidgets.QMessageBox.warning(
|
||||
self, 'Missing values',
|
||||
'Are you sure you want to continue without providing missing values?',
|
||||
QtWidgets.QMessageBox.Yes,
|
||||
QtWidgets.QMessageBox.No)
|
||||
reply = QtWidgets.QMessageBox.warning(self,
|
||||
"Missing values",
|
||||
"Are you sure you want to continue without providing missing values?",
|
||||
QtWidgets.QMessageBox.Yes,
|
||||
QtWidgets.QMessageBox.No)
|
||||
if reply == QtWidgets.QMessageBox.No:
|
||||
return
|
||||
|
||||
|
||||
@@ -43,15 +43,18 @@ class SetupWizard(QtWidgets.QWizard, Ui_SetupWizard):
|
||||
|
||||
super().__init__(parent)
|
||||
self.setupUi(self)
|
||||
self.adjustSize()
|
||||
|
||||
self._gns3_vm_settings = {
|
||||
"enable": True,
|
||||
"headless": False,
|
||||
"when_exit": "stop",
|
||||
"engine": "vmware",
|
||||
"allocate_vcpus_ram": True,
|
||||
"vcpus": 1,
|
||||
"ram": 2048,
|
||||
"vmname": "GNS3 VM"
|
||||
"vmname": "GNS3 VM",
|
||||
"port": 80
|
||||
}
|
||||
|
||||
self.setWizardStyle(QtWidgets.QWizard.ModernStyle)
|
||||
@@ -65,7 +68,6 @@ class SetupWizard(QtWidgets.QWizard, Ui_SetupWizard):
|
||||
self.uiRefreshPushButton.clicked.connect(self._refreshVMListSlot)
|
||||
self.uiVmwareRadioButton.clicked.connect(self._listVMwareVMsSlot)
|
||||
self.uiVirtualBoxRadioButton.clicked.connect(self._listVirtualBoxVMsSlot)
|
||||
self.uiVMwareBannerButton.clicked.connect(self._VMwareBannerButtonClickedSlot)
|
||||
settings = parent.settings()
|
||||
self.uiShowCheckBox.setChecked(settings["hide_setup_wizard"])
|
||||
|
||||
@@ -83,14 +85,14 @@ class SetupWizard(QtWidgets.QWizard, Ui_SetupWizard):
|
||||
if address.protocol() in [QtNetwork.QAbstractSocket.IPv4Protocol, QtNetwork.QAbstractSocket.IPv6Protocol]:
|
||||
address_string = address.toString()
|
||||
if address_string.startswith("169.254") or address_string.startswith("fe80"):
|
||||
# ignore link-local addresses
|
||||
# ignore link-local addresses, could not use https://doc.qt.io/qt-5/qhostaddress.html#isLinkLocal
|
||||
# because it was introduced in Qt 5.11
|
||||
continue
|
||||
self.uiLocalServerHostComboBox.addItem(address_string, address_string)
|
||||
|
||||
if sys.platform.startswith("darwin"):
|
||||
self.uiVMwareBannerButton.setIcon(QtGui.QIcon(":/images/vmware_fusion_banner.png"))
|
||||
else:
|
||||
self.uiVMwareBannerButton.setIcon(QtGui.QIcon(":/images/vmware_workstation_banner.png"))
|
||||
self.uiLocalServerHostComboBox.addItem("localhost", "localhost") # local host
|
||||
self.uiLocalServerHostComboBox.addItem("::", "::") # all IPv6 addresses
|
||||
self.uiLocalServerHostComboBox.addItem("0.0.0.0", "0.0.0.0") # all IPv4 addresses
|
||||
|
||||
if sys.platform.startswith("linux"):
|
||||
self.uiLocalRadioButton.setChecked(True)
|
||||
@@ -114,13 +116,6 @@ class SetupWizard(QtWidgets.QWizard, Ui_SetupWizard):
|
||||
|
||||
self.uiLocalServerPathLineEdit.setText(path)
|
||||
|
||||
def _VMwareBannerButtonClickedSlot(self):
|
||||
if sys.platform.startswith("darwin"):
|
||||
url = "http://send.onenetworkdirect.net/z/621395/CD225091/"
|
||||
else:
|
||||
url = "http://send.onenetworkdirect.net/z/616207/CD225091/"
|
||||
QtGui.QDesktopServices.openUrl(QtCore.QUrl(url))
|
||||
|
||||
def _listVMwareVMsSlot(self):
|
||||
"""
|
||||
Slot to refresh the VMware VMs list.
|
||||
@@ -141,7 +136,6 @@ class SetupWizard(QtWidgets.QWizard, Ui_SetupWizard):
|
||||
Slot to refresh the VirtualBox VMs list.
|
||||
"""
|
||||
|
||||
QtWidgets.QMessageBox.warning(self, "GNS3 VM on VirtualBox", "VirtualBox doesn't support nested virtualization, this means running Qemu based VM could be very slow")
|
||||
download_url = "https://github.com/GNS3/gns3-gui/releases/download/v{version}/GNS3.VM.VirtualBox.{version}.zip".format(version=__version__)
|
||||
self.uiGNS3VMDownloadLinkUrlLabel.setText('If you don\'t have the GNS3 Virtual Machine you can <a href="{download_url}">download it here</a>.<br>And import the VM in the virtualization software and hit refresh.'.format(download_url=download_url))
|
||||
self.uiVmwareRadioButton.setChecked(False)
|
||||
@@ -414,11 +408,8 @@ class SetupWizard(QtWidgets.QWizard, Ui_SetupWizard):
|
||||
settings["hide_setup_wizard"] = True
|
||||
else:
|
||||
local_server_settings = LocalServer.instance().localServerSettings()
|
||||
if local_server_settings["host"] is None:
|
||||
local_server_settings["host"] = DEFAULT_LOCAL_SERVER_HOST
|
||||
LocalServer.instance().updateLocalServerSettings(local_server_settings)
|
||||
settings["hide_setup_wizard"] = self.uiShowCheckBox.isChecked()
|
||||
|
||||
LocalServer.instance().updateLocalServerSettings(local_server_settings)
|
||||
settings["hide_setup_wizard"] = not self.uiShowCheckBox.isChecked()
|
||||
self.parentWidget().setSettings(settings)
|
||||
super().done(result)
|
||||
|
||||
|
||||
@@ -161,6 +161,8 @@ class SymbolSelectionDialog(QtWidgets.QDialog, Ui_SymbolSelectionDialog):
|
||||
"""
|
||||
|
||||
symbol_path = self.getSymbol()
|
||||
if not symbol_path:
|
||||
return False
|
||||
for item in self._items:
|
||||
item.setSymbol(symbol_path)
|
||||
return True
|
||||
@@ -169,7 +171,7 @@ class SymbolSelectionDialog(QtWidgets.QDialog, Ui_SymbolSelectionDialog):
|
||||
|
||||
if self.uiSymbolTreeWidget.isEnabled():
|
||||
current = self.uiSymbolTreeWidget.currentItem()
|
||||
if current:
|
||||
if current and current.parent():
|
||||
return current.data(0, QtCore.Qt.UserRole).id()
|
||||
else:
|
||||
return os.path.basename(self.uiSymbolLineEdit.text())
|
||||
|
||||
@@ -49,7 +49,7 @@ from .compute_manager import ComputeManager
|
||||
from .utils.get_icon import get_icon
|
||||
|
||||
# link items
|
||||
from .items.link_item import LinkItem
|
||||
from .items.link_item import LinkItem, SvgIconItem
|
||||
from .items.ethernet_link_item import EthernetLinkItem
|
||||
from .items.serial_link_item import SerialLinkItem
|
||||
|
||||
@@ -460,25 +460,15 @@ class GraphicsView(QtWidgets.QGraphicsView):
|
||||
else:
|
||||
item.setSelected(True)
|
||||
elif is_not_link and is_not_logo and event.button() == QtCore.Qt.RightButton and not self._adding_link:
|
||||
if item and not sip.isdeleted(item):
|
||||
# Prevent right clicking on a selected item from de-selecting all other items
|
||||
if not item.isSelected():
|
||||
if not event.modifiers() & QtCore.Qt.ControlModifier:
|
||||
for it in self.scene().items():
|
||||
it.setSelected(False)
|
||||
item.setSelected(True)
|
||||
self._showDeviceContextualMenu(QtGui.QCursor.pos())
|
||||
else:
|
||||
self._showDeviceContextualMenu(QtGui.QCursor.pos())
|
||||
# when more than one item is selected display the contextual menu even if mouse is not above an item
|
||||
elif len(self.scene().selectedItems()) > 1:
|
||||
self._showDeviceContextualMenu(QtGui.QCursor.pos())
|
||||
pass #TODO: remove this without creating a bug...
|
||||
elif is_not_link and self._adding_link and event.button() == QtCore.Qt.RightButton:
|
||||
# send a escape key to the main window to cancel the link addition
|
||||
key = QtGui.QKeyEvent(QtCore.QEvent.KeyPress, QtCore.Qt.Key_Escape, QtCore.Qt.NoModifier)
|
||||
QtWidgets.QApplication.sendEvent(self._main_window, key)
|
||||
elif item and isinstance(item, NodeItem) and self._adding_link and event.button() == QtCore.Qt.LeftButton:
|
||||
self._userNodeLinking(event, item)
|
||||
#context_event = QtGui.QContextMenuEvent(QtGui.QContextMenuEvent.Mouse, event.pos())
|
||||
#QtWidgets.QApplication.sendEvent(self, context_event)
|
||||
elif event.button() == QtCore.Qt.LeftButton and self._adding_note:
|
||||
pos = self.mapToScene(event.pos())
|
||||
note = self.createDrawingItem("text", pos.x(), pos.y(), 2)
|
||||
@@ -512,6 +502,46 @@ class GraphicsView(QtWidgets.QGraphicsView):
|
||||
|
||||
self.toggleUiDeviceMenu()
|
||||
|
||||
def contextMenuEvent(self, event):
|
||||
"""
|
||||
Handles all context menu events.
|
||||
|
||||
:param event: QContextMenuEvent instance
|
||||
"""
|
||||
|
||||
is_not_link = True
|
||||
is_not_logo = True
|
||||
|
||||
item = self.itemAt(event.pos())
|
||||
if item and sip.isdeleted(item):
|
||||
return
|
||||
|
||||
if item and (isinstance(item, LinkItem) or isinstance(item.parentItem(), LinkItem)):
|
||||
is_not_link = False
|
||||
if item and (isinstance(item, LogoItem) or isinstance(item.parentItem(), LogoItem)):
|
||||
is_not_logo = False
|
||||
else:
|
||||
for it in self.scene().items():
|
||||
if isinstance(it, LinkItem):
|
||||
it.setHovered(False)
|
||||
|
||||
if is_not_link and is_not_logo and not self._adding_link:
|
||||
if item and not sip.isdeleted(item):
|
||||
# Prevent right clicking on a selected item from de-selecting all other items
|
||||
if not item.isSelected():
|
||||
if not event.modifiers() & QtCore.Qt.ControlModifier:
|
||||
for it in self.scene().items():
|
||||
it.setSelected(False)
|
||||
item.setSelected(True)
|
||||
self._showDeviceContextualMenu(event.globalPos())
|
||||
# when more than one item is selected display the contextual menu even if mouse is not above an item
|
||||
elif len(self.scene().selectedItems()) > 1:
|
||||
self._showDeviceContextualMenu(event.globalPos())
|
||||
#elif item and isinstance(item, NodeItem) and self._adding_link:
|
||||
# self._userNodeLinking(event, item)
|
||||
else:
|
||||
super().contextMenuEvent(event)
|
||||
|
||||
def mouseReleaseEvent(self, event):
|
||||
"""
|
||||
Handles all mouse release events.
|
||||
@@ -627,7 +657,7 @@ class GraphicsView(QtWidgets.QGraphicsView):
|
||||
if not self._adding_link:
|
||||
if isinstance(item, NodeItem) and item.node().initialized():
|
||||
item.setSelected(True)
|
||||
if item.node().status() == Node.stopped or item.node().isAlwaysOn():
|
||||
if item.node().status() == Node.stopped or item.node().consoleType() == "none":
|
||||
self.configureSlot()
|
||||
return
|
||||
else:
|
||||
@@ -724,6 +754,11 @@ class GraphicsView(QtWidgets.QGraphicsView):
|
||||
self.populateDeviceContextualMenu(menu)
|
||||
menu.exec_(pos)
|
||||
menu.clear()
|
||||
# Make sure to deselect all items.
|
||||
# This is to prevent a bug on Windows
|
||||
# see https://github.com/GNS3/gns3-gui/issues/2986
|
||||
for it in self.scene().items():
|
||||
it.setSelected(False)
|
||||
|
||||
def populateDeviceContextualMenu(self, menu):
|
||||
"""
|
||||
@@ -826,19 +861,19 @@ class GraphicsView(QtWidgets.QGraphicsView):
|
||||
bring_to_front_action.triggered.connect(self.bringToFrontSlot)
|
||||
menu.addAction(bring_to_front_action)
|
||||
|
||||
if True in list(map(lambda item: isinstance(item, NodeItem) and hasattr(item.node(), "configFiles"), items)):
|
||||
if True in list(map(lambda item: isinstance(item, NodeItem) and bool(item.node().configFiles()), items)):
|
||||
import_config_action = QtWidgets.QAction("Import config", menu)
|
||||
import_config_action.setIcon(get_icon("import.svg"))
|
||||
import_config_action.triggered.connect(self.importConfigActionSlot)
|
||||
menu.addAction(import_config_action)
|
||||
|
||||
if True in list(map(lambda item: isinstance(item, NodeItem) and hasattr(item.node(), "configFiles"), items)):
|
||||
if True in list(map(lambda item: isinstance(item, NodeItem) and bool(item.node().configFiles()), items)):
|
||||
export_config_action = QtWidgets.QAction("Export config", menu)
|
||||
export_config_action.setIcon(get_icon("export.svg"))
|
||||
export_config_action.triggered.connect(self.exportConfigActionSlot)
|
||||
menu.addAction(export_config_action)
|
||||
|
||||
if True in list(map(lambda item: isinstance(item, NodeItem) and hasattr(item.node(), "configFiles"), items)):
|
||||
if True in list(map(lambda item: isinstance(item, NodeItem) and bool(item.node().configTextFiles()), items)):
|
||||
export_config_action = QtWidgets.QAction("Edit config", menu)
|
||||
export_config_action.setIcon(get_icon("edit.svg"))
|
||||
export_config_action.triggered.connect(self.editConfigActionSlot)
|
||||
@@ -988,6 +1023,9 @@ class GraphicsView(QtWidgets.QGraphicsView):
|
||||
if isinstance(item, NodeItem) and item.node().initialized():
|
||||
new_hostname, ok = QtWidgets.QInputDialog.getText(self, "Change hostname", "Hostname:", QtWidgets.QLineEdit.Normal, item.node().name())
|
||||
if ok:
|
||||
if not new_hostname.strip():
|
||||
QtWidgets.QMessageBox.critical(self, "Change hostname", "Hostname cannot be blank")
|
||||
continue
|
||||
if hasattr(item.node(), "validateHostname"):
|
||||
if not item.node().validateHostname(new_hostname):
|
||||
QtWidgets.QMessageBox.critical(self, "Change hostname", "Invalid name detected for this node: {}".format(new_hostname))
|
||||
@@ -1054,8 +1092,7 @@ class GraphicsView(QtWidgets.QGraphicsView):
|
||||
|
||||
# TightVNC has lack support of IPv6 host at this moment
|
||||
if "vncviewer" in node.consoleCommand() and ":" in node.consoleHost():
|
||||
QtWidgets.QMessageBox.warning(
|
||||
self, "TightVNC", "TightVNC (vncviewer) may not start because of lack of IPv6 support.")
|
||||
QtWidgets.QMessageBox.warning(self, "TightVNC", "TightVNC (vncviewer) may not start because of lack of IPv6 support.")
|
||||
|
||||
try:
|
||||
node.openConsole(aux=aux)
|
||||
@@ -1096,11 +1133,21 @@ class GraphicsView(QtWidgets.QGraphicsView):
|
||||
|
||||
def consoleFromAllItems(self):
|
||||
"""
|
||||
Console from all scene items, except builtin devices.
|
||||
Console from all scene items with console type different than "none"
|
||||
"""
|
||||
|
||||
items = [item for item in self.scene().items()
|
||||
if not (isinstance(item, NodeItem) and isinstance(item.node().module(), Builtin))]
|
||||
if isinstance(item, NodeItem) and item.node().consoleType() != "none"]
|
||||
nb_items = len(items)
|
||||
if nb_items > 10:
|
||||
proceed = QtWidgets.QMessageBox.question(self,
|
||||
"Console to all nodes",
|
||||
"You are about to open console windows to {} nodes. Are you sure?".format(nb_items),
|
||||
QtWidgets.QMessageBox.Yes,
|
||||
QtWidgets.QMessageBox.No)
|
||||
|
||||
if proceed == QtWidgets.QMessageBox.No:
|
||||
return
|
||||
self.consoleFromItems(items)
|
||||
|
||||
def consoleActionSlot(self):
|
||||
@@ -1116,24 +1163,20 @@ class GraphicsView(QtWidgets.QGraphicsView):
|
||||
Allow user to use a custom console for this VM
|
||||
"""
|
||||
|
||||
current_cmd = None
|
||||
console_type = "telnet"
|
||||
for item in self.scene().selectedItems():
|
||||
if isinstance(item, NodeItem) and item.node().console() is not None and item.node().initialized() and item.node().status() == Node.started:
|
||||
if isinstance(item, NodeItem) and item.node().console() is not None and item.node().initialized():
|
||||
if item.node().consoleType() not in ("telnet", "serial", "vnc", "spice", "spice+agent"):
|
||||
continue
|
||||
current_cmd = item.node().consoleCommand()
|
||||
console_type = item.node().consoleType()
|
||||
|
||||
(ok, cmd) = ConsoleCommandDialog.getCommand(self, console_type=console_type, current=current_cmd)
|
||||
if ok:
|
||||
for item in self.scene().selectedItems():
|
||||
if isinstance(item, NodeItem) and item.node().console() is not None and item.node().initialized() and item.node().status() == Node.started:
|
||||
node = item.node()
|
||||
if node.consoleType() not in ("telnet", "serial", "vnc", "spice", "spice+agent"):
|
||||
continue
|
||||
(ok, cmd) = ConsoleCommandDialog.getCommand(self, console_type=console_type, current=current_cmd)
|
||||
if ok:
|
||||
try:
|
||||
node.openConsole(command=cmd)
|
||||
if item.node().status() != Node.started:
|
||||
QtWidgets.QMessageBox.warning(self, "Console", "This node must be started before a console can be opened")
|
||||
continue
|
||||
item.node().openConsole(command=cmd)
|
||||
except (OSError, ValueError) as e:
|
||||
QtWidgets.QMessageBox.critical(self, "Console", "Cannot start console application: {}".format(e))
|
||||
|
||||
@@ -1183,7 +1226,7 @@ class GraphicsView(QtWidgets.QGraphicsView):
|
||||
|
||||
items = []
|
||||
for item in self.scene().selectedItems():
|
||||
if isinstance(item, NodeItem) and hasattr(item.node(), "configFiles") and item.node().initialized():
|
||||
if isinstance(item, NodeItem) and item.node().configFiles() and item.node().initialized():
|
||||
items.append(item)
|
||||
|
||||
if not items:
|
||||
@@ -1199,12 +1242,12 @@ class GraphicsView(QtWidgets.QGraphicsView):
|
||||
|
||||
path, _ = QtWidgets.QFileDialog.getOpenFileName(self,
|
||||
"Import {}".format(os.path.basename(config_file)),
|
||||
self._import_config_dir,
|
||||
self._import_config_directory,
|
||||
"All files (*.*);;Config files (*.cfg)",
|
||||
"Config files (*.cfg)")
|
||||
if not path:
|
||||
continue
|
||||
self._import_config_dir = os.path.dirname(path)
|
||||
self._import_config_directory = os.path.dirname(path)
|
||||
item.node().importFile(config_file, path)
|
||||
|
||||
def editConfigActionSlot(self):
|
||||
@@ -1214,17 +1257,17 @@ class GraphicsView(QtWidgets.QGraphicsView):
|
||||
|
||||
items = []
|
||||
for item in self.scene().selectedItems():
|
||||
if isinstance(item, NodeItem) and hasattr(item.node(), "configFiles") and item.node().initialized():
|
||||
if isinstance(item, NodeItem) and item.node().configTextFiles() and item.node().initialized():
|
||||
items.append(item)
|
||||
|
||||
if not items:
|
||||
return
|
||||
|
||||
for item in items:
|
||||
if len(item.node().configFiles()) == 1:
|
||||
config_file = item.node().configFiles()[0]
|
||||
if len(item.node().configTextFiles()) == 1:
|
||||
config_file = item.node().configTextFiles()[0]
|
||||
else:
|
||||
config_file, ok = QtWidgets.QInputDialog.getItem(self, "Edit file", "File to edit?", item.node().configFiles(), 0, False)
|
||||
config_file, ok = QtWidgets.QInputDialog.getItem(self, "Edit file", "File to edit?", item.node().configTextFiles(), 0, False)
|
||||
if not ok:
|
||||
continue
|
||||
dialog = FileEditorDialog(item.node(), config_file, parent=self)
|
||||
@@ -1239,7 +1282,7 @@ class GraphicsView(QtWidgets.QGraphicsView):
|
||||
|
||||
items = []
|
||||
for item in self.scene().selectedItems():
|
||||
if isinstance(item, NodeItem) and hasattr(item.node(), "configFiles") and item.node().initialized():
|
||||
if isinstance(item, NodeItem) and item.node().configFiles() and item.node().initialized():
|
||||
items.append(item)
|
||||
|
||||
if not items:
|
||||
@@ -1485,7 +1528,7 @@ class GraphicsView(QtWidgets.QGraphicsView):
|
||||
"""
|
||||
|
||||
for item in self.scene().selectedItems():
|
||||
if not isinstance(item, LinkItem) and not isinstance(item, LabelItem):
|
||||
if not isinstance(item, LinkItem) and not isinstance(item, LabelItem) and not isinstance(item, SvgIconItem):
|
||||
if item.locked() is True:
|
||||
item.setLocked(False)
|
||||
else:
|
||||
@@ -1503,7 +1546,14 @@ class GraphicsView(QtWidgets.QGraphicsView):
|
||||
selected_nodes = []
|
||||
for item in self.scene().selectedItems():
|
||||
if isinstance(item, NodeItem):
|
||||
selected_nodes.append(item.node())
|
||||
node = item.node()
|
||||
if node.locked():
|
||||
QtWidgets.QMessageBox.critical(self, "Delete", "Cannot delete node '{}' because it is locked".format(node.name()))
|
||||
return
|
||||
selected_nodes.append(node)
|
||||
if isinstance(item, DrawingItem) and item.locked():
|
||||
QtWidgets.QMessageBox.critical(self, "Delete", "Cannot delete drawing because it is locked")
|
||||
return
|
||||
if selected_nodes:
|
||||
if len(selected_nodes) > 1:
|
||||
question = "Do you want to permanently delete these {} nodes?".format(len(selected_nodes))
|
||||
@@ -1598,10 +1648,12 @@ class GraphicsView(QtWidgets.QGraphicsView):
|
||||
def drawBackground(self, painter, rect):
|
||||
super().drawBackground(painter, rect)
|
||||
if self._main_window.uiShowGridAction.isChecked():
|
||||
grids = [(self.drawingGridSize(),QtGui.QColor(208, 208, 208)),
|
||||
(self.nodeGridSize(),QtGui.QColor(190, 190, 190))]
|
||||
grids = [(self.drawingGridSize(), QtGui.QColor(208, 208, 208)),
|
||||
(self.nodeGridSize(), QtGui.QColor(190, 190, 190))]
|
||||
painter.save()
|
||||
for (grid,colour) in grids:
|
||||
for (grid, colour) in grids:
|
||||
if not grid:
|
||||
continue
|
||||
painter.setPen(QtGui.QPen(colour))
|
||||
|
||||
left = int(rect.left()) - (int(rect.left()) % grid)
|
||||
|
||||
@@ -18,18 +18,15 @@
|
||||
from .qt import sip
|
||||
import json
|
||||
import copy
|
||||
import http
|
||||
import uuid
|
||||
import pathlib
|
||||
import base64
|
||||
import datetime
|
||||
import ipaddress
|
||||
import urllib.request
|
||||
import urllib.parse
|
||||
|
||||
|
||||
from .version import __version__, __version_info__
|
||||
from .qt import QtCore, QtNetwork, qpartial, sip_is_deleted
|
||||
from .qt import QtCore, QtNetwork, QtWidgets, qpartial, sip_is_deleted
|
||||
from .utils import parse_version
|
||||
|
||||
import logging
|
||||
@@ -79,6 +76,18 @@ class HTTPClient(QtCore.QObject):
|
||||
self._shutdown = False # Shutdown in progress
|
||||
self._accept_insecure_certificate = settings.get("accept_insecure_certificate", None)
|
||||
|
||||
# Add custom CA
|
||||
# ssl_config = QtNetwork.QSslConfiguration.defaultConfiguration()
|
||||
# if ssl_config.addCaCertificates("/path/to/rootCA.crt"):
|
||||
# log.debug("CA certificate added")
|
||||
# QtNetwork.QSslConfiguration.setDefaultConfiguration(ssl_config)
|
||||
|
||||
if self._protocol == "https":
|
||||
if not QtNetwork.QSslSocket.supportsSsl():
|
||||
log.error("SSL is not supported")
|
||||
else:
|
||||
log.debug(f"SSL is supported, version: {QtNetwork.QSslSocket().sslLibraryBuildVersionString()}")
|
||||
|
||||
# In order to detect computer hibernation we detect the date of the last
|
||||
# query and disconnect if time is too long between two query
|
||||
self._last_query_timestamp = None
|
||||
@@ -93,6 +102,12 @@ class HTTPClient(QtCore.QObject):
|
||||
# List of query waiting for the connection
|
||||
self._query_waiting_connections = []
|
||||
|
||||
# To catch SSL errors
|
||||
self._network_manager.sslErrors.connect(self._sslErrorsSlot)
|
||||
|
||||
# Store SSL error exceptions
|
||||
self._ssl_exceptions = {}
|
||||
|
||||
def setMaxTimeDifferenceBetweenQueries(self, value):
|
||||
self._max_time_difference_between_queries = value
|
||||
|
||||
@@ -207,16 +222,16 @@ class HTTPClient(QtCore.QObject):
|
||||
Called when a query upload progress
|
||||
"""
|
||||
if not sip_is_deleted(HTTPClient._progress_callback):
|
||||
HTTPClient._progress_callback.progress_signal.emit(query_id, str(sent), str(total))
|
||||
HTTPClient._progress_callback.progress_signal.emit(query_id, str(abs(sent)), str(abs(total)))
|
||||
|
||||
def _notify_progress_download(self, query_id, sent, total):
|
||||
"""
|
||||
Called when a query download progress
|
||||
"""
|
||||
if not sip_is_deleted(HTTPClient._progress_callback):
|
||||
# abs() for maxium because sometimes the system send negative
|
||||
# abs() for maximum because sometimes the system send negative
|
||||
# values
|
||||
HTTPClient._progress_callback.progress_signal.emit(query_id, str(sent), str(abs(total)))
|
||||
HTTPClient._progress_callback.progress_signal.emit(query_id, str(abs(sent)), str(abs(total)))
|
||||
|
||||
@classmethod
|
||||
def setProgressCallback(cls, progress_callback):
|
||||
@@ -470,7 +485,16 @@ class HTTPClient(QtCore.QObject):
|
||||
"""
|
||||
host = self._getHostForQuery()
|
||||
request = websocket.request()
|
||||
request.setUrl(QtCore.QUrl("ws://{host}:{port}{prefix}{path}".format(host=host, port=self._port, path=path, prefix=prefix)))
|
||||
ws_protocol = "ws"
|
||||
if self._protocol == "https":
|
||||
ws_protocol = "wss"
|
||||
ws_url = "{protocol}://{host}:{port}{prefix}{path}".format(protocol=ws_protocol,
|
||||
host=host,
|
||||
port=self._port,
|
||||
path=path,
|
||||
prefix=prefix)
|
||||
log.debug("Connecting to WebSocket endpoint: {}".format(ws_url))
|
||||
request.setUrl(QtCore.QUrl(ws_url))
|
||||
self._addAuth(request)
|
||||
websocket.open(request)
|
||||
return websocket
|
||||
@@ -725,47 +749,103 @@ class HTTPClient(QtCore.QObject):
|
||||
e = HttpBadRequest(body)
|
||||
raise e
|
||||
|
||||
def getSynchronous(self, endpoint, timeout=2):
|
||||
def getSynchronous(self, method, endpoint, prefix="/v2", timeout=5):
|
||||
"""
|
||||
Synchronous check if a server is running
|
||||
|
||||
:returns: Tuple (Status code, json of anwser). Status 0 is a non HTTP error
|
||||
:returns: Tuple (Status code, json of answer). Status 0 is a non HTTP error
|
||||
"""
|
||||
try:
|
||||
url = "{protocol}://{host}:{port}/v2/{endpoint}".format(protocol=self._protocol, host=self._host, port=self._port, endpoint=endpoint)
|
||||
|
||||
if self._user is not None and len(self._user) > 0:
|
||||
log.debug("Synchronous get {} with user '{}'".format(url, self._user))
|
||||
auth_handler = urllib.request.HTTPBasicAuthHandler()
|
||||
auth_handler.add_password(realm="GNS3 server",
|
||||
uri=url,
|
||||
user=self._user,
|
||||
passwd=self._password)
|
||||
opener = urllib.request.build_opener(auth_handler)
|
||||
urllib.request.install_opener(opener)
|
||||
else:
|
||||
log.debug("Synchronous get {} (no authentication)".format(url))
|
||||
response = urllib.request.urlopen(url, timeout=timeout)
|
||||
content_type = response.getheader("CONTENT-TYPE")
|
||||
if response.status == 200:
|
||||
if content_type == "application/json":
|
||||
content = response.read()
|
||||
host = self._getHostForQuery()
|
||||
|
||||
log.debug("{method} {protocol}://{host}:{port}{prefix}{endpoint}".format(method=method, protocol=self._protocol, host=host, port=self._port, prefix=prefix, endpoint=endpoint))
|
||||
if self._user:
|
||||
url = QtCore.QUrl("{protocol}://{user}@{host}:{port}{prefix}{endpoint}".format(protocol=self._protocol, user=self._user, host=host, port=self._port, prefix=prefix, endpoint=endpoint))
|
||||
else:
|
||||
url = QtCore.QUrl("{protocol}://{host}:{port}{prefix}{endpoint}".format(protocol=self._protocol, host=host, port=self._port, prefix=prefix, endpoint=endpoint))
|
||||
|
||||
request = self._request(url)
|
||||
request = self._addAuth(request)
|
||||
request.setRawHeader(b"User-Agent", "GNS3 QT Client v{version}".format(version=__version__).encode())
|
||||
|
||||
try:
|
||||
response = self._network_manager.sendCustomRequest(request, method.encode())
|
||||
except SystemError as e:
|
||||
log.error("Can't send query: {}".format(str(e)))
|
||||
return
|
||||
|
||||
loop = QtCore.QEventLoop()
|
||||
response.finished.connect(loop.quit)
|
||||
|
||||
if timeout is not None:
|
||||
QtCore.QTimer.singleShot(timeout * 1000, qpartial(self._timeoutSlot, response, timeout))
|
||||
|
||||
if not loop.isRunning():
|
||||
loop.exec_()
|
||||
|
||||
status = response.attribute(QtNetwork.QNetworkRequest.HttpStatusCodeAttribute)
|
||||
if response.error() != QtNetwork.QNetworkReply.NoError:
|
||||
log.debug("Error while connecting to local server {}".format(response.errorString()))
|
||||
else:
|
||||
content_type = response.header(QtNetwork.QNetworkRequest.ContentTypeHeader)
|
||||
if status == 200 and content_type == "application/json":
|
||||
content = bytes(response.readAll())
|
||||
try:
|
||||
json_data = json.loads(content.decode("utf-8"))
|
||||
return response.status, json_data
|
||||
else:
|
||||
return response.status, None
|
||||
except http.client.InvalidURL as e:
|
||||
log.warning("Invalid local server url: {}".format(e))
|
||||
return 0, None
|
||||
except urllib.error.URLError:
|
||||
# Connection refused. It's a normal behavior if server is not started
|
||||
return 0, None
|
||||
except urllib.error.HTTPError as e:
|
||||
log.debug("Error during get on {}:{}: {}".format(self.host(), self.port(), e))
|
||||
return e.code, None
|
||||
except (OSError, http.client.BadStatusLine, ValueError) as e:
|
||||
log.debug("Error during get on {}:{}: {}".format(self.host(), self.port(), e))
|
||||
return 0, None
|
||||
except (UnicodeEncodeError, ValueError) as e:
|
||||
log.warning("Could not read JSON data returned from {}: {}".format(url, e))
|
||||
else:
|
||||
return status, json_data
|
||||
return status, None
|
||||
|
||||
def _sslErrorsSlot(self, response, ssl_errors):
|
||||
|
||||
self.handleSslError(response, ssl_errors)
|
||||
|
||||
def handleSslError(self, response, ssl_errors):
|
||||
|
||||
if self._accept_insecure_certificate:
|
||||
response.ignoreSslErrors()
|
||||
return
|
||||
|
||||
url = response.request().url()
|
||||
host_port_key = f"{url.host()}:{url.port()}"
|
||||
|
||||
# get the certificate digest
|
||||
ssl_config = response.sslConfiguration()
|
||||
peer_cert = ssl_config.peerCertificate()
|
||||
digest = peer_cert.digest()
|
||||
|
||||
if host_port_key in self._ssl_exceptions:
|
||||
|
||||
if self._ssl_exceptions[host_port_key] == digest:
|
||||
response.ignoreSslErrors()
|
||||
return
|
||||
|
||||
from gns3.main_window import MainWindow
|
||||
main_window = MainWindow.instance()
|
||||
|
||||
msgbox = QtWidgets.QMessageBox(main_window)
|
||||
msgbox.setWindowTitle("SSL error detected")
|
||||
msgbox.setText(f"This server could not prove that it is {url.host()}:{url.port()}. Please carefully examine the certificate to make sure the server can be trusted.")
|
||||
msgbox.setInformativeText(f"{ssl_errors[0].errorString()}")
|
||||
msgbox.setDetailedText(peer_cert.toText())
|
||||
msgbox.setSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
|
||||
connect_button = QtWidgets.QPushButton(f"&Connect to {url.host()}:{url.port()}", msgbox)
|
||||
msgbox.addButton(connect_button, QtWidgets.QMessageBox.YesRole)
|
||||
abort_button = QtWidgets.QPushButton("&Abort", msgbox)
|
||||
msgbox.addButton(abort_button, QtWidgets.QMessageBox.RejectRole)
|
||||
msgbox.setDefaultButton(abort_button)
|
||||
msgbox.setIcon(QtWidgets.QMessageBox.Critical)
|
||||
msgbox.exec_()
|
||||
|
||||
if msgbox.clickedButton() == connect_button:
|
||||
self._ssl_exceptions[host_port_key] = digest
|
||||
response.ignoreSslErrors()
|
||||
else:
|
||||
for error in ssl_errors:
|
||||
log.error(f"SSL error detected: {error.errorString()}")
|
||||
main_window.close()
|
||||
|
||||
@classmethod
|
||||
def fromUrl(cls, url, network_manager=None, base_settings=None):
|
||||
|
||||
@@ -176,7 +176,7 @@ class ImageManager:
|
||||
if node_type == 'DYNAMIPS':
|
||||
return os.path.join(self.getDirectory(), 'IOS')
|
||||
else:
|
||||
return os.path.join(self.getDirectory(), node_type)
|
||||
return os.path.join(self.getDirectory(), node_type.upper())
|
||||
|
||||
@staticmethod
|
||||
def instance():
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import os
|
||||
import pathlib
|
||||
import urllib.parse
|
||||
|
||||
@@ -37,6 +38,9 @@ class ImageUploadManager(object):
|
||||
self._controller = controller
|
||||
|
||||
def upload(self):
|
||||
if not os.path.exists(self._image.path):
|
||||
log.error("Image '{}' could not be found".format(self._image.path))
|
||||
return
|
||||
if self._directFileUpload:
|
||||
# first obtain endpoint and know when target request
|
||||
self._controller.getEndpoint(self._getComputePath(), self._compute_id, self._onLoadEndpointCallback, showProgress=False)
|
||||
@@ -71,19 +75,16 @@ class ImageUploadManager(object):
|
||||
self._callback(result, error, **kwargs)
|
||||
|
||||
def _fileUploadToCompute(self, endpoint):
|
||||
log.info("Uploading file to compute: {}".format(endpoint))
|
||||
|
||||
log.debug("Uploading image '{}' to compute".format(self._image.path))
|
||||
parse_results = urllib.parse.urlparse(endpoint)
|
||||
network_manager = self._controller.getHttpClient().getNetworkManager()
|
||||
client = HTTPClient.fromUrl(endpoint, network_manager=network_manager)
|
||||
# We don't retry connection as in case of fail we try direct file upload
|
||||
client.setMaxRetryConnection(0)
|
||||
client.createHTTPQuery(
|
||||
'POST', parse_results.path, self._checkIfSuccessfulCallback, body=pathlib.Path(self._image.path),
|
||||
progressText="Uploading {}".format(self._image.filename), timeout=None, prefix="")
|
||||
client.createHTTPQuery('POST', parse_results.path, self._checkIfSuccessfulCallback, body=pathlib.Path(self._image.path),
|
||||
context={"image_path": self._image.path}, progressText="Uploading {}".format(self._image.filename), timeout=None, prefix="")
|
||||
|
||||
def _fileUploadToController(self):
|
||||
log.info("Uploading file to controller: {}".format(self._getComputePath()))
|
||||
self._controller.postCompute(
|
||||
self._getComputePath(), self._compute_id, self._callback, body=pathlib.Path(self._image.path),
|
||||
progressText="Uploading {}".format(self._image.filename), timeout=None)
|
||||
log.debug("Uploading image '{}' to controller".format(self._image.path))
|
||||
self._controller.postCompute(self._getComputePath(), self._compute_id, self._callback, body=pathlib.Path(self._image.path),
|
||||
context={"image_path": self._image.path}, progressText="Uploading {}".format(self._image.filename), timeout=None)
|
||||
|
||||
@@ -212,14 +212,13 @@ class DrawingItem:
|
||||
self._project.delete("/drawings/" + self._id, None, body=self.__json__())
|
||||
|
||||
def itemChange(self, change, value):
|
||||
if change == QtWidgets.QGraphicsItem.ItemPositionHasChanged and self.isActive() and self._main_window.uiSnapToGridAction.isChecked():
|
||||
|
||||
if change == QtWidgets.QGraphicsItem.ItemPositionChange and self.isActive() and self._main_window.uiSnapToGridAction.isChecked():
|
||||
grid_size = self._graphics_view.drawingGridSize()
|
||||
mid_x = self.boundingRect().width() / 2
|
||||
tmp_x = (grid_size * round((self.x() + mid_x) / grid_size)) - mid_x
|
||||
value.setX((grid_size * round((value.x() + mid_x) / grid_size)) - mid_x)
|
||||
mid_y = self.boundingRect().height() / 2
|
||||
tmp_y = (grid_size * round((self.y() + mid_y) / grid_size)) - mid_y
|
||||
if tmp_x != self.x() and tmp_y != self.y():
|
||||
self.setPos(tmp_x, tmp_y)
|
||||
value.setY((grid_size * round((value.y()+mid_y)/grid_size)) - mid_y)
|
||||
|
||||
if change == QtWidgets.QGraphicsItem.ItemSelectedChange:
|
||||
if not value:
|
||||
|
||||
@@ -147,6 +147,7 @@ class EthernetLinkItem(LinkItem):
|
||||
self._source_port.setLabel(source_port_label)
|
||||
|
||||
if self._draw_port_labels:
|
||||
source_port_label.setFlag(source_port_label.ItemIsMovable, not self._source_item.locked())
|
||||
source_port_label.show()
|
||||
else:
|
||||
source_port_label.hide()
|
||||
@@ -189,6 +190,7 @@ class EthernetLinkItem(LinkItem):
|
||||
self._destination_port.setLabel(destination_port_label)
|
||||
|
||||
if self._draw_port_labels:
|
||||
destination_port_label.setFlag(destination_port_label.ItemIsMovable, not self._destination_item.locked())
|
||||
destination_port_label.show()
|
||||
else:
|
||||
destination_port_label.hide()
|
||||
|
||||
@@ -280,23 +280,31 @@ class LinkItem(QtWidgets.QGraphicsPathItem):
|
||||
:param: QGraphicsSceneMouseEvent instance
|
||||
"""
|
||||
|
||||
if event.button() == QtCore.Qt.RightButton:
|
||||
if self._adding_flag:
|
||||
# send a escape key to the main window to cancel the link addition
|
||||
from ..main_window import MainWindow
|
||||
key = QtGui.QKeyEvent(QtCore.QEvent.KeyPress, QtCore.Qt.Key_Escape, QtCore.Qt.NoModifier)
|
||||
QtWidgets.QApplication.sendEvent(MainWindow.instance(), key)
|
||||
return
|
||||
if event.button() == QtCore.Qt.RightButton and self._adding_flag:
|
||||
# send a escape key to the main window to cancel the link addition
|
||||
from ..main_window import MainWindow
|
||||
key = QtGui.QKeyEvent(QtCore.QEvent.KeyPress, QtCore.Qt.Key_Escape, QtCore.Qt.NoModifier)
|
||||
QtWidgets.QApplication.sendEvent(MainWindow.instance(), key)
|
||||
return
|
||||
else:
|
||||
super().mousePressEvent(event)
|
||||
|
||||
if not sip_is_deleted(self):
|
||||
# create the contextual menu
|
||||
self.setAcceptHoverEvents(False)
|
||||
menu = QtWidgets.QMenu()
|
||||
self.populateLinkContextualMenu(menu)
|
||||
menu.exec_(QtGui.QCursor.pos())
|
||||
self.setAcceptHoverEvents(True)
|
||||
self._hovered = False
|
||||
self.adjust()
|
||||
def contextMenuEvent(self, event):
|
||||
"""
|
||||
Handles all context menu events.
|
||||
|
||||
:param event: QContextMenuEvent instance
|
||||
"""
|
||||
|
||||
if not sip_is_deleted(self):
|
||||
# create the contextual menu
|
||||
self.setAcceptHoverEvents(False)
|
||||
menu = QtWidgets.QMenu()
|
||||
self.populateLinkContextualMenu(menu)
|
||||
menu.exec_(QtGui.QCursor.pos())
|
||||
self.setAcceptHoverEvents(True)
|
||||
self._hovered = False
|
||||
self.adjust()
|
||||
|
||||
def keyPressEvent(self, event):
|
||||
"""
|
||||
|
||||
@@ -103,22 +103,11 @@ class NodeItem(QtSvg.QGraphicsSvgItem):
|
||||
|
||||
from ..main_window import MainWindow
|
||||
self._main_window = MainWindow.instance()
|
||||
if self._main_window.uiSnapToGridAction.isChecked():
|
||||
self._snapToGrid()
|
||||
self._settings = self._main_window.uiGraphicsView.settings()
|
||||
|
||||
if node.initialized():
|
||||
self.createdSlot(node.id())
|
||||
|
||||
def _snapToGrid(self):
|
||||
|
||||
grid_size = self._main_window.uiGraphicsView.nodeGridSize()
|
||||
mid_x = self.boundingRect().width() / 2
|
||||
x = (grid_size * round((self.x() + mid_x) / grid_size)) - mid_x
|
||||
mid_y = self.boundingRect().height() / 2
|
||||
y = (grid_size * round((self.y() + mid_y) / grid_size)) - mid_y
|
||||
self.setPos(x, y)
|
||||
|
||||
def updateNode(self):
|
||||
"""
|
||||
Sync change to the node
|
||||
|
||||
@@ -136,6 +136,7 @@ class SerialLinkItem(LinkItem):
|
||||
self._source_port.setLabel(source_port_label)
|
||||
|
||||
if self._draw_port_labels:
|
||||
source_port_label.setFlag(source_port_label.ItemIsMovable, not self._source_item.locked())
|
||||
source_port_label.show()
|
||||
else:
|
||||
source_port_label.hide()
|
||||
@@ -167,6 +168,7 @@ class SerialLinkItem(LinkItem):
|
||||
self._destination_port.setLabel(destination_port_label)
|
||||
|
||||
if self._draw_port_labels:
|
||||
destination_port_label.setFlag(destination_port_label.ItemIsMovable, not self._destination_item.locked())
|
||||
destination_port_label.show()
|
||||
else:
|
||||
destination_port_label.hide()
|
||||
|
||||
54
gns3/link.py
54
gns3/link.py
@@ -19,7 +19,6 @@
|
||||
Manages and stores everything needed for a connection between 2 devices.
|
||||
"""
|
||||
|
||||
import os
|
||||
import re
|
||||
from .qt import sip
|
||||
import uuid
|
||||
@@ -79,6 +78,8 @@ class Link(QtCore.QObject):
|
||||
self._deleting = False
|
||||
self._capture_file_path = None
|
||||
self._capture_file = None
|
||||
self._response_stream = None
|
||||
self._capture_compute_id = None
|
||||
self._initialized = False
|
||||
self._filters = {}
|
||||
self._suspend = False
|
||||
@@ -103,24 +104,30 @@ class Link(QtCore.QObject):
|
||||
Controller.instance().post("/projects/{project_id}/links".format(project_id=source_node.project().id()), self._linkCreatedCallback, body=body)
|
||||
|
||||
def _parseResponse(self, result):
|
||||
self._capturing = result.get("capturing", False)
|
||||
|
||||
# If the controller is remote the capture path should be rewrite to something local
|
||||
self._capturing = result.get("capturing", False)
|
||||
if self._capturing:
|
||||
if Controller.instance().isRemote():
|
||||
if self._capture_file_path is None and result.get("capture_file_path", None) is not None:
|
||||
self._capture_compute_id = result.get("capture_compute_id", None)
|
||||
self._capture_file_path = result.get("capture_file_path", None)
|
||||
if Controller.instance().isRemote() or (self._capture_compute_id and self._capture_compute_id != "local"):
|
||||
# We need to stream the pcap file content if the controller or compute is remote
|
||||
if Controller.instance().isRemote() or self._capture_file_path is None:
|
||||
self._capture_file = QtCore.QTemporaryFile()
|
||||
self._capture_file.open(QtCore.QFile.WriteOnly)
|
||||
self._capture_file.setAutoRemove(True)
|
||||
self._capture_file_path = self._capture_file.fileName()
|
||||
Controller.instance().get("/projects/{project_id}/links/{link_id}/pcap".format(project_id=self.project().id(),link_id=self._link_id),
|
||||
None,
|
||||
showProgress=False,
|
||||
downloadProgressCallback=self._downloadPcapProgress,
|
||||
ignoreErrors=True, # If something is wrong avoid disconnect us from server
|
||||
timeout=None)
|
||||
else:
|
||||
self._capture_file_path = result["capture_file_path"]
|
||||
else:
|
||||
self._capture_file = QtCore.QFile(self._capture_file_path)
|
||||
self._capture_file.open(QtCore.QFile.WriteOnly)
|
||||
self._response_stream = Controller.instance().get("/projects/{project_id}/links/{link_id}/pcap".format(project_id=self.project().id(), link_id=self._link_id),
|
||||
None,
|
||||
showProgress=False,
|
||||
downloadProgressCallback=self._downloadPcapProgress,
|
||||
ignoreErrors=True, # If something is wrong avoid disconnect us from server
|
||||
timeout=None)
|
||||
log.debug("Has successfully started capturing packets on link {} to '{}'".format(self._link_id, self._capture_file_path))
|
||||
else:
|
||||
self._response_stream = None
|
||||
|
||||
if "nodes" in result:
|
||||
self._nodes = result["nodes"]
|
||||
@@ -351,9 +358,8 @@ class Link(QtCore.QObject):
|
||||
|
||||
def _startCaptureCallback(self, result, error=False, **kwargs):
|
||||
if error:
|
||||
log.error("Error while starting capture on link: {}".format(result["message"]))
|
||||
log.error("Error while starting capture on link {}: {}".format(self._link_id, result["message"]))
|
||||
return
|
||||
self._parseResponse(result)
|
||||
|
||||
def _downloadPcapProgress(self, content, server=None, context={}, **kwargs):
|
||||
"""
|
||||
@@ -366,25 +372,27 @@ class Link(QtCore.QObject):
|
||||
self._capture_file.flush()
|
||||
|
||||
def stopCapture(self):
|
||||
if Controller.instance().isRemote():
|
||||
|
||||
if Controller.instance().isRemote() or (self._capture_compute_id and self._capture_compute_id != "local"):
|
||||
if self._capture_file:
|
||||
self._capture_file.close()
|
||||
self._capture_file = None
|
||||
if self._capture_file_path and os.path.exists(self._capture_file_path):
|
||||
try:
|
||||
os.remove(self._capture_file_path)
|
||||
except OSError as e:
|
||||
log.error("Cannot remove file {}: {}".format(self._capture_file_path, e))
|
||||
# if self._capture_file_path and os.path.exists(self._capture_file_path):
|
||||
# try:
|
||||
# os.remove(self._capture_file_path)
|
||||
# except OSError as e:
|
||||
# log.error("Cannot remove file {}: {}".format(self._capture_file_path, e))
|
||||
self._capture_file_path = None
|
||||
Controller.instance().post("/projects/{project_id}/links/{link_id}/stop_capture".format(project_id=self.project().id(),
|
||||
link_id=self._link_id),
|
||||
self._stopCaptureCallback)
|
||||
|
||||
|
||||
def _stopCaptureCallback(self, result, error=False, **kwargs):
|
||||
if error:
|
||||
log.error("Error while stopping capture on link: {}".format(result["message"]))
|
||||
log.error("Error while stopping capture on link {}: {}".format(self._link_id, result["message"]))
|
||||
return
|
||||
self._parseResponse(result)
|
||||
log.debug("Has successfully stopped capturing packets on link {}".format(self._link_id))
|
||||
|
||||
def get(self, path, callback, **kwargs):
|
||||
"""
|
||||
|
||||
@@ -24,8 +24,10 @@ import copy
|
||||
import psutil
|
||||
|
||||
from .qt import QtCore, QtWidgets
|
||||
from .version import __version__
|
||||
from .version import __version__, __version_info__
|
||||
from .utils import parse_version
|
||||
from .local_server_config import LocalServerConfig
|
||||
from .settings import LOCAL_SERVER_SETTINGS
|
||||
|
||||
import logging
|
||||
log = logging.getLogger(__name__)
|
||||
@@ -87,8 +89,25 @@ class LocalConfig(QtCore.QObject):
|
||||
try:
|
||||
# create the config file if it doesn't exist
|
||||
os.makedirs(os.path.dirname(self._config_file), exist_ok=True)
|
||||
with open(self._config_file, "w", encoding="utf-8") as f:
|
||||
json.dump({"version": __version__, "type": "settings"}, f)
|
||||
|
||||
if sys.platform.startswith("win"):
|
||||
old_config_path = os.path.join(os.path.expandvars("%APPDATA%"), "GNS3", filename)
|
||||
else:
|
||||
old_config_path = os.path.join(os.path.expanduser("~"), ".config", "GNS3", filename)
|
||||
|
||||
# TODO: migrate versioned config file from a previous version of GNS3 (for instance 2.2 -> 2.3) + support profiles
|
||||
if os.path.exists(old_config_path):
|
||||
# migrate post version 2.2.0 configuration file
|
||||
shutil.copyfile(old_config_path, self._config_file)
|
||||
# reset the local server path and ubridge path
|
||||
settings = LocalServerConfig.instance().loadSettings("Server", LOCAL_SERVER_SETTINGS)
|
||||
settings["path"] = ""
|
||||
settings["ubridge_path"] = ""
|
||||
LocalServerConfig.instance().saveSettings("Server", settings)
|
||||
else:
|
||||
# create a new config
|
||||
with open(self._config_file, "w", encoding="utf-8") as f:
|
||||
json.dump({"version": __version__, "type": "settings"}, f)
|
||||
except OSError as e:
|
||||
log.error("Could not create the config file {}: {}".format(self._config_file, e))
|
||||
|
||||
@@ -114,17 +133,18 @@ class LocalConfig(QtCore.QObject):
|
||||
self._config_file = None
|
||||
self._resetLoadConfig()
|
||||
|
||||
|
||||
def configDirectory(self):
|
||||
"""
|
||||
Get the configuration directory
|
||||
"""
|
||||
|
||||
version = "{}.{}".format(__version_info__[0], __version_info__[1])
|
||||
if sys.platform.startswith("win"):
|
||||
appdata = os.path.expandvars("%APPDATA%")
|
||||
path = os.path.join(appdata, "GNS3")
|
||||
path = os.path.join(appdata, "GNS3", version)
|
||||
else:
|
||||
home = os.path.expanduser("~")
|
||||
path = os.path.join(home, ".config", "GNS3")
|
||||
path = os.path.join(home, ".config", "GNS3", version)
|
||||
|
||||
if self._profile is not None:
|
||||
path = os.path.join(path, "profiles", self._profile)
|
||||
@@ -146,8 +166,9 @@ class LocalConfig(QtCore.QObject):
|
||||
# In < 1.4 on Mac the config was in a gns3.net directory
|
||||
# We have move to same location as Linux
|
||||
if sys.platform.startswith("darwin"):
|
||||
version = "{}.{}".format(__version_info__[0], __version_info__[1])
|
||||
old_path = os.path.join(os.path.expanduser("~"), ".config", "gns3.net")
|
||||
new_path = os.path.join(os.path.expanduser("~"), ".config", "GNS3")
|
||||
new_path = os.path.join(os.path.expanduser("~"), ".config", "GNS3", version)
|
||||
if os.path.exists(old_path) and not os.path.exists(new_path):
|
||||
try:
|
||||
shutil.copytree(old_path, new_path)
|
||||
@@ -156,7 +177,7 @@ class LocalConfig(QtCore.QObject):
|
||||
|
||||
def _migrateOldConfig(self):
|
||||
"""
|
||||
Migrate pre 1.4 config
|
||||
Migrate config from a previous version.
|
||||
"""
|
||||
|
||||
# Display an error if settings come from a more recent version of GNS3
|
||||
@@ -165,7 +186,7 @@ class LocalConfig(QtCore.QObject):
|
||||
if "version" in self._settings:
|
||||
if parse_version(self._settings["version"])[:2] > parse_version(__version__)[:2]:
|
||||
app = QtWidgets.QApplication(sys.argv) # We need to create an application because settings are loaded before Qt init
|
||||
error_message = "Your settings are for version {} of GNS3. You cannot use a previous version of GNS3 without risking losing data. If you want to reset delete the settings in {}".format(self._settings["version"], self.configDirectory())
|
||||
error_message = "Settings are for version {} of GNS3. It is not possible to use a previous version of GNS3 without risking losing data. Delete the settings in '{}' to start GNS3".format(self._settings["version"], self.configDirectory())
|
||||
QtWidgets.QMessageBox.critical(False, "Version error", error_message)
|
||||
# Exit immediately not clean but we want to avoid any side effect that could corrupt the file
|
||||
QtCore.QTimer.singleShot(0, app.quit)
|
||||
@@ -174,21 +195,21 @@ class LocalConfig(QtCore.QObject):
|
||||
|
||||
if "version" not in self._settings or parse_version(self._settings["version"]) < parse_version("1.4.0alpha1"):
|
||||
|
||||
servers = self._settings.get("Servers", {})
|
||||
servers = self._settings.get("Servers", {})
|
||||
|
||||
if "LocalServer" in self._settings:
|
||||
if "LocalServer" in self._settings:
|
||||
servers["local_server"] = copy.copy(self._settings["LocalServer"])
|
||||
|
||||
# We migrate the server binary for OSX due to the change from py2app to CX freeze
|
||||
# We migrate the server binary for OSX due to the change from py2app to CX freeze
|
||||
if servers["local_server"]["path"] == "/Applications/GNS3.app/Contents/Resources/server/Contents/MacOS/gns3server":
|
||||
servers["local_server"]["path"] = "gns3server"
|
||||
|
||||
if "RemoteServers" in self._settings:
|
||||
if "RemoteServers" in self._settings:
|
||||
servers["remote_servers"] = copy.copy(self._settings["RemoteServers"])
|
||||
|
||||
self._settings["Servers"] = servers
|
||||
self._settings["Servers"] = servers
|
||||
|
||||
if "GUI" in self._settings:
|
||||
if "GUI" in self._settings:
|
||||
main_window = self._settings.get("MainWindow", {})
|
||||
main_window["hide_getting_started_dialog"] = self._settings["GUI"].get("hide_getting_started_dialog", False)
|
||||
self._settings["MainWindow"] = main_window
|
||||
@@ -201,7 +222,7 @@ class LocalConfig(QtCore.QObject):
|
||||
if self._settings["MainWindow"].get("telnet_console_command") not in PRECONFIGURED_TELNET_CONSOLE_COMMANDS.values():
|
||||
self._settings["MainWindow"]["telnet_console_command"] = DEFAULT_TELNET_CONSOLE_COMMAND
|
||||
|
||||
# Migrate 1.X to 2.0
|
||||
# Migrate 1.X to 2.0
|
||||
if "version" not in self._settings or parse_version(self._settings["version"]) < parse_version("2.0.0"):
|
||||
if "Qemu" in self._settings:
|
||||
# The internet VM is replaced by the nat Node
|
||||
@@ -212,7 +233,7 @@ class LocalConfig(QtCore.QObject):
|
||||
vms.append(vm)
|
||||
self._settings["Qemu"]["vms"] = vms
|
||||
|
||||
# Starting with 2.0.0dev5 IOU licence is stored in the settings
|
||||
# Starting with 2.0.0dev5 IOU licence is stored in the settings
|
||||
if "version" not in self._settings or parse_version(self._settings["version"]) < parse_version("2.0.0"):
|
||||
if "IOU" in self._settings and "iourc_path" in self._settings["IOU"] and "iourc_content" not in self._settings["IOU"]:
|
||||
try:
|
||||
@@ -467,7 +488,7 @@ class LocalConfig(QtCore.QObject):
|
||||
if pid != my_pid:
|
||||
try:
|
||||
process = psutil.Process(pid=pid)
|
||||
ps_name = process.name()
|
||||
ps_name = process.name().lower()
|
||||
except (OSError, psutil.NoSuchProcess, psutil.AccessDenied):
|
||||
pass
|
||||
else:
|
||||
|
||||
@@ -31,12 +31,11 @@ import subprocess
|
||||
|
||||
|
||||
from gns3.qt import QtWidgets, QtCore, qslot
|
||||
from gns3.settings import LOCAL_SERVER_SETTINGS
|
||||
from gns3.settings import LOCAL_SERVER_SETTINGS, DEFAULT_LOCAL_SERVER_HOST
|
||||
from gns3.local_config import LocalConfig
|
||||
from gns3.local_server_config import LocalServerConfig
|
||||
from gns3.utils.wait_for_connection_worker import WaitForConnectionWorker
|
||||
from gns3.utils.progress_dialog import ProgressDialog
|
||||
from gns3.utils.http import getSynchronous
|
||||
from gns3.utils.sudo import sudo
|
||||
from gns3.http_client import HTTPClient
|
||||
from gns3.controller import Controller
|
||||
@@ -131,6 +130,7 @@ class LocalServer(QtCore.QObject):
|
||||
import win32serviceutil
|
||||
except ImportError as e:
|
||||
log.error("Could not check if the {} service is running: {}".format(service_name, e))
|
||||
return
|
||||
|
||||
try:
|
||||
if win32serviceutil.QueryServiceStatus(service_name, None)[1] != win32service.SERVICE_RUNNING:
|
||||
@@ -246,6 +246,9 @@ class LocalServer(QtCore.QObject):
|
||||
"""
|
||||
Update the local server settings. Keep the key not in new_settings
|
||||
"""
|
||||
|
||||
if "host" in new_settings and new_settings["host"] is None:
|
||||
new_settings["host"] = DEFAULT_LOCAL_SERVER_HOST
|
||||
old_settings = copy.copy(self._settings)
|
||||
if not self._settings:
|
||||
self._settings = new_settings
|
||||
@@ -369,13 +372,15 @@ class LocalServer(QtCore.QObject):
|
||||
|
||||
self._checkUbridgePermissions()
|
||||
|
||||
if sys.platform.startswith('win'):
|
||||
if not self._checkWindowsService("npf") and not self._checkWindowsService("npcap"):
|
||||
QtWidgets.QMessageBox.critical(self.parent(), "Error", "The NPF or NPCAP service is not installed, please install Winpcap or Npcap and reboot.")
|
||||
return False
|
||||
if sys.platform.startswith("win"):
|
||||
import pywintypes
|
||||
try:
|
||||
if not self._checkWindowsService("npf") and not self._checkWindowsService("npcap"):
|
||||
log.warning("The NPF or NPCAP service is not installed, please install Winpcap or Npcap and reboot.")
|
||||
except pywintypes.error as e:
|
||||
log.warning("Could not check if the NPF or Npcap service is running: {}".format(e.strerror))
|
||||
|
||||
self._port = self._settings["port"]
|
||||
|
||||
# check the local server path
|
||||
local_server_path = self.localServerPath()
|
||||
if not local_server_path:
|
||||
@@ -516,9 +521,7 @@ class LocalServer(QtCore.QObject):
|
||||
:returns: boolean
|
||||
"""
|
||||
|
||||
status, json_data = getSynchronous(self._settings["protocol"], self._settings["host"], self._port, "version",
|
||||
timeout=2, user=self._settings["user"], password=self._settings["password"])
|
||||
|
||||
status, json_data = HTTPClient(self._settings).getSynchronous("GET", "/version")
|
||||
if status == 401: # Auth issue that need to be solved later
|
||||
return True
|
||||
elif json_data is None:
|
||||
|
||||
@@ -118,6 +118,9 @@ def main():
|
||||
# an extra argument starting with -psn_. We filter it
|
||||
if sys.platform.startswith("darwin"):
|
||||
sys.argv = [a for a in sys.argv if not a.startswith("-psn_")]
|
||||
if parse_version(QtCore.QT_VERSION_STR) < parse_version("5.15.2"):
|
||||
# Fixes issue on macOS Big Sur: https://github.com/GNS3/gns3-gui/issues/3037
|
||||
os.environ["QT_MAC_WANTS_LAYER"] = "1"
|
||||
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("project", help="load a GNS3 project (.gns3)", metavar="path", nargs="?")
|
||||
@@ -255,8 +258,7 @@ def main():
|
||||
current_year = datetime.date.today().year
|
||||
log.info("GNS3 GUI version {}".format(__version__))
|
||||
log.info("Copyright (c) 2007-{} GNS3 Technologies Inc.".format(current_year))
|
||||
|
||||
log.info("Application started with {}".format("".join(sys.argv)))
|
||||
log.info("Application started with {}".format(" ".join(sys.argv)))
|
||||
|
||||
# update the exception file path to have it in the same directory as the settings file.
|
||||
exception_file_path = os.path.join(LocalConfig.instance().configDirectory(), exception_file_path)
|
||||
|
||||
@@ -42,7 +42,7 @@ from .dialogs.edit_project_dialog import EditProjectDialog
|
||||
from .dialogs.setup_wizard import SetupWizard
|
||||
from .settings import GENERAL_SETTINGS
|
||||
from .items.node_item import NodeItem
|
||||
from .items.link_item import LinkItem
|
||||
from .items.link_item import LinkItem, SvgIconItem
|
||||
from .items.shape_item import ShapeItem
|
||||
from .items.label_item import LabelItem
|
||||
from .topology import Topology
|
||||
@@ -84,6 +84,7 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
|
||||
self._settings = {}
|
||||
|
||||
self.setupUi(self)
|
||||
self.setUnifiedTitleAndToolBarOnMac(True)
|
||||
|
||||
self._notif_dialog = NotifDialog(self)
|
||||
# Setup logger
|
||||
@@ -190,7 +191,8 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
|
||||
self.uiSnapshotAction,
|
||||
self.uiEditProjectAction,
|
||||
self.uiDeleteProjectAction,
|
||||
self.uiImportExportConfigsAction
|
||||
self.uiImportExportConfigsAction,
|
||||
self.uiLockAllAction
|
||||
]
|
||||
|
||||
# This widgets are not enabled if it's a remote controller (no access to the local file system)
|
||||
@@ -239,7 +241,6 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
|
||||
self.uiLockAllAction.triggered.connect(self._lockActionSlot)
|
||||
|
||||
# tool menu connections
|
||||
self.uiWebInterfaceAction.triggered.connect(self._openLightWebInterfaceActionSlot)
|
||||
self.uiWebUIAction.triggered.connect(self._openWebInterfaceActionSlot)
|
||||
|
||||
# control menu connections
|
||||
@@ -322,14 +323,10 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
|
||||
LocalConfig.instance().saveSectionSettings(self.__class__.__name__, self._settings)
|
||||
self.settings_updated_signal.emit()
|
||||
|
||||
def _openLightWebInterfaceActionSlot(self):
|
||||
if Controller.instance().connected():
|
||||
QtGui.QDesktopServices.openUrl(QtCore.QUrl(Controller.instance().httpClient().fullUrl()))
|
||||
|
||||
def _openWebInterfaceActionSlot(self):
|
||||
if Controller.instance().connected():
|
||||
base_url = Controller.instance().httpClient().fullUrl()
|
||||
webui_url = "{}/static/web-ui/local".format(base_url)
|
||||
webui_url = "{}/static/web-ui/bundled".format(base_url)
|
||||
QtGui.QDesktopServices.openUrl(QtCore.QUrl(webui_url))
|
||||
|
||||
def _showGridActionSlot(self):
|
||||
@@ -363,15 +360,16 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
|
||||
:return: None
|
||||
"""
|
||||
|
||||
for item in self.uiGraphicsView.items():
|
||||
if not isinstance(item, LinkItem) and not isinstance(item, LabelItem):
|
||||
if self.uiLockAllAction.isChecked() and not item.locked():
|
||||
item.setLocked(True)
|
||||
elif not self.uiLockAllAction.isChecked() and item.locked():
|
||||
item.setLocked(False)
|
||||
if item.parentItem() is None:
|
||||
item.updateNode()
|
||||
item.update()
|
||||
if self.uiGraphicsView.isEnabled():
|
||||
for item in self.uiGraphicsView.items():
|
||||
if not isinstance(item, LinkItem) and not isinstance(item, LabelItem) and not isinstance(item, SvgIconItem):
|
||||
if self.uiLockAllAction.isChecked() and not item.locked():
|
||||
item.setLocked(True)
|
||||
elif not self.uiLockAllAction.isChecked() and item.locked():
|
||||
item.setLocked(False)
|
||||
if item.parentItem() is None:
|
||||
item.updateNode()
|
||||
item.update()
|
||||
|
||||
def analyticsClient(self):
|
||||
"""
|
||||
@@ -392,9 +390,6 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
|
||||
self._project_dialog = ProjectDialog(self)
|
||||
self._project_dialog.show()
|
||||
create_new_project = self._project_dialog.exec_()
|
||||
# Close the device dock so it repopulates. Done in case switching between cloud and local.
|
||||
self.uiNodesDockWidget.setVisible(False)
|
||||
self.uiNodesDockWidget.setWindowTitle("")
|
||||
|
||||
if create_new_project:
|
||||
Topology.instance().createLoadProject(self._project_dialog.getProjectSettings())
|
||||
@@ -436,7 +431,7 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
|
||||
self._newProjectActionSlot()
|
||||
else:
|
||||
directory = self._project_dir
|
||||
if self._project_dir and not os.path.exists(self._project_dir):
|
||||
if self._project_dir is None or not os.path.exists(self._project_dir):
|
||||
directory = Topology.instance().projectsDirPath()
|
||||
path, _ = QtWidgets.QFileDialog.getOpenFileName(self, "Open project", directory,
|
||||
"All files (*.*);;GNS3 Project (*.gns3);;GNS3 Portable Project (*.gns3project *.gns3p);;NET files (*.net)",
|
||||
@@ -815,6 +810,13 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
|
||||
"""
|
||||
Slot called when starting all the nodes.
|
||||
"""
|
||||
|
||||
reply = QtWidgets.QMessageBox.question(self, "Confirm Start All", "Are you sure you want to start all devices?",
|
||||
QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No)
|
||||
|
||||
if reply == QtWidgets.QMessageBox.No:
|
||||
return
|
||||
|
||||
project = Topology.instance().project()
|
||||
if project is not None:
|
||||
project.start_all_nodes()
|
||||
@@ -824,6 +826,12 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
|
||||
Slot called when suspending all the nodes.
|
||||
"""
|
||||
|
||||
reply = QtWidgets.QMessageBox.question(self, "Confirm Suspend All", "Are you sure you want to suspend all devices?",
|
||||
QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No)
|
||||
|
||||
if reply == QtWidgets.QMessageBox.No:
|
||||
return
|
||||
|
||||
project = Topology.instance().project()
|
||||
if project is not None:
|
||||
project.suspend_all_nodes()
|
||||
@@ -833,6 +841,12 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
|
||||
Slot called when stopping all the nodes.
|
||||
"""
|
||||
|
||||
reply = QtWidgets.QMessageBox.question(self, "Confirm Stop All", "Are you sure you want to stop all devices?",
|
||||
QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No)
|
||||
|
||||
if reply == QtWidgets.QMessageBox.No:
|
||||
return
|
||||
|
||||
project = Topology.instance().project()
|
||||
if project is not None:
|
||||
project.stop_all_nodes()
|
||||
@@ -842,6 +856,12 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
|
||||
Slot called when reloading all the nodes.
|
||||
"""
|
||||
|
||||
reply = QtWidgets.QMessageBox.question(self, "Confirm Reload All", "Are you sure you want to reload all devices?",
|
||||
QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No)
|
||||
|
||||
if reply == QtWidgets.QMessageBox.No:
|
||||
return
|
||||
|
||||
project = Topology.instance().project()
|
||||
if project is not None:
|
||||
project.reload_all_nodes()
|
||||
@@ -916,7 +936,7 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
|
||||
Slot to launch a browser pointing to the documentation page.
|
||||
"""
|
||||
|
||||
QtGui.QDesktopServices.openUrl(QtCore.QUrl("https://gns3.com/support/docs"))
|
||||
QtGui.QDesktopServices.openUrl(QtCore.QUrl("https://docs.gns3.com/"))
|
||||
|
||||
def _checkForUpdateActionSlot(self, silent=False):
|
||||
"""
|
||||
@@ -1060,11 +1080,11 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
|
||||
|
||||
with Progress.instance().context(min_duration=0):
|
||||
dialog = PreferencesDialog(self)
|
||||
dialog.restoreGeometry(QtCore.QByteArray().fromBase64(self._settings["preferences_dialog_geometry"].encode()))
|
||||
#dialog.restoreGeometry(QtCore.QByteArray().fromBase64(self._settings["preferences_dialog_geometry"].encode()))
|
||||
dialog.show()
|
||||
dialog.exec_()
|
||||
self._settings["preferences_dialog_geometry"] = bytes(dialog.saveGeometry().toBase64()).decode()
|
||||
self.setSettings(self._settings)
|
||||
#self._settings["preferences_dialog_geometry"] = bytes(dialog.saveGeometry().toBase64()).decode()
|
||||
#self.setSettings(self._settings)
|
||||
|
||||
def _editReadmeActionSlot(self):
|
||||
"""
|
||||
@@ -1130,6 +1150,7 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
|
||||
self._settings["state"] = bytes(self.saveState().toBase64()).decode()
|
||||
self.setSettings(self._settings)
|
||||
|
||||
Controller.instance().stopListenNotifications()
|
||||
server = LocalServer.instance()
|
||||
server.stopLocalServer(wait=True)
|
||||
|
||||
@@ -1189,8 +1210,9 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
|
||||
|
||||
# restore debug level
|
||||
if self._settings["debug_level"]:
|
||||
print("Activating debugging (use command 'debug 0' to deactivate)")
|
||||
root = logging.getLogger()
|
||||
root.addHandler(logging.StreamHandler(sys.stdout))
|
||||
root.setLevel(logging.DEBUG)
|
||||
|
||||
# restore the style
|
||||
self._setStyle(self._settings.get("style"))
|
||||
|
||||
@@ -38,7 +38,7 @@ class EthernetSwitch(Node):
|
||||
# this is an always-on node
|
||||
self.setStatus(Node.started)
|
||||
self._always_on = True
|
||||
self.settings().update({"ports_mapping": [], "console_type": "telnet"})
|
||||
self.settings().update({"ports_mapping": [], "console_type": "none"})
|
||||
|
||||
def info(self):
|
||||
"""
|
||||
|
||||
@@ -59,7 +59,7 @@ ETHERNET_SWITCH_SETTINGS = {
|
||||
"default_name_format": "Switch{0}",
|
||||
"symbol": ":/symbols/ethernet_switch.svg",
|
||||
"category": Node.switches,
|
||||
"console_type": "telnet",
|
||||
"console_type": "none",
|
||||
"ports_mapping": [],
|
||||
"node_type": "ethernet_switch"
|
||||
}
|
||||
|
||||
@@ -51,7 +51,8 @@ class DockerVM(Node):
|
||||
"console_resolution": DOCKER_CONTAINER_SETTINGS["console_resolution"],
|
||||
"console_http_port": DOCKER_CONTAINER_SETTINGS["console_http_port"],
|
||||
"console_http_path": DOCKER_CONTAINER_SETTINGS["console_http_path"],
|
||||
"extra_hosts": DOCKER_CONTAINER_SETTINGS["extra_hosts"]}
|
||||
"extra_hosts": DOCKER_CONTAINER_SETTINGS["extra_hosts"],
|
||||
"extra_volumes": DOCKER_CONTAINER_SETTINGS["extra_volumes"]}
|
||||
|
||||
self.settings().update(docker_vm_settings)
|
||||
|
||||
|
||||
@@ -103,7 +103,8 @@ class DockerVMConfigurationPage(QtWidgets.QWidget, Ui_dockerVMConfigPageWidget):
|
||||
self.uiConsoleResolutionComboBox.setCurrentIndex(self.uiConsoleResolutionComboBox.findText(settings["console_resolution"]))
|
||||
self.uiConsoleHttpPortSpinBox.setValue(settings["console_http_port"])
|
||||
self.uiHttpConsolePathLineEdit.setText(settings["console_http_path"])
|
||||
self.uiExtraHostsTextEdit.setText(settings["extra_hosts"])
|
||||
self.uiExtraHostsTextEdit.setPlainText(settings["extra_hosts"])
|
||||
self.uiExtraVolumeTextEdit.setPlainText("\n".join(settings["extra_volumes"]))
|
||||
|
||||
if not group:
|
||||
self.uiNameLineEdit.setText(settings["name"])
|
||||
@@ -175,6 +176,8 @@ class DockerVMConfigurationPage(QtWidgets.QWidget, Ui_dockerVMConfigPageWidget):
|
||||
settings["console_http_port"] = self.uiConsoleHttpPortSpinBox.value()
|
||||
settings["console_http_path"] = self.uiHttpConsolePathLineEdit.text()
|
||||
settings["extra_hosts"] = self.uiExtraHostsTextEdit.toPlainText()
|
||||
# only tidy input here, validation is performed server side
|
||||
settings["extra_volumes"] = [ y for x in self.uiExtraVolumeTextEdit.toPlainText().split("\n") for y in [ x.strip() ] if y ]
|
||||
|
||||
if not group:
|
||||
adapters = self.uiAdapterSpinBox.value()
|
||||
|
||||
@@ -95,6 +95,9 @@ class DockerVMPreferencesPage(QtWidgets.QWidget, Ui_DockerVMPreferencesPageWidge
|
||||
if docker_container["extra_hosts"]:
|
||||
QtWidgets.QTreeWidgetItem(section_item, ["Extra hosts:", str(docker_container["extra_hosts"])])
|
||||
|
||||
if docker_container["extra_volumes"]:
|
||||
QtWidgets.QTreeWidgetItem(section_item, ["Extra volumes:", "\n".join(docker_container["extra_volumes"])])
|
||||
|
||||
self.uiDockerVMInfoTreeWidget.expandAll()
|
||||
self.uiDockerVMInfoTreeWidget.resizeColumnToContents(0)
|
||||
self.uiDockerVMInfoTreeWidget.resizeColumnToContents(1)
|
||||
|
||||
@@ -43,5 +43,6 @@ DOCKER_CONTAINER_SETTINGS = {
|
||||
"console_http_port": 80,
|
||||
"console_http_path": "/",
|
||||
"extra_hosts": "",
|
||||
"extra_volumes": [],
|
||||
"node_type": "docker"
|
||||
}
|
||||
|
||||
@@ -297,9 +297,34 @@ one per line)</string>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QTextEdit" name="uiExtraHostsTextEdit"/>
|
||||
<widget class="QPlainTextEdit" name="uiExtraHostsTextEdit">
|
||||
<property name="placeholderText">
|
||||
<string>e.g. router:192.168.0.1</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="uiExtraVolumeLabel">
|
||||
<property name="text">
|
||||
<string>Additional directories to
|
||||
make persistent that are
|
||||
not included in the image
|
||||
VOLUMES config. One
|
||||
directory per line.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QPlainTextEdit" name="uiExtraVolumeTextEdit">
|
||||
<property name="plainText">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>e.g. /etc/sysctl.d</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
|
||||
@@ -143,11 +143,18 @@ class Ui_dockerVMConfigPageWidget(object):
|
||||
self.uiExtraHostsLabel.setWordWrap(True)
|
||||
self.uiExtraHostsLabel.setObjectName("uiExtraHostsLabel")
|
||||
self.gridLayout_2.addWidget(self.uiExtraHostsLabel, 0, 0, 1, 1)
|
||||
self.uiExtraHostsTextEdit = QtWidgets.QTextEdit(self.tab_2)
|
||||
self.uiExtraHostsTextEdit = QtWidgets.QPlainTextEdit(self.tab_2)
|
||||
self.uiExtraHostsTextEdit.setObjectName("uiExtraHostsTextEdit")
|
||||
self.gridLayout_2.addWidget(self.uiExtraHostsTextEdit, 0, 1, 1, 1)
|
||||
self.uiExtraVolumeLabel = QtWidgets.QLabel(self.tab_2)
|
||||
self.uiExtraVolumeLabel.setObjectName("uiExtraVolumeLabel")
|
||||
self.gridLayout_2.addWidget(self.uiExtraVolumeLabel, 1, 0, 1, 1)
|
||||
self.uiExtraVolumeTextEdit = QtWidgets.QPlainTextEdit(self.tab_2)
|
||||
self.uiExtraVolumeTextEdit.setPlainText("")
|
||||
self.uiExtraVolumeTextEdit.setObjectName("uiExtraVolumeTextEdit")
|
||||
self.gridLayout_2.addWidget(self.uiExtraVolumeTextEdit, 1, 1, 1, 1)
|
||||
spacerItem = QtWidgets.QSpacerItem(20, 388, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
|
||||
self.gridLayout_2.addItem(spacerItem, 1, 1, 1, 1)
|
||||
self.gridLayout_2.addItem(spacerItem, 2, 1, 1, 1)
|
||||
self.uiTabWidget.addTab(self.tab_2, "")
|
||||
self.tab_3 = QtWidgets.QWidget()
|
||||
self.tab_3.setObjectName("tab_3")
|
||||
@@ -201,6 +208,13 @@ class Ui_dockerVMConfigPageWidget(object):
|
||||
"to the /etc/hosts file.\n"
|
||||
"(hostname:IP\n"
|
||||
"one per line)"))
|
||||
self.uiExtraHostsTextEdit.setPlaceholderText(_translate("dockerVMConfigPageWidget", "e.g. router:192.168.0.1"))
|
||||
self.uiExtraVolumeLabel.setText(_translate("dockerVMConfigPageWidget", "Additional directories to\n"
|
||||
"make persistent that are\n"
|
||||
"not included in the image\n"
|
||||
"VOLUMES config. One\n"
|
||||
"directory per line."))
|
||||
self.uiExtraVolumeTextEdit.setPlaceholderText(_translate("dockerVMConfigPageWidget", "e.g. /etc/sysctl.d"))
|
||||
self.uiTabWidget.setTabText(self.uiTabWidget.indexOf(self.tab_2), _translate("dockerVMConfigPageWidget", "Advanced"))
|
||||
self.uiTabWidget.setTabText(self.uiTabWidget.indexOf(self.tab_3), _translate("dockerVMConfigPageWidget", "Usage"))
|
||||
|
||||
|
||||
@@ -130,7 +130,7 @@ class Dynamips(Module):
|
||||
for router in self._settings.get("routers"):
|
||||
router_settings = IOS_ROUTER_SETTINGS.copy()
|
||||
router_settings.update(router)
|
||||
if not router_settings.get("chassis"):
|
||||
if router_settings.get("chassis"):
|
||||
del router_settings["chassis"]
|
||||
templates.append(Template(router_settings))
|
||||
TemplateManager.instance().updateList(templates)
|
||||
|
||||
@@ -123,7 +123,7 @@ class IOSRouterWizard(VMWithImagesWizard, Ui_IOSRouterWizard):
|
||||
|
||||
# try to guess the platform
|
||||
image = os.path.basename(self.uiIOSImageLineEdit.text())
|
||||
match = re.match(r"^(c[0-9]+)p?\\-\w+", image.lower())
|
||||
match = re.match(r"^(c[0-9]+)p?-\w+", image.lower())
|
||||
if not match:
|
||||
QtWidgets.QMessageBox.warning(self, "IOS image", "Could not detect the platform, make sure this is a valid IOS image!")
|
||||
return
|
||||
|
||||
@@ -111,7 +111,7 @@ class IOSRouterConfigurationPage(QtWidgets.QWidget, Ui_iosRouterConfigPageWidget
|
||||
|
||||
# try to guess the platform
|
||||
image = os.path.basename(path)
|
||||
match = re.match(r"^(c[0-9]+)\\-\w+", image)
|
||||
match = re.match(r"^(c[0-9]+)p?-\w+", image)
|
||||
if not match:
|
||||
QtWidgets.QMessageBox.warning(self, "IOS image", "Could not detect the platform, make sure this is a valid IOS image!")
|
||||
return
|
||||
|
||||
@@ -210,7 +210,7 @@ class IOUDevicePreferencesPage(QtWidgets.QWidget, Ui_IOUDevicePreferencesPageWid
|
||||
del self._iou_devices[key]
|
||||
item.setText(0, iou_device["name"])
|
||||
item.setData(0, QtCore.Qt.UserRole, new_key)
|
||||
self._refreshInfo(dialog.settings)
|
||||
self._refreshInfo(dialog.settings())
|
||||
|
||||
def _iouDeviceDeleteSlot(self):
|
||||
"""
|
||||
|
||||
@@ -98,7 +98,10 @@ class IOUPreferencesPage(QtWidgets.QWidget, Ui_IOUPreferencesPageWidget):
|
||||
:param settings: IOU settings
|
||||
"""
|
||||
|
||||
self.IOULicenceTextEdit.setPlainText(settings["iourc_content"])
|
||||
if settings["iourc_content"]:
|
||||
self.IOULicenceTextEdit.blockSignals(True)
|
||||
self.IOULicenceTextEdit.setPlainText(settings["iourc_content"])
|
||||
self.IOULicenceTextEdit.blockSignals(False)
|
||||
self.uiLicensecheckBox.setChecked(settings["license_check"])
|
||||
|
||||
def loadPreferences(self):
|
||||
@@ -106,7 +109,10 @@ class IOUPreferencesPage(QtWidgets.QWidget, Ui_IOUPreferencesPageWidget):
|
||||
Loads IOU preferences.
|
||||
"""
|
||||
|
||||
Controller.instance().get("/iou_license", self._getSettingsCallback)
|
||||
if Controller.instance().connected():
|
||||
Controller.instance().get("/iou_license", self._getSettingsCallback)
|
||||
else:
|
||||
log.error("Cannot load the IOU license in the preferences dialog: not connected to the controller")
|
||||
|
||||
@qslot
|
||||
def _getSettingsCallback(self, result, error=False, **kwargs):
|
||||
@@ -115,7 +121,7 @@ class IOUPreferencesPage(QtWidgets.QWidget, Ui_IOUPreferencesPageWidget):
|
||||
return
|
||||
if error:
|
||||
if "message" in result:
|
||||
log.error("Error while getting settings : {}".format(result["message"]))
|
||||
log.error("Error while getting the IOU license information: {}".format(result["message"]))
|
||||
return
|
||||
self._old_settings = copy.copy(result)
|
||||
self._populateWidgets(result)
|
||||
|
||||
@@ -14,6 +14,13 @@
|
||||
<string>IOS on UNIX</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>IOU licence (iourc file):</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
||||
<item>
|
||||
|
||||
@@ -1,21 +1,22 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file '/Users/noplay/code/gns3/gns3-gui/gns3/modules/iou/ui/iou_preferences_page.ui'
|
||||
# Form implementation generated from reading ui file '/home/grossmj/PycharmProjects/gns3-gui/gns3/modules/iou/ui/iou_preferences_page.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.7.1
|
||||
# Created by: PyQt5 UI code generator 5.9
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_IOUPreferencesPageWidget(object):
|
||||
|
||||
def setupUi(self, IOUPreferencesPageWidget):
|
||||
IOUPreferencesPageWidget.setObjectName("IOUPreferencesPageWidget")
|
||||
IOUPreferencesPageWidget.resize(490, 532)
|
||||
self.vboxlayout = QtWidgets.QVBoxLayout(IOUPreferencesPageWidget)
|
||||
self.vboxlayout.setObjectName("vboxlayout")
|
||||
self.label = QtWidgets.QLabel(IOUPreferencesPageWidget)
|
||||
self.label.setObjectName("label")
|
||||
self.vboxlayout.addWidget(self.label)
|
||||
self.horizontalLayout_5 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_5.setObjectName("horizontalLayout_5")
|
||||
self.IOULicenceTextEdit = QtWidgets.QPlainTextEdit(IOUPreferencesPageWidget)
|
||||
@@ -47,7 +48,9 @@ class Ui_IOUPreferencesPageWidget(object):
|
||||
def retranslateUi(self, IOUPreferencesPageWidget):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
IOUPreferencesPageWidget.setWindowTitle(_translate("IOUPreferencesPageWidget", "IOS on UNIX"))
|
||||
self.label.setText(_translate("IOUPreferencesPageWidget", "IOU licence (iourc file):"))
|
||||
self.IOULicenceTextEdit.setToolTip(_translate("IOUPreferencesPageWidget", "A license is required to run IOU. Copy & paste the content of your iourc file here or use the browse button to select a file. The license will be pushed to remote servers."))
|
||||
self.uiIOURCPathToolButton.setText(_translate("IOUPreferencesPageWidget", "&Browse..."))
|
||||
self.uiLicensecheckBox.setText(_translate("IOUPreferencesPageWidget", "Check for a valid IOU license key"))
|
||||
self.uiRestoreDefaultsPushButton.setText(_translate("IOUPreferencesPageWidget", "Restore defaults"))
|
||||
|
||||
|
||||
@@ -152,9 +152,14 @@ class Module(QtCore.QObject):
|
||||
:param directory: destination directory path
|
||||
"""
|
||||
|
||||
node_names_cannot_export = []
|
||||
for node in self._nodes:
|
||||
if hasattr(node, "initialized") and node.initialized():
|
||||
node.exportConfigsToDirectory(directory)
|
||||
if not node.exportConfigsToDirectory(directory):
|
||||
node_names_cannot_export.append(node.name())
|
||||
|
||||
if node_names_cannot_export:
|
||||
log.warning("Config export is not supported by the following nodes: {}".format(" ".join(node_names_cannot_export)))
|
||||
|
||||
def importConfigs(self, directory):
|
||||
"""
|
||||
|
||||
@@ -47,10 +47,13 @@ class QemuVMWizard(VMWithImagesWizard, Ui_QemuVMWizard):
|
||||
|
||||
# Mandatory fields
|
||||
self.uiNameWizardPage.registerField("vm_name*", self.uiNameLineEdit)
|
||||
self.uiDiskWizardPage.registerField("hda_disk_image*", self.uiHdaDiskImageLineEdit)
|
||||
self.uiInitrdKernelImageWizardPage.registerField("initrd*", self.uiInitrdImageLineEdit)
|
||||
self.uiInitrdKernelImageWizardPage.registerField("kernel_image*", self.uiKernelImageLineEdit)
|
||||
|
||||
# Fill image combo boxes
|
||||
self.addImageSelector(self.uiHdaDiskExistingImageRadioButton, self.uiHdaDiskImageListComboBox, self.uiHdaDiskImageLineEdit, self.uiHdaDiskImageToolButton, QemuVMConfigurationPage.getDiskImage, create_image_wizard=QemuImageWizard, create_button=self.uiHdaDiskImageCreateToolButton, image_suffix="-hda")
|
||||
self.addImageSelector(self.uiLinuxExistingImageRadioButton, self.uiInitrdImageListComboBox, self.uiInitrdImageLineEdit, self.uiInitrdImageToolButton, QemuVMConfigurationPage.getDiskImage)
|
||||
self.addImageSelector(self.uiLinuxExistingImageRadioButton, self.uiKernelImageListComboBox, self.uiKernelImageLineEdit, self.uiKernelImageToolButton, QemuVMConfigurationPage.getDiskImage)
|
||||
|
||||
def validateCurrentPage(self):
|
||||
"""
|
||||
@@ -61,7 +64,11 @@ class QemuVMWizard(VMWithImagesWizard, Ui_QemuVMWizard):
|
||||
return False
|
||||
|
||||
if self.currentPage() == self.uiNameWizardPage:
|
||||
self.uiRamSpinBox.setValue(512)
|
||||
if self.uiLegacyASACheckBox.isChecked():
|
||||
QtWidgets.QMessageBox.warning(self, "Legacy ASA VM", "Running ASA (with initrd/kernel) is not recommended and will not work on Windows 10, please use ASAv instead")
|
||||
self.uiRamSpinBox.setValue(1024)
|
||||
else:
|
||||
self.uiRamSpinBox.setValue(256)
|
||||
|
||||
if self.currentPage() == self.uiBinaryMemoryWizardPage:
|
||||
if not self.uiQemuListComboBox.count():
|
||||
@@ -81,7 +88,7 @@ class QemuVMWizard(VMWithImagesWizard, Ui_QemuVMWizard):
|
||||
if self.uiLocalRadioButton.isChecked() and not ComputeManager.instance().localPlatform().startswith("linux"):
|
||||
QtWidgets.QMessageBox.warning(self, "QEMU on Windows or Mac", "The recommended way to run QEMU on Windows and OSX is to use the GNS3 VM")
|
||||
|
||||
if self.page(page_id) == self.uiDiskWizardPage:
|
||||
if self.page(page_id) in [self.uiDiskWizardPage, self.uiInitrdKernelImageWizardPage]:
|
||||
self.loadImagesList("/qemu/images")
|
||||
elif self.page(page_id) == self.uiBinaryMemoryWizardPage:
|
||||
try:
|
||||
@@ -109,7 +116,9 @@ class QemuVMWizard(VMWithImagesWizard, Ui_QemuVMWizard):
|
||||
|
||||
is_64bit = sys.maxsize > 2 ** 32
|
||||
if ComputeManager.instance().localPlatform().startswith("win") and self.uiLocalRadioButton.isChecked():
|
||||
if is_64bit:
|
||||
if self.uiLegacyASACheckBox.isChecked():
|
||||
search_string = r"qemu-0.13.0\qemu-system-i386w.exe"
|
||||
elif is_64bit:
|
||||
# default is qemu-system-x86_64w.exe on Windows 64-bit with a remote server
|
||||
search_string = "x86_64w.exe"
|
||||
else:
|
||||
@@ -143,9 +152,45 @@ class QemuVMWizard(VMWithImagesWizard, Ui_QemuVMWizard):
|
||||
"qemu_path": qemu_path,
|
||||
"compute_id": self._compute_id,
|
||||
"category": Node.end_devices,
|
||||
"hda_disk_image": self.uiHdaDiskImageLineEdit.text(),
|
||||
"console_type": console_type,
|
||||
"options": ""
|
||||
"console_type": console_type
|
||||
}
|
||||
|
||||
if self.uiHdaDiskImageLineEdit.text().strip():
|
||||
settings["hda_disk_image"] = self.uiHdaDiskImageLineEdit.text().strip()
|
||||
|
||||
if self.uiLegacyASACheckBox.isChecked():
|
||||
# special settings for legacy ASA VM
|
||||
settings["adapters"] = 4
|
||||
settings["initrd"] = self.uiInitrdImageLineEdit.text()
|
||||
settings["kernel_image"] = self.uiKernelImageLineEdit.text()
|
||||
settings["kernel_command_line"] = "ide_generic.probe_mask=0x01 ide_core.chs=0.0:980,16,32 auto nousb console=ttyS0,9600 bigphysarea=65536 ide1=noprobe no-hlt -net nic"
|
||||
settings["options"] = "-no-kvm -icount auto"
|
||||
if not sys.platform.startswith("darwin"):
|
||||
settings["cpu_throttling"] = 80 # limit to 80% CPU usage
|
||||
settings["process_priority"] = "low"
|
||||
settings["symbol"] = ":/symbols/asa.svg"
|
||||
settings["category"] = Node.security_devices
|
||||
|
||||
if "options" not in settings:
|
||||
settings["options"] = ""
|
||||
if self._compute_id == "local" and (sys.platform.startswith("win") and qemu_path.endswith(r"qemu-0.11.0\qemu.exe")) or \
|
||||
(sys.platform.startswith("darwin") and "GNS3.app" in qemu_path):
|
||||
settings["options"] += " -vga none -vnc none"
|
||||
settings["legacy_networking"] = True
|
||||
settings["options"] = settings["options"].strip()
|
||||
|
||||
return settings
|
||||
|
||||
def nextId(self):
|
||||
"""
|
||||
Wizard rules!
|
||||
"""
|
||||
|
||||
current_id = self.currentId()
|
||||
if self.page(current_id) == self.uiDiskWizardPage:
|
||||
if self.uiLegacyASACheckBox.isChecked():
|
||||
return self.uiDiskWizardPage.nextId()
|
||||
return -1
|
||||
elif self.page(current_id) == self.uiInitrdKernelImageWizardPage:
|
||||
return -1
|
||||
return QtWidgets.QWizard.nextId(self)
|
||||
|
||||
@@ -78,7 +78,7 @@ class QemuVMConfigurationPage(QtWidgets.QWidget, Ui_QemuVMConfigPageWidget):
|
||||
self.uiHdcDiskImageResizeToolButton.clicked.connect(self._hdcDiskImageResizeSlot)
|
||||
self.uiHddDiskImageResizeToolButton.clicked.connect(self._hddDiskImageResizeSlot)
|
||||
|
||||
disk_interfaces = ["ide", "sata", "scsi", "sd", "mtd", "floppy", "pflash", "virtio", "none"]
|
||||
disk_interfaces = ["ide", "sata", "nvme", "scsi", "sd", "mtd", "floppy", "pflash", "virtio", "none"]
|
||||
self.uiHdaDiskInterfaceComboBox.addItems(disk_interfaces)
|
||||
self.uiHdbDiskInterfaceComboBox.addItems(disk_interfaces)
|
||||
self.uiHdcDiskInterfaceComboBox.addItems(disk_interfaces)
|
||||
@@ -90,6 +90,7 @@ class QemuVMConfigurationPage(QtWidgets.QWidget, Ui_QemuVMConfigPageWidget):
|
||||
self.uiActivateCPUThrottlingCheckBox.stateChanged.connect(self._cpuThrottlingChangedSlot)
|
||||
self.uiLegacyNetworkingCheckBox.stateChanged.connect(self._legacyNetworkingChangedSlot)
|
||||
self.uiCustomAdaptersConfigurationPushButton.clicked.connect(self._customAdaptersConfigurationSlot)
|
||||
self.uiCreateConfigDiskCheckBox.stateChanged.connect(self._createConfigDiskChangedSlot)
|
||||
|
||||
# add the categories
|
||||
for name, category in Node.defaultCategories().items():
|
||||
@@ -99,8 +100,13 @@ class QemuVMConfigurationPage(QtWidgets.QWidget, Ui_QemuVMConfigPageWidget):
|
||||
for name, option_name in Node.onCloseOptions().items():
|
||||
self.uiOnCloseComboBox.addItem(name, option_name)
|
||||
|
||||
# Supported NIC models: e1000, e1000-82544gc, e1000-82545em, e1000e, i82550, i82551, i82557a, i82557b, i82557c, i82558a
|
||||
# i82558b, i82559a, i82559b, i82559c, i82559er, i82562, i82801, ne2k_pci, pcnet, rocker, rtl8139, virtio-net-pci, vmxnet3
|
||||
self._legacy_devices = ("e1000", "i82551", "i82557b", "i82559er", "ne2k_pci", "pcnet", "rtl8139", "virtio")
|
||||
self._qemu_network_devices = OrderedDict([("e1000", "Intel Gigabit Ethernet"),
|
||||
("e1000-82544gc", "Intel 82544GC Gigabit Ethernet"),
|
||||
("e1000-82545em", "Intel 82545EM Gigabit Ethernet"),
|
||||
("e1000e", "Intel PCIe Gigabit Ethernet"),
|
||||
("i82550", "Intel i82550 Ethernet"),
|
||||
("i82551", "Intel i82551 Ethernet"),
|
||||
("i82557a", "Intel i82557A Ethernet"),
|
||||
@@ -116,6 +122,7 @@ class QemuVMConfigurationPage(QtWidgets.QWidget, Ui_QemuVMConfigPageWidget):
|
||||
("i82801", "Intel i82801 Ethernet"),
|
||||
("ne2k_pci", "NE2000 Ethernet"),
|
||||
("pcnet", "AMD PCNet Ethernet"),
|
||||
("rocker", "Rocker L2 switch device"),
|
||||
("rtl8139", "Realtek 8139 Ethernet"),
|
||||
("virtio", "Legacy paravirtualized Network I/O"),
|
||||
("virtio-net-pci", "Paravirtualized Network I/O"),
|
||||
@@ -360,6 +367,19 @@ class QemuVMConfigurationPage(QtWidgets.QWidget, Ui_QemuVMConfigPageWidget):
|
||||
else:
|
||||
self._refreshQemuNetworkDevices()
|
||||
|
||||
def _createConfigDiskChangedSlot(self, state):
|
||||
"""
|
||||
Slot to allow or not HDD disk to be configured based on the state of the config disk option.
|
||||
"""
|
||||
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
if state:
|
||||
self.uiHddDiskImageLabel.setText(_translate("QemuVMConfigPageWidget", "Startup-cfg:"))
|
||||
else:
|
||||
self.uiHddDiskImageLabel.setText(_translate("QemuVMConfigPageWidget", "Disk image:"))
|
||||
self.uiHddDiskImageCreateToolButton.setEnabled(not state)
|
||||
self.uiHddDiskImageResizeToolButton.setEnabled(not state)
|
||||
|
||||
def _customAdaptersConfigurationSlot(self):
|
||||
"""
|
||||
Slot to open the custom adapters configuration dialog
|
||||
@@ -391,11 +411,19 @@ class QemuVMConfigurationPage(QtWidgets.QWidget, Ui_QemuVMConfigPageWidget):
|
||||
|
||||
try:
|
||||
ports = StandardPortNameFactory(adapters, first_port_name, port_name_format, port_segment_size)
|
||||
except (ValueError, KeyError):
|
||||
except (IndexError, ValueError, KeyError):
|
||||
QtWidgets.QMessageBox.critical(self, "Invalid format", "Invalid port name format")
|
||||
return
|
||||
|
||||
dialog = CustomAdaptersConfigurationDialog(ports, self._custom_adapters, default_adapter, self._qemu_network_devices, base_mac_address, parent=self)
|
||||
if self.uiLegacyNetworkingCheckBox.isChecked():
|
||||
network_devices = {}
|
||||
for nic, desc in self._qemu_network_devices.items():
|
||||
if nic in self._legacy_devices:
|
||||
network_devices[nic] = desc
|
||||
else:
|
||||
network_devices = self._qemu_network_devices
|
||||
|
||||
dialog = CustomAdaptersConfigurationDialog(ports, self._custom_adapters, default_adapter, network_devices, base_mac_address, parent=self)
|
||||
dialog.show()
|
||||
dialog.exec_()
|
||||
|
||||
@@ -439,6 +467,7 @@ class QemuVMConfigurationPage(QtWidgets.QWidget, Ui_QemuVMConfigPageWidget):
|
||||
self.uiHdbDiskInterfaceComboBox.setCurrentIndex(self.uiHdbDiskInterfaceComboBox.findText(settings["hdb_disk_interface"]))
|
||||
self.uiHdcDiskInterfaceComboBox.setCurrentIndex(self.uiHdcDiskInterfaceComboBox.findText(settings["hdc_disk_interface"]))
|
||||
self.uiHddDiskInterfaceComboBox.setCurrentIndex(self.uiHddDiskInterfaceComboBox.findText(settings["hdd_disk_interface"]))
|
||||
self.uiCreateConfigDiskCheckBox.setChecked(settings["create_config_disk"])
|
||||
self.uiCdromImageLineEdit.setText(settings["cdrom_image"])
|
||||
self.uiBiosImageLineEdit.setText(settings["bios_image"])
|
||||
self.uiInitrdLineEdit.setText(settings["initrd"])
|
||||
@@ -511,6 +540,7 @@ class QemuVMConfigurationPage(QtWidgets.QWidget, Ui_QemuVMConfigPageWidget):
|
||||
self._custom_adapters = settings["custom_adapters"].copy()
|
||||
|
||||
self.uiLegacyNetworkingCheckBox.setChecked(settings["legacy_networking"])
|
||||
self.uiReplicateNetworkConnectionStateCheckBox.setChecked(settings["replicate_network_connection_state"])
|
||||
|
||||
# load the MAC address setting
|
||||
self.uiMacAddrLineEdit.setInputMask("HH:HH:HH:HH:HH:HH;_")
|
||||
@@ -573,6 +603,7 @@ class QemuVMConfigurationPage(QtWidgets.QWidget, Ui_QemuVMConfigPageWidget):
|
||||
settings["hdb_disk_interface"] = self.uiHdbDiskInterfaceComboBox.currentText()
|
||||
settings["hdc_disk_interface"] = self.uiHdcDiskInterfaceComboBox.currentText()
|
||||
settings["hdd_disk_interface"] = self.uiHddDiskInterfaceComboBox.currentText()
|
||||
settings["create_config_disk"] = self.uiCreateConfigDiskCheckBox.isChecked()
|
||||
settings["cdrom_image"] = self.uiCdromImageLineEdit.text().strip()
|
||||
settings["bios_image"] = self.uiBiosImageLineEdit.text().strip()
|
||||
settings["initrd"] = self.uiInitrdLineEdit.text().strip()
|
||||
@@ -642,6 +673,8 @@ class QemuVMConfigurationPage(QtWidgets.QWidget, Ui_QemuVMConfigPageWidget):
|
||||
raise ConfigurationError()
|
||||
|
||||
settings["adapters"] = adapters
|
||||
settings["legacy_networking"] = self.uiLegacyNetworkingCheckBox.isChecked()
|
||||
settings["replicate_network_connection_state"] = self.uiReplicateNetworkConnectionStateCheckBox.isChecked()
|
||||
settings["custom_adapters"] = self._custom_adapters.copy()
|
||||
settings["on_close"] = self.uiOnCloseComboBox.itemData(self.uiOnCloseComboBox.currentIndex())
|
||||
settings["cpus"] = self.uiCPUSpinBox.value()
|
||||
|
||||
@@ -71,6 +71,8 @@ class QemuVM(Node):
|
||||
"adapter_type": QEMU_VM_SETTINGS["adapter_type"],
|
||||
"mac_address": QEMU_VM_SETTINGS["mac_address"],
|
||||
"legacy_networking": QEMU_VM_SETTINGS["legacy_networking"],
|
||||
"replicate_network_connection_state": QEMU_VM_SETTINGS["replicate_network_connection_state"],
|
||||
"create_config_disk": QEMU_VM_SETTINGS["create_config_disk"],
|
||||
"platform": QEMU_VM_SETTINGS["platform"],
|
||||
"on_close": QEMU_VM_SETTINGS["on_close"],
|
||||
"cpu_throttling": QEMU_VM_SETTINGS["cpu_throttling"],
|
||||
@@ -133,6 +135,24 @@ class QemuVM(Node):
|
||||
usage = "\n" + self._settings.get("usage")
|
||||
return info + port_info + usage
|
||||
|
||||
def configFiles(self):
|
||||
"""
|
||||
Name of the configuration files
|
||||
"""
|
||||
|
||||
if self._settings.get("create_config_disk"):
|
||||
return ["config.zip"]
|
||||
return None
|
||||
|
||||
def configTextFiles(self):
|
||||
"""
|
||||
Name of the configuration files, which are plain text files
|
||||
|
||||
:returns: List of configuration files, False if no files
|
||||
"""
|
||||
|
||||
return None
|
||||
|
||||
def configPage(self):
|
||||
"""
|
||||
Returns the configuration page widget to be used by the node properties dialog.
|
||||
|
||||
@@ -41,10 +41,10 @@ QEMU_VM_SETTINGS = {
|
||||
"hdb_disk_image": "",
|
||||
"hdc_disk_image": "",
|
||||
"hdd_disk_image": "",
|
||||
"hda_disk_interface": "ide",
|
||||
"hdb_disk_interface": "ide",
|
||||
"hdc_disk_interface": "ide",
|
||||
"hdd_disk_interface": "ide",
|
||||
"hda_disk_interface": "none",
|
||||
"hdb_disk_interface": "none",
|
||||
"hdc_disk_interface": "none",
|
||||
"hdd_disk_interface": "none",
|
||||
"cdrom_image": "",
|
||||
"bios_image": "",
|
||||
"boot_priority": "c",
|
||||
@@ -56,6 +56,8 @@ QEMU_VM_SETTINGS = {
|
||||
"adapter_type": "e1000",
|
||||
"mac_address": "",
|
||||
"legacy_networking": False,
|
||||
"replicate_network_connection_state": True,
|
||||
"create_config_disk": False,
|
||||
"on_close": "power_off",
|
||||
"platform": "",
|
||||
"cpu_throttling": 0,
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>941</width>
|
||||
<height>877</height>
|
||||
<height>939</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@@ -399,14 +399,21 @@
|
||||
<string>HDD (Secondary Slave)</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_9">
|
||||
<item row="0" column="0">
|
||||
<item row="0" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="uiCreateConfigDiskCheckBox">
|
||||
<property name="text">
|
||||
<string>Automatically create a config disk on HDD</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="uiHddDiskImageLabel">
|
||||
<property name="text">
|
||||
<string>Disk image:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1" rowspan="2">
|
||||
<item row="1" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_10">
|
||||
<item>
|
||||
<widget class="QLineEdit" name="uiHddDiskImageLineEdit"/>
|
||||
@@ -437,7 +444,7 @@
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="0" rowspan="2">
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="uiHddDiskInterfaceLabel">
|
||||
<property name="text">
|
||||
<string>Disk interface:</string>
|
||||
@@ -470,7 +477,16 @@
|
||||
<string>CD/DVD</string>
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||
<property name="margin">
|
||||
<property name="leftMargin">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<item>
|
||||
@@ -526,6 +542,23 @@
|
||||
<string>Network</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout_5">
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="uiPortSegmentSizeLabel">
|
||||
<property name="text">
|
||||
<string>Segment size:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1" colspan="2">
|
||||
<widget class="QSpinBox" name="uiPortSegmentSizeSpinBox">
|
||||
<property name="maximum">
|
||||
<number>128</number>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<number>4</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="uiAdaptersLabel">
|
||||
<property name="text">
|
||||
@@ -560,13 +593,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="uiPortSegmentSizeLabel">
|
||||
<property name="text">
|
||||
<string>Segment size:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="uiMacAddrLabel">
|
||||
<property name="text">
|
||||
@@ -598,14 +624,14 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="0" colspan="3">
|
||||
<item row="8" column="0" colspan="3">
|
||||
<widget class="QCheckBox" name="uiLegacyNetworkingCheckBox">
|
||||
<property name="text">
|
||||
<string>Use the legacy networking mode</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="2">
|
||||
<item row="9" column="2">
|
||||
<spacer name="verticalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
@@ -628,16 +654,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1" colspan="2">
|
||||
<widget class="QSpinBox" name="uiPortSegmentSizeSpinBox">
|
||||
<property name="maximum">
|
||||
<number>128</number>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<number>4</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1" colspan="2">
|
||||
<widget class="QSpinBox" name="uiAdaptersSpinBox">
|
||||
<property name="sizePolicy">
|
||||
@@ -654,6 +670,13 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="0" colspan="3">
|
||||
<widget class="QCheckBox" name="uiReplicateNetworkConnectionStateCheckBox">
|
||||
<property name="text">
|
||||
<string>Replicate network connection states in Qemu</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="uiAdvancedSettingsTab">
|
||||
@@ -860,6 +883,8 @@
|
||||
<li>%vm-id% =VM ID</li>
|
||||
<li>%project-id% = project ID</li>
|
||||
<li>%project-path% = project path</li>
|
||||
<li>%console-port% = console port number</li>
|
||||
<li>%guest-cid% = unique ID from 3 to 65535</li>
|
||||
</ul>
|
||||
</body></html></string>
|
||||
</property>
|
||||
|
||||
@@ -2,16 +2,18 @@
|
||||
|
||||
# Form implementation generated from reading ui file '/home/grossmj/PycharmProjects/gns3-gui/gns3/modules/qemu/ui/qemu_vm_configuration_page.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.11.3
|
||||
# Created by: PyQt5 UI code generator 5.13.2
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_QemuVMConfigPageWidget(object):
|
||||
def setupUi(self, QemuVMConfigPageWidget):
|
||||
QemuVMConfigPageWidget.setObjectName("QemuVMConfigPageWidget")
|
||||
QemuVMConfigPageWidget.resize(941, 877)
|
||||
QemuVMConfigPageWidget.resize(941, 939)
|
||||
self.verticalLayout = QtWidgets.QVBoxLayout(QemuVMConfigPageWidget)
|
||||
self.verticalLayout.setObjectName("verticalLayout")
|
||||
self.uiQemutabWidget = QtWidgets.QTabWidget(QemuVMConfigPageWidget)
|
||||
@@ -209,9 +211,12 @@ class Ui_QemuVMConfigPageWidget(object):
|
||||
self.uiHddGroupBox.setObjectName("uiHddGroupBox")
|
||||
self.gridLayout_9 = QtWidgets.QGridLayout(self.uiHddGroupBox)
|
||||
self.gridLayout_9.setObjectName("gridLayout_9")
|
||||
self.uiCreateConfigDiskCheckBox = QtWidgets.QCheckBox(self.uiHddGroupBox)
|
||||
self.uiCreateConfigDiskCheckBox.setObjectName("uiCreateConfigDiskCheckBox")
|
||||
self.gridLayout_9.addWidget(self.uiCreateConfigDiskCheckBox, 0, 0, 1, 2)
|
||||
self.uiHddDiskImageLabel = QtWidgets.QLabel(self.uiHddGroupBox)
|
||||
self.uiHddDiskImageLabel.setObjectName("uiHddDiskImageLabel")
|
||||
self.gridLayout_9.addWidget(self.uiHddDiskImageLabel, 0, 0, 1, 1)
|
||||
self.gridLayout_9.addWidget(self.uiHddDiskImageLabel, 1, 0, 1, 1)
|
||||
self.horizontalLayout_10 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_10.setObjectName("horizontalLayout_10")
|
||||
self.uiHddDiskImageLineEdit = QtWidgets.QLineEdit(self.uiHddGroupBox)
|
||||
@@ -227,10 +232,10 @@ class Ui_QemuVMConfigPageWidget(object):
|
||||
self.uiHddDiskImageResizeToolButton = QtWidgets.QToolButton(self.uiHddGroupBox)
|
||||
self.uiHddDiskImageResizeToolButton.setObjectName("uiHddDiskImageResizeToolButton")
|
||||
self.horizontalLayout_10.addWidget(self.uiHddDiskImageResizeToolButton)
|
||||
self.gridLayout_9.addLayout(self.horizontalLayout_10, 0, 1, 2, 1)
|
||||
self.gridLayout_9.addLayout(self.horizontalLayout_10, 1, 1, 1, 1)
|
||||
self.uiHddDiskInterfaceLabel = QtWidgets.QLabel(self.uiHddGroupBox)
|
||||
self.uiHddDiskInterfaceLabel.setObjectName("uiHddDiskInterfaceLabel")
|
||||
self.gridLayout_9.addWidget(self.uiHddDiskInterfaceLabel, 1, 0, 2, 1)
|
||||
self.gridLayout_9.addWidget(self.uiHddDiskInterfaceLabel, 2, 0, 1, 1)
|
||||
self.uiHddDiskInterfaceComboBox = QtWidgets.QComboBox(self.uiHddGroupBox)
|
||||
self.uiHddDiskInterfaceComboBox.setObjectName("uiHddDiskInterfaceComboBox")
|
||||
self.gridLayout_9.addWidget(self.uiHddDiskInterfaceComboBox, 2, 1, 1, 1)
|
||||
@@ -268,6 +273,14 @@ class Ui_QemuVMConfigPageWidget(object):
|
||||
self.uiNetworkTab.setObjectName("uiNetworkTab")
|
||||
self.gridLayout_5 = QtWidgets.QGridLayout(self.uiNetworkTab)
|
||||
self.gridLayout_5.setObjectName("gridLayout_5")
|
||||
self.uiPortSegmentSizeLabel = QtWidgets.QLabel(self.uiNetworkTab)
|
||||
self.uiPortSegmentSizeLabel.setObjectName("uiPortSegmentSizeLabel")
|
||||
self.gridLayout_5.addWidget(self.uiPortSegmentSizeLabel, 3, 0, 1, 1)
|
||||
self.uiPortSegmentSizeSpinBox = QtWidgets.QSpinBox(self.uiNetworkTab)
|
||||
self.uiPortSegmentSizeSpinBox.setMaximum(128)
|
||||
self.uiPortSegmentSizeSpinBox.setSingleStep(4)
|
||||
self.uiPortSegmentSizeSpinBox.setObjectName("uiPortSegmentSizeSpinBox")
|
||||
self.gridLayout_5.addWidget(self.uiPortSegmentSizeSpinBox, 3, 1, 1, 2)
|
||||
self.uiAdaptersLabel = QtWidgets.QLabel(self.uiNetworkTab)
|
||||
self.uiAdaptersLabel.setObjectName("uiAdaptersLabel")
|
||||
self.gridLayout_5.addWidget(self.uiAdaptersLabel, 0, 0, 1, 1)
|
||||
@@ -284,9 +297,6 @@ class Ui_QemuVMConfigPageWidget(object):
|
||||
self.uiPortNameFormatLineEdit.setText("")
|
||||
self.uiPortNameFormatLineEdit.setObjectName("uiPortNameFormatLineEdit")
|
||||
self.gridLayout_5.addWidget(self.uiPortNameFormatLineEdit, 2, 1, 1, 2)
|
||||
self.uiPortSegmentSizeLabel = QtWidgets.QLabel(self.uiNetworkTab)
|
||||
self.uiPortSegmentSizeLabel.setObjectName("uiPortSegmentSizeLabel")
|
||||
self.gridLayout_5.addWidget(self.uiPortSegmentSizeLabel, 3, 0, 1, 1)
|
||||
self.uiMacAddrLabel = QtWidgets.QLabel(self.uiNetworkTab)
|
||||
self.uiMacAddrLabel.setObjectName("uiMacAddrLabel")
|
||||
self.gridLayout_5.addWidget(self.uiMacAddrLabel, 4, 0, 1, 1)
|
||||
@@ -304,9 +314,9 @@ class Ui_QemuVMConfigPageWidget(object):
|
||||
self.gridLayout_5.addWidget(self.uiCustomAdaptersConfigurationPushButton, 6, 1, 1, 2)
|
||||
self.uiLegacyNetworkingCheckBox = QtWidgets.QCheckBox(self.uiNetworkTab)
|
||||
self.uiLegacyNetworkingCheckBox.setObjectName("uiLegacyNetworkingCheckBox")
|
||||
self.gridLayout_5.addWidget(self.uiLegacyNetworkingCheckBox, 7, 0, 1, 3)
|
||||
self.gridLayout_5.addWidget(self.uiLegacyNetworkingCheckBox, 8, 0, 1, 3)
|
||||
spacerItem3 = QtWidgets.QSpacerItem(20, 261, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
|
||||
self.gridLayout_5.addItem(spacerItem3, 8, 2, 1, 1)
|
||||
self.gridLayout_5.addItem(spacerItem3, 9, 2, 1, 1)
|
||||
self.uiAdapterTypesComboBox = QtWidgets.QComboBox(self.uiNetworkTab)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
@@ -315,11 +325,6 @@ class Ui_QemuVMConfigPageWidget(object):
|
||||
self.uiAdapterTypesComboBox.setSizePolicy(sizePolicy)
|
||||
self.uiAdapterTypesComboBox.setObjectName("uiAdapterTypesComboBox")
|
||||
self.gridLayout_5.addWidget(self.uiAdapterTypesComboBox, 5, 1, 1, 2)
|
||||
self.uiPortSegmentSizeSpinBox = QtWidgets.QSpinBox(self.uiNetworkTab)
|
||||
self.uiPortSegmentSizeSpinBox.setMaximum(128)
|
||||
self.uiPortSegmentSizeSpinBox.setSingleStep(4)
|
||||
self.uiPortSegmentSizeSpinBox.setObjectName("uiPortSegmentSizeSpinBox")
|
||||
self.gridLayout_5.addWidget(self.uiPortSegmentSizeSpinBox, 3, 1, 1, 2)
|
||||
self.uiAdaptersSpinBox = QtWidgets.QSpinBox(self.uiNetworkTab)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
@@ -330,6 +335,9 @@ class Ui_QemuVMConfigPageWidget(object):
|
||||
self.uiAdaptersSpinBox.setMaximum(275)
|
||||
self.uiAdaptersSpinBox.setObjectName("uiAdaptersSpinBox")
|
||||
self.gridLayout_5.addWidget(self.uiAdaptersSpinBox, 0, 1, 1, 2)
|
||||
self.uiReplicateNetworkConnectionStateCheckBox = QtWidgets.QCheckBox(self.uiNetworkTab)
|
||||
self.uiReplicateNetworkConnectionStateCheckBox.setObjectName("uiReplicateNetworkConnectionStateCheckBox")
|
||||
self.gridLayout_5.addWidget(self.uiReplicateNetworkConnectionStateCheckBox, 7, 0, 1, 3)
|
||||
self.uiQemutabWidget.addTab(self.uiNetworkTab, "")
|
||||
self.uiAdvancedSettingsTab = QtWidgets.QWidget()
|
||||
self.uiAdvancedSettingsTab.setObjectName("uiAdvancedSettingsTab")
|
||||
@@ -492,6 +500,7 @@ class Ui_QemuVMConfigPageWidget(object):
|
||||
self.uiHdcDiskImageResizeToolButton.setText(_translate("QemuVMConfigPageWidget", "Resize..."))
|
||||
self.uiHdcDiskInterfaceLabel.setText(_translate("QemuVMConfigPageWidget", "Disk interface:"))
|
||||
self.uiHddGroupBox.setTitle(_translate("QemuVMConfigPageWidget", "HDD (Secondary Slave)"))
|
||||
self.uiCreateConfigDiskCheckBox.setText(_translate("QemuVMConfigPageWidget", "Automatically create a config disk on HDD"))
|
||||
self.uiHddDiskImageLabel.setText(_translate("QemuVMConfigPageWidget", "Disk image:"))
|
||||
self.uiHddDiskImageToolButton.setText(_translate("QemuVMConfigPageWidget", "&Browse..."))
|
||||
self.uiHddDiskImageCreateToolButton.setText(_translate("QemuVMConfigPageWidget", "Create..."))
|
||||
@@ -502,16 +511,17 @@ class Ui_QemuVMConfigPageWidget(object):
|
||||
self.uiCdromImageLabel.setText(_translate("QemuVMConfigPageWidget", "Image:"))
|
||||
self.uiCdromImageToolButton.setText(_translate("QemuVMConfigPageWidget", "&Browse..."))
|
||||
self.uiQemutabWidget.setTabText(self.uiQemutabWidget.indexOf(self.uiCdromTab), _translate("QemuVMConfigPageWidget", "CD/DVD"))
|
||||
self.uiPortSegmentSizeLabel.setText(_translate("QemuVMConfigPageWidget", "Segment size:"))
|
||||
self.uiAdaptersLabel.setText(_translate("QemuVMConfigPageWidget", "Adapters:"))
|
||||
self.uiFirstPortNameLabel.setText(_translate("QemuVMConfigPageWidget", "First port name:"))
|
||||
self.uiPortNameFormatLabel.setToolTip(_translate("QemuVMConfigPageWidget", "<html><head/><body><p>{0} - the port number, from 0 to the number of adapters-1.</p><p>{1} - the segment number, from 0 to the number of segments-1.</p><p>{port0} - named alias for {0}.</p><p>{port1} - the port number, from 1 to the number of adapters.</p><p>{segment0} - named alias for {1}.</p><p>{segment1} - the segment number, from 1 to the number of segments.</p></body></html>"))
|
||||
self.uiPortNameFormatLabel.setText(_translate("QemuVMConfigPageWidget", "Name format:"))
|
||||
self.uiPortSegmentSizeLabel.setText(_translate("QemuVMConfigPageWidget", "Segment size:"))
|
||||
self.uiMacAddrLabel.setText(_translate("QemuVMConfigPageWidget", "Base MAC:"))
|
||||
self.uiAdapterTypesLabel.setText(_translate("QemuVMConfigPageWidget", "Type:"))
|
||||
self.uiCustomAdaptersLabel.setText(_translate("QemuVMConfigPageWidget", "Custom adapters:"))
|
||||
self.uiCustomAdaptersConfigurationPushButton.setText(_translate("QemuVMConfigPageWidget", "&Configure custom adapters"))
|
||||
self.uiLegacyNetworkingCheckBox.setText(_translate("QemuVMConfigPageWidget", "Use the legacy networking mode"))
|
||||
self.uiReplicateNetworkConnectionStateCheckBox.setText(_translate("QemuVMConfigPageWidget", "Replicate network connection states in Qemu"))
|
||||
self.uiQemutabWidget.setTabText(self.uiQemutabWidget.indexOf(self.uiNetworkTab), _translate("QemuVMConfigPageWidget", "Network"))
|
||||
self.uiLinuxBootGroupBox.setTitle(_translate("QemuVMConfigPageWidget", "Linux boot specific settings"))
|
||||
self.uiKernelCommandLineLabel.setText(_translate("QemuVMConfigPageWidget", "Kernel command line:"))
|
||||
@@ -541,9 +551,10 @@ class Ui_QemuVMConfigPageWidget(object):
|
||||
"<li>%vm-id% =VM ID</li>\n"
|
||||
"<li>%project-id% = project ID</li>\n"
|
||||
"<li>%project-path% = project path</li>\n"
|
||||
"<li>%console-port% = console port number</li>\n"
|
||||
"<li>%guest-cid% = unique ID from 3 to 65535</li>\n"
|
||||
"</ul>\n"
|
||||
"</body></html>"))
|
||||
self.uiBaseVMCheckBox.setText(_translate("QemuVMConfigPageWidget", "Use as a linked base VM"))
|
||||
self.uiQemutabWidget.setTabText(self.uiQemutabWidget.indexOf(self.uiAdvancedSettingsTab), _translate("QemuVMConfigPageWidget", "Advanced"))
|
||||
self.uiQemutabWidget.setTabText(self.uiQemutabWidget.indexOf(self.uiUsageTab), _translate("QemuVMConfigPageWidget", "Usage"))
|
||||
|
||||
|
||||
@@ -106,6 +106,13 @@
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="uiNameLineEdit"/>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="uiLegacyASACheckBox">
|
||||
<property name="text">
|
||||
<string>This is a legacy ASA VM</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWizardPage" name="uiBinaryMemoryWizardPage">
|
||||
@@ -305,6 +312,114 @@
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWizardPage" name="uiInitrdKernelImageWizardPage">
|
||||
<property name="title">
|
||||
<string>Linux boot specific settings</string>
|
||||
</property>
|
||||
<property name="subTitle">
|
||||
<string>Please choose a initrd and a kernel image.</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_4">
|
||||
<item row="0" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_7">
|
||||
<item>
|
||||
<widget class="QRadioButton" name="uiLinuxExistingImageRadioButton">
|
||||
<property name="text">
|
||||
<string>Existing image</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="uiNewImageRadioButton_4">
|
||||
<property name="text">
|
||||
<string>New Image</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_5">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<layout class="QFormLayout" name="formLayout_2">
|
||||
<property name="fieldGrowthPolicy">
|
||||
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
|
||||
</property>
|
||||
<item row="0" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_11">
|
||||
<item>
|
||||
<widget class="QComboBox" name="uiInitrdImageListComboBox"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="uiInitrdImageLineEdit"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="uiInitrdImageToolButton">
|
||||
<property name="text">
|
||||
<string>&Browse...</string>
|
||||
</property>
|
||||
<property name="toolButtonStyle">
|
||||
<enum>Qt::ToolButtonTextOnly</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="uiKernelImageLabel">
|
||||
<property name="text">
|
||||
<string>Kernel image (vmlinuz):</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_14">
|
||||
<item>
|
||||
<widget class="QComboBox" name="uiKernelImageListComboBox"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="uiKernelImageLineEdit"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="uiKernelImageToolButton">
|
||||
<property name="text">
|
||||
<string>&Browse...</string>
|
||||
</property>
|
||||
<property name="toolButtonStyle">
|
||||
<enum>Qt::ToolButtonTextOnly</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="uiInitrdLabel">
|
||||
<property name="text">
|
||||
<string>Initial RAM disk (initrd):</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
<tabstops>
|
||||
<tabstop>uiNameLineEdit</tabstop>
|
||||
|
||||
@@ -60,6 +60,9 @@ class Ui_QemuVMWizard(object):
|
||||
self.uiNameLineEdit = QtWidgets.QLineEdit(self.uiNameWizardPage)
|
||||
self.uiNameLineEdit.setObjectName("uiNameLineEdit")
|
||||
self.gridLayout.addWidget(self.uiNameLineEdit, 0, 1, 1, 1)
|
||||
self.uiLegacyASACheckBox = QtWidgets.QCheckBox(self.uiNameWizardPage)
|
||||
self.uiLegacyASACheckBox.setObjectName("uiLegacyASACheckBox")
|
||||
self.gridLayout.addWidget(self.uiLegacyASACheckBox, 1, 0, 1, 2)
|
||||
QemuVMWizard.addPage(self.uiNameWizardPage)
|
||||
self.uiBinaryMemoryWizardPage = QtWidgets.QWizardPage()
|
||||
self.uiBinaryMemoryWizardPage.setObjectName("uiBinaryMemoryWizardPage")
|
||||
@@ -146,6 +149,60 @@ class Ui_QemuVMWizard(object):
|
||||
self.horizontalLayout_8.addWidget(self.uiHdaDiskImageCreateToolButton)
|
||||
self.gridLayout_3.addLayout(self.horizontalLayout_8, 1, 0, 1, 1)
|
||||
QemuVMWizard.addPage(self.uiDiskWizardPage)
|
||||
self.uiInitrdKernelImageWizardPage = QtWidgets.QWizardPage()
|
||||
self.uiInitrdKernelImageWizardPage.setObjectName("uiInitrdKernelImageWizardPage")
|
||||
self.gridLayout_4 = QtWidgets.QGridLayout(self.uiInitrdKernelImageWizardPage)
|
||||
self.gridLayout_4.setObjectName("gridLayout_4")
|
||||
self.horizontalLayout_7 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_7.setObjectName("horizontalLayout_7")
|
||||
self.uiLinuxExistingImageRadioButton = QtWidgets.QRadioButton(self.uiInitrdKernelImageWizardPage)
|
||||
self.uiLinuxExistingImageRadioButton.setChecked(True)
|
||||
self.uiLinuxExistingImageRadioButton.setObjectName("uiLinuxExistingImageRadioButton")
|
||||
self.horizontalLayout_7.addWidget(self.uiLinuxExistingImageRadioButton)
|
||||
self.uiNewImageRadioButton_4 = QtWidgets.QRadioButton(self.uiInitrdKernelImageWizardPage)
|
||||
self.uiNewImageRadioButton_4.setChecked(False)
|
||||
self.uiNewImageRadioButton_4.setObjectName("uiNewImageRadioButton_4")
|
||||
self.horizontalLayout_7.addWidget(self.uiNewImageRadioButton_4)
|
||||
spacerItem2 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
|
||||
self.horizontalLayout_7.addItem(spacerItem2)
|
||||
self.gridLayout_4.addLayout(self.horizontalLayout_7, 0, 0, 1, 1)
|
||||
self.formLayout_2 = QtWidgets.QFormLayout()
|
||||
self.formLayout_2.setFieldGrowthPolicy(QtWidgets.QFormLayout.AllNonFixedFieldsGrow)
|
||||
self.formLayout_2.setObjectName("formLayout_2")
|
||||
self.horizontalLayout_11 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_11.setObjectName("horizontalLayout_11")
|
||||
self.uiInitrdImageListComboBox = QtWidgets.QComboBox(self.uiInitrdKernelImageWizardPage)
|
||||
self.uiInitrdImageListComboBox.setObjectName("uiInitrdImageListComboBox")
|
||||
self.horizontalLayout_11.addWidget(self.uiInitrdImageListComboBox)
|
||||
self.uiInitrdImageLineEdit = QtWidgets.QLineEdit(self.uiInitrdKernelImageWizardPage)
|
||||
self.uiInitrdImageLineEdit.setObjectName("uiInitrdImageLineEdit")
|
||||
self.horizontalLayout_11.addWidget(self.uiInitrdImageLineEdit)
|
||||
self.uiInitrdImageToolButton = QtWidgets.QToolButton(self.uiInitrdKernelImageWizardPage)
|
||||
self.uiInitrdImageToolButton.setToolButtonStyle(QtCore.Qt.ToolButtonTextOnly)
|
||||
self.uiInitrdImageToolButton.setObjectName("uiInitrdImageToolButton")
|
||||
self.horizontalLayout_11.addWidget(self.uiInitrdImageToolButton)
|
||||
self.formLayout_2.setLayout(0, QtWidgets.QFormLayout.FieldRole, self.horizontalLayout_11)
|
||||
self.uiKernelImageLabel = QtWidgets.QLabel(self.uiInitrdKernelImageWizardPage)
|
||||
self.uiKernelImageLabel.setObjectName("uiKernelImageLabel")
|
||||
self.formLayout_2.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.uiKernelImageLabel)
|
||||
self.horizontalLayout_14 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_14.setObjectName("horizontalLayout_14")
|
||||
self.uiKernelImageListComboBox = QtWidgets.QComboBox(self.uiInitrdKernelImageWizardPage)
|
||||
self.uiKernelImageListComboBox.setObjectName("uiKernelImageListComboBox")
|
||||
self.horizontalLayout_14.addWidget(self.uiKernelImageListComboBox)
|
||||
self.uiKernelImageLineEdit = QtWidgets.QLineEdit(self.uiInitrdKernelImageWizardPage)
|
||||
self.uiKernelImageLineEdit.setObjectName("uiKernelImageLineEdit")
|
||||
self.horizontalLayout_14.addWidget(self.uiKernelImageLineEdit)
|
||||
self.uiKernelImageToolButton = QtWidgets.QToolButton(self.uiInitrdKernelImageWizardPage)
|
||||
self.uiKernelImageToolButton.setToolButtonStyle(QtCore.Qt.ToolButtonTextOnly)
|
||||
self.uiKernelImageToolButton.setObjectName("uiKernelImageToolButton")
|
||||
self.horizontalLayout_14.addWidget(self.uiKernelImageToolButton)
|
||||
self.formLayout_2.setLayout(1, QtWidgets.QFormLayout.FieldRole, self.horizontalLayout_14)
|
||||
self.uiInitrdLabel = QtWidgets.QLabel(self.uiInitrdKernelImageWizardPage)
|
||||
self.uiInitrdLabel.setObjectName("uiInitrdLabel")
|
||||
self.formLayout_2.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.uiInitrdLabel)
|
||||
self.gridLayout_4.addLayout(self.formLayout_2, 1, 0, 1, 1)
|
||||
QemuVMWizard.addPage(self.uiInitrdKernelImageWizardPage)
|
||||
|
||||
self.retranslateUi(QemuVMWizard)
|
||||
QtCore.QMetaObject.connectSlotsByName(QemuVMWizard)
|
||||
@@ -168,6 +225,7 @@ class Ui_QemuVMWizard(object):
|
||||
self.uiNameWizardPage.setTitle(_translate("QemuVMWizard", "QEMU VM name"))
|
||||
self.uiNameWizardPage.setSubTitle(_translate("QemuVMWizard", "Please choose a descriptive name for your new QEMU virtual machine."))
|
||||
self.uiNameLabel.setText(_translate("QemuVMWizard", "Name:"))
|
||||
self.uiLegacyASACheckBox.setText(_translate("QemuVMWizard", "This is a legacy ASA VM"))
|
||||
self.uiBinaryMemoryWizardPage.setTitle(_translate("QemuVMWizard", "QEMU binary and memory"))
|
||||
self.uiBinaryMemoryWizardPage.setSubTitle(_translate("QemuVMWizard", "Please check the Qemu binary is correctly set and the virtual machine has enough memory to work."))
|
||||
self.uiQemuListLabel.setText(_translate("QemuVMWizard", "Qemu binary:"))
|
||||
@@ -188,4 +246,12 @@ class Ui_QemuVMWizard(object):
|
||||
self.uiHdaDiskImageLabel.setText(_translate("QemuVMWizard", "Disk image (hda):"))
|
||||
self.uiHdaDiskImageToolButton.setText(_translate("QemuVMWizard", "&Browse..."))
|
||||
self.uiHdaDiskImageCreateToolButton.setText(_translate("QemuVMWizard", "&Create"))
|
||||
self.uiInitrdKernelImageWizardPage.setTitle(_translate("QemuVMWizard", "Linux boot specific settings"))
|
||||
self.uiInitrdKernelImageWizardPage.setSubTitle(_translate("QemuVMWizard", "Please choose a initrd and a kernel image."))
|
||||
self.uiLinuxExistingImageRadioButton.setText(_translate("QemuVMWizard", "Existing image"))
|
||||
self.uiNewImageRadioButton_4.setText(_translate("QemuVMWizard", "New Image"))
|
||||
self.uiInitrdImageToolButton.setText(_translate("QemuVMWizard", "&Browse..."))
|
||||
self.uiKernelImageLabel.setText(_translate("QemuVMWizard", "Kernel image (vmlinuz):"))
|
||||
self.uiKernelImageToolButton.setText(_translate("QemuVMWizard", "&Browse..."))
|
||||
self.uiInitrdLabel.setText(_translate("QemuVMWizard", "Initial RAM disk (initrd):"))
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ class TraceNGNode(Node):
|
||||
self._last_destination = destination
|
||||
params = {"destination": destination}
|
||||
log.debug("{} is starting".format(self.name()))
|
||||
self.controllerHttpPost("/nodes/{node_id}/start".format(node_id=self._node_id), self._startCallback, body=params, timeout=None, progressText="{} is starting".format(self.name()))
|
||||
self.controllerHttpPost("/nodes/{node_id}/start".format(node_id=self._node_id), self._startCallback, body=params, timeout=None, showProgress=False)
|
||||
|
||||
def info(self):
|
||||
"""
|
||||
|
||||
@@ -99,7 +99,7 @@ class VirtualBoxVMConfigurationPage(QtWidgets.QWidget, Ui_virtualBoxVMConfigPage
|
||||
|
||||
try:
|
||||
ports = StandardPortNameFactory(adapters, first_port_name, port_name_format, port_segment_size)
|
||||
except (ValueError, KeyError):
|
||||
except (IndexError, ValueError, KeyError):
|
||||
QtWidgets.QMessageBox.critical(self, "Invalid format", "Invalid port name format")
|
||||
return
|
||||
|
||||
|
||||
@@ -99,7 +99,7 @@ class VMwareVMConfigurationPage(QtWidgets.QWidget, Ui_VMwareVMConfigPageWidget):
|
||||
|
||||
try:
|
||||
ports = StandardPortNameFactory(adapters, first_port_name, port_name_format, port_segment_size)
|
||||
except (ValueError, KeyError):
|
||||
except (IndexError, ValueError, KeyError):
|
||||
QtWidgets.QMessageBox.critical(self, "Invalid format", "Invalid port name format")
|
||||
return
|
||||
|
||||
|
||||
59
gns3/node.py
59
gns3/node.py
@@ -199,6 +199,26 @@ class Node(BaseNode):
|
||||
|
||||
return self._always_on
|
||||
|
||||
def configFiles(self):
|
||||
"""
|
||||
Name of the configuration files
|
||||
|
||||
This method should be overridden in derived classes
|
||||
|
||||
:returns: List of configuration files, False if no files
|
||||
"""
|
||||
|
||||
return None
|
||||
|
||||
def configTextFiles(self):
|
||||
"""
|
||||
Name of the configuration files, which are plain text files
|
||||
|
||||
:returns: List of configuration files, False if no files
|
||||
"""
|
||||
|
||||
return self.configFiles()
|
||||
|
||||
def get(self, path, *args, **kwargs):
|
||||
"""
|
||||
GET on current server / project
|
||||
@@ -223,7 +243,7 @@ class Node(BaseNode):
|
||||
return
|
||||
|
||||
log.debug("{} is starting".format(self.name()))
|
||||
self.post("/start", self._startCallback, timeout=None, progressText="{} is starting".format(self.name()))
|
||||
self.post("/start", self._startCallback, timeout=None, showProgress=False)
|
||||
|
||||
def _startCallback(self, result, error=False, **kwargs):
|
||||
"""
|
||||
@@ -249,7 +269,7 @@ class Node(BaseNode):
|
||||
return
|
||||
|
||||
log.debug("{} is stopping".format(self.name()))
|
||||
self.post("/stop", self._stopCallback, timeout=None, progressText="{} is stopping".format(self.name()))
|
||||
self.post("/stop", self._stopCallback, timeout=None, showProgress=False)
|
||||
|
||||
def _stopCallback(self, result, error=False, **kwargs):
|
||||
"""
|
||||
@@ -279,7 +299,7 @@ class Node(BaseNode):
|
||||
return
|
||||
|
||||
log.debug("{} is being suspended".format(self.name()))
|
||||
self.post("/suspend", self._suspendCallback, timeout=None, progressText="{} is suspending".format(self.name()))
|
||||
self.post("/suspend", self._suspendCallback, timeout=None, showProgress=False)
|
||||
|
||||
def _suspendCallback(self, result, error=False, **kwargs):
|
||||
"""
|
||||
@@ -301,7 +321,7 @@ class Node(BaseNode):
|
||||
"""
|
||||
|
||||
log.debug("{} is being reloaded".format(self.name()))
|
||||
self.post("/reload", self._reloadCallback, timeout=None, progressText="{} is reloading".format(self.name()))
|
||||
self.post("/reload", self._reloadCallback, timeout=None, showProgress=False)
|
||||
|
||||
def _reloadCallback(self, result, error=False, **kwargs):
|
||||
"""
|
||||
@@ -455,7 +475,7 @@ class Node(BaseNode):
|
||||
if not skip_controller:
|
||||
for link in self.links():
|
||||
link.setDeleting()
|
||||
self.controllerHttpDelete("/nodes/{node_id}".format(node_id=self._node_id), self._deleteCallback)
|
||||
self.controllerHttpDelete("/nodes/{node_id}".format(node_id=self._node_id), self._deleteCallback, showProgress=False)
|
||||
else:
|
||||
self.deleted_signal.emit()
|
||||
self._module.removeNode(self)
|
||||
@@ -485,7 +505,7 @@ class Node(BaseNode):
|
||||
"y": int(y),
|
||||
"z": int(z)}
|
||||
|
||||
self.post("/duplicate", self._duplicateCallback, body=params, timeout=None, progressText="{} is being duplicated".format(self.name()))
|
||||
self.post("/duplicate", self._duplicateCallback, body=params, timeout=None, showProgress=False)
|
||||
|
||||
def _duplicateCallback(self, result, error=False, **kwargs):
|
||||
"""
|
||||
@@ -628,12 +648,12 @@ class Node(BaseNode):
|
||||
from .main_window import MainWindow
|
||||
general_settings = MainWindow.instance().settings()
|
||||
|
||||
if console_type != "telnet":
|
||||
if not console_type:
|
||||
console_type = self.consoleType()
|
||||
if console_type == "vnc":
|
||||
return general_settings["vnc_console_command"]
|
||||
if console_type.startswith("spice"):
|
||||
return general_settings["spice_console_command"]
|
||||
if console_type == "vnc":
|
||||
return general_settings["vnc_console_command"]
|
||||
elif console_type.startswith("spice"):
|
||||
return general_settings["spice_console_command"]
|
||||
return general_settings["telnet_console_command"]
|
||||
|
||||
def consoleType(self):
|
||||
@@ -641,7 +661,7 @@ class Node(BaseNode):
|
||||
Get the console type (serial, telnet or VNC)
|
||||
"""
|
||||
|
||||
console_type = "telnet"
|
||||
console_type = "none"
|
||||
if "console_type" in self.settings():
|
||||
return self.settings()["console_type"]
|
||||
return console_type
|
||||
@@ -654,7 +674,7 @@ class Node(BaseNode):
|
||||
"""
|
||||
|
||||
host = self.settings()["console_host"]
|
||||
if host is None or host == "::" or host == "0.0.0.0":
|
||||
if host is None or host == "::" or host == "0.0.0.0" or host == "0:0:0:0:0:0:0:0":
|
||||
host = Controller.instance().host()
|
||||
return host
|
||||
|
||||
@@ -704,10 +724,10 @@ class Node(BaseNode):
|
||||
nodeTelnetConsole(self, console_port, command)
|
||||
elif console_type == "vnc":
|
||||
from .vnc_console import vncConsole
|
||||
vncConsole(self.consoleHost(), console_port, command)
|
||||
vncConsole(self, console_port, command)
|
||||
elif console_type.startswith("spice"):
|
||||
from .spice_console import spiceConsole
|
||||
spiceConsole(self.consoleHost(), console_port, command)
|
||||
spiceConsole(self, console_port, command)
|
||||
elif console_type == "http" or console_type == "https":
|
||||
QtGui.QDesktopServices.openUrl(QtCore.QUrl("{console_type}://{host}:{port}{path}".format(console_type=console_type, host=self.consoleHost(), port=console_port, path=self.consoleHttpPath())))
|
||||
|
||||
@@ -765,7 +785,7 @@ class Node(BaseNode):
|
||||
with open(context["path"], "wb+") as f:
|
||||
f.write(raw_body)
|
||||
except OSError as e:
|
||||
log.erro("Can't write %s: %s", context["path"], str(e))
|
||||
log.error("Cannot export file '{}': {}".format(context["path"], e))
|
||||
|
||||
def exportConfigsToDirectory(self, directory):
|
||||
"""
|
||||
@@ -774,13 +794,14 @@ class Node(BaseNode):
|
||||
:param directory: destination directory path
|
||||
"""
|
||||
|
||||
if not hasattr(self, "configFiles"):
|
||||
return
|
||||
if not self.configFiles():
|
||||
return False
|
||||
for file in self.configFiles():
|
||||
self.get("/files/{file}".format(file=file),
|
||||
self._exportConfigsToDirectoryCallback,
|
||||
context={"directory": directory, "file": file},
|
||||
raw=True)
|
||||
return True
|
||||
|
||||
def _exportConfigsToDirectoryCallback(self, result, error=False, raw_body=None, context={}, **kwargs):
|
||||
"""
|
||||
@@ -812,7 +833,7 @@ class Node(BaseNode):
|
||||
:param directory: source directory path
|
||||
"""
|
||||
|
||||
if not hasattr(self, "configFiles"):
|
||||
if not self.configFiles():
|
||||
return
|
||||
|
||||
try:
|
||||
|
||||
@@ -142,19 +142,14 @@ class NodesView(QtWidgets.QTreeWidget):
|
||||
# when we're in docked mode, outside main window
|
||||
return self.window().parent()
|
||||
|
||||
def mousePressEvent(self, event):
|
||||
def contextMenuEvent(self, event):
|
||||
"""
|
||||
Handles all mouse press events.
|
||||
Handles all context menu events.
|
||||
|
||||
:param: QMouseEvent instance
|
||||
:param event: QContextMenuEvent instance
|
||||
"""
|
||||
|
||||
# Check that an item has been selected and right click
|
||||
if event.button() == QtCore.Qt.RightButton:
|
||||
self._showContextualMenu()
|
||||
event.accept()
|
||||
return
|
||||
super().mousePressEvent(event)
|
||||
self._showContextualMenu(event.globalPos())
|
||||
|
||||
def mouseMoveEvent(self, event):
|
||||
"""
|
||||
@@ -181,7 +176,7 @@ class NodesView(QtWidgets.QTreeWidget):
|
||||
drag.exec_(QtCore.Qt.CopyAction)
|
||||
event.accept()
|
||||
|
||||
def _showContextualMenu(self):
|
||||
def _showContextualMenu(self, pos):
|
||||
|
||||
menu = QtWidgets.QMenu()
|
||||
refresh_action = QtWidgets.QAction("Refresh templates", menu)
|
||||
@@ -207,7 +202,7 @@ class NodesView(QtWidgets.QTreeWidget):
|
||||
delete_action.triggered.connect(qpartial(self._deleteSlot, template))
|
||||
menu.addAction(delete_action)
|
||||
|
||||
menu.exec_(QtGui.QCursor.pos())
|
||||
menu.exec_(pos)
|
||||
|
||||
def _configurationSlot(self, template, configuration_page, source):
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ class PacketCapture:
|
||||
def __init__(self):
|
||||
self._tail_process = {}
|
||||
self._capture_reader_process = {}
|
||||
# Auto start the capture program for th link
|
||||
# Auto start the capture program for this link
|
||||
self._autostart = {}
|
||||
|
||||
Topology.instance().project_changed_signal.connect(self.killAllCapture)
|
||||
@@ -47,6 +47,7 @@ class PacketCapture:
|
||||
"""
|
||||
Kill all running captures (for example when change project)
|
||||
"""
|
||||
|
||||
for process in list(self._tail_process.values()):
|
||||
try:
|
||||
process.kill()
|
||||
@@ -89,12 +90,11 @@ class PacketCapture:
|
||||
|
||||
def _updatedLinkSlot(self, link_id):
|
||||
link = self.topology().getLink(link_id)
|
||||
|
||||
if link:
|
||||
if link.capturing():
|
||||
if self._autostart.get(link) and link not in self._tail_process:
|
||||
log.debug("Starting packet capture reader for link {}".format(link.link_id()))
|
||||
self.startPacketCaptureReader(link)
|
||||
log.debug("Has successfully started capturing packets on {} to {}".format(link.id(), link.capture_file_path()))
|
||||
else:
|
||||
self.stopPacketCaptureReader(link)
|
||||
|
||||
@@ -107,7 +107,6 @@ class PacketCapture:
|
||||
"""
|
||||
|
||||
link.stopCapture()
|
||||
log.debug("Has successfully stopped capturing packets on {}".format(link.id()))
|
||||
|
||||
def startPacketCaptureReader(self, link):
|
||||
"""
|
||||
@@ -120,6 +119,7 @@ class PacketCapture:
|
||||
Stop the packet capture reader
|
||||
"""
|
||||
if link in self._tail_process and self._tail_process[link].poll() is None:
|
||||
log.debug("Stopping packet capture reader for link {}".format(link.link_id()))
|
||||
self._tail_process[link].kill()
|
||||
del self._tail_process[link]
|
||||
|
||||
|
||||
@@ -421,8 +421,6 @@ class GeneralPreferencesPage(QtWidgets.QWidget, Ui_GeneralPreferencesPageWidget)
|
||||
|
||||
new_graphics_view_settings = {"scene_width": self.uiSceneWidthSpinBox.value(),
|
||||
"scene_height": self.uiSceneHeightSpinBox.value(),
|
||||
"grid_size": self.uiNodeGridSizeSpinBox.value(),
|
||||
"drawing_grid_size": self.uiDrawingGridSizeSpinBox.value(),
|
||||
"draw_rectangle_selected_item": self.uiRectangleSelectedItemCheckBox.isChecked(),
|
||||
"draw_link_status_points": self.uiDrawLinkStatusPointsCheckBox.isChecked(),
|
||||
"show_interface_labels_on_new_project": self.uiShowInterfaceLabelsOnNewProject.isChecked(),
|
||||
@@ -433,4 +431,12 @@ class GeneralPreferencesPage(QtWidgets.QWidget, Ui_GeneralPreferencesPageWidget)
|
||||
"default_label_color": self._default_label_color.name(),
|
||||
"default_note_font": self.uiDefaultNoteStylePlainTextEdit.font().toString(),
|
||||
"default_note_color": self._default_note_color.name()}
|
||||
|
||||
node_grid_size = self.uiNodeGridSizeSpinBox.value()
|
||||
drawing_grid_size = self.uiDrawingGridSizeSpinBox.value()
|
||||
if node_grid_size % drawing_grid_size != 0:
|
||||
QtWidgets.QMessageBox.critical(self, "Grid sizes", "Invalid grid sizes which will create overlapping lines")
|
||||
else:
|
||||
new_graphics_view_settings["grid_size"] = node_grid_size
|
||||
new_graphics_view_settings["drawing_grid_size"] = drawing_grid_size
|
||||
MainWindow.instance().uiGraphicsView.setSettings(new_graphics_view_settings)
|
||||
|
||||
@@ -42,6 +42,7 @@ class GNS3VMPreferencesPage(QtWidgets.QWidget, Ui_GNS3VMPreferencesPageWidget):
|
||||
self._initialized = False
|
||||
self.uiRefreshPushButton.clicked.connect(self._refreshVMSlot)
|
||||
self.uiGNS3VMEngineComboBox.currentIndexChanged.connect(self._engineChangedSlot)
|
||||
self.uiAllocatevCPUsRAMCheckBox.stateChanged.connect(self._allocatevCPUsRAMSlot)
|
||||
Controller.instance().connected_signal.connect(self.loadPreferences)
|
||||
|
||||
def pageInitialized(self):
|
||||
@@ -66,13 +67,35 @@ class GNS3VMPreferencesPage(QtWidgets.QWidget, Ui_GNS3VMPreferencesPageWidget):
|
||||
self.uiRamLabel.setVisible(engine["support_ram"])
|
||||
self.uiRamSpinBox.setVisible(engine["support_ram"])
|
||||
self.uiCpuSpinBox.setVisible(engine["support_ram"])
|
||||
if engine_id == "remote":
|
||||
self.uiPortLabel.setVisible(False)
|
||||
self.uiPortSpinBox.setVisible(False)
|
||||
else:
|
||||
self.uiPortLabel.setVisible(True)
|
||||
self.uiPortSpinBox.setVisible(True)
|
||||
self._refreshVMSlot(ignore_error=True)
|
||||
|
||||
def _allocatevCPUsRAMSlot(self, state):
|
||||
"""
|
||||
Slot to enable or not the vCPUS and RAM spin boxes.
|
||||
"""
|
||||
|
||||
if state:
|
||||
self.uiRamSpinBox.setEnabled(True)
|
||||
self.uiCpuSpinBox.setEnabled(True)
|
||||
else:
|
||||
self.uiRamSpinBox.setEnabled(False)
|
||||
self.uiCpuSpinBox.setEnabled(False)
|
||||
|
||||
def loadPreferences(self):
|
||||
"""
|
||||
Loads the preference from controller.
|
||||
"""
|
||||
Controller.instance().get("/gns3vm", self._getSettingsCallback)
|
||||
|
||||
if Controller.instance().connected():
|
||||
Controller.instance().get("/gns3vm", self._getSettingsCallback)
|
||||
else:
|
||||
log.error("Cannot load the GNS3 VM settings in the preferences dialog: not connected to the controller")
|
||||
|
||||
@qslot
|
||||
def _getSettingsCallback(self, result, error=False, **kwargs):
|
||||
@@ -81,12 +104,14 @@ class GNS3VMPreferencesPage(QtWidgets.QWidget, Ui_GNS3VMPreferencesPageWidget):
|
||||
return
|
||||
if error:
|
||||
if "message" in result:
|
||||
log.error("Error while getting settings : {}".format(result["message"]))
|
||||
log.error("Error while getting the GNS3 VM settings : {}".format(result["message"]))
|
||||
return
|
||||
self._old_settings = copy.copy(result)
|
||||
self._settings = result
|
||||
self.uiAllocatevCPUsRAMCheckBox.setChecked(self._settings["allocate_vcpus_ram"])
|
||||
self.uiRamSpinBox.setValue(self._settings["ram"])
|
||||
self.uiCpuSpinBox.setValue(self._settings["vcpus"])
|
||||
self.uiPortSpinBox.setValue(self._settings.get("port", 3080))
|
||||
self.uiEnableVMCheckBox.setChecked(self._settings["enable"])
|
||||
if self._settings["when_exit"] == "keep":
|
||||
self.uiWhenExitKeepRadioButton.setChecked(True)
|
||||
@@ -163,8 +188,10 @@ class GNS3VMPreferencesPage(QtWidgets.QWidget, Ui_GNS3VMPreferencesPageWidget):
|
||||
"headless": self.uiHeadlessCheckBox.isChecked(),
|
||||
"when_exit": when_exit,
|
||||
"engine": self.uiGNS3VMEngineComboBox.currentData(),
|
||||
"allocate_vcpus_ram": self.uiAllocatevCPUsRAMCheckBox.isChecked(),
|
||||
"ram": self.uiRamSpinBox.value(),
|
||||
"vcpus": self.uiCpuSpinBox.value()
|
||||
"vcpus": self.uiCpuSpinBox.value(),
|
||||
"port": self.uiPortSpinBox.value()
|
||||
}
|
||||
if self._old_settings != settings:
|
||||
Controller.instance().put("/gns3vm", self._saveSettingsCallback, settings, timeout=60 * 5)
|
||||
|
||||
@@ -67,6 +67,7 @@ class ServerPreferencesPage(QtWidgets.QWidget, Ui_ServerPreferencesPageWidget):
|
||||
# ignore link-local addresses
|
||||
continue
|
||||
self.uiLocalServerHostComboBox.addItem(address_string, address_string)
|
||||
self.uiLocalServerHostComboBox.addItem("localhost", "localhost") # local host
|
||||
self.uiLocalServerHostComboBox.addItem("::", "::") # all IPv6 addresses
|
||||
self.uiLocalServerHostComboBox.addItem("0.0.0.0", "0.0.0.0") # all IPv4 addresses
|
||||
|
||||
@@ -190,6 +191,7 @@ class ServerPreferencesPage(QtWidgets.QWidget, Ui_ServerPreferencesPageWidget):
|
||||
|
||||
self.uiRemoteMainServerHostLineEdit.setText(servers_settings["host"])
|
||||
self.uiRemoteMainServerPortSpinBox.setValue(servers_settings["port"])
|
||||
self.uiRemoteMainServerProtocolComboBox.setCurrentText(servers_settings["protocol"].upper())
|
||||
self.uiRemoteMainServerUserLineEdit.setText(servers_settings["user"])
|
||||
self.uiRemoteMainServerPasswordLineEdit.setText(servers_settings["password"])
|
||||
self.uiRemoteMainServerAuthCheckBox.setChecked(servers_settings["auth"])
|
||||
@@ -284,7 +286,7 @@ class ServerPreferencesPage(QtWidgets.QWidget, Ui_ServerPreferencesPageWidget):
|
||||
else:
|
||||
new_local_server_settings["host"] = self.uiRemoteMainServerHostLineEdit.text()
|
||||
new_local_server_settings["port"] = self.uiRemoteMainServerPortSpinBox.value()
|
||||
new_local_server_settings["protocol"] = "http"
|
||||
new_local_server_settings["protocol"] = self.uiRemoteMainServerProtocolComboBox.currentText().lower()
|
||||
new_local_server_settings["user"] = self.uiRemoteMainServerUserLineEdit.text()
|
||||
new_local_server_settings["password"] = self.uiRemoteMainServerPasswordLineEdit.text()
|
||||
new_local_server_settings["auth"] = self.uiRemoteMainServerAuthCheckBox.isChecked()
|
||||
|
||||
@@ -189,7 +189,10 @@ class Progress(QtCore.QObject):
|
||||
# Due to Qt limitations for large numbers (above 32bit int) we calculate "progress" ourselves
|
||||
current, maximum = self._normalize(query['current'], query['maximum'])
|
||||
progress_dialog.setMaximum(maximum)
|
||||
progress_dialog.setValue(current)
|
||||
try:
|
||||
progress_dialog.setValue(current)
|
||||
except OverflowError:
|
||||
progress_dialog.setValue(100)
|
||||
|
||||
if text and query["maximum"] > 1000:
|
||||
text += "\n{} / {}".format(human_filesize(query["current"]), human_filesize(query["maximum"]))
|
||||
|
||||
@@ -17,14 +17,12 @@
|
||||
|
||||
import os
|
||||
import json
|
||||
from .qt import QtCore, qpartial, QtWidgets, QtNetwork, qslot
|
||||
from .qt import QtCore, qpartial, QtNetwork, QtWebSockets, qslot
|
||||
|
||||
from gns3.controller import Controller
|
||||
from gns3.compute_manager import ComputeManager
|
||||
from gns3.topology import Topology
|
||||
from gns3.local_config import LocalConfig
|
||||
from gns3.settings import GRAPHICS_VIEW_SETTINGS
|
||||
from gns3.template_manager import TemplateManager
|
||||
from gns3.utils import parse_version
|
||||
|
||||
import logging
|
||||
@@ -49,7 +47,6 @@ class Project(QtCore.QObject):
|
||||
# Called when project is fully loaded
|
||||
project_loaded_signal = QtCore.Signal()
|
||||
|
||||
|
||||
def __init__(self):
|
||||
|
||||
self._id = None
|
||||
@@ -84,6 +81,7 @@ class Project(QtCore.QObject):
|
||||
# Due to bug in Qt on some version we need a dedicated network manager
|
||||
self._notification_network_manager = QtNetwork.QNetworkAccessManager()
|
||||
self._notification_stream = None
|
||||
self._websocket = QtWebSockets.QWebSocket()
|
||||
|
||||
super().__init__()
|
||||
|
||||
@@ -485,7 +483,8 @@ class Project(QtCore.QObject):
|
||||
if self._closed:
|
||||
self._closed = False
|
||||
self._closing = False
|
||||
self._startListenNotifications()
|
||||
if not self._notification_stream:
|
||||
self._startListenNotifications()
|
||||
|
||||
self.project_updated_signal.emit()
|
||||
self.project_loaded_signal.emit()
|
||||
@@ -521,10 +520,12 @@ class Project(QtCore.QObject):
|
||||
def load(self, path=None):
|
||||
if not path:
|
||||
path = self.path()
|
||||
if path:
|
||||
if not Controller.instance().isRemote() and path:
|
||||
# load a local project from file
|
||||
body = {"path": path}
|
||||
Controller.instance().post("/projects/load", self._projectOpenCallback, body=body, timeout=None)
|
||||
else:
|
||||
# open a local/remote project
|
||||
self.post("/open", self._projectOpenCallback, timeout=None)
|
||||
|
||||
def _projectOpenCallback(self, result, error=False, **kwargs):
|
||||
@@ -537,7 +538,8 @@ class Project(QtCore.QObject):
|
||||
if self._closed:
|
||||
self._closed = False
|
||||
self._closing = False
|
||||
self._startListenNotifications()
|
||||
if not self._notification_stream:
|
||||
self._startListenNotifications()
|
||||
self.project_updated_signal.emit()
|
||||
|
||||
self.get("/nodes", self._listNodesCallback)
|
||||
@@ -609,7 +611,7 @@ class Project(QtCore.QObject):
|
||||
log.debug("Stop listening for notifications from project %s", self._id)
|
||||
stream = self._notification_stream
|
||||
self._notification_stream = None
|
||||
stream.abort()
|
||||
stream.close()
|
||||
|
||||
def _startListenNotifications(self):
|
||||
if not Controller.instance().connected():
|
||||
@@ -627,9 +629,10 @@ class Project(QtCore.QObject):
|
||||
|
||||
else:
|
||||
path = "/projects/{project_id}/notifications/ws".format(project_id=self._id)
|
||||
self._notification_stream = Controller.instance().connectProjectWebSocket(path)
|
||||
self._notification_stream = Controller.instance().httpClient().connectWebSocket(self._websocket, path)
|
||||
self._notification_stream.textMessageReceived.connect(self._websocket_event_received)
|
||||
self._notification_stream.error.connect(self._websocket_error)
|
||||
self._notification_stream.sslErrors.connect(self._sslErrorsSlot)
|
||||
|
||||
def _endListenNotificationCallback(self, result, error=False, **kwargs):
|
||||
"""
|
||||
@@ -646,6 +649,11 @@ class Project(QtCore.QObject):
|
||||
self._notification_stream = None
|
||||
self._startListenNotifications()
|
||||
|
||||
@qslot
|
||||
def _sslErrorsSlot(self, ssl_errors):
|
||||
|
||||
Controller.instance().httpClient().handleSslError(self._notification_stream, ssl_errors)
|
||||
|
||||
@qslot
|
||||
def _websocket_event_received(self, event):
|
||||
try:
|
||||
@@ -700,7 +708,7 @@ class Project(QtCore.QObject):
|
||||
elif result["action"] == "project.updated":
|
||||
self._projectUpdatedCallback(result["event"])
|
||||
elif result["action"] == "snapshot.restored":
|
||||
Topology.instance().createLoadProject({"project_id": result["event"]["project_id"]})
|
||||
Topology.instance().restoreSnapshot(result["event"]["project_id"])
|
||||
elif result["action"] == "log.error":
|
||||
log.error(result["event"]["message"])
|
||||
elif result["action"] == "log.warning":
|
||||
|
||||
@@ -115,10 +115,13 @@ class LogQMessageBox(QtWidgets.QMessageBox):
|
||||
show a stack trace when a critical message box is shown in debug mode
|
||||
"""
|
||||
@staticmethod
|
||||
def critical(parent, title, message, *args):
|
||||
def critical(parent, title, message, *args, show_stack_info=False):
|
||||
if message.startswith("QXcbConnection"): # Qt noise not relevant
|
||||
return
|
||||
LogQMessageBox._get_logger().critical(re.sub(r"<[^<]+?>", "", message), stack_info=LogQMessageBox.stack_info())
|
||||
stack_info = None
|
||||
if show_stack_info:
|
||||
stack_info = LogQMessageBox.stack_info()
|
||||
LogQMessageBox._get_logger().critical(re.sub(r"<[^<]+?>", "", message), stack_info=stack_info)
|
||||
if parent is False:
|
||||
# special case to display a QMessageBox before the main window is created.
|
||||
parent = None
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
import json
|
||||
import copy
|
||||
import os
|
||||
import collections
|
||||
import collections.abc
|
||||
import jsonschema
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ class ApplianceError(Exception):
|
||||
pass
|
||||
|
||||
|
||||
class Appliance(collections.Mapping):
|
||||
class Appliance(collections.abc.Mapping):
|
||||
|
||||
def __init__(self, registry, path):
|
||||
"""
|
||||
@@ -115,22 +115,14 @@ class Appliance(collections.Mapping):
|
||||
if not found:
|
||||
raise ApplianceError("Broken appliance missing file {} for version {}".format(filename, version["name"]))
|
||||
|
||||
def create_new_version(self, version_name):
|
||||
def create_new_version(self, new_version):
|
||||
"""
|
||||
Duplicate a version in order to create a new version
|
||||
"""
|
||||
if 'versions' not in self._appliance.keys() or len(self._appliance["versions"]) == 0:
|
||||
|
||||
if "versions" not in self._appliance.keys() or not self._appliance["versions"]:
|
||||
raise ApplianceError("Your appliance file doesn't contain any versions")
|
||||
|
||||
ref = self._appliance["versions"][0]
|
||||
new_version = {'name': version_name}
|
||||
new_version['images'] = {}
|
||||
|
||||
for disk_type in ref['images']:
|
||||
filename = ref['images'][disk_type]['filename']
|
||||
filename = filename.replace(ref['images'][disk_type]['version'], version_name)
|
||||
new_version['images'][disk_type] = {'filename': filename, 'version': version_name}
|
||||
self._appliance['versions'].append(new_version)
|
||||
self._appliance["versions"].append(new_version)
|
||||
|
||||
def search_images_for_version(self, version_name):
|
||||
"""
|
||||
@@ -150,9 +142,7 @@ class Appliance(collections.Mapping):
|
||||
for image_type, image in version["images"].items():
|
||||
image["type"] = image_type
|
||||
|
||||
img = self._registry.search_image_file(
|
||||
self.emulator(), image["filename"], image.get("md5sum"), image.get("filesize")
|
||||
)
|
||||
img = self._registry.search_image_file(self.emulator(), image["filename"], image.get("md5sum"), image.get("filesize"))
|
||||
if img is None:
|
||||
if "md5sum" in image:
|
||||
raise ApplianceError("File {} with checksum {} not found for {}".format(image["filename"], image["md5sum"], appliance["name"]))
|
||||
|
||||
@@ -17,10 +17,10 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import os
|
||||
import urllib.request
|
||||
import shutil
|
||||
from ssl import CertificateError
|
||||
|
||||
from ..qt import QtCore, QtWidgets, QtNetwork
|
||||
from ..controller import Controller
|
||||
from .config import Config, ConfigException
|
||||
|
||||
@@ -33,7 +33,7 @@ class ApplianceToTemplate:
|
||||
Appliance installation.
|
||||
"""
|
||||
|
||||
def new_template(self, appliance_config, server, controller_symbols=None):
|
||||
def new_template(self, appliance_config, server, controller_symbols=None, parent=None):
|
||||
"""
|
||||
Creates a new template from an appliance.
|
||||
|
||||
@@ -41,6 +41,7 @@ class ApplianceToTemplate:
|
||||
:param server
|
||||
"""
|
||||
|
||||
self._parent = parent
|
||||
new_template = {
|
||||
"compute_id": server,
|
||||
"name": appliance_config["name"]
|
||||
@@ -177,8 +178,9 @@ class ApplianceToTemplate:
|
||||
if symbol_id.startswith(":/symbols/"):
|
||||
return symbol_id
|
||||
|
||||
controller = Controller.instance()
|
||||
path = os.path.join(Config().symbols_dir, symbol_id)
|
||||
if os.path.exists(path):
|
||||
if not controller.isRemote() and os.path.exists(path):
|
||||
return os.path.basename(path)
|
||||
|
||||
if controller_symbols:
|
||||
@@ -195,11 +197,38 @@ class ApplianceToTemplate:
|
||||
|
||||
url = "https://raw.githubusercontent.com/GNS3/gns3-registry/master/symbols/{}".format(symbol_id)
|
||||
try:
|
||||
urllib.request.urlretrieve(url, path)
|
||||
controller = Controller.instance()
|
||||
self._downloadApplianceSymbol(url, path)
|
||||
controller.clearStaticCache()
|
||||
if controller.isRemote():
|
||||
controller.uploadSymbol(symbol_id, path)
|
||||
return os.path.basename(path)
|
||||
except (OSError, CertificateError):
|
||||
return None
|
||||
|
||||
def _downloadApplianceSymbol(self, url, path, timeout=30):
|
||||
"""
|
||||
Download an appliance symbol in a synchronous way.
|
||||
"""
|
||||
|
||||
network_manager = QtNetwork.QNetworkAccessManager()
|
||||
request = QtNetwork.QNetworkRequest(QtCore.QUrl(url))
|
||||
request.setRawHeader(b'User-Agent', b'GNS3 symbol downloader')
|
||||
reply = network_manager.get(request)
|
||||
progress_dialog = QtWidgets.QProgressDialog("Downloading '{}' appliance symbol...".format(os.path.basename(path)), "Cancel", 0, 0, self._parent)
|
||||
progress_dialog.setMinimumDuration(0)
|
||||
reply.finished.connect(progress_dialog.close)
|
||||
QtCore.QTimer.singleShot(timeout * 1000, progress_dialog.close)
|
||||
log.debug("Downloading appliance symbol from '{}'".format(url))
|
||||
progress_dialog.show()
|
||||
progress_dialog.exec_()
|
||||
status = reply.attribute(QtNetwork.QNetworkRequest.HttpStatusCodeAttribute)
|
||||
if reply.error() == QtNetwork.QNetworkReply.NoError and status == 200:
|
||||
try:
|
||||
with open(path, 'wb+') as f:
|
||||
f.write(reply.readAll())
|
||||
except OSError as e:
|
||||
log.debug("Error while saving appliance symbol to '{}': {}".format(path, e))
|
||||
raise
|
||||
log.debug("Appliance symbol downloaded and saved to '{}'".format(path))
|
||||
else:
|
||||
log.warning("Error when downloading appliance symbol from '{}': {}".format(url, reply.errorString()))
|
||||
|
||||
@@ -38,7 +38,7 @@ class Image:
|
||||
|
||||
self._location = "local"
|
||||
self._emulator = emulator
|
||||
self.path = path
|
||||
self._path = path
|
||||
if filename is None:
|
||||
self._filename = os.path.basename(self.path)
|
||||
else:
|
||||
@@ -66,6 +66,13 @@ class Image:
|
||||
"""
|
||||
return self._filename
|
||||
|
||||
@property
|
||||
def path(self):
|
||||
"""
|
||||
:returns: Image path
|
||||
"""
|
||||
return self._path
|
||||
|
||||
@property
|
||||
def version(self):
|
||||
"""
|
||||
@@ -90,12 +97,12 @@ class Image:
|
||||
"""
|
||||
|
||||
if self._md5sum is None:
|
||||
from_cache = Image._cache.get(self.path)
|
||||
from_cache = Image._cache.get(self._path)
|
||||
if from_cache:
|
||||
self._md5sum = from_cache
|
||||
return self._md5sum
|
||||
|
||||
md5_file = self.path + ".md5sum"
|
||||
md5_file = self._path + ".md5sum"
|
||||
if os.path.exists(md5_file):
|
||||
try:
|
||||
with open(md5_file) as f:
|
||||
@@ -105,20 +112,20 @@ class Image:
|
||||
log.debug("Could not read '{}': {}".format(md5_file, e))
|
||||
|
||||
try:
|
||||
if not os.path.isfile(self.path):
|
||||
if not os.path.isfile(self._path):
|
||||
return None
|
||||
m = hashlib.md5()
|
||||
with open(self._path, "rb") as f:
|
||||
while True:
|
||||
buf = f.read(4096)
|
||||
if not buf:
|
||||
break
|
||||
m.update(buf)
|
||||
except (OSError, PermissionError) as e:
|
||||
log.debug("Cannot access '{}': {}".format(self.path, e))
|
||||
log.debug("Cannot access '{}': {}".format(self._path, e))
|
||||
return None
|
||||
m = hashlib.md5()
|
||||
with open(self.path, "rb") as f:
|
||||
while True:
|
||||
buf = f.read(4096)
|
||||
if not buf:
|
||||
break
|
||||
m.update(buf)
|
||||
self._md5sum = m.hexdigest()
|
||||
Image._cache[self.path] = self._md5sum
|
||||
Image._cache[self._path] = self._md5sum
|
||||
return self._md5sum
|
||||
|
||||
@md5sum.setter
|
||||
@@ -133,7 +140,7 @@ class Image:
|
||||
if self._filesize is not None:
|
||||
return self._filesize
|
||||
try:
|
||||
self._filesize = os.path.getsize(self.path)
|
||||
self._filesize = os.path.getsize(self._path)
|
||||
return self._filesize
|
||||
except OSError:
|
||||
return 0
|
||||
|
||||
@@ -87,12 +87,12 @@ class Registry(QtCore.QObject):
|
||||
return remote_image
|
||||
|
||||
for directory in self._images_dirs:
|
||||
log.debug("Search images %s (%s) in %s", filename, md5sum, directory)
|
||||
log.debug("Search image {} (MD5={} SIZE={}) in '{}'".format(filename, md5sum, size, directory))
|
||||
if os.path.exists(directory):
|
||||
for file in os.listdir(directory):
|
||||
if not file.endswith(".md5sum") and not file.startswith("."):
|
||||
path = os.path.join(directory, file)
|
||||
try:
|
||||
try:
|
||||
for file in os.listdir(directory):
|
||||
if not file.endswith(".md5sum") and not file.startswith("."):
|
||||
path = os.path.join(directory, file)
|
||||
if os.path.isfile(path):
|
||||
if md5sum is None or strict_md5_check is False:
|
||||
if filename == os.path.basename(path):
|
||||
@@ -104,9 +104,9 @@ class Registry(QtCore.QObject):
|
||||
if size is None or (file_size - 10 < size and file_size + 10 > size):
|
||||
image = Image(emulator, path)
|
||||
if image.md5sum == md5sum:
|
||||
log.debug("Found images %s (%s) in %s", filename, md5sum, image.path)
|
||||
log.debug("Found image {} (MD5={}) in {}".format(filename, md5sum, image.path))
|
||||
return image
|
||||
except (OSError, PermissionError) as e:
|
||||
log.error("Cannot scan {}: {}".format(path, e))
|
||||
except (OSError, PermissionError) as e:
|
||||
log.error("Cannot scan {}: {}".format(path, e))
|
||||
|
||||
return None
|
||||
|
||||
@@ -166,6 +166,13 @@
|
||||
"extra_hosts": {
|
||||
"description": "Hosts which will be written to /etc/hosts into container" ,
|
||||
"type": "string"
|
||||
},
|
||||
"extra_volumes": {
|
||||
"description": "Additional directories to make persistent that are not included in the images VOLUME directive" ,
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
@@ -259,6 +266,9 @@
|
||||
"adapter_type": {
|
||||
"enum": [
|
||||
"e1000",
|
||||
"e1000-82544gc",
|
||||
"e1000-82545em",
|
||||
"e1000e",
|
||||
"i82550",
|
||||
"i82551",
|
||||
"i82557a",
|
||||
@@ -274,6 +284,7 @@
|
||||
"i82801",
|
||||
"ne2k_pci",
|
||||
"pcnet",
|
||||
"rocker",
|
||||
"rtl8139",
|
||||
"virtio",
|
||||
"virtio-net-pci",
|
||||
@@ -294,19 +305,19 @@
|
||||
"title": "Number of Virtual CPU"
|
||||
},
|
||||
"hda_disk_interface": {
|
||||
"enum": ["ide", "scsi", "sd", "mtd", "floppy", "pflash", "virtio", "sata"],
|
||||
"enum": ["ide", "sata", "nvme","scsi", "sd", "mtd", "floppy", "pflash", "virtio", "none"],
|
||||
"title": "Disk interface for the installed hda_disk_image"
|
||||
},
|
||||
"hdb_disk_interface": {
|
||||
"enum": ["ide", "scsi", "sd", "mtd", "floppy", "pflash", "virtio", "sata"],
|
||||
"enum": ["ide", "sata", "nvme", "scsi", "sd", "mtd", "floppy", "pflash", "virtio", "none"],
|
||||
"title": "Disk interface for the installed hdb_disk_image"
|
||||
},
|
||||
"hdc_disk_interface": {
|
||||
"enum": ["ide", "scsi", "sd", "mtd", "floppy", "pflash", "virtio", "sata"],
|
||||
"enum": ["ide", "sata", "nvme", "scsi", "sd", "mtd", "floppy", "pflash", "virtio", "none"],
|
||||
"title": "Disk interface for the installed hdc_disk_image"
|
||||
},
|
||||
"hdd_disk_interface": {
|
||||
"enum": ["ide", "scsi", "sd", "mtd", "floppy", "pflash", "virtio", "sata"],
|
||||
"enum": ["ide", "sata", "nvme", "scsi", "sd", "mtd", "floppy", "pflash", "virtio", "none"],
|
||||
"title": "Disk interface for the installed hdd_disk_image"
|
||||
},
|
||||
"arch": {
|
||||
|
||||
@@ -40,7 +40,7 @@ DEFAULT_CONFIGS_PATH = os.path.normpath(os.path.expanduser("~/GNS3/configs"))
|
||||
# Default appliances location
|
||||
DEFAULT_APPLIANCES_PATH = os.path.normpath(os.path.expanduser("~/GNS3/appliances"))
|
||||
|
||||
DEFAULT_LOCAL_SERVER_HOST = "127.0.0.1"
|
||||
DEFAULT_LOCAL_SERVER_HOST = "localhost"
|
||||
DEFAULT_LOCAL_SERVER_PORT = 3080
|
||||
DEFAULT_DELAY_CONSOLE_ALL = 500
|
||||
|
||||
@@ -55,9 +55,11 @@ if sys.platform.startswith("win"):
|
||||
# windows 32-bit
|
||||
program_files_x86 = program_files = os.environ["PROGRAMFILES"]
|
||||
|
||||
PRECONFIGURED_TELNET_CONSOLE_COMMANDS = {'Putty (included with GNS3)': 'putty.exe -telnet %h %p -wt "%d" -gns3 5 -skin 4',
|
||||
PRECONFIGURED_TELNET_CONSOLE_COMMANDS = {'Putty (normal standalone version)': 'putty_standalone.exe -telnet %h %p -loghost "%d"',
|
||||
'Putty (custom deprecated version)': 'putty.exe -telnet %h %p -wt "%d" -gns3 5 -skin 4',
|
||||
'MobaXterm': r'"{}\Mobatek\MobaXterm Personal Edition\MobaXterm.exe" -newtab "telnet %h %p"'.format(program_files_x86),
|
||||
'Royal TS': r'{}\code4ward.net\Royal TS V3\RTS3App.exe /connectadhoc:%h /adhoctype:terminal /p:IsTelnetConnection="true" /p:ConnectionType="telnet;Telnet Connection" /p:Port="%p" /p:Name="%d"'.format(program_files),
|
||||
'Royal TS V3': r'{}\code4ward.net\Royal TS V3\RTS3App.exe /connectadhoc:%h /adhoctype:terminal /p:IsTelnetConnection="true" /p:ConnectionType="telnet;Telnet Connection" /p:Port="%p" /p:Name="%d"'.format(program_files),
|
||||
'Royal TS V5': r'"{}\Royal TS V5\RoyalTS.exe" /protocol:terminal /using:adhoc /uri:"%h" /property:Port="%p" /property:IsTelnetConnection="true" /property:Name="%d"'.format(program_files_x86),
|
||||
'SuperPutty': r'SuperPutty.exe -telnet "%h -P %p -wt \"%d\""',
|
||||
'SecureCRT': r'"{}\VanDyke Software\SecureCRT\SecureCRT.exe" /N "%d" /T /TELNET %h %p'.format(program_files),
|
||||
'SecureCRT (personal profile)': r'"{}\AppData\Local\VanDyke Software\SecureCRT\SecureCRT.exe" /T /N "%d" /TELNET %h %p'.format(userprofile),
|
||||
@@ -75,7 +77,7 @@ if sys.platform.startswith("win"):
|
||||
DEFAULT_DELAY_CONSOLE_ALL = 1500
|
||||
else:
|
||||
PRECONFIGURED_TELNET_CONSOLE_COMMANDS["Solar-Putty (included with GNS3 downloaded from gns3.com)"] = 'Solar-PuTTY.exe --telnet --hostname %h --port %p --name "%d"'
|
||||
DEFAULT_TELNET_CONSOLE_COMMAND = PRECONFIGURED_TELNET_CONSOLE_COMMANDS["Putty (included with GNS3)"]
|
||||
DEFAULT_TELNET_CONSOLE_COMMAND = PRECONFIGURED_TELNET_CONSOLE_COMMANDS["Putty (normal standalone version)"]
|
||||
|
||||
elif sys.platform.startswith("darwin"):
|
||||
# Mac OS X
|
||||
@@ -155,6 +157,7 @@ else:
|
||||
'KDE Konsole': 'konsole --new-tab -p tabtitle="%d" -e "telnet %h %p"',
|
||||
'SecureCRT': 'SecureCRT /T /N "%d" /TELNET %h %p',
|
||||
'Mate Terminal': 'mate-terminal --tab -e "telnet %h %p" -t "%d"',
|
||||
'terminator': 'terminator -e "telnet %h %p" -T "%d"',
|
||||
'urxvt': 'urxvt -title %d -e telnet %h %p'}
|
||||
|
||||
# default Telnet console command on other systems
|
||||
@@ -196,7 +199,8 @@ else:
|
||||
PRECONFIGURED_VNC_CONSOLE_COMMANDS = {
|
||||
'TightVNC': 'vncviewer %h:%p',
|
||||
'Vinagre': 'vinagre %h::%p',
|
||||
'gvncviewer': 'gvncviewer %h:%P'
|
||||
'gvncviewer': 'gvncviewer %h:%P',
|
||||
'Remote Viewer': 'remote-viewer vnc://%h:%p'
|
||||
}
|
||||
|
||||
# default VNC console command on other systems
|
||||
@@ -292,7 +296,7 @@ GENERAL_SETTINGS = {
|
||||
"recent_projects": [],
|
||||
"geometry": "",
|
||||
"state": "",
|
||||
"preferences_dialog_geometry": "",
|
||||
#"preferences_dialog_geometry": "",
|
||||
"debug_level": 0,
|
||||
"multi_profiles": False,
|
||||
"hdpi": not sys.platform.startswith("linux"),
|
||||
@@ -329,7 +333,7 @@ GRAPHICS_VIEW_SETTINGS = {
|
||||
LOCAL_SERVER_SETTINGS = {
|
||||
"path": "gns3server",
|
||||
"ubridge_path": "ubridge",
|
||||
"host": None,
|
||||
"host": "localhost",
|
||||
"port": DEFAULT_LOCAL_SERVER_PORT,
|
||||
"images_path": DEFAULT_IMAGES_PATH,
|
||||
"projects_path": DEFAULT_PROJECTS_PATH,
|
||||
|
||||
@@ -24,23 +24,28 @@ import os
|
||||
import shlex
|
||||
import subprocess
|
||||
|
||||
from .controller import Controller
|
||||
|
||||
import logging
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def spiceConsole(host, port, command):
|
||||
def spiceConsole(node, port, command):
|
||||
"""
|
||||
Start a SPICE console program.
|
||||
|
||||
:param host: host or IP address
|
||||
:param node: Node instance
|
||||
:param port: port number
|
||||
:param command: command to be executed
|
||||
"""
|
||||
|
||||
if len(command.strip(' ')) == 0:
|
||||
log.warning('SPICE client is not configured')
|
||||
log.error("SPICE client is not configured")
|
||||
return
|
||||
|
||||
name = node.name()
|
||||
host = node.consoleHost()
|
||||
|
||||
# ipv6 support
|
||||
if ":" in host:
|
||||
host = "[{}]".format(host)
|
||||
@@ -48,9 +53,12 @@ def spiceConsole(host, port, command):
|
||||
# replace the place-holders by the actual values
|
||||
command = command.replace("%h", host)
|
||||
command = command.replace("%p", str(port))
|
||||
command = command.replace("%d", name.replace('"', '\\"'))
|
||||
command = command.replace("%i", node.project().id())
|
||||
command = command.replace("%n", str(node.id()))
|
||||
|
||||
try:
|
||||
log.info('starting SPICE program "{}"'.format(command))
|
||||
log.debug('starting SPICE program "{}"'.format(command))
|
||||
if sys.platform.startswith("win"):
|
||||
# use the string on Windows
|
||||
subprocess.Popen(command)
|
||||
@@ -59,5 +67,4 @@ def spiceConsole(host, port, command):
|
||||
args = shlex.split(command)
|
||||
subprocess.Popen(args, env=os.environ)
|
||||
except (OSError, ValueError, subprocess.SubprocessError) as e:
|
||||
log.warning('could not start SPICE program "{}": {}'.format(command, e))
|
||||
raise
|
||||
log.error("Could not start SPICE program with command '{}': {}".format(command, e))
|
||||
|
||||
@@ -30,6 +30,10 @@ class Template:
|
||||
settings["template_id"] = str(uuid.uuid4())
|
||||
self._settings = copy.deepcopy(settings)
|
||||
|
||||
# The "appliance_id" setting has been replaced by "template_id" setting in version 2.2
|
||||
if "appliance_id" in self._settings:
|
||||
self._settings["template_id"] = self._settings.pop("appliance_id")
|
||||
|
||||
# The "node_type" setting has been replaced by "template_type" setting in version 2.2
|
||||
if "node_type" in self._settings:
|
||||
self._settings["template_type"] = self._settings.pop("node_type")
|
||||
@@ -38,6 +42,11 @@ class Template:
|
||||
if "server" in self._settings:
|
||||
self._settings["compute_id"] = self._settings.pop("server")
|
||||
|
||||
for setting in self._settings.copy():
|
||||
# remove deprecated settings
|
||||
if setting in ["enable_remote_console", "use_ubridge", "acpi_shutdown", "default_symbol", "hover_symbol"]:
|
||||
del self._settings[setting]
|
||||
|
||||
def id(self):
|
||||
"""
|
||||
Returns the template ID.
|
||||
|
||||
@@ -213,6 +213,7 @@ class TemplateManager(QtCore.QObject):
|
||||
self._controller.post("/projects/{project_id}/templates/{template_id}".format(project_id=project.id(), template_id=template_id),
|
||||
self._createNodeFromTemplateCallback,
|
||||
params,
|
||||
showProgress=False,
|
||||
timeout=None)
|
||||
return True
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@ from .qt import QtCore, QtWidgets
|
||||
from .utils.progress_dialog import ProgressDialog
|
||||
from .utils.import_project_worker import ImportProjectWorker
|
||||
from .dialogs.project_export_wizard import ExportProjectWizard
|
||||
from .dialogs.file_editor_dialog import FileEditorDialog
|
||||
from .dialogs.project_welcome_dialog import ProjectWelcomeDialog
|
||||
|
||||
from .modules import MODULES
|
||||
@@ -61,7 +62,7 @@ class Topology(QtCore.QObject):
|
||||
self._main_window = None
|
||||
|
||||
# If set the project is loaded when we got connection to the controller
|
||||
# usefull when we open a project from cli or when server restart
|
||||
# useful when we open a project from cli or when server restart
|
||||
self._project_to_load_path = None
|
||||
self._project_id_to_load = None
|
||||
|
||||
@@ -109,14 +110,14 @@ class Topology(QtCore.QObject):
|
||||
|
||||
return self._project
|
||||
|
||||
def setProject(self, project):
|
||||
def setProject(self, project, snapshot=False):
|
||||
"""
|
||||
Set current project
|
||||
|
||||
:param project: Project instance
|
||||
"""
|
||||
|
||||
if self._project:
|
||||
if self._project and snapshot is False:
|
||||
# Assert to detect when we create a new project object for the same project
|
||||
assert project is None or (project != self._project and project.id != self._project.id)
|
||||
self._project.stopListenNotifications()
|
||||
@@ -134,7 +135,6 @@ class Topology(QtCore.QObject):
|
||||
|
||||
self.project_changed_signal.emit()
|
||||
|
||||
|
||||
def _projectUpdatedSlot(self):
|
||||
if not self._project or not self._project.filesDir() or not self._project.filename():
|
||||
return
|
||||
@@ -145,7 +145,7 @@ class Topology(QtCore.QObject):
|
||||
self._main_window.uiGraphicsView.setDrawingGridSize(self._project.drawingGridSize())
|
||||
self._main_window.uiShowGridAction.setChecked(self._project.showGrid())
|
||||
self._main_window.showGrid(self._project.showGrid())
|
||||
if os.path.exists(project_file):
|
||||
if not Controller.instance().isRemote() and os.path.exists(project_file):
|
||||
self._main_window.updateRecentFileSettings(project_file)
|
||||
self._main_window.updateRecentFileActions()
|
||||
|
||||
@@ -193,6 +193,7 @@ class Topology(QtCore.QObject):
|
||||
"""
|
||||
Create load a project based on settings, not on the .gns3
|
||||
"""
|
||||
|
||||
self.setProject(None)
|
||||
from .project import Project
|
||||
project = Project()
|
||||
@@ -215,6 +216,17 @@ class Topology(QtCore.QObject):
|
||||
self._main_window.uiStatusBar.showMessage("Project created", 2000)
|
||||
return project
|
||||
|
||||
def restoreSnapshot(self, project_id):
|
||||
"""
|
||||
Restore a snapshot for a given project.
|
||||
"""
|
||||
|
||||
assert self._project.id() == project_id
|
||||
project = self._project
|
||||
self.setProject(project, snapshot=True)
|
||||
project.load()
|
||||
self._main_window.uiStatusBar.showMessage("Snapshot restored", 2000)
|
||||
|
||||
def loadProject(self, path):
|
||||
"""
|
||||
Loads a project into GNS3.
|
||||
@@ -232,6 +244,13 @@ class Topology(QtCore.QObject):
|
||||
self._main_window.uiStatusBar.showMessage("Project loaded {}".format(path), 2000)
|
||||
return True
|
||||
|
||||
def editReadme(self):
|
||||
if self.project() is None:
|
||||
return
|
||||
dialog = FileEditorDialog(self.project(), "README.txt", parent=self._main_window, default="Project title\n\nAuthor: Grace Hopper <grace@example.org>\n\nThis project is about...")
|
||||
dialog.show()
|
||||
dialog.exec_()
|
||||
|
||||
def _projectCreationErrorSlot(self, message):
|
||||
if self._project:
|
||||
self._project.project_creation_error_signal.disconnect(self._projectCreationErrorSlot)
|
||||
|
||||
@@ -267,19 +267,16 @@ class TopologySummaryView(QtWidgets.QTreeWidget):
|
||||
if item.link() == link:
|
||||
view.centerOn(item)
|
||||
|
||||
def mousePressEvent(self, event):
|
||||
def contextMenuEvent(self, event):
|
||||
"""
|
||||
Handles all mouse press events.
|
||||
Handles all context menu events.
|
||||
|
||||
:param event: QMouseEvent instance
|
||||
:param event: QContextMenuEvent instance
|
||||
"""
|
||||
|
||||
if event.button() == QtCore.Qt.RightButton:
|
||||
self._showContextualMenu()
|
||||
else:
|
||||
super().mousePressEvent(event)
|
||||
self._showContextualMenu(event.globalPos())
|
||||
|
||||
def _showContextualMenu(self):
|
||||
def _showContextualMenu(self, pos):
|
||||
"""
|
||||
Contextual menu to expand and collapse the tree.
|
||||
"""
|
||||
@@ -322,6 +319,11 @@ class TopologySummaryView(QtWidgets.QTreeWidget):
|
||||
reset_all_filters.triggered.connect(self._resetAllFiltersSlot)
|
||||
menu.addAction(reset_all_filters)
|
||||
|
||||
resume_suspended_links = QtWidgets.QAction("Resume all suspended links", menu)
|
||||
resume_suspended_links.setIcon(get_icon("start.svg"))
|
||||
resume_suspended_links.triggered.connect(self._resumeAllLinksSlot)
|
||||
menu.addAction(resume_suspended_links)
|
||||
|
||||
current_item = self.currentItem()
|
||||
from .main_window import MainWindow
|
||||
view = MainWindow.instance().uiGraphicsView
|
||||
@@ -336,7 +338,7 @@ class TopologySummaryView(QtWidgets.QTreeWidget):
|
||||
item.populateLinkContextualMenu(menu)
|
||||
break
|
||||
|
||||
menu.exec_(QtGui.QCursor.pos())
|
||||
menu.exec_(pos)
|
||||
|
||||
@qslot
|
||||
def _expandAllSlot(self, *args):
|
||||
@@ -403,3 +405,13 @@ class TopologySummaryView(QtWidgets.QTreeWidget):
|
||||
filters = {}
|
||||
link.setFilters(filters)
|
||||
link.update()
|
||||
|
||||
@qslot
|
||||
def _resumeAllLinksSlot(self, *args):
|
||||
"""
|
||||
Resume all suspended links.
|
||||
"""
|
||||
|
||||
for link in self._topology.links():
|
||||
if link.suspended():
|
||||
link.toggleSuspend()
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>579</width>
|
||||
<height>374</height>
|
||||
<width>585</width>
|
||||
<height>353</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@@ -23,10 +23,31 @@
|
||||
<string>Server settings</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="uiServerPortLabel">
|
||||
<property name="text">
|
||||
<string>Port:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="uiServerNameLineEdit"/>
|
||||
</item>
|
||||
<item row="2" column="1" colspan="2">
|
||||
<widget class="QLineEdit" name="uiServerHostLineEdit">
|
||||
<property name="text">
|
||||
<string>192.168.56.101</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="uiServerHostLabel">
|
||||
<property name="text">
|
||||
<string>Host:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1" colspan="2">
|
||||
<widget class="QSpinBox" name="uiServerPortSpinBox">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
@@ -52,25 +73,25 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1" colspan="2">
|
||||
<widget class="QLineEdit" name="uiServerHostLineEdit">
|
||||
<property name="text">
|
||||
<string>192.168.56.101</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="uiServerHostLabel">
|
||||
<widget class="QLabel" name="uiServerProtocolLabel">
|
||||
<property name="text">
|
||||
<string>Host:</string>
|
||||
<string>Protocol:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="uiServerPortLabel">
|
||||
<property name="text">
|
||||
<string>Port:</string>
|
||||
</property>
|
||||
<item row="1" column="1">
|
||||
<widget class="QComboBox" name="uiServerProtocolComboBox">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>HTTP</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>HTTPS</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
|
||||
@@ -1,29 +1,39 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file '/Users/noplay/code/gns3/gns3-gui/gns3/ui/edit_compute_dialog.ui'
|
||||
# Form implementation generated from reading ui file '/home/grossmj/PycharmProjects/gns3-gui/gns3/ui/edit_compute_dialog.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.8
|
||||
# Created by: PyQt5 UI code generator 5.15.2
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
# 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.
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_EditComputeDialog(object):
|
||||
|
||||
def setupUi(self, EditComputeDialog):
|
||||
EditComputeDialog.setObjectName("EditComputeDialog")
|
||||
EditComputeDialog.setWindowModality(QtCore.Qt.WindowModal)
|
||||
EditComputeDialog.resize(579, 374)
|
||||
EditComputeDialog.resize(585, 353)
|
||||
self.verticalLayout = QtWidgets.QVBoxLayout(EditComputeDialog)
|
||||
self.verticalLayout.setObjectName("verticalLayout")
|
||||
self.groupBox = QtWidgets.QGroupBox(EditComputeDialog)
|
||||
self.groupBox.setObjectName("groupBox")
|
||||
self.gridLayout = QtWidgets.QGridLayout(self.groupBox)
|
||||
self.gridLayout.setObjectName("gridLayout")
|
||||
self.uiServerPortLabel = QtWidgets.QLabel(self.groupBox)
|
||||
self.uiServerPortLabel.setObjectName("uiServerPortLabel")
|
||||
self.gridLayout.addWidget(self.uiServerPortLabel, 3, 0, 1, 1)
|
||||
self.uiServerNameLineEdit = QtWidgets.QLineEdit(self.groupBox)
|
||||
self.uiServerNameLineEdit.setObjectName("uiServerNameLineEdit")
|
||||
self.gridLayout.addWidget(self.uiServerNameLineEdit, 0, 1, 1, 1)
|
||||
self.uiServerHostLineEdit = QtWidgets.QLineEdit(self.groupBox)
|
||||
self.uiServerHostLineEdit.setObjectName("uiServerHostLineEdit")
|
||||
self.gridLayout.addWidget(self.uiServerHostLineEdit, 2, 1, 1, 2)
|
||||
self.uiServerHostLabel = QtWidgets.QLabel(self.groupBox)
|
||||
self.uiServerHostLabel.setObjectName("uiServerHostLabel")
|
||||
self.gridLayout.addWidget(self.uiServerHostLabel, 2, 0, 1, 1)
|
||||
self.uiServerPortSpinBox = QtWidgets.QSpinBox(self.groupBox)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
@@ -34,19 +44,18 @@ class Ui_EditComputeDialog(object):
|
||||
self.uiServerPortSpinBox.setMaximum(65535)
|
||||
self.uiServerPortSpinBox.setProperty("value", 3080)
|
||||
self.uiServerPortSpinBox.setObjectName("uiServerPortSpinBox")
|
||||
self.gridLayout.addWidget(self.uiServerPortSpinBox, 2, 1, 1, 2)
|
||||
self.gridLayout.addWidget(self.uiServerPortSpinBox, 3, 1, 1, 2)
|
||||
self.label = QtWidgets.QLabel(self.groupBox)
|
||||
self.label.setObjectName("label")
|
||||
self.gridLayout.addWidget(self.label, 0, 0, 1, 1)
|
||||
self.uiServerHostLineEdit = QtWidgets.QLineEdit(self.groupBox)
|
||||
self.uiServerHostLineEdit.setObjectName("uiServerHostLineEdit")
|
||||
self.gridLayout.addWidget(self.uiServerHostLineEdit, 1, 1, 1, 2)
|
||||
self.uiServerHostLabel = QtWidgets.QLabel(self.groupBox)
|
||||
self.uiServerHostLabel.setObjectName("uiServerHostLabel")
|
||||
self.gridLayout.addWidget(self.uiServerHostLabel, 1, 0, 1, 1)
|
||||
self.uiServerPortLabel = QtWidgets.QLabel(self.groupBox)
|
||||
self.uiServerPortLabel.setObjectName("uiServerPortLabel")
|
||||
self.gridLayout.addWidget(self.uiServerPortLabel, 2, 0, 1, 1)
|
||||
self.uiServerProtocolLabel = QtWidgets.QLabel(self.groupBox)
|
||||
self.uiServerProtocolLabel.setObjectName("uiServerProtocolLabel")
|
||||
self.gridLayout.addWidget(self.uiServerProtocolLabel, 1, 0, 1, 1)
|
||||
self.uiServerProtocolComboBox = QtWidgets.QComboBox(self.groupBox)
|
||||
self.uiServerProtocolComboBox.setObjectName("uiServerProtocolComboBox")
|
||||
self.uiServerProtocolComboBox.addItem("")
|
||||
self.uiServerProtocolComboBox.addItem("")
|
||||
self.gridLayout.addWidget(self.uiServerProtocolComboBox, 1, 1, 1, 1)
|
||||
self.verticalLayout.addWidget(self.groupBox)
|
||||
self.uiEnableAuthenticationCheckBox = QtWidgets.QGroupBox(EditComputeDialog)
|
||||
self.uiEnableAuthenticationCheckBox.setCheckable(True)
|
||||
@@ -67,7 +76,7 @@ class Ui_EditComputeDialog(object):
|
||||
self.formLayout.setWidget(2, QtWidgets.QFormLayout.LabelRole, self.uiServerPasswordLabel)
|
||||
self.uiServerPasswordLineEdit = QtWidgets.QLineEdit(self.uiEnableAuthenticationCheckBox)
|
||||
self.uiServerPasswordLineEdit.setEnabled(True)
|
||||
self.uiServerPasswordLineEdit.setInputMethodHints(QtCore.Qt.ImhHiddenText | QtCore.Qt.ImhNoAutoUppercase | QtCore.Qt.ImhNoPredictiveText | QtCore.Qt.ImhSensitiveData)
|
||||
self.uiServerPasswordLineEdit.setInputMethodHints(QtCore.Qt.ImhHiddenText|QtCore.Qt.ImhNoAutoUppercase|QtCore.Qt.ImhNoPredictiveText|QtCore.Qt.ImhSensitiveData)
|
||||
self.uiServerPasswordLineEdit.setEchoMode(QtWidgets.QLineEdit.Password)
|
||||
self.uiServerPasswordLineEdit.setObjectName("uiServerPasswordLineEdit")
|
||||
self.formLayout.setWidget(2, QtWidgets.QFormLayout.FieldRole, self.uiServerPasswordLineEdit)
|
||||
@@ -80,7 +89,7 @@ class Ui_EditComputeDialog(object):
|
||||
self.verticalLayout.addItem(spacerItem)
|
||||
self.buttonBox = QtWidgets.QDialogButtonBox(EditComputeDialog)
|
||||
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
|
||||
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel | QtWidgets.QDialogButtonBox.Ok)
|
||||
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
|
||||
self.buttonBox.setObjectName("buttonBox")
|
||||
self.verticalLayout.addWidget(self.buttonBox)
|
||||
|
||||
@@ -98,10 +107,13 @@ class Ui_EditComputeDialog(object):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
EditComputeDialog.setWindowTitle(_translate("EditComputeDialog", "Edit server settings"))
|
||||
self.groupBox.setTitle(_translate("EditComputeDialog", "Server settings"))
|
||||
self.label.setText(_translate("EditComputeDialog", "Name:"))
|
||||
self.uiServerPortLabel.setText(_translate("EditComputeDialog", "Port:"))
|
||||
self.uiServerHostLineEdit.setText(_translate("EditComputeDialog", "192.168.56.101"))
|
||||
self.uiServerHostLabel.setText(_translate("EditComputeDialog", "Host:"))
|
||||
self.uiServerPortLabel.setText(_translate("EditComputeDialog", "Port:"))
|
||||
self.label.setText(_translate("EditComputeDialog", "Name:"))
|
||||
self.uiServerProtocolLabel.setText(_translate("EditComputeDialog", "Protocol:"))
|
||||
self.uiServerProtocolComboBox.setItemText(0, _translate("EditComputeDialog", "HTTP"))
|
||||
self.uiServerProtocolComboBox.setItemText(1, _translate("EditComputeDialog", "HTTPS"))
|
||||
self.uiEnableAuthenticationCheckBox.setTitle(_translate("EditComputeDialog", "Enable authentication"))
|
||||
self.uiServerUserLabel.setText(_translate("EditComputeDialog", "User:"))
|
||||
self.uiServerPasswordLabel.setText(_translate("EditComputeDialog", "Password:"))
|
||||
|
||||
@@ -67,13 +67,13 @@
|
||||
<item row="4" column="1">
|
||||
<widget class="QSpinBox" name="uiNodeGridSizeSpinBox">
|
||||
<property name="minimum">
|
||||
<number>10</number>
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>150</number>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<number>10</number>
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>75</number>
|
||||
@@ -83,13 +83,13 @@
|
||||
<item row="5" column="1">
|
||||
<widget class="QSpinBox" name="uiDrawingGridSizeSpinBox">
|
||||
<property name="minimum">
|
||||
<number>10</number>
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>100</number>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<number>10</number>
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>25</number>
|
||||
@@ -179,6 +179,17 @@
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<tabstops>
|
||||
<tabstop>tabWidget</tabstop>
|
||||
<tabstop>uiProjectNameLineEdit</tabstop>
|
||||
<tabstop>uiSceneWidthSpinBox</tabstop>
|
||||
<tabstop>uiSceneHeightSpinBox</tabstop>
|
||||
<tabstop>uiNodeGridSizeSpinBox</tabstop>
|
||||
<tabstop>uiDrawingGridSizeSpinBox</tabstop>
|
||||
<tabstop>uiProjectAutoOpenCheckBox</tabstop>
|
||||
<tabstop>uiProjectAutoStartCheckBox</tabstop>
|
||||
<tabstop>uiProjectAutoCloseCheckBox</tabstop>
|
||||
</tabstops>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
|
||||
@@ -37,16 +37,16 @@ class Ui_EditProjectDialog(object):
|
||||
self.uiSceneWidthSpinBox.setObjectName("uiSceneWidthSpinBox")
|
||||
self.uiGeneralGrid.addWidget(self.uiSceneWidthSpinBox, 2, 1, 1, 1)
|
||||
self.uiNodeGridSizeSpinBox = QtWidgets.QSpinBox(self.uiGeneralTab)
|
||||
self.uiNodeGridSizeSpinBox.setMinimum(10)
|
||||
self.uiNodeGridSizeSpinBox.setMinimum(5)
|
||||
self.uiNodeGridSizeSpinBox.setMaximum(150)
|
||||
self.uiNodeGridSizeSpinBox.setSingleStep(10)
|
||||
self.uiNodeGridSizeSpinBox.setSingleStep(5)
|
||||
self.uiNodeGridSizeSpinBox.setProperty("value", 75)
|
||||
self.uiNodeGridSizeSpinBox.setObjectName("uiNodeGridSizeSpinBox")
|
||||
self.uiGeneralGrid.addWidget(self.uiNodeGridSizeSpinBox, 4, 1, 1, 1)
|
||||
self.uiDrawingGridSizeSpinBox = QtWidgets.QSpinBox(self.uiGeneralTab)
|
||||
self.uiDrawingGridSizeSpinBox.setMinimum(10)
|
||||
self.uiDrawingGridSizeSpinBox.setMinimum(5)
|
||||
self.uiDrawingGridSizeSpinBox.setMaximum(100)
|
||||
self.uiDrawingGridSizeSpinBox.setSingleStep(10)
|
||||
self.uiDrawingGridSizeSpinBox.setSingleStep(5)
|
||||
self.uiDrawingGridSizeSpinBox.setProperty("value", 25)
|
||||
self.uiDrawingGridSizeSpinBox.setObjectName("uiDrawingGridSizeSpinBox")
|
||||
self.uiGeneralGrid.addWidget(self.uiDrawingGridSizeSpinBox, 5, 1, 1, 1)
|
||||
|
||||
@@ -61,14 +61,24 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="2">
|
||||
<item row="1" column="1" colspan="2">
|
||||
<widget class="QComboBox" name="uiCompressionComboBox"/>
|
||||
</item>
|
||||
<item row="3" column="0" colspan="3">
|
||||
<widget class="QCheckBox" name="uiIncludeImagesCheckBox">
|
||||
<property name="text">
|
||||
<string>Include base images</string>
|
||||
<string>&Include base images</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<item row="4" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="uiIncludeSnapshotsCheckBox">
|
||||
<property name="text">
|
||||
<string>&Include snapshots</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="2">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
@@ -81,8 +91,12 @@
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="1" column="1" colspan="2">
|
||||
<widget class="QComboBox" name="uiCompressionComboBox"/>
|
||||
<item row="5" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="uiResetMacAddressesCheckBox">
|
||||
<property name="text">
|
||||
<string>&Reset MAC addresses</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
|
||||
@@ -2,12 +2,14 @@
|
||||
|
||||
# Form implementation generated from reading ui file '/home/grossmj/PycharmProjects/gns3-gui/gns3/ui/export_project_wizard.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.9
|
||||
# Created by: PyQt5 UI code generator 5.13.2
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_ExportProjectWizard(object):
|
||||
def setupUi(self, ExportProjectWizard):
|
||||
ExportProjectWizard.setObjectName("ExportProjectWizard")
|
||||
@@ -38,14 +40,20 @@ class Ui_ExportProjectWizard(object):
|
||||
self.uiCompressionLabel = QtWidgets.QLabel(self.uiExportOptionsWizardPage)
|
||||
self.uiCompressionLabel.setObjectName("uiCompressionLabel")
|
||||
self.gridLayout.addWidget(self.uiCompressionLabel, 1, 0, 1, 1)
|
||||
self.uiIncludeImagesCheckBox = QtWidgets.QCheckBox(self.uiExportOptionsWizardPage)
|
||||
self.uiIncludeImagesCheckBox.setObjectName("uiIncludeImagesCheckBox")
|
||||
self.gridLayout.addWidget(self.uiIncludeImagesCheckBox, 2, 0, 1, 2)
|
||||
spacerItem = QtWidgets.QSpacerItem(20, 247, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
|
||||
self.gridLayout.addItem(spacerItem, 3, 1, 1, 1)
|
||||
self.uiCompressionComboBox = QtWidgets.QComboBox(self.uiExportOptionsWizardPage)
|
||||
self.uiCompressionComboBox.setObjectName("uiCompressionComboBox")
|
||||
self.gridLayout.addWidget(self.uiCompressionComboBox, 1, 1, 1, 2)
|
||||
self.uiIncludeImagesCheckBox = QtWidgets.QCheckBox(self.uiExportOptionsWizardPage)
|
||||
self.uiIncludeImagesCheckBox.setObjectName("uiIncludeImagesCheckBox")
|
||||
self.gridLayout.addWidget(self.uiIncludeImagesCheckBox, 3, 0, 1, 3)
|
||||
self.uiIncludeSnapshotsCheckBox = QtWidgets.QCheckBox(self.uiExportOptionsWizardPage)
|
||||
self.uiIncludeSnapshotsCheckBox.setObjectName("uiIncludeSnapshotsCheckBox")
|
||||
self.gridLayout.addWidget(self.uiIncludeSnapshotsCheckBox, 4, 0, 1, 2)
|
||||
spacerItem = QtWidgets.QSpacerItem(20, 247, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
|
||||
self.gridLayout.addItem(spacerItem, 6, 2, 1, 1)
|
||||
self.uiResetMacAddressesCheckBox = QtWidgets.QCheckBox(self.uiExportOptionsWizardPage)
|
||||
self.uiResetMacAddressesCheckBox.setObjectName("uiResetMacAddressesCheckBox")
|
||||
self.gridLayout.addWidget(self.uiResetMacAddressesCheckBox, 5, 0, 1, 2)
|
||||
ExportProjectWizard.addPage(self.uiExportOptionsWizardPage)
|
||||
self.uiProjectReadmeWizardPage = QtWidgets.QWizardPage()
|
||||
self.uiProjectReadmeWizardPage.setObjectName("uiProjectReadmeWizardPage")
|
||||
@@ -67,7 +75,9 @@ class Ui_ExportProjectWizard(object):
|
||||
self.uiPathLabel.setText(_translate("ExportProjectWizard", "Path:"))
|
||||
self.uiPathBrowserToolButton.setText(_translate("ExportProjectWizard", "Browse..."))
|
||||
self.uiCompressionLabel.setText(_translate("ExportProjectWizard", "Compression:"))
|
||||
self.uiIncludeImagesCheckBox.setText(_translate("ExportProjectWizard", "Include base images"))
|
||||
self.uiIncludeImagesCheckBox.setText(_translate("ExportProjectWizard", "&Include base images"))
|
||||
self.uiIncludeSnapshotsCheckBox.setText(_translate("ExportProjectWizard", "&Include snapshots"))
|
||||
self.uiResetMacAddressesCheckBox.setText(_translate("ExportProjectWizard", "&Reset MAC addresses"))
|
||||
self.uiProjectReadmeWizardPage.setTitle(_translate("ExportProjectWizard", "Readme file"))
|
||||
self.uiProjectReadmeWizardPage.setSubTitle(_translate("ExportProjectWizard", "Write a summary of the project."))
|
||||
self.uiReadmeTextEdit.setHtml(_translate("ExportProjectWizard", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
|
||||
@@ -75,4 +85,3 @@ class Ui_ExportProjectWizard(object):
|
||||
"p, li { white-space: pre-wrap; }\n"
|
||||
"</style></head><body style=\" font-family:\'Ubuntu\'; font-size:11pt; font-weight:400; font-style:normal;\">\n"
|
||||
"<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:\'.SF NS Text\'; font-size:13pt;\"><br /></p></body></html>"))
|
||||
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>931</width>
|
||||
<height>878</height>
|
||||
<width>941</width>
|
||||
<height>910</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@@ -136,11 +136,15 @@
|
||||
<item>
|
||||
<widget class="QGroupBox" name="uiSymbolThemeGroupBox">
|
||||
<property name="title">
|
||||
<string>Symbol theme</string>
|
||||
<string>Symbol theme for new templates</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_15">
|
||||
<item>
|
||||
<widget class="QComboBox" name="uiSymbolThemeComboBox"/>
|
||||
<widget class="QComboBox" name="uiSymbolThemeComboBox">
|
||||
<property name="toolTip">
|
||||
<string>Symbol theme support only works when adding a new template using the recommended method in the template wizard.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
@@ -271,6 +275,9 @@
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QListWidget" name="uiImageDirectoriesListWidget">
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::ClickFocus</enum>
|
||||
</property>
|
||||
<property name="lineWidth">
|
||||
<number>0</number>
|
||||
</property>
|
||||
@@ -393,17 +400,7 @@
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Command line replacements:</p>
|
||||
<ul>
|
||||
<li>%h = console IP or hostname</li>
|
||||
<li>%p = console port</li>
|
||||
<li>%P = VNC display</li>
|
||||
<li>%s = path of the serial connection</li>
|
||||
<li>%d = title of the console</li>
|
||||
<li>%i = project UUID</li>
|
||||
<li>%c = server URL</li>
|
||||
</ul>
|
||||
</body></html></string>
|
||||
<string><html><head/><body><p>Command line replacements:</p><ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">%h = console IP or hostname</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">%p = console port</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">%d = title of the console</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">%i = project UUID</li><ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">%n = node UUID</li></ul><li style=" margin-top:0px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">%c = server URL</li></ul></body></html></string>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
@@ -504,17 +501,7 @@
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Command line replacements:</p>
|
||||
<ul>
|
||||
<li>%h = console IP or hostname</li>
|
||||
<li>%p = console port</li>
|
||||
<li>%P = VNC display</li>
|
||||
<li>%s = path of the serial connection</li>
|
||||
<li>%d = title of the console</li>
|
||||
<li>%i = project UUID</li>
|
||||
<li>%c = server URL</li>
|
||||
</ul>
|
||||
</body></html></string>
|
||||
<string><html><head/><body><p>Command line replacements:</p><ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">%h = console IP or hostname</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">%p = console port</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">%P = VNC display</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">%d = title of the console</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">%i = project UUID</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">%n = node UUID</li></ul></body></html></string>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
@@ -583,17 +570,7 @@
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Command line replacements:</p>
|
||||
<ul>
|
||||
<li>%h = console IP or hostname</li>
|
||||
<li>%p = console port</li>
|
||||
<li>%P = VNC display</li>
|
||||
<li>%s = path of the serial connection</li>
|
||||
<li>%d = title of the console</li>
|
||||
<li>%i = project UUID</li>
|
||||
<li>%c = server URL</li>
|
||||
</ul>
|
||||
</body></html></string>
|
||||
<string><html><head/><body><p>Command line replacements:</p><ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">%h = console IP or hostname</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">%p = console port</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">%d = title of the console</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">%i = project UUID</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">%n = node UUID</li></ul><p><br/></p></body></html></string>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
@@ -680,6 +657,9 @@
|
||||
<height>50</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
@@ -726,16 +706,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QCheckBox" name="uiDrawLinkStatusPointsCheckBox">
|
||||
<property name="text">
|
||||
<string>Draw link status points</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="12" column="0" colspan="3">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
||||
<item>
|
||||
@@ -781,6 +751,9 @@
|
||||
<height>50</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
@@ -797,6 +770,9 @@
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::StrongFocus</enum>
|
||||
</property>
|
||||
<property name="suffix">
|
||||
<string> pixels</string>
|
||||
</property>
|
||||
@@ -822,6 +798,9 @@
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::StrongFocus</enum>
|
||||
</property>
|
||||
<property name="suffix">
|
||||
<string> pixels</string>
|
||||
</property>
|
||||
@@ -875,14 +854,17 @@
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::StrongFocus</enum>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>10</number>
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>100</number>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<number>10</number>
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>25</number>
|
||||
@@ -897,14 +879,17 @@
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::StrongFocus</enum>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>10</number>
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>150</number>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<number>10</number>
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>75</number>
|
||||
@@ -941,6 +926,16 @@
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="5" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="uiDrawLinkStatusPointsCheckBox">
|
||||
<property name="text">
|
||||
<string>Draw link status points</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="uiMiscTab">
|
||||
@@ -1062,6 +1057,56 @@
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<tabstops>
|
||||
<tabstop>uiProjectsPathLineEdit</tabstop>
|
||||
<tabstop>uiProjectsPathToolButton</tabstop>
|
||||
<tabstop>uiSymbolsPathLineEdit</tabstop>
|
||||
<tabstop>uiSymbolsPathToolButton</tabstop>
|
||||
<tabstop>uiConfigsPathLineEdit</tabstop>
|
||||
<tabstop>uiConfigsPathToolButton</tabstop>
|
||||
<tabstop>uiAppliancesPathLineEdit</tabstop>
|
||||
<tabstop>uiAppliancesPathToolButton</tabstop>
|
||||
<tabstop>uiStyleComboBox</tabstop>
|
||||
<tabstop>uiSymbolThemeComboBox</tabstop>
|
||||
<tabstop>uiImportConfigurationFilePushButton</tabstop>
|
||||
<tabstop>uiExportConfigurationFilePushButton</tabstop>
|
||||
<tabstop>uiBrowseConfigurationPushButton</tabstop>
|
||||
<tabstop>uiImagesPathLineEdit</tabstop>
|
||||
<tabstop>uiImagesPathToolButton</tabstop>
|
||||
<tabstop>uiImageDirectoriesAddPushButton</tabstop>
|
||||
<tabstop>uiImageDirectoriesDeletePushButton</tabstop>
|
||||
<tabstop>uiTelnetConsoleCommandLineEdit</tabstop>
|
||||
<tabstop>uiTelnetConsolePreconfiguredCommandPushButton</tabstop>
|
||||
<tabstop>uiDelayConsoleAllSpinBox</tabstop>
|
||||
<tabstop>uiVNCConsoleCommandLineEdit</tabstop>
|
||||
<tabstop>uiVNCConsolePreconfiguredCommandPushButton</tabstop>
|
||||
<tabstop>uiSPICEConsoleCommandLineEdit</tabstop>
|
||||
<tabstop>uiSPICEConsolePreconfiguredCommandPushButton</tabstop>
|
||||
<tabstop>uiSceneWidthSpinBox</tabstop>
|
||||
<tabstop>uiSceneHeightSpinBox</tabstop>
|
||||
<tabstop>uiNodeGridSizeSpinBox</tabstop>
|
||||
<tabstop>uiDrawingGridSizeSpinBox</tabstop>
|
||||
<tabstop>uiRectangleSelectedItemCheckBox</tabstop>
|
||||
<tabstop>uiDrawLinkStatusPointsCheckBox</tabstop>
|
||||
<tabstop>uiShowInterfaceLabelsOnNewProject</tabstop>
|
||||
<tabstop>uiShowGridOnNewProject</tabstop>
|
||||
<tabstop>uiSnapToGridOnNewProject</tabstop>
|
||||
<tabstop>uiLimitSizeNodeSymbolCheckBox</tabstop>
|
||||
<tabstop>uiDefaultLabelFontPushButton</tabstop>
|
||||
<tabstop>uiDefaultLabelColorPushButton</tabstop>
|
||||
<tabstop>uiDefaultNoteFontPushButton</tabstop>
|
||||
<tabstop>uiDefaultNoteColorPushButton</tabstop>
|
||||
<tabstop>uiCheckForUpdateCheckBox</tabstop>
|
||||
<tabstop>uiCrashReportCheckBox</tabstop>
|
||||
<tabstop>uiStatsCheckBox</tabstop>
|
||||
<tabstop>uiOverlayNotificationsCheckBox</tabstop>
|
||||
<tabstop>uiExperimentalFeaturesCheckBox</tabstop>
|
||||
<tabstop>uiHdpiCheckBox</tabstop>
|
||||
<tabstop>uiMultiProfilesCheckBox</tabstop>
|
||||
<tabstop>uiDirectFileUpload</tabstop>
|
||||
<tabstop>uiRestoreDefaultsPushButton</tabstop>
|
||||
<tabstop>uiMiscTabWidget</tabstop>
|
||||
</tabstops>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
||||
@@ -2,16 +2,18 @@
|
||||
|
||||
# Form implementation generated from reading ui file '/home/grossmj/PycharmProjects/gns3-gui/gns3/ui/general_preferences_page.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.9
|
||||
# Created by: PyQt5 UI code generator 5.13.2
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_GeneralPreferencesPageWidget(object):
|
||||
def setupUi(self, GeneralPreferencesPageWidget):
|
||||
GeneralPreferencesPageWidget.setObjectName("GeneralPreferencesPageWidget")
|
||||
GeneralPreferencesPageWidget.resize(931, 878)
|
||||
GeneralPreferencesPageWidget.resize(941, 910)
|
||||
self.verticalLayout = QtWidgets.QVBoxLayout(GeneralPreferencesPageWidget)
|
||||
self.verticalLayout.setObjectName("verticalLayout")
|
||||
self.uiMiscTabWidget = QtWidgets.QTabWidget(GeneralPreferencesPageWidget)
|
||||
@@ -140,6 +142,7 @@ class Ui_GeneralPreferencesPageWidget(object):
|
||||
self.uiImageDirectoriesLabel.setObjectName("uiImageDirectoriesLabel")
|
||||
self.verticalLayout_10.addWidget(self.uiImageDirectoriesLabel)
|
||||
self.uiImageDirectoriesListWidget = QtWidgets.QListWidget(self.uiLocalBinaryImagePathsGroupBox)
|
||||
self.uiImageDirectoriesListWidget.setFocusPolicy(QtCore.Qt.ClickFocus)
|
||||
self.uiImageDirectoriesListWidget.setLineWidth(0)
|
||||
self.uiImageDirectoriesListWidget.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers)
|
||||
self.uiImageDirectoriesListWidget.setAlternatingRowColors(False)
|
||||
@@ -312,6 +315,7 @@ class Ui_GeneralPreferencesPageWidget(object):
|
||||
sizePolicy.setHeightForWidth(self.uiDefaultNoteStylePlainTextEdit.sizePolicy().hasHeightForWidth())
|
||||
self.uiDefaultNoteStylePlainTextEdit.setSizePolicy(sizePolicy)
|
||||
self.uiDefaultNoteStylePlainTextEdit.setMaximumSize(QtCore.QSize(16777215, 50))
|
||||
self.uiDefaultNoteStylePlainTextEdit.setFocusPolicy(QtCore.Qt.NoFocus)
|
||||
self.uiDefaultNoteStylePlainTextEdit.setReadOnly(True)
|
||||
self.uiDefaultNoteStylePlainTextEdit.setObjectName("uiDefaultNoteStylePlainTextEdit")
|
||||
self.gridLayout_3.addWidget(self.uiDefaultNoteStylePlainTextEdit, 14, 0, 1, 3)
|
||||
@@ -329,10 +333,6 @@ class Ui_GeneralPreferencesPageWidget(object):
|
||||
self.uiLimitSizeNodeSymbolCheckBox = QtWidgets.QCheckBox(self.uiSceneTab)
|
||||
self.uiLimitSizeNodeSymbolCheckBox.setObjectName("uiLimitSizeNodeSymbolCheckBox")
|
||||
self.gridLayout_3.addWidget(self.uiLimitSizeNodeSymbolCheckBox, 9, 0, 1, 2)
|
||||
self.uiDrawLinkStatusPointsCheckBox = QtWidgets.QCheckBox(self.uiSceneTab)
|
||||
self.uiDrawLinkStatusPointsCheckBox.setChecked(True)
|
||||
self.uiDrawLinkStatusPointsCheckBox.setObjectName("uiDrawLinkStatusPointsCheckBox")
|
||||
self.gridLayout_3.addWidget(self.uiDrawLinkStatusPointsCheckBox, 5, 0, 1, 1)
|
||||
self.horizontalLayout_5 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_5.setObjectName("horizontalLayout_5")
|
||||
self.uiDefaultLabelFontPushButton = QtWidgets.QPushButton(self.uiSceneTab)
|
||||
@@ -351,6 +351,7 @@ class Ui_GeneralPreferencesPageWidget(object):
|
||||
sizePolicy.setHeightForWidth(self.uiDefaultLabelStylePlainTextEdit.sizePolicy().hasHeightForWidth())
|
||||
self.uiDefaultLabelStylePlainTextEdit.setSizePolicy(sizePolicy)
|
||||
self.uiDefaultLabelStylePlainTextEdit.setMaximumSize(QtCore.QSize(16777215, 50))
|
||||
self.uiDefaultLabelStylePlainTextEdit.setFocusPolicy(QtCore.Qt.NoFocus)
|
||||
self.uiDefaultLabelStylePlainTextEdit.setReadOnly(True)
|
||||
self.uiDefaultLabelStylePlainTextEdit.setObjectName("uiDefaultLabelStylePlainTextEdit")
|
||||
self.gridLayout_3.addWidget(self.uiDefaultLabelStylePlainTextEdit, 11, 0, 1, 3)
|
||||
@@ -360,6 +361,7 @@ class Ui_GeneralPreferencesPageWidget(object):
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.uiSceneHeightSpinBox.sizePolicy().hasHeightForWidth())
|
||||
self.uiSceneHeightSpinBox.setSizePolicy(sizePolicy)
|
||||
self.uiSceneHeightSpinBox.setFocusPolicy(QtCore.Qt.StrongFocus)
|
||||
self.uiSceneHeightSpinBox.setMinimum(500)
|
||||
self.uiSceneHeightSpinBox.setMaximum(1000000)
|
||||
self.uiSceneHeightSpinBox.setSingleStep(100)
|
||||
@@ -372,6 +374,7 @@ class Ui_GeneralPreferencesPageWidget(object):
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.uiSceneWidthSpinBox.sizePolicy().hasHeightForWidth())
|
||||
self.uiSceneWidthSpinBox.setSizePolicy(sizePolicy)
|
||||
self.uiSceneWidthSpinBox.setFocusPolicy(QtCore.Qt.StrongFocus)
|
||||
self.uiSceneWidthSpinBox.setMinimum(500)
|
||||
self.uiSceneWidthSpinBox.setMaximum(1000000)
|
||||
self.uiSceneWidthSpinBox.setSingleStep(100)
|
||||
@@ -396,9 +399,10 @@ class Ui_GeneralPreferencesPageWidget(object):
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.uiDrawingGridSizeSpinBox.sizePolicy().hasHeightForWidth())
|
||||
self.uiDrawingGridSizeSpinBox.setSizePolicy(sizePolicy)
|
||||
self.uiDrawingGridSizeSpinBox.setMinimum(10)
|
||||
self.uiDrawingGridSizeSpinBox.setFocusPolicy(QtCore.Qt.StrongFocus)
|
||||
self.uiDrawingGridSizeSpinBox.setMinimum(5)
|
||||
self.uiDrawingGridSizeSpinBox.setMaximum(100)
|
||||
self.uiDrawingGridSizeSpinBox.setSingleStep(10)
|
||||
self.uiDrawingGridSizeSpinBox.setSingleStep(5)
|
||||
self.uiDrawingGridSizeSpinBox.setProperty("value", 25)
|
||||
self.uiDrawingGridSizeSpinBox.setObjectName("uiDrawingGridSizeSpinBox")
|
||||
self.gridLayout_3.addWidget(self.uiDrawingGridSizeSpinBox, 3, 1, 1, 1)
|
||||
@@ -408,9 +412,10 @@ class Ui_GeneralPreferencesPageWidget(object):
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.uiNodeGridSizeSpinBox.sizePolicy().hasHeightForWidth())
|
||||
self.uiNodeGridSizeSpinBox.setSizePolicy(sizePolicy)
|
||||
self.uiNodeGridSizeSpinBox.setMinimum(10)
|
||||
self.uiNodeGridSizeSpinBox.setFocusPolicy(QtCore.Qt.StrongFocus)
|
||||
self.uiNodeGridSizeSpinBox.setMinimum(5)
|
||||
self.uiNodeGridSizeSpinBox.setMaximum(150)
|
||||
self.uiNodeGridSizeSpinBox.setSingleStep(10)
|
||||
self.uiNodeGridSizeSpinBox.setSingleStep(5)
|
||||
self.uiNodeGridSizeSpinBox.setProperty("value", 75)
|
||||
self.uiNodeGridSizeSpinBox.setObjectName("uiNodeGridSizeSpinBox")
|
||||
self.gridLayout_3.addWidget(self.uiNodeGridSizeSpinBox, 2, 1, 1, 1)
|
||||
@@ -423,6 +428,10 @@ class Ui_GeneralPreferencesPageWidget(object):
|
||||
self.gridLayout_3.addWidget(self.uiRectangleSelectedItemCheckBox, 4, 0, 1, 3)
|
||||
spacerItem9 = QtWidgets.QSpacerItem(20, 5, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
|
||||
self.gridLayout_3.addItem(spacerItem9, 16, 0, 1, 1)
|
||||
self.uiDrawLinkStatusPointsCheckBox = QtWidgets.QCheckBox(self.uiSceneTab)
|
||||
self.uiDrawLinkStatusPointsCheckBox.setChecked(True)
|
||||
self.uiDrawLinkStatusPointsCheckBox.setObjectName("uiDrawLinkStatusPointsCheckBox")
|
||||
self.gridLayout_3.addWidget(self.uiDrawLinkStatusPointsCheckBox, 5, 0, 1, 2)
|
||||
self.uiMiscTabWidget.addTab(self.uiSceneTab, "")
|
||||
self.uiMiscTab = QtWidgets.QWidget()
|
||||
self.uiMiscTab.setObjectName("uiMiscTab")
|
||||
@@ -472,6 +481,53 @@ class Ui_GeneralPreferencesPageWidget(object):
|
||||
self.retranslateUi(GeneralPreferencesPageWidget)
|
||||
self.uiMiscTabWidget.setCurrentIndex(0)
|
||||
QtCore.QMetaObject.connectSlotsByName(GeneralPreferencesPageWidget)
|
||||
GeneralPreferencesPageWidget.setTabOrder(self.uiProjectsPathLineEdit, self.uiProjectsPathToolButton)
|
||||
GeneralPreferencesPageWidget.setTabOrder(self.uiProjectsPathToolButton, self.uiSymbolsPathLineEdit)
|
||||
GeneralPreferencesPageWidget.setTabOrder(self.uiSymbolsPathLineEdit, self.uiSymbolsPathToolButton)
|
||||
GeneralPreferencesPageWidget.setTabOrder(self.uiSymbolsPathToolButton, self.uiConfigsPathLineEdit)
|
||||
GeneralPreferencesPageWidget.setTabOrder(self.uiConfigsPathLineEdit, self.uiConfigsPathToolButton)
|
||||
GeneralPreferencesPageWidget.setTabOrder(self.uiConfigsPathToolButton, self.uiAppliancesPathLineEdit)
|
||||
GeneralPreferencesPageWidget.setTabOrder(self.uiAppliancesPathLineEdit, self.uiAppliancesPathToolButton)
|
||||
GeneralPreferencesPageWidget.setTabOrder(self.uiAppliancesPathToolButton, self.uiStyleComboBox)
|
||||
GeneralPreferencesPageWidget.setTabOrder(self.uiStyleComboBox, self.uiSymbolThemeComboBox)
|
||||
GeneralPreferencesPageWidget.setTabOrder(self.uiSymbolThemeComboBox, self.uiImportConfigurationFilePushButton)
|
||||
GeneralPreferencesPageWidget.setTabOrder(self.uiImportConfigurationFilePushButton, self.uiExportConfigurationFilePushButton)
|
||||
GeneralPreferencesPageWidget.setTabOrder(self.uiExportConfigurationFilePushButton, self.uiBrowseConfigurationPushButton)
|
||||
GeneralPreferencesPageWidget.setTabOrder(self.uiBrowseConfigurationPushButton, self.uiImagesPathLineEdit)
|
||||
GeneralPreferencesPageWidget.setTabOrder(self.uiImagesPathLineEdit, self.uiImagesPathToolButton)
|
||||
GeneralPreferencesPageWidget.setTabOrder(self.uiImagesPathToolButton, self.uiImageDirectoriesAddPushButton)
|
||||
GeneralPreferencesPageWidget.setTabOrder(self.uiImageDirectoriesAddPushButton, self.uiImageDirectoriesDeletePushButton)
|
||||
GeneralPreferencesPageWidget.setTabOrder(self.uiImageDirectoriesDeletePushButton, self.uiTelnetConsoleCommandLineEdit)
|
||||
GeneralPreferencesPageWidget.setTabOrder(self.uiTelnetConsoleCommandLineEdit, self.uiTelnetConsolePreconfiguredCommandPushButton)
|
||||
GeneralPreferencesPageWidget.setTabOrder(self.uiTelnetConsolePreconfiguredCommandPushButton, self.uiDelayConsoleAllSpinBox)
|
||||
GeneralPreferencesPageWidget.setTabOrder(self.uiDelayConsoleAllSpinBox, self.uiVNCConsoleCommandLineEdit)
|
||||
GeneralPreferencesPageWidget.setTabOrder(self.uiVNCConsoleCommandLineEdit, self.uiVNCConsolePreconfiguredCommandPushButton)
|
||||
GeneralPreferencesPageWidget.setTabOrder(self.uiVNCConsolePreconfiguredCommandPushButton, self.uiSPICEConsoleCommandLineEdit)
|
||||
GeneralPreferencesPageWidget.setTabOrder(self.uiSPICEConsoleCommandLineEdit, self.uiSPICEConsolePreconfiguredCommandPushButton)
|
||||
GeneralPreferencesPageWidget.setTabOrder(self.uiSPICEConsolePreconfiguredCommandPushButton, self.uiSceneWidthSpinBox)
|
||||
GeneralPreferencesPageWidget.setTabOrder(self.uiSceneWidthSpinBox, self.uiSceneHeightSpinBox)
|
||||
GeneralPreferencesPageWidget.setTabOrder(self.uiSceneHeightSpinBox, self.uiNodeGridSizeSpinBox)
|
||||
GeneralPreferencesPageWidget.setTabOrder(self.uiNodeGridSizeSpinBox, self.uiDrawingGridSizeSpinBox)
|
||||
GeneralPreferencesPageWidget.setTabOrder(self.uiDrawingGridSizeSpinBox, self.uiRectangleSelectedItemCheckBox)
|
||||
GeneralPreferencesPageWidget.setTabOrder(self.uiRectangleSelectedItemCheckBox, self.uiDrawLinkStatusPointsCheckBox)
|
||||
GeneralPreferencesPageWidget.setTabOrder(self.uiDrawLinkStatusPointsCheckBox, self.uiShowInterfaceLabelsOnNewProject)
|
||||
GeneralPreferencesPageWidget.setTabOrder(self.uiShowInterfaceLabelsOnNewProject, self.uiShowGridOnNewProject)
|
||||
GeneralPreferencesPageWidget.setTabOrder(self.uiShowGridOnNewProject, self.uiSnapToGridOnNewProject)
|
||||
GeneralPreferencesPageWidget.setTabOrder(self.uiSnapToGridOnNewProject, self.uiLimitSizeNodeSymbolCheckBox)
|
||||
GeneralPreferencesPageWidget.setTabOrder(self.uiLimitSizeNodeSymbolCheckBox, self.uiDefaultLabelFontPushButton)
|
||||
GeneralPreferencesPageWidget.setTabOrder(self.uiDefaultLabelFontPushButton, self.uiDefaultLabelColorPushButton)
|
||||
GeneralPreferencesPageWidget.setTabOrder(self.uiDefaultLabelColorPushButton, self.uiDefaultNoteFontPushButton)
|
||||
GeneralPreferencesPageWidget.setTabOrder(self.uiDefaultNoteFontPushButton, self.uiDefaultNoteColorPushButton)
|
||||
GeneralPreferencesPageWidget.setTabOrder(self.uiDefaultNoteColorPushButton, self.uiCheckForUpdateCheckBox)
|
||||
GeneralPreferencesPageWidget.setTabOrder(self.uiCheckForUpdateCheckBox, self.uiCrashReportCheckBox)
|
||||
GeneralPreferencesPageWidget.setTabOrder(self.uiCrashReportCheckBox, self.uiStatsCheckBox)
|
||||
GeneralPreferencesPageWidget.setTabOrder(self.uiStatsCheckBox, self.uiOverlayNotificationsCheckBox)
|
||||
GeneralPreferencesPageWidget.setTabOrder(self.uiOverlayNotificationsCheckBox, self.uiExperimentalFeaturesCheckBox)
|
||||
GeneralPreferencesPageWidget.setTabOrder(self.uiExperimentalFeaturesCheckBox, self.uiHdpiCheckBox)
|
||||
GeneralPreferencesPageWidget.setTabOrder(self.uiHdpiCheckBox, self.uiMultiProfilesCheckBox)
|
||||
GeneralPreferencesPageWidget.setTabOrder(self.uiMultiProfilesCheckBox, self.uiDirectFileUpload)
|
||||
GeneralPreferencesPageWidget.setTabOrder(self.uiDirectFileUpload, self.uiRestoreDefaultsPushButton)
|
||||
GeneralPreferencesPageWidget.setTabOrder(self.uiRestoreDefaultsPushButton, self.uiMiscTabWidget)
|
||||
|
||||
def retranslateUi(self, GeneralPreferencesPageWidget):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
@@ -488,7 +544,8 @@ class Ui_GeneralPreferencesPageWidget(object):
|
||||
self.label_3.setText(_translate("GeneralPreferencesPageWidget", "My custom appliances:"))
|
||||
self.uiAppliancesPathToolButton.setText(_translate("GeneralPreferencesPageWidget", "Browse..."))
|
||||
self.uiStyleGroupBox.setTitle(_translate("GeneralPreferencesPageWidget", "Interface style"))
|
||||
self.uiSymbolThemeGroupBox.setTitle(_translate("GeneralPreferencesPageWidget", "Symbol theme"))
|
||||
self.uiSymbolThemeGroupBox.setTitle(_translate("GeneralPreferencesPageWidget", "Symbol theme for new templates"))
|
||||
self.uiSymbolThemeComboBox.setToolTip(_translate("GeneralPreferencesPageWidget", "Symbol theme support only works when adding a new template using the recommended method in the template wizard."))
|
||||
self.uiConfigurationFileGroupBox.setTitle(_translate("GeneralPreferencesPageWidget", "Configuration file"))
|
||||
self.uiImportConfigurationFilePushButton.setText(_translate("GeneralPreferencesPageWidget", "&Import"))
|
||||
self.uiExportConfigurationFilePushButton.setText(_translate("GeneralPreferencesPageWidget", "&Export"))
|
||||
@@ -505,17 +562,7 @@ class Ui_GeneralPreferencesPageWidget(object):
|
||||
self.uiMiscTabWidget.setTabText(self.uiMiscTabWidget.indexOf(self.uiImagesTab), _translate("GeneralPreferencesPageWidget", "Binary images"))
|
||||
self.uiTelnetConsoleSettingsGroupBox.setTitle(_translate("GeneralPreferencesPageWidget", "Console settings"))
|
||||
self.uiTelnetConsoleCommandLabel.setText(_translate("GeneralPreferencesPageWidget", "Console application command for Telnet:"))
|
||||
self.uiTelnetConsoleCommandLineEdit.setToolTip(_translate("GeneralPreferencesPageWidget", "<html><head/><body><p>Command line replacements:</p>\n"
|
||||
"<ul>\n"
|
||||
"<li>%h = console IP or hostname</li>\n"
|
||||
"<li>%p = console port</li>\n"
|
||||
"<li>%P = VNC display</li>\n"
|
||||
"<li>%s = path of the serial connection</li>\n"
|
||||
"<li>%d = title of the console</li>\n"
|
||||
"<li>%i = project UUID</li>\n"
|
||||
"<li>%c = server URL</li>\n"
|
||||
"</ul>\n"
|
||||
"</body></html>"))
|
||||
self.uiTelnetConsoleCommandLineEdit.setToolTip(_translate("GeneralPreferencesPageWidget", "<html><head/><body><p>Command line replacements:</p><ul style=\"margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;\"><li style=\" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">%h = console IP or hostname</li><li style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">%p = console port</li><li style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">%d = title of the console</li><li style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">%i = project UUID</li><ul style=\"margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;\"><li style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">%n = node UUID</li></ul><li style=\" margin-top:0px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">%c = server URL</li></ul></body></html>"))
|
||||
self.uiTelnetConsolePreconfiguredCommandPushButton.setText(_translate("GeneralPreferencesPageWidget", "&Edit"))
|
||||
self.uiConsoleMiscGroupBox.setTitle(_translate("GeneralPreferencesPageWidget", "Miscellaneous"))
|
||||
self.uiDelayConsoleAllSpinBox.setSuffix(_translate("GeneralPreferencesPageWidget", " ms"))
|
||||
@@ -523,32 +570,12 @@ class Ui_GeneralPreferencesPageWidget(object):
|
||||
self.uiMiscTabWidget.setTabText(self.uiMiscTabWidget.indexOf(self.uiConsoleTab), _translate("GeneralPreferencesPageWidget", "Console applications"))
|
||||
self.uiVNCConsoleSettingsGroupBox.setTitle(_translate("GeneralPreferencesPageWidget", "Settings for VNC connections"))
|
||||
self.uiVNCConsoleCommandLabel.setText(_translate("GeneralPreferencesPageWidget", "Console application command for VNC:"))
|
||||
self.uiVNCConsoleCommandLineEdit.setToolTip(_translate("GeneralPreferencesPageWidget", "<html><head/><body><p>Command line replacements:</p>\n"
|
||||
"<ul>\n"
|
||||
"<li>%h = console IP or hostname</li>\n"
|
||||
"<li>%p = console port</li>\n"
|
||||
"<li>%P = VNC display</li>\n"
|
||||
"<li>%s = path of the serial connection</li>\n"
|
||||
"<li>%d = title of the console</li>\n"
|
||||
"<li>%i = project UUID</li>\n"
|
||||
"<li>%c = server URL</li>\n"
|
||||
"</ul>\n"
|
||||
"</body></html>"))
|
||||
self.uiVNCConsoleCommandLineEdit.setToolTip(_translate("GeneralPreferencesPageWidget", "<html><head/><body><p>Command line replacements:</p><ul style=\"margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;\"><li style=\" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">%h = console IP or hostname</li><li style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">%p = console port</li><li style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">%P = VNC display</li><li style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">%d = title of the console</li><li style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">%i = project UUID</li><li style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">%n = node UUID</li></ul></body></html>"))
|
||||
self.uiVNCConsolePreconfiguredCommandPushButton.setText(_translate("GeneralPreferencesPageWidget", "&Edit"))
|
||||
self.uiMiscTabWidget.setTabText(self.uiMiscTabWidget.indexOf(self.uiVNCTab), _translate("GeneralPreferencesPageWidget", "VNC"))
|
||||
self.uiSPICEConsoleSettingsGroupBox.setTitle(_translate("GeneralPreferencesPageWidget", "Settings for SPICE connections"))
|
||||
self.uiSPICEConsoleCommandLabel.setText(_translate("GeneralPreferencesPageWidget", "Console application command for SPICE:"))
|
||||
self.uiSPICEConsoleCommandLineEdit.setToolTip(_translate("GeneralPreferencesPageWidget", "<html><head/><body><p>Command line replacements:</p>\n"
|
||||
"<ul>\n"
|
||||
"<li>%h = console IP or hostname</li>\n"
|
||||
"<li>%p = console port</li>\n"
|
||||
"<li>%P = VNC display</li>\n"
|
||||
"<li>%s = path of the serial connection</li>\n"
|
||||
"<li>%d = title of the console</li>\n"
|
||||
"<li>%i = project UUID</li>\n"
|
||||
"<li>%c = server URL</li>\n"
|
||||
"</ul>\n"
|
||||
"</body></html>"))
|
||||
self.uiSPICEConsoleCommandLineEdit.setToolTip(_translate("GeneralPreferencesPageWidget", "<html><head/><body><p>Command line replacements:</p><ul style=\"margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;\"><li style=\" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">%h = console IP or hostname</li><li style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">%p = console port</li><li style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">%d = title of the console</li><li style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">%i = project UUID</li><li style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">%n = node UUID</li></ul><p><br/></p></body></html>"))
|
||||
self.uiSPICEConsolePreconfiguredCommandPushButton.setText(_translate("GeneralPreferencesPageWidget", "&Edit"))
|
||||
self.uiMiscTabWidget.setTabText(self.uiMiscTabWidget.indexOf(self.uiSPICETab), _translate("GeneralPreferencesPageWidget", "SPICE"))
|
||||
self.uiSceneWidthLabel.setText(_translate("GeneralPreferencesPageWidget", "Default width:"))
|
||||
@@ -559,7 +586,6 @@ class Ui_GeneralPreferencesPageWidget(object):
|
||||
self.uiDefaultNoteFontPushButton.setText(_translate("GeneralPreferencesPageWidget", "&Select default font"))
|
||||
self.uiDefaultNoteColorPushButton.setText(_translate("GeneralPreferencesPageWidget", "&Select default color"))
|
||||
self.uiLimitSizeNodeSymbolCheckBox.setText(_translate("GeneralPreferencesPageWidget", "Limit the size of node symbols"))
|
||||
self.uiDrawLinkStatusPointsCheckBox.setText(_translate("GeneralPreferencesPageWidget", "Draw link status points"))
|
||||
self.uiDefaultLabelFontPushButton.setText(_translate("GeneralPreferencesPageWidget", "&Select default font"))
|
||||
self.uiDefaultLabelColorPushButton.setText(_translate("GeneralPreferencesPageWidget", "&Select default color"))
|
||||
self.uiDefaultLabelStylePlainTextEdit.setPlainText(_translate("GeneralPreferencesPageWidget", "AaBbYyZz"))
|
||||
@@ -571,6 +597,7 @@ class Ui_GeneralPreferencesPageWidget(object):
|
||||
self.uiNodeGridSizeLabel.setText(_translate("GeneralPreferencesPageWidget", "Default node grid size:"))
|
||||
self.uiShowGridOnNewProject.setText(_translate("GeneralPreferencesPageWidget", "Show grid on new project"))
|
||||
self.uiRectangleSelectedItemCheckBox.setText(_translate("GeneralPreferencesPageWidget", "Draw a rectangle when an item is selected"))
|
||||
self.uiDrawLinkStatusPointsCheckBox.setText(_translate("GeneralPreferencesPageWidget", "Draw link status points"))
|
||||
self.uiMiscTabWidget.setTabText(self.uiMiscTabWidget.indexOf(self.uiSceneTab), _translate("GeneralPreferencesPageWidget", "Topology view"))
|
||||
self.uiCheckForUpdateCheckBox.setText(_translate("GeneralPreferencesPageWidget", "Automatically check for update"))
|
||||
self.uiCrashReportCheckBox.setText(_translate("GeneralPreferencesPageWidget", "Send anonymous crash reports"))
|
||||
@@ -583,4 +610,3 @@ class Ui_GeneralPreferencesPageWidget(object):
|
||||
self.uiDirectFileUpload.setText(_translate("GeneralPreferencesPageWidget", "Upload files directly to computes (experimental)"))
|
||||
self.uiMiscTabWidget.setTabText(self.uiMiscTabWidget.indexOf(self.uiMiscTab), _translate("GeneralPreferencesPageWidget", "Miscellaneous"))
|
||||
self.uiRestoreDefaultsPushButton.setText(_translate("GeneralPreferencesPageWidget", "Restore defaults"))
|
||||
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>494</width>
|
||||
<height>585</height>
|
||||
<width>467</width>
|
||||
<height>657</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
@@ -85,28 +85,28 @@
|
||||
<string>Settings</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="8" column="0" colspan="2">
|
||||
<widget class="QLabel" name="uiActionCloseLabel">
|
||||
<property name="text">
|
||||
<string>Action when closing GNS3:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="2">
|
||||
<item row="3" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="uiHeadlessCheckBox">
|
||||
<property name="text">
|
||||
<string>Run the VM in headless mode</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="0" colspan="2">
|
||||
<item row="11" column="0" colspan="2">
|
||||
<widget class="QLabel" name="uiActionCloseLabel">
|
||||
<property name="text">
|
||||
<string>Action when closing GNS3:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="12" column="0" colspan="2">
|
||||
<widget class="QRadioButton" name="uiWhenExitKeepRadioButton">
|
||||
<property name="text">
|
||||
<string>keep the GNS3 VM running</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="0" colspan="2">
|
||||
<item row="13" column="0" colspan="2">
|
||||
<widget class="QRadioButton" name="uiWhenExitSuspendRadioButton">
|
||||
<property name="text">
|
||||
<string>suspend the GNS3 VM</string>
|
||||
@@ -141,22 +141,25 @@
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="11" column="0" colspan="2">
|
||||
<item row="14" column="0" colspan="2">
|
||||
<widget class="QRadioButton" name="uiWhenExitStopRadioButton">
|
||||
<property name="text">
|
||||
<string>stop the GNS3 VM</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="uiRamLabel">
|
||||
<property name="text">
|
||||
<string>RAM:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<item row="6" column="1">
|
||||
<widget class="QSpinBox" name="uiRamSpinBox">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="suffix">
|
||||
<string> MB</string>
|
||||
</property>
|
||||
@@ -174,13 +177,30 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="QSpinBox" name="uiCpuSpinBox">
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="uiPortLabel">
|
||||
<property name="text">
|
||||
<string>Port:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QSpinBox" name="uiPortSpinBox">
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>65635</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>1</number>
|
||||
<number>80</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="uiAllocatevCPUsRAMCheckBox">
|
||||
<property name="text">
|
||||
<string>Allocate vCPUs and RAM</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -191,6 +211,19 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="QSpinBox" name="uiCpuSpinBox">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>1</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -209,6 +242,16 @@
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<tabstops>
|
||||
<tabstop>uiEnableVMCheckBox</tabstop>
|
||||
<tabstop>uiGNS3VMEngineComboBox</tabstop>
|
||||
<tabstop>uiVMListComboBox</tabstop>
|
||||
<tabstop>uiRefreshPushButton</tabstop>
|
||||
<tabstop>uiRamSpinBox</tabstop>
|
||||
<tabstop>uiWhenExitKeepRadioButton</tabstop>
|
||||
<tabstop>uiWhenExitSuspendRadioButton</tabstop>
|
||||
<tabstop>uiWhenExitStopRadioButton</tabstop>
|
||||
</tabstops>
|
||||
<resources/>
|
||||
<connections/>
|
||||
<designerdata>
|
||||
|
||||
@@ -2,16 +2,19 @@
|
||||
|
||||
# Form implementation generated from reading ui file '/home/grossmj/PycharmProjects/gns3-gui/gns3/ui/gns3_vm_preferences_page.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.9
|
||||
# Created by: PyQt5 UI code generator 5.15.0
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
# 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.
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_GNS3VMPreferencesPageWidget(object):
|
||||
def setupUi(self, GNS3VMPreferencesPageWidget):
|
||||
GNS3VMPreferencesPageWidget.setObjectName("GNS3VMPreferencesPageWidget")
|
||||
GNS3VMPreferencesPageWidget.resize(494, 585)
|
||||
GNS3VMPreferencesPageWidget.resize(467, 657)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.MinimumExpanding)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
@@ -52,18 +55,18 @@ class Ui_GNS3VMPreferencesPageWidget(object):
|
||||
self.uiGNS3VMSettingsGroupBox.setObjectName("uiGNS3VMSettingsGroupBox")
|
||||
self.gridLayout = QtWidgets.QGridLayout(self.uiGNS3VMSettingsGroupBox)
|
||||
self.gridLayout.setObjectName("gridLayout")
|
||||
self.uiActionCloseLabel = QtWidgets.QLabel(self.uiGNS3VMSettingsGroupBox)
|
||||
self.uiActionCloseLabel.setObjectName("uiActionCloseLabel")
|
||||
self.gridLayout.addWidget(self.uiActionCloseLabel, 8, 0, 1, 2)
|
||||
self.uiHeadlessCheckBox = QtWidgets.QCheckBox(self.uiGNS3VMSettingsGroupBox)
|
||||
self.uiHeadlessCheckBox.setObjectName("uiHeadlessCheckBox")
|
||||
self.gridLayout.addWidget(self.uiHeadlessCheckBox, 1, 0, 1, 2)
|
||||
self.gridLayout.addWidget(self.uiHeadlessCheckBox, 3, 0, 1, 2)
|
||||
self.uiActionCloseLabel = QtWidgets.QLabel(self.uiGNS3VMSettingsGroupBox)
|
||||
self.uiActionCloseLabel.setObjectName("uiActionCloseLabel")
|
||||
self.gridLayout.addWidget(self.uiActionCloseLabel, 11, 0, 1, 2)
|
||||
self.uiWhenExitKeepRadioButton = QtWidgets.QRadioButton(self.uiGNS3VMSettingsGroupBox)
|
||||
self.uiWhenExitKeepRadioButton.setObjectName("uiWhenExitKeepRadioButton")
|
||||
self.gridLayout.addWidget(self.uiWhenExitKeepRadioButton, 9, 0, 1, 2)
|
||||
self.gridLayout.addWidget(self.uiWhenExitKeepRadioButton, 12, 0, 1, 2)
|
||||
self.uiWhenExitSuspendRadioButton = QtWidgets.QRadioButton(self.uiGNS3VMSettingsGroupBox)
|
||||
self.uiWhenExitSuspendRadioButton.setObjectName("uiWhenExitSuspendRadioButton")
|
||||
self.gridLayout.addWidget(self.uiWhenExitSuspendRadioButton, 10, 0, 1, 2)
|
||||
self.gridLayout.addWidget(self.uiWhenExitSuspendRadioButton, 13, 0, 1, 2)
|
||||
self.uiVMNameLabel = QtWidgets.QLabel(self.uiGNS3VMSettingsGroupBox)
|
||||
self.uiVMNameLabel.setObjectName("uiVMNameLabel")
|
||||
self.gridLayout.addWidget(self.uiVMNameLabel, 0, 0, 1, 1)
|
||||
@@ -83,31 +86,52 @@ class Ui_GNS3VMPreferencesPageWidget(object):
|
||||
self.gridLayout.addLayout(self.horizontalLayout, 0, 1, 1, 1)
|
||||
self.uiWhenExitStopRadioButton = QtWidgets.QRadioButton(self.uiGNS3VMSettingsGroupBox)
|
||||
self.uiWhenExitStopRadioButton.setObjectName("uiWhenExitStopRadioButton")
|
||||
self.gridLayout.addWidget(self.uiWhenExitStopRadioButton, 11, 0, 1, 2)
|
||||
self.gridLayout.addWidget(self.uiWhenExitStopRadioButton, 14, 0, 1, 2)
|
||||
self.uiRamLabel = QtWidgets.QLabel(self.uiGNS3VMSettingsGroupBox)
|
||||
self.uiRamLabel.setObjectName("uiRamLabel")
|
||||
self.gridLayout.addWidget(self.uiRamLabel, 4, 0, 1, 1)
|
||||
self.gridLayout.addWidget(self.uiRamLabel, 6, 0, 1, 1)
|
||||
self.uiRamSpinBox = QtWidgets.QSpinBox(self.uiGNS3VMSettingsGroupBox)
|
||||
self.uiRamSpinBox.setEnabled(False)
|
||||
self.uiRamSpinBox.setMinimum(512)
|
||||
self.uiRamSpinBox.setMaximum(1000000)
|
||||
self.uiRamSpinBox.setSingleStep(512)
|
||||
self.uiRamSpinBox.setProperty("value", 2048)
|
||||
self.uiRamSpinBox.setObjectName("uiRamSpinBox")
|
||||
self.gridLayout.addWidget(self.uiRamSpinBox, 4, 1, 1, 1)
|
||||
self.gridLayout.addWidget(self.uiRamSpinBox, 6, 1, 1, 1)
|
||||
self.uiPortLabel = QtWidgets.QLabel(self.uiGNS3VMSettingsGroupBox)
|
||||
self.uiPortLabel.setObjectName("uiPortLabel")
|
||||
self.gridLayout.addWidget(self.uiPortLabel, 2, 0, 1, 1)
|
||||
self.uiPortSpinBox = QtWidgets.QSpinBox(self.uiGNS3VMSettingsGroupBox)
|
||||
self.uiPortSpinBox.setMinimum(1)
|
||||
self.uiPortSpinBox.setMaximum(65635)
|
||||
self.uiPortSpinBox.setProperty("value", 80)
|
||||
self.uiPortSpinBox.setObjectName("uiPortSpinBox")
|
||||
self.gridLayout.addWidget(self.uiPortSpinBox, 2, 1, 1, 1)
|
||||
self.uiAllocatevCPUsRAMCheckBox = QtWidgets.QCheckBox(self.uiGNS3VMSettingsGroupBox)
|
||||
self.uiAllocatevCPUsRAMCheckBox.setObjectName("uiAllocatevCPUsRAMCheckBox")
|
||||
self.gridLayout.addWidget(self.uiAllocatevCPUsRAMCheckBox, 4, 0, 1, 2)
|
||||
self.uiCpuLabel = QtWidgets.QLabel(self.uiGNS3VMSettingsGroupBox)
|
||||
self.uiCpuLabel.setObjectName("uiCpuLabel")
|
||||
self.gridLayout.addWidget(self.uiCpuLabel, 5, 0, 1, 1)
|
||||
self.uiCpuSpinBox = QtWidgets.QSpinBox(self.uiGNS3VMSettingsGroupBox)
|
||||
self.uiCpuSpinBox.setEnabled(False)
|
||||
self.uiCpuSpinBox.setMinimum(1)
|
||||
self.uiCpuSpinBox.setProperty("value", 1)
|
||||
self.uiCpuSpinBox.setObjectName("uiCpuSpinBox")
|
||||
self.gridLayout.addWidget(self.uiCpuSpinBox, 5, 1, 1, 1)
|
||||
self.uiCpuLabel = QtWidgets.QLabel(self.uiGNS3VMSettingsGroupBox)
|
||||
self.uiCpuLabel.setObjectName("uiCpuLabel")
|
||||
self.gridLayout.addWidget(self.uiCpuLabel, 5, 0, 1, 1)
|
||||
self.verticalLayout.addWidget(self.uiGNS3VMSettingsGroupBox)
|
||||
spacerItem = QtWidgets.QSpacerItem(10, 10, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
|
||||
self.verticalLayout.addItem(spacerItem)
|
||||
|
||||
self.retranslateUi(GNS3VMPreferencesPageWidget)
|
||||
QtCore.QMetaObject.connectSlotsByName(GNS3VMPreferencesPageWidget)
|
||||
GNS3VMPreferencesPageWidget.setTabOrder(self.uiEnableVMCheckBox, self.uiGNS3VMEngineComboBox)
|
||||
GNS3VMPreferencesPageWidget.setTabOrder(self.uiGNS3VMEngineComboBox, self.uiVMListComboBox)
|
||||
GNS3VMPreferencesPageWidget.setTabOrder(self.uiVMListComboBox, self.uiRefreshPushButton)
|
||||
GNS3VMPreferencesPageWidget.setTabOrder(self.uiRefreshPushButton, self.uiRamSpinBox)
|
||||
GNS3VMPreferencesPageWidget.setTabOrder(self.uiRamSpinBox, self.uiWhenExitKeepRadioButton)
|
||||
GNS3VMPreferencesPageWidget.setTabOrder(self.uiWhenExitKeepRadioButton, self.uiWhenExitSuspendRadioButton)
|
||||
GNS3VMPreferencesPageWidget.setTabOrder(self.uiWhenExitSuspendRadioButton, self.uiWhenExitStopRadioButton)
|
||||
|
||||
def retranslateUi(self, GNS3VMPreferencesPageWidget):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
@@ -116,8 +140,8 @@ class Ui_GNS3VMPreferencesPageWidget(object):
|
||||
self.uiVirtualizationGroupBox.setTitle(_translate("GNS3VMPreferencesPageWidget", "Virtualization engine"))
|
||||
self.uiEngineDescriptionLabel.setText(_translate("GNS3VMPreferencesPageWidget", "Description"))
|
||||
self.uiGNS3VMSettingsGroupBox.setTitle(_translate("GNS3VMPreferencesPageWidget", "Settings"))
|
||||
self.uiActionCloseLabel.setText(_translate("GNS3VMPreferencesPageWidget", "Action when closing GNS3:"))
|
||||
self.uiHeadlessCheckBox.setText(_translate("GNS3VMPreferencesPageWidget", "Run the VM in headless mode"))
|
||||
self.uiActionCloseLabel.setText(_translate("GNS3VMPreferencesPageWidget", "Action when closing GNS3:"))
|
||||
self.uiWhenExitKeepRadioButton.setText(_translate("GNS3VMPreferencesPageWidget", "keep the GNS3 VM running"))
|
||||
self.uiWhenExitSuspendRadioButton.setText(_translate("GNS3VMPreferencesPageWidget", "suspend the GNS3 VM"))
|
||||
self.uiVMNameLabel.setText(_translate("GNS3VMPreferencesPageWidget", "VM name:"))
|
||||
@@ -125,5 +149,6 @@ class Ui_GNS3VMPreferencesPageWidget(object):
|
||||
self.uiWhenExitStopRadioButton.setText(_translate("GNS3VMPreferencesPageWidget", "stop the GNS3 VM"))
|
||||
self.uiRamLabel.setText(_translate("GNS3VMPreferencesPageWidget", "RAM:"))
|
||||
self.uiRamSpinBox.setSuffix(_translate("GNS3VMPreferencesPageWidget", " MB"))
|
||||
self.uiPortLabel.setText(_translate("GNS3VMPreferencesPageWidget", "Port:"))
|
||||
self.uiAllocatevCPUsRAMCheckBox.setText(_translate("GNS3VMPreferencesPageWidget", "Allocate vCPUs and RAM"))
|
||||
self.uiCpuLabel.setText(_translate("GNS3VMPreferencesPageWidget", "vCPUs:"))
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ background-none;
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>986</width>
|
||||
<height>40</height>
|
||||
<height>42</height>
|
||||
</rect>
|
||||
</property>
|
||||
<widget class="QMenu" name="uiEditMenu">
|
||||
@@ -164,7 +164,6 @@ background-none;
|
||||
</property>
|
||||
<addaction name="uiScreenshotAction"/>
|
||||
<addaction name="uiImportExportConfigsAction"/>
|
||||
<addaction name="uiWebInterfaceAction"/>
|
||||
<addaction name="uiWebUIAction"/>
|
||||
</widget>
|
||||
<addaction name="uiFileMenu"/>
|
||||
@@ -1197,11 +1196,6 @@ background-none;
|
||||
<string>Edit project</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="uiWebInterfaceAction">
|
||||
<property name="text">
|
||||
<string>Light Web interface</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="uiDrawLineAction">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
@@ -1237,7 +1231,7 @@ background-none;
|
||||
</action>
|
||||
<action name="uiWebUIAction">
|
||||
<property name="text">
|
||||
<string>WebUI - topology preview</string>
|
||||
<string>Web UI - beta</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="uiNewTemplateAction">
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user