Skip to content

Commit

Permalink
Merge pull request #3668 from GNS3/release/v2.2.52
Browse files Browse the repository at this point in the history
release/v2.2.52
  • Loading branch information
grossmj authored Dec 2, 2024
2 parents 5efb301 + 804b871 commit 2b98d51
Show file tree
Hide file tree
Showing 13 changed files with 65 additions and 26 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Change Log

## 2.2.52 02/12/2024

* Add iol extension filter. Ref #3664
* Remove maximum 64GB RAM limitation for QEMU VMs. Fixes #3658
* Bring to front support for consoles on Linux.
* Relax setuptools requirement to allow for easier Debian packaging on Ubuntu Focal & Jammy

## 2.2.51 07/11/2024

* Python 3.13 support
Expand Down
2 changes: 1 addition & 1 deletion gns3/crash_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class CrashReport:
Report crash to a third party service
"""

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

def __init__(self):
Expand Down
6 changes: 3 additions & 3 deletions gns3/graphics_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,7 @@ def mouseDoubleClickEvent(self, event):
self.configureSlot()
return
else:
if sys.platform.startswith("win") and item.node().bringToFront():
if item.node().bringToFront():
return
self.consoleFromItems(self.scene().selectedItems())
return
Expand Down Expand Up @@ -860,8 +860,8 @@ def populateDeviceContextualMenu(self, menu):
show_in_file_manager_action.triggered.connect(self.showInFileManagerSlot)
menu.addAction(show_in_file_manager_action)

if sys.platform.startswith("win") and True in list(map(lambda item: isinstance(item, NodeItem) and hasattr(item.node(), "bringToFront"), items)):
# Action: bring console or window to front (Windows only)
if not sys.platform.startswith("darwin") and True in list(map(lambda item: isinstance(item, NodeItem) and hasattr(item.node(), "bringToFront"), items)):
# Action: bring console or window to front (Windows and Linux only)
bring_to_front_action = QtWidgets.QAction("Bring to front", menu)
bring_to_front_action.setIcon(get_icon("front.svg"))
bring_to_front_action.triggered.connect(self.bringToFrontSlot)
Expand Down
4 changes: 2 additions & 2 deletions gns3/modules/iou/pages/iou_device_preferences_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,8 +291,8 @@ def getIOUImage(cls, parent, server):
path, _ = QtWidgets.QFileDialog.getOpenFileName(parent,
"Select an IOU image",
cls._default_images_dir,
"All file (*);;IOU image (*.bin *.image)",
"IOU image (*.bin *.image)")
"All file (*);;IOU image (*.bin *.image *.iol)",
"IOU image (*.bin *.image *.iol)")

if not path:
return
Expand Down
5 changes: 4 additions & 1 deletion gns3/modules/qemu/ui/qemu_vm_configuration_page.ui
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,10 @@
<number>32</number>
</property>
<property name="maximum">
<number>65535</number>
<number>2147483647</number>
</property>
<property name="singleStep">
<number>1024</number>
</property>
<property name="value">
<number>256</number>
Expand Down
5 changes: 3 additions & 2 deletions gns3/modules/qemu/ui/qemu_vm_configuration_page_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# 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.15.9
# Created by: PyQt5 UI code generator 5.15.6
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
Expand Down Expand Up @@ -59,7 +59,8 @@ def setupUi(self, QemuVMConfigPageWidget):
self.gridLayout_4.addWidget(self.uiRamLabel, 4, 0, 1, 1)
self.uiRamSpinBox = QtWidgets.QSpinBox(self.uiGeneralSettingsTab)
self.uiRamSpinBox.setMinimum(32)
self.uiRamSpinBox.setMaximum(65535)
self.uiRamSpinBox.setMaximum(2147483647)
self.uiRamSpinBox.setSingleStep(1024)
self.uiRamSpinBox.setProperty("value", 256)
self.uiRamSpinBox.setObjectName("uiRamSpinBox")
self.gridLayout_4.addWidget(self.uiRamSpinBox, 4, 1, 1, 1)
Expand Down
3 changes: 2 additions & 1 deletion gns3/modules/virtualbox/virtualbox_vm.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"""
VirtualBox VM implementation.
"""
import sys

from gns3.node import Node
from gns3.utils.bring_to_front import bring_window_to_front_from_process_name
Expand Down Expand Up @@ -100,7 +101,7 @@ def bringToFront(self):
Bring the VM window to front.
"""

if self.status() == Node.started:
if self.status() == Node.started and sys.platform.startswith("win"):
# try 2 different window title formats
bring_window_to_front_from_process_name("VirtualBox.exe", title="{} [".format(self._settings["vmname"]))
bring_window_to_front_from_process_name("VirtualBox.exe", title="{} (".format(self._settings["vmname"]))
Expand Down
4 changes: 3 additions & 1 deletion gns3/modules/vmware/vmware_vm.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
VMware VM implementation.
"""

import sys

from gns3.qt import QtCore
from gns3.node import Node
from gns3.utils.bring_to_front import bring_window_to_front_from_process_name
Expand Down Expand Up @@ -124,7 +126,7 @@ def bringToFront(self):
Bring the VM window to front.
"""

if self.status() == Node.started:
if self.status() == Node.started and sys.platform.startswith("win"):
try:
vmx_pairs = self.module().parseVMwareFile(self.settings()["vmx_path"])
except OSError as e:
Expand Down
35 changes: 25 additions & 10 deletions gns3/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,11 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.

import os
import sys
import pathlib
import re
import shutil
import subprocess

from gns3.controller import Controller
from gns3.ports.ethernet_port import EthernetPort
Expand Down Expand Up @@ -740,18 +743,30 @@ def bringToFront(self):
"""

if self.status() == Node.started:
console_command = self.consoleCommand()
if console_command:
process_name = console_command.split()[0]
if bring_window_to_front_from_process_name(process_name, self.name()):
if sys.platform.startswith("linux"):
wmctrl_path = shutil.which("wmctrl")
if wmctrl_path:
try:
# use wmctrl to raise the window based on the node name (this doesn't work well with window having multiple tabs)
subprocess.run([wmctrl_path, "-a", self.name()], check=True, env=os.environ)
return True
except subprocess.CalledProcessError:
log.debug("Could not find window title '{}' to bring it to front".format(self.name()))
except OSError as e:
log.warning("Count not focus on terminal window: '{}'".format(e))
elif sys.platform.startswith("win"):
console_command = self.consoleCommand()
if console_command:
process_name = console_command.split()[0]
if bring_window_to_front_from_process_name(process_name, self.name()):
return True
else:
log.debug("Could not find process name '' and window title '{}' to bring it to front".format(process_name, self.name()))

if bring_window_to_front_from_title(self.name()):
return True
else:
log.debug("Could not find process name '' and window title '{}' to bring it to front".format(process_name, self.name()))

if bring_window_to_front_from_title(self.name()):
return True
else:
log.debug("Could not find window title '{}' to bring it to front".format(self.name()))
log.debug("Could not find window title '{}' to bring it to front".format(self.name()))
return False

def importFile(self, path, source_path):
Expand Down
12 changes: 11 additions & 1 deletion gns3/telnet_console.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import shlex
import subprocess
import psutil
import shutil

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

def run(self):

Expand Down
2 changes: 1 addition & 1 deletion gns3/topology.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ def _projectCreationErrorSlot(self, message):
if self._project:
self._project.project_creation_error_signal.disconnect(self._projectCreationErrorSlot)
self.setProject(None)
QtWidgets.QMessageBox.critical(self._main_window, "New project", message)
QtWidgets.QMessageBox.critical(self._main_window, "Project", message)

def exportProject(self):
if self._project is None:
Expand Down
4 changes: 2 additions & 2 deletions gns3/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
# or negative for a release candidate or beta (after the base version
# number has been incremented)

__version__ = "2.2.51"
__version_info__ = (2, 2, 51, 0)
__version__ = "2.2.52"
__version_info__ = (2, 2, 52, 0)

if "dev" in __version__:
try:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def run_tests(self):
package_data={"gns3": ["configs/*.txt", "schemas/*.json"]},
platforms="any",
python_requires=">=3.8",
setup_requires=["setuptools>=61.0"],
setup_requires=["setuptools>=45.2"],
classifiers=[
"Development Status :: 5 - Production/Stable",
"Environment :: X11 Applications :: Qt",
Expand Down

0 comments on commit 2b98d51

Please sign in to comment.