Skip to content

Commit 2b98d51

Browse files
authored
Merge pull request #3668 from GNS3/release/v2.2.52
release/v2.2.52
2 parents 5efb301 + 804b871 commit 2b98d51

File tree

13 files changed

+65
-26
lines changed

13 files changed

+65
-26
lines changed

CHANGELOG

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Change Log
22

3+
## 2.2.52 02/12/2024
4+
5+
* Add iol extension filter. Ref #3664
6+
* Remove maximum 64GB RAM limitation for QEMU VMs. Fixes #3658
7+
* Bring to front support for consoles on Linux.
8+
* Relax setuptools requirement to allow for easier Debian packaging on Ubuntu Focal & Jammy
9+
310
## 2.2.51 07/11/2024
411

512
* Python 3.13 support

gns3/crash_report.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class CrashReport:
5050
Report crash to a third party service
5151
"""
5252

53-
DSN = "https://1d34173f3470d2bd89c355deccbc9c40@o19455.ingest.us.sentry.io/38506"
53+
DSN = "https://8a3db3ada69cd1c9817eafd87b400846@o19455.ingest.us.sentry.io/38506"
5454
_instance = None
5555

5656
def __init__(self):

gns3/graphics_view.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -666,7 +666,7 @@ def mouseDoubleClickEvent(self, event):
666666
self.configureSlot()
667667
return
668668
else:
669-
if sys.platform.startswith("win") and item.node().bringToFront():
669+
if item.node().bringToFront():
670670
return
671671
self.consoleFromItems(self.scene().selectedItems())
672672
return
@@ -860,8 +860,8 @@ def populateDeviceContextualMenu(self, menu):
860860
show_in_file_manager_action.triggered.connect(self.showInFileManagerSlot)
861861
menu.addAction(show_in_file_manager_action)
862862

863-
if sys.platform.startswith("win") and True in list(map(lambda item: isinstance(item, NodeItem) and hasattr(item.node(), "bringToFront"), items)):
864-
# Action: bring console or window to front (Windows only)
863+
if not sys.platform.startswith("darwin") and True in list(map(lambda item: isinstance(item, NodeItem) and hasattr(item.node(), "bringToFront"), items)):
864+
# Action: bring console or window to front (Windows and Linux only)
865865
bring_to_front_action = QtWidgets.QAction("Bring to front", menu)
866866
bring_to_front_action.setIcon(get_icon("front.svg"))
867867
bring_to_front_action.triggered.connect(self.bringToFrontSlot)

gns3/modules/iou/pages/iou_device_preferences_page.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,8 +291,8 @@ def getIOUImage(cls, parent, server):
291291
path, _ = QtWidgets.QFileDialog.getOpenFileName(parent,
292292
"Select an IOU image",
293293
cls._default_images_dir,
294-
"All file (*);;IOU image (*.bin *.image)",
295-
"IOU image (*.bin *.image)")
294+
"All file (*);;IOU image (*.bin *.image *.iol)",
295+
"IOU image (*.bin *.image *.iol)")
296296

297297
if not path:
298298
return

gns3/modules/qemu/ui/qemu_vm_configuration_page.ui

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,10 @@
9494
<number>32</number>
9595
</property>
9696
<property name="maximum">
97-
<number>65535</number>
97+
<number>2147483647</number>
98+
</property>
99+
<property name="singleStep">
100+
<number>1024</number>
98101
</property>
99102
<property name="value">
100103
<number>256</number>

gns3/modules/qemu/ui/qemu_vm_configuration_page_ui.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# Form implementation generated from reading ui file '/home/grossmj/PycharmProjects/gns3-gui/gns3/modules/qemu/ui/qemu_vm_configuration_page.ui'
44
#
5-
# Created by: PyQt5 UI code generator 5.15.9
5+
# Created by: PyQt5 UI code generator 5.15.6
66
#
77
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
88
# run again. Do not edit this file unless you know what you are doing.
@@ -59,7 +59,8 @@ def setupUi(self, QemuVMConfigPageWidget):
5959
self.gridLayout_4.addWidget(self.uiRamLabel, 4, 0, 1, 1)
6060
self.uiRamSpinBox = QtWidgets.QSpinBox(self.uiGeneralSettingsTab)
6161
self.uiRamSpinBox.setMinimum(32)
62-
self.uiRamSpinBox.setMaximum(65535)
62+
self.uiRamSpinBox.setMaximum(2147483647)
63+
self.uiRamSpinBox.setSingleStep(1024)
6364
self.uiRamSpinBox.setProperty("value", 256)
6465
self.uiRamSpinBox.setObjectName("uiRamSpinBox")
6566
self.gridLayout_4.addWidget(self.uiRamSpinBox, 4, 1, 1, 1)

gns3/modules/virtualbox/virtualbox_vm.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"""
1919
VirtualBox VM implementation.
2020
"""
21+
import sys
2122

2223
from gns3.node import Node
2324
from gns3.utils.bring_to_front import bring_window_to_front_from_process_name
@@ -100,7 +101,7 @@ def bringToFront(self):
100101
Bring the VM window to front.
101102
"""
102103

103-
if self.status() == Node.started:
104+
if self.status() == Node.started and sys.platform.startswith("win"):
104105
# try 2 different window title formats
105106
bring_window_to_front_from_process_name("VirtualBox.exe", title="{} [".format(self._settings["vmname"]))
106107
bring_window_to_front_from_process_name("VirtualBox.exe", title="{} (".format(self._settings["vmname"]))

gns3/modules/vmware/vmware_vm.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
VMware VM implementation.
2020
"""
2121

22+
import sys
23+
2224
from gns3.qt import QtCore
2325
from gns3.node import Node
2426
from gns3.utils.bring_to_front import bring_window_to_front_from_process_name
@@ -124,7 +126,7 @@ def bringToFront(self):
124126
Bring the VM window to front.
125127
"""
126128

127-
if self.status() == Node.started:
129+
if self.status() == Node.started and sys.platform.startswith("win"):
128130
try:
129131
vmx_pairs = self.module().parseVMwareFile(self.settings()["vmx_path"])
130132
except OSError as e:

gns3/node.py

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,11 @@
1616
# along with this program. If not, see <http://www.gnu.org/licenses/>.
1717

1818
import os
19+
import sys
1920
import pathlib
2021
import re
22+
import shutil
23+
import subprocess
2124

2225
from gns3.controller import Controller
2326
from gns3.ports.ethernet_port import EthernetPort
@@ -740,18 +743,30 @@ def bringToFront(self):
740743
"""
741744

742745
if self.status() == Node.started:
743-
console_command = self.consoleCommand()
744-
if console_command:
745-
process_name = console_command.split()[0]
746-
if bring_window_to_front_from_process_name(process_name, self.name()):
746+
if sys.platform.startswith("linux"):
747+
wmctrl_path = shutil.which("wmctrl")
748+
if wmctrl_path:
749+
try:
750+
# use wmctrl to raise the window based on the node name (this doesn't work well with window having multiple tabs)
751+
subprocess.run([wmctrl_path, "-a", self.name()], check=True, env=os.environ)
752+
return True
753+
except subprocess.CalledProcessError:
754+
log.debug("Could not find window title '{}' to bring it to front".format(self.name()))
755+
except OSError as e:
756+
log.warning("Count not focus on terminal window: '{}'".format(e))
757+
elif sys.platform.startswith("win"):
758+
console_command = self.consoleCommand()
759+
if console_command:
760+
process_name = console_command.split()[0]
761+
if bring_window_to_front_from_process_name(process_name, self.name()):
762+
return True
763+
else:
764+
log.debug("Could not find process name '' and window title '{}' to bring it to front".format(process_name, self.name()))
765+
766+
if bring_window_to_front_from_title(self.name()):
747767
return True
748768
else:
749-
log.debug("Could not find process name '' and window title '{}' to bring it to front".format(process_name, self.name()))
750-
751-
if bring_window_to_front_from_title(self.name()):
752-
return True
753-
else:
754-
log.debug("Could not find window title '{}' to bring it to front".format(self.name()))
769+
log.debug("Could not find window title '{}' to bring it to front".format(self.name()))
755770
return False
756771

757772
def importFile(self, path, source_path):

gns3/telnet_console.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import shlex
2727
import subprocess
2828
import psutil
29+
import shutil
2930

3031
from .main_window import MainWindow
3132
from .controller import Controller
@@ -102,7 +103,16 @@ def exec_command(self, command):
102103
# inject gnome-terminal environment variables
103104
if "GNOME_TERMINAL_SERVICE" not in env or "GNOME_TERMINAL_SCREEN" not in env:
104105
env.update(gnome_terminal_env())
105-
subprocess.Popen(args, env=env)
106+
proc = subprocess.Popen(args, env=env)
107+
if sys.platform.startswith("linux"):
108+
wmctrl_path = shutil.which("wmctrl")
109+
if wmctrl_path:
110+
proc.wait() # wait for the terminal to open
111+
try:
112+
# use wmctrl to raise the window based on the node name
113+
subprocess.run([wmctrl_path, "-a", self._name], env=os.environ)
114+
except OSError as e:
115+
self.consoleError.emit("Count not focus on terminal window: '{}'".format(e))
106116

107117
def run(self):
108118

0 commit comments

Comments
 (0)