mirror of
https://github.com/GNS3/gns3-gui.git
synced 2026-05-17 00:46:01 +03:00
Merge branch '2.2' into 3.0
# Conflicts: # gns3/application.py # gns3/controller.py # gns3/crash_report.py # gns3/dialogs/appliance_wizard.py # gns3/dialogs/project_export_wizard.py # gns3/dialogs/setup_wizard.py # gns3/dialogs/style_editor_dialog.py # gns3/dialogs/vm_with_images_wizard.py # gns3/http_client.py # gns3/items/drawing_item.py # gns3/link.py # gns3/local_server.py # gns3/main_window.py # gns3/modules/builtin/ui/cloud_configuration_page_ui.py # gns3/modules/docker/dialogs/docker_vm_wizard.py # gns3/modules/docker/ui/docker_vm_configuration_page_ui.py # gns3/modules/dynamips/ui/ios_router_configuration_page_ui.py # gns3/modules/qemu/dialogs/qemu_image_wizard.py # gns3/modules/qemu/dialogs/qemu_vm_wizard.py # gns3/modules/qemu/pages/qemu_vm_configuration_page.py # gns3/modules/qemu/ui/qemu_image_wizard_ui.py # gns3/modules/qemu/ui/qemu_vm_configuration_page_ui.py # gns3/modules/qemu/ui/qemu_vm_wizard_ui.py # gns3/modules/traceng/dialogs/traceng_node_wizard.py # gns3/modules/traceng/pages/traceng_node_configuration_page.py # gns3/modules/traceng/pages/traceng_node_preferences_page.py # gns3/modules/traceng/ui/traceng_node_configuration_page_ui.py # gns3/modules/traceng/ui/traceng_node_preferences_page_ui.py # gns3/modules/traceng/ui/traceng_node_wizard_ui.py # gns3/modules/traceng/ui/traceng_preferences_page_ui.py # gns3/modules/virtualbox/dialogs/virtualbox_vm_wizard.py # gns3/modules/vmware/dialogs/vmware_vm_wizard.py # gns3/nodes_view.py # gns3/qt/__init__.py # gns3/settings.py # gns3/ui/appliance_wizard_ui.py # gns3/ui/controller_preferences_page_ui.py # gns3/ui/edit_compute_dialog_ui.py # gns3/ui/edit_project_dialog_ui.py # gns3/ui/export_project_wizard_ui.py # gns3/ui/general_preferences_page.ui # gns3/ui/general_preferences_page_ui.py # gns3/ui/main_window_ui.py # gns3/ui/setup_wizard_ui.py # gns3/utils/export_project_worker.py # gns3/version.py
This commit is contained in:
@@ -1,5 +1,11 @@
|
||||
# Change Log
|
||||
|
||||
## 2.2.56 21/01/2026
|
||||
|
||||
* Fixing tab name in MobaXterm
|
||||
* PyQt6 migration
|
||||
* Add XDG Config Home support
|
||||
|
||||
## 2.2.55 19/11/2025
|
||||
|
||||
* Fix SyntaxWarning: invalid escape sequence. Fixes #3760
|
||||
|
||||
@@ -13,7 +13,7 @@ Please see the documentation on our [website](https://docs.gns3.com)
|
||||
Software dependencies
|
||||
---------------------
|
||||
|
||||
PyQt5 which is either part of the Linux distribution or installable from
|
||||
PyQt6 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/3.0/requirements.txt)
|
||||
|
||||
@@ -28,25 +28,11 @@ log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class Application(QtWidgets.QApplication):
|
||||
file_open_signal = QtCore.pyqtSignal(str)
|
||||
file_open_signal = QtCore.Signal(str)
|
||||
|
||||
def __init__(self, argv, hdpi=True):
|
||||
def __init__(self, argv):
|
||||
|
||||
self.setStyle(QtWidgets.QStyleFactory.create("Fusion"))
|
||||
# both Qt and PyQt must be version >= 5.6 in order to enable high DPI scaling
|
||||
if parse_version(QtCore.QT_VERSION_STR) >= parse_version("5.6") and parse_version(QtCore.PYQT_VERSION_STR) >= parse_version("5.6"):
|
||||
# only available starting Qt version 5.6
|
||||
if hdpi:
|
||||
if sys.platform.startswith("linux"):
|
||||
local_config_path = LocalConfig.instance().configFilePath()
|
||||
log.warning("HDPI mode is enabled. HDPI support on Linux is not fully stable and GNS3 may crash depending of your version of Linux. "
|
||||
f"To disabled HDPI mode please edit '{local_config_path}' and set 'hdpi' to 'false'")
|
||||
self.setAttribute(QtCore.Qt.AA_EnableHighDpiScaling)
|
||||
self.setAttribute(QtCore.Qt.AA_UseHighDpiPixmaps)
|
||||
else:
|
||||
log.info("HDPI mode is disabled")
|
||||
self.setAttribute(QtCore.Qt.AA_DisableHighDpiScaling)
|
||||
|
||||
super().__init__(argv)
|
||||
|
||||
# this is tell Wayland what is the name of the desktop file (gns3.desktop)
|
||||
@@ -63,7 +49,7 @@ class Application(QtWidgets.QApplication):
|
||||
self.open_file_at_startup = None
|
||||
|
||||
def event(self, event):
|
||||
# When you double click file you receive an event
|
||||
# When you double click on a file, you receive an event
|
||||
# and not the file as command line parameter
|
||||
if sys.platform.startswith("darwin"):
|
||||
if isinstance(event, QtGui.QFileOpenEvent):
|
||||
|
||||
@@ -97,7 +97,7 @@ class ComputeItem(QtWidgets.QTreeWidgetItem):
|
||||
self._status = "stopped"
|
||||
self.setToolTip(0, "{} is stopped or cannot be reached".format(self._compute.name()))
|
||||
self.setIcon(0, QtGui.QIcon(':/icons/led_red.svg'))
|
||||
self._parent.sortItems(0, QtCore.Qt.AscendingOrder)
|
||||
self._parent.sortItems(0, QtCore.Qt.SortOrder.AscendingOrder)
|
||||
|
||||
# add nodes belonging to this compute
|
||||
self.takeChildren()
|
||||
@@ -113,7 +113,7 @@ class ComputeItem(QtWidgets.QTreeWidgetItem):
|
||||
else:
|
||||
item.setIcon(0, QtGui.QIcon(':/icons/led_red.svg'))
|
||||
self.addChild(item)
|
||||
self.sortChildren(0, QtCore.Qt.AscendingOrder)
|
||||
self.sortChildren(0, QtCore.Qt.SortOrder.AscendingOrder)
|
||||
|
||||
|
||||
class ComputeSummaryView(QtWidgets.QTreeWidget):
|
||||
|
||||
@@ -22,7 +22,7 @@ import inspect
|
||||
import datetime
|
||||
import platform
|
||||
|
||||
from .qt import QtCore, QtWidgets
|
||||
from .qt import QtCore, QtGui
|
||||
from .topology import Topology
|
||||
from .version import __version__
|
||||
from .console_cmd import ConsoleCmd
|
||||
@@ -117,10 +117,10 @@ class ConsoleView(PyCutExt, ConsoleCmd):
|
||||
"""
|
||||
|
||||
menu = self.createStandardContextMenu()
|
||||
delete_all_action = QtWidgets.QAction("Delete All", menu)
|
||||
delete_all_action = QtGui.QAction("Delete All", menu)
|
||||
delete_all_action.triggered.connect(self._deleteAllActionSlot)
|
||||
menu.addAction(delete_all_action)
|
||||
menu.exec_(event.globalPos());
|
||||
menu.exec(event.globalPos())
|
||||
|
||||
def _deleteAllActionSlot(self):
|
||||
"""
|
||||
|
||||
@@ -87,7 +87,7 @@ class ApplianceWizard(QtWidgets.QWizard, Ui_ApplianceWizard):
|
||||
images_directories.append(emulator_images_dir)
|
||||
|
||||
images_directories.append(os.path.dirname(self._path))
|
||||
download_directory = QtCore.QStandardPaths.writableLocation(QtCore.QStandardPaths.DownloadLocation)
|
||||
download_directory = QtCore.QStandardPaths.writableLocation(QtCore.QStandardPaths.StandardLocation.DownloadLocation)
|
||||
if download_directory != "" and download_directory != os.path.dirname(self._path):
|
||||
images_directories.append(download_directory)
|
||||
|
||||
@@ -102,8 +102,8 @@ class ApplianceWizard(QtWidgets.QWizard, Ui_ApplianceWizard):
|
||||
# add a custom button to show appliance information
|
||||
if self._appliance["registry_version"] < 8:
|
||||
# FIXME: show appliance info for v8
|
||||
self.setButtonText(QtWidgets.QWizard.CustomButton1, "&Appliance info")
|
||||
self.setOption(QtWidgets.QWizard.HaveCustomButton1, True)
|
||||
self.setButtonText(QtWidgets.QWizard.WizardButton.CustomButton1, "&Appliance info")
|
||||
self.setOption(QtWidgets.QWizard.WizardOption.HaveCustomButton1, True)
|
||||
self.customButtonClicked.connect(self._showApplianceInfoSlot)
|
||||
|
||||
# customize the server selection
|
||||
@@ -149,7 +149,7 @@ class ApplianceWizard(QtWidgets.QWizard, Ui_ApplianceWizard):
|
||||
symbol = ":/symbols/computer.svg"
|
||||
else:
|
||||
symbol = ":/symbols/{}.svg".format(self._appliance["category"])
|
||||
self.page(page_id).setPixmap(QtWidgets.QWizard.LogoPixmap, QtGui.QPixmap(symbol))
|
||||
self.page(page_id).setPixmap(QtWidgets.QWizard.WizardPixmap.LogoPixmap, QtGui.QPixmap(symbol))
|
||||
|
||||
if self.page(page_id) == self.uiServerWizardPage:
|
||||
|
||||
@@ -282,10 +282,10 @@ Usage: {}
|
||||
msgbox = QtWidgets.QMessageBox(self)
|
||||
msgbox.setWindowTitle("Appliance information")
|
||||
msgbox.setStyleSheet("QLabel{min-width: 600px;}") # TODO: resize details box QTextEdit{min-height: 500px;}
|
||||
msgbox.setSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
|
||||
msgbox.setSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Expanding)
|
||||
msgbox.setText(text_info)
|
||||
msgbox.setDetailedText(self._appliance["description"])
|
||||
msgbox.exec_()
|
||||
msgbox.exec()
|
||||
|
||||
@qslot
|
||||
def _refreshVersions(self, *args):
|
||||
@@ -332,9 +332,9 @@ Usage: {}
|
||||
image_widget.setToolTip(0, f'{image["status"]} with path: {image["path"]}')
|
||||
|
||||
# Associated data stored are col 0: version, col 1: image
|
||||
image_widget.setData(0, QtCore.Qt.UserRole, version)
|
||||
image_widget.setData(1, QtCore.Qt.UserRole, image)
|
||||
image_widget.setData(2, QtCore.Qt.UserRole, self._appliance)
|
||||
image_widget.setData(0, QtCore.Qt.ItemDataRole.UserRole, version)
|
||||
image_widget.setData(1, QtCore.Qt.ItemDataRole.UserRole, image)
|
||||
image_widget.setData(2, QtCore.Qt.ItemDataRole.UserRole, self._appliance)
|
||||
top.addChild(image_widget)
|
||||
|
||||
font = top.font(0)
|
||||
@@ -348,10 +348,10 @@ Usage: {}
|
||||
expand = False
|
||||
top.setForeground(2, QtGui.QBrush(QtGui.QColor("green")))
|
||||
|
||||
top.setData(1, QtCore.Qt.DisplayRole, human_size(size))
|
||||
top.setData(2, QtCore.Qt.DisplayRole, status)
|
||||
top.setData(0, QtCore.Qt.UserRole, version)
|
||||
top.setData(2, QtCore.Qt.UserRole, self._appliance)
|
||||
top.setData(1, QtCore.Qt.ItemDataRole.DisplayRole, human_size(size))
|
||||
top.setData(2, QtCore.Qt.ItemDataRole.DisplayRole, status)
|
||||
top.setData(0, QtCore.Qt.ItemDataRole.UserRole, version)
|
||||
top.setData(2, QtCore.Qt.ItemDataRole.UserRole, self._appliance)
|
||||
self.uiApplianceVersionTreeWidget.addTopLevelItem(top)
|
||||
if expand:
|
||||
top.setExpanded(True)
|
||||
@@ -416,7 +416,7 @@ Usage: {}
|
||||
if current is None or sip.isdeleted(current):
|
||||
return
|
||||
|
||||
image = current.data(1, QtCore.Qt.UserRole)
|
||||
image = current.data(1, QtCore.Qt.ItemDataRole.UserRole)
|
||||
if image is not None:
|
||||
if "direct_download_url" in image or "download_url" in image:
|
||||
self.uiDownloadPushButton.show()
|
||||
@@ -437,7 +437,7 @@ Usage: {}
|
||||
if current is None or sip.isdeleted(current):
|
||||
return
|
||||
|
||||
data = current.data(1, QtCore.Qt.UserRole)
|
||||
data = current.data(1, QtCore.Qt.ItemDataRole.UserRole)
|
||||
if data is not None:
|
||||
if "direct_download_url" in data:
|
||||
QtGui.QDesktopServices.openUrl(QtCore.QUrl(data["direct_download_url"]))
|
||||
@@ -457,16 +457,16 @@ Usage: {}
|
||||
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)
|
||||
base_version = current.data(0, QtCore.Qt.ItemDataRole.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"))
|
||||
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.EchoMode.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)
|
||||
filename, ok = QtWidgets.QInputDialog.getText(self, "Image", "Disk image filename for {}".format(disk_type), QtWidgets.QLineEdit.EchoMode.Normal, base_filename)
|
||||
if not ok:
|
||||
filename = base_filename
|
||||
new_version["images"][disk_type] = {"filename": filename, "version": new_version_name}
|
||||
@@ -491,7 +491,7 @@ Usage: {}
|
||||
current = self.uiApplianceVersionTreeWidget.currentItem()
|
||||
if not current:
|
||||
return
|
||||
disk = current.data(1, QtCore.Qt.UserRole)
|
||||
disk = current.data(1, QtCore.Qt.ItemDataRole.UserRole)
|
||||
|
||||
path, _ = QtWidgets.QFileDialog.getOpenFileName()
|
||||
if len(path) == 0:
|
||||
@@ -511,9 +511,9 @@ Usage: {}
|
||||
f"actual:\t{image.filesize} bytes\n"
|
||||
f"expected:\t{disk['filesize']} bytes\n\n"
|
||||
"Do you want to accept it at your own risks?",
|
||||
QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No
|
||||
QtWidgets.QMessageBox.StandardButton.Yes | QtWidgets.QMessageBox.StandardButton.No
|
||||
)
|
||||
if reply == QtWidgets.QMessageBox.No:
|
||||
if reply == QtWidgets.QMessageBox.StandardButton.No:
|
||||
return
|
||||
except OSError as e:
|
||||
QtWidgets.QMessageBox.warning(self.parent(), "Add appliance", "Can't access to the image file {}: {}.".format(path, str(e)))
|
||||
@@ -550,7 +550,7 @@ Usage: {}
|
||||
template_manager = TemplateManager().instance()
|
||||
while len(appliance_configuration["name"]) == 0 or not template_manager.is_name_available(appliance_configuration["name"]):
|
||||
QtWidgets.QMessageBox.warning(self.parent(), "Add template", "The name \"{}\" is already used by another template".format(appliance_configuration["name"]))
|
||||
appliance_configuration["name"], ok = QtWidgets.QInputDialog.getText(self.parent(), "Add template", "New name:", QtWidgets.QLineEdit.Normal, appliance_configuration["name"])
|
||||
appliance_configuration["name"], ok = QtWidgets.QInputDialog.getText(self.parent(), "Add template", "New name:", QtWidgets.QLineEdit.EchoMode.Normal, appliance_configuration["name"])
|
||||
if not ok:
|
||||
return False
|
||||
appliance_configuration["name"] = appliance_configuration["name"].strip()
|
||||
@@ -613,18 +613,18 @@ Usage: {}
|
||||
current = self.uiApplianceVersionTreeWidget.currentItem()
|
||||
if current is None or sip.isdeleted(current):
|
||||
return False
|
||||
version = current.data(0, QtCore.Qt.UserRole)
|
||||
version = current.data(0, QtCore.Qt.ItemDataRole.UserRole)
|
||||
if version is None:
|
||||
return False
|
||||
appliance = current.data(2, QtCore.Qt.UserRole)
|
||||
appliance = current.data(2, QtCore.Qt.ItemDataRole.UserRole)
|
||||
try:
|
||||
self._appliance.search_images_for_version(version["name"])
|
||||
except ApplianceError as e:
|
||||
QtWidgets.QMessageBox.critical(self, "Appliance", "Cannot install {} version {}: {}".format(appliance["name"], version["name"], e))
|
||||
return False
|
||||
reply = QtWidgets.QMessageBox.question(self, "Appliance", "Would you like to install {} version {}?".format(appliance["name"], version["name"]),
|
||||
QtWidgets.QMessageBox.Yes, QtWidgets.QMessageBox.No)
|
||||
if reply == QtWidgets.QMessageBox.No:
|
||||
QtWidgets.QMessageBox.StandardButton.Yes, QtWidgets.QMessageBox.StandardButton.No)
|
||||
if reply == QtWidgets.QMessageBox.StandardButton.No:
|
||||
return False
|
||||
|
||||
return self._uploadImages(appliance["name"], version["name"])
|
||||
@@ -639,7 +639,7 @@ Usage: {}
|
||||
return False
|
||||
current = self.uiApplianceVersionTreeWidget.currentItem()
|
||||
if current:
|
||||
version = current.data(0, QtCore.Qt.UserRole)
|
||||
version = current.data(0, QtCore.Qt.ItemDataRole.UserRole)
|
||||
return self._install(version["name"])
|
||||
else:
|
||||
return self._install(None)
|
||||
@@ -656,8 +656,8 @@ Usage: {}
|
||||
if ComputeManager.instance().localPlatform():
|
||||
if (ComputeManager.instance().localPlatform().startswith("darwin") or ComputeManager.instance().localPlatform().startswith("win")):
|
||||
if "qemu" in self._appliance:
|
||||
reply = QtWidgets.QMessageBox.question(self, "Appliance", "Qemu on Windows and macOS is not supported by the GNS3 team. Do you want to continue?", QtWidgets.QMessageBox.Yes, QtWidgets.QMessageBox.No)
|
||||
if reply == QtWidgets.QMessageBox.No:
|
||||
reply = QtWidgets.QMessageBox.question(self, "Appliance", "Qemu on Windows and macOS is not supported by the GNS3 team. Do you want to continue?", QtWidgets.QMessageBox.StandardButton.Yes, QtWidgets.QMessageBox.StandardButton.No)
|
||||
if reply == QtWidgets.QMessageBox.StandardButton.No:
|
||||
return False
|
||||
self._compute_id = "local"
|
||||
|
||||
@@ -698,8 +698,8 @@ Usage: {}
|
||||
reply = QtWidgets.QMessageBox.question(self, "Custom files",
|
||||
"This option allows files with different MD5 checksums. This feature is only for advanced users and can lead "
|
||||
"to unexpected problems. Do you want to proceed?",
|
||||
QtWidgets.QMessageBox.Yes, QtWidgets.QMessageBox.No)
|
||||
QtWidgets.QMessageBox.StandardButton.Yes, QtWidgets.QMessageBox.StandardButton.No)
|
||||
|
||||
if reply == QtWidgets.QMessageBox.No:
|
||||
if reply == QtWidgets.QMessageBox.StandardButton.No:
|
||||
self.allowCustomFiles.setChecked(False)
|
||||
return False
|
||||
|
||||
@@ -31,8 +31,8 @@ class CaptureDialog(QtWidgets.QDialog, Ui_CaptureDialog):
|
||||
|
||||
super().__init__(parent)
|
||||
self.setupUi(self)
|
||||
self.uiButtonBox.button(QtWidgets.QDialogButtonBox.Ok).clicked.connect(self._okButtonClickedSlot)
|
||||
self.uiButtonBox.button(QtWidgets.QDialogButtonBox.Cancel).clicked.connect(self.reject)
|
||||
self.uiButtonBox.button(QtWidgets.QDialogButtonBox.StandardButton.Ok).clicked.connect(self._okButtonClickedSlot)
|
||||
self.uiButtonBox.button(QtWidgets.QDialogButtonBox.StandardButton.Cancel).clicked.connect(self.reject)
|
||||
|
||||
if ethernet_link:
|
||||
self.uiDataLinkTypeComboBox.addItem("Ethernet", "DLT_EN10MB")
|
||||
@@ -70,6 +70,6 @@ if __name__ == '__main__':
|
||||
main = QtWidgets.QMainWindow()
|
||||
dialog = CaptureDialog(main, "test.pcap")
|
||||
dialog.show()
|
||||
exit_code = app.exec_()
|
||||
exit_code = app.exec()
|
||||
print(dialog.dataLink())
|
||||
print(dialog.fileName())
|
||||
|
||||
@@ -59,7 +59,7 @@ class ConfigurationDialog(QtWidgets.QDialog, Ui_configurationDialog):
|
||||
:param button: button that was clicked (QAbstractButton)
|
||||
"""
|
||||
|
||||
if button == self.uiButtonBox.button(QtWidgets.QDialogButtonBox.Cancel):
|
||||
if button == self.uiButtonBox.button(QtWidgets.QDialogButtonBox.StandardButton.Cancel):
|
||||
QtWidgets.QDialog.reject(self)
|
||||
else:
|
||||
try:
|
||||
|
||||
@@ -93,7 +93,7 @@ class ConsoleCommandDialog(QtWidgets.QDialog, Ui_uiConsoleCommandDialog):
|
||||
"""
|
||||
Save a custom command to the list
|
||||
"""
|
||||
name, ok = QtWidgets.QInputDialog.getText(self, "Add a command", "Command name:", QtWidgets.QLineEdit.Normal)
|
||||
name, ok = QtWidgets.QInputDialog.getText(self, "Add a command", "Command name:", QtWidgets.QLineEdit.EchoMode.Normal)
|
||||
command = self.uiCommandPlainTextEdit.toPlainText().strip()
|
||||
if ok and len(command) > 0:
|
||||
if command not in self._consoles.values():
|
||||
@@ -123,7 +123,7 @@ class ConsoleCommandDialog(QtWidgets.QDialog, Ui_uiConsoleCommandDialog):
|
||||
def getCommand(parent, console_type="telnet", current=None):
|
||||
dialog = ConsoleCommandDialog(parent, console_type=console_type, current=current)
|
||||
dialog.show()
|
||||
if dialog.exec_():
|
||||
if dialog.exec():
|
||||
return True, dialog.uiCommandPlainTextEdit.toPlainText().replace("\n", " ")
|
||||
return False, None
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ class CustomAdaptersConfigurationDialog(QtWidgets.QDialog, Ui_CustomAdaptersConf
|
||||
self._custom_adapters = custom_adapters
|
||||
self._base_mac_address = base_mac_address
|
||||
|
||||
self.uiButtonBox.button(QtWidgets.QDialogButtonBox.Reset).clicked.connect(self._resetSlot)
|
||||
self.uiButtonBox.button(QtWidgets.QDialogButtonBox.StandardButton.Reset).clicked.connect(self._resetSlot)
|
||||
|
||||
if self._default_adapter_type and self._adapter_types:
|
||||
self.uiAdaptersTreeWidget.setColumnCount(3)
|
||||
@@ -115,10 +115,10 @@ class CustomAdaptersConfigurationDialog(QtWidgets.QDialog, Ui_CustomAdaptersConf
|
||||
adapter_number = 0
|
||||
for port_name in self._ports:
|
||||
item = TreeWidgetItem(self.uiAdaptersTreeWidget)
|
||||
item.setFlags(item.flags() | QtCore.Qt.ItemIsEditable)
|
||||
item.setFlags(item.flags() | QtCore.Qt.ItemFlag.ItemIsEditable)
|
||||
item.setText(0, "Adapter {}".format(adapter_number))
|
||||
item.setData(0, QtCore.Qt.UserRole, adapter_number)
|
||||
item.setData(1, QtCore.Qt.UserRole, port_name)
|
||||
item.setData(0, QtCore.Qt.ItemDataRole.UserRole, adapter_number)
|
||||
item.setData(1, QtCore.Qt.ItemDataRole.UserRole, port_name)
|
||||
custom_adapter = self._getCustomAdapterSettings(adapter_number)
|
||||
item.setText(1, custom_adapter.get("port_name", port_name))
|
||||
|
||||
@@ -131,7 +131,7 @@ class CustomAdaptersConfigurationDialog(QtWidgets.QDialog, Ui_CustomAdaptersConf
|
||||
index = 0
|
||||
for adapter_type, adapter_description in self._adapter_types.items():
|
||||
combobox.addItem("{}".format(adapter_type))
|
||||
combobox.setItemData(index, adapter_description, QtCore.Qt.ToolTipRole)
|
||||
combobox.setItemData(index, adapter_description, QtCore.Qt.ItemDataRole.ToolTipRole)
|
||||
index += 1
|
||||
adapter_type_index = combobox.findText(custom_adapter.get("adapter_type", self._default_adapter_type))
|
||||
combobox.setCurrentIndex(adapter_type_index)
|
||||
@@ -147,7 +147,7 @@ class CustomAdaptersConfigurationDialog(QtWidgets.QDialog, Ui_CustomAdaptersConf
|
||||
adapter_number += 1
|
||||
|
||||
self.uiAdaptersTreeWidget.setItemDelegateForColumn(0, NoEditDelegate(self))
|
||||
self.uiAdaptersTreeWidget.sortByColumn(0, QtCore.Qt.AscendingOrder)
|
||||
self.uiAdaptersTreeWidget.sortByColumn(0, QtCore.Qt.SortOrder.AscendingOrder)
|
||||
self.uiAdaptersTreeWidget.setSortingEnabled(True)
|
||||
|
||||
for column in range(self.uiAdaptersTreeWidget.columnCount()):
|
||||
@@ -166,9 +166,9 @@ class CustomAdaptersConfigurationDialog(QtWidgets.QDialog, Ui_CustomAdaptersConf
|
||||
custom_adapter_settings = {}
|
||||
item = self.uiAdaptersTreeWidget.topLevelItem(row)
|
||||
port_name = item.text(1)
|
||||
adapter_number = item.data(0, QtCore.Qt.UserRole)
|
||||
adapter_number = item.data(0, QtCore.Qt.ItemDataRole.UserRole)
|
||||
custom_adapter_settings["adapter_number"] = adapter_number
|
||||
original_port_name = item.data(1, QtCore.Qt.UserRole)
|
||||
original_port_name = item.data(1, QtCore.Qt.ItemDataRole.UserRole)
|
||||
if not port_name:
|
||||
QtWidgets.QMessageBox.critical(self, "Port name", "Port name cannot be empty for adapter {}".format(adapter_number))
|
||||
return False
|
||||
|
||||
@@ -180,4 +180,4 @@ if __name__ == '__main__':
|
||||
main = QtWidgets.QMainWindow()
|
||||
dialog = DoctorDialog(main, console=True)
|
||||
# dialog.show()
|
||||
#exit_code = app.exec_()
|
||||
#exit_code = app.exec()
|
||||
|
||||
@@ -90,4 +90,4 @@ if __name__ == '__main__':
|
||||
main = QtWidgets.QMainWindow()
|
||||
dialog = EditComputeDialog(main)
|
||||
dialog.show()
|
||||
exit_code = app.exec_()
|
||||
exit_code = app.exec()
|
||||
|
||||
@@ -41,12 +41,12 @@ class EditProjectDialog(QtWidgets.QDialog, Ui_EditProjectDialog):
|
||||
self.uiNodeGridSizeSpinBox.setValue(self._project.nodeGridSize())
|
||||
self.uiDrawingGridSizeSpinBox.setValue(self._project.drawingGridSize())
|
||||
|
||||
self.uiGlobalVariablesGrid.setAlignment(QtCore.Qt.AlignTop)
|
||||
self.uiGlobalVariablesGrid.setAlignment(QtCore.Qt.AlignmentFlag.AlignTop)
|
||||
|
||||
self.uiNewVarButton = QtWidgets.QPushButton('Add new variable', self)
|
||||
self.uiNewVarButton.setSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
|
||||
self.uiNewVarButton.setSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Fixed)
|
||||
self.uiNewVarButton.clicked.connect(self.onAddNewVariable)
|
||||
self.uiGlobalVariablesGrid.addWidget(self.uiNewVarButton, 0, 3, QtCore.Qt.AlignRight)
|
||||
self.uiGlobalVariablesGrid.addWidget(self.uiNewVarButton, 0, 3, QtCore.Qt.AlignmentFlag.AlignRight)
|
||||
|
||||
self._readme_filename = "README.txt"
|
||||
self.uiTabWidget.currentChanged.connect(self._previewMarkdownSlot)
|
||||
|
||||
@@ -48,8 +48,8 @@ class FileEditorDialog(QtWidgets.QDialog, Ui_FileEditorDialog):
|
||||
self.setWindowTitle(target.name() + " " + os.path.basename(path))
|
||||
|
||||
self.uiRefreshButton.pressed.connect(self._refreshSlot)
|
||||
self.uiButtonBox.button(QtWidgets.QDialogButtonBox.Save).clicked.connect(self._okButtonClickedSlot)
|
||||
self.uiButtonBox.button(QtWidgets.QDialogButtonBox.Cancel).clicked.connect(self.reject)
|
||||
self.uiButtonBox.button(QtWidgets.QDialogButtonBox.StandardButton.Save).clicked.connect(self._okButtonClickedSlot)
|
||||
self.uiButtonBox.button(QtWidgets.QDialogButtonBox.StandardButton.Cancel).clicked.connect(self.reject)
|
||||
|
||||
self._refreshSlot()
|
||||
|
||||
|
||||
@@ -38,9 +38,9 @@ class FilterDialog(QtWidgets.QDialog, Ui_FilterDialog):
|
||||
self._link.listAvailableFilters(self._listAvailableFiltersCallback)
|
||||
self._initialized = False
|
||||
self._filter_items = {}
|
||||
self.uiButtonBox.button(QtWidgets.QDialogButtonBox.Apply).clicked.connect(self._applyPreferencesSlot)
|
||||
self.uiButtonBox.button(QtWidgets.QDialogButtonBox.Help).clicked.connect(self._helpSlot)
|
||||
self.uiButtonBox.button(QtWidgets.QDialogButtonBox.Reset).clicked.connect(self._resetSlot)
|
||||
self.uiButtonBox.button(QtWidgets.QDialogButtonBox.StandardButton.Apply).clicked.connect(self._applyPreferencesSlot)
|
||||
self.uiButtonBox.button(QtWidgets.QDialogButtonBox.StandardButton.Help).clicked.connect(self._helpSlot)
|
||||
self.uiButtonBox.button(QtWidgets.QDialogButtonBox.StandardButton.Reset).clicked.connect(self._resetSlot)
|
||||
|
||||
def _listAvailableFiltersCallback(self, result, error=False, *args, **kwargs):
|
||||
if error:
|
||||
@@ -91,7 +91,7 @@ class FilterDialog(QtWidgets.QDialog, Ui_FilterDialog):
|
||||
spinBox.setMinimum(param["minimum"])
|
||||
spinBox.setMaximum(param["maximum"])
|
||||
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(spinBox.sizePolicy().hasHeightForWidth())
|
||||
@@ -112,7 +112,7 @@ class FilterDialog(QtWidgets.QDialog, Ui_FilterDialog):
|
||||
textEdit = QtWidgets.QTextEdit()
|
||||
textEdit.setAcceptRichText(False)
|
||||
filter["textEdits"].append(textEdit)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Expanding)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
textEdit.setMinimumWidth(300)
|
||||
@@ -128,7 +128,7 @@ class FilterDialog(QtWidgets.QDialog, Ui_FilterDialog):
|
||||
|
||||
line += 1
|
||||
|
||||
spacerItem = QtWidgets.QSpacerItem(1, 1, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
|
||||
spacerItem = QtWidgets.QSpacerItem(1, 1, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding)
|
||||
gridLayout.addItem(spacerItem, line, 0, 1, 1)
|
||||
vlayout.addLayout(gridLayout)
|
||||
tab.setLayout(vlayout)
|
||||
|
||||
@@ -33,8 +33,8 @@ class IdlePCDialog(QtWidgets.QDialog, Ui_IdlePCDialog):
|
||||
|
||||
super().__init__(parent)
|
||||
self.setupUi(self)
|
||||
self.uiButtonBox.button(QtWidgets.QDialogButtonBox.Apply).clicked.connect(self._applySlot)
|
||||
self.uiButtonBox.button(QtWidgets.QDialogButtonBox.Help).clicked.connect(self._helpSlot)
|
||||
self.uiButtonBox.button(QtWidgets.QDialogButtonBox.StandardButton.Apply).clicked.connect(self._applySlot)
|
||||
self.uiButtonBox.button(QtWidgets.QDialogButtonBox.StandardButton.Help).clicked.connect(self._helpSlot)
|
||||
|
||||
self._router = router
|
||||
self._idlepcs = idlepcs
|
||||
|
||||
@@ -18,9 +18,9 @@
|
||||
import sys
|
||||
import tempfile
|
||||
import json
|
||||
import sip
|
||||
import os
|
||||
|
||||
from ..qt import sip
|
||||
from gns3.qt import QtCore, QtWidgets, qpartial
|
||||
from gns3.controller import Controller
|
||||
from gns3.appliance_manager import ApplianceManager
|
||||
@@ -41,16 +41,16 @@ class NewTemplateWizard(QtWidgets.QWizard, Ui_NewTemplateWizard):
|
||||
super().__init__(parent)
|
||||
self.setupUi(self)
|
||||
|
||||
self.setWizardStyle(QtWidgets.QWizard.ModernStyle)
|
||||
self.setWizardStyle(QtWidgets.QWizard.WizardStyle.ModernStyle)
|
||||
if sys.platform.startswith("darwin"):
|
||||
# we want to see the cancel button on OSX
|
||||
self.setOptions(QtWidgets.QWizard.NoDefaultButton)
|
||||
self.setOptions(QtWidgets.QWizard.WizardOption.NoDefaultButton)
|
||||
|
||||
# add a custom button to show appliance information
|
||||
self.setButtonText(QtWidgets.QWizard.CustomButton1, "&Update from online registry")
|
||||
self.setOption(QtWidgets.QWizard.HaveCustomButton1, True)
|
||||
self.setButtonText(QtWidgets.QWizard.WizardButton.CustomButton1, "&Update from online registry")
|
||||
self.setOption(QtWidgets.QWizard.WizardOption.HaveCustomButton1, True)
|
||||
self.customButtonClicked.connect(self._downloadAppliancesSlot)
|
||||
self.button(QtWidgets.QWizard.CustomButton1).hide()
|
||||
self.button(QtWidgets.QWizard.WizardButton.CustomButton1).hide()
|
||||
self.uiFilterLineEdit.textChanged.connect(self._filterTextChangedSlot)
|
||||
ApplianceManager.instance().appliances_changed_signal.connect(self._appliancesChangedSlot)
|
||||
|
||||
@@ -154,16 +154,16 @@ 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_routers.setFlags(parent_routers.flags() & ~QtCore.Qt.ItemFlag.ItemIsSelectable)
|
||||
parent_switches = QtWidgets.QTreeWidgetItem(self.uiAppliancesTreeWidget)
|
||||
parent_switches.setText(0, "Switches")
|
||||
parent_switches.setFlags(parent_switches.flags() & ~QtCore.Qt.ItemIsSelectable)
|
||||
parent_switches.setFlags(parent_switches.flags() & ~QtCore.Qt.ItemFlag.ItemIsSelectable)
|
||||
parent_guests = QtWidgets.QTreeWidgetItem(self.uiAppliancesTreeWidget)
|
||||
parent_guests.setText(0, "Guests")
|
||||
parent_guests.setFlags(parent_guests.flags() & ~QtCore.Qt.ItemIsSelectable)
|
||||
parent_guests.setFlags(parent_guests.flags() & ~QtCore.Qt.ItemFlag.ItemIsSelectable)
|
||||
parent_firewalls = QtWidgets.QTreeWidgetItem(self.uiAppliancesTreeWidget)
|
||||
parent_firewalls.setText(0, "Firewalls")
|
||||
parent_firewalls.setFlags(parent_firewalls.flags() & ~QtCore.Qt.ItemIsSelectable)
|
||||
parent_firewalls.setFlags(parent_firewalls.flags() & ~QtCore.Qt.ItemFlag.ItemIsSelectable)
|
||||
self.uiAppliancesTreeWidget.expandAll()
|
||||
|
||||
for appliance in ApplianceManager.instance().appliances():
|
||||
@@ -200,14 +200,14 @@ class NewTemplateWizard(QtWidgets.QWizard, Ui_NewTemplateWizard):
|
||||
item.setText(1, "N/A")
|
||||
|
||||
item.setText(2, appliance["vendor_name"])
|
||||
item.setData(0, QtCore.Qt.UserRole, appliance)
|
||||
item.setData(0, QtCore.Qt.ItemDataRole.UserRole, appliance)
|
||||
|
||||
#item.setSizeHint(0, QtCore.QSize(32, 32))
|
||||
item.setToolTip(0, self._get_tooltip_text(appliance))
|
||||
Controller.instance().getSymbolIcon(appliance.get("symbol"), qpartial(self._setItemIcon, item),
|
||||
fallback=":/symbols/" + appliance["category"] + ".svg")
|
||||
|
||||
self.uiAppliancesTreeWidget.sortByColumn(0, QtCore.Qt.AscendingOrder)
|
||||
self.uiAppliancesTreeWidget.sortByColumn(0, QtCore.Qt.SortOrder.AscendingOrder)
|
||||
self.uiAppliancesTreeWidget.resizeColumnToContents(0)
|
||||
if not appliance_filter:
|
||||
self.uiAppliancesTreeWidget.collapseAll()
|
||||
@@ -221,19 +221,19 @@ class NewTemplateWizard(QtWidgets.QWizard, Ui_NewTemplateWizard):
|
||||
|
||||
super().initializePage(page_id)
|
||||
if self.page(page_id) == self.uiApplianceFromServerWizardPage:
|
||||
self.button(QtWidgets.QWizard.CustomButton1).show()
|
||||
self.setButtonText(QtWidgets.QWizard.FinishButton, "&Install")
|
||||
self.button(QtWidgets.QWizard.WizardButton.CustomButton1).show()
|
||||
self.setButtonText(QtWidgets.QWizard.WizardButton.FinishButton, "&Install")
|
||||
self._get_appliances_from_server()
|
||||
else:
|
||||
self.button(QtWidgets.QWizard.CustomButton1).hide()
|
||||
self.button(QtWidgets.QWizard.WizardButton.CustomButton1).hide()
|
||||
|
||||
def cleanupPage(self, page_id):
|
||||
"""
|
||||
Restore button default settings on the first page.
|
||||
"""
|
||||
|
||||
self.button(QtWidgets.QWizard.CustomButton1).hide()
|
||||
self.setButtonText(QtWidgets.QWizard.FinishButton, "&Finish")
|
||||
self.button(QtWidgets.QWizard.WizardButton.CustomButton1).hide()
|
||||
self.setButtonText(QtWidgets.QWizard.WizardButton.FinishButton, "&Finish")
|
||||
super().cleanupPage(page_id)
|
||||
|
||||
def validateCurrentPage(self):
|
||||
@@ -274,7 +274,7 @@ class NewTemplateWizard(QtWidgets.QWizard, Ui_NewTemplateWizard):
|
||||
items = self.uiAppliancesTreeWidget.selectedItems()
|
||||
for item in items:
|
||||
f = tempfile.NamedTemporaryFile(mode="w+", suffix=".builtin.gns3a", delete=False)
|
||||
json.dump(item.data(0, QtCore.Qt.UserRole), f)
|
||||
json.dump(item.data(0, QtCore.Qt.ItemDataRole.UserRole), f)
|
||||
f.close()
|
||||
MainWindow.instance().loadPath(f.name)
|
||||
try:
|
||||
|
||||
@@ -40,8 +40,8 @@ class NodePropertiesDialog(QtWidgets.QDialog, Ui_NodePropertiesDialog):
|
||||
self._node_items = node_items
|
||||
self._parent_items = {}
|
||||
|
||||
self.uiButtonBox.button(QtWidgets.QDialogButtonBox.Apply).setEnabled(False)
|
||||
self.uiButtonBox.button(QtWidgets.QDialogButtonBox.Reset).setEnabled(False)
|
||||
self.uiButtonBox.button(QtWidgets.QDialogButtonBox.StandardButton.Apply).setEnabled(False)
|
||||
self.uiButtonBox.button(QtWidgets.QDialogButtonBox.StandardButton.Reset).setEnabled(False)
|
||||
|
||||
self.previousItem = None
|
||||
self.previousPage = None
|
||||
@@ -84,7 +84,7 @@ class NodePropertiesDialog(QtWidgets.QDialog, Ui_NodePropertiesDialog):
|
||||
ConfigurationPageItem(self._parent_items[parent], node_item)
|
||||
|
||||
# sort the tree
|
||||
self.uiNodesTreeWidget.sortByColumn(0, QtCore.Qt.AscendingOrder)
|
||||
self.uiNodesTreeWidget.sortByColumn(0, QtCore.Qt.SortOrder.AscendingOrder)
|
||||
|
||||
if len(self._node_items) == 1:
|
||||
parent = " {} group".format(str(node_item.node()))
|
||||
@@ -135,19 +135,19 @@ class NodePropertiesDialog(QtWidgets.QDialog, Ui_NodePropertiesDialog):
|
||||
self.uiConfigStackedWidget.setCurrentWidget(page)
|
||||
|
||||
if page != self.uiEmptyPageWidget:
|
||||
self.uiButtonBox.button(QtWidgets.QDialogButtonBox.Apply).setEnabled(True)
|
||||
self.uiButtonBox.button(QtWidgets.QDialogButtonBox.Reset).setEnabled(True)
|
||||
self.uiButtonBox.button(QtWidgets.QDialogButtonBox.Help).setEnabled(True)
|
||||
self.uiButtonBox.button(QtWidgets.QDialogButtonBox.StandardButton.Apply).setEnabled(True)
|
||||
self.uiButtonBox.button(QtWidgets.QDialogButtonBox.StandardButton.Reset).setEnabled(True)
|
||||
self.uiButtonBox.button(QtWidgets.QDialogButtonBox.StandardButton.Help).setEnabled(True)
|
||||
else:
|
||||
self.uiButtonBox.button(QtWidgets.QDialogButtonBox.Apply).setEnabled(False)
|
||||
self.uiButtonBox.button(QtWidgets.QDialogButtonBox.Reset).setEnabled(False)
|
||||
self.uiButtonBox.button(QtWidgets.QDialogButtonBox.Help).setEnabled(False)
|
||||
self.uiButtonBox.button(QtWidgets.QDialogButtonBox.StandardButton.Apply).setEnabled(False)
|
||||
self.uiButtonBox.button(QtWidgets.QDialogButtonBox.StandardButton.Reset).setEnabled(False)
|
||||
self.uiButtonBox.button(QtWidgets.QDialogButtonBox.StandardButton.Help).setEnabled(False)
|
||||
|
||||
# hide the contextual help button if there is no help text
|
||||
if page.whatsThis():
|
||||
self.uiButtonBox.button(QtWidgets.QDialogButtonBox.Help).show()
|
||||
self.uiButtonBox.button(QtWidgets.QDialogButtonBox.StandardButton.Help).show()
|
||||
else:
|
||||
self.uiButtonBox.button(QtWidgets.QDialogButtonBox.Help).hide()
|
||||
self.uiButtonBox.button(QtWidgets.QDialogButtonBox.StandardButton.Help).hide()
|
||||
|
||||
def on_uiButtonBox_clicked(self, button):
|
||||
"""
|
||||
@@ -157,13 +157,13 @@ class NodePropertiesDialog(QtWidgets.QDialog, Ui_NodePropertiesDialog):
|
||||
"""
|
||||
|
||||
try:
|
||||
if button == self.uiButtonBox.button(QtWidgets.QDialogButtonBox.Apply):
|
||||
if button == self.uiButtonBox.button(QtWidgets.QDialogButtonBox.StandardButton.Apply):
|
||||
self.applySettings()
|
||||
elif button == self.uiButtonBox.button(QtWidgets.QDialogButtonBox.Reset):
|
||||
elif button == self.uiButtonBox.button(QtWidgets.QDialogButtonBox.StandardButton.Reset):
|
||||
self.resetSettings()
|
||||
elif button == self.uiButtonBox.button(QtWidgets.QDialogButtonBox.Help):
|
||||
elif button == self.uiButtonBox.button(QtWidgets.QDialogButtonBox.StandardButton.Help):
|
||||
self.showHelp()
|
||||
elif button == self.uiButtonBox.button(QtWidgets.QDialogButtonBox.Cancel):
|
||||
elif button == self.uiButtonBox.button(QtWidgets.QDialogButtonBox.StandardButton.Cancel):
|
||||
QtWidgets.QDialog.reject(self)
|
||||
else:
|
||||
self.applySettings()
|
||||
|
||||
@@ -54,12 +54,12 @@ class NotifDialog(QtWidgets.QWidget):
|
||||
super().__init__(parent)
|
||||
self._notifs = []
|
||||
|
||||
self.setWindowFlags(QtCore.Qt.FramelessWindowHint |
|
||||
QtCore.Qt.WindowDoesNotAcceptFocus |
|
||||
QtCore.Qt.SubWindow)
|
||||
# QtCore.Qt.Tool)
|
||||
# QtCore.Qt.WindowStaysOnTopHint)
|
||||
self.setAttribute(QtCore.Qt.WA_ShowWithoutActivating) # | QtCore.Qt.WA_TranslucentBackground)
|
||||
self.setWindowFlags(QtCore.Qt.WindowType.FramelessWindowHint |
|
||||
QtCore.Qt.WindowType.WindowDoesNotAcceptFocus |
|
||||
QtCore.Qt.WindowType.SubWindow)
|
||||
# QtCore.Qt.WindowType.Tool)
|
||||
# QtCore.Qt.WindowType.WindowStaysOnTopHint)
|
||||
self.setAttribute(QtCore.Qt.WidgetAttribute.WA_ShowWithoutActivating) # | QtCore.Qt.WidgetAttribute.WA_TranslucentBackground)
|
||||
|
||||
self._layout = QtWidgets.QVBoxLayout()
|
||||
|
||||
@@ -70,7 +70,7 @@ class NotifDialog(QtWidgets.QWidget):
|
||||
|
||||
for i in range(0, MAX_ELEMENTS):
|
||||
l = QtWidgets.QLabel()
|
||||
l.setAlignment(QtCore.Qt.AlignTop)
|
||||
l.setAlignment(QtCore.Qt.AlignmentFlag.AlignTop)
|
||||
l.setWordWrap(True)
|
||||
l.hide()
|
||||
self._layout.addWidget(l)
|
||||
@@ -187,4 +187,4 @@ if __name__ == '__main__':
|
||||
main.setMinimumWidth(600)
|
||||
main.setMinimumHeight(600)
|
||||
main.show()
|
||||
exit_code = app.exec_()
|
||||
exit_code = app.exec()
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
Dialog to load module and built-in preference pages.
|
||||
"""
|
||||
|
||||
from ..qt import QtCore, QtWidgets
|
||||
from ..qt import QtGui, QtCore, QtWidgets
|
||||
from ..ui.preferences_dialog_ui import Ui_PreferencesDialog
|
||||
from ..pages.controller_preferences_page import ControllerPreferencesPage
|
||||
from ..pages.general_preferences_page import GeneralPreferencesPage
|
||||
@@ -50,8 +50,9 @@ class PreferencesDialog(QtWidgets.QDialog, Ui_PreferencesDialog):
|
||||
# We adapt the max size to the screen resolution
|
||||
# We need to manually do that otherwise on small screen the windows
|
||||
# could be bigger than the screen instead of displaying scrollbars
|
||||
height = QtWidgets.QDesktopWidget().screenGeometry().height() - 100
|
||||
width = QtWidgets.QDesktopWidget().screenGeometry().width() - 100
|
||||
geometry = QtGui.QGuiApplication.primaryScreen().geometry()
|
||||
height = geometry.height() - 100
|
||||
width = geometry.width() - 100
|
||||
|
||||
# 980 is the default width
|
||||
if self.width() > width:
|
||||
@@ -61,7 +62,7 @@ class PreferencesDialog(QtWidgets.QDialog, Ui_PreferencesDialog):
|
||||
self.resize(self.width(), height)
|
||||
|
||||
self.uiTreeWidget.currentItemChanged.connect(self._showPreferencesPageSlot)
|
||||
self._applyButton = self.uiButtonBox.button(QtWidgets.QDialogButtonBox.Apply)
|
||||
self._applyButton = self.uiButtonBox.button(QtWidgets.QDialogButtonBox.StandardButton.Apply)
|
||||
self._applyButton.clicked.connect(self._applyPreferences)
|
||||
self._applyButton.setEnabled(False)
|
||||
self._applyButton.setStyleSheet("QPushButton:disabled {color: gray}")
|
||||
@@ -74,7 +75,7 @@ class PreferencesDialog(QtWidgets.QDialog, Ui_PreferencesDialog):
|
||||
# set the maximum width based on the content of column 0
|
||||
self.uiTreeWidget.setMaximumWidth(self.uiTreeWidget.sizeHintForColumn(0) + 10)
|
||||
|
||||
# Something has change?
|
||||
# Something has changed?
|
||||
self._modified_pages = set()
|
||||
|
||||
def _loadPreferencePages(self):
|
||||
@@ -97,7 +98,7 @@ class PreferencesDialog(QtWidgets.QDialog, Ui_PreferencesDialog):
|
||||
name = preferences_page.windowTitle()
|
||||
item = QtWidgets.QTreeWidgetItem(self.uiTreeWidget)
|
||||
item.setText(0, name)
|
||||
item.setData(0, QtCore.Qt.UserRole, preferences_page)
|
||||
item.setData(0, QtCore.Qt.ItemDataRole.UserRole, preferences_page)
|
||||
self.uiStackedWidget.addWidget(preferences_page)
|
||||
self._items.append(item)
|
||||
self._watchForChanges(preferences_page)
|
||||
@@ -113,7 +114,7 @@ class PreferencesDialog(QtWidgets.QDialog, Ui_PreferencesDialog):
|
||||
name = preferences_page.windowTitle()
|
||||
item = QtWidgets.QTreeWidgetItem(parent)
|
||||
item.setText(0, name)
|
||||
item.setData(0, QtCore.Qt.UserRole, preferences_page)
|
||||
item.setData(0, QtCore.Qt.ItemDataRole.UserRole, preferences_page)
|
||||
self.uiStackedWidget.addWidget(preferences_page)
|
||||
self._items.append(item)
|
||||
if cls is preference_pages[0]:
|
||||
@@ -178,7 +179,7 @@ class PreferencesDialog(QtWidgets.QDialog, Ui_PreferencesDialog):
|
||||
if current is None:
|
||||
current = previous
|
||||
|
||||
preferences_page = current.data(0, QtCore.Qt.UserRole)
|
||||
preferences_page = current.data(0, QtCore.Qt.ItemDataRole.UserRole)
|
||||
accessible_name = preferences_page.accessibleName()
|
||||
if accessible_name:
|
||||
self.uiTitleLabel.setText(accessible_name)
|
||||
@@ -194,9 +195,9 @@ class PreferencesDialog(QtWidgets.QDialog, Ui_PreferencesDialog):
|
||||
for index in range(0, self.uiStackedWidget.count()):
|
||||
page = self.uiStackedWidget.widget(index)
|
||||
if self.uiStackedWidget.currentIndex() == index:
|
||||
page.setSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
|
||||
page.setSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Expanding)
|
||||
else:
|
||||
page.setSizePolicy(QtWidgets.QSizePolicy.Ignored, QtWidgets.QSizePolicy.Ignored)
|
||||
page.setSizePolicy(QtWidgets.QSizePolicy.Policy.Ignored, QtWidgets.QSizePolicy.Policy.Ignored)
|
||||
|
||||
def _applyPreferences(self):
|
||||
"""
|
||||
@@ -225,9 +226,9 @@ class PreferencesDialog(QtWidgets.QDialog, Ui_PreferencesDialog):
|
||||
reply = QtWidgets.QMessageBox.warning(self,
|
||||
"Preferences",
|
||||
"You have unsaved preferences in {}.\n\nContinue without saving?".format(pages_title),
|
||||
QtWidgets.QMessageBox.Yes,
|
||||
QtWidgets.QMessageBox.No)
|
||||
if reply == QtWidgets.QMessageBox.No:
|
||||
QtWidgets.QMessageBox.StandardButton.Yes,
|
||||
QtWidgets.QMessageBox.StandardButton.No)
|
||||
if reply == QtWidgets.QMessageBox.StandardButton.No:
|
||||
return
|
||||
QtWidgets.QDialog.reject(self)
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ import os
|
||||
import sys
|
||||
import shutil
|
||||
|
||||
from gns3.qt import QtWidgets
|
||||
from gns3.qt import QtWidgets, QtGui
|
||||
from gns3.local_config import LocalConfig
|
||||
from gns3.ui.profile_select_dialog_ui import Ui_ProfileSelectDialog
|
||||
from gns3.version import __version_info__
|
||||
@@ -46,7 +46,7 @@ class ProfileSelectDialog(QtWidgets.QDialog, Ui_ProfileSelectDialog):
|
||||
self.uiDeletePushButton.clicked.connect(self._deletePushButtonSlot)
|
||||
|
||||
# Center on screen
|
||||
screen = QtWidgets.QApplication.desktop().screenGeometry()
|
||||
screen = QtGui.QGuiApplication.primaryScreen().geometry()
|
||||
self.move(screen.center() - self.rect().center())
|
||||
|
||||
version = "{}.{}".format(__version_info__[0], __version_info__[1])
|
||||
@@ -54,8 +54,14 @@ class ProfileSelectDialog(QtWidgets.QDialog, Ui_ProfileSelectDialog):
|
||||
appdata = os.path.expandvars("%APPDATA%")
|
||||
path = os.path.join(appdata, "GNS3", version)
|
||||
else:
|
||||
home = os.path.expanduser("~")
|
||||
path = os.path.join(home, ".config", "GNS3", version)
|
||||
xgd_config_var = "$XDG_CONFIG_HOME"
|
||||
xdg_config_res = os.path.expandvars(xgd_config_var)
|
||||
if xdg_config_res != xgd_config_var:
|
||||
path = os.path.join(xdg_config_res, "GNS3", version)
|
||||
else:
|
||||
home = os.path.expanduser("~")
|
||||
path = os.path.join(home, ".config", "GNS3", version)
|
||||
|
||||
self.profiles_path = os.path.join(path, "profiles")
|
||||
|
||||
self.uiShowAtStartupCheckBox.setChecked(LocalConfig.instance().multiProfiles())
|
||||
@@ -103,4 +109,4 @@ if __name__ == '__main__':
|
||||
app = QtWidgets.QApplication(sys.argv)
|
||||
dialog = ProfileSelectDialog()
|
||||
dialog.show()
|
||||
exit_code = app.exec_()
|
||||
exit_code = app.exec()
|
||||
|
||||
@@ -93,15 +93,15 @@ class ProjectDialog(QtWidgets.QDialog, Ui_ProjectDialog):
|
||||
for project in self.uiProjectsTreeWidget.selectedItems():
|
||||
if sip_is_deleted(project):
|
||||
continue
|
||||
project_id = project.data(0, QtCore.Qt.UserRole)
|
||||
project_name = project.data(1, QtCore.Qt.UserRole)
|
||||
project_id = project.data(0, QtCore.Qt.ItemDataRole.UserRole)
|
||||
project_name = project.data(1, QtCore.Qt.ItemDataRole.UserRole)
|
||||
|
||||
reply = QtWidgets.QMessageBox.warning(self,
|
||||
"Delete project",
|
||||
'Delete project "{}"?\nThis cannot be reverted.'.format(project_name),
|
||||
QtWidgets.QMessageBox.Yes,
|
||||
QtWidgets.QMessageBox.No)
|
||||
if reply == QtWidgets.QMessageBox.Yes:
|
||||
QtWidgets.QMessageBox.StandardButton.Yes,
|
||||
QtWidgets.QMessageBox.StandardButton.No)
|
||||
if reply == QtWidgets.QMessageBox.StandardButton.Yes:
|
||||
projects_to_delete.add(project_id)
|
||||
|
||||
for project_id in projects_to_delete:
|
||||
@@ -118,8 +118,8 @@ class ProjectDialog(QtWidgets.QDialog, Ui_ProjectDialog):
|
||||
return
|
||||
|
||||
for project in self.uiProjectsTreeWidget.selectedItems():
|
||||
project_id = project.data(0, QtCore.Qt.UserRole)
|
||||
project_name = project.data(1, QtCore.Qt.UserRole)
|
||||
project_id = project.data(0, QtCore.Qt.ItemDataRole.UserRole)
|
||||
project_name = project.data(1, QtCore.Qt.ItemDataRole.UserRole)
|
||||
|
||||
new_project_name = project_name + "-1"
|
||||
existing_project_name = [p["name"] for p in Controller.instance().projects()]
|
||||
@@ -131,7 +131,7 @@ class ProjectDialog(QtWidgets.QDialog, Ui_ProjectDialog):
|
||||
name, reply = QtWidgets.QInputDialog.getText(self,
|
||||
"Duplicate project",
|
||||
'Duplicate project "{}"?.'.format(project_name),
|
||||
QtWidgets.QLineEdit.Normal,
|
||||
QtWidgets.QLineEdit.EchoMode.Normal,
|
||||
new_project_name)
|
||||
name = name.strip()
|
||||
if reply and len(name) > 0:
|
||||
@@ -173,9 +173,9 @@ class ProjectDialog(QtWidgets.QDialog, Ui_ProjectDialog):
|
||||
for project in Controller.instance().projects():
|
||||
path = os.path.join(project["path"], project["filename"])
|
||||
item = QtWidgets.QTreeWidgetItem([project["name"], project["status"], path])
|
||||
item.setData(0, QtCore.Qt.UserRole, project["project_id"])
|
||||
item.setData(1, QtCore.Qt.UserRole, project["name"])
|
||||
item.setData(2, QtCore.Qt.UserRole, path)
|
||||
item.setData(0, QtCore.Qt.ItemDataRole.UserRole, project["project_id"])
|
||||
item.setData(1, QtCore.Qt.ItemDataRole.UserRole, project["name"])
|
||||
item.setData(2, QtCore.Qt.ItemDataRole.UserRole, path)
|
||||
items.append(item)
|
||||
self.uiProjectsTreeWidget.addTopLevelItems(items)
|
||||
|
||||
@@ -186,7 +186,7 @@ class ProjectDialog(QtWidgets.QDialog, Ui_ProjectDialog):
|
||||
self.uiProjectsTreeWidget.resizeColumnToContents(0)
|
||||
self.uiProjectsTreeWidget.resizeColumnToContents(1)
|
||||
self.uiProjectsTreeWidget.resizeColumnToContents(2)
|
||||
self.uiProjectsTreeWidget.sortItems(0, QtCore.Qt.AscendingOrder)
|
||||
self.uiProjectsTreeWidget.sortItems(0, QtCore.Qt.SortOrder.AscendingOrder)
|
||||
self.uiProjectsTreeWidget.setUpdatesEnabled(True)
|
||||
|
||||
def keyPressEvent(self, e):
|
||||
@@ -194,7 +194,7 @@ class ProjectDialog(QtWidgets.QDialog, Ui_ProjectDialog):
|
||||
Event handler in order to properly handle escape.
|
||||
"""
|
||||
|
||||
if e.key() == QtCore.Qt.Key_Escape:
|
||||
if e.key() == QtCore.Qt.Key.Key_Escape:
|
||||
self.close()
|
||||
|
||||
def _projectNameSlot(self, text):
|
||||
@@ -295,10 +295,10 @@ class ProjectDialog(QtWidgets.QDialog, Ui_ProjectDialog):
|
||||
reply = QtWidgets.QMessageBox.warning(self,
|
||||
"New project",
|
||||
'Project "{}" already exists in location "{}", overwrite it?'.format(existing_project["name"], existing_project["path"]),
|
||||
QtWidgets.QMessageBox.Yes,
|
||||
QtWidgets.QMessageBox.No)
|
||||
QtWidgets.QMessageBox.StandardButton.Yes,
|
||||
QtWidgets.QMessageBox.StandardButton.No)
|
||||
|
||||
if reply == QtWidgets.QMessageBox.Yes:
|
||||
if reply == QtWidgets.QMessageBox.StandardButton.Yes:
|
||||
Controller.instance().deleteProject(existing_project["project_id"], self._overwriteProjectCallback)
|
||||
|
||||
# In all cases we cancel the new project and if project success to delete
|
||||
@@ -319,6 +319,6 @@ class ProjectDialog(QtWidgets.QDialog, Ui_ProjectDialog):
|
||||
QtWidgets.QMessageBox.critical(self, "Open project", "No project selected")
|
||||
return
|
||||
|
||||
self._project_settings["project_id"] = current.data(0, QtCore.Qt.UserRole)
|
||||
self._project_settings["project_name"] = current.data(1, QtCore.Qt.UserRole)
|
||||
self._project_settings["project_id"] = current.data(0, QtCore.Qt.ItemDataRole.UserRole)
|
||||
self._project_settings["project_name"] = current.data(1, QtCore.Qt.ItemDataRole.UserRole)
|
||||
super().done(result)
|
||||
|
||||
@@ -42,10 +42,10 @@ class ExportProjectWizard(QtWidgets.QWizard, Ui_ExportProjectWizard):
|
||||
|
||||
self._project = project
|
||||
self._path = None
|
||||
self.setWizardStyle(QtWidgets.QWizard.ModernStyle)
|
||||
self.setWizardStyle(QtWidgets.QWizard.WizardStyle.ModernStyle)
|
||||
if sys.platform.startswith("darwin"):
|
||||
# we want to see the cancel button on OSX
|
||||
self.setOptions(QtWidgets.QWizard.NoDefaultButton)
|
||||
self.setOptions(QtWidgets.QWizard.WizardOption.NoDefaultButton)
|
||||
|
||||
self.uiCompressionComboBox.addItem("None", "none")
|
||||
self.uiCompressionComboBox.addItem("Zip compression (deflate)", "zip")
|
||||
@@ -88,7 +88,7 @@ class ExportProjectWizard(QtWidgets.QWizard, Ui_ExportProjectWizard):
|
||||
|
||||
def _pathBrowserSlot(self):
|
||||
|
||||
directory = QtCore.QStandardPaths.writableLocation(QtCore.QStandardPaths.DocumentsLocation)
|
||||
directory = QtCore.QStandardPaths.writableLocation(QtCore.QStandardPaths.StandardLocation.DocumentsLocation)
|
||||
if len(directory) == 0:
|
||||
directory = LocalServer.instance().localServerSettings()["projects_path"]
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ class ProjectWelcomeDialog(QtWidgets.QDialog, Ui_ProjectWelcomeDialog):
|
||||
self._project = project
|
||||
self.setupUi(self)
|
||||
self.uiOkButton.clicked.connect(self._okButtonClickedSlot)
|
||||
self.gridLayout.setAlignment(QtCore.Qt.AlignTop)
|
||||
self.gridLayout.setAlignment(QtCore.Qt.AlignmentFlag.AlignTop)
|
||||
self.label.setOpenExternalLinks(True)
|
||||
self._variables = self._getVariables(project)
|
||||
self._loadReadme()
|
||||
@@ -76,9 +76,9 @@ class ProjectWelcomeDialog(QtWidgets.QDialog, Ui_ProjectWelcomeDialog):
|
||||
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:
|
||||
QtWidgets.QMessageBox.StandardButton.Yes,
|
||||
QtWidgets.QMessageBox.StandardButton.No)
|
||||
if reply == QtWidgets.QMessageBox.StandardButton.No:
|
||||
return
|
||||
|
||||
self._project.setVariables(self._variables)
|
||||
|
||||
@@ -43,10 +43,10 @@ class SetupWizard(QtWidgets.QWizard, Ui_SetupWizard):
|
||||
self.setupUi(self)
|
||||
self.adjustSize()
|
||||
|
||||
self.setWizardStyle(QtWidgets.QWizard.ModernStyle)
|
||||
self.setWizardStyle(QtWidgets.QWizard.WizardStyle.ModernStyle)
|
||||
if sys.platform.startswith("darwin"):
|
||||
# we want to see the cancel button on OSX
|
||||
self.setOptions(QtWidgets.QWizard.NoDefaultButton)
|
||||
self.setOptions(QtWidgets.QWizard.WizardOption.NoDefaultButton)
|
||||
|
||||
self.uiLocalServerToolButton.clicked.connect(self._localServerBrowserSlot)
|
||||
settings = parent.settings()
|
||||
@@ -57,7 +57,7 @@ class SetupWizard(QtWidgets.QWizard, Ui_SetupWizard):
|
||||
|
||||
# load all available addresses
|
||||
for address in QtNetwork.QNetworkInterface.allAddresses():
|
||||
if address.protocol() in [QtNetwork.QAbstractSocket.IPv4Protocol, QtNetwork.QAbstractSocket.IPv6Protocol]:
|
||||
if address.protocol() in [QtNetwork.QAbstractSocket.NetworkLayerProtocol.IPv4Protocol, QtNetwork.QAbstractSocket.NetworkLayerProtocol.IPv6Protocol]:
|
||||
address_string = address.toString()
|
||||
if address_string.startswith("169.254") or address_string.startswith("fe80"):
|
||||
# ignore link-local addresses, could not use https://doc.qt.io/qt-5/qhostaddress.html#isLinkLocal
|
||||
@@ -101,7 +101,7 @@ class SetupWizard(QtWidgets.QWizard, Ui_SetupWizard):
|
||||
:returns: current QWidget
|
||||
"""
|
||||
|
||||
pane = dialog.uiTreeWidget.findItems(name, QtCore.Qt.MatchFixedString)[0]
|
||||
pane = dialog.uiTreeWidget.findItems(name, QtCore.Qt.MatchFlag.MatchFixedString)[0]
|
||||
child_pane = pane.child(0)
|
||||
dialog.uiTreeWidget.setCurrentItem(child_pane)
|
||||
return dialog.uiStackedWidget.currentWidget()
|
||||
|
||||
@@ -68,7 +68,7 @@ class SnapshotsDialog(QtWidgets.QDialog, Ui_SnapshotsDialog):
|
||||
for snapshot in result:
|
||||
item = QtWidgets.QListWidgetItem(self.uiSnapshotsList)
|
||||
item.setText("{} on {}".format(snapshot["name"], datetime.fromtimestamp(snapshot["created_at"]).strftime("%d/%m/%y at %H:%M:%S")))
|
||||
item.setData(QtCore.Qt.UserRole, snapshot["snapshot_id"])
|
||||
item.setData(QtCore.Qt.ItemDataRole.UserRole, snapshot["snapshot_id"])
|
||||
|
||||
if self.uiSnapshotsList.count():
|
||||
self.uiSnapshotsList.setCurrentRow(0)
|
||||
@@ -83,7 +83,7 @@ class SnapshotsDialog(QtWidgets.QDialog, Ui_SnapshotsDialog):
|
||||
Slot to create a snapshot.
|
||||
"""
|
||||
|
||||
snapshot_name, ok = QtWidgets.QInputDialog.getText(self, "Snapshot", "Snapshot name:", QtWidgets.QLineEdit.Normal, "Unnamed")
|
||||
snapshot_name, ok = QtWidgets.QInputDialog.getText(self, "Snapshot", "Snapshot name:", QtWidgets.QLineEdit.EchoMode.Normal, "Unnamed")
|
||||
if ok and snapshot_name and self._project:
|
||||
Controller.instance().post(
|
||||
"/projects/{}/snapshots".format(self._project.id()),
|
||||
@@ -110,7 +110,7 @@ class SnapshotsDialog(QtWidgets.QDialog, Ui_SnapshotsDialog):
|
||||
|
||||
item = self.uiSnapshotsList.currentItem()
|
||||
if item:
|
||||
snapshot_id = item.data(QtCore.Qt.UserRole)
|
||||
snapshot_id = item.data(QtCore.Qt.ItemDataRole.UserRole)
|
||||
Controller.instance().delete("/projects/{}/snapshots/{}".format(self._project.id(), snapshot_id), self._deleteSnapshotsCallback)
|
||||
|
||||
def _deleteSnapshotsCallback(self, result, error=False, server=None, context={}, **kwargs):
|
||||
@@ -128,7 +128,7 @@ class SnapshotsDialog(QtWidgets.QDialog, Ui_SnapshotsDialog):
|
||||
|
||||
item = self.uiSnapshotsList.currentItem()
|
||||
if item:
|
||||
snapshot_id = item.data(QtCore.Qt.UserRole)
|
||||
snapshot_id = item.data(QtCore.Qt.ItemDataRole.UserRole)
|
||||
self._restoreSnapshot(snapshot_id)
|
||||
|
||||
def _restoreSnapshot(self, snapshot_id):
|
||||
@@ -138,8 +138,8 @@ class SnapshotsDialog(QtWidgets.QDialog, Ui_SnapshotsDialog):
|
||||
:param snapshot_id: id of the snapshot
|
||||
"""
|
||||
|
||||
reply = QtWidgets.QMessageBox.question(self, "Snapshots", "This will discard any changes made to your project since the snapshot was taken, would you like to proceed?", QtWidgets.QMessageBox.Ok, QtWidgets.QMessageBox.Cancel)
|
||||
if reply == QtWidgets.QMessageBox.Cancel:
|
||||
reply = QtWidgets.QMessageBox.question(self, "Snapshots", "This will discard any changes made to your project since the snapshot was taken, would you like to proceed?", QtWidgets.QMessageBox.StandardButton.Ok, QtWidgets.QMessageBox.StandardButton.Cancel)
|
||||
if reply == QtWidgets.QMessageBox.StandardButton.Cancel:
|
||||
return
|
||||
|
||||
Controller.instance().post(
|
||||
@@ -163,5 +163,5 @@ class SnapshotsDialog(QtWidgets.QDialog, Ui_SnapshotsDialog):
|
||||
Slot to restore a snapshot when it is double clicked.
|
||||
"""
|
||||
|
||||
snapshot_id = item.data(QtCore.Qt.UserRole)
|
||||
snapshot_id = item.data(QtCore.Qt.ItemDataRole.UserRole)
|
||||
self._restoreSnapshot(snapshot_id)
|
||||
|
||||
@@ -43,15 +43,15 @@ class StyleEditorDialog(QtWidgets.QDialog, Ui_StyleEditorDialog):
|
||||
self._items = items
|
||||
self.uiColorPushButton.clicked.connect(self._setColorSlot)
|
||||
self.uiBorderColorPushButton.clicked.connect(self._setBorderColorSlot)
|
||||
self.uiButtonBox.button(QtWidgets.QDialogButtonBox.Apply).clicked.connect(self._applyPreferencesSlot)
|
||||
self.uiButtonBox.button(QtWidgets.QDialogButtonBox.StandardButton.Apply).clicked.connect(self._applyPreferencesSlot)
|
||||
|
||||
self.uiBorderStyleComboBox.addItem("Solid", QtCore.Qt.SolidLine)
|
||||
self.uiBorderStyleComboBox.addItem("Dash", QtCore.Qt.DashLine)
|
||||
self.uiBorderStyleComboBox.addItem("Dot", QtCore.Qt.DotLine)
|
||||
self.uiBorderStyleComboBox.addItem("Dash Dot", QtCore.Qt.DashDotLine)
|
||||
self.uiBorderStyleComboBox.addItem("Dash Dot Dot", QtCore.Qt.DashDotDotLine)
|
||||
self.uiBorderStyleComboBox.addItem("Solid", QtCore.Qt.PenStyle.SolidLine)
|
||||
self.uiBorderStyleComboBox.addItem("Dash", QtCore.Qt.PenStyle.DashLine)
|
||||
self.uiBorderStyleComboBox.addItem("Dot", QtCore.Qt.PenStyle.DotLine)
|
||||
self.uiBorderStyleComboBox.addItem("Dash Dot", QtCore.Qt.PenStyle.DashDotLine)
|
||||
self.uiBorderStyleComboBox.addItem("Dash Dot Dot", QtCore.Qt.PenStyle.DashDotDotLine)
|
||||
if True not in list(map(lambda item: isinstance(item, LineItem), items)):
|
||||
self.uiBorderStyleComboBox.addItem("No border", QtCore.Qt.NoPen)
|
||||
self.uiBorderStyleComboBox.addItem("No border", QtCore.Qt.PenStyle.NoPen)
|
||||
|
||||
# use the first item in the list as the model
|
||||
first_item = items[0]
|
||||
@@ -103,7 +103,7 @@ class StyleEditorDialog(QtWidgets.QDialog, Ui_StyleEditorDialog):
|
||||
Slot to select the filling color.
|
||||
"""
|
||||
|
||||
color = QtWidgets.QColorDialog.getColor(self._color, self, "Select Color", QtWidgets.QColorDialog.ShowAlphaChannel)
|
||||
color = QtWidgets.QColorDialog.getColor(self._color, self, "Select Color", QtWidgets.QColorDialog.ColorDialogOption.ShowAlphaChannel)
|
||||
if color.isValid():
|
||||
self._color = color
|
||||
self.uiColorPushButton.setStyleSheet("background-color: rgba({}, {}, {}, {});".format(self._color.red(),
|
||||
@@ -116,7 +116,7 @@ class StyleEditorDialog(QtWidgets.QDialog, Ui_StyleEditorDialog):
|
||||
Slot to select the border color.
|
||||
"""
|
||||
|
||||
color = QtWidgets.QColorDialog.getColor(self._border_color, self, "Select Color", QtWidgets.QColorDialog.ShowAlphaChannel)
|
||||
color = QtWidgets.QColorDialog.getColor(self._border_color, self, "Select Color", QtWidgets.QColorDialog.ColorDialogOption.ShowAlphaChannel)
|
||||
if color.isValid():
|
||||
self._border_color = color
|
||||
self.uiBorderColorPushButton.setStyleSheet("background-color: rgba({}, {}, {}, {});".format(self._border_color.red(),
|
||||
@@ -130,7 +130,7 @@ class StyleEditorDialog(QtWidgets.QDialog, Ui_StyleEditorDialog):
|
||||
"""
|
||||
|
||||
border_style = QtCore.Qt.PenStyle(self.uiBorderStyleComboBox.itemData(self.uiBorderStyleComboBox.currentIndex()))
|
||||
pen = QtGui.QPen(self._border_color, self.uiBorderWidthSpinBox.value(), border_style, QtCore.Qt.RoundCap, QtCore.Qt.RoundJoin)
|
||||
pen = QtGui.QPen(self._border_color, self.uiBorderWidthSpinBox.value(), border_style, QtCore.Qt.PenCapStyle.RoundCap, QtCore.Qt.PenJoinStyle.RoundJoin)
|
||||
if self._color:
|
||||
brush = QtGui.QBrush(self._color)
|
||||
else:
|
||||
|
||||
@@ -42,14 +42,14 @@ class StyleEditorDialogLink(QtWidgets.QDialog, Ui_StyleEditorDialog):
|
||||
self._link_style = {}
|
||||
|
||||
self.uiBorderColorPushButton.clicked.connect(self._setBorderColorSlot)
|
||||
self.uiButtonBox.button(QtWidgets.QDialogButtonBox.Apply).clicked.connect(self._applyPreferencesSlot)
|
||||
self.uiButtonBox.button(QtWidgets.QDialogButtonBox.StandardButton.Apply).clicked.connect(self._applyPreferencesSlot)
|
||||
|
||||
self.uiBorderStyleComboBox.addItem("Solid", QtCore.Qt.SolidLine)
|
||||
self.uiBorderStyleComboBox.addItem("Dash", QtCore.Qt.DashLine)
|
||||
self.uiBorderStyleComboBox.addItem("Dot", QtCore.Qt.DotLine)
|
||||
self.uiBorderStyleComboBox.addItem("Dash Dot", QtCore.Qt.DashDotLine)
|
||||
self.uiBorderStyleComboBox.addItem("Dash Dot Dot", QtCore.Qt.DashDotDotLine)
|
||||
self.uiBorderStyleComboBox.addItem("Invisible", QtCore.Qt.NoPen)
|
||||
self.uiBorderStyleComboBox.addItem("Solid", QtCore.Qt.PenStyle.SolidLine)
|
||||
self.uiBorderStyleComboBox.addItem("Dash", QtCore.Qt.PenStyle.DashLine)
|
||||
self.uiBorderStyleComboBox.addItem("Dot", QtCore.Qt.PenStyle.DotLine)
|
||||
self.uiBorderStyleComboBox.addItem("Dash Dot", QtCore.Qt.PenStyle.DashDotLine)
|
||||
self.uiBorderStyleComboBox.addItem("Dash Dot Dot", QtCore.Qt.PenStyle.DashDotDotLine)
|
||||
self.uiBorderStyleComboBox.addItem("Invisible", QtCore.Qt.PenStyle.NoPen)
|
||||
|
||||
self.uiColorLabel.hide()
|
||||
self.uiColorPushButton.hide()
|
||||
@@ -81,7 +81,7 @@ class StyleEditorDialogLink(QtWidgets.QDialog, Ui_StyleEditorDialog):
|
||||
Slot to select the border color.
|
||||
"""
|
||||
|
||||
color = QtWidgets.QColorDialog.getColor(self._border_color, self, "Select Color", QtWidgets.QColorDialog.ShowAlphaChannel)
|
||||
color = QtWidgets.QColorDialog.getColor(self._border_color, self, "Select Color", QtWidgets.QColorDialog.ColorDialogOption.ShowAlphaChannel)
|
||||
if color.isValid():
|
||||
self._border_color = color
|
||||
self.uiBorderColorPushButton.setStyleSheet("background-color: rgba({}, {}, {}, {});".format(self._border_color.red(),
|
||||
@@ -95,7 +95,7 @@ class StyleEditorDialogLink(QtWidgets.QDialog, Ui_StyleEditorDialog):
|
||||
"""
|
||||
|
||||
border_style = QtCore.Qt.PenStyle(self.uiBorderStyleComboBox.itemData(self.uiBorderStyleComboBox.currentIndex()))
|
||||
pen = QtGui.QPen(self._border_color, self.uiBorderWidthSpinBox.value(), border_style, QtCore.Qt.RoundCap, QtCore.Qt.RoundJoin)
|
||||
pen = QtGui.QPen(self._border_color, self.uiBorderWidthSpinBox.value(), border_style, QtCore.Qt.PenCapStyle.RoundCap, QtCore.Qt.PenJoinStyle.RoundJoin)
|
||||
|
||||
self._link.setPen(pen)
|
||||
|
||||
|
||||
@@ -50,16 +50,16 @@ class SymbolSelectionDialog(QtWidgets.QDialog, Ui_SymbolSelectionDialog):
|
||||
self.setupUi(self)
|
||||
|
||||
self._items = items
|
||||
self.uiButtonBox.button(QtWidgets.QDialogButtonBox.Apply).clicked.connect(self._applyPreferencesSlot)
|
||||
self.uiButtonBox.button(QtWidgets.QDialogButtonBox.StandardButton.Apply).clicked.connect(self._applyPreferencesSlot)
|
||||
self.uiSymbolToolButton.clicked.connect(self._symbolBrowserSlot)
|
||||
self.uiCustomSymbolRadioButton.toggled.connect(self._customSymbolToggledSlot)
|
||||
self.uiBuiltInSymbolRadioButton.toggled.connect(self._builtInSymbolToggledSlot)
|
||||
self.uiSearchLineEdit.textChanged.connect(self._searchTextChangedSlot)
|
||||
if not SymbolSelectionDialog._symbols_dir:
|
||||
SymbolSelectionDialog._symbols_dir = QtCore.QStandardPaths.writableLocation(QtCore.QStandardPaths.PicturesLocation)
|
||||
SymbolSelectionDialog._symbols_dir = QtCore.QStandardPaths.writableLocation(QtCore.QStandardPaths.StandardLocation.PicturesLocation)
|
||||
|
||||
if not self._items:
|
||||
self.uiButtonBox.button(QtWidgets.QDialogButtonBox.Apply).hide()
|
||||
self.uiButtonBox.button(QtWidgets.QDialogButtonBox.StandardButton.Apply).hide()
|
||||
|
||||
self.uiBuiltInSymbolRadioButton.setChecked(True)
|
||||
self.uiSymbolTreeWidget.setFocus()
|
||||
@@ -85,14 +85,14 @@ class SymbolSelectionDialog(QtWidgets.QDialog, Ui_SymbolSelectionDialog):
|
||||
font = parent.font(0)
|
||||
font.setBold(True)
|
||||
parent.setFont(0, font)
|
||||
parent.setFlags(parent.flags() & ~QtCore.Qt.ItemIsSelectable)
|
||||
parent.setFlags(parent.flags() & ~QtCore.Qt.ItemFlag.ItemIsSelectable)
|
||||
self._parents[theme] = parent
|
||||
else:
|
||||
parent = self._parents[theme]
|
||||
|
||||
name = os.path.splitext(symbol.filename())[0]
|
||||
item = QtWidgets.QTreeWidgetItem(parent)
|
||||
item.setData(0, QtCore.Qt.UserRole, symbol)
|
||||
item.setData(0, QtCore.Qt.ItemDataRole.UserRole, symbol)
|
||||
item.setToolTip(0, symbol.id())
|
||||
self._symbol_items.append(item)
|
||||
item.setText(0, name)
|
||||
@@ -101,7 +101,7 @@ class SymbolSelectionDialog(QtWidgets.QDialog, Ui_SymbolSelectionDialog):
|
||||
if sip_is_deleted(item):
|
||||
return
|
||||
svg_renderer = QImageSvgRenderer(path)
|
||||
image = QtGui.QImage(64, 64, QtGui.QImage.Format_ARGB32)
|
||||
image = QtGui.QImage(64, 64, QtGui.QImage.Format.Format_ARGB32)
|
||||
# Set the ARGB to 0 to prevent rendering artifacts
|
||||
image.fill(0x00000000)
|
||||
svg_renderer.render(QtGui.QPainter(image))
|
||||
@@ -111,7 +111,7 @@ class SymbolSelectionDialog(QtWidgets.QDialog, Ui_SymbolSelectionDialog):
|
||||
Controller.instance().getStatic(symbol.url(), qpartial(render, item))
|
||||
|
||||
for parent in self._parents.values():
|
||||
parent.sortChildren(0, QtCore.Qt.AscendingOrder)
|
||||
parent.sortChildren(0, QtCore.Qt.SortOrder.AscendingOrder)
|
||||
self.adjustSize()
|
||||
|
||||
def _searchTextChangedSlot(self, text):
|
||||
@@ -123,7 +123,7 @@ class SymbolSelectionDialog(QtWidgets.QDialog, Ui_SymbolSelectionDialog):
|
||||
"""
|
||||
text = self.uiSearchLineEdit.text()
|
||||
for item in self._symbol_items:
|
||||
# if not item.data(0, QtCore.Qt.UserRole).builtin():
|
||||
# if not item.data(0, QtCore.Qt.ItemDataRole.UserRole).builtin():
|
||||
# item.setHidden(True)
|
||||
# else:
|
||||
if not text.strip() or text.strip().lower() in item.text(0).lower():
|
||||
@@ -176,7 +176,7 @@ class SymbolSelectionDialog(QtWidgets.QDialog, Ui_SymbolSelectionDialog):
|
||||
if self.uiSymbolTreeWidget.isEnabled():
|
||||
current = self.uiSymbolTreeWidget.currentItem()
|
||||
if current and current.parent():
|
||||
return current.data(0, QtCore.Qt.UserRole).id()
|
||||
return current.data(0, QtCore.Qt.ItemDataRole.UserRole).id()
|
||||
else:
|
||||
return os.path.basename(self.uiSymbolLineEdit.text())
|
||||
return None
|
||||
|
||||
@@ -39,7 +39,7 @@ class TextEditorDialog(QtWidgets.QDialog, Ui_TextEditorDialog):
|
||||
self._items = items
|
||||
self.uiFontPushButton.clicked.connect(self._setFontSlot)
|
||||
self.uiColorPushButton.clicked.connect(self._setColorSlot)
|
||||
self.uiButtonBox.button(QtWidgets.QDialogButtonBox.Apply).clicked.connect(self._applyPreferencesSlot)
|
||||
self.uiButtonBox.button(QtWidgets.QDialogButtonBox.StandardButton.Apply).clicked.connect(self._applyPreferencesSlot)
|
||||
|
||||
# use the first item in the list as the model
|
||||
first_item = items[0]
|
||||
@@ -49,7 +49,7 @@ class TextEditorDialog(QtWidgets.QDialog, Ui_TextEditorDialog):
|
||||
self.uiPlainTextEdit.setFont(first_item.font())
|
||||
|
||||
if not first_item.editable():
|
||||
self.uiPlainTextEdit.setTextInteractionFlags(QtCore.Qt.NoTextInteraction)
|
||||
self.uiPlainTextEdit.setTextInteractionFlags(QtCore.Qt.TextInteractionFlag.NoTextInteraction)
|
||||
|
||||
if len(self._items) == 1:
|
||||
self.uiApplyColorToAllItemsCheckBox.setChecked(True)
|
||||
@@ -77,7 +77,7 @@ class TextEditorDialog(QtWidgets.QDialog, Ui_TextEditorDialog):
|
||||
"""
|
||||
|
||||
selected_font, ok = QtWidgets.QFontDialog.getFont(self.uiPlainTextEdit.font(), self,
|
||||
options=QtWidgets.QFontDialog.DontUseNativeDialog)
|
||||
options=QtWidgets.QFontDialog.FontDialogOption.DontUseNativeDialog)
|
||||
if ok:
|
||||
self.uiPlainTextEdit.setFont(selected_font)
|
||||
|
||||
@@ -87,7 +87,7 @@ class TextEditorDialog(QtWidgets.QDialog, Ui_TextEditorDialog):
|
||||
Slot to select the color.
|
||||
"""
|
||||
|
||||
color = QtWidgets.QColorDialog.getColor(self._color, self, None, QtWidgets.QColorDialog.ShowAlphaChannel)
|
||||
color = QtWidgets.QColorDialog.getColor(self._color, self, None, QtWidgets.QColorDialog.ColorDialogOption.ShowAlphaChannel)
|
||||
if color.isValid():
|
||||
self._setColor(color)
|
||||
|
||||
|
||||
@@ -40,10 +40,10 @@ class VMWizard(QtWidgets.QWizard):
|
||||
self._allow_dynamic_compute_allocation = True
|
||||
self._local_server_disable = False
|
||||
|
||||
self.setWizardStyle(QtWidgets.QWizard.ModernStyle)
|
||||
self.setWizardStyle(QtWidgets.QWizard.WizardStyle.ModernStyle)
|
||||
if sys.platform.startswith("darwin"):
|
||||
# we want to see the cancel button on OSX
|
||||
self.setOptions(QtWidgets.QWizard.NoDefaultButton)
|
||||
self.setOptions(QtWidgets.QWizard.WizardOption.NoDefaultButton)
|
||||
|
||||
self.uiRemoteRadioButton.toggled.connect(self._remoteServerToggledSlot)
|
||||
if hasattr(self, "uiVMRadioButton"):
|
||||
|
||||
@@ -109,14 +109,14 @@ class GraphicsView(QtWidgets.QGraphicsView):
|
||||
self.setSceneSize(width, height)
|
||||
|
||||
# set the custom flags for this view
|
||||
self.setDragMode(QtWidgets.QGraphicsView.RubberBandDrag)
|
||||
self.setRenderHint(QtGui.QPainter.Antialiasing)
|
||||
self.setTransformationAnchor(QtWidgets.QGraphicsView.AnchorUnderMouse)
|
||||
self.setResizeAnchor(QtWidgets.QGraphicsView.AnchorViewCenter)
|
||||
self.setDragMode(QtWidgets.QGraphicsView.DragMode.RubberBandDrag)
|
||||
self.setRenderHint(QtGui.QPainter.RenderHint.Antialiasing)
|
||||
self.setTransformationAnchor(QtWidgets.QGraphicsView.ViewportAnchor.AnchorUnderMouse)
|
||||
self.setResizeAnchor(QtWidgets.QGraphicsView.ViewportAnchor.AnchorViewCenter)
|
||||
|
||||
# default directories for QFileDialog
|
||||
self._import_config_directory = QtCore.QStandardPaths.writableLocation(QtCore.QStandardPaths.DocumentsLocation)
|
||||
self._export_config_directory = QtCore.QStandardPaths.writableLocation(QtCore.QStandardPaths.DocumentsLocation)
|
||||
self._import_config_directory = QtCore.QStandardPaths.writableLocation(QtCore.QStandardPaths.StandardLocation.DocumentsLocation)
|
||||
self._export_config_directory = QtCore.QStandardPaths.writableLocation(QtCore.QStandardPaths.StandardLocation.DocumentsLocation)
|
||||
self._local_addresses = ['0.0.0.0', '127.0.0.1', 'localhost', '::1', '0:0:0:0:0:0:0:1', '::', QtNetwork.QHostInfo.localHostName()]
|
||||
|
||||
def setSceneSize(self, width, height):
|
||||
@@ -235,12 +235,12 @@ class GraphicsView(QtWidgets.QGraphicsView):
|
||||
"""
|
||||
|
||||
if enabled:
|
||||
self.setCursor(QtCore.Qt.CrossCursor)
|
||||
self.setCursor(QtCore.Qt.CursorShape.CrossCursor)
|
||||
else:
|
||||
if self._newlink and self._newlink in self.scene().items():
|
||||
self.scene().removeItem(self._newlink)
|
||||
self._newlink = None
|
||||
self.setCursor(QtCore.Qt.ArrowCursor)
|
||||
self.setCursor(QtCore.Qt.CursorShape.ArrowCursor)
|
||||
self._adding_link = enabled
|
||||
|
||||
def addNote(self, state):
|
||||
@@ -252,10 +252,10 @@ class GraphicsView(QtWidgets.QGraphicsView):
|
||||
|
||||
if state:
|
||||
self._adding_note = True
|
||||
self.setCursor(QtCore.Qt.IBeamCursor)
|
||||
self.setCursor(QtCore.Qt.CursorShape.IBeamCursor)
|
||||
else:
|
||||
self._adding_note = False
|
||||
self.setCursor(QtCore.Qt.ArrowCursor)
|
||||
self.setCursor(QtCore.Qt.CursorShape.ArrowCursor)
|
||||
|
||||
def addRectangle(self, state):
|
||||
"""
|
||||
@@ -266,10 +266,10 @@ class GraphicsView(QtWidgets.QGraphicsView):
|
||||
|
||||
if state:
|
||||
self._adding_rectangle = True
|
||||
self.setCursor(QtCore.Qt.PointingHandCursor)
|
||||
self.setCursor(QtCore.Qt.CursorShape.PointingHandCursor)
|
||||
else:
|
||||
self._adding_rectangle = False
|
||||
self.setCursor(QtCore.Qt.ArrowCursor)
|
||||
self.setCursor(QtCore.Qt.CursorShape.ArrowCursor)
|
||||
|
||||
def addEllipse(self, state):
|
||||
"""
|
||||
@@ -280,10 +280,10 @@ class GraphicsView(QtWidgets.QGraphicsView):
|
||||
|
||||
if state:
|
||||
self._adding_ellipse = True
|
||||
self.setCursor(QtCore.Qt.PointingHandCursor)
|
||||
self.setCursor(QtCore.Qt.CursorShape.PointingHandCursor)
|
||||
else:
|
||||
self._adding_ellipse = False
|
||||
self.setCursor(QtCore.Qt.ArrowCursor)
|
||||
self.setCursor(QtCore.Qt.CursorShape.ArrowCursor)
|
||||
|
||||
def addLine(self, state):
|
||||
"""
|
||||
@@ -294,10 +294,10 @@ class GraphicsView(QtWidgets.QGraphicsView):
|
||||
|
||||
if state:
|
||||
self._adding_line = True
|
||||
self.setCursor(QtCore.Qt.PointingHandCursor)
|
||||
self.setCursor(QtCore.Qt.CursorShape.PointingHandCursor)
|
||||
else:
|
||||
self._adding_line = False
|
||||
self.setCursor(QtCore.Qt.ArrowCursor)
|
||||
self.setCursor(QtCore.Qt.CursorShape.ArrowCursor)
|
||||
|
||||
def addImage(self, image_path):
|
||||
"""
|
||||
@@ -399,7 +399,7 @@ class GraphicsView(QtWidgets.QGraphicsView):
|
||||
# link addition code
|
||||
if not self._newlink:
|
||||
source_item = item
|
||||
source_port = source_item.connectToPort(event.globalPos())
|
||||
source_port = source_item.connectToPort(event.globalPosition().toPoint())
|
||||
if not source_port:
|
||||
return
|
||||
|
||||
@@ -408,15 +408,15 @@ class GraphicsView(QtWidgets.QGraphicsView):
|
||||
return
|
||||
|
||||
if source_port.linkType() == "Serial":
|
||||
self._newlink = SerialLinkItem(source_item, source_port, self.mapToScene(event.pos()), None, adding_flag=True)
|
||||
self._newlink = SerialLinkItem(source_item, source_port, self.mapToScene(event.position().toPoint()), None, adding_flag=True)
|
||||
else:
|
||||
self._newlink = EthernetLinkItem(source_item, source_port, self.mapToScene(event.pos()), None, adding_flag=True)
|
||||
self._newlink = EthernetLinkItem(source_item, source_port, self.mapToScene(event.position().toPoint()), None, adding_flag=True)
|
||||
self.scene().addItem(self._newlink)
|
||||
else:
|
||||
source_item = self._newlink.sourceItem()
|
||||
source_port = self._newlink.sourcePort()
|
||||
destination_item = item
|
||||
destination_port = destination_item.connectToPort(event.globalPos())
|
||||
destination_port = destination_item.connectToPort(event.globalPosition().toPoint())
|
||||
if not destination_port:
|
||||
return
|
||||
|
||||
@@ -439,7 +439,7 @@ class GraphicsView(QtWidgets.QGraphicsView):
|
||||
is_not_link = True
|
||||
is_not_logo = True
|
||||
|
||||
item = self.itemAt(event.pos())
|
||||
item = self.itemAt(event.position().toPoint())
|
||||
if item and sip.isdeleted(item):
|
||||
return
|
||||
elif not item:
|
||||
@@ -454,57 +454,57 @@ class GraphicsView(QtWidgets.QGraphicsView):
|
||||
if isinstance(it, LinkItem):
|
||||
it.setHovered(False)
|
||||
|
||||
if (event.buttons() == QtCore.Qt.LeftButton and event.modifiers() == QtCore.Qt.ShiftModifier) or event.buttons() == QtCore.Qt.MidButton:
|
||||
if (event.buttons() == QtCore.Qt.MouseButton.LeftButton and event.modifiers() == QtCore.Qt.KeyboardModifier.ShiftModifier) or event.buttons() == QtCore.Qt.MouseButton.MiddleButton:
|
||||
# checks to see if either the middle mouse is pressed
|
||||
# or a combination of left mouse button and SHIT key are pressed to start dragging the view
|
||||
self._last_mouse_position = self.mapFromGlobal(event.globalPos())
|
||||
self._last_mouse_position = self.mapFromGlobal(event.globalPosition())
|
||||
self._dragging = True
|
||||
self.setCursor(QtCore.Qt.ClosedHandCursor)
|
||||
self.setCursor(QtCore.Qt.CursorShape.ClosedHandCursor)
|
||||
return
|
||||
|
||||
if is_not_link and item and event.modifiers() == QtCore.Qt.ControlModifier and event.button() == QtCore.Qt.LeftButton and item and not self._adding_link:
|
||||
if is_not_link and item and event.modifiers() == QtCore.Qt.KeyboardModifier.ControlModifier and event.button() == QtCore.Qt.MouseButton.LeftButton and item and not self._adding_link:
|
||||
# manual selection using CTRL
|
||||
if item.isSelected():
|
||||
item.setSelected(False)
|
||||
else:
|
||||
item.setSelected(True)
|
||||
elif is_not_link and is_not_logo and event.button() == QtCore.Qt.RightButton and not self._adding_link:
|
||||
elif is_not_link and is_not_logo and event.button() == QtCore.Qt.MouseButton.RightButton and not self._adding_link:
|
||||
pass #TODO: remove this without creating a bug...
|
||||
elif is_not_link and self._adding_link and event.button() == QtCore.Qt.RightButton:
|
||||
elif is_not_link and self._adding_link and event.button() == QtCore.Qt.MouseButton.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)
|
||||
key = QtGui.QKeyEvent(QtCore.QEvent.Type.KeyPress, QtCore.Qt.Key.Key_Escape, QtCore.Qt.KeyboardModifier.NoModifier)
|
||||
QtWidgets.QApplication.sendEvent(self._main_window, key)
|
||||
elif item and isinstance(item, NodeItem) and self._adding_link and event.button() == QtCore.Qt.LeftButton:
|
||||
elif item and isinstance(item, NodeItem) and self._adding_link and event.button() == QtCore.Qt.MouseButton.LeftButton:
|
||||
self._userNodeLinking(event, item)
|
||||
#context_event = QtGui.QContextMenuEvent(QtGui.QContextMenuEvent.Mouse, event.pos())
|
||||
#context_event = QtGui.QContextMenuEvent(QtGui.QContextMenuEvent.Reason.Mouse, event.pos())
|
||||
#QtWidgets.QApplication.sendEvent(self, context_event)
|
||||
elif event.button() == QtCore.Qt.LeftButton and self._adding_note:
|
||||
pos = self.mapToScene(event.pos())
|
||||
elif event.button() == QtCore.Qt.MouseButton.LeftButton and self._adding_note:
|
||||
pos = self.mapToScene(event.position().toPoint())
|
||||
note = self.createDrawingItem("text", int(pos.x()), int(pos.y()), 2)
|
||||
pos_x = note.pos().x()
|
||||
pos_y = note.pos().y() - (note.boundingRect().height() / 2)
|
||||
note.setPos(pos_x, pos_y)
|
||||
note.editText()
|
||||
self._main_window.uiAddNoteAction.setChecked(False)
|
||||
self.setCursor(QtCore.Qt.ArrowCursor)
|
||||
self.setCursor(QtCore.Qt.CursorShape.ArrowCursor)
|
||||
self._adding_note = False
|
||||
elif event.button() == QtCore.Qt.LeftButton and self._adding_rectangle:
|
||||
pos = self.mapToScene(event.pos())
|
||||
elif event.button() == QtCore.Qt.MouseButton.LeftButton and self._adding_rectangle:
|
||||
pos = self.mapToScene(event.position().toPoint())
|
||||
self.createDrawingItem("rect", int(pos.x()), int(pos.y()), 1)
|
||||
self._main_window.uiDrawRectangleAction.setChecked(False)
|
||||
self.setCursor(QtCore.Qt.ArrowCursor)
|
||||
self.setCursor(QtCore.Qt.CursorShape.ArrowCursor)
|
||||
self._adding_rectangle = False
|
||||
elif event.button() == QtCore.Qt.LeftButton and self._adding_ellipse:
|
||||
pos = self.mapToScene(event.pos())
|
||||
elif event.button() == QtCore.Qt.MouseButton.LeftButton and self._adding_ellipse:
|
||||
pos = self.mapToScene(event.position().toPoint())
|
||||
self.createDrawingItem("ellipse", int(pos.x()), int(pos.y()), 1)
|
||||
self._main_window.uiDrawEllipseAction.setChecked(False)
|
||||
self.setCursor(QtCore.Qt.ArrowCursor)
|
||||
self.setCursor(QtCore.Qt.CursorShape.ArrowCursor)
|
||||
self._adding_ellipse = False
|
||||
elif event.button() == QtCore.Qt.LeftButton and self._adding_line:
|
||||
pos = self.mapToScene(event.pos())
|
||||
elif event.button() == QtCore.Qt.MouseButton.LeftButton and self._adding_line:
|
||||
pos = self.mapToScene(event.position().toPoint())
|
||||
self.createDrawingItem("line", int(pos.x()), int(pos.y()), 1)
|
||||
self._main_window.uiDrawLineAction.setChecked(False)
|
||||
self.setCursor(QtCore.Qt.ArrowCursor)
|
||||
self.setCursor(QtCore.Qt.CursorShape.ArrowCursor)
|
||||
self._adding_line = False
|
||||
else:
|
||||
super().mousePressEvent(event)
|
||||
@@ -538,7 +538,7 @@ class GraphicsView(QtWidgets.QGraphicsView):
|
||||
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:
|
||||
if not (event.modifiers() & QtCore.Qt.KeyboardModifier.ControlModifier):
|
||||
for it in self.scene().items():
|
||||
it.setSelected(False)
|
||||
item.setSelected(True)
|
||||
@@ -564,12 +564,12 @@ class GraphicsView(QtWidgets.QGraphicsView):
|
||||
|
||||
# If the left mouse button is not still pressed TOGETHER with the SHIFT key and neither is the middle button
|
||||
# this means the user is no longer trying to drag the view
|
||||
if self._dragging and not (event.buttons() == QtCore.Qt.LeftButton and event.modifiers() == QtCore.Qt.ShiftModifier) and not event.buttons() & QtCore.Qt.MidButton:
|
||||
if self._dragging and not (event.buttons() == QtCore.Qt.MouseButton.LeftButton and event.modifiers() == QtCore.Qt.KeyboardModifier.ShiftModifier) and not (event.buttons() & QtCore.Qt.MouseButton.MiddleButton):
|
||||
self._dragging = False
|
||||
self.setCursor(QtCore.Qt.ArrowCursor)
|
||||
self.setCursor(QtCore.Qt.CursorShape.ArrowCursor)
|
||||
else:
|
||||
item = self.itemAt(event.pos())
|
||||
if item is not None and not event.modifiers() & QtCore.Qt.ControlModifier:
|
||||
item = self.itemAt(event.position().toPoint())
|
||||
if item is not None and not (event.modifiers() & QtCore.Qt.KeyboardModifier.ControlModifier):
|
||||
item.setSelected(True)
|
||||
super().mouseReleaseEvent(event)
|
||||
|
||||
@@ -582,7 +582,7 @@ class GraphicsView(QtWidgets.QGraphicsView):
|
||||
:param: QWheelEvent instance
|
||||
"""
|
||||
|
||||
if event.modifiers() == QtCore.Qt.ControlModifier:
|
||||
if event.modifiers() == QtCore.Qt.KeyboardModifier.ControlModifier:
|
||||
delta = event.angleDelta()
|
||||
if delta is not None and delta.x() == 0:
|
||||
# CTRL is pressed then use the mouse wheel to zoom in or out.
|
||||
@@ -610,7 +610,7 @@ class GraphicsView(QtWidgets.QGraphicsView):
|
||||
:param event: QKeyEvent
|
||||
"""
|
||||
|
||||
if event.key() == QtCore.Qt.Key_Delete:
|
||||
if event.key() == QtCore.Qt.Key.Key_Delete:
|
||||
# check if we are editing an LabelItem instance, then send the delete key event to it
|
||||
for item in self.scene().selectedItems():
|
||||
if (isinstance(item, LabelItem) or isinstance(item, TextItem)) and item.hasFocus():
|
||||
@@ -630,7 +630,7 @@ class GraphicsView(QtWidgets.QGraphicsView):
|
||||
# This if statement event checks to see if the user is dragging the scene
|
||||
# if so it sets the value of the scene scroll bars based on the change between
|
||||
# the previous and current mouse position
|
||||
mapped_global_pos = self.mapFromGlobal(event.globalPos())
|
||||
mapped_global_pos = self.mapFromGlobal(event.globalPosition())
|
||||
hBar = self.horizontalScrollBar()
|
||||
vBar = self.verticalScrollBar()
|
||||
delta = mapped_global_pos - self._last_mouse_position
|
||||
@@ -639,10 +639,10 @@ class GraphicsView(QtWidgets.QGraphicsView):
|
||||
self._last_mouse_position = mapped_global_pos
|
||||
if self._adding_link and self._newlink and self._newlink in self.scene().items():
|
||||
# update the mouse position when the user is adding a link.
|
||||
self._newlink.setMousePoint(self.mapToScene(event.pos()))
|
||||
self._newlink.setMousePoint(self.mapToScene(event.position().toPoint()))
|
||||
event.ignore()
|
||||
else:
|
||||
item = self.itemAt(event.pos())
|
||||
item = self.itemAt(event.position().toPoint())
|
||||
if item:
|
||||
# show item coords in the status bar
|
||||
coords = "X: {} Y: {} Z: {}".format(item.x(), item.y(), item.zValue())
|
||||
@@ -661,7 +661,7 @@ class GraphicsView(QtWidgets.QGraphicsView):
|
||||
:param event: QMouseEvent instance
|
||||
"""
|
||||
|
||||
item = self.itemAt(event.pos())
|
||||
item = self.itemAt(event.position().toPoint())
|
||||
|
||||
if not self._adding_link:
|
||||
if isinstance(item, NodeItem) and item.node().initialized():
|
||||
@@ -695,7 +695,7 @@ class GraphicsView(QtWidgets.QGraphicsView):
|
||||
node_properties = NodePropertiesDialog(items, self._main_window)
|
||||
node_properties.setModal(True)
|
||||
node_properties.show()
|
||||
node_properties.exec_()
|
||||
node_properties.exec()
|
||||
|
||||
def dragMoveEvent(self, event):
|
||||
"""
|
||||
@@ -723,21 +723,21 @@ class GraphicsView(QtWidgets.QGraphicsView):
|
||||
# check if what has been dropped is handled by this view
|
||||
if event.mimeData().hasFormat("application/x-gns3-template"):
|
||||
template_id = event.mimeData().data("application/x-gns3-template").data().decode()
|
||||
event.setDropAction(QtCore.Qt.CopyAction)
|
||||
event.setDropAction(QtCore.Qt.DropAction.CopyAction)
|
||||
event.accept()
|
||||
if event.keyboardModifiers() == QtCore.Qt.ShiftModifier:
|
||||
if event.modifiers() == QtCore.Qt.KeyboardModifier.ShiftModifier:
|
||||
max_nodes_per_line = 10 # max number of nodes on a single line
|
||||
offset = 100 # spacing between elements
|
||||
integer, ok = QtWidgets.QInputDialog.getInt(self, "Nodes", "Number of nodes:", 2, 1, 100, 1)
|
||||
if ok:
|
||||
for node_number in range(integer):
|
||||
x = event.pos().x() - (150 // 2) + (node_number % max_nodes_per_line) * offset
|
||||
y = event.pos().y() - (70 // 2) + (node_number // max_nodes_per_line) * offset
|
||||
x = event.position().x() - (150 // 2) + (node_number % max_nodes_per_line) * offset
|
||||
y = event.position().y() - (70 // 2) + (node_number // max_nodes_per_line) * offset
|
||||
if self.createNodeFromTemplateId(template_id, QtCore.QPoint(x, y)) is False:
|
||||
event.ignore()
|
||||
break
|
||||
else:
|
||||
if self.createNodeFromTemplateId(template_id, event.pos()) is False:
|
||||
if self.createNodeFromTemplateId(template_id, event.position()) is False:
|
||||
event.ignore()
|
||||
elif event.mimeData().hasFormat("text/uri-list") and event.mimeData().hasUrls():
|
||||
# This should not arrive but we received bug report with it...
|
||||
@@ -762,7 +762,7 @@ class GraphicsView(QtWidgets.QGraphicsView):
|
||||
|
||||
menu = QtWidgets.QMenu()
|
||||
self.populateDeviceContextualMenu(menu)
|
||||
menu.exec_(pos)
|
||||
menu.exec(pos)
|
||||
menu.clear()
|
||||
# Make sure to deselect all items.
|
||||
# This is to prevent a bug on Windows
|
||||
@@ -783,49 +783,49 @@ class GraphicsView(QtWidgets.QGraphicsView):
|
||||
|
||||
if True in list(map(lambda item: isinstance(item, NodeItem) and hasattr(item.node(), "configPage"), items)):
|
||||
# Action: Configure node
|
||||
configure_action = QtWidgets.QAction("Configure", menu)
|
||||
configure_action = QtGui.QAction("Configure", menu)
|
||||
configure_action.setIcon(get_icon("configuration.svg"))
|
||||
configure_action.triggered.connect(self.configureActionSlot)
|
||||
menu.addAction(configure_action)
|
||||
|
||||
if True in list(map(lambda item: isinstance(item, NodeItem) and item.node().console() is not None, items)):
|
||||
console_action = QtWidgets.QAction("Console", menu)
|
||||
console_action = QtGui.QAction("Console", menu)
|
||||
console_action.setIcon(get_icon("console.svg"))
|
||||
console_action.triggered.connect(self.consoleActionSlot)
|
||||
menu.addAction(console_action)
|
||||
|
||||
if True in list(map(lambda item: isinstance(item, NodeItem) and hasattr(item.node(), "auxConsole"), items)):
|
||||
aux_console_action = QtWidgets.QAction("Auxiliary console", menu)
|
||||
aux_console_action = QtGui.QAction("Auxiliary console", menu)
|
||||
aux_console_action.setIcon(get_icon("aux-console.svg"))
|
||||
aux_console_action.triggered.connect(self.auxConsoleActionSlot)
|
||||
menu.addAction(aux_console_action)
|
||||
|
||||
if True in list(map(lambda item: isinstance(item, NodeItem) and not item.node().isAlwaysOn(), items)):
|
||||
start_action = QtWidgets.QAction("Start", menu)
|
||||
start_action = QtGui.QAction("Start", menu)
|
||||
start_action.setIcon(get_icon("start.svg"))
|
||||
start_action.triggered.connect(self.startActionSlot)
|
||||
menu.addAction(start_action)
|
||||
|
||||
if True in list(map(lambda item: isinstance(item, NodeItem) and not item.node().isAlwaysOn(), items)):
|
||||
suspend_action = QtWidgets.QAction("Suspend", menu)
|
||||
suspend_action = QtGui.QAction("Suspend", menu)
|
||||
suspend_action.setIcon(get_icon("pause.svg"))
|
||||
suspend_action.triggered.connect(self.suspendActionSlot)
|
||||
menu.addAction(suspend_action)
|
||||
|
||||
if True in list(map(lambda item: isinstance(item, NodeItem) and not item.node().isAlwaysOn(), items)):
|
||||
stop_action = QtWidgets.QAction("Stop", menu)
|
||||
stop_action = QtGui.QAction("Stop", menu)
|
||||
stop_action.setIcon(get_icon("stop.svg"))
|
||||
stop_action.triggered.connect(self.stopActionSlot)
|
||||
menu.addAction(stop_action)
|
||||
|
||||
if True in list(map(lambda item: isinstance(item, NodeItem) and not item.node().isAlwaysOn(), items)):
|
||||
reload_action = QtWidgets.QAction("Reload", menu)
|
||||
reload_action = QtGui.QAction("Reload", menu)
|
||||
reload_action.setIcon(get_icon("reload.svg"))
|
||||
reload_action.triggered.connect(self.reloadActionSlot)
|
||||
menu.addAction(reload_action)
|
||||
|
||||
if True in list(map(lambda item: isinstance(item, NodeItem) and item.node().console() is not None, items)):
|
||||
console_edit_action = QtWidgets.QAction("Custom console", menu)
|
||||
console_edit_action = QtGui.QAction("Custom console", menu)
|
||||
console_edit_action.setIcon(get_icon("console_edit.svg"))
|
||||
console_edit_action.triggered.connect(self.customConsoleActionSlot)
|
||||
menu.addAction(console_edit_action)
|
||||
@@ -844,96 +844,96 @@ class GraphicsView(QtWidgets.QGraphicsView):
|
||||
|
||||
if True in list(map(lambda item: isinstance(item, NodeItem), items)):
|
||||
# Action: Change hostname
|
||||
change_hostname_action = QtWidgets.QAction("Change hostname", menu)
|
||||
change_hostname_action = QtGui.QAction("Change hostname", menu)
|
||||
change_hostname_action.setIcon(get_icon("show-hostname.svg"))
|
||||
change_hostname_action.triggered.connect(self.changeHostnameActionSlot)
|
||||
menu.addAction(change_hostname_action)
|
||||
|
||||
if True in list(map(lambda item: isinstance(item, NodeItem), items)):
|
||||
# Action: Change symbol
|
||||
change_symbol_action = QtWidgets.QAction("Change symbol", menu)
|
||||
change_symbol_action = QtGui.QAction("Change symbol", menu)
|
||||
change_symbol_action.setIcon(get_icon("node_conception.svg"))
|
||||
change_symbol_action.triggered.connect(self.changeSymbolActionSlot)
|
||||
menu.addAction(change_symbol_action)
|
||||
|
||||
if True in list(map(lambda item: isinstance(item, DrawingItem) or isinstance(item, NodeItem), items)):
|
||||
duplicate_action = QtWidgets.QAction("Duplicate", menu)
|
||||
duplicate_action = QtGui.QAction("Duplicate", menu)
|
||||
duplicate_action.setIcon(get_icon("duplicate.svg"))
|
||||
duplicate_action.triggered.connect(self.duplicateActionSlot)
|
||||
menu.addAction(duplicate_action)
|
||||
|
||||
if True in list(map(lambda item: isinstance(item, NodeItem) and hasattr(item.node(), "info"), items)):
|
||||
# Action: Show node information
|
||||
show_node_info_action = QtWidgets.QAction("Show node information", menu)
|
||||
show_node_info_action = QtGui.QAction("Show node information", menu)
|
||||
show_node_info_action.setIcon(get_icon("help.svg"))
|
||||
show_node_info_action.triggered.connect(self.showNodeInfoSlot)
|
||||
menu.addAction(show_node_info_action)
|
||||
|
||||
if True in list(map(lambda item: isinstance(item, NodeItem) and hasattr(item.node(), "nodeDir"), items)):
|
||||
# Action: Show in file manager
|
||||
show_in_file_manager_action = QtWidgets.QAction("Show in file manager", menu)
|
||||
show_in_file_manager_action = QtGui.QAction("Show in file manager", menu)
|
||||
show_in_file_manager_action.setIcon(get_icon("open.svg"))
|
||||
show_in_file_manager_action.triggered.connect(self.showInFileManagerSlot)
|
||||
menu.addAction(show_in_file_manager_action)
|
||||
|
||||
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 = QtGui.QAction("Bring to front", menu)
|
||||
bring_to_front_action.setIcon(get_icon("front.svg"))
|
||||
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 bool(item.node().configFiles()), items)):
|
||||
import_config_action = QtWidgets.QAction("Import config", menu)
|
||||
import_config_action = QtGui.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 bool(item.node().configFiles()), items)):
|
||||
export_config_action = QtWidgets.QAction("Export config", menu)
|
||||
export_config_action = QtGui.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 bool(item.node().configTextFiles()), items)):
|
||||
export_config_action = QtWidgets.QAction("Edit config", menu)
|
||||
export_config_action = QtGui.QAction("Edit config", menu)
|
||||
export_config_action.setIcon(get_icon("edit.svg"))
|
||||
export_config_action.triggered.connect(self.editConfigActionSlot)
|
||||
menu.addAction(export_config_action)
|
||||
|
||||
if True in list(map(lambda item: isinstance(item, NodeItem) and hasattr(item.node(), "idlepc"), items)):
|
||||
idlepc_action = QtWidgets.QAction("Idle-PC", menu)
|
||||
idlepc_action = QtGui.QAction("Idle-PC", menu)
|
||||
idlepc_action.setIcon(get_icon("calculate.svg"))
|
||||
idlepc_action.triggered.connect(self.idlepcActionSlot)
|
||||
menu.addAction(idlepc_action)
|
||||
|
||||
if True in list(map(lambda item: isinstance(item, NodeItem) and hasattr(item.node(), "idlepc"), items)):
|
||||
auto_idlepc_action = QtWidgets.QAction("Auto Idle-PC", menu)
|
||||
auto_idlepc_action = QtGui.QAction("Auto Idle-PC", menu)
|
||||
auto_idlepc_action.setIcon(get_icon("calculate.svg"))
|
||||
auto_idlepc_action.triggered.connect(self.autoIdlepcActionSlot)
|
||||
menu.addAction(auto_idlepc_action)
|
||||
|
||||
if True in list(map(lambda item: isinstance(item, LabelItem), items)):
|
||||
text_edit_action = QtWidgets.QAction("Text edit", menu)
|
||||
text_edit_action = QtGui.QAction("Text edit", menu)
|
||||
text_edit_action.setIcon(get_icon("show-hostname.svg"))
|
||||
text_edit_action.triggered.connect(self.textEditActionSlot)
|
||||
menu.addAction(text_edit_action)
|
||||
|
||||
if True in list(map(lambda item: isinstance(item, TextItem), items)):
|
||||
text_edit_action = QtWidgets.QAction("Text edit", menu)
|
||||
text_edit_action = QtGui.QAction("Text edit", menu)
|
||||
text_edit_action.setIcon(get_icon("edit.svg"))
|
||||
text_edit_action.triggered.connect(self.textEditActionSlot)
|
||||
menu.addAction(text_edit_action)
|
||||
|
||||
if True in list(map(lambda item: isinstance(item, ShapeItem) or isinstance(item, LineItem), items)):
|
||||
style_action = QtWidgets.QAction("Style", menu)
|
||||
style_action = QtGui.QAction("Style", menu)
|
||||
style_action.setIcon(get_icon("node_conception.svg"))
|
||||
style_action.triggered.connect(self.styleActionSlot)
|
||||
menu.addAction(style_action)
|
||||
|
||||
if True in list(map(lambda item: isinstance(item, LabelItem), items)) and False in list(map(lambda item: item.parentItem() is None, items)):
|
||||
# action only for port labels
|
||||
reset_label_position_action = QtWidgets.QAction("Reset position", menu)
|
||||
reset_label_position_action = QtGui.QAction("Reset position", menu)
|
||||
reset_label_position_action.setIcon(get_icon("reset.svg"))
|
||||
reset_label_position_action.triggered.connect(self.resetLabelPositionActionSlot)
|
||||
menu.addAction(reset_label_position_action)
|
||||
@@ -942,41 +942,41 @@ class GraphicsView(QtWidgets.QGraphicsView):
|
||||
if True in list(map(lambda item: item.parentItem() is None, items)):
|
||||
|
||||
if len(items) > 1:
|
||||
horizontal_align_action = QtWidgets.QAction("Align horizontally", menu)
|
||||
horizontal_align_action = QtGui.QAction("Align horizontally", menu)
|
||||
horizontal_align_action.setIcon(get_icon("horizontally.svg"))
|
||||
horizontal_align_action.triggered.connect(self.horizontalAlignmentSlot)
|
||||
menu.addAction(horizontal_align_action)
|
||||
|
||||
vertical_align_action = QtWidgets.QAction("Align vertically", menu)
|
||||
vertical_align_action = QtGui.QAction("Align vertically", menu)
|
||||
vertical_align_action.setIcon(get_icon("vertically.svg"))
|
||||
vertical_align_action.triggered.connect(self.verticalAlignmentSlot)
|
||||
menu.addAction(vertical_align_action)
|
||||
|
||||
raise_layer_action = QtWidgets.QAction("Raise one layer", menu)
|
||||
raise_layer_action = QtGui.QAction("Raise one layer", menu)
|
||||
raise_layer_action.setIcon(get_icon("raise_z_value.svg"))
|
||||
raise_layer_action.triggered.connect(self.raiseLayerActionSlot)
|
||||
menu.addAction(raise_layer_action)
|
||||
|
||||
lower_layer_action = QtWidgets.QAction("Lower one layer", menu)
|
||||
lower_layer_action = QtGui.QAction("Lower one layer", menu)
|
||||
lower_layer_action.setIcon(get_icon("lower_z_value.svg"))
|
||||
lower_layer_action.triggered.connect(self.lowerLayerActionSlot)
|
||||
menu.addAction(lower_layer_action)
|
||||
|
||||
if len(items) > 1:
|
||||
lock_action = QtWidgets.QAction("Lock or unlock items", menu)
|
||||
lock_action = QtGui.QAction("Lock or unlock items", menu)
|
||||
lock_action.setIcon(get_icon("lock.svg"))
|
||||
else:
|
||||
item = items[0]
|
||||
if item.flags() & QtWidgets.QGraphicsItem.ItemIsMovable:
|
||||
lock_action = QtWidgets.QAction("Lock item", menu)
|
||||
if item.flags() & QtWidgets.QGraphicsItem.GraphicsItemFlag.ItemIsMovable:
|
||||
lock_action = QtGui.QAction("Lock item", menu)
|
||||
lock_action.setIcon(get_icon("lock.svg"))
|
||||
else:
|
||||
lock_action = QtWidgets.QAction("Unlock item", menu)
|
||||
lock_action = QtGui.QAction("Unlock item", menu)
|
||||
lock_action.setIcon(get_icon("unlock.svg"))
|
||||
lock_action.triggered.connect(self.lockActionSlot)
|
||||
menu.addAction(lock_action)
|
||||
|
||||
delete_action = QtWidgets.QAction("Delete", menu)
|
||||
delete_action = QtGui.QAction("Delete", menu)
|
||||
delete_action.setIcon(get_icon("delete.svg"))
|
||||
delete_action.triggered.connect(self.deleteActionSlot)
|
||||
menu.addAction(delete_action)
|
||||
@@ -1063,7 +1063,7 @@ class GraphicsView(QtWidgets.QGraphicsView):
|
||||
|
||||
for item in self.scene().selectedItems():
|
||||
if isinstance(item, NodeItem) and item.node().initialized():
|
||||
new_hostname, ok = QtWidgets.QInputDialog.getText(self, "Change hostname", "Hostname:", QtWidgets.QLineEdit.Normal, item.node().name())
|
||||
new_hostname, ok = QtWidgets.QInputDialog.getText(self, "Change hostname", "Hostname:", QtWidgets.QLineEdit.EchoMode.Normal, item.node().name())
|
||||
if ok:
|
||||
if not new_hostname.strip():
|
||||
QtWidgets.QMessageBox.critical(self, "Change hostname", "Hostname cannot be blank")
|
||||
@@ -1083,7 +1083,7 @@ class GraphicsView(QtWidgets.QGraphicsView):
|
||||
if items:
|
||||
dialog = SymbolSelectionDialog(self, items)
|
||||
dialog.show()
|
||||
dialog.exec_()
|
||||
dialog.exec()
|
||||
|
||||
def showInFileManagerSlot(self):
|
||||
"""
|
||||
@@ -1105,8 +1105,8 @@ class GraphicsView(QtWidgets.QGraphicsView):
|
||||
QtWidgets.QMessageBox.critical(self, "Show in file manager", "Failed to open {}".format(node_dir))
|
||||
break
|
||||
else:
|
||||
reply = QtWidgets.QMessageBox.information(self, "Show in file manager", "The device directory is located in {} on {}\n\nCopy path to clipboard?".format(node_dir, node.compute().name()), QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No)
|
||||
if reply == QtWidgets.QMessageBox.Yes:
|
||||
reply = QtWidgets.QMessageBox.information(self, "Show in file manager", "The device directory is located in {} on {}\n\nCopy path to clipboard?".format(node_dir, node.compute().name()), QtWidgets.QMessageBox.StandardButton.Yes | QtWidgets.QMessageBox.StandardButton.No)
|
||||
if reply == QtWidgets.QMessageBox.StandardButton.Yes:
|
||||
QtWidgets.QApplication.clipboard().setText(node_dir)
|
||||
break
|
||||
|
||||
@@ -1181,10 +1181,10 @@ class GraphicsView(QtWidgets.QGraphicsView):
|
||||
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)
|
||||
QtWidgets.QMessageBox.StandardButton.Yes,
|
||||
QtWidgets.QMessageBox.StandardButton.No)
|
||||
|
||||
if proceed == QtWidgets.QMessageBox.No:
|
||||
if proceed == QtWidgets.QMessageBox.StandardButton.No:
|
||||
return
|
||||
self.consoleFromItems(items)
|
||||
|
||||
@@ -1310,7 +1310,7 @@ class GraphicsView(QtWidgets.QGraphicsView):
|
||||
continue
|
||||
dialog = FileEditorDialog(item.node(), config_file, parent=self)
|
||||
dialog.show()
|
||||
dialog.exec_()
|
||||
dialog.exec()
|
||||
|
||||
def exportConfigActionSlot(self):
|
||||
"""
|
||||
@@ -1348,7 +1348,7 @@ class GraphicsView(QtWidgets.QGraphicsView):
|
||||
if isinstance(item, NodeItem):
|
||||
dialog = NodeInfoDialog(item.node(), parent=self)
|
||||
dialog.show()
|
||||
dialog.exec_()
|
||||
dialog.exec()
|
||||
|
||||
def bringToFrontSlot(self):
|
||||
"""
|
||||
@@ -1389,7 +1389,7 @@ class GraphicsView(QtWidgets.QGraphicsView):
|
||||
if idlepcs and idlepcs[0] != "0x0":
|
||||
dialog = IdlePCDialog(router, idlepcs, parent=self)
|
||||
dialog.show()
|
||||
dialog.exec_()
|
||||
dialog.exec()
|
||||
else:
|
||||
QtWidgets.QMessageBox.critical(self, "Idle-PC", "Sorry no Idle-PC values could be computed, please check again with Cisco IOS in a different state")
|
||||
|
||||
@@ -1472,7 +1472,7 @@ class GraphicsView(QtWidgets.QGraphicsView):
|
||||
if items:
|
||||
style_dialog = StyleEditorDialog(self._main_window, items)
|
||||
style_dialog.show()
|
||||
style_dialog.exec_()
|
||||
style_dialog.exec()
|
||||
|
||||
def textEditActionSlot(self):
|
||||
"""
|
||||
@@ -1487,7 +1487,7 @@ class GraphicsView(QtWidgets.QGraphicsView):
|
||||
if items:
|
||||
text_edit_dialog = TextEditorDialog(self._main_window, items)
|
||||
text_edit_dialog.show()
|
||||
text_edit_dialog.exec_()
|
||||
text_edit_dialog.exec()
|
||||
|
||||
def resetLabelPositionActionSlot(self):
|
||||
"""
|
||||
@@ -1545,7 +1545,7 @@ class GraphicsView(QtWidgets.QGraphicsView):
|
||||
|
||||
for item in self.scene().selectedItems():
|
||||
if item.parentItem() is None:
|
||||
if not (item.flags() & QtWidgets.QGraphicsItem.ItemIsMovable):
|
||||
if not (item.flags() & QtWidgets.QGraphicsItem.GraphicsItemFlag.ItemIsMovable):
|
||||
log.error("Cannot move object to a upper layer because it is locked")
|
||||
continue
|
||||
item.setZValue(item.zValue() + 1)
|
||||
@@ -1560,7 +1560,7 @@ class GraphicsView(QtWidgets.QGraphicsView):
|
||||
|
||||
for item in self.scene().selectedItems():
|
||||
if item.parentItem() is None:
|
||||
if not (item.flags() & QtWidgets.QGraphicsItem.ItemIsMovable):
|
||||
if not (item.flags() & QtWidgets.QGraphicsItem.GraphicsItemFlag.ItemIsMovable):
|
||||
log.error("Cannot move object to a lower layer because it is locked")
|
||||
continue
|
||||
item.setZValue(item.zValue() - 1)
|
||||
@@ -1606,8 +1606,8 @@ class GraphicsView(QtWidgets.QGraphicsView):
|
||||
else:
|
||||
question = "Do you want to permanently delete {}?".format(selected_nodes[0].name())
|
||||
reply = QtWidgets.QMessageBox.question(self, "Delete", question,
|
||||
QtWidgets.QMessageBox.Yes, QtWidgets.QMessageBox.No)
|
||||
if reply == QtWidgets.QMessageBox.No:
|
||||
QtWidgets.QMessageBox.StandardButton.Yes, QtWidgets.QMessageBox.StandardButton.No)
|
||||
if reply == QtWidgets.QMessageBox.StandardButton.No:
|
||||
return
|
||||
for item in self.scene().selectedItems():
|
||||
if isinstance(item, NodeItem):
|
||||
@@ -1643,7 +1643,7 @@ class GraphicsView(QtWidgets.QGraphicsView):
|
||||
"""
|
||||
Ask the server to create a node using this template
|
||||
"""
|
||||
pos = self.mapToScene(pos)
|
||||
pos = self.mapToScene(pos.toPoint())
|
||||
return TemplateManager().instance().createNodeFromTemplateId(self._topology.project(), template_id, pos.x(), pos.y())
|
||||
|
||||
def createNodeItem(self, node, symbol, x, y):
|
||||
@@ -1674,15 +1674,15 @@ class GraphicsView(QtWidgets.QGraphicsView):
|
||||
def createDrawingItem(self, type, x, y, z, locked=False, rotation=0, svg=None, drawing_id=None):
|
||||
|
||||
if type == "ellipse":
|
||||
item = EllipseItem(pos=QtCore.QPoint(x, y), z=z, locked=locked, rotation=rotation, project=self._topology.project(), drawing_id=drawing_id, svg=svg)
|
||||
item = EllipseItem(pos=QtCore.QPointF(x, y), z=z, locked=locked, rotation=rotation, project=self._topology.project(), drawing_id=drawing_id, svg=svg)
|
||||
elif type == "rect":
|
||||
item = RectangleItem(pos=QtCore.QPoint(x, y), z=z, locked=locked, rotation=rotation, project=self._topology.project(), drawing_id=drawing_id, svg=svg)
|
||||
item = RectangleItem(pos=QtCore.QPointF(x, y), z=z, locked=locked, rotation=rotation, project=self._topology.project(), drawing_id=drawing_id, svg=svg)
|
||||
elif type == "line":
|
||||
item = LineItem(pos=QtCore.QPoint(x, y), dst=QtCore.QPoint(200, 0), z=z, locked=locked, rotation=rotation, project=self._topology.project(), drawing_id=drawing_id, svg=svg)
|
||||
item = LineItem(pos=QtCore.QPointF(x, y), dst=QtCore.QPoint(200, 0), z=z, locked=locked, rotation=rotation, project=self._topology.project(), drawing_id=drawing_id, svg=svg)
|
||||
elif type == "image":
|
||||
item = ImageItem(pos=QtCore.QPoint(x, y), z=z, rotation=rotation, locked=locked, project=self._topology.project(), drawing_id=drawing_id, svg=svg)
|
||||
item = ImageItem(pos=QtCore.QPointF(x, y), z=z, rotation=rotation, locked=locked, project=self._topology.project(), drawing_id=drawing_id, svg=svg)
|
||||
elif type == "text":
|
||||
item = TextItem(pos=QtCore.QPoint(x, y), z=z, rotation=rotation, locked=locked, project=self._topology.project(), drawing_id=drawing_id, svg=svg)
|
||||
item = TextItem(pos=QtCore.QPointF(x, y), z=z, rotation=rotation, locked=locked, project=self._topology.project(), drawing_id=drawing_id, svg=svg)
|
||||
|
||||
if drawing_id is None:
|
||||
item.create()
|
||||
|
||||
@@ -379,24 +379,24 @@ class HTTPClient(QtCore.QObject):
|
||||
data = QtCore.QByteArray(body.encode())
|
||||
body = QtCore.QBuffer(self)
|
||||
body.setData(data)
|
||||
body.open(QtCore.QIODevice.ReadOnly)
|
||||
request.setHeader(QtNetwork.QNetworkRequest.ContentTypeHeader, "application/json")
|
||||
request.setHeader(QtNetwork.QNetworkRequest.ContentLengthHeader, str(data.size()))
|
||||
body.open(QtCore.QIODeviceBase.OpenModeFlag.ReadOnly)
|
||||
request.setHeader(QtNetwork.QNetworkRequest.KnownHeaders.ContentTypeHeader, "application/json")
|
||||
request.setHeader(QtNetwork.QNetworkRequest.KnownHeaders.ContentLengthHeader, str(data.size()))
|
||||
#request.setRawHeader(b"Content-Length", str(data.size()).encode())
|
||||
return body
|
||||
elif isinstance(body, pathlib.Path):
|
||||
body = QtCore.QFile(str(body), self)
|
||||
body.open(QtCore.QFile.ReadOnly)
|
||||
request.setHeader(QtNetwork.QNetworkRequest.ContentTypeHeader, "application/octet-stream")
|
||||
request.setHeader(QtNetwork.QNetworkRequest.ContentLengthHeader, str(body.size()))
|
||||
body.open(QtCore.QIODeviceBase.OpenModeFlag.ReadOnly)
|
||||
request.setHeader(QtNetwork.QNetworkRequest.KnownHeaders.ContentTypeHeader, "application/octet-stream")
|
||||
request.setHeader(QtNetwork.QNetworkRequest.KnownHeaders.ContentLengthHeader, str(body.size()))
|
||||
#request.setRawHeader(b"Content-Length", str(body.size()).encode())
|
||||
return body
|
||||
elif isinstance(body, str):
|
||||
data = QtCore.QByteArray(body.encode())
|
||||
body = QtCore.QBuffer(self)
|
||||
body.setData(data)
|
||||
body.open(QtCore.QIODevice.ReadOnly)
|
||||
request.setHeader(QtNetwork.QNetworkRequest.ContentTypeHeader, "application/octet-stream")
|
||||
body.open(QtCore.QIODeviceBase.OpenModeFlag.ReadOnly)
|
||||
request.setHeader(QtNetwork.QNetworkRequest.KnownHeaders.ContentTypeHeader, "application/octet-stream")
|
||||
#request.setRawHeader(b"Content-Length", str(data.size()).encode())
|
||||
return body
|
||||
else:
|
||||
@@ -468,18 +468,18 @@ class HTTPClient(QtCore.QObject):
|
||||
JSON, we keep it for the next packet
|
||||
"""
|
||||
|
||||
if reply.error() != QtNetwork.QNetworkReply.NoError:
|
||||
if reply.error() != QtNetwork.QNetworkReply.NetworkError.NoError:
|
||||
return
|
||||
|
||||
# HTTP error
|
||||
status = reply.attribute(QtNetwork.QNetworkRequest.HttpStatusCodeAttribute)
|
||||
status = reply.attribute(QtNetwork.QNetworkRequest.Attribute.HttpStatusCodeAttribute)
|
||||
if status >= 300:
|
||||
return
|
||||
|
||||
content = bytes(reply.readAll())
|
||||
if not content:
|
||||
return
|
||||
content_type = reply.header(QtNetwork.QNetworkRequest.ContentTypeHeader)
|
||||
content_type = reply.header(QtNetwork.QNetworkRequest.KnownHeaders.ContentTypeHeader)
|
||||
if content_type == "application/json":
|
||||
content = content.decode("utf-8")
|
||||
if context["query_id"] in self._buffer:
|
||||
@@ -502,7 +502,7 @@ class HTTPClient(QtCore.QObject):
|
||||
|
||||
# We check if we received HTTP headers
|
||||
if not sip.isdeleted(reply) and reply.isRunning() and not len(reply.rawHeaderList()) > 0:
|
||||
if not reply.error() != QtNetwork.QNetworkReply.NoError:
|
||||
if not reply.error() != QtNetwork.QNetworkReply.NetworkError.NoError:
|
||||
log.warning(f"Timeout after {timeout} seconds for request {reply.url().toString()}. \
|
||||
Please check the connection is not blocked by a firewall or an anti-virus.")
|
||||
reply.abort()
|
||||
@@ -874,16 +874,16 @@ class HTTPClient(QtCore.QObject):
|
||||
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)
|
||||
msgbox.setSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Expanding)
|
||||
connect_button = QtWidgets.QPushButton(f"&Connect to {url.host()}:{url.port()}", msgbox)
|
||||
msgbox.addButton(connect_button, QtWidgets.QMessageBox.YesRole)
|
||||
msgbox.addButton(connect_button, QtWidgets.QMessageBox.ButtonRole.YesRole)
|
||||
checkbox = QtWidgets.QCheckBox("Accept insecure certificate for future connections", parent=msgbox)
|
||||
msgbox.setCheckBox(checkbox)
|
||||
abort_button = QtWidgets.QPushButton("&Abort", msgbox)
|
||||
msgbox.addButton(abort_button, QtWidgets.QMessageBox.RejectRole)
|
||||
msgbox.addButton(abort_button, QtWidgets.QMessageBox.ButtonRole.RejectRole)
|
||||
msgbox.setDefaultButton(abort_button)
|
||||
msgbox.setIcon(QtWidgets.QMessageBox.Critical)
|
||||
msgbox.exec_()
|
||||
msgbox.setIcon(QtWidgets.QMessageBox.Icon.Critical)
|
||||
msgbox.exec()
|
||||
|
||||
if msgbox.clickedButton() == connect_button:
|
||||
self._ssl_exceptions[host_port_key] = digest
|
||||
|
||||
@@ -93,9 +93,9 @@ class ImageManager:
|
||||
reply = QtWidgets.QMessageBox.question(parent,
|
||||
'Image',
|
||||
'Would you like to copy {} to the default images directory'.format(source_filename),
|
||||
QtWidgets.QMessageBox.Yes,
|
||||
QtWidgets.QMessageBox.No)
|
||||
if reply == QtWidgets.QMessageBox.Yes:
|
||||
QtWidgets.QMessageBox.StandardButton.Yes,
|
||||
QtWidgets.QMessageBox.StandardButton.No)
|
||||
if reply == QtWidgets.QMessageBox.StandardButton.Yes:
|
||||
try:
|
||||
os.makedirs(destination_directory, exist_ok=True)
|
||||
except OSError as e:
|
||||
@@ -105,7 +105,7 @@ class ImageManager:
|
||||
worker = FileCopyWorker(source_path, destination_path)
|
||||
progress_dialog = ProgressDialog(worker, 'Image', 'Copying {}'.format(source_filename), 'Cancel', busy=True, parent=parent)
|
||||
progress_dialog.show()
|
||||
progress_dialog.exec_()
|
||||
progress_dialog.exec()
|
||||
errors = progress_dialog.errors()
|
||||
if errors:
|
||||
QtWidgets.QMessageBox.critical(parent, 'Image', '{}'.format(''.join(errors)))
|
||||
|
||||
@@ -27,12 +27,12 @@ log = logging.getLogger(__name__)
|
||||
class DrawingItem:
|
||||
# Map QT stroke to SVG style
|
||||
QT_DASH_TO_SVG = {
|
||||
QtCore.Qt.SolidLine: "none",
|
||||
QtCore.Qt.NoPen: None,
|
||||
QtCore.Qt.DashLine: "25, 25",
|
||||
QtCore.Qt.DotLine: "5, 25",
|
||||
QtCore.Qt.DashDotLine: "5, 25, 25",
|
||||
QtCore.Qt.DashDotDotLine: "25, 25, 5, 25, 5"
|
||||
QtCore.Qt.PenStyle.SolidLine: "none",
|
||||
QtCore.Qt.PenStyle.NoPen: None,
|
||||
QtCore.Qt.PenStyle.DashLine: "25, 25",
|
||||
QtCore.Qt.PenStyle.DotLine: "5, 25",
|
||||
QtCore.Qt.PenStyle.DashDotLine: "5, 25, 25",
|
||||
QtCore.Qt.PenStyle.DashDotDotLine: "25, 25, 5, 25, 5"
|
||||
}
|
||||
|
||||
show_layer = False
|
||||
@@ -48,7 +48,7 @@ class DrawingItem:
|
||||
self._locked = locked
|
||||
if self._id is None:
|
||||
self._id = str(uuid.uuid4())
|
||||
self.setFlags(QtWidgets.QGraphicsItem.ItemIsMovable | QtWidgets.QGraphicsItem.ItemIsFocusable | QtWidgets.QGraphicsItem.ItemIsSelectable | QtWidgets.QGraphicsItem.ItemSendsGeometryChanges)
|
||||
self.setFlags(QtWidgets.QGraphicsItem.GraphicsItemFlag.ItemIsMovable | QtWidgets.QGraphicsItem.GraphicsItemFlag.ItemIsFocusable | QtWidgets.QGraphicsItem.GraphicsItemFlag.ItemIsSelectable | QtWidgets.QGraphicsItem.GraphicsItemFlag.ItemSendsGeometryChanges)
|
||||
|
||||
from ..main_window import MainWindow
|
||||
self._graphics_view = MainWindow.instance().uiGraphicsView
|
||||
@@ -57,7 +57,7 @@ class DrawingItem:
|
||||
self._project = project
|
||||
|
||||
# Store a hash of the SVG to avoid him
|
||||
# to be send if he doesn't change
|
||||
# to be sent if he doesn't change
|
||||
self._hash_svg = None
|
||||
|
||||
if pos:
|
||||
@@ -108,7 +108,7 @@ class DrawingItem:
|
||||
if error:
|
||||
log.error("Error while updating drawing: {}".format(result["message"]))
|
||||
return False
|
||||
self.setPos(QtCore.QPoint(result["x"], result["y"]))
|
||||
self.setPos(QtCore.QPointF(result["x"], result["y"]))
|
||||
self.setZValue(result["z"])
|
||||
self.setLocked(result["locked"])
|
||||
self.setRotation(result["rotation"])
|
||||
@@ -124,19 +124,19 @@ class DrawingItem:
|
||||
"""
|
||||
key = event.key()
|
||||
modifiers = event.modifiers()
|
||||
if key in (QtCore.Qt.Key_P, QtCore.Qt.Key_Plus, QtCore.Qt.Key_Equal) and modifiers & QtCore.Qt.AltModifier \
|
||||
or key == QtCore.Qt.Key_Plus and modifiers & QtCore.Qt.AltModifier and modifiers & QtCore.Qt.KeypadModifier:
|
||||
if key in (QtCore.Qt.Key.Key_P, QtCore.Qt.Key.Key_Plus, QtCore.Qt.Key.Key_Equal) and modifiers & QtCore.Qt.KeyboardModifier.AltModifier \
|
||||
or key == QtCore.Qt.Key.Key_Plus and modifiers & QtCore.Qt.KeyboardModifier.AltModifier and modifiers & QtCore.Qt.KeyboardModifier.KeypadModifier:
|
||||
if self.rotation() == 0:
|
||||
self.setRotation(359)
|
||||
else:
|
||||
self.setRotation(self.rotation() - 1)
|
||||
return True
|
||||
elif key in (QtCore.Qt.Key_M, QtCore.Qt.Key_Minus) and modifiers & QtCore.Qt.AltModifier \
|
||||
or key == QtCore.Qt.Key_Minus and modifiers & QtCore.Qt.AltModifier and modifiers & QtCore.Qt.KeypadModifier:
|
||||
elif key in (QtCore.Qt.Key.Key_M, QtCore.Qt.Key.Key_Minus) and modifiers & QtCore.Qt.KeyboardModifier.AltModifier \
|
||||
or key == QtCore.Qt.Key.Key_Minus and modifiers & QtCore.Qt.KeyboardModifier.AltModifier and modifiers & QtCore.Qt.KeyboardModifier.KeypadModifier:
|
||||
if self.rotation() < 360.0:
|
||||
self.setRotation(self.rotation() + 1)
|
||||
return True
|
||||
elif modifiers & QtCore.Qt.AltModifier:
|
||||
elif modifiers & QtCore.Qt.KeyboardModifier.AltModifier:
|
||||
self._allow_snap_to_grid = False
|
||||
return True
|
||||
return False
|
||||
@@ -191,9 +191,9 @@ class DrawingItem:
|
||||
"""
|
||||
|
||||
if locked is True:
|
||||
self.setFlag(self.ItemIsMovable, False)
|
||||
self.setFlag(QtWidgets.QGraphicsItem.GraphicsItemFlag.ItemIsMovable, False)
|
||||
else:
|
||||
self.setFlag(self.ItemIsMovable, True)
|
||||
self.setFlag(QtWidgets.QGraphicsItem.GraphicsItemFlag.ItemIsMovable, True)
|
||||
self._locked = locked
|
||||
|
||||
def deleting(self):
|
||||
@@ -226,13 +226,13 @@ class DrawingItem:
|
||||
|
||||
def itemChange(self, change, value):
|
||||
|
||||
if change == QtWidgets.QGraphicsItem.ItemPositionChange and self._main_window.uiSnapToGridAction.isChecked() \
|
||||
if change == QtWidgets.QGraphicsItem.GraphicsItemChange.ItemPositionChange and self._main_window.uiSnapToGridAction.isChecked() \
|
||||
and self._allow_snap_to_grid:
|
||||
grid_size = self._graphics_view.drawingGridSize()
|
||||
value.setX(grid_size * round(value.x() / grid_size))
|
||||
value.setY(grid_size * round(value.y() / grid_size))
|
||||
|
||||
if change == QtWidgets.QGraphicsItem.ItemSelectedChange:
|
||||
if change == QtWidgets.QGraphicsItem.GraphicsItemChange.ItemSelectedChange:
|
||||
if not value:
|
||||
self.updateDrawing()
|
||||
return QtWidgets.QGraphicsItem.itemChange(self, change, value)
|
||||
@@ -256,10 +256,10 @@ class DrawingItem:
|
||||
return
|
||||
|
||||
center = self.mapFromItem(self, brect.width() / 2.0, brect.height() / 2.0)
|
||||
painter.setBrush(QtCore.Qt.red)
|
||||
painter.setPen(QtCore.Qt.red)
|
||||
painter.setBrush(QtCore.Qt.GlobalColor.red)
|
||||
painter.setPen(QtCore.Qt.GlobalColor.red)
|
||||
painter.drawRect(QtCore.QRectF((brect.width() / 2.0) - 10, (brect.height() / 2.0) - 10, 20, 20))
|
||||
painter.setPen(QtCore.Qt.black)
|
||||
painter.setPen(QtCore.Qt.GlobalColor.black)
|
||||
zval = str(int(self.zValue()))
|
||||
painter.drawText(QtCore.QPointF(center.x() - 4, center.y() + 4), zval)
|
||||
|
||||
@@ -298,9 +298,9 @@ class DrawingItem:
|
||||
pen.setColor(colorFromSvg(svg.get("stroke")))
|
||||
# Map SVG stroke style (border of the element to the Qt version)
|
||||
if not svg.get("stroke"):
|
||||
pen.setStyle(QtCore.Qt.NoPen)
|
||||
pen.setStyle(QtCore.Qt.PenStyle.NoPen)
|
||||
else:
|
||||
pen.setStyle(QtCore.Qt.SolidLine)
|
||||
pen.setStyle(QtCore.Qt.PenStyle.SolidLine)
|
||||
stroke = svg.get("stroke-dasharray")
|
||||
if stroke:
|
||||
for (qt_stroke, svg_stroke) in self.QT_DASH_TO_SVG.items():
|
||||
|
||||
@@ -54,14 +54,14 @@ class EthernetLinkItem(LinkItem):
|
||||
|
||||
try:
|
||||
if self._hovered:
|
||||
self.setPen(QtGui.QPen(QtCore.Qt.red, self._link._link_style["width"] + 1, QtCore.Qt.SolidLine, QtCore.Qt.RoundCap, QtCore.Qt.RoundJoin))
|
||||
self.setPen(QtGui.QPen(QtCore.Qt.GlobalColor.red, self._link._link_style["width"] + 1, QtCore.Qt.PenStyle.SolidLine, QtCore.Qt.PenCapStyle.RoundCap, QtCore.Qt.PenJoinStyle.RoundJoin))
|
||||
else:
|
||||
self.setPen(QtGui.QPen(QtGui.QColor(self._link._link_style["color"]), self._link._link_style["width"], self._link._link_style["type"], QtCore.Qt.RoundCap, QtCore.Qt.RoundJoin))
|
||||
self.setPen(QtGui.QPen(QtGui.QColor(self._link._link_style["color"]), self._link._link_style["width"], self._link._link_style["type"], QtCore.Qt.PenCapStyle.RoundCap, QtCore.Qt.PenJoinStyle.RoundJoin))
|
||||
except:
|
||||
if self._hovered:
|
||||
self.setPen(QtGui.QPen(QtCore.Qt.red, self._pen_width + 1, QtCore.Qt.SolidLine, QtCore.Qt.RoundCap, QtCore.Qt.RoundJoin))
|
||||
self.setPen(QtGui.QPen(QtCore.Qt.GlobalColor.red, self._pen_width + 1, QtCore.Qt.PenStyle.SolidLine, QtCore.Qt.PenCapStyle.RoundCap, QtCore.Qt.PenJoinStyle.RoundJoin))
|
||||
else:
|
||||
self.setPen(QtGui.QPen(QtGui.QColor("#000000"), self._pen_width, QtCore.Qt.SolidLine, QtCore.Qt.RoundCap, QtCore.Qt.RoundJoin))
|
||||
self.setPen(QtGui.QPen(QtGui.QColor("#000000"), self._pen_width, QtCore.Qt.PenStyle.SolidLine, QtCore.Qt.PenCapStyle.RoundCap, QtCore.Qt.PenJoinStyle.RoundJoin))
|
||||
|
||||
# draw a line between nodes
|
||||
path = QtGui.QPainterPath(self.source)
|
||||
@@ -121,17 +121,17 @@ class EthernetLinkItem(LinkItem):
|
||||
|
||||
if self._link.suspended() or self._source_port.status() == Port.suspended:
|
||||
# link or port is suspended
|
||||
color = QtCore.Qt.yellow
|
||||
shape = QtCore.Qt.RoundCap
|
||||
color = QtCore.Qt.GlobalColor.yellow
|
||||
shape = QtCore.Qt.PenCapStyle.RoundCap
|
||||
elif self._source_port.status() == Port.started:
|
||||
# port is active
|
||||
color = QtCore.Qt.green
|
||||
shape = QtCore.Qt.RoundCap
|
||||
color = QtCore.Qt.GlobalColor.green
|
||||
shape = QtCore.Qt.PenCapStyle.RoundCap
|
||||
else:
|
||||
color = QtCore.Qt.red
|
||||
shape = QtCore.Qt.SquareCap
|
||||
color = QtCore.Qt.GlobalColor.red
|
||||
shape = QtCore.Qt.PenCapStyle.SquareCap
|
||||
|
||||
painter.setPen(QtGui.QPen(color, self._point_size, QtCore.Qt.SolidLine, shape, QtCore.Qt.MiterJoin))
|
||||
painter.setPen(QtGui.QPen(color, self._point_size, QtCore.Qt.PenStyle.SolidLine, shape, QtCore.Qt.PenJoinStyle.MiterJoin))
|
||||
point1 = QtCore.QPointF(self.source + self.edge_offset) + QtCore.QPointF((self.dx * self._source_collision_offset) / self.length, (self.dy * self._source_collision_offset) / self.length)
|
||||
|
||||
# avoid any collision of the status point with the source node
|
||||
@@ -154,27 +154,27 @@ 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.setFlag(QtWidgets.QGraphicsItem.GraphicsItemFlag.ItemIsMovable, not self._source_item.locked())
|
||||
source_port_label.show()
|
||||
else:
|
||||
source_port_label.hide()
|
||||
|
||||
if self._settings["draw_link_status_points"] and self.pen().style() != QtCore.Qt.NoPen:
|
||||
if self._settings["draw_link_status_points"] and self.pen().style() != QtCore.Qt.PenStyle.NoPen:
|
||||
painter.drawPoint(point1)
|
||||
|
||||
if self._link.suspended() or self._destination_port.status() == Port.suspended:
|
||||
# link or port is suspended
|
||||
color = QtCore.Qt.yellow
|
||||
shape = QtCore.Qt.RoundCap
|
||||
color = QtCore.Qt.GlobalColor.yellow
|
||||
shape = QtCore.Qt.PenCapStyle.RoundCap
|
||||
elif self._destination_port.status() == Port.started:
|
||||
# port is active
|
||||
color = QtCore.Qt.green
|
||||
shape = QtCore.Qt.RoundCap
|
||||
color = QtCore.Qt.GlobalColor.green
|
||||
shape = QtCore.Qt.PenCapStyle.RoundCap
|
||||
else:
|
||||
color = QtCore.Qt.red
|
||||
shape = QtCore.Qt.SquareCap
|
||||
color = QtCore.Qt.GlobalColor.red
|
||||
shape = QtCore.Qt.PenCapStyle.SquareCap
|
||||
|
||||
painter.setPen(QtGui.QPen(color, self._point_size, QtCore.Qt.SolidLine, shape, QtCore.Qt.MiterJoin))
|
||||
painter.setPen(QtGui.QPen(color, self._point_size, QtCore.Qt.PenStyle.SolidLine, shape, QtCore.Qt.PenJoinStyle.MiterJoin))
|
||||
point2 = QtCore.QPointF(self.destination - self.edge_offset) - QtCore.QPointF((self.dx * self._destination_collision_offset) / self.length, (self.dy * self._destination_collision_offset) / self.length)
|
||||
|
||||
# avoid any collision of the status point with the destination node
|
||||
@@ -197,12 +197,12 @@ 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.setFlag(QtWidgets.QGraphicsItem.GraphicsItemFlag.ItemIsMovable, not self._destination_item.locked())
|
||||
destination_port_label.show()
|
||||
else:
|
||||
destination_port_label.hide()
|
||||
|
||||
if self._settings["draw_link_status_points"] and self.pen().style() != QtCore.Qt.NoPen:
|
||||
if self._settings["draw_link_status_points"] and self.pen().style() != QtCore.Qt.PenStyle.NoPen:
|
||||
painter.drawPoint(point2)
|
||||
|
||||
self._drawSymbol()
|
||||
|
||||
@@ -19,12 +19,12 @@
|
||||
Graphical representation of an image on the QGraphicsScene.
|
||||
"""
|
||||
|
||||
from ..qt import QtSvg
|
||||
from ..qt import QtSvgWidgets
|
||||
from ..qt.qimage_svg_renderer import QImageSvgRenderer
|
||||
from .drawing_item import DrawingItem
|
||||
|
||||
|
||||
class ImageItem(QtSvg.QGraphicsSvgItem, DrawingItem):
|
||||
class ImageItem(QtSvgWidgets.QGraphicsSvgItem, DrawingItem):
|
||||
|
||||
"""
|
||||
Class to insert an image on the scene.
|
||||
|
||||
@@ -42,7 +42,7 @@ class LabelItem(QtWidgets.QGraphicsTextItem):
|
||||
qt_font.fromString(view_settings["default_label_font"])
|
||||
self.setDefaultTextColor(QtGui.QColor(view_settings["default_label_color"]))
|
||||
self.setFont(qt_font)
|
||||
self.setFlags(QtWidgets.QGraphicsItem.ItemIsMovable | QtWidgets.QGraphicsItem.ItemIsSelectable)
|
||||
self.setFlags(QtWidgets.QGraphicsItem.GraphicsItemFlag.ItemIsMovable | QtWidgets.QGraphicsItem.GraphicsItemFlag.ItemIsSelectable)
|
||||
self.setZValue(2)
|
||||
self._editable = True
|
||||
|
||||
@@ -91,12 +91,12 @@ class LabelItem(QtWidgets.QGraphicsTextItem):
|
||||
|
||||
key = event.key()
|
||||
modifiers = event.modifiers()
|
||||
if key in (QtCore.Qt.Key_P, QtCore.Qt.Key_Plus, QtCore.Qt.Key_Equal) and modifiers & QtCore.Qt.AltModifier \
|
||||
or key == QtCore.Qt.Key_Plus and modifiers & QtCore.Qt.AltModifier and modifiers & QtCore.Qt.KeypadModifier:
|
||||
if key in (QtCore.Qt.Key.Key_P, QtCore.Qt.Key.Key_Plus, QtCore.Qt.Key.Key_Equal) and modifiers & QtCore.Qt.KeyboardModifier.AltModifier \
|
||||
or key == QtCore.Qt.Key.Key_Plus and modifiers & QtCore.Qt.KeyboardModifier.AltModifier and modifiers & QtCore.Qt.KeyboardModifier.KeypadModifier:
|
||||
if self.rotation() > -360.0:
|
||||
self.setRotation(self.rotation() - 1)
|
||||
elif key in (QtCore.Qt.Key_M, QtCore.Qt.Key_Minus) and modifiers & QtCore.Qt.AltModifier \
|
||||
or key == QtCore.Qt.Key_Minus and modifiers & QtCore.Qt.AltModifier and modifiers & QtCore.Qt.KeypadModifier:
|
||||
elif key in (QtCore.Qt.Key.Key_M, QtCore.Qt.Key.Key_Minus) and modifiers & QtCore.Qt.KeyboardModifier.AltModifier \
|
||||
or key == QtCore.Qt.Key.Key_Minus and modifiers & QtCore.Qt.KeyboardModifier.AltModifier and modifiers & QtCore.Qt.KeyboardModifier.KeypadModifier:
|
||||
if self.rotation() < 360.0:
|
||||
self.setRotation(self.rotation() + 1)
|
||||
else:
|
||||
@@ -107,11 +107,11 @@ class LabelItem(QtWidgets.QGraphicsTextItem):
|
||||
Edit mode for this note.
|
||||
"""
|
||||
|
||||
self.setTextInteractionFlags(QtCore.Qt.TextEditorInteraction)
|
||||
self.setTextInteractionFlags(QtCore.Qt.TextInteractionFlag.TextEditorInteraction)
|
||||
self.setSelected(True)
|
||||
self.setFocus()
|
||||
cursor = self.textCursor()
|
||||
cursor.select(QtGui.QTextCursor.Document)
|
||||
cursor.select(QtGui.QTextCursor.SelectionType.Document)
|
||||
self.setTextCursor(cursor)
|
||||
|
||||
def mouseDoubleClickEvent(self, event):
|
||||
@@ -131,12 +131,12 @@ class LabelItem(QtWidgets.QGraphicsTextItem):
|
||||
:param event: QFocusEvent instance
|
||||
"""
|
||||
|
||||
self.setFlag(QtWidgets.QGraphicsItem.ItemIsFocusable, False)
|
||||
self.setFlag(QtWidgets.QGraphicsItem.GraphicsItemFlag.ItemIsFocusable, False)
|
||||
cursor = self.textCursor()
|
||||
if cursor.hasSelection():
|
||||
cursor.clearSelection()
|
||||
self.setTextCursor(cursor)
|
||||
self.setTextInteractionFlags(QtCore.Qt.NoTextInteraction)
|
||||
self.setTextInteractionFlags(QtCore.Qt.TextInteractionFlag.NoTextInteraction)
|
||||
if not self.toPlainText():
|
||||
# delete the note if empty
|
||||
self.delete()
|
||||
@@ -163,10 +163,10 @@ class LabelItem(QtWidgets.QGraphicsTextItem):
|
||||
return
|
||||
|
||||
center = self.mapFromItem(self, brect.width() / 2.0, brect.height() / 2.0)
|
||||
painter.setBrush(QtCore.Qt.red)
|
||||
painter.setPen(QtCore.Qt.red)
|
||||
painter.setBrush(QtCore.Qt.GlobalColor.red)
|
||||
painter.setPen(QtCore.Qt.GlobalColor.red)
|
||||
painter.drawRect(QtCore.QRectF((brect.width() / 2.0) - 10, (brect.height() / 2.0) - 10, 20, 20))
|
||||
painter.setPen(QtCore.Qt.black)
|
||||
painter.setPen(QtCore.Qt.GlobalColor.black)
|
||||
zval = str(int(self.zValue()))
|
||||
painter.drawText(QtCore.QPointF(center.x(), center.y()), zval)
|
||||
|
||||
@@ -213,7 +213,7 @@ class LabelItem(QtWidgets.QGraphicsTextItem):
|
||||
:param change: GraphicsItemChange type
|
||||
:param value: value of the change
|
||||
"""
|
||||
if change == QtWidgets.QGraphicsItem.ItemSelectedChange:
|
||||
if change == QtWidgets.QGraphicsItem.GraphicsItemChange.ItemSelectedChange:
|
||||
if value == 0:
|
||||
self.item_unselected_signal.emit()
|
||||
return super().itemChange(change, value)
|
||||
|
||||
@@ -44,7 +44,7 @@ class LineItem(QtWidgets.QGraphicsLineItem, DrawingItem):
|
||||
0,
|
||||
dst.x(),
|
||||
dst.y())
|
||||
pen = QtGui.QPen(QtCore.Qt.black, 2, QtCore.Qt.SolidLine, QtCore.Qt.RoundCap, QtCore.Qt.RoundJoin)
|
||||
pen = QtGui.QPen(QtCore.Qt.GlobalColor.black, 2, QtCore.Qt.PenStyle.SolidLine, QtCore.Qt.PenCapStyle.RoundCap, QtCore.Qt.PenJoinStyle.RoundJoin)
|
||||
self.setPen(pen)
|
||||
else:
|
||||
self.fromSvg(svg)
|
||||
@@ -124,19 +124,19 @@ class LineItem(QtWidgets.QGraphicsLineItem, DrawingItem):
|
||||
|
||||
if self._isHorizontalLine():
|
||||
if event.pos().x() > (self.line().x2() - self._border):
|
||||
self._graphics_view.setCursor(QtCore.Qt.SizeHorCursor)
|
||||
self._graphics_view.setCursor(QtCore.Qt.CursorShape.SizeHorCursor)
|
||||
elif event.pos().x() < self._border:
|
||||
self._graphics_view.setCursor(QtCore.Qt.SizeHorCursor)
|
||||
self._graphics_view.setCursor(QtCore.Qt.CursorShape.SizeHorCursor)
|
||||
else:
|
||||
self._graphics_view.setCursor(QtCore.Qt.SizeAllCursor)
|
||||
self._graphics_view.setCursor(QtCore.Qt.CursorShape.SizeAllCursor)
|
||||
# Vertical line
|
||||
else:
|
||||
if event.pos().y() > (self.line().y2() - self._border):
|
||||
self._graphics_view.setCursor(QtCore.Qt.SizeVerCursor)
|
||||
self._graphics_view.setCursor(QtCore.Qt.CursorShape.SizeVerCursor)
|
||||
elif event.pos().y() < self._border:
|
||||
self._graphics_view.setCursor(QtCore.Qt.SizeVerCursor)
|
||||
self._graphics_view.setCursor(QtCore.Qt.CursorShape.SizeVerCursor)
|
||||
else:
|
||||
self._graphics_view.setCursor(QtCore.Qt.SizeAllCursor)
|
||||
self._graphics_view.setCursor(QtCore.Qt.CursorShape.SizeAllCursor)
|
||||
|
||||
def mouseMoveEvent(self, event):
|
||||
"""
|
||||
@@ -177,17 +177,17 @@ class LineItem(QtWidgets.QGraphicsLineItem, DrawingItem):
|
||||
self.update()
|
||||
if self._isHorizontalLine():
|
||||
if event.pos().x() > (self.line().x2() - self._border):
|
||||
self.setFlag(QtWidgets.QGraphicsItem.ItemIsMovable, False)
|
||||
self.setFlag(QtWidgets.QGraphicsItem.GraphicsItemFlag.ItemIsMovable, False)
|
||||
self._edge = "right"
|
||||
elif event.pos().x() < (self.line().x1() + self._border):
|
||||
self.setFlag(QtWidgets.QGraphicsItem.ItemIsMovable, False)
|
||||
self.setFlag(QtWidgets.QGraphicsItem.GraphicsItemFlag.ItemIsMovable, False)
|
||||
self._edge = "left"
|
||||
else:
|
||||
if event.pos().y() > (self.line().y2() - self._border):
|
||||
self.setFlag(QtWidgets.QGraphicsItem.ItemIsMovable, False)
|
||||
self.setFlag(QtWidgets.QGraphicsItem.GraphicsItemFlag.ItemIsMovable, False)
|
||||
self._edge = "top"
|
||||
elif event.pos().y() < (self.line().y1() + self._border):
|
||||
self.setFlag(QtWidgets.QGraphicsItem.ItemIsMovable, False)
|
||||
self.setFlag(QtWidgets.QGraphicsItem.GraphicsItemFlag.ItemIsMovable, False)
|
||||
self._edge = "bottom"
|
||||
super().mousePressEvent(event)
|
||||
|
||||
@@ -199,7 +199,7 @@ class LineItem(QtWidgets.QGraphicsLineItem, DrawingItem):
|
||||
"""
|
||||
|
||||
self.update()
|
||||
self.setFlag(QtWidgets.QGraphicsItem.ItemIsMovable)
|
||||
self.setFlag(QtWidgets.QGraphicsItem.GraphicsItemFlag.ItemIsMovable)
|
||||
|
||||
self._edge = None
|
||||
super().mouseReleaseEvent(event)
|
||||
@@ -213,4 +213,4 @@ class LineItem(QtWidgets.QGraphicsLineItem, DrawingItem):
|
||||
|
||||
# locked objects don't need cursors
|
||||
if not self.locked():
|
||||
self._graphics_view.setCursor(QtCore.Qt.ArrowCursor)
|
||||
self._graphics_view.setCursor(QtCore.Qt.CursorShape.ArrowCursor)
|
||||
|
||||
@@ -21,7 +21,7 @@ Link items are graphical representation of a link on the QGraphicsScene
|
||||
"""
|
||||
|
||||
import math
|
||||
from ..qt import QtCore, QtGui, QtWidgets, QtSvg, qslot, sip_is_deleted
|
||||
from ..qt import QtCore, QtGui, QtWidgets, QtSvgWidgets, qslot, sip_is_deleted
|
||||
|
||||
from ..packet_capture import PacketCapture
|
||||
from ..dialogs.filter_dialog import FilterDialog
|
||||
@@ -29,11 +29,11 @@ from ..dialogs.style_editor_dialog_link import StyleEditorDialogLink
|
||||
from ..utils.get_icon import get_icon
|
||||
|
||||
|
||||
class SvgIconItem(QtSvg.QGraphicsSvgItem):
|
||||
class SvgIconItem(QtSvgWidgets.QGraphicsSvgItem):
|
||||
|
||||
def __init__(self, symbol, parent):
|
||||
|
||||
QtSvg.QGraphicsSvgItem.__init__(self, symbol, parent)
|
||||
QtSvgWidgets.QGraphicsSvgItem.__init__(self, symbol, parent)
|
||||
|
||||
def mousePressEvent(self, event):
|
||||
|
||||
@@ -56,7 +56,7 @@ class LinkItem(QtWidgets.QGraphicsPathItem):
|
||||
"""
|
||||
|
||||
_draw_port_labels = False
|
||||
delete_link_item_signal = QtCore.pyqtSignal(str)
|
||||
delete_link_item_signal = QtCore.Signal(str)
|
||||
|
||||
def __init__(self, source_item, source_port, destination_item, destination_port, link=None, adding_flag=False):
|
||||
|
||||
@@ -102,7 +102,7 @@ class LinkItem(QtWidgets.QGraphicsPathItem):
|
||||
self._link = link
|
||||
self._link.updated_link_signal.connect(self._drawSymbol)
|
||||
self._link.delete_link_signal.connect(self._linkDeletedSlot)
|
||||
self.setFlag(self.ItemIsFocusable)
|
||||
self.setFlag(QtWidgets.QGraphicsItem.GraphicsItemFlag.ItemIsFocusable)
|
||||
source_item.addLink(self)
|
||||
destination_item.addLink(self)
|
||||
self.setCustomToolTip()
|
||||
@@ -132,7 +132,7 @@ class LinkItem(QtWidgets.QGraphicsPathItem):
|
||||
def _filterActionSlot(self, *args):
|
||||
dialog = FilterDialog(self._main_window, self._link)
|
||||
dialog.show()
|
||||
dialog.exec_()
|
||||
dialog.exec()
|
||||
|
||||
@qslot
|
||||
def _suspendActionSlot(self, *args):
|
||||
@@ -142,7 +142,7 @@ class LinkItem(QtWidgets.QGraphicsPathItem):
|
||||
def _styleActionSlot(self, *args):
|
||||
style_dialog = StyleEditorDialogLink(self, self._main_window)
|
||||
style_dialog.show()
|
||||
style_dialog.exec_()
|
||||
style_dialog.exec()
|
||||
|
||||
def setLinkStyle(self, link_style):
|
||||
self._link._link_style["color"] = link_style["color"]
|
||||
@@ -245,45 +245,45 @@ class LinkItem(QtWidgets.QGraphicsPathItem):
|
||||
|
||||
if not self._link.capturing():
|
||||
# start capture
|
||||
start_capture_action = QtWidgets.QAction("Start capture", menu)
|
||||
start_capture_action = QtGui.QAction("Start capture", menu)
|
||||
start_capture_action.setIcon(get_icon('capture-start.svg'))
|
||||
start_capture_action.triggered.connect(self._startCaptureActionSlot)
|
||||
menu.addAction(start_capture_action)
|
||||
|
||||
if self._link.capturing():
|
||||
# stop capture
|
||||
stop_capture_action = QtWidgets.QAction("Stop capture", menu)
|
||||
stop_capture_action = QtGui.QAction("Stop capture", menu)
|
||||
stop_capture_action.setIcon(get_icon('capture-stop.svg'))
|
||||
stop_capture_action.triggered.connect(self._stopCaptureActionSlot)
|
||||
menu.addAction(stop_capture_action)
|
||||
|
||||
# start wireshark
|
||||
start_wireshark_action = QtWidgets.QAction("Start Wireshark", menu)
|
||||
start_wireshark_action = QtGui.QAction("Start Wireshark", menu)
|
||||
start_wireshark_action.setIcon(QtGui.QIcon(":/icons/wireshark.png"))
|
||||
start_wireshark_action.triggered.connect(self._startWiresharkActionSlot)
|
||||
menu.addAction(start_wireshark_action)
|
||||
|
||||
if PacketCapture.instance().packetAnalyzerAvailable():
|
||||
analyze_action = QtWidgets.QAction("Analyze capture", menu)
|
||||
analyze_action = QtGui.QAction("Analyze capture", menu)
|
||||
analyze_action.setIcon(QtGui.QIcon(':/icons/rtv.png'))
|
||||
analyze_action.triggered.connect(self._analyzeCaptureActionSlot)
|
||||
menu.addAction(analyze_action)
|
||||
|
||||
if self._link.suspended() is False:
|
||||
# Edit filters
|
||||
filter_action = QtWidgets.QAction("Packet filters", menu)
|
||||
filter_action = QtGui.QAction("Packet filters", menu)
|
||||
filter_action.setIcon(get_icon('filter.svg'))
|
||||
filter_action.triggered.connect(self._filterActionSlot)
|
||||
menu.addAction(filter_action)
|
||||
|
||||
# Suspend link
|
||||
suspend_action = QtWidgets.QAction("Suspend", menu)
|
||||
suspend_action = QtGui.QAction("Suspend", menu)
|
||||
suspend_action.setIcon(get_icon('pause.svg'))
|
||||
suspend_action.triggered.connect(self._suspendActionSlot)
|
||||
menu.addAction(suspend_action)
|
||||
else:
|
||||
# Resume link
|
||||
resume_action = QtWidgets.QAction("Resume", menu)
|
||||
resume_action = QtGui.QAction("Resume", menu)
|
||||
resume_action.setIcon(get_icon('start.svg'))
|
||||
resume_action.triggered.connect(self._suspendActionSlot)
|
||||
menu.addAction(resume_action)
|
||||
@@ -295,13 +295,13 @@ class LinkItem(QtWidgets.QGraphicsPathItem):
|
||||
menu.addAction(reset_action)
|
||||
|
||||
# style
|
||||
style_action = QtWidgets.QAction("Style", menu)
|
||||
style_action = QtGui.QAction("Style", menu)
|
||||
style_action.setIcon(get_icon("node_conception.svg"))
|
||||
style_action.triggered.connect(self._styleActionSlot)
|
||||
menu.addAction(style_action)
|
||||
|
||||
# delete
|
||||
delete_action = QtWidgets.QAction("Delete", menu)
|
||||
delete_action = QtGui.QAction("Delete", menu)
|
||||
delete_action.setIcon(get_icon('delete.svg'))
|
||||
delete_action.triggered.connect(self._deleteActionSlot)
|
||||
menu.addAction(delete_action)
|
||||
@@ -314,10 +314,10 @@ class LinkItem(QtWidgets.QGraphicsPathItem):
|
||||
:param: QGraphicsSceneMouseEvent instance
|
||||
"""
|
||||
|
||||
if event.button() == QtCore.Qt.RightButton and self._adding_flag:
|
||||
if event.button() == QtCore.Qt.MouseButton.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)
|
||||
key = QtGui.QKeyEvent(QtCore.QEvent.Type.KeyPress, QtCore.Qt.Key.Key_Escape, QtCore.Qt.KeyboardModifier.NoModifier)
|
||||
QtWidgets.QApplication.sendEvent(MainWindow.instance(), key)
|
||||
return
|
||||
else:
|
||||
@@ -336,7 +336,7 @@ class LinkItem(QtWidgets.QGraphicsPathItem):
|
||||
self.setAcceptHoverEvents(False)
|
||||
menu = QtWidgets.QMenu()
|
||||
self.populateLinkContextualMenu(menu)
|
||||
menu.exec_(QtGui.QCursor.pos())
|
||||
menu.exec(QtGui.QCursor.pos())
|
||||
self.setAcceptHoverEvents(True)
|
||||
self.setHovered(False)
|
||||
|
||||
@@ -348,7 +348,7 @@ class LinkItem(QtWidgets.QGraphicsPathItem):
|
||||
"""
|
||||
|
||||
# On pressing backspace or delete key, the selected link gets deleted
|
||||
if event.key() == QtCore.Qt.Key_Delete or event.key() == QtCore.Qt.Key_Backspace:
|
||||
if event.key() == QtCore.Qt.Key.Key_Delete or event.key() == QtCore.Qt.Key.Key_Backspace:
|
||||
self._deleteActionSlot()
|
||||
return
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
import urllib.parse
|
||||
|
||||
from ..qt import QtCore, QtGui, QtWidgets, QtSvg
|
||||
from ..qt import QtCore, QtGui, QtWidgets, QtSvgWidgets
|
||||
from ..qt.qimage_svg_renderer import QImageSvgRenderer
|
||||
from ..controller import Controller
|
||||
|
||||
@@ -27,7 +27,7 @@ import logging
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class LogoItem(QtSvg.QGraphicsSvgItem):
|
||||
class LogoItem(QtSvgWidgets.QGraphicsSvgItem):
|
||||
"""
|
||||
Margin for the logo
|
||||
"""
|
||||
@@ -60,8 +60,8 @@ class LogoItem(QtSvg.QGraphicsSvgItem):
|
||||
self.graphicsEffect().setEnabled(False)
|
||||
|
||||
# set graphical settings for this item
|
||||
self.setFlag(QtWidgets.QGraphicsItem.ItemIsFocusable)
|
||||
self.setFlag(QtWidgets.QGraphicsItem.ItemSendsGeometryChanges)
|
||||
self.setFlag(QtWidgets.QGraphicsItem.GraphicsItemFlag.ItemIsFocusable)
|
||||
self.setFlag(QtWidgets.QGraphicsItem.GraphicsItemFlag.ItemSendsGeometryChanges)
|
||||
self.setAcceptHoverEvents(True)
|
||||
|
||||
from ..main_window import MainWindow
|
||||
@@ -83,7 +83,7 @@ class LogoItem(QtSvg.QGraphicsSvgItem):
|
||||
self.setZValue(-2)
|
||||
|
||||
def eventFilter(self, source, event):
|
||||
if event.type() == QtCore.QEvent.Paint:
|
||||
if event.type() == QtCore.QEvent.Type.Paint:
|
||||
self.updatePosition()
|
||||
return QtWidgets.QWidget.eventFilter(self, source, event)
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ Graphical representation of a node on the QGraphicsScene.
|
||||
|
||||
from ..qt import sip
|
||||
|
||||
from ..qt import QtCore, QtGui, QtWidgets, QtSvg, qslot
|
||||
from ..qt import QtCore, QtGui, QtWidgets, QtSvgWidgets, qslot
|
||||
from ..qt.qimage_svg_renderer import QImageSvgRenderer
|
||||
from .label_item import LabelItem
|
||||
from ..symbol import Symbol
|
||||
@@ -32,7 +32,7 @@ import logging
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class NodeItem(QtSvg.QGraphicsSvgItem):
|
||||
class NodeItem(QtSvgWidgets.QGraphicsSvgItem):
|
||||
|
||||
"""
|
||||
Node for the scene.
|
||||
@@ -60,7 +60,7 @@ class NodeItem(QtSvg.QGraphicsSvgItem):
|
||||
# node label
|
||||
self._node_label = None
|
||||
|
||||
self.setPos(QtCore.QPoint(self._node.x(), self._node.y()))
|
||||
self.setPos(QtCore.QPointF(self._node.x(), self._node.y()))
|
||||
|
||||
# Temporary symbol during loading
|
||||
renderer = QImageSvgRenderer(":/icons/reload.svg")
|
||||
@@ -74,10 +74,10 @@ class NodeItem(QtSvg.QGraphicsSvgItem):
|
||||
self.graphicsEffect().setEnabled(False)
|
||||
|
||||
# set graphical settings for this node
|
||||
self.setFlag(QtWidgets.QGraphicsItem.ItemIsMovable)
|
||||
self.setFlag(QtWidgets.QGraphicsItem.ItemIsSelectable)
|
||||
self.setFlag(QtWidgets.QGraphicsItem.ItemIsFocusable)
|
||||
self.setFlag(QtWidgets.QGraphicsItem.ItemSendsGeometryChanges)
|
||||
self.setFlag(QtWidgets.QGraphicsItem.GraphicsItemFlag.ItemIsMovable)
|
||||
self.setFlag(QtWidgets.QGraphicsItem.GraphicsItemFlag.ItemIsSelectable)
|
||||
self.setFlag(QtWidgets.QGraphicsItem.GraphicsItemFlag.ItemIsFocusable)
|
||||
self.setFlag(QtWidgets.QGraphicsItem.GraphicsItemFlag.ItemSendsGeometryChanges)
|
||||
self.setAcceptHoverEvents(True)
|
||||
|
||||
# update z value and locked state
|
||||
@@ -223,7 +223,7 @@ class NodeItem(QtSvg.QGraphicsSvgItem):
|
||||
:param base_node_id: base node identifier (integer)
|
||||
"""
|
||||
|
||||
self.setPos(QtCore.QPoint(self._node.x(), self._node.y()))
|
||||
self.setPos(QtCore.QPointF(self._node.x(), self._node.y()))
|
||||
self.setSymbol(self._node.symbol())
|
||||
self.update()
|
||||
|
||||
@@ -384,7 +384,7 @@ class NodeItem(QtSvg.QGraphicsSvgItem):
|
||||
self._node_label.setRotation(label_data.get("rotation", 0))
|
||||
|
||||
if self._node.locked():
|
||||
self._node_label.setFlag(self.ItemIsMovable, False)
|
||||
self._node_label.setFlag(QtWidgets.QGraphicsItem.GraphicsItemFlag.ItemIsMovable, False)
|
||||
|
||||
if label_data["x"] is None:
|
||||
self._centerLabel()
|
||||
@@ -443,7 +443,7 @@ class NodeItem(QtSvg.QGraphicsSvgItem):
|
||||
# add some delay before showing the menu
|
||||
# https://github.com/GNS3/gns3-gui/issues/3169
|
||||
QtCore.QThread.msleep(100)
|
||||
menu.exec_(pos)
|
||||
menu.exec(pos)
|
||||
return self._selected_port
|
||||
|
||||
def selectedPortSlot(self, action):
|
||||
@@ -470,7 +470,7 @@ class NodeItem(QtSvg.QGraphicsSvgItem):
|
||||
:param value: value of the change
|
||||
"""
|
||||
|
||||
if change == QtWidgets.QGraphicsItem.ItemPositionChange and self._main_window.uiSnapToGridAction.isChecked() \
|
||||
if change == QtWidgets.QGraphicsItem.GraphicsItemChange.ItemPositionChange and self._main_window.uiSnapToGridAction.isChecked() \
|
||||
and self._allow_snap_to_grid:
|
||||
grid_size = self._main_window.uiGraphicsView.nodeGridSize()
|
||||
mid_x = self.boundingRect().width() / 2
|
||||
@@ -479,7 +479,7 @@ class NodeItem(QtSvg.QGraphicsSvgItem):
|
||||
value.setY((grid_size * round((value.y() + mid_y) / grid_size)) - mid_y)
|
||||
|
||||
# dynamically change the renderer when this node item is selected/unselected.
|
||||
if change == QtWidgets.QGraphicsItem.ItemSelectedChange:
|
||||
if change == QtWidgets.QGraphicsItem.GraphicsItemChange.ItemSelectedChange:
|
||||
if value:
|
||||
self.graphicsEffect().setEnabled(True)
|
||||
else:
|
||||
@@ -487,7 +487,7 @@ class NodeItem(QtSvg.QGraphicsSvgItem):
|
||||
self.updateNode()
|
||||
|
||||
# adjust link item positions when this node is moving or has changed.
|
||||
if change == QtWidgets.QGraphicsItem.ItemPositionChange or change == QtWidgets.QGraphicsItem.ItemPositionHasChanged:
|
||||
if change == QtWidgets.QGraphicsItem.GraphicsItemChange.ItemPositionChange or change == QtWidgets.QGraphicsItem.GraphicsItemChange.ItemPositionHasChanged:
|
||||
for link in self._links:
|
||||
link.adjust()
|
||||
|
||||
@@ -504,16 +504,16 @@ class NodeItem(QtSvg.QGraphicsSvgItem):
|
||||
|
||||
# don't show the selection rectangle
|
||||
if not self._settings["draw_rectangle_selected_item"]:
|
||||
option.state = QtWidgets.QStyle.State_None
|
||||
option.state = QtWidgets.QStyle.StateFlag.State_None
|
||||
super().paint(painter, option, widget)
|
||||
|
||||
if not self._initialized or self.show_layer:
|
||||
brect = self.boundingRect()
|
||||
center = self.mapFromItem(self, brect.width() / 2.0, brect.height() / 2.0)
|
||||
painter.setBrush(QtCore.Qt.red)
|
||||
painter.setPen(QtCore.Qt.red)
|
||||
painter.setBrush(QtCore.Qt.GlobalColor.red)
|
||||
painter.setPen(QtCore.Qt.GlobalColor.red)
|
||||
painter.drawRect(QtCore.QRectF((brect.width() / 2.0) - 10, (brect.height() / 2.0) - 10, 20, 20))
|
||||
painter.setPen(QtCore.Qt.black)
|
||||
painter.setPen(QtCore.Qt.GlobalColor.black)
|
||||
if self.show_layer:
|
||||
text = str(int(self.zValue())) # Z value
|
||||
elif self._last_error:
|
||||
@@ -540,7 +540,7 @@ class NodeItem(QtSvg.QGraphicsSvgItem):
|
||||
:param event: QKeyEvent
|
||||
"""
|
||||
|
||||
if event.modifiers() & QtCore.Qt.AltModifier:
|
||||
if event.modifiers() & QtCore.Qt.KeyboardModifier.AltModifier:
|
||||
self._allow_snap_to_grid = False
|
||||
else:
|
||||
super().keyPressEvent(event)
|
||||
@@ -566,13 +566,13 @@ class NodeItem(QtSvg.QGraphicsSvgItem):
|
||||
"""
|
||||
|
||||
if locked is True:
|
||||
self.setFlag(self.ItemIsMovable, False)
|
||||
self.setFlag(QtWidgets.QGraphicsItem.GraphicsItemFlag.ItemIsMovable, False)
|
||||
if self._node_label:
|
||||
self._node_label.setFlag(self.ItemIsMovable, False)
|
||||
self._node_label.setFlag(QtWidgets.QGraphicsItem.GraphicsItemFlag.ItemIsMovable, False)
|
||||
else:
|
||||
self.setFlag(self.ItemIsMovable, True)
|
||||
self.setFlag(QtWidgets.QGraphicsItem.GraphicsItemFlag.ItemIsMovable, True)
|
||||
if self._node_label:
|
||||
self._node_label.setFlag(self.ItemIsMovable, True)
|
||||
self._node_label.setFlag(QtWidgets.QGraphicsItem.GraphicsItemFlag.ItemIsMovable, True)
|
||||
for link in self._links:
|
||||
link.adjust()
|
||||
self._locked = locked
|
||||
|
||||
@@ -52,14 +52,14 @@ class SerialLinkItem(LinkItem):
|
||||
|
||||
try:
|
||||
if self._hovered:
|
||||
self.setPen(QtGui.QPen(QtCore.Qt.red, self._link._link_style["width"] + 1, QtCore.Qt.SolidLine, QtCore.Qt.RoundCap, QtCore.Qt.RoundJoin))
|
||||
self.setPen(QtGui.QPen(QtCore.Qt.GlobalColor.red, self._link._link_style["width"] + 1, QtCore.Qt.PenStyle.SolidLine, QtCore.Qt.PenCapStyle.RoundCap, QtCore.Qt.PenJoinStyle.RoundJoin))
|
||||
else:
|
||||
self.setPen(QtGui.QPen(QtGui.QColor(self._link._link_style["color"]), self._link._link_style["width"], self._link._link_style["type"], QtCore.Qt.RoundCap, QtCore.Qt.RoundJoin))
|
||||
self.setPen(QtGui.QPen(QtGui.QColor(self._link._link_style["color"]), self._link._link_style["width"], self._link._link_style["type"], QtCore.Qt.PenCapStyle.RoundCap, QtCore.Qt.PenJoinStyle.RoundJoin))
|
||||
except:
|
||||
if self._hovered:
|
||||
self.setPen(QtGui.QPen(QtCore.Qt.red, self._pen_width + 1, QtCore.Qt.SolidLine, QtCore.Qt.RoundCap, QtCore.Qt.RoundJoin))
|
||||
self.setPen(QtGui.QPen(QtCore.Qt.GlobalColor.red, self._pen_width + 1, QtCore.Qt.PenStyle.SolidLine, QtCore.Qt.PenCapStyle.RoundCap, QtCore.Qt.PenJoinStyle.RoundJoin))
|
||||
else:
|
||||
self.setPen(QtGui.QPen(QtCore.Qt.darkRed, self._pen_width, QtCore.Qt.SolidLine, QtCore.Qt.RoundCap, QtCore.Qt.RoundJoin))
|
||||
self.setPen(QtGui.QPen(QtCore.Qt.GlobalColor.darkRed, self._pen_width, QtCore.Qt.PenStyle.SolidLine, QtCore.Qt.PenCapStyle.RoundCap, QtCore.Qt.PenJoinStyle.RoundJoin))
|
||||
|
||||
# get source to destination angle
|
||||
vector_angle = math.atan2(self.dy, self.dx)
|
||||
@@ -122,17 +122,17 @@ class SerialLinkItem(LinkItem):
|
||||
# source point color
|
||||
if self._link.suspended() or self._source_port.status() == Port.suspended:
|
||||
# link or port is suspended
|
||||
shape = QtCore.Qt.RoundCap
|
||||
color = QtCore.Qt.yellow
|
||||
shape = QtCore.Qt.PenCapStyle.RoundCap
|
||||
color = QtCore.Qt.GlobalColor.yellow
|
||||
elif self._source_port.status() == Port.started:
|
||||
# port is active
|
||||
shape = QtCore.Qt.RoundCap
|
||||
color = QtCore.Qt.green
|
||||
shape = QtCore.Qt.PenCapStyle.RoundCap
|
||||
color = QtCore.Qt.GlobalColor.green
|
||||
else:
|
||||
shape = QtCore.Qt.SquareCap
|
||||
color = QtCore.Qt.red
|
||||
shape = QtCore.Qt.PenCapStyle.SquareCap
|
||||
color = QtCore.Qt.GlobalColor.red
|
||||
|
||||
painter.setPen(QtGui.QPen(color, self._point_size, QtCore.Qt.SolidLine, shape, QtCore.Qt.MiterJoin))
|
||||
painter.setPen(QtGui.QPen(color, self._point_size, QtCore.Qt.PenStyle.SolidLine, shape, QtCore.Qt.PenJoinStyle.MiterJoin))
|
||||
|
||||
source_port_label = self._source_port.label()
|
||||
if source_port_label is None:
|
||||
@@ -142,28 +142,28 @@ 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.setFlag(QtWidgets.QGraphicsItem.GraphicsItemFlag.ItemIsMovable, not self._source_item.locked())
|
||||
source_port_label.show()
|
||||
else:
|
||||
source_port_label.hide()
|
||||
|
||||
if self._settings["draw_link_status_points"] and self.pen().style() != QtCore.Qt.NoPen:
|
||||
if self._settings["draw_link_status_points"] and self.pen().style() != QtCore.Qt.PenStyle.NoPen:
|
||||
painter.drawPoint(self.source_point)
|
||||
|
||||
# destination point color
|
||||
if self._link.suspended() or self._destination_port.status() == Port.suspended:
|
||||
# link or port is suspended
|
||||
color = QtCore.Qt.yellow
|
||||
shape = QtCore.Qt.RoundCap
|
||||
color = QtCore.Qt.GlobalColor.yellow
|
||||
shape = QtCore.Qt.PenCapStyle.RoundCap
|
||||
elif self._destination_port.status() == Port.started:
|
||||
# port is active
|
||||
color = QtCore.Qt.green
|
||||
shape = QtCore.Qt.RoundCap
|
||||
color = QtCore.Qt.GlobalColor.green
|
||||
shape = QtCore.Qt.PenCapStyle.RoundCap
|
||||
else:
|
||||
color = QtCore.Qt.red
|
||||
shape = QtCore.Qt.SquareCap
|
||||
color = QtCore.Qt.GlobalColor.red
|
||||
shape = QtCore.Qt.PenCapStyle.SquareCap
|
||||
|
||||
painter.setPen(QtGui.QPen(color, self._point_size, QtCore.Qt.SolidLine, shape, QtCore.Qt.MiterJoin))
|
||||
painter.setPen(QtGui.QPen(color, self._point_size, QtCore.Qt.PenStyle.SolidLine, shape, QtCore.Qt.PenJoinStyle.MiterJoin))
|
||||
|
||||
destination_port_label = self._destination_port.label()
|
||||
|
||||
@@ -174,12 +174,12 @@ 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.setFlag(QtWidgets.QGraphicsItem.GraphicsItemFlag.ItemIsMovable, not self._destination_item.locked())
|
||||
destination_port_label.show()
|
||||
else:
|
||||
destination_port_label.hide()
|
||||
|
||||
if self._settings["draw_link_status_points"] and self.pen().style() != QtCore.Qt.NoPen:
|
||||
if self._settings["draw_link_status_points"] and self.pen().style() != QtCore.Qt.PenStyle.NoPen:
|
||||
painter.drawPoint(self.destination_point)
|
||||
|
||||
self._drawSymbol()
|
||||
|
||||
@@ -44,7 +44,7 @@ class ShapeItem(DrawingItem):
|
||||
|
||||
if svg is None:
|
||||
self.setRect(0, 0, width, height)
|
||||
pen = QtGui.QPen(QtCore.Qt.black, 2, QtCore.Qt.SolidLine, QtCore.Qt.RoundCap, QtCore.Qt.RoundJoin)
|
||||
pen = QtGui.QPen(QtCore.Qt.GlobalColor.black, 2, QtCore.Qt.PenStyle.SolidLine, QtCore.Qt.PenCapStyle.RoundCap, QtCore.Qt.PenJoinStyle.RoundJoin)
|
||||
self.setPen(pen)
|
||||
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255, 255)) # default color is white and not transparent
|
||||
self.setBrush(brush)
|
||||
@@ -61,21 +61,21 @@ class ShapeItem(DrawingItem):
|
||||
"""
|
||||
|
||||
self.update()
|
||||
self._originally_movable = self.flags() & QtWidgets.QGraphicsItem.ItemIsMovable
|
||||
self._originally_movable = bool(self.flags() & QtWidgets.QGraphicsItem.GraphicsItemFlag.ItemIsMovable)
|
||||
if event.pos().x() > (self.rect().right() - self._border):
|
||||
self.setFlag(QtWidgets.QGraphicsItem.ItemIsMovable, False)
|
||||
self.setFlag(QtWidgets.QGraphicsItem.GraphicsItemFlag.ItemIsMovable, False)
|
||||
self._edge = "right"
|
||||
|
||||
elif event.pos().x() < (self.rect().left() + self._border):
|
||||
self.setFlag(QtWidgets.QGraphicsItem.ItemIsMovable, False)
|
||||
self.setFlag(QtWidgets.QGraphicsItem.GraphicsItemFlag.ItemIsMovable, False)
|
||||
self._edge = "left"
|
||||
|
||||
elif event.pos().y() < (self.rect().top() + self._border):
|
||||
self.setFlag(QtWidgets.QGraphicsItem.ItemIsMovable, False)
|
||||
self.setFlag(QtWidgets.QGraphicsItem.GraphicsItemFlag.ItemIsMovable, False)
|
||||
self._edge = "top"
|
||||
|
||||
elif event.pos().y() > (self.rect().bottom() - self._border):
|
||||
self.setFlag(QtWidgets.QGraphicsItem.ItemIsMovable, False)
|
||||
self.setFlag(QtWidgets.QGraphicsItem.GraphicsItemFlag.ItemIsMovable, False)
|
||||
self._edge = "bottom"
|
||||
QtWidgets.QGraphicsItem.mousePressEvent(self, event)
|
||||
|
||||
@@ -87,7 +87,7 @@ class ShapeItem(DrawingItem):
|
||||
"""
|
||||
|
||||
self.update()
|
||||
self.setFlag(QtWidgets.QGraphicsItem.ItemIsMovable, self._originally_movable)
|
||||
self.setFlag(QtWidgets.QGraphicsItem.GraphicsItemFlag.ItemIsMovable, self._originally_movable)
|
||||
self._edge = None
|
||||
QtWidgets.QGraphicsItem.mouseReleaseEvent(self, event)
|
||||
|
||||
@@ -150,15 +150,15 @@ class ShapeItem(DrawingItem):
|
||||
# locked objects don't need cursors
|
||||
if not self.locked():
|
||||
if event.pos().x() > (self.rect().right() - self._border):
|
||||
self._graphics_view.setCursor(QtCore.Qt.SizeHorCursor)
|
||||
self._graphics_view.setCursor(QtCore.Qt.CursorShape.SizeHorCursor)
|
||||
elif event.pos().x() < (self.rect().left() + self._border):
|
||||
self._graphics_view.setCursor(QtCore.Qt.SizeHorCursor)
|
||||
self._graphics_view.setCursor(QtCore.Qt.CursorShape.SizeHorCursor)
|
||||
elif event.pos().y() < (self.rect().top() + self._border):
|
||||
self._graphics_view.setCursor(QtCore.Qt.SizeVerCursor)
|
||||
self._graphics_view.setCursor(QtCore.Qt.CursorShape.SizeVerCursor)
|
||||
elif event.pos().y() > (self.rect().bottom() - self._border):
|
||||
self._graphics_view.setCursor(QtCore.Qt.SizeVerCursor)
|
||||
self._graphics_view.setCursor(QtCore.Qt.CursorShape.SizeVerCursor)
|
||||
else:
|
||||
self._graphics_view.setCursor(QtCore.Qt.SizeAllCursor)
|
||||
self._graphics_view.setCursor(QtCore.Qt.CursorShape.SizeAllCursor)
|
||||
|
||||
def hoverLeaveEvent(self, event):
|
||||
"""
|
||||
@@ -169,7 +169,7 @@ class ShapeItem(DrawingItem):
|
||||
|
||||
# locked objects don't need cursors
|
||||
if not self.locked():
|
||||
self._graphics_view.setCursor(QtCore.Qt.ArrowCursor)
|
||||
self._graphics_view.setCursor(QtCore.Qt.CursorShape.ArrowCursor)
|
||||
|
||||
def setWidthAndHeight(self, width, height):
|
||||
self.setRect(0, 0, width, height)
|
||||
@@ -184,7 +184,7 @@ class ShapeItem(DrawingItem):
|
||||
self.setRect(0, 0, width, height)
|
||||
|
||||
pen = QtGui.QPen()
|
||||
brush = QtGui.QBrush(QtCore.Qt.SolidPattern)
|
||||
brush = QtGui.QBrush(QtCore.Qt.BrushStyle.SolidPattern)
|
||||
|
||||
if len(svg):
|
||||
pen = self._penFromSVGElement(svg[0])
|
||||
|
||||
@@ -62,11 +62,11 @@ class TextItem(QtWidgets.QGraphicsTextItem, DrawingItem):
|
||||
Edit mode for this note.
|
||||
"""
|
||||
|
||||
self.setTextInteractionFlags(QtCore.Qt.TextEditorInteraction)
|
||||
self.setTextInteractionFlags(QtCore.Qt.TextInteractionFlag.TextEditorInteraction)
|
||||
self.setSelected(True)
|
||||
self.setFocus()
|
||||
cursor = self.textCursor()
|
||||
cursor.select(QtGui.QTextCursor.Document)
|
||||
cursor.select(QtGui.QTextCursor.SelectionType.Document)
|
||||
self.setTextCursor(cursor)
|
||||
|
||||
def mouseDoubleClickEvent(self, event):
|
||||
@@ -85,12 +85,12 @@ class TextItem(QtWidgets.QGraphicsTextItem, DrawingItem):
|
||||
:param event: QFocusEvent instance
|
||||
"""
|
||||
|
||||
self.setFlag(QtWidgets.QGraphicsItem.ItemIsFocusable, False)
|
||||
self.setFlag(QtWidgets.QGraphicsItem.GraphicsItemFlag.ItemIsFocusable, False)
|
||||
cursor = self.textCursor()
|
||||
if cursor.hasSelection():
|
||||
cursor.clearSelection()
|
||||
self.setTextCursor(cursor)
|
||||
self.setTextInteractionFlags(QtCore.Qt.NoTextInteraction)
|
||||
self.setTextInteractionFlags(QtCore.Qt.TextInteractionFlag.NoTextInteraction)
|
||||
if not self.toPlainText():
|
||||
# delete the note if empty
|
||||
self.delete()
|
||||
|
||||
@@ -112,12 +112,12 @@ class Link(QtCore.QObject):
|
||||
# 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.open(QtCore.QIODeviceBase.OpenModeFlag.WriteOnly)
|
||||
self._capture_file.setAutoRemove(True)
|
||||
self._capture_file_path = self._capture_file.fileName()
|
||||
else:
|
||||
self._capture_file = QtCore.QFile(self._capture_file_path)
|
||||
self._capture_file.open(QtCore.QFile.WriteOnly)
|
||||
self._capture_file.open(QtCore.QIODeviceBase.OpenModeFlag.WriteOnly)
|
||||
|
||||
if self._network_manager is None:
|
||||
self._network_manager = QtNetwork.QNetworkAccessManager(self)
|
||||
|
||||
@@ -91,7 +91,12 @@ class LocalConfig(QtCore.QObject):
|
||||
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)
|
||||
xgd_config_var = "$XDG_CONFIG_HOME"
|
||||
xdg_config_res = os.path.expandvars(xgd_config_var)
|
||||
if xdg_config_res != xgd_config_var:
|
||||
old_config_path = os.path.join(xdg_config_res, "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):
|
||||
@@ -141,8 +146,13 @@ class LocalConfig(QtCore.QObject):
|
||||
appdata = os.path.expandvars("%APPDATA%")
|
||||
path = os.path.join(appdata, "GNS3", version)
|
||||
else:
|
||||
home = os.path.expanduser("~")
|
||||
path = os.path.join(home, ".config", "GNS3", version)
|
||||
xgd_config_var = "$XDG_CONFIG_HOME"
|
||||
xdg_config_res = os.path.expandvars(xgd_config_var)
|
||||
if xdg_config_res != xgd_config_var:
|
||||
path = os.path.join(xdg_config_res, "GNS3", version)
|
||||
else:
|
||||
home = os.path.expanduser("~")
|
||||
path = os.path.join(home, ".config", "GNS3", version)
|
||||
|
||||
if self._profile is not None:
|
||||
path = os.path.join(path, "profiles", self._profile)
|
||||
@@ -188,7 +198,7 @@ class LocalConfig(QtCore.QObject):
|
||||
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)
|
||||
app.exec_()
|
||||
app.exec()
|
||||
sys.exit(1)
|
||||
|
||||
if "version" not in self._settings or parse_version(self._settings["version"]) < parse_version("1.4.0alpha1"):
|
||||
@@ -392,14 +402,6 @@ class LocalConfig(QtCore.QObject):
|
||||
from gns3.settings import GENERAL_SETTINGS
|
||||
return self.loadSectionSettings("MainWindow", GENERAL_SETTINGS)["experimental_features"]
|
||||
|
||||
def hdpi(self):
|
||||
"""
|
||||
:returns: Boolean. True if hdpi is allowed
|
||||
"""
|
||||
|
||||
from gns3.settings import GENERAL_SETTINGS
|
||||
return self.loadSectionSettings("MainWindow", GENERAL_SETTINGS)["hdpi"]
|
||||
|
||||
def multiProfiles(self):
|
||||
"""
|
||||
:returns: Boolean. True if multi_profiles is enabled
|
||||
|
||||
@@ -48,9 +48,9 @@ class StopLocalServerWorker(QtCore.QObject):
|
||||
the server
|
||||
"""
|
||||
# signals to update the progress dialog.
|
||||
error = QtCore.pyqtSignal(str, bool)
|
||||
finished = QtCore.pyqtSignal()
|
||||
updated = QtCore.pyqtSignal(int)
|
||||
error = QtCore.Signal(str, bool)
|
||||
finished = QtCore.Signal()
|
||||
updated = QtCore.Signal(int)
|
||||
|
||||
def __init__(self, local_server_process):
|
||||
super().__init__()
|
||||
@@ -140,9 +140,9 @@ class LocalServer(QtCore.QObject):
|
||||
self.parent(),
|
||||
"uBridge",
|
||||
"uBridge requires CAP_NET_RAW capability to interact with network interfaces. Set the capability to uBridge? All users on the system will be able to read packet from the network interfaces.",
|
||||
QtWidgets.QMessageBox.Yes,
|
||||
QtWidgets.QMessageBox.No)
|
||||
if proceed == QtWidgets.QMessageBox.Yes:
|
||||
QtWidgets.QMessageBox.StandardButton.Yes,
|
||||
QtWidgets.QMessageBox.StandardButton.No)
|
||||
if proceed == QtWidgets.QMessageBox.StandardButton.Yes:
|
||||
sudo(["setcap", "cap_net_admin,cap_net_raw=ep", path])
|
||||
except AttributeError:
|
||||
# Due to a Python bug, os.listxattr could be missing: https://github.com/GNS3/gns3-gui/issues/2010
|
||||
@@ -159,9 +159,9 @@ class LocalServer(QtCore.QObject):
|
||||
self.parent(),
|
||||
"uBridge",
|
||||
"uBridge requires root permissions to interact with network interfaces. Set root permissions to uBridge? All admin users on the system will be able to read packet from the network interfaces.",
|
||||
QtWidgets.QMessageBox.Yes,
|
||||
QtWidgets.QMessageBox.No)
|
||||
if proceed == QtWidgets.QMessageBox.Yes:
|
||||
QtWidgets.QMessageBox.StandardButton.Yes,
|
||||
QtWidgets.QMessageBox.StandardButton.No)
|
||||
if proceed == QtWidgets.QMessageBox.StandardButton.Yes:
|
||||
from gns3.utils.macos_ubridge_setuid import macos_ubridge_setuid
|
||||
if sys.platform.startswith("darwin") and hasattr(sys, "frozen"):
|
||||
macos_ubridge_setuid()
|
||||
@@ -311,7 +311,7 @@ class LocalServer(QtCore.QObject):
|
||||
"Starting local controller {} on port {}...".format(self._settings["host"], self._port),
|
||||
"Cancel", busy=True, parent=self.parent())
|
||||
progress_dialog.show()
|
||||
if not progress_dialog.exec_():
|
||||
if not progress_dialog.exec():
|
||||
return False
|
||||
self._server_started_by_me = True
|
||||
Controller.instance().connect()
|
||||
@@ -489,7 +489,7 @@ class LocalServer(QtCore.QObject):
|
||||
worker = StopLocalServerWorker(self._local_server_process)
|
||||
progress_dialog = ProgressDialog(worker, "Local server", "Waiting for the local controller to stop...", None, busy=True, parent=self.parent())
|
||||
progress_dialog.show()
|
||||
progress_dialog.exec_()
|
||||
progress_dialog.exec()
|
||||
if self._local_server_process.returncode is None:
|
||||
self._killLocalServer()
|
||||
self._server_started_by_me = False
|
||||
@@ -512,10 +512,10 @@ class LocalServer(QtCore.QObject):
|
||||
proceed = QtWidgets.QMessageBox.question(self.parent(),
|
||||
"Local controller",
|
||||
"The local controller cannot be stopped, would you like to kill it?",
|
||||
QtWidgets.QMessageBox.Yes,
|
||||
QtWidgets.QMessageBox.No)
|
||||
QtWidgets.QMessageBox.StandardButton.Yes,
|
||||
QtWidgets.QMessageBox.StandardButton.No)
|
||||
|
||||
if proceed == QtWidgets.QMessageBox.Yes:
|
||||
if proceed == QtWidgets.QMessageBox.StandardButton.Yes:
|
||||
self._local_server_process.kill()
|
||||
|
||||
@staticmethod
|
||||
|
||||
14
gns3/main.py
14
gns3/main.py
@@ -193,8 +193,8 @@ def main():
|
||||
if sys.version_info < (3, 9):
|
||||
raise SystemExit("Python 3.9 or higher is required")
|
||||
|
||||
if parse_version(QtCore.QT_VERSION_STR) < parse_version("5.5.0"):
|
||||
raise SystemExit("Requirement is PyQt5 version 5.5.0 or higher, got version {}".format(QtCore.QT_VERSION_STR))
|
||||
if parse_version(QtCore.QT_VERSION_STR) < parse_version("6.3.1"):
|
||||
raise SystemExit("Requirement is PyQt6 version 6.3.1 or higher, got version {}".format(QtCore.QT_VERSION_STR))
|
||||
|
||||
if parse_version(psutil.__version__) < parse_version("2.2.1"):
|
||||
raise SystemExit("Requirement is psutil version 2.2.1 or higher, got version {}".format(psutil.__version__))
|
||||
@@ -211,7 +211,7 @@ def main():
|
||||
|
||||
# always use the INI format on Windows and OSX (because we don't like the registry and plist files)
|
||||
if sys.platform.startswith('win') or sys.platform.startswith('darwin'):
|
||||
QtCore.QSettings.setDefaultFormat(QtCore.QSettings.IniFormat)
|
||||
QtCore.QSettings.setDefaultFormat(QtCore.QSettings.Format.IniFormat)
|
||||
|
||||
if sys.platform.startswith('win') and hasattr(sys, "frozen"):
|
||||
try:
|
||||
@@ -239,12 +239,12 @@ def main():
|
||||
local_config = LocalConfig.instance()
|
||||
|
||||
global app
|
||||
app = Application(sys.argv, hdpi=local_config.hdpi())
|
||||
app = Application(sys.argv)
|
||||
|
||||
if local_config.multiProfiles() and not options.profile:
|
||||
profile_select = ProfileSelectDialog()
|
||||
profile_select.show()
|
||||
if profile_select.exec_():
|
||||
if profile_select.exec():
|
||||
options.profile = profile_select.profile()
|
||||
else:
|
||||
sys.exit(0)
|
||||
@@ -282,7 +282,7 @@ def main():
|
||||
error_message = "GNS3.app must be moved to the '/Applications' folder before it can be used"
|
||||
QtWidgets.QMessageBox.critical(False, "Loading error", error_message)
|
||||
QtCore.QTimer.singleShot(0, app.quit)
|
||||
app.exec_()
|
||||
app.exec()
|
||||
sys.exit(1)
|
||||
|
||||
global mainwindow
|
||||
@@ -305,7 +305,7 @@ def main():
|
||||
|
||||
mainwindow.show()
|
||||
|
||||
exit_code = app.exec_()
|
||||
exit_code = app.exec()
|
||||
signal.signal(signal.SIGINT, orig_sigint)
|
||||
signal.signal(signal.SIGTERM, orig_sigterm)
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
|
||||
"""
|
||||
|
||||
# signal to tell the view if the user is adding a link or not
|
||||
adding_link_signal = QtCore.pyqtSignal(bool)
|
||||
adding_link_signal = QtCore.Signal(bool)
|
||||
|
||||
# Signal of settings updates
|
||||
settings_updated_signal = QtCore.Signal()
|
||||
@@ -171,17 +171,17 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
|
||||
self.uiNodesDockWidget.setVisible(False)
|
||||
|
||||
# default directories for QFileDialog
|
||||
self._import_configs_from_dir = QtCore.QStandardPaths.writableLocation(QtCore.QStandardPaths.DocumentsLocation)
|
||||
self._export_configs_to_dir = QtCore.QStandardPaths.writableLocation(QtCore.QStandardPaths.DocumentsLocation)
|
||||
self._screenshots_dir = QtCore.QStandardPaths.writableLocation(QtCore.QStandardPaths.PicturesLocation)
|
||||
self._pictures_dir = QtCore.QStandardPaths.writableLocation(QtCore.QStandardPaths.PicturesLocation)
|
||||
self._appliance_dir = QtCore.QStandardPaths.writableLocation(QtCore.QStandardPaths.DownloadLocation)
|
||||
self._portable_project_dir = QtCore.QStandardPaths.writableLocation(QtCore.QStandardPaths.DownloadLocation)
|
||||
self._import_configs_from_dir = QtCore.QStandardPaths.writableLocation(QtCore.QStandardPaths.StandardLocation.DocumentsLocation)
|
||||
self._export_configs_to_dir = QtCore.QStandardPaths.writableLocation(QtCore.QStandardPaths.StandardLocation.DocumentsLocation)
|
||||
self._screenshots_dir = QtCore.QStandardPaths.writableLocation(QtCore.QStandardPaths.StandardLocation.PicturesLocation)
|
||||
self._pictures_dir = QtCore.QStandardPaths.writableLocation(QtCore.QStandardPaths.StandardLocation.PicturesLocation)
|
||||
self._appliance_dir = QtCore.QStandardPaths.writableLocation(QtCore.QStandardPaths.StandardLocation.DownloadLocation)
|
||||
self._portable_project_dir = QtCore.QStandardPaths.writableLocation(QtCore.QStandardPaths.StandardLocation.DownloadLocation)
|
||||
self._project_dir = None
|
||||
|
||||
# add recent file actions to the File menu
|
||||
for i in range(0, self._maxrecent_files):
|
||||
action = QtWidgets.QAction(self.uiFileMenu)
|
||||
action = QtGui.QAction(self.uiFileMenu)
|
||||
action.setVisible(False)
|
||||
action.triggered.connect(self.openRecentFileSlot)
|
||||
self.recent_file_actions.append(action)
|
||||
@@ -192,7 +192,7 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
|
||||
|
||||
# add recent projects to the File menu
|
||||
for i in range(0, self._maxrecent_files):
|
||||
action = QtWidgets.QAction(self.uiFileMenu)
|
||||
action = QtGui.QAction(self.uiFileMenu)
|
||||
action.setVisible(False)
|
||||
action.triggered.connect(self.openRecentProjectSlot)
|
||||
self.recent_project_actions.append(action)
|
||||
@@ -211,6 +211,12 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
|
||||
|
||||
self.setWindowTitle("[*] GNS3")
|
||||
|
||||
# detect if the SVG module is correctly installed
|
||||
supported_image_formats = [fmt.data().decode('utf-8') for fmt in QtGui.QImageReader().supportedImageFormats()]
|
||||
log.debug("Supported image formats: %s", ", ".join(supported_image_formats))
|
||||
if "svg" not in supported_image_formats:
|
||||
log.warning("SVG image format is not supported, is the Qt SVG module installed?")
|
||||
|
||||
# load initial stuff once the event loop isn't busy
|
||||
self.run_later(0, self.startupLoading)
|
||||
|
||||
@@ -421,7 +427,7 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
|
||||
|
||||
self._project_dialog = ProjectDialog(self)
|
||||
self._project_dialog.show()
|
||||
create_new_project = self._project_dialog.exec_()
|
||||
create_new_project = self._project_dialog.exec()
|
||||
|
||||
if create_new_project:
|
||||
Topology.instance().createLoadProject(self._project_dialog.getProjectSettings())
|
||||
@@ -435,7 +441,7 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
|
||||
|
||||
dialog = NewTemplateWizard(self)
|
||||
dialog.show()
|
||||
dialog.exec_()
|
||||
dialog.exec()
|
||||
|
||||
def _imageManagementActionSlot(self):
|
||||
"""
|
||||
@@ -444,7 +450,7 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
|
||||
|
||||
dialog = ImageDialog(self)
|
||||
dialog.show()
|
||||
dialog.exec_()
|
||||
dialog.exec()
|
||||
|
||||
@qslot
|
||||
def openApplianceActionSlot(self, *args):
|
||||
@@ -539,7 +545,7 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
|
||||
QtWidgets.QMessageBox.critical(self, "Appliance", "Error while importing appliance {}: {}".format(path, str(e)))
|
||||
return
|
||||
self._appliance_wizard.show()
|
||||
self._appliance_wizard.exec_()
|
||||
self._appliance_wizard.exec()
|
||||
elif path.endswith(".gns3"):
|
||||
if Controller.instance().isRemote():
|
||||
QtWidgets.QMessageBox.critical(self, "Open project", "Cannot open a .gns3 file on a remote server, please use a project (.gns3p) instead")
|
||||
@@ -619,7 +625,7 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
|
||||
Exports all configs to a directory.
|
||||
"""
|
||||
|
||||
path = QtWidgets.QFileDialog.getExistingDirectory(self, "Export directory", self._export_configs_to_dir, QtWidgets.QFileDialog.ShowDirsOnly)
|
||||
path = QtWidgets.QFileDialog.getExistingDirectory(self, "Export directory", self._export_configs_to_dir, QtWidgets.QFileDialog.Option.ShowDirsOnly)
|
||||
if path:
|
||||
self._export_configs_to_dir = os.path.dirname(path)
|
||||
for module in MODULES:
|
||||
@@ -632,7 +638,7 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
|
||||
Imports all configs from a directory.
|
||||
"""
|
||||
|
||||
path = QtWidgets.QFileDialog.getExistingDirectory(self, "Import directory", self._import_configs_from_dir, QtWidgets.QFileDialog.ShowDirsOnly)
|
||||
path = QtWidgets.QFileDialog.getExistingDirectory(self, "Import directory", self._import_configs_from_dir, QtWidgets.QFileDialog.Option.ShowDirsOnly)
|
||||
if path:
|
||||
self._import_configs_from_dir = os.path.dirname(path)
|
||||
for module in MODULES:
|
||||
@@ -650,12 +656,12 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
|
||||
scene = self.uiGraphicsView.scene()
|
||||
scene.clearSelection()
|
||||
source = scene.itemsBoundingRect().adjusted(-20.0, -20.0, 20.0, 20.0)
|
||||
image = QtGui.QImage(source.size().toSize(), QtGui.QImage.Format_RGB32)
|
||||
image.fill(QtCore.Qt.white)
|
||||
image = QtGui.QImage(source.size().toSize(), QtGui.QImage.Format.Format_RGB32)
|
||||
image.fill(QtCore.Qt.GlobalColor.white)
|
||||
painter = QtGui.QPainter(image)
|
||||
painter.setRenderHint(QtGui.QPainter.Antialiasing, True)
|
||||
painter.setRenderHint(QtGui.QPainter.TextAntialiasing, True)
|
||||
painter.setRenderHint(QtGui.QPainter.SmoothPixmapTransform, True)
|
||||
painter.setRenderHint(QtGui.QPainter.RenderHint.Antialiasing, True)
|
||||
painter.setRenderHint(QtGui.QPainter.RenderHint.TextAntialiasing, True)
|
||||
painter.setRenderHint(QtGui.QPainter.RenderHint.SmoothPixmapTransform, True)
|
||||
scene.render(painter, source=source)
|
||||
painter.end()
|
||||
# TODO: quality option
|
||||
@@ -745,7 +751,7 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
|
||||
|
||||
dialog = SnapshotsDialog(self, project)
|
||||
dialog.show()
|
||||
dialog.exec_()
|
||||
dialog.exec()
|
||||
|
||||
def _selectAllActionSlot(self):
|
||||
"""
|
||||
@@ -770,12 +776,12 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
|
||||
Slot to switch to full screen.
|
||||
"""
|
||||
|
||||
if not self.windowState() & QtCore.Qt.WindowFullScreen:
|
||||
if not self.windowState() & QtCore.Qt.WindowState.WindowFullScreen:
|
||||
# switch to full screen
|
||||
self.setWindowState(self.windowState() | QtCore.Qt.WindowFullScreen)
|
||||
self.setWindowState(self.windowState() | QtCore.Qt.WindowState.WindowFullScreen)
|
||||
else:
|
||||
# switch back to normal
|
||||
self.setWindowState(self.windowState() & ~QtCore.Qt.WindowFullScreen)
|
||||
self.setWindowState(self.windowState() & ~QtCore.Qt.WindowState.WindowFullScreen)
|
||||
|
||||
def _zoomInActionSlot(self):
|
||||
"""
|
||||
@@ -811,7 +817,7 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
|
||||
view = self.uiGraphicsView
|
||||
bounding_rect = view.scene().itemsBoundingRect().adjusted(-20.0, -20.0, 20.0, 20.0)
|
||||
view.ensureVisible(bounding_rect)
|
||||
view.fitInView(bounding_rect, QtCore.Qt.KeepAspectRatio)
|
||||
view.fitInView(bounding_rect, QtCore.Qt.AspectRatioMode.KeepAspectRatio)
|
||||
|
||||
def _showLayersActionSlot(self):
|
||||
"""
|
||||
@@ -854,9 +860,9 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
|
||||
"""
|
||||
|
||||
reply = QtWidgets.QMessageBox.question(self, "Confirm Start All", "Are you sure you want to start all devices?",
|
||||
QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No)
|
||||
QtWidgets.QMessageBox.StandardButton.Yes | QtWidgets.QMessageBox.StandardButton.No)
|
||||
|
||||
if reply == QtWidgets.QMessageBox.No:
|
||||
if reply == QtWidgets.QMessageBox.StandardButton.No:
|
||||
return
|
||||
|
||||
project = Topology.instance().project()
|
||||
@@ -869,9 +875,9 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
|
||||
"""
|
||||
|
||||
reply = QtWidgets.QMessageBox.question(self, "Confirm Suspend All", "Are you sure you want to suspend all devices?",
|
||||
QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No)
|
||||
QtWidgets.QMessageBox.StandardButton.Yes | QtWidgets.QMessageBox.StandardButton.No)
|
||||
|
||||
if reply == QtWidgets.QMessageBox.No:
|
||||
if reply == QtWidgets.QMessageBox.StandardButton.No:
|
||||
return
|
||||
|
||||
project = Topology.instance().project()
|
||||
@@ -884,9 +890,9 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
|
||||
"""
|
||||
|
||||
reply = QtWidgets.QMessageBox.question(self, "Confirm Stop All", "Are you sure you want to stop all devices?",
|
||||
QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No)
|
||||
QtWidgets.QMessageBox.StandardButton.Yes | QtWidgets.QMessageBox.StandardButton.No)
|
||||
|
||||
if reply == QtWidgets.QMessageBox.No:
|
||||
if reply == QtWidgets.QMessageBox.StandardButton.No:
|
||||
return
|
||||
|
||||
project = Topology.instance().project()
|
||||
@@ -899,9 +905,9 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
|
||||
"""
|
||||
|
||||
reply = QtWidgets.QMessageBox.question(self, "Confirm Reload All", "Are you sure you want to reload all devices?",
|
||||
QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No)
|
||||
QtWidgets.QMessageBox.StandardButton.Yes | QtWidgets.QMessageBox.StandardButton.No)
|
||||
|
||||
if reply == QtWidgets.QMessageBox.No:
|
||||
if reply == QtWidgets.QMessageBox.StandardButton.No:
|
||||
return
|
||||
|
||||
project = Topology.instance().project()
|
||||
@@ -1006,12 +1012,12 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
|
||||
|
||||
setup_wizard = SetupWizard(self)
|
||||
setup_wizard.show()
|
||||
setup_wizard.exec_()
|
||||
setup_wizard.exec()
|
||||
|
||||
def _shortcutsActionSlot(self):
|
||||
|
||||
shortcuts_text = ""
|
||||
for action in self.findChildren(QtWidgets.QAction):
|
||||
for action in self.findChildren(QtGui.QAction):
|
||||
shortcut = action.shortcut().toString()
|
||||
if shortcut:
|
||||
shortcuts_text += f"{action.toolTip()}: {shortcut}\n"
|
||||
@@ -1031,7 +1037,7 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
|
||||
|
||||
dialog = AboutDialog(self)
|
||||
dialog.show()
|
||||
dialog.exec_()
|
||||
dialog.exec()
|
||||
|
||||
def _exportDebugInformationSlot(self):
|
||||
"""
|
||||
@@ -1040,7 +1046,7 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
|
||||
|
||||
dialog = ExportDebugDialog(self, Topology.instance().project())
|
||||
dialog.show()
|
||||
dialog.exec_()
|
||||
dialog.exec()
|
||||
|
||||
def _doctorSlot(self):
|
||||
"""
|
||||
@@ -1049,7 +1055,7 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
|
||||
|
||||
dialog = DoctorDialog(self)
|
||||
dialog.show()
|
||||
dialog.exec_()
|
||||
dialog.exec()
|
||||
|
||||
def _academyActionSlot(self):
|
||||
"""
|
||||
@@ -1139,7 +1145,7 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
|
||||
dialog = PreferencesDialog(self)
|
||||
#dialog.restoreGeometry(QtCore.QByteArray().fromBase64(self._settings["preferences_dialog_geometry"].encode()))
|
||||
dialog.show()
|
||||
dialog.exec_()
|
||||
dialog.exec()
|
||||
#self._settings["preferences_dialog_geometry"] = bytes(dialog.saveGeometry().toBase64()).decode()
|
||||
#self.setSettings(self._settings)
|
||||
|
||||
@@ -1168,10 +1174,10 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
|
||||
|
||||
key = event.key()
|
||||
# if the user is adding a link and press Escape, then cancel the link addition.
|
||||
if self.uiAddLinkAction.isChecked() and key == QtCore.Qt.Key_Escape:
|
||||
if self.uiAddLinkAction.isChecked() and key == QtCore.Qt.Key.Key_Escape:
|
||||
self.uiAddLinkAction.setChecked(False)
|
||||
self._addLinkActionSlot()
|
||||
elif key == QtCore.Qt.Key_C and event.modifiers() & QtCore.Qt.ControlModifier:
|
||||
elif key == QtCore.Qt.Key.Key_C and (event.modifiers() & QtCore.Qt.KeyboardModifier.ControlModifier):
|
||||
status_bar_message = self.uiStatusBar.currentMessage()
|
||||
if status_bar_message:
|
||||
QtWidgets.QApplication.clipboard().setText(status_bar_message)
|
||||
@@ -1187,8 +1193,8 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
|
||||
|
||||
if Topology.instance().project():
|
||||
reply = QtWidgets.QMessageBox.question(self, "Confirm Exit", "Are you sure you want to exit GNS3?",
|
||||
QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No)
|
||||
if reply == QtWidgets.QMessageBox.No:
|
||||
QtWidgets.QMessageBox.StandardButton.Yes | QtWidgets.QMessageBox.StandardButton.No)
|
||||
if reply == QtWidgets.QMessageBox.StandardButton.No:
|
||||
event.ignore()
|
||||
return
|
||||
|
||||
@@ -1250,8 +1256,8 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
|
||||
|
||||
if not LocalConfig.instance().isMainGui():
|
||||
reply = QtWidgets.QMessageBox.warning(self, "GNS3", "Another GNS3 GUI is already running. Continue?",
|
||||
QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No)
|
||||
if reply == QtWidgets.QMessageBox.No:
|
||||
QtWidgets.QMessageBox.StandardButton.Yes | QtWidgets.QMessageBox.StandardButton.No)
|
||||
if reply == QtWidgets.QMessageBox.StandardButton.No:
|
||||
sys.exit(1)
|
||||
return
|
||||
|
||||
@@ -1500,7 +1506,7 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
|
||||
return
|
||||
dialog = EditProjectDialog(self)
|
||||
dialog.show()
|
||||
dialog.exec_()
|
||||
dialog.exec()
|
||||
|
||||
def _deleteProjectActionSlot(self):
|
||||
if Topology.instance().project() is None:
|
||||
@@ -1509,8 +1515,8 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
|
||||
self,
|
||||
"GNS3",
|
||||
"The project will be deleted from disk. All files will be removed including the project subdirectories. Continue?",
|
||||
QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No)
|
||||
if reply == QtWidgets.QMessageBox.Yes:
|
||||
QtWidgets.QMessageBox.StandardButton.Yes | QtWidgets.QMessageBox.StandardButton.No)
|
||||
if reply == QtWidgets.QMessageBox.StandardButton.Yes:
|
||||
Topology.instance().deleteProject()
|
||||
|
||||
def _setStyle(self, style_name):
|
||||
|
||||
@@ -37,7 +37,7 @@ class CloudWizard(VMWizard, Ui_CloudNodeWizard):
|
||||
|
||||
super().__init__(cloud_nodes, parent)
|
||||
|
||||
self.setPixmap(QtWidgets.QWizard.LogoPixmap, QtGui.QPixmap(":/symbols/cloud.svg"))
|
||||
self.setPixmap(QtWidgets.QWizard.WizardPixmap.LogoPixmap, QtGui.QPixmap(":/symbols/cloud.svg"))
|
||||
self.uiNameWizardPage.registerField("name*", self.uiNameLineEdit)
|
||||
|
||||
def getSettings(self):
|
||||
|
||||
@@ -38,7 +38,7 @@ class EthernetHubWizard(VMWizard, Ui_EthernetHubWizard):
|
||||
|
||||
super().__init__(ethernet_hubs, parent)
|
||||
|
||||
self.setPixmap(QtWidgets.QWizard.LogoPixmap, QtGui.QPixmap(":/symbols/hub.svg"))
|
||||
self.setPixmap(QtWidgets.QWizard.WizardPixmap.LogoPixmap, QtGui.QPixmap(":/symbols/hub.svg"))
|
||||
self.uiNameWizardPage.registerField("name*", self.uiNameLineEdit)
|
||||
|
||||
def getSettings(self):
|
||||
|
||||
@@ -38,7 +38,7 @@ class EthernetSwitchWizard(VMWizard, Ui_EthernetSwitchWizard):
|
||||
|
||||
super().__init__(ethernet_switches, parent)
|
||||
|
||||
self.setPixmap(QtWidgets.QWizard.LogoPixmap, QtGui.QPixmap(":/symbols/ethernet_switch.svg"))
|
||||
self.setPixmap(QtWidgets.QWizard.WizardPixmap.LogoPixmap, QtGui.QPixmap(":/symbols/ethernet_switch.svg"))
|
||||
self.uiNameWizardPage.registerField("name*", self.uiNameLineEdit)
|
||||
|
||||
def getSettings(self):
|
||||
|
||||
@@ -43,7 +43,7 @@ class ATMSwitchConfigurationPage(QtWidgets.QWidget, Ui_atmSwitchConfigPageWidget
|
||||
self.uiMappingTreeWidget.itemSelectionChanged.connect(self._mappingSelectionChangedSlot)
|
||||
|
||||
# enable sorting
|
||||
self.uiMappingTreeWidget.sortByColumn(0, QtCore.Qt.AscendingOrder)
|
||||
self.uiMappingTreeWidget.sortByColumn(0, QtCore.Qt.SortOrder.AscendingOrder)
|
||||
self.uiMappingTreeWidget.setSortingEnabled(True)
|
||||
|
||||
def _mappingSelectedSlot(self, item, column):
|
||||
@@ -61,11 +61,11 @@ class ATMSwitchConfigurationPage(QtWidgets.QWidget, Ui_atmSwitchConfigPageWidget
|
||||
match_destination_mapping = mapping.search(destination)
|
||||
|
||||
if match_source_mapping and match_destination_mapping:
|
||||
self.uiVPICheckBox.setCheckState(QtCore.Qt.Unchecked)
|
||||
self.uiVPICheckBox.setCheckState(QtCore.Qt.CheckState.Unchecked)
|
||||
(source_port, source_vpi, source_vci) = match_source_mapping.group(1, 2, 3)
|
||||
(destination_port, destination_vpi, destination_vci) = match_destination_mapping.group(1, 2, 3)
|
||||
else:
|
||||
self.uiVPICheckBox.setCheckState(QtCore.Qt.Checked)
|
||||
self.uiVPICheckBox.setCheckState(QtCore.Qt.CheckState.Checked)
|
||||
(source_port, source_vpi) = source.split(':')
|
||||
(destination_port, destination_vpi) = destination.split(':')
|
||||
source_vci = destination_vci = 0
|
||||
@@ -103,7 +103,7 @@ class ATMSwitchConfigurationPage(QtWidgets.QWidget, Ui_atmSwitchConfigPageWidget
|
||||
destination_vpi = self.uiDestinationVPISpinBox.value()
|
||||
destination_vci = self.uiDestinationVCISpinBox.value()
|
||||
|
||||
if self.uiVPICheckBox.checkState() == QtCore.Qt.Unchecked:
|
||||
if self.uiVPICheckBox.checkState() == QtCore.Qt.CheckState.Unchecked:
|
||||
source = "{port}:{vpi}:{vci}".format(port=source_port,
|
||||
vpi=source_vpi,
|
||||
vci=source_vci)
|
||||
|
||||
@@ -364,7 +364,7 @@ class CloudConfigurationPage(QtWidgets.QWidget, Ui_cloudConfigPageWidget):
|
||||
if interface["type"] == "ethernet":
|
||||
if not state and interface["special"]:
|
||||
continue
|
||||
if self.uiEthernetListWidget.findItems(interface["name"], QtCore.Qt.MatchFixedString):
|
||||
if self.uiEthernetListWidget.findItems(interface["name"], QtCore.Qt.MatchFlag.MatchFixedString):
|
||||
continue
|
||||
self.uiEthernetComboBox.addItem(interface["name"])
|
||||
index += 1
|
||||
@@ -377,7 +377,7 @@ class CloudConfigurationPage(QtWidgets.QWidget, Ui_cloudConfigPageWidget):
|
||||
symbol_path = self.uiSymbolLineEdit.text()
|
||||
dialog = SymbolSelectionDialog(self, symbol=symbol_path)
|
||||
dialog.show()
|
||||
if dialog.exec_():
|
||||
if dialog.exec():
|
||||
new_symbol_path = dialog.getSymbol()
|
||||
self.uiSymbolLineEdit.setText(new_symbol_path)
|
||||
self.uiSymbolLineEdit.setToolTip('<img src="{}"/>'.format(new_symbol_path))
|
||||
|
||||
@@ -115,7 +115,7 @@ class CloudPreferencesPage(QtWidgets.QWidget, Ui_CloudPreferencesPageWidget):
|
||||
self.uiEditCloudNodePushButton.setEnabled(single_selected)
|
||||
|
||||
if single_selected:
|
||||
key = selection[0].data(0, QtCore.Qt.UserRole)
|
||||
key = selection[0].data(0, QtCore.Qt.ItemDataRole.UserRole)
|
||||
cloud_node = self._cloud_nodes[key]
|
||||
self._refreshInfo(cloud_node)
|
||||
else:
|
||||
@@ -128,7 +128,7 @@ class CloudPreferencesPage(QtWidgets.QWidget, Ui_CloudPreferencesPageWidget):
|
||||
|
||||
wizard = CloudWizard(self._cloud_nodes, parent=self)
|
||||
wizard.show()
|
||||
if wizard.exec_():
|
||||
if wizard.exec():
|
||||
new_cloud_settings = wizard.getSettings()
|
||||
key = "{server}:{name}".format(server=new_cloud_settings["compute_id"], name=new_cloud_settings["name"])
|
||||
self._cloud_nodes[key] = CLOUD_SETTINGS.copy()
|
||||
@@ -138,7 +138,7 @@ class CloudPreferencesPage(QtWidgets.QWidget, Ui_CloudPreferencesPageWidget):
|
||||
item.setText(0, self._cloud_nodes[key]["name"])
|
||||
Controller.instance().getSymbolIcon(self._cloud_nodes[key]["symbol"], qpartial(self._setItemIcon, item))
|
||||
|
||||
item.setData(0, QtCore.Qt.UserRole, key)
|
||||
item.setData(0, QtCore.Qt.ItemDataRole.UserRole, key)
|
||||
self._items.append(item)
|
||||
self.uiCloudNodesTreeWidget.setCurrentItem(item)
|
||||
|
||||
@@ -149,11 +149,11 @@ class CloudPreferencesPage(QtWidgets.QWidget, Ui_CloudPreferencesPageWidget):
|
||||
|
||||
item = self.uiCloudNodesTreeWidget.currentItem()
|
||||
if item:
|
||||
key = item.data(0, QtCore.Qt.UserRole)
|
||||
key = item.data(0, QtCore.Qt.ItemDataRole.UserRole)
|
||||
cloud_node = self._cloud_nodes[key]
|
||||
dialog = ConfigurationDialog(cloud_node["name"], cloud_node, CloudConfigurationPage(), parent=self)
|
||||
dialog.show()
|
||||
if dialog.exec_():
|
||||
if dialog.exec():
|
||||
# update the icon
|
||||
Controller.instance().getSymbolIcon(cloud_node["symbol"], qpartial(self._setItemIcon, item))
|
||||
if cloud_node["name"] != item.text(0):
|
||||
@@ -166,7 +166,7 @@ class CloudPreferencesPage(QtWidgets.QWidget, Ui_CloudPreferencesPageWidget):
|
||||
self._cloud_nodes[new_key] = self._cloud_nodes[key]
|
||||
del self._cloud_nodes[key]
|
||||
item.setText(0, cloud_node["name"])
|
||||
item.setData(0, QtCore.Qt.UserRole, new_key)
|
||||
item.setData(0, QtCore.Qt.ItemDataRole.UserRole, new_key)
|
||||
self._refreshInfo(cloud_node)
|
||||
|
||||
def _deleteCloudNodeSlot(self):
|
||||
@@ -176,7 +176,7 @@ class CloudPreferencesPage(QtWidgets.QWidget, Ui_CloudPreferencesPageWidget):
|
||||
|
||||
for item in self.uiCloudNodesTreeWidget.selectedItems():
|
||||
if item:
|
||||
key = item.data(0, QtCore.Qt.UserRole)
|
||||
key = item.data(0, QtCore.Qt.ItemDataRole.UserRole)
|
||||
del self._cloud_nodes[key]
|
||||
self.uiCloudNodesTreeWidget.takeTopLevelItem(self.uiCloudNodesTreeWidget.indexOfTopLevelItem(item))
|
||||
|
||||
@@ -200,12 +200,12 @@ class CloudPreferencesPage(QtWidgets.QWidget, Ui_CloudPreferencesPageWidget):
|
||||
item = QtWidgets.QTreeWidgetItem(self.uiCloudNodesTreeWidget)
|
||||
item.setText(0, cloud_node["name"])
|
||||
Controller.instance().getSymbolIcon(cloud_node["symbol"], qpartial(self._setItemIcon, item))
|
||||
item.setData(0, QtCore.Qt.UserRole, key)
|
||||
item.setData(0, QtCore.Qt.ItemDataRole.UserRole, key)
|
||||
self._items.append(item)
|
||||
|
||||
if self._items:
|
||||
self.uiCloudNodesTreeWidget.setCurrentItem(self._items[0])
|
||||
self.uiCloudNodesTreeWidget.sortByColumn(0, QtCore.Qt.AscendingOrder)
|
||||
self.uiCloudNodesTreeWidget.sortByColumn(0, QtCore.Qt.SortOrder.AscendingOrder)
|
||||
self.uiCloudNodesTreeWidget.setMaximumWidth(self.uiCloudNodesTreeWidget.sizeHintForColumn(0) + 20)
|
||||
|
||||
def _setItemIcon(self, item, icon):
|
||||
|
||||
@@ -52,7 +52,7 @@ class EthernetHubConfigurationPage(QtWidgets.QWidget, Ui_ethernetHubConfigPageWi
|
||||
symbol_path = self.uiSymbolLineEdit.text()
|
||||
dialog = SymbolSelectionDialog(self, symbol=symbol_path)
|
||||
dialog.show()
|
||||
if dialog.exec_():
|
||||
if dialog.exec():
|
||||
new_symbol_path = dialog.getSymbol()
|
||||
self.uiSymbolLineEdit.setText(new_symbol_path)
|
||||
self.uiSymbolLineEdit.setToolTip('<img src="{}"/>'.format(new_symbol_path))
|
||||
|
||||
@@ -112,7 +112,7 @@ class EthernetHubPreferencesPage(QtWidgets.QWidget, Ui_EthernetHubPreferencesPag
|
||||
self.uiEditEthernetHubPushButton.setEnabled(single_selected)
|
||||
|
||||
if single_selected:
|
||||
key = selection[0].data(0, QtCore.Qt.UserRole)
|
||||
key = selection[0].data(0, QtCore.Qt.ItemDataRole.UserRole)
|
||||
ethernet_hub = self._ethernet_hubs[key]
|
||||
self._refreshInfo(ethernet_hub)
|
||||
else:
|
||||
@@ -125,7 +125,7 @@ class EthernetHubPreferencesPage(QtWidgets.QWidget, Ui_EthernetHubPreferencesPag
|
||||
|
||||
wizard = EthernetHubWizard(self._ethernet_hubs, parent=self)
|
||||
wizard.show()
|
||||
if wizard.exec_():
|
||||
if wizard.exec():
|
||||
new_ethernet_hub_settings = wizard.getSettings()
|
||||
key = "{server}:{name}".format(server=new_ethernet_hub_settings["compute_id"], name=new_ethernet_hub_settings["name"])
|
||||
self._ethernet_hubs[key] = ETHERNET_HUB_SETTINGS.copy()
|
||||
@@ -134,7 +134,7 @@ class EthernetHubPreferencesPage(QtWidgets.QWidget, Ui_EthernetHubPreferencesPag
|
||||
item = QtWidgets.QTreeWidgetItem(self.uiEthernetHubsTreeWidget)
|
||||
item.setText(0, self._ethernet_hubs[key]["name"])
|
||||
Controller.instance().getSymbolIcon(self._ethernet_hubs[key]["symbol"], qpartial(self._setItemIcon, item))
|
||||
item.setData(0, QtCore.Qt.UserRole, key)
|
||||
item.setData(0, QtCore.Qt.ItemDataRole.UserRole, key)
|
||||
self._items.append(item)
|
||||
self.uiEthernetHubsTreeWidget.setCurrentItem(item)
|
||||
|
||||
@@ -145,11 +145,11 @@ class EthernetHubPreferencesPage(QtWidgets.QWidget, Ui_EthernetHubPreferencesPag
|
||||
|
||||
item = self.uiEthernetHubsTreeWidget.currentItem()
|
||||
if item:
|
||||
key = item.data(0, QtCore.Qt.UserRole)
|
||||
key = item.data(0, QtCore.Qt.ItemDataRole.UserRole)
|
||||
ethernet_hub = self._ethernet_hubs[key]
|
||||
dialog = ConfigurationDialog(ethernet_hub["name"], ethernet_hub, EthernetHubConfigurationPage(), parent=self)
|
||||
dialog.show()
|
||||
if dialog.exec_():
|
||||
if dialog.exec():
|
||||
# update the icon
|
||||
Controller.instance().getSymbolIcon(ethernet_hub["symbol"], qpartial(self._setItemIcon, item))
|
||||
if ethernet_hub["name"] != item.text(0):
|
||||
@@ -162,7 +162,7 @@ class EthernetHubPreferencesPage(QtWidgets.QWidget, Ui_EthernetHubPreferencesPag
|
||||
self._ethernet_hubs[new_key] = self._ethernet_hubs[key]
|
||||
del self._ethernet_hubs[key]
|
||||
item.setText(0, ethernet_hub["name"])
|
||||
item.setData(0, QtCore.Qt.UserRole, new_key)
|
||||
item.setData(0, QtCore.Qt.ItemDataRole.UserRole, new_key)
|
||||
self._refreshInfo(ethernet_hub)
|
||||
|
||||
def _deleteEthernetHubSlot(self):
|
||||
@@ -172,7 +172,7 @@ class EthernetHubPreferencesPage(QtWidgets.QWidget, Ui_EthernetHubPreferencesPag
|
||||
|
||||
for item in self.uiEthernetHubsTreeWidget.selectedItems():
|
||||
if item:
|
||||
key = item.data(0, QtCore.Qt.UserRole)
|
||||
key = item.data(0, QtCore.Qt.ItemDataRole.UserRole)
|
||||
del self._ethernet_hubs[key]
|
||||
self.uiEthernetHubsTreeWidget.takeTopLevelItem(self.uiEthernetHubsTreeWidget.indexOfTopLevelItem(item))
|
||||
|
||||
@@ -196,12 +196,12 @@ class EthernetHubPreferencesPage(QtWidgets.QWidget, Ui_EthernetHubPreferencesPag
|
||||
item = QtWidgets.QTreeWidgetItem(self.uiEthernetHubsTreeWidget)
|
||||
item.setText(0, ethernet_hub["name"])
|
||||
Controller.instance().getSymbolIcon(ethernet_hub["symbol"], qpartial(self._setItemIcon, item))
|
||||
item.setData(0, QtCore.Qt.UserRole, key)
|
||||
item.setData(0, QtCore.Qt.ItemDataRole.UserRole, key)
|
||||
self._items.append(item)
|
||||
|
||||
if self._items:
|
||||
self.uiEthernetHubsTreeWidget.setCurrentItem(self._items[0])
|
||||
self.uiEthernetHubsTreeWidget.sortByColumn(0, QtCore.Qt.AscendingOrder)
|
||||
self.uiEthernetHubsTreeWidget.sortByColumn(0, QtCore.Qt.SortOrder.AscendingOrder)
|
||||
self.uiEthernetHubsTreeWidget.setMaximumWidth(self.uiEthernetHubsTreeWidget.sizeHintForColumn(0) + 20)
|
||||
|
||||
def _setItemIcon(self, item, icon):
|
||||
|
||||
@@ -51,7 +51,7 @@ class EthernetSwitchConfigurationPage(QtWidgets.QWidget, Ui_ethernetSwitchConfig
|
||||
self.uiPortTypeComboBox.currentIndexChanged.connect(self._typeSelectionChangedSlot)
|
||||
|
||||
# enable sorting
|
||||
self.uiPortsTreeWidget.sortByColumn(0, QtCore.Qt.AscendingOrder)
|
||||
self.uiPortsTreeWidget.sortByColumn(0, QtCore.Qt.SortOrder.AscendingOrder)
|
||||
self.uiPortsTreeWidget.setSortingEnabled(True)
|
||||
|
||||
self.uiSymbolToolButton.clicked.connect(self._symbolBrowserSlot)
|
||||
@@ -64,7 +64,7 @@ class EthernetSwitchConfigurationPage(QtWidgets.QWidget, Ui_ethernetSwitchConfig
|
||||
symbol_path = self.uiSymbolLineEdit.text()
|
||||
dialog = SymbolSelectionDialog(self, symbol=symbol_path)
|
||||
dialog.show()
|
||||
if dialog.exec_():
|
||||
if dialog.exec():
|
||||
new_symbol_path = dialog.getSymbol()
|
||||
self.uiSymbolLineEdit.setText(new_symbol_path)
|
||||
self.uiSymbolLineEdit.setToolTip('<img src="{}"/>'.format(new_symbol_path))
|
||||
@@ -131,7 +131,7 @@ class EthernetSwitchConfigurationPage(QtWidgets.QWidget, Ui_ethernetSwitchConfig
|
||||
|
||||
if port in self._ports:
|
||||
# update a given entry in the tree widget
|
||||
item = self.uiPortsTreeWidget.findItems(str(port), QtCore.Qt.MatchFixedString)[0]
|
||||
item = self.uiPortsTreeWidget.findItems(str(port), QtCore.Qt.MatchFlag.MatchFixedString)[0]
|
||||
item.setText(1, str(vlan))
|
||||
item.setText(2, port_type)
|
||||
if port_ethertype:
|
||||
|
||||
@@ -117,7 +117,7 @@ class EthernetSwitchPreferencesPage(QtWidgets.QWidget, Ui_EthernetSwitchPreferen
|
||||
self.uiEditEthernetSwitchPushButton.setEnabled(single_selected)
|
||||
|
||||
if single_selected:
|
||||
key = selection[0].data(0, QtCore.Qt.UserRole)
|
||||
key = selection[0].data(0, QtCore.Qt.ItemDataRole.UserRole)
|
||||
ethernet_switch = self._ethernet_switches[key]
|
||||
self._refreshInfo(ethernet_switch)
|
||||
else:
|
||||
@@ -130,7 +130,7 @@ class EthernetSwitchPreferencesPage(QtWidgets.QWidget, Ui_EthernetSwitchPreferen
|
||||
|
||||
wizard = EthernetSwitchWizard(self._ethernet_switches, parent=self)
|
||||
wizard.show()
|
||||
if wizard.exec_():
|
||||
if wizard.exec():
|
||||
new_ethernet_switch_settings = wizard.getSettings()
|
||||
key = "{server}:{name}".format(server=new_ethernet_switch_settings["compute_id"], name=new_ethernet_switch_settings["name"])
|
||||
self._ethernet_switches[key] = ETHERNET_SWITCH_SETTINGS.copy()
|
||||
@@ -140,7 +140,7 @@ class EthernetSwitchPreferencesPage(QtWidgets.QWidget, Ui_EthernetSwitchPreferen
|
||||
item.setText(0, self._ethernet_switches[key]["name"])
|
||||
Controller.instance().getSymbolIcon(self._ethernet_switches[key]["symbol"], qpartial(self._setItemIcon, item))
|
||||
|
||||
item.setData(0, QtCore.Qt.UserRole, key)
|
||||
item.setData(0, QtCore.Qt.ItemDataRole.UserRole, key)
|
||||
self._items.append(item)
|
||||
self.uiEthernetSwitchesTreeWidget.setCurrentItem(item)
|
||||
|
||||
@@ -151,11 +151,11 @@ class EthernetSwitchPreferencesPage(QtWidgets.QWidget, Ui_EthernetSwitchPreferen
|
||||
|
||||
item = self.uiEthernetSwitchesTreeWidget.currentItem()
|
||||
if item:
|
||||
key = item.data(0, QtCore.Qt.UserRole)
|
||||
key = item.data(0, QtCore.Qt.ItemDataRole.UserRole)
|
||||
ethernet_switch = self._ethernet_switches[key]
|
||||
dialog = ConfigurationDialog(ethernet_switch["name"], ethernet_switch, EthernetSwitchConfigurationPage(), parent=self)
|
||||
dialog.show()
|
||||
if dialog.exec_():
|
||||
if dialog.exec():
|
||||
# update the icon
|
||||
Controller.instance().getSymbolIcon(ethernet_switch["symbol"], qpartial(self._setItemIcon, item))
|
||||
if ethernet_switch["name"] != item.text(0):
|
||||
@@ -168,7 +168,7 @@ class EthernetSwitchPreferencesPage(QtWidgets.QWidget, Ui_EthernetSwitchPreferen
|
||||
self._ethernet_switches[new_key] = self._ethernet_switches[key]
|
||||
del self._ethernet_switches[key]
|
||||
item.setText(0, ethernet_switch["name"])
|
||||
item.setData(0, QtCore.Qt.UserRole, new_key)
|
||||
item.setData(0, QtCore.Qt.ItemDataRole.UserRole, new_key)
|
||||
self._refreshInfo(ethernet_switch)
|
||||
|
||||
def _deleteEthernetSwitchSlot(self):
|
||||
@@ -177,7 +177,7 @@ class EthernetSwitchPreferencesPage(QtWidgets.QWidget, Ui_EthernetSwitchPreferen
|
||||
"""
|
||||
for item in self.uiEthernetSwitchesTreeWidget.selectedItems():
|
||||
if item:
|
||||
key = item.data(0, QtCore.Qt.UserRole)
|
||||
key = item.data(0, QtCore.Qt.ItemDataRole.UserRole)
|
||||
del self._ethernet_switches[key]
|
||||
self.uiEthernetSwitchesTreeWidget.takeTopLevelItem(self.uiEthernetSwitchesTreeWidget.indexOfTopLevelItem(item))
|
||||
|
||||
@@ -201,12 +201,12 @@ class EthernetSwitchPreferencesPage(QtWidgets.QWidget, Ui_EthernetSwitchPreferen
|
||||
item = QtWidgets.QTreeWidgetItem(self.uiEthernetSwitchesTreeWidget)
|
||||
item.setText(0, ethernet_switch["name"])
|
||||
Controller.instance().getSymbolIcon(ethernet_switch["symbol"], qpartial(self._setItemIcon, item))
|
||||
item.setData(0, QtCore.Qt.UserRole, key)
|
||||
item.setData(0, QtCore.Qt.ItemDataRole.UserRole, key)
|
||||
self._items.append(item)
|
||||
|
||||
if self._items:
|
||||
self.uiEthernetSwitchesTreeWidget.setCurrentItem(self._items[0])
|
||||
self.uiEthernetSwitchesTreeWidget.sortByColumn(0, QtCore.Qt.AscendingOrder)
|
||||
self.uiEthernetSwitchesTreeWidget.sortByColumn(0, QtCore.Qt.SortOrder.AscendingOrder)
|
||||
self.uiEthernetSwitchesTreeWidget.setMaximumWidth(self.uiEthernetSwitchesTreeWidget.sizeHintForColumn(0) + 20)
|
||||
|
||||
def _setItemIcon(self, item, icon):
|
||||
|
||||
@@ -42,7 +42,7 @@ class FrameRelaySwitchConfigurationPage(QtWidgets.QWidget, Ui_frameRelaySwitchCo
|
||||
self.uiMappingTreeWidget.itemSelectionChanged.connect(self._mappingSelectionChangedSlot)
|
||||
|
||||
# enable sorting
|
||||
self.uiMappingTreeWidget.sortByColumn(0, QtCore.Qt.AscendingOrder)
|
||||
self.uiMappingTreeWidget.sortByColumn(0, QtCore.Qt.SortOrder.AscendingOrder)
|
||||
self.uiMappingTreeWidget.setSortingEnabled(True)
|
||||
|
||||
def _mappingSelectedSlot(self, item, column):
|
||||
|
||||
@@ -1,39 +1,40 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file '/home/grossmj/PycharmProjects/gns3-gui/gns3/modules/builtin/ui/atm_switch_configuration_page.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.5.1
|
||||
# Created by: PyQt6 UI code generator 6.10.1
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
|
||||
# run again. Do not edit this file unless you know what you are doing.
|
||||
|
||||
|
||||
from PyQt6 import QtCore, QtGui, QtWidgets
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
class Ui_atmSwitchConfigPageWidget(object):
|
||||
def setupUi(self, atmSwitchConfigPageWidget):
|
||||
atmSwitchConfigPageWidget.setObjectName("atmSwitchConfigPageWidget")
|
||||
atmSwitchConfigPageWidget.resize(459, 430)
|
||||
atmSwitchConfigPageWidget.resize(540, 553)
|
||||
self.gridLayout_2 = QtWidgets.QGridLayout(atmSwitchConfigPageWidget)
|
||||
self.gridLayout_2.setObjectName("gridLayout_2")
|
||||
self.uiGeneralGroupBox = QtWidgets.QGroupBox(atmSwitchConfigPageWidget)
|
||||
self.uiGeneralGroupBox = QtWidgets.QGroupBox(parent=atmSwitchConfigPageWidget)
|
||||
self.uiGeneralGroupBox.setObjectName("uiGeneralGroupBox")
|
||||
self.gridLayout = QtWidgets.QGridLayout(self.uiGeneralGroupBox)
|
||||
self.gridLayout.setObjectName("gridLayout")
|
||||
self.uiNameLabel = QtWidgets.QLabel(self.uiGeneralGroupBox)
|
||||
self.uiNameLabel = QtWidgets.QLabel(parent=self.uiGeneralGroupBox)
|
||||
self.uiNameLabel.setObjectName("uiNameLabel")
|
||||
self.gridLayout.addWidget(self.uiNameLabel, 0, 0, 1, 1)
|
||||
self.uiNameLineEdit = QtWidgets.QLineEdit(self.uiGeneralGroupBox)
|
||||
self.uiNameLineEdit = QtWidgets.QLineEdit(parent=self.uiGeneralGroupBox)
|
||||
self.uiNameLineEdit.setObjectName("uiNameLineEdit")
|
||||
self.gridLayout.addWidget(self.uiNameLineEdit, 0, 1, 1, 1)
|
||||
self.uiVPICheckBox = QtWidgets.QCheckBox(self.uiGeneralGroupBox)
|
||||
self.uiVPICheckBox = QtWidgets.QCheckBox(parent=self.uiGeneralGroupBox)
|
||||
self.uiVPICheckBox.setObjectName("uiVPICheckBox")
|
||||
self.gridLayout.addWidget(self.uiVPICheckBox, 1, 0, 1, 2)
|
||||
self.gridLayout_2.addWidget(self.uiGeneralGroupBox, 0, 0, 1, 3)
|
||||
self.uiMappingGroupBox = QtWidgets.QGroupBox(atmSwitchConfigPageWidget)
|
||||
self.uiMappingGroupBox = QtWidgets.QGroupBox(parent=atmSwitchConfigPageWidget)
|
||||
self.uiMappingGroupBox.setObjectName("uiMappingGroupBox")
|
||||
self.vboxlayout = QtWidgets.QVBoxLayout(self.uiMappingGroupBox)
|
||||
self.vboxlayout.setObjectName("vboxlayout")
|
||||
self.uiMappingTreeWidget = QtWidgets.QTreeWidget(self.uiMappingGroupBox)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
|
||||
self.uiMappingTreeWidget = QtWidgets.QTreeWidget(parent=self.uiMappingGroupBox)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Expanding)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.uiMappingTreeWidget.sizePolicy().hasHeightForWidth())
|
||||
@@ -42,17 +43,17 @@ class Ui_atmSwitchConfigPageWidget(object):
|
||||
self.uiMappingTreeWidget.setObjectName("uiMappingTreeWidget")
|
||||
self.vboxlayout.addWidget(self.uiMappingTreeWidget)
|
||||
self.gridLayout_2.addWidget(self.uiMappingGroupBox, 0, 3, 3, 1)
|
||||
self.uiAddPushButton = QtWidgets.QPushButton(atmSwitchConfigPageWidget)
|
||||
self.uiAddPushButton = QtWidgets.QPushButton(parent=atmSwitchConfigPageWidget)
|
||||
self.uiAddPushButton.setObjectName("uiAddPushButton")
|
||||
self.gridLayout_2.addWidget(self.uiAddPushButton, 3, 0, 1, 1)
|
||||
self.uiDeletePushButton = QtWidgets.QPushButton(atmSwitchConfigPageWidget)
|
||||
self.uiDeletePushButton = QtWidgets.QPushButton(parent=atmSwitchConfigPageWidget)
|
||||
self.uiDeletePushButton.setEnabled(False)
|
||||
self.uiDeletePushButton.setObjectName("uiDeletePushButton")
|
||||
self.gridLayout_2.addWidget(self.uiDeletePushButton, 3, 1, 1, 1)
|
||||
spacerItem = QtWidgets.QSpacerItem(213, 31, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
|
||||
spacerItem = QtWidgets.QSpacerItem(213, 31, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding)
|
||||
self.gridLayout_2.addItem(spacerItem, 4, 2, 1, 2)
|
||||
self.uiSourceGroupBox = QtWidgets.QGroupBox(atmSwitchConfigPageWidget)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Preferred)
|
||||
self.uiSourceGroupBox = QtWidgets.QGroupBox(parent=atmSwitchConfigPageWidget)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.uiSourceGroupBox.sizePolicy().hasHeightForWidth())
|
||||
@@ -60,11 +61,11 @@ class Ui_atmSwitchConfigPageWidget(object):
|
||||
self.uiSourceGroupBox.setObjectName("uiSourceGroupBox")
|
||||
self.gridlayout = QtWidgets.QGridLayout(self.uiSourceGroupBox)
|
||||
self.gridlayout.setObjectName("gridlayout")
|
||||
self.uiSourcePortLabel = QtWidgets.QLabel(self.uiSourceGroupBox)
|
||||
self.uiSourcePortLabel = QtWidgets.QLabel(parent=self.uiSourceGroupBox)
|
||||
self.uiSourcePortLabel.setObjectName("uiSourcePortLabel")
|
||||
self.gridlayout.addWidget(self.uiSourcePortLabel, 0, 0, 1, 1)
|
||||
self.uiSourcePortSpinBox = QtWidgets.QSpinBox(self.uiSourceGroupBox)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
|
||||
self.uiSourcePortSpinBox = QtWidgets.QSpinBox(parent=self.uiSourceGroupBox)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.uiSourcePortSpinBox.sizePolicy().hasHeightForWidth())
|
||||
@@ -74,12 +75,12 @@ class Ui_atmSwitchConfigPageWidget(object):
|
||||
self.uiSourcePortSpinBox.setProperty("value", 1)
|
||||
self.uiSourcePortSpinBox.setObjectName("uiSourcePortSpinBox")
|
||||
self.gridlayout.addWidget(self.uiSourcePortSpinBox, 0, 1, 1, 1)
|
||||
self.uiSourceVPILabel = QtWidgets.QLabel(self.uiSourceGroupBox)
|
||||
self.uiSourceVPILabel = QtWidgets.QLabel(parent=self.uiSourceGroupBox)
|
||||
self.uiSourceVPILabel.setObjectName("uiSourceVPILabel")
|
||||
self.gridlayout.addWidget(self.uiSourceVPILabel, 1, 0, 1, 1)
|
||||
self.uiSourceVPISpinBox = QtWidgets.QSpinBox(self.uiSourceGroupBox)
|
||||
self.uiSourceVPISpinBox = QtWidgets.QSpinBox(parent=self.uiSourceGroupBox)
|
||||
self.uiSourceVPISpinBox.setEnabled(True)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.uiSourceVPISpinBox.sizePolicy().hasHeightForWidth())
|
||||
@@ -88,11 +89,11 @@ class Ui_atmSwitchConfigPageWidget(object):
|
||||
self.uiSourceVPISpinBox.setProperty("value", 0)
|
||||
self.uiSourceVPISpinBox.setObjectName("uiSourceVPISpinBox")
|
||||
self.gridlayout.addWidget(self.uiSourceVPISpinBox, 1, 1, 1, 1)
|
||||
self.uiSourceVCILabel = QtWidgets.QLabel(self.uiSourceGroupBox)
|
||||
self.uiSourceVCILabel = QtWidgets.QLabel(parent=self.uiSourceGroupBox)
|
||||
self.uiSourceVCILabel.setObjectName("uiSourceVCILabel")
|
||||
self.gridlayout.addWidget(self.uiSourceVCILabel, 2, 0, 1, 1)
|
||||
self.uiSourceVCISpinBox = QtWidgets.QSpinBox(self.uiSourceGroupBox)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
|
||||
self.uiSourceVCISpinBox = QtWidgets.QSpinBox(parent=self.uiSourceGroupBox)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.uiSourceVCISpinBox.sizePolicy().hasHeightForWidth())
|
||||
@@ -102,8 +103,8 @@ class Ui_atmSwitchConfigPageWidget(object):
|
||||
self.uiSourceVCISpinBox.setObjectName("uiSourceVCISpinBox")
|
||||
self.gridlayout.addWidget(self.uiSourceVCISpinBox, 2, 1, 1, 1)
|
||||
self.gridLayout_2.addWidget(self.uiSourceGroupBox, 1, 0, 1, 3)
|
||||
self.uiDestinationGroupBox = QtWidgets.QGroupBox(atmSwitchConfigPageWidget)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Preferred)
|
||||
self.uiDestinationGroupBox = QtWidgets.QGroupBox(parent=atmSwitchConfigPageWidget)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.uiDestinationGroupBox.sizePolicy().hasHeightForWidth())
|
||||
@@ -111,11 +112,11 @@ class Ui_atmSwitchConfigPageWidget(object):
|
||||
self.uiDestinationGroupBox.setObjectName("uiDestinationGroupBox")
|
||||
self.gridlayout1 = QtWidgets.QGridLayout(self.uiDestinationGroupBox)
|
||||
self.gridlayout1.setObjectName("gridlayout1")
|
||||
self.uiDestinationPortLabel = QtWidgets.QLabel(self.uiDestinationGroupBox)
|
||||
self.uiDestinationPortLabel = QtWidgets.QLabel(parent=self.uiDestinationGroupBox)
|
||||
self.uiDestinationPortLabel.setObjectName("uiDestinationPortLabel")
|
||||
self.gridlayout1.addWidget(self.uiDestinationPortLabel, 0, 0, 1, 1)
|
||||
self.uiDestinationPortSpinBox = QtWidgets.QSpinBox(self.uiDestinationGroupBox)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
|
||||
self.uiDestinationPortSpinBox = QtWidgets.QSpinBox(parent=self.uiDestinationGroupBox)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.uiDestinationPortSpinBox.sizePolicy().hasHeightForWidth())
|
||||
@@ -125,12 +126,12 @@ class Ui_atmSwitchConfigPageWidget(object):
|
||||
self.uiDestinationPortSpinBox.setProperty("value", 10)
|
||||
self.uiDestinationPortSpinBox.setObjectName("uiDestinationPortSpinBox")
|
||||
self.gridlayout1.addWidget(self.uiDestinationPortSpinBox, 0, 1, 1, 1)
|
||||
self.uiDestinationVPILabel = QtWidgets.QLabel(self.uiDestinationGroupBox)
|
||||
self.uiDestinationVPILabel = QtWidgets.QLabel(parent=self.uiDestinationGroupBox)
|
||||
self.uiDestinationVPILabel.setObjectName("uiDestinationVPILabel")
|
||||
self.gridlayout1.addWidget(self.uiDestinationVPILabel, 1, 0, 1, 1)
|
||||
self.uiDestinationVPISpinBox = QtWidgets.QSpinBox(self.uiDestinationGroupBox)
|
||||
self.uiDestinationVPISpinBox = QtWidgets.QSpinBox(parent=self.uiDestinationGroupBox)
|
||||
self.uiDestinationVPISpinBox.setEnabled(True)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.uiDestinationVPISpinBox.sizePolicy().hasHeightForWidth())
|
||||
@@ -139,11 +140,11 @@ class Ui_atmSwitchConfigPageWidget(object):
|
||||
self.uiDestinationVPISpinBox.setProperty("value", 0)
|
||||
self.uiDestinationVPISpinBox.setObjectName("uiDestinationVPISpinBox")
|
||||
self.gridlayout1.addWidget(self.uiDestinationVPISpinBox, 1, 1, 1, 1)
|
||||
self.uiDestinationVCILabel = QtWidgets.QLabel(self.uiDestinationGroupBox)
|
||||
self.uiDestinationVCILabel = QtWidgets.QLabel(parent=self.uiDestinationGroupBox)
|
||||
self.uiDestinationVCILabel.setObjectName("uiDestinationVCILabel")
|
||||
self.gridlayout1.addWidget(self.uiDestinationVCILabel, 2, 0, 1, 1)
|
||||
self.uiDestinationVCISpinBox = QtWidgets.QSpinBox(self.uiDestinationGroupBox)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
|
||||
self.uiDestinationVCISpinBox = QtWidgets.QSpinBox(parent=self.uiDestinationGroupBox)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.uiDestinationVCISpinBox.sizePolicy().hasHeightForWidth())
|
||||
@@ -185,4 +186,3 @@ class Ui_atmSwitchConfigPageWidget(object):
|
||||
self.uiDestinationPortLabel.setText(_translate("atmSwitchConfigPageWidget", "Port:"))
|
||||
self.uiDestinationVPILabel.setText(_translate("atmSwitchConfigPageWidget", "VPI:"))
|
||||
self.uiDestinationVCILabel.setText(_translate("atmSwitchConfigPageWidget", "VCI:"))
|
||||
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file '/home/grossmj/PycharmProjects/gns3-gui/gns3/modules/builtin/ui/builtin_preferences_page.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.9.1
|
||||
# Created by: PyQt6 UI code generator 6.10.1
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
|
||||
# run again. Do not edit this file unless you know what you are doing.
|
||||
|
||||
|
||||
from PyQt6 import QtCore, QtGui, QtWidgets
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
class Ui_BuiltinPreferencesPageWidget(object):
|
||||
def setupUi(self, BuiltinPreferencesPageWidget):
|
||||
@@ -14,28 +15,28 @@ class Ui_BuiltinPreferencesPageWidget(object):
|
||||
BuiltinPreferencesPageWidget.resize(456, 385)
|
||||
self.verticalLayout = QtWidgets.QVBoxLayout(BuiltinPreferencesPageWidget)
|
||||
self.verticalLayout.setObjectName("verticalLayout")
|
||||
self.uiTabWidget = QtWidgets.QTabWidget(BuiltinPreferencesPageWidget)
|
||||
self.uiTabWidget.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
|
||||
self.uiTabWidget = QtWidgets.QTabWidget(parent=BuiltinPreferencesPageWidget)
|
||||
self.uiTabWidget.setContextMenuPolicy(QtCore.Qt.ContextMenuPolicy.CustomContextMenu)
|
||||
self.uiTabWidget.setObjectName("uiTabWidget")
|
||||
self.uiServerSettingsTabWidget = QtWidgets.QWidget()
|
||||
self.uiServerSettingsTabWidget.setObjectName("uiServerSettingsTabWidget")
|
||||
self.gridLayout = QtWidgets.QGridLayout(self.uiServerSettingsTabWidget)
|
||||
self.gridLayout.setObjectName("gridLayout")
|
||||
self.label = QtWidgets.QLabel(self.uiServerSettingsTabWidget)
|
||||
self.label = QtWidgets.QLabel(parent=self.uiServerSettingsTabWidget)
|
||||
self.label.setObjectName("label")
|
||||
self.gridLayout.addWidget(self.label, 0, 0, 1, 1)
|
||||
self.uiNATInterfaceComboBox = QtWidgets.QComboBox(self.uiServerSettingsTabWidget)
|
||||
self.uiNATInterfaceComboBox = QtWidgets.QComboBox(parent=self.uiServerSettingsTabWidget)
|
||||
self.uiNATInterfaceComboBox.setObjectName("uiNATInterfaceComboBox")
|
||||
self.gridLayout.addWidget(self.uiNATInterfaceComboBox, 1, 0, 1, 1)
|
||||
spacerItem = QtWidgets.QSpacerItem(20, 5, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
|
||||
spacerItem = QtWidgets.QSpacerItem(20, 5, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding)
|
||||
self.gridLayout.addItem(spacerItem, 2, 0, 1, 1)
|
||||
self.uiTabWidget.addTab(self.uiServerSettingsTabWidget, "")
|
||||
self.verticalLayout.addWidget(self.uiTabWidget)
|
||||
self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
|
||||
spacerItem1 = QtWidgets.QSpacerItem(254, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
|
||||
spacerItem1 = QtWidgets.QSpacerItem(254, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
|
||||
self.horizontalLayout_2.addItem(spacerItem1)
|
||||
self.uiRestoreDefaultsPushButton = QtWidgets.QPushButton(BuiltinPreferencesPageWidget)
|
||||
self.uiRestoreDefaultsPushButton = QtWidgets.QPushButton(parent=BuiltinPreferencesPageWidget)
|
||||
self.uiRestoreDefaultsPushButton.setObjectName("uiRestoreDefaultsPushButton")
|
||||
self.horizontalLayout_2.addWidget(self.uiRestoreDefaultsPushButton)
|
||||
self.verticalLayout.addLayout(self.horizontalLayout_2)
|
||||
@@ -50,4 +51,3 @@ class Ui_BuiltinPreferencesPageWidget(object):
|
||||
self.label.setText(_translate("BuiltinPreferencesPageWidget", "Default NAT interface:"))
|
||||
self.uiTabWidget.setTabText(self.uiTabWidget.indexOf(self.uiServerSettingsTabWidget), _translate("BuiltinPreferencesPageWidget", "Local settings"))
|
||||
self.uiRestoreDefaultsPushButton.setText(_translate("BuiltinPreferencesPageWidget", "Restore defaults"))
|
||||
|
||||
|
||||
@@ -38,13 +38,6 @@
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>11</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="selectionMode">
|
||||
<enum>QAbstractItemView::ExtendedSelection</enum>
|
||||
</property>
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file '/home/grossmj/PycharmProjects/gns3-gui/gns3/modules/builtin/ui/cloud_preferences_page.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.9
|
||||
# Created by: PyQt6 UI code generator 6.10.1
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
|
||||
# run again. Do not edit this file unless you know what you are doing.
|
||||
|
||||
|
||||
from PyQt6 import QtCore, QtGui, QtWidgets
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
class Ui_CloudPreferencesPageWidget(object):
|
||||
def setupUi(self, CloudPreferencesPageWidget):
|
||||
@@ -15,34 +16,29 @@ class Ui_CloudPreferencesPageWidget(object):
|
||||
CloudPreferencesPageWidget.setAccessibleDescription("")
|
||||
self.verticalLayout_2 = QtWidgets.QVBoxLayout(CloudPreferencesPageWidget)
|
||||
self.verticalLayout_2.setObjectName("verticalLayout_2")
|
||||
self.splitter = QtWidgets.QSplitter(CloudPreferencesPageWidget)
|
||||
self.splitter.setOrientation(QtCore.Qt.Horizontal)
|
||||
self.splitter = QtWidgets.QSplitter(parent=CloudPreferencesPageWidget)
|
||||
self.splitter.setOrientation(QtCore.Qt.Orientation.Horizontal)
|
||||
self.splitter.setObjectName("splitter")
|
||||
self.uiCloudNodesTreeWidget = QtWidgets.QTreeWidget(self.splitter)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Expanding)
|
||||
self.uiCloudNodesTreeWidget = QtWidgets.QTreeWidget(parent=self.splitter)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Preferred, QtWidgets.QSizePolicy.Policy.Expanding)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.uiCloudNodesTreeWidget.sizePolicy().hasHeightForWidth())
|
||||
self.uiCloudNodesTreeWidget.setSizePolicy(sizePolicy)
|
||||
self.uiCloudNodesTreeWidget.setMaximumSize(QtCore.QSize(160, 16777215))
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(11)
|
||||
font.setBold(True)
|
||||
font.setWeight(75)
|
||||
self.uiCloudNodesTreeWidget.setFont(font)
|
||||
self.uiCloudNodesTreeWidget.setSelectionMode(QtWidgets.QAbstractItemView.ExtendedSelection)
|
||||
self.uiCloudNodesTreeWidget.setSelectionMode(QtWidgets.QAbstractItemView.SelectionMode.ExtendedSelection)
|
||||
self.uiCloudNodesTreeWidget.setIconSize(QtCore.QSize(32, 32))
|
||||
self.uiCloudNodesTreeWidget.setRootIsDecorated(False)
|
||||
self.uiCloudNodesTreeWidget.setObjectName("uiCloudNodesTreeWidget")
|
||||
self.uiCloudNodesTreeWidget.headerItem().setText(0, "1")
|
||||
self.uiCloudNodesTreeWidget.header().setVisible(False)
|
||||
self.layoutWidget = QtWidgets.QWidget(self.splitter)
|
||||
self.layoutWidget = QtWidgets.QWidget(parent=self.splitter)
|
||||
self.layoutWidget.setObjectName("layoutWidget")
|
||||
self.verticalLayout = QtWidgets.QVBoxLayout(self.layoutWidget)
|
||||
self.verticalLayout.setContentsMargins(0, 0, 0, 0)
|
||||
self.verticalLayout.setObjectName("verticalLayout")
|
||||
self.uiCloudNodeInfoTreeWidget = QtWidgets.QTreeWidget(self.layoutWidget)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Expanding)
|
||||
self.uiCloudNodeInfoTreeWidget = QtWidgets.QTreeWidget(parent=self.layoutWidget)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.MinimumExpanding, QtWidgets.QSizePolicy.Policy.Expanding)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.uiCloudNodeInfoTreeWidget.sizePolicy().hasHeightForWidth())
|
||||
@@ -54,14 +50,14 @@ class Ui_CloudPreferencesPageWidget(object):
|
||||
self.verticalLayout.addWidget(self.uiCloudNodeInfoTreeWidget)
|
||||
self.horizontalLayout_5 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_5.setObjectName("horizontalLayout_5")
|
||||
self.uiNewCloudNodePushButton = QtWidgets.QPushButton(self.layoutWidget)
|
||||
self.uiNewCloudNodePushButton = QtWidgets.QPushButton(parent=self.layoutWidget)
|
||||
self.uiNewCloudNodePushButton.setObjectName("uiNewCloudNodePushButton")
|
||||
self.horizontalLayout_5.addWidget(self.uiNewCloudNodePushButton)
|
||||
self.uiEditCloudNodePushButton = QtWidgets.QPushButton(self.layoutWidget)
|
||||
self.uiEditCloudNodePushButton = QtWidgets.QPushButton(parent=self.layoutWidget)
|
||||
self.uiEditCloudNodePushButton.setEnabled(False)
|
||||
self.uiEditCloudNodePushButton.setObjectName("uiEditCloudNodePushButton")
|
||||
self.horizontalLayout_5.addWidget(self.uiEditCloudNodePushButton)
|
||||
self.uiDeleteCloudNodePushButton = QtWidgets.QPushButton(self.layoutWidget)
|
||||
self.uiDeleteCloudNodePushButton = QtWidgets.QPushButton(parent=self.layoutWidget)
|
||||
self.uiDeleteCloudNodePushButton.setEnabled(False)
|
||||
self.uiDeleteCloudNodePushButton.setObjectName("uiDeleteCloudNodePushButton")
|
||||
self.horizontalLayout_5.addWidget(self.uiDeleteCloudNodePushButton)
|
||||
@@ -81,4 +77,3 @@ class Ui_CloudPreferencesPageWidget(object):
|
||||
self.uiNewCloudNodePushButton.setText(_translate("CloudPreferencesPageWidget", "&New"))
|
||||
self.uiEditCloudNodePushButton.setText(_translate("CloudPreferencesPageWidget", "&Edit"))
|
||||
self.uiDeleteCloudNodePushButton.setText(_translate("CloudPreferencesPageWidget", "&Delete"))
|
||||
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file '/home/grossmj/PycharmProjects/gns3-gui/gns3/modules/builtin/ui/cloud_wizard.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.9
|
||||
# Created by: PyQt6 UI code generator 6.10.1
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
|
||||
# run again. Do not edit this file unless you know what you are doing.
|
||||
|
||||
|
||||
from PyQt6 import QtCore, QtGui, QtWidgets
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
class Ui_CloudNodeWizard(object):
|
||||
def setupUi(self, CloudNodeWizard):
|
||||
@@ -17,31 +18,31 @@ class Ui_CloudNodeWizard(object):
|
||||
self.uiServerWizardPage.setObjectName("uiServerWizardPage")
|
||||
self.gridLayout_2 = QtWidgets.QGridLayout(self.uiServerWizardPage)
|
||||
self.gridLayout_2.setObjectName("gridLayout_2")
|
||||
self.uiServerTypeGroupBox = QtWidgets.QGroupBox(self.uiServerWizardPage)
|
||||
self.uiServerTypeGroupBox = QtWidgets.QGroupBox(parent=self.uiServerWizardPage)
|
||||
self.uiServerTypeGroupBox.setObjectName("uiServerTypeGroupBox")
|
||||
self.verticalLayout = QtWidgets.QVBoxLayout(self.uiServerTypeGroupBox)
|
||||
self.verticalLayout.setObjectName("verticalLayout")
|
||||
self.uiRemoteRadioButton = QtWidgets.QRadioButton(self.uiServerTypeGroupBox)
|
||||
self.uiRemoteRadioButton = QtWidgets.QRadioButton(parent=self.uiServerTypeGroupBox)
|
||||
self.uiRemoteRadioButton.setChecked(True)
|
||||
self.uiRemoteRadioButton.setObjectName("uiRemoteRadioButton")
|
||||
self.verticalLayout.addWidget(self.uiRemoteRadioButton)
|
||||
self.uiVMRadioButton = QtWidgets.QRadioButton(self.uiServerTypeGroupBox)
|
||||
self.uiVMRadioButton = QtWidgets.QRadioButton(parent=self.uiServerTypeGroupBox)
|
||||
self.uiVMRadioButton.setObjectName("uiVMRadioButton")
|
||||
self.verticalLayout.addWidget(self.uiVMRadioButton)
|
||||
self.uiLocalRadioButton = QtWidgets.QRadioButton(self.uiServerTypeGroupBox)
|
||||
self.uiLocalRadioButton = QtWidgets.QRadioButton(parent=self.uiServerTypeGroupBox)
|
||||
self.uiLocalRadioButton.setObjectName("uiLocalRadioButton")
|
||||
self.verticalLayout.addWidget(self.uiLocalRadioButton)
|
||||
self.gridLayout_2.addWidget(self.uiServerTypeGroupBox, 0, 0, 1, 1)
|
||||
self.uiRemoteServersGroupBox = QtWidgets.QGroupBox(self.uiServerWizardPage)
|
||||
self.uiRemoteServersGroupBox = QtWidgets.QGroupBox(parent=self.uiServerWizardPage)
|
||||
self.uiRemoteServersGroupBox.setObjectName("uiRemoteServersGroupBox")
|
||||
self.gridLayout_7 = QtWidgets.QGridLayout(self.uiRemoteServersGroupBox)
|
||||
self.gridLayout_7.setObjectName("gridLayout_7")
|
||||
self.uiRemoteServersLabel = QtWidgets.QLabel(self.uiRemoteServersGroupBox)
|
||||
self.uiRemoteServersLabel = QtWidgets.QLabel(parent=self.uiRemoteServersGroupBox)
|
||||
self.uiRemoteServersLabel.setObjectName("uiRemoteServersLabel")
|
||||
self.gridLayout_7.addWidget(self.uiRemoteServersLabel, 0, 0, 1, 1)
|
||||
self.uiRemoteServersComboBox = QtWidgets.QComboBox(self.uiRemoteServersGroupBox)
|
||||
self.uiRemoteServersComboBox = QtWidgets.QComboBox(parent=self.uiRemoteServersGroupBox)
|
||||
self.uiRemoteServersComboBox.setEnabled(False)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.uiRemoteServersComboBox.sizePolicy().hasHeightForWidth())
|
||||
@@ -54,10 +55,10 @@ class Ui_CloudNodeWizard(object):
|
||||
self.uiNameWizardPage.setObjectName("uiNameWizardPage")
|
||||
self.gridLayout = QtWidgets.QGridLayout(self.uiNameWizardPage)
|
||||
self.gridLayout.setObjectName("gridLayout")
|
||||
self.uiNameLabel = QtWidgets.QLabel(self.uiNameWizardPage)
|
||||
self.uiNameLabel = QtWidgets.QLabel(parent=self.uiNameWizardPage)
|
||||
self.uiNameLabel.setObjectName("uiNameLabel")
|
||||
self.gridLayout.addWidget(self.uiNameLabel, 0, 0, 1, 1)
|
||||
self.uiNameLineEdit = QtWidgets.QLineEdit(self.uiNameWizardPage)
|
||||
self.uiNameLineEdit = QtWidgets.QLineEdit(parent=self.uiNameWizardPage)
|
||||
self.uiNameLineEdit.setObjectName("uiNameLineEdit")
|
||||
self.gridLayout.addWidget(self.uiNameLineEdit, 0, 1, 1, 1)
|
||||
CloudNodeWizard.addPage(self.uiNameWizardPage)
|
||||
@@ -79,4 +80,3 @@ class Ui_CloudNodeWizard(object):
|
||||
self.uiNameWizardPage.setTitle(_translate("CloudNodeWizard", "Name"))
|
||||
self.uiNameWizardPage.setSubTitle(_translate("CloudNodeWizard", "Please choose a descriptive name for the new cloud node."))
|
||||
self.uiNameLabel.setText(_translate("CloudNodeWizard", "Name:"))
|
||||
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file '/home/grossmj/PycharmProjects/gns3-gui/gns3/modules/builtin/ui/ethernet_hub_configuration_page.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.11.3
|
||||
# Created by: PyQt6 UI code generator 6.10.1
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
|
||||
# run again. Do not edit this file unless you know what you are doing.
|
||||
|
||||
|
||||
from PyQt6 import QtCore, QtGui, QtWidgets
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
class Ui_ethernetHubConfigPageWidget(object):
|
||||
def setupUi(self, ethernetHubConfigPageWidget):
|
||||
@@ -14,8 +15,8 @@ class Ui_ethernetHubConfigPageWidget(object):
|
||||
ethernetHubConfigPageWidget.resize(591, 352)
|
||||
self.verticalLayout = QtWidgets.QVBoxLayout(ethernetHubConfigPageWidget)
|
||||
self.verticalLayout.setObjectName("verticalLayout")
|
||||
self.uiSettingsGroupBox = QtWidgets.QGroupBox(ethernetHubConfigPageWidget)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Preferred)
|
||||
self.uiSettingsGroupBox = QtWidgets.QGroupBox(parent=ethernetHubConfigPageWidget)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.uiSettingsGroupBox.sizePolicy().hasHeightForWidth())
|
||||
@@ -23,39 +24,39 @@ class Ui_ethernetHubConfigPageWidget(object):
|
||||
self.uiSettingsGroupBox.setObjectName("uiSettingsGroupBox")
|
||||
self.gridLayout = QtWidgets.QGridLayout(self.uiSettingsGroupBox)
|
||||
self.gridLayout.setObjectName("gridLayout")
|
||||
self.uiNameLabel = QtWidgets.QLabel(self.uiSettingsGroupBox)
|
||||
self.uiNameLabel = QtWidgets.QLabel(parent=self.uiSettingsGroupBox)
|
||||
self.uiNameLabel.setObjectName("uiNameLabel")
|
||||
self.gridLayout.addWidget(self.uiNameLabel, 0, 0, 1, 1)
|
||||
self.uiDefaultNameFormatLabel = QtWidgets.QLabel(self.uiSettingsGroupBox)
|
||||
self.uiDefaultNameFormatLabel = QtWidgets.QLabel(parent=self.uiSettingsGroupBox)
|
||||
self.uiDefaultNameFormatLabel.setObjectName("uiDefaultNameFormatLabel")
|
||||
self.gridLayout.addWidget(self.uiDefaultNameFormatLabel, 1, 0, 1, 2)
|
||||
self.uiDefaultNameFormatLineEdit = QtWidgets.QLineEdit(self.uiSettingsGroupBox)
|
||||
self.uiDefaultNameFormatLineEdit = QtWidgets.QLineEdit(parent=self.uiSettingsGroupBox)
|
||||
self.uiDefaultNameFormatLineEdit.setObjectName("uiDefaultNameFormatLineEdit")
|
||||
self.gridLayout.addWidget(self.uiDefaultNameFormatLineEdit, 1, 2, 1, 1)
|
||||
self.uiSymbolLabel = QtWidgets.QLabel(self.uiSettingsGroupBox)
|
||||
self.uiSymbolLabel = QtWidgets.QLabel(parent=self.uiSettingsGroupBox)
|
||||
self.uiSymbolLabel.setObjectName("uiSymbolLabel")
|
||||
self.gridLayout.addWidget(self.uiSymbolLabel, 2, 0, 1, 2)
|
||||
self.horizontalLayout_7 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_7.setObjectName("horizontalLayout_7")
|
||||
self.uiSymbolLineEdit = QtWidgets.QLineEdit(self.uiSettingsGroupBox)
|
||||
self.uiSymbolLineEdit = QtWidgets.QLineEdit(parent=self.uiSettingsGroupBox)
|
||||
self.uiSymbolLineEdit.setObjectName("uiSymbolLineEdit")
|
||||
self.horizontalLayout_7.addWidget(self.uiSymbolLineEdit)
|
||||
self.uiSymbolToolButton = QtWidgets.QToolButton(self.uiSettingsGroupBox)
|
||||
self.uiSymbolToolButton.setToolButtonStyle(QtCore.Qt.ToolButtonTextOnly)
|
||||
self.uiSymbolToolButton = QtWidgets.QToolButton(parent=self.uiSettingsGroupBox)
|
||||
self.uiSymbolToolButton.setToolButtonStyle(QtCore.Qt.ToolButtonStyle.ToolButtonTextOnly)
|
||||
self.uiSymbolToolButton.setObjectName("uiSymbolToolButton")
|
||||
self.horizontalLayout_7.addWidget(self.uiSymbolToolButton)
|
||||
self.gridLayout.addLayout(self.horizontalLayout_7, 2, 2, 1, 1)
|
||||
self.uiCategoryLabel = QtWidgets.QLabel(self.uiSettingsGroupBox)
|
||||
self.uiCategoryLabel = QtWidgets.QLabel(parent=self.uiSettingsGroupBox)
|
||||
self.uiCategoryLabel.setObjectName("uiCategoryLabel")
|
||||
self.gridLayout.addWidget(self.uiCategoryLabel, 3, 0, 1, 2)
|
||||
self.uiCategoryComboBox = QtWidgets.QComboBox(self.uiSettingsGroupBox)
|
||||
self.uiCategoryComboBox = QtWidgets.QComboBox(parent=self.uiSettingsGroupBox)
|
||||
self.uiCategoryComboBox.setObjectName("uiCategoryComboBox")
|
||||
self.gridLayout.addWidget(self.uiCategoryComboBox, 3, 2, 1, 1)
|
||||
self.uiPortsLabel = QtWidgets.QLabel(self.uiSettingsGroupBox)
|
||||
self.uiPortsLabel = QtWidgets.QLabel(parent=self.uiSettingsGroupBox)
|
||||
self.uiPortsLabel.setObjectName("uiPortsLabel")
|
||||
self.gridLayout.addWidget(self.uiPortsLabel, 4, 0, 1, 1)
|
||||
self.uiPortsSpinBox = QtWidgets.QSpinBox(self.uiSettingsGroupBox)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
|
||||
self.uiPortsSpinBox = QtWidgets.QSpinBox(parent=self.uiSettingsGroupBox)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.uiPortsSpinBox.sizePolicy().hasHeightForWidth())
|
||||
@@ -65,9 +66,9 @@ class Ui_ethernetHubConfigPageWidget(object):
|
||||
self.uiPortsSpinBox.setProperty("value", 1)
|
||||
self.uiPortsSpinBox.setObjectName("uiPortsSpinBox")
|
||||
self.gridLayout.addWidget(self.uiPortsSpinBox, 4, 2, 1, 1)
|
||||
spacerItem = QtWidgets.QSpacerItem(20, 71, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
|
||||
spacerItem = QtWidgets.QSpacerItem(20, 71, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding)
|
||||
self.gridLayout.addItem(spacerItem, 5, 2, 1, 1)
|
||||
self.uiNameLineEdit = QtWidgets.QLineEdit(self.uiSettingsGroupBox)
|
||||
self.uiNameLineEdit = QtWidgets.QLineEdit(parent=self.uiSettingsGroupBox)
|
||||
self.uiNameLineEdit.setObjectName("uiNameLineEdit")
|
||||
self.gridLayout.addWidget(self.uiNameLineEdit, 0, 2, 1, 1)
|
||||
self.verticalLayout.addWidget(self.uiSettingsGroupBox)
|
||||
@@ -85,4 +86,3 @@ class Ui_ethernetHubConfigPageWidget(object):
|
||||
self.uiSymbolToolButton.setText(_translate("ethernetHubConfigPageWidget", "&Browse..."))
|
||||
self.uiCategoryLabel.setText(_translate("ethernetHubConfigPageWidget", "Category:"))
|
||||
self.uiPortsLabel.setText(_translate("ethernetHubConfigPageWidget", "Number of ports:"))
|
||||
|
||||
|
||||
@@ -38,13 +38,6 @@
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>11</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="selectionMode">
|
||||
<enum>QAbstractItemView::ExtendedSelection</enum>
|
||||
</property>
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file '/home/grossmj/PycharmProjects/gns3-gui/gns3/modules/builtin/ui/ethernet_hub_preferences_page.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.9
|
||||
# Created by: PyQt6 UI code generator 6.10.1
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
|
||||
# run again. Do not edit this file unless you know what you are doing.
|
||||
|
||||
|
||||
from PyQt6 import QtCore, QtGui, QtWidgets
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
class Ui_EthernetHubPreferencesPageWidget(object):
|
||||
def setupUi(self, EthernetHubPreferencesPageWidget):
|
||||
@@ -15,34 +16,29 @@ class Ui_EthernetHubPreferencesPageWidget(object):
|
||||
EthernetHubPreferencesPageWidget.setAccessibleDescription("")
|
||||
self.verticalLayout_2 = QtWidgets.QVBoxLayout(EthernetHubPreferencesPageWidget)
|
||||
self.verticalLayout_2.setObjectName("verticalLayout_2")
|
||||
self.splitter = QtWidgets.QSplitter(EthernetHubPreferencesPageWidget)
|
||||
self.splitter.setOrientation(QtCore.Qt.Horizontal)
|
||||
self.splitter = QtWidgets.QSplitter(parent=EthernetHubPreferencesPageWidget)
|
||||
self.splitter.setOrientation(QtCore.Qt.Orientation.Horizontal)
|
||||
self.splitter.setObjectName("splitter")
|
||||
self.uiEthernetHubsTreeWidget = QtWidgets.QTreeWidget(self.splitter)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Expanding)
|
||||
self.uiEthernetHubsTreeWidget = QtWidgets.QTreeWidget(parent=self.splitter)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Preferred, QtWidgets.QSizePolicy.Policy.Expanding)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.uiEthernetHubsTreeWidget.sizePolicy().hasHeightForWidth())
|
||||
self.uiEthernetHubsTreeWidget.setSizePolicy(sizePolicy)
|
||||
self.uiEthernetHubsTreeWidget.setMaximumSize(QtCore.QSize(160, 16777215))
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(11)
|
||||
font.setBold(True)
|
||||
font.setWeight(75)
|
||||
self.uiEthernetHubsTreeWidget.setFont(font)
|
||||
self.uiEthernetHubsTreeWidget.setSelectionMode(QtWidgets.QAbstractItemView.ExtendedSelection)
|
||||
self.uiEthernetHubsTreeWidget.setSelectionMode(QtWidgets.QAbstractItemView.SelectionMode.ExtendedSelection)
|
||||
self.uiEthernetHubsTreeWidget.setIconSize(QtCore.QSize(32, 32))
|
||||
self.uiEthernetHubsTreeWidget.setRootIsDecorated(False)
|
||||
self.uiEthernetHubsTreeWidget.setObjectName("uiEthernetHubsTreeWidget")
|
||||
self.uiEthernetHubsTreeWidget.headerItem().setText(0, "1")
|
||||
self.uiEthernetHubsTreeWidget.header().setVisible(False)
|
||||
self.layoutWidget = QtWidgets.QWidget(self.splitter)
|
||||
self.layoutWidget = QtWidgets.QWidget(parent=self.splitter)
|
||||
self.layoutWidget.setObjectName("layoutWidget")
|
||||
self.verticalLayout = QtWidgets.QVBoxLayout(self.layoutWidget)
|
||||
self.verticalLayout.setContentsMargins(0, 0, 0, 0)
|
||||
self.verticalLayout.setObjectName("verticalLayout")
|
||||
self.uiEthernetHubInfoTreeWidget = QtWidgets.QTreeWidget(self.layoutWidget)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Expanding)
|
||||
self.uiEthernetHubInfoTreeWidget = QtWidgets.QTreeWidget(parent=self.layoutWidget)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.MinimumExpanding, QtWidgets.QSizePolicy.Policy.Expanding)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.uiEthernetHubInfoTreeWidget.sizePolicy().hasHeightForWidth())
|
||||
@@ -54,14 +50,14 @@ class Ui_EthernetHubPreferencesPageWidget(object):
|
||||
self.verticalLayout.addWidget(self.uiEthernetHubInfoTreeWidget)
|
||||
self.horizontalLayout_5 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_5.setObjectName("horizontalLayout_5")
|
||||
self.uiNewEthernetHubPushButton = QtWidgets.QPushButton(self.layoutWidget)
|
||||
self.uiNewEthernetHubPushButton = QtWidgets.QPushButton(parent=self.layoutWidget)
|
||||
self.uiNewEthernetHubPushButton.setObjectName("uiNewEthernetHubPushButton")
|
||||
self.horizontalLayout_5.addWidget(self.uiNewEthernetHubPushButton)
|
||||
self.uiEditEthernetHubPushButton = QtWidgets.QPushButton(self.layoutWidget)
|
||||
self.uiEditEthernetHubPushButton = QtWidgets.QPushButton(parent=self.layoutWidget)
|
||||
self.uiEditEthernetHubPushButton.setEnabled(False)
|
||||
self.uiEditEthernetHubPushButton.setObjectName("uiEditEthernetHubPushButton")
|
||||
self.horizontalLayout_5.addWidget(self.uiEditEthernetHubPushButton)
|
||||
self.uiDeleteEthernetHubPushButton = QtWidgets.QPushButton(self.layoutWidget)
|
||||
self.uiDeleteEthernetHubPushButton = QtWidgets.QPushButton(parent=self.layoutWidget)
|
||||
self.uiDeleteEthernetHubPushButton.setEnabled(False)
|
||||
self.uiDeleteEthernetHubPushButton.setObjectName("uiDeleteEthernetHubPushButton")
|
||||
self.horizontalLayout_5.addWidget(self.uiDeleteEthernetHubPushButton)
|
||||
@@ -81,4 +77,3 @@ class Ui_EthernetHubPreferencesPageWidget(object):
|
||||
self.uiNewEthernetHubPushButton.setText(_translate("EthernetHubPreferencesPageWidget", "&New"))
|
||||
self.uiEditEthernetHubPushButton.setText(_translate("EthernetHubPreferencesPageWidget", "&Edit"))
|
||||
self.uiDeleteEthernetHubPushButton.setText(_translate("EthernetHubPreferencesPageWidget", "&Delete"))
|
||||
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file '/home/grossmj/PycharmProjects/gns3-gui/gns3/modules/builtin/ui/ethernet_hub_wizard.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.9
|
||||
# Created by: PyQt6 UI code generator 6.10.1
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
|
||||
# run again. Do not edit this file unless you know what you are doing.
|
||||
|
||||
|
||||
from PyQt6 import QtCore, QtGui, QtWidgets
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
class Ui_EthernetHubWizard(object):
|
||||
def setupUi(self, EthernetHubWizard):
|
||||
@@ -17,31 +18,31 @@ class Ui_EthernetHubWizard(object):
|
||||
self.uiServerWizardPage.setObjectName("uiServerWizardPage")
|
||||
self.gridLayout_2 = QtWidgets.QGridLayout(self.uiServerWizardPage)
|
||||
self.gridLayout_2.setObjectName("gridLayout_2")
|
||||
self.uiServerTypeGroupBox = QtWidgets.QGroupBox(self.uiServerWizardPage)
|
||||
self.uiServerTypeGroupBox = QtWidgets.QGroupBox(parent=self.uiServerWizardPage)
|
||||
self.uiServerTypeGroupBox.setObjectName("uiServerTypeGroupBox")
|
||||
self.verticalLayout = QtWidgets.QVBoxLayout(self.uiServerTypeGroupBox)
|
||||
self.verticalLayout.setObjectName("verticalLayout")
|
||||
self.uiRemoteRadioButton = QtWidgets.QRadioButton(self.uiServerTypeGroupBox)
|
||||
self.uiRemoteRadioButton = QtWidgets.QRadioButton(parent=self.uiServerTypeGroupBox)
|
||||
self.uiRemoteRadioButton.setChecked(True)
|
||||
self.uiRemoteRadioButton.setObjectName("uiRemoteRadioButton")
|
||||
self.verticalLayout.addWidget(self.uiRemoteRadioButton)
|
||||
self.uiVMRadioButton = QtWidgets.QRadioButton(self.uiServerTypeGroupBox)
|
||||
self.uiVMRadioButton = QtWidgets.QRadioButton(parent=self.uiServerTypeGroupBox)
|
||||
self.uiVMRadioButton.setObjectName("uiVMRadioButton")
|
||||
self.verticalLayout.addWidget(self.uiVMRadioButton)
|
||||
self.uiLocalRadioButton = QtWidgets.QRadioButton(self.uiServerTypeGroupBox)
|
||||
self.uiLocalRadioButton = QtWidgets.QRadioButton(parent=self.uiServerTypeGroupBox)
|
||||
self.uiLocalRadioButton.setObjectName("uiLocalRadioButton")
|
||||
self.verticalLayout.addWidget(self.uiLocalRadioButton)
|
||||
self.gridLayout_2.addWidget(self.uiServerTypeGroupBox, 0, 0, 1, 1)
|
||||
self.uiRemoteServersGroupBox = QtWidgets.QGroupBox(self.uiServerWizardPage)
|
||||
self.uiRemoteServersGroupBox = QtWidgets.QGroupBox(parent=self.uiServerWizardPage)
|
||||
self.uiRemoteServersGroupBox.setObjectName("uiRemoteServersGroupBox")
|
||||
self.gridLayout_7 = QtWidgets.QGridLayout(self.uiRemoteServersGroupBox)
|
||||
self.gridLayout_7.setObjectName("gridLayout_7")
|
||||
self.uiRemoteServersLabel = QtWidgets.QLabel(self.uiRemoteServersGroupBox)
|
||||
self.uiRemoteServersLabel = QtWidgets.QLabel(parent=self.uiRemoteServersGroupBox)
|
||||
self.uiRemoteServersLabel.setObjectName("uiRemoteServersLabel")
|
||||
self.gridLayout_7.addWidget(self.uiRemoteServersLabel, 0, 0, 1, 1)
|
||||
self.uiRemoteServersComboBox = QtWidgets.QComboBox(self.uiRemoteServersGroupBox)
|
||||
self.uiRemoteServersComboBox = QtWidgets.QComboBox(parent=self.uiRemoteServersGroupBox)
|
||||
self.uiRemoteServersComboBox.setEnabled(False)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.uiRemoteServersComboBox.sizePolicy().hasHeightForWidth())
|
||||
@@ -54,17 +55,17 @@ class Ui_EthernetHubWizard(object):
|
||||
self.uiNameWizardPage.setObjectName("uiNameWizardPage")
|
||||
self.gridLayout = QtWidgets.QGridLayout(self.uiNameWizardPage)
|
||||
self.gridLayout.setObjectName("gridLayout")
|
||||
self.uiNameLabel = QtWidgets.QLabel(self.uiNameWizardPage)
|
||||
self.uiNameLabel = QtWidgets.QLabel(parent=self.uiNameWizardPage)
|
||||
self.uiNameLabel.setObjectName("uiNameLabel")
|
||||
self.gridLayout.addWidget(self.uiNameLabel, 0, 0, 1, 1)
|
||||
self.uiNameLineEdit = QtWidgets.QLineEdit(self.uiNameWizardPage)
|
||||
self.uiNameLineEdit = QtWidgets.QLineEdit(parent=self.uiNameWizardPage)
|
||||
self.uiNameLineEdit.setObjectName("uiNameLineEdit")
|
||||
self.gridLayout.addWidget(self.uiNameLineEdit, 0, 1, 1, 1)
|
||||
self.uiPortsLabel = QtWidgets.QLabel(self.uiNameWizardPage)
|
||||
self.uiPortsLabel = QtWidgets.QLabel(parent=self.uiNameWizardPage)
|
||||
self.uiPortsLabel.setObjectName("uiPortsLabel")
|
||||
self.gridLayout.addWidget(self.uiPortsLabel, 1, 0, 1, 1)
|
||||
self.uiPortsSpinBox = QtWidgets.QSpinBox(self.uiNameWizardPage)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
|
||||
self.uiPortsSpinBox = QtWidgets.QSpinBox(parent=self.uiNameWizardPage)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.uiPortsSpinBox.sizePolicy().hasHeightForWidth())
|
||||
@@ -94,4 +95,3 @@ class Ui_EthernetHubWizard(object):
|
||||
self.uiNameWizardPage.setSubTitle(_translate("EthernetHubWizard", "Please choose a descriptive name for the new Ethernet hub."))
|
||||
self.uiNameLabel.setText(_translate("EthernetHubWizard", "Name:"))
|
||||
self.uiPortsLabel.setText(_translate("EthernetHubWizard", "Number of ports:"))
|
||||
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file '/home/grossmj/PycharmProjects/gns3-gui/gns3/modules/builtin/ui/ethernet_switch_configuration_page.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.11.3
|
||||
# Created by: PyQt6 UI code generator 6.10.1
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
|
||||
# run again. Do not edit this file unless you know what you are doing.
|
||||
|
||||
|
||||
from PyQt6 import QtCore, QtGui, QtWidgets
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
class Ui_ethernetSwitchConfigPageWidget(object):
|
||||
def setupUi(self, ethernetSwitchConfigPageWidget):
|
||||
@@ -14,52 +15,52 @@ class Ui_ethernetSwitchConfigPageWidget(object):
|
||||
ethernetSwitchConfigPageWidget.resize(708, 653)
|
||||
self.gridLayout_2 = QtWidgets.QGridLayout(ethernetSwitchConfigPageWidget)
|
||||
self.gridLayout_2.setObjectName("gridLayout_2")
|
||||
self.uiGeneralGroupBox = QtWidgets.QGroupBox(ethernetSwitchConfigPageWidget)
|
||||
self.uiGeneralGroupBox = QtWidgets.QGroupBox(parent=ethernetSwitchConfigPageWidget)
|
||||
self.uiGeneralGroupBox.setObjectName("uiGeneralGroupBox")
|
||||
self.gridLayout = QtWidgets.QGridLayout(self.uiGeneralGroupBox)
|
||||
self.gridLayout.setObjectName("gridLayout")
|
||||
self.uiNameLabel = QtWidgets.QLabel(self.uiGeneralGroupBox)
|
||||
self.uiNameLabel = QtWidgets.QLabel(parent=self.uiGeneralGroupBox)
|
||||
self.uiNameLabel.setObjectName("uiNameLabel")
|
||||
self.gridLayout.addWidget(self.uiNameLabel, 0, 0, 1, 1)
|
||||
self.uiNameLineEdit = QtWidgets.QLineEdit(self.uiGeneralGroupBox)
|
||||
self.uiNameLineEdit = QtWidgets.QLineEdit(parent=self.uiGeneralGroupBox)
|
||||
self.uiNameLineEdit.setObjectName("uiNameLineEdit")
|
||||
self.gridLayout.addWidget(self.uiNameLineEdit, 0, 1, 1, 1)
|
||||
self.uiDefaultNameFormatLabel = QtWidgets.QLabel(self.uiGeneralGroupBox)
|
||||
self.uiDefaultNameFormatLabel = QtWidgets.QLabel(parent=self.uiGeneralGroupBox)
|
||||
self.uiDefaultNameFormatLabel.setObjectName("uiDefaultNameFormatLabel")
|
||||
self.gridLayout.addWidget(self.uiDefaultNameFormatLabel, 1, 0, 1, 1)
|
||||
self.uiDefaultNameFormatLineEdit = QtWidgets.QLineEdit(self.uiGeneralGroupBox)
|
||||
self.uiDefaultNameFormatLineEdit = QtWidgets.QLineEdit(parent=self.uiGeneralGroupBox)
|
||||
self.uiDefaultNameFormatLineEdit.setObjectName("uiDefaultNameFormatLineEdit")
|
||||
self.gridLayout.addWidget(self.uiDefaultNameFormatLineEdit, 1, 1, 1, 1)
|
||||
self.uiSymbolLabel = QtWidgets.QLabel(self.uiGeneralGroupBox)
|
||||
self.uiSymbolLabel = QtWidgets.QLabel(parent=self.uiGeneralGroupBox)
|
||||
self.uiSymbolLabel.setObjectName("uiSymbolLabel")
|
||||
self.gridLayout.addWidget(self.uiSymbolLabel, 2, 0, 1, 1)
|
||||
self.horizontalLayout_7 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_7.setObjectName("horizontalLayout_7")
|
||||
self.uiSymbolLineEdit = QtWidgets.QLineEdit(self.uiGeneralGroupBox)
|
||||
self.uiSymbolLineEdit = QtWidgets.QLineEdit(parent=self.uiGeneralGroupBox)
|
||||
self.uiSymbolLineEdit.setObjectName("uiSymbolLineEdit")
|
||||
self.horizontalLayout_7.addWidget(self.uiSymbolLineEdit)
|
||||
self.uiSymbolToolButton = QtWidgets.QToolButton(self.uiGeneralGroupBox)
|
||||
self.uiSymbolToolButton.setToolButtonStyle(QtCore.Qt.ToolButtonTextOnly)
|
||||
self.uiSymbolToolButton = QtWidgets.QToolButton(parent=self.uiGeneralGroupBox)
|
||||
self.uiSymbolToolButton.setToolButtonStyle(QtCore.Qt.ToolButtonStyle.ToolButtonTextOnly)
|
||||
self.uiSymbolToolButton.setObjectName("uiSymbolToolButton")
|
||||
self.horizontalLayout_7.addWidget(self.uiSymbolToolButton)
|
||||
self.gridLayout.addLayout(self.horizontalLayout_7, 2, 1, 1, 1)
|
||||
self.uiCategoryLabel = QtWidgets.QLabel(self.uiGeneralGroupBox)
|
||||
self.uiCategoryLabel = QtWidgets.QLabel(parent=self.uiGeneralGroupBox)
|
||||
self.uiCategoryLabel.setObjectName("uiCategoryLabel")
|
||||
self.gridLayout.addWidget(self.uiCategoryLabel, 3, 0, 1, 1)
|
||||
self.uiCategoryComboBox = QtWidgets.QComboBox(self.uiGeneralGroupBox)
|
||||
self.uiCategoryComboBox = QtWidgets.QComboBox(parent=self.uiGeneralGroupBox)
|
||||
self.uiCategoryComboBox.setObjectName("uiCategoryComboBox")
|
||||
self.gridLayout.addWidget(self.uiCategoryComboBox, 3, 1, 1, 1)
|
||||
self.uiConsoleTypeLabel = QtWidgets.QLabel(self.uiGeneralGroupBox)
|
||||
self.uiConsoleTypeLabel = QtWidgets.QLabel(parent=self.uiGeneralGroupBox)
|
||||
self.uiConsoleTypeLabel.setObjectName("uiConsoleTypeLabel")
|
||||
self.gridLayout.addWidget(self.uiConsoleTypeLabel, 4, 0, 1, 1)
|
||||
self.uiConsoleTypeComboBox = QtWidgets.QComboBox(self.uiGeneralGroupBox)
|
||||
self.uiConsoleTypeComboBox = QtWidgets.QComboBox(parent=self.uiGeneralGroupBox)
|
||||
self.uiConsoleTypeComboBox.setObjectName("uiConsoleTypeComboBox")
|
||||
self.uiConsoleTypeComboBox.addItem("")
|
||||
self.uiConsoleTypeComboBox.addItem("")
|
||||
self.gridLayout.addWidget(self.uiConsoleTypeComboBox, 4, 1, 1, 1)
|
||||
self.gridLayout_2.addWidget(self.uiGeneralGroupBox, 0, 0, 1, 2)
|
||||
self.uiEthernetSwitchSettingsGroupBox = QtWidgets.QGroupBox(ethernetSwitchConfigPageWidget)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Preferred)
|
||||
self.uiEthernetSwitchSettingsGroupBox = QtWidgets.QGroupBox(parent=ethernetSwitchConfigPageWidget)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.uiEthernetSwitchSettingsGroupBox.sizePolicy().hasHeightForWidth())
|
||||
@@ -67,11 +68,11 @@ class Ui_ethernetSwitchConfigPageWidget(object):
|
||||
self.uiEthernetSwitchSettingsGroupBox.setObjectName("uiEthernetSwitchSettingsGroupBox")
|
||||
self.gridlayout = QtWidgets.QGridLayout(self.uiEthernetSwitchSettingsGroupBox)
|
||||
self.gridlayout.setObjectName("gridlayout")
|
||||
self.label = QtWidgets.QLabel(self.uiEthernetSwitchSettingsGroupBox)
|
||||
self.label = QtWidgets.QLabel(parent=self.uiEthernetSwitchSettingsGroupBox)
|
||||
self.label.setObjectName("label")
|
||||
self.gridlayout.addWidget(self.label, 0, 0, 1, 1)
|
||||
self.uiPortSpinBox = QtWidgets.QSpinBox(self.uiEthernetSwitchSettingsGroupBox)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
|
||||
self.uiPortSpinBox = QtWidgets.QSpinBox(parent=self.uiEthernetSwitchSettingsGroupBox)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.uiPortSpinBox.sizePolicy().hasHeightForWidth())
|
||||
@@ -81,11 +82,11 @@ class Ui_ethernetSwitchConfigPageWidget(object):
|
||||
self.uiPortSpinBox.setProperty("value", 0)
|
||||
self.uiPortSpinBox.setObjectName("uiPortSpinBox")
|
||||
self.gridlayout.addWidget(self.uiPortSpinBox, 0, 1, 1, 1)
|
||||
self.label_3 = QtWidgets.QLabel(self.uiEthernetSwitchSettingsGroupBox)
|
||||
self.label_3 = QtWidgets.QLabel(parent=self.uiEthernetSwitchSettingsGroupBox)
|
||||
self.label_3.setObjectName("label_3")
|
||||
self.gridlayout.addWidget(self.label_3, 1, 0, 1, 1)
|
||||
self.uiVlanSpinBox = QtWidgets.QSpinBox(self.uiEthernetSwitchSettingsGroupBox)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
|
||||
self.uiVlanSpinBox = QtWidgets.QSpinBox(parent=self.uiEthernetSwitchSettingsGroupBox)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.uiVlanSpinBox.sizePolicy().hasHeightForWidth())
|
||||
@@ -95,19 +96,19 @@ class Ui_ethernetSwitchConfigPageWidget(object):
|
||||
self.uiVlanSpinBox.setProperty("value", 1)
|
||||
self.uiVlanSpinBox.setObjectName("uiVlanSpinBox")
|
||||
self.gridlayout.addWidget(self.uiVlanSpinBox, 1, 1, 1, 1)
|
||||
self.label_2 = QtWidgets.QLabel(self.uiEthernetSwitchSettingsGroupBox)
|
||||
self.label_2 = QtWidgets.QLabel(parent=self.uiEthernetSwitchSettingsGroupBox)
|
||||
self.label_2.setObjectName("label_2")
|
||||
self.gridlayout.addWidget(self.label_2, 2, 0, 1, 1)
|
||||
self.label_4 = QtWidgets.QLabel(self.uiEthernetSwitchSettingsGroupBox)
|
||||
self.label_4 = QtWidgets.QLabel(parent=self.uiEthernetSwitchSettingsGroupBox)
|
||||
self.label_4.setObjectName("label_4")
|
||||
self.gridlayout.addWidget(self.label_4, 3, 0, 1, 1)
|
||||
self.uiPortTypeComboBox = QtWidgets.QComboBox(self.uiEthernetSwitchSettingsGroupBox)
|
||||
self.uiPortTypeComboBox = QtWidgets.QComboBox(parent=self.uiEthernetSwitchSettingsGroupBox)
|
||||
self.uiPortTypeComboBox.setObjectName("uiPortTypeComboBox")
|
||||
self.uiPortTypeComboBox.addItem("")
|
||||
self.uiPortTypeComboBox.addItem("")
|
||||
self.uiPortTypeComboBox.addItem("")
|
||||
self.gridlayout.addWidget(self.uiPortTypeComboBox, 2, 1, 1, 1)
|
||||
self.uiPortEtherTypeComboBox = QtWidgets.QComboBox(self.uiEthernetSwitchSettingsGroupBox)
|
||||
self.uiPortEtherTypeComboBox = QtWidgets.QComboBox(parent=self.uiEthernetSwitchSettingsGroupBox)
|
||||
self.uiPortEtherTypeComboBox.setEnabled(False)
|
||||
self.uiPortEtherTypeComboBox.setObjectName("uiPortEtherTypeComboBox")
|
||||
self.uiPortEtherTypeComboBox.addItem("")
|
||||
@@ -116,12 +117,12 @@ class Ui_ethernetSwitchConfigPageWidget(object):
|
||||
self.uiPortEtherTypeComboBox.addItem("")
|
||||
self.gridlayout.addWidget(self.uiPortEtherTypeComboBox, 3, 1, 1, 1)
|
||||
self.gridLayout_2.addWidget(self.uiEthernetSwitchSettingsGroupBox, 1, 0, 1, 1)
|
||||
self.uiEthernetSwitchPortsGroupBox = QtWidgets.QGroupBox(ethernetSwitchConfigPageWidget)
|
||||
self.uiEthernetSwitchPortsGroupBox = QtWidgets.QGroupBox(parent=ethernetSwitchConfigPageWidget)
|
||||
self.uiEthernetSwitchPortsGroupBox.setObjectName("uiEthernetSwitchPortsGroupBox")
|
||||
self.vboxlayout = QtWidgets.QVBoxLayout(self.uiEthernetSwitchPortsGroupBox)
|
||||
self.vboxlayout.setObjectName("vboxlayout")
|
||||
self.uiPortsTreeWidget = QtWidgets.QTreeWidget(self.uiEthernetSwitchPortsGroupBox)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
|
||||
self.uiPortsTreeWidget = QtWidgets.QTreeWidget(parent=self.uiEthernetSwitchPortsGroupBox)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Expanding)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.uiPortsTreeWidget.sizePolicy().hasHeightForWidth())
|
||||
@@ -132,17 +133,17 @@ class Ui_ethernetSwitchConfigPageWidget(object):
|
||||
self.gridLayout_2.addWidget(self.uiEthernetSwitchPortsGroupBox, 1, 1, 2, 1)
|
||||
self.horizontalLayout = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout.setObjectName("horizontalLayout")
|
||||
self.uiAddPushButton = QtWidgets.QPushButton(ethernetSwitchConfigPageWidget)
|
||||
self.uiAddPushButton = QtWidgets.QPushButton(parent=ethernetSwitchConfigPageWidget)
|
||||
self.uiAddPushButton.setObjectName("uiAddPushButton")
|
||||
self.horizontalLayout.addWidget(self.uiAddPushButton)
|
||||
self.uiDeletePushButton = QtWidgets.QPushButton(ethernetSwitchConfigPageWidget)
|
||||
self.uiDeletePushButton = QtWidgets.QPushButton(parent=ethernetSwitchConfigPageWidget)
|
||||
self.uiDeletePushButton.setEnabled(False)
|
||||
self.uiDeletePushButton.setObjectName("uiDeletePushButton")
|
||||
self.horizontalLayout.addWidget(self.uiDeletePushButton)
|
||||
self.gridLayout_2.addLayout(self.horizontalLayout, 2, 0, 1, 1)
|
||||
spacerItem = QtWidgets.QSpacerItem(20, 71, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
|
||||
spacerItem = QtWidgets.QSpacerItem(20, 71, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding)
|
||||
self.gridLayout_2.addItem(spacerItem, 3, 0, 1, 1)
|
||||
spacerItem1 = QtWidgets.QSpacerItem(20, 20, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
|
||||
spacerItem1 = QtWidgets.QSpacerItem(20, 20, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding)
|
||||
self.gridLayout_2.addItem(spacerItem1, 3, 1, 1, 1)
|
||||
|
||||
self.retranslateUi(ethernetSwitchConfigPageWidget)
|
||||
@@ -184,4 +185,3 @@ class Ui_ethernetSwitchConfigPageWidget(object):
|
||||
self.uiPortsTreeWidget.headerItem().setText(3, _translate("ethernetSwitchConfigPageWidget", "EtherType"))
|
||||
self.uiAddPushButton.setText(_translate("ethernetSwitchConfigPageWidget", "&Add"))
|
||||
self.uiDeletePushButton.setText(_translate("ethernetSwitchConfigPageWidget", "&Delete"))
|
||||
|
||||
|
||||
@@ -35,13 +35,6 @@
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>11</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="selectionMode">
|
||||
<enum>QAbstractItemView::ExtendedSelection</enum>
|
||||
</property>
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file '/home/grossmj/PycharmProjects/gns3-gui/gns3/modules/builtin/ui/ethernet_switch_preferences_page.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.9
|
||||
# Created by: PyQt6 UI code generator 6.10.1
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
|
||||
# run again. Do not edit this file unless you know what you are doing.
|
||||
|
||||
|
||||
from PyQt6 import QtCore, QtGui, QtWidgets
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
class Ui_EthernetSwitchPreferencesPageWidget(object):
|
||||
def setupUi(self, EthernetSwitchPreferencesPageWidget):
|
||||
@@ -14,34 +15,29 @@ class Ui_EthernetSwitchPreferencesPageWidget(object):
|
||||
EthernetSwitchPreferencesPageWidget.resize(546, 455)
|
||||
self.verticalLayout_2 = QtWidgets.QVBoxLayout(EthernetSwitchPreferencesPageWidget)
|
||||
self.verticalLayout_2.setObjectName("verticalLayout_2")
|
||||
self.splitter = QtWidgets.QSplitter(EthernetSwitchPreferencesPageWidget)
|
||||
self.splitter.setOrientation(QtCore.Qt.Horizontal)
|
||||
self.splitter = QtWidgets.QSplitter(parent=EthernetSwitchPreferencesPageWidget)
|
||||
self.splitter.setOrientation(QtCore.Qt.Orientation.Horizontal)
|
||||
self.splitter.setObjectName("splitter")
|
||||
self.uiEthernetSwitchesTreeWidget = QtWidgets.QTreeWidget(self.splitter)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Expanding)
|
||||
self.uiEthernetSwitchesTreeWidget = QtWidgets.QTreeWidget(parent=self.splitter)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Preferred, QtWidgets.QSizePolicy.Policy.Expanding)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.uiEthernetSwitchesTreeWidget.sizePolicy().hasHeightForWidth())
|
||||
self.uiEthernetSwitchesTreeWidget.setSizePolicy(sizePolicy)
|
||||
self.uiEthernetSwitchesTreeWidget.setMaximumSize(QtCore.QSize(160, 16777215))
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(11)
|
||||
font.setBold(True)
|
||||
font.setWeight(75)
|
||||
self.uiEthernetSwitchesTreeWidget.setFont(font)
|
||||
self.uiEthernetSwitchesTreeWidget.setSelectionMode(QtWidgets.QAbstractItemView.ExtendedSelection)
|
||||
self.uiEthernetSwitchesTreeWidget.setSelectionMode(QtWidgets.QAbstractItemView.SelectionMode.ExtendedSelection)
|
||||
self.uiEthernetSwitchesTreeWidget.setIconSize(QtCore.QSize(32, 32))
|
||||
self.uiEthernetSwitchesTreeWidget.setRootIsDecorated(False)
|
||||
self.uiEthernetSwitchesTreeWidget.setObjectName("uiEthernetSwitchesTreeWidget")
|
||||
self.uiEthernetSwitchesTreeWidget.headerItem().setText(0, "1")
|
||||
self.uiEthernetSwitchesTreeWidget.header().setVisible(False)
|
||||
self.layoutWidget = QtWidgets.QWidget(self.splitter)
|
||||
self.layoutWidget = QtWidgets.QWidget(parent=self.splitter)
|
||||
self.layoutWidget.setObjectName("layoutWidget")
|
||||
self.verticalLayout = QtWidgets.QVBoxLayout(self.layoutWidget)
|
||||
self.verticalLayout.setContentsMargins(0, 0, 0, 0)
|
||||
self.verticalLayout.setObjectName("verticalLayout")
|
||||
self.uiEthernetSwitchInfoTreeWidget = QtWidgets.QTreeWidget(self.layoutWidget)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Expanding)
|
||||
self.uiEthernetSwitchInfoTreeWidget = QtWidgets.QTreeWidget(parent=self.layoutWidget)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.MinimumExpanding, QtWidgets.QSizePolicy.Policy.Expanding)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.uiEthernetSwitchInfoTreeWidget.sizePolicy().hasHeightForWidth())
|
||||
@@ -53,14 +49,14 @@ class Ui_EthernetSwitchPreferencesPageWidget(object):
|
||||
self.verticalLayout.addWidget(self.uiEthernetSwitchInfoTreeWidget)
|
||||
self.horizontalLayout_5 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_5.setObjectName("horizontalLayout_5")
|
||||
self.uiNewEthernetSwitchPushButton = QtWidgets.QPushButton(self.layoutWidget)
|
||||
self.uiNewEthernetSwitchPushButton = QtWidgets.QPushButton(parent=self.layoutWidget)
|
||||
self.uiNewEthernetSwitchPushButton.setObjectName("uiNewEthernetSwitchPushButton")
|
||||
self.horizontalLayout_5.addWidget(self.uiNewEthernetSwitchPushButton)
|
||||
self.uiEditEthernetSwitchPushButton = QtWidgets.QPushButton(self.layoutWidget)
|
||||
self.uiEditEthernetSwitchPushButton = QtWidgets.QPushButton(parent=self.layoutWidget)
|
||||
self.uiEditEthernetSwitchPushButton.setEnabled(False)
|
||||
self.uiEditEthernetSwitchPushButton.setObjectName("uiEditEthernetSwitchPushButton")
|
||||
self.horizontalLayout_5.addWidget(self.uiEditEthernetSwitchPushButton)
|
||||
self.uiDeleteEthernetSwitchPushButton = QtWidgets.QPushButton(self.layoutWidget)
|
||||
self.uiDeleteEthernetSwitchPushButton = QtWidgets.QPushButton(parent=self.layoutWidget)
|
||||
self.uiDeleteEthernetSwitchPushButton.setEnabled(False)
|
||||
self.uiDeleteEthernetSwitchPushButton.setObjectName("uiDeleteEthernetSwitchPushButton")
|
||||
self.horizontalLayout_5.addWidget(self.uiDeleteEthernetSwitchPushButton)
|
||||
@@ -80,4 +76,3 @@ class Ui_EthernetSwitchPreferencesPageWidget(object):
|
||||
self.uiNewEthernetSwitchPushButton.setText(_translate("EthernetSwitchPreferencesPageWidget", "&New"))
|
||||
self.uiEditEthernetSwitchPushButton.setText(_translate("EthernetSwitchPreferencesPageWidget", "&Edit"))
|
||||
self.uiDeleteEthernetSwitchPushButton.setText(_translate("EthernetSwitchPreferencesPageWidget", "&Delete"))
|
||||
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file '/home/grossmj/PycharmProjects/gns3-gui/gns3/modules/builtin/ui/ethernet_switch_wizard.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.9
|
||||
# Created by: PyQt6 UI code generator 6.10.1
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
|
||||
# run again. Do not edit this file unless you know what you are doing.
|
||||
|
||||
|
||||
from PyQt6 import QtCore, QtGui, QtWidgets
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
class Ui_EthernetSwitchWizard(object):
|
||||
def setupUi(self, EthernetSwitchWizard):
|
||||
@@ -17,31 +18,31 @@ class Ui_EthernetSwitchWizard(object):
|
||||
self.uiServerWizardPage.setObjectName("uiServerWizardPage")
|
||||
self.gridLayout_2 = QtWidgets.QGridLayout(self.uiServerWizardPage)
|
||||
self.gridLayout_2.setObjectName("gridLayout_2")
|
||||
self.uiServerTypeGroupBox = QtWidgets.QGroupBox(self.uiServerWizardPage)
|
||||
self.uiServerTypeGroupBox = QtWidgets.QGroupBox(parent=self.uiServerWizardPage)
|
||||
self.uiServerTypeGroupBox.setObjectName("uiServerTypeGroupBox")
|
||||
self.verticalLayout = QtWidgets.QVBoxLayout(self.uiServerTypeGroupBox)
|
||||
self.verticalLayout.setObjectName("verticalLayout")
|
||||
self.uiRemoteRadioButton = QtWidgets.QRadioButton(self.uiServerTypeGroupBox)
|
||||
self.uiRemoteRadioButton = QtWidgets.QRadioButton(parent=self.uiServerTypeGroupBox)
|
||||
self.uiRemoteRadioButton.setChecked(True)
|
||||
self.uiRemoteRadioButton.setObjectName("uiRemoteRadioButton")
|
||||
self.verticalLayout.addWidget(self.uiRemoteRadioButton)
|
||||
self.uiVMRadioButton = QtWidgets.QRadioButton(self.uiServerTypeGroupBox)
|
||||
self.uiVMRadioButton = QtWidgets.QRadioButton(parent=self.uiServerTypeGroupBox)
|
||||
self.uiVMRadioButton.setObjectName("uiVMRadioButton")
|
||||
self.verticalLayout.addWidget(self.uiVMRadioButton)
|
||||
self.uiLocalRadioButton = QtWidgets.QRadioButton(self.uiServerTypeGroupBox)
|
||||
self.uiLocalRadioButton = QtWidgets.QRadioButton(parent=self.uiServerTypeGroupBox)
|
||||
self.uiLocalRadioButton.setObjectName("uiLocalRadioButton")
|
||||
self.verticalLayout.addWidget(self.uiLocalRadioButton)
|
||||
self.gridLayout_2.addWidget(self.uiServerTypeGroupBox, 0, 0, 1, 1)
|
||||
self.uiRemoteServersGroupBox = QtWidgets.QGroupBox(self.uiServerWizardPage)
|
||||
self.uiRemoteServersGroupBox = QtWidgets.QGroupBox(parent=self.uiServerWizardPage)
|
||||
self.uiRemoteServersGroupBox.setObjectName("uiRemoteServersGroupBox")
|
||||
self.gridLayout_7 = QtWidgets.QGridLayout(self.uiRemoteServersGroupBox)
|
||||
self.gridLayout_7.setObjectName("gridLayout_7")
|
||||
self.uiRemoteServersLabel = QtWidgets.QLabel(self.uiRemoteServersGroupBox)
|
||||
self.uiRemoteServersLabel = QtWidgets.QLabel(parent=self.uiRemoteServersGroupBox)
|
||||
self.uiRemoteServersLabel.setObjectName("uiRemoteServersLabel")
|
||||
self.gridLayout_7.addWidget(self.uiRemoteServersLabel, 0, 0, 1, 1)
|
||||
self.uiRemoteServersComboBox = QtWidgets.QComboBox(self.uiRemoteServersGroupBox)
|
||||
self.uiRemoteServersComboBox = QtWidgets.QComboBox(parent=self.uiRemoteServersGroupBox)
|
||||
self.uiRemoteServersComboBox.setEnabled(False)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.uiRemoteServersComboBox.sizePolicy().hasHeightForWidth())
|
||||
@@ -54,14 +55,14 @@ class Ui_EthernetSwitchWizard(object):
|
||||
self.uiNameWizardPage.setObjectName("uiNameWizardPage")
|
||||
self.gridLayout = QtWidgets.QGridLayout(self.uiNameWizardPage)
|
||||
self.gridLayout.setObjectName("gridLayout")
|
||||
self.uiNameLabel = QtWidgets.QLabel(self.uiNameWizardPage)
|
||||
self.uiNameLabel = QtWidgets.QLabel(parent=self.uiNameWizardPage)
|
||||
self.uiNameLabel.setObjectName("uiNameLabel")
|
||||
self.gridLayout.addWidget(self.uiNameLabel, 0, 0, 1, 1)
|
||||
self.uiPortsLabel = QtWidgets.QLabel(self.uiNameWizardPage)
|
||||
self.uiPortsLabel = QtWidgets.QLabel(parent=self.uiNameWizardPage)
|
||||
self.uiPortsLabel.setObjectName("uiPortsLabel")
|
||||
self.gridLayout.addWidget(self.uiPortsLabel, 1, 0, 1, 2)
|
||||
self.uiPortsSpinBox = QtWidgets.QSpinBox(self.uiNameWizardPage)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
|
||||
self.uiPortsSpinBox = QtWidgets.QSpinBox(parent=self.uiNameWizardPage)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.uiPortsSpinBox.sizePolicy().hasHeightForWidth())
|
||||
@@ -71,7 +72,7 @@ class Ui_EthernetSwitchWizard(object):
|
||||
self.uiPortsSpinBox.setProperty("value", 8)
|
||||
self.uiPortsSpinBox.setObjectName("uiPortsSpinBox")
|
||||
self.gridLayout.addWidget(self.uiPortsSpinBox, 1, 2, 1, 1)
|
||||
self.uiNameLineEdit = QtWidgets.QLineEdit(self.uiNameWizardPage)
|
||||
self.uiNameLineEdit = QtWidgets.QLineEdit(parent=self.uiNameWizardPage)
|
||||
self.uiNameLineEdit.setObjectName("uiNameLineEdit")
|
||||
self.gridLayout.addWidget(self.uiNameLineEdit, 0, 2, 1, 1)
|
||||
EthernetSwitchWizard.addPage(self.uiNameWizardPage)
|
||||
@@ -94,4 +95,3 @@ class Ui_EthernetSwitchWizard(object):
|
||||
self.uiNameWizardPage.setSubTitle(_translate("EthernetSwitchWizard", "Please choose a descriptive name for the new Ethernet switch."))
|
||||
self.uiNameLabel.setText(_translate("EthernetSwitchWizard", "Name:"))
|
||||
self.uiPortsLabel.setText(_translate("EthernetSwitchWizard", "Number of ports:"))
|
||||
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file '/home/dominik/projects/gns3-gui/gns3/modules/builtin/ui/frame_relay_switch_configuration_page.ui'
|
||||
# Form implementation generated from reading ui file '/home/grossmj/PycharmProjects/gns3-gui/gns3/modules/builtin/ui/frame_relay_switch_configuration_page.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.8.2
|
||||
# Created by: PyQt6 UI code generator 6.10.1
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
|
||||
# run again. Do not edit this file unless you know what you are doing.
|
||||
|
||||
|
||||
from PyQt6 import QtCore, QtGui, QtWidgets
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
class Ui_frameRelaySwitchConfigPageWidget(object):
|
||||
def setupUi(self, frameRelaySwitchConfigPageWidget):
|
||||
@@ -14,23 +15,23 @@ class Ui_frameRelaySwitchConfigPageWidget(object):
|
||||
frameRelaySwitchConfigPageWidget.resize(499, 414)
|
||||
self.gridLayout_2 = QtWidgets.QGridLayout(frameRelaySwitchConfigPageWidget)
|
||||
self.gridLayout_2.setObjectName("gridLayout_2")
|
||||
self.uiGeneralGroupBox = QtWidgets.QGroupBox(frameRelaySwitchConfigPageWidget)
|
||||
self.uiGeneralGroupBox = QtWidgets.QGroupBox(parent=frameRelaySwitchConfigPageWidget)
|
||||
self.uiGeneralGroupBox.setObjectName("uiGeneralGroupBox")
|
||||
self.gridLayout = QtWidgets.QGridLayout(self.uiGeneralGroupBox)
|
||||
self.gridLayout.setObjectName("gridLayout")
|
||||
self.uiNameLabel = QtWidgets.QLabel(self.uiGeneralGroupBox)
|
||||
self.uiNameLabel = QtWidgets.QLabel(parent=self.uiGeneralGroupBox)
|
||||
self.uiNameLabel.setObjectName("uiNameLabel")
|
||||
self.gridLayout.addWidget(self.uiNameLabel, 0, 0, 1, 1)
|
||||
self.uiNameLineEdit = QtWidgets.QLineEdit(self.uiGeneralGroupBox)
|
||||
self.uiNameLineEdit = QtWidgets.QLineEdit(parent=self.uiGeneralGroupBox)
|
||||
self.uiNameLineEdit.setObjectName("uiNameLineEdit")
|
||||
self.gridLayout.addWidget(self.uiNameLineEdit, 0, 1, 1, 1)
|
||||
self.gridLayout_2.addWidget(self.uiGeneralGroupBox, 0, 0, 1, 2)
|
||||
self.uiFrameRelayMappingGroupBox = QtWidgets.QGroupBox(frameRelaySwitchConfigPageWidget)
|
||||
self.uiFrameRelayMappingGroupBox = QtWidgets.QGroupBox(parent=frameRelaySwitchConfigPageWidget)
|
||||
self.uiFrameRelayMappingGroupBox.setObjectName("uiFrameRelayMappingGroupBox")
|
||||
self.vboxlayout = QtWidgets.QVBoxLayout(self.uiFrameRelayMappingGroupBox)
|
||||
self.vboxlayout.setObjectName("vboxlayout")
|
||||
self.uiMappingTreeWidget = QtWidgets.QTreeWidget(self.uiFrameRelayMappingGroupBox)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
|
||||
self.uiMappingTreeWidget = QtWidgets.QTreeWidget(parent=self.uiFrameRelayMappingGroupBox)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Expanding)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.uiMappingTreeWidget.sizePolicy().hasHeightForWidth())
|
||||
@@ -39,8 +40,8 @@ class Ui_frameRelaySwitchConfigPageWidget(object):
|
||||
self.uiMappingTreeWidget.setObjectName("uiMappingTreeWidget")
|
||||
self.vboxlayout.addWidget(self.uiMappingTreeWidget)
|
||||
self.gridLayout_2.addWidget(self.uiFrameRelayMappingGroupBox, 0, 2, 4, 1)
|
||||
self.uiFrameRelaySourceGroupBox = QtWidgets.QGroupBox(frameRelaySwitchConfigPageWidget)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Preferred)
|
||||
self.uiFrameRelaySourceGroupBox = QtWidgets.QGroupBox(parent=frameRelaySwitchConfigPageWidget)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.uiFrameRelaySourceGroupBox.sizePolicy().hasHeightForWidth())
|
||||
@@ -48,11 +49,11 @@ class Ui_frameRelaySwitchConfigPageWidget(object):
|
||||
self.uiFrameRelaySourceGroupBox.setObjectName("uiFrameRelaySourceGroupBox")
|
||||
self.gridlayout = QtWidgets.QGridLayout(self.uiFrameRelaySourceGroupBox)
|
||||
self.gridlayout.setObjectName("gridlayout")
|
||||
self.uiSourcePortLabel = QtWidgets.QLabel(self.uiFrameRelaySourceGroupBox)
|
||||
self.uiSourcePortLabel = QtWidgets.QLabel(parent=self.uiFrameRelaySourceGroupBox)
|
||||
self.uiSourcePortLabel.setObjectName("uiSourcePortLabel")
|
||||
self.gridlayout.addWidget(self.uiSourcePortLabel, 0, 0, 1, 1)
|
||||
self.uiSourcePortSpinBox = QtWidgets.QSpinBox(self.uiFrameRelaySourceGroupBox)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
|
||||
self.uiSourcePortSpinBox = QtWidgets.QSpinBox(parent=self.uiFrameRelaySourceGroupBox)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.uiSourcePortSpinBox.sizePolicy().hasHeightForWidth())
|
||||
@@ -62,11 +63,11 @@ class Ui_frameRelaySwitchConfigPageWidget(object):
|
||||
self.uiSourcePortSpinBox.setProperty("value", 1)
|
||||
self.uiSourcePortSpinBox.setObjectName("uiSourcePortSpinBox")
|
||||
self.gridlayout.addWidget(self.uiSourcePortSpinBox, 0, 1, 1, 1)
|
||||
self.uiSourceDLCILabel = QtWidgets.QLabel(self.uiFrameRelaySourceGroupBox)
|
||||
self.uiSourceDLCILabel = QtWidgets.QLabel(parent=self.uiFrameRelaySourceGroupBox)
|
||||
self.uiSourceDLCILabel.setObjectName("uiSourceDLCILabel")
|
||||
self.gridlayout.addWidget(self.uiSourceDLCILabel, 1, 0, 1, 1)
|
||||
self.uiSourceDLCISpinBox = QtWidgets.QSpinBox(self.uiFrameRelaySourceGroupBox)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
|
||||
self.uiSourceDLCISpinBox = QtWidgets.QSpinBox(parent=self.uiFrameRelaySourceGroupBox)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.uiSourceDLCISpinBox.sizePolicy().hasHeightForWidth())
|
||||
@@ -76,8 +77,8 @@ class Ui_frameRelaySwitchConfigPageWidget(object):
|
||||
self.uiSourceDLCISpinBox.setObjectName("uiSourceDLCISpinBox")
|
||||
self.gridlayout.addWidget(self.uiSourceDLCISpinBox, 1, 1, 1, 1)
|
||||
self.gridLayout_2.addWidget(self.uiFrameRelaySourceGroupBox, 1, 0, 1, 2)
|
||||
self.uiFrameRelayDestinationGroupBox = QtWidgets.QGroupBox(frameRelaySwitchConfigPageWidget)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Preferred)
|
||||
self.uiFrameRelayDestinationGroupBox = QtWidgets.QGroupBox(parent=frameRelaySwitchConfigPageWidget)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.uiFrameRelayDestinationGroupBox.sizePolicy().hasHeightForWidth())
|
||||
@@ -85,11 +86,11 @@ class Ui_frameRelaySwitchConfigPageWidget(object):
|
||||
self.uiFrameRelayDestinationGroupBox.setObjectName("uiFrameRelayDestinationGroupBox")
|
||||
self.gridlayout1 = QtWidgets.QGridLayout(self.uiFrameRelayDestinationGroupBox)
|
||||
self.gridlayout1.setObjectName("gridlayout1")
|
||||
self.uiDestinationPortLabel = QtWidgets.QLabel(self.uiFrameRelayDestinationGroupBox)
|
||||
self.uiDestinationPortLabel = QtWidgets.QLabel(parent=self.uiFrameRelayDestinationGroupBox)
|
||||
self.uiDestinationPortLabel.setObjectName("uiDestinationPortLabel")
|
||||
self.gridlayout1.addWidget(self.uiDestinationPortLabel, 0, 0, 1, 1)
|
||||
self.uiDestinationPortSpinBox = QtWidgets.QSpinBox(self.uiFrameRelayDestinationGroupBox)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
|
||||
self.uiDestinationPortSpinBox = QtWidgets.QSpinBox(parent=self.uiFrameRelayDestinationGroupBox)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.uiDestinationPortSpinBox.sizePolicy().hasHeightForWidth())
|
||||
@@ -99,11 +100,11 @@ class Ui_frameRelaySwitchConfigPageWidget(object):
|
||||
self.uiDestinationPortSpinBox.setProperty("value", 10)
|
||||
self.uiDestinationPortSpinBox.setObjectName("uiDestinationPortSpinBox")
|
||||
self.gridlayout1.addWidget(self.uiDestinationPortSpinBox, 0, 1, 1, 1)
|
||||
self.uiDestinationDLCILabel = QtWidgets.QLabel(self.uiFrameRelayDestinationGroupBox)
|
||||
self.uiDestinationDLCILabel = QtWidgets.QLabel(parent=self.uiFrameRelayDestinationGroupBox)
|
||||
self.uiDestinationDLCILabel.setObjectName("uiDestinationDLCILabel")
|
||||
self.gridlayout1.addWidget(self.uiDestinationDLCILabel, 1, 0, 1, 1)
|
||||
self.uiDestinationDLCISpinBox = QtWidgets.QSpinBox(self.uiFrameRelayDestinationGroupBox)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
|
||||
self.uiDestinationDLCISpinBox = QtWidgets.QSpinBox(parent=self.uiFrameRelayDestinationGroupBox)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.uiDestinationDLCISpinBox.sizePolicy().hasHeightForWidth())
|
||||
@@ -113,14 +114,14 @@ class Ui_frameRelaySwitchConfigPageWidget(object):
|
||||
self.uiDestinationDLCISpinBox.setObjectName("uiDestinationDLCISpinBox")
|
||||
self.gridlayout1.addWidget(self.uiDestinationDLCISpinBox, 1, 1, 1, 1)
|
||||
self.gridLayout_2.addWidget(self.uiFrameRelayDestinationGroupBox, 2, 0, 1, 2)
|
||||
self.uiAddPushButton = QtWidgets.QPushButton(frameRelaySwitchConfigPageWidget)
|
||||
self.uiAddPushButton = QtWidgets.QPushButton(parent=frameRelaySwitchConfigPageWidget)
|
||||
self.uiAddPushButton.setObjectName("uiAddPushButton")
|
||||
self.gridLayout_2.addWidget(self.uiAddPushButton, 3, 0, 1, 1)
|
||||
self.uiDeletePushButton = QtWidgets.QPushButton(frameRelaySwitchConfigPageWidget)
|
||||
self.uiDeletePushButton = QtWidgets.QPushButton(parent=frameRelaySwitchConfigPageWidget)
|
||||
self.uiDeletePushButton.setEnabled(False)
|
||||
self.uiDeletePushButton.setObjectName("uiDeletePushButton")
|
||||
self.gridLayout_2.addWidget(self.uiDeletePushButton, 3, 1, 1, 1)
|
||||
spacerItem = QtWidgets.QSpacerItem(20, 20, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
|
||||
spacerItem = QtWidgets.QSpacerItem(20, 20, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding)
|
||||
self.gridLayout_2.addItem(spacerItem, 4, 2, 1, 1)
|
||||
|
||||
self.retranslateUi(frameRelaySwitchConfigPageWidget)
|
||||
@@ -148,4 +149,3 @@ class Ui_frameRelaySwitchConfigPageWidget(object):
|
||||
self.uiDestinationDLCILabel.setText(_translate("frameRelaySwitchConfigPageWidget", "DLCI:"))
|
||||
self.uiAddPushButton.setText(_translate("frameRelaySwitchConfigPageWidget", "&Add"))
|
||||
self.uiDeletePushButton.setText(_translate("frameRelaySwitchConfigPageWidget", "&Delete"))
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ class DockerVMWizard(VMWizard, Ui_DockerVMWizard):
|
||||
|
||||
super().__init__(docker_containers, parent)
|
||||
self._docker_containers = docker_containers
|
||||
self.setPixmap(QtWidgets.QWizard.LogoPixmap, QtGui.QPixmap(":/symbols/docker_guest.svg"))
|
||||
self.setPixmap(QtWidgets.QWizard.WizardPixmap.LogoPixmap, QtGui.QPixmap(":/symbols/docker_guest.svg"))
|
||||
|
||||
self.uiNewImageRadioButton.setChecked(True)
|
||||
self._existingImageRadioButtonToggledSlot(False)
|
||||
|
||||
@@ -59,7 +59,7 @@ class DockerVMConfigurationPage(QtWidgets.QWidget, Ui_dockerVMConfigPageWidget):
|
||||
symbol_path = self.uiSymbolLineEdit.text()
|
||||
dialog = SymbolSelectionDialog(self, symbol=symbol_path)
|
||||
dialog.show()
|
||||
if dialog.exec_():
|
||||
if dialog.exec():
|
||||
new_symbol_path = dialog.getSymbol()
|
||||
self.uiSymbolLineEdit.setText(new_symbol_path)
|
||||
self.uiSymbolLineEdit.setToolTip('<img src="{}"/>'.format(new_symbol_path))
|
||||
@@ -91,7 +91,7 @@ class DockerVMConfigurationPage(QtWidgets.QWidget, Ui_dockerVMConfigPageWidget):
|
||||
|
||||
dialog = CustomAdaptersConfigurationDialog(ports, self._custom_adapters, "TAP", {"TAP": "Default"}, base_mac_address, parent=self)
|
||||
dialog.show()
|
||||
dialog.exec_()
|
||||
dialog.exec()
|
||||
|
||||
def loadSettings(self, settings, node=None, group=False):
|
||||
"""
|
||||
|
||||
@@ -127,7 +127,7 @@ class DockerVMPreferencesPage(QtWidgets.QWidget, Ui_DockerVMPreferencesPageWidge
|
||||
self.uiCopyDockerVMPushButton.setEnabled(single_selected)
|
||||
|
||||
if single_selected:
|
||||
key = selection[0].data(0, QtCore.Qt.UserRole)
|
||||
key = selection[0].data(0, QtCore.Qt.ItemDataRole.UserRole)
|
||||
docker_container = self._docker_containers[key]
|
||||
self._refreshInfo(docker_container)
|
||||
else:
|
||||
@@ -139,7 +139,7 @@ class DockerVMPreferencesPage(QtWidgets.QWidget, Ui_DockerVMPreferencesPageWidge
|
||||
"""
|
||||
wizard = DockerVMWizard(self._docker_containers, parent=self)
|
||||
wizard.show()
|
||||
if wizard.exec_():
|
||||
if wizard.exec():
|
||||
new_image_settings = wizard.getSettings()
|
||||
key = "{server}:{name}".format(server=new_image_settings["compute_id"], name=new_image_settings["name"])
|
||||
self._docker_containers[key] = DOCKER_CONTAINER_SETTINGS.copy()
|
||||
@@ -148,7 +148,7 @@ class DockerVMPreferencesPage(QtWidgets.QWidget, Ui_DockerVMPreferencesPageWidge
|
||||
item = QtWidgets.QTreeWidgetItem(self.uiDockerVMsTreeWidget)
|
||||
item.setText(0, self._docker_containers[key]["name"])
|
||||
Controller.instance().getSymbolIcon(self._docker_containers[key]["symbol"], qpartial(self._setItemIcon, item))
|
||||
item.setData(0, QtCore.Qt.UserRole, key)
|
||||
item.setData(0, QtCore.Qt.ItemDataRole.UserRole, key)
|
||||
self._items.append(item)
|
||||
self.uiDockerVMsTreeWidget.setCurrentItem(item)
|
||||
|
||||
@@ -159,9 +159,9 @@ class DockerVMPreferencesPage(QtWidgets.QWidget, Ui_DockerVMPreferencesPageWidge
|
||||
|
||||
item = self.uiDockerVMsTreeWidget.currentItem()
|
||||
if item:
|
||||
key = item.data(0, QtCore.Qt.UserRole)
|
||||
key = item.data(0, QtCore.Qt.ItemDataRole.UserRole)
|
||||
copied_containers_settings = copy.deepcopy(self._docker_containers[key])
|
||||
new_name, ok = QtWidgets.QInputDialog.getText(self, "Copy Docker template", "Template name:", QtWidgets.QLineEdit.Normal, "Copy of {}".format(copied_containers_settings["name"]))
|
||||
new_name, ok = QtWidgets.QInputDialog.getText(self, "Copy Docker template", "Template name:", QtWidgets.QLineEdit.EchoMode.Normal, "Copy of {}".format(copied_containers_settings["name"]))
|
||||
if ok:
|
||||
key = "{server}:{name}".format(server=copied_containers_settings["compute_id"], name=new_name)
|
||||
if key in self._docker_containers:
|
||||
@@ -175,7 +175,7 @@ class DockerVMPreferencesPage(QtWidgets.QWidget, Ui_DockerVMPreferencesPageWidge
|
||||
item = QtWidgets.QTreeWidgetItem(self.uiDockerVMsTreeWidget)
|
||||
item.setText(0, self._docker_containers[key]["name"])
|
||||
Controller.instance().getSymbolIcon(self._docker_containers[key]["symbol"], qpartial(self._setItemIcon, item))
|
||||
item.setData(0, QtCore.Qt.UserRole, key)
|
||||
item.setData(0, QtCore.Qt.ItemDataRole.UserRole, key)
|
||||
self._items.append(item)
|
||||
self.uiDockerVMsTreeWidget.setCurrentItem(item)
|
||||
|
||||
@@ -186,11 +186,11 @@ class DockerVMPreferencesPage(QtWidgets.QWidget, Ui_DockerVMPreferencesPageWidge
|
||||
|
||||
item = self.uiDockerVMsTreeWidget.currentItem()
|
||||
if item:
|
||||
key = item.data(0, QtCore.Qt.UserRole)
|
||||
key = item.data(0, QtCore.Qt.ItemDataRole.UserRole)
|
||||
docker_container = self._docker_containers[key]
|
||||
dialog = ConfigurationDialog(docker_container["name"], docker_container, DockerVMConfigurationPage(), parent=self)
|
||||
dialog.show()
|
||||
if dialog.exec_():
|
||||
if dialog.exec():
|
||||
# update the icon
|
||||
Controller.instance().getSymbolIcon(docker_container["symbol"], qpartial(self._setItemIcon, item))
|
||||
if docker_container["name"] != item.text(0):
|
||||
@@ -203,7 +203,7 @@ class DockerVMPreferencesPage(QtWidgets.QWidget, Ui_DockerVMPreferencesPageWidge
|
||||
self._docker_containers[new_key] = self._docker_containers[key]
|
||||
del self._docker_containers[key]
|
||||
item.setText(0, docker_container["name"])
|
||||
item.setData(0, QtCore.Qt.UserRole, new_key)
|
||||
item.setData(0, QtCore.Qt.ItemDataRole.UserRole, new_key)
|
||||
self._refreshInfo(docker_container)
|
||||
|
||||
def _dockerImageDeleteSlot(self):
|
||||
@@ -213,7 +213,7 @@ class DockerVMPreferencesPage(QtWidgets.QWidget, Ui_DockerVMPreferencesPageWidge
|
||||
|
||||
for item in self.uiDockerVMsTreeWidget.selectedItems():
|
||||
if item:
|
||||
key = item.data(0, QtCore.Qt.UserRole)
|
||||
key = item.data(0, QtCore.Qt.ItemDataRole.UserRole)
|
||||
del self._docker_containers[key]
|
||||
self.uiDockerVMsTreeWidget.takeTopLevelItem(self.uiDockerVMsTreeWidget.indexOfTopLevelItem(item))
|
||||
|
||||
@@ -237,12 +237,12 @@ class DockerVMPreferencesPage(QtWidgets.QWidget, Ui_DockerVMPreferencesPageWidge
|
||||
item = QtWidgets.QTreeWidgetItem(self.uiDockerVMsTreeWidget)
|
||||
item.setText(0, docker_container["name"])
|
||||
Controller.instance().getSymbolIcon(docker_container["symbol"], qpartial(self._setItemIcon, item))
|
||||
item.setData(0, QtCore.Qt.UserRole, key)
|
||||
item.setData(0, QtCore.Qt.ItemDataRole.UserRole, key)
|
||||
self._items.append(item)
|
||||
|
||||
if self._items:
|
||||
self.uiDockerVMsTreeWidget.setCurrentItem(self._items[0])
|
||||
self.uiDockerVMsTreeWidget.sortByColumn(0, QtCore.Qt.AscendingOrder)
|
||||
self.uiDockerVMsTreeWidget.sortByColumn(0, QtCore.Qt.SortOrder.AscendingOrder)
|
||||
self.uiDockerVMsTreeWidget.setMaximumWidth(self.uiDockerVMsTreeWidget.sizeHintForColumn(0) + 10)
|
||||
|
||||
def savePreferences(self):
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file '/home/grossmj/PycharmProjects/gns3-gui/gns3/modules/docker/ui/docker_preferences_page.ui'
|
||||
#
|
||||
# Created: Wed Dec 7 21:29:40 2016
|
||||
# by: PyQt5 UI code generator 5.2.1
|
||||
# Created by: PyQt6 UI code generator 6.10.1
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
|
||||
# run again. Do not edit this file unless you know what you are doing.
|
||||
|
||||
|
||||
from PyQt6 import QtCore, QtGui, QtWidgets
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
class Ui_DockerPreferencesPageWidget(object):
|
||||
def setupUi(self, DockerPreferencesPageWidget):
|
||||
@@ -15,23 +15,23 @@ class Ui_DockerPreferencesPageWidget(object):
|
||||
DockerPreferencesPageWidget.resize(330, 200)
|
||||
self.verticalLayout = QtWidgets.QVBoxLayout(DockerPreferencesPageWidget)
|
||||
self.verticalLayout.setObjectName("verticalLayout")
|
||||
self.uiTabWidget = QtWidgets.QTabWidget(DockerPreferencesPageWidget)
|
||||
self.uiTabWidget.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
|
||||
self.uiTabWidget = QtWidgets.QTabWidget(parent=DockerPreferencesPageWidget)
|
||||
self.uiTabWidget.setContextMenuPolicy(QtCore.Qt.ContextMenuPolicy.CustomContextMenu)
|
||||
self.uiTabWidget.setObjectName("uiTabWidget")
|
||||
self.uiServerSettingsTabWidget = QtWidgets.QWidget()
|
||||
self.uiServerSettingsTabWidget.setObjectName("uiServerSettingsTabWidget")
|
||||
self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.uiServerSettingsTabWidget)
|
||||
self.verticalLayout_2.setContentsMargins(10, 10, 10, 10)
|
||||
self.verticalLayout_2.setObjectName("verticalLayout_2")
|
||||
spacerItem = QtWidgets.QSpacerItem(20, 5, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
|
||||
spacerItem = QtWidgets.QSpacerItem(20, 5, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding)
|
||||
self.verticalLayout_2.addItem(spacerItem)
|
||||
self.uiTabWidget.addTab(self.uiServerSettingsTabWidget, "")
|
||||
self.verticalLayout.addWidget(self.uiTabWidget)
|
||||
self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
|
||||
spacerItem1 = QtWidgets.QSpacerItem(254, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
|
||||
spacerItem1 = QtWidgets.QSpacerItem(254, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
|
||||
self.horizontalLayout_2.addItem(spacerItem1)
|
||||
self.uiRestoreDefaultsPushButton = QtWidgets.QPushButton(DockerPreferencesPageWidget)
|
||||
self.uiRestoreDefaultsPushButton = QtWidgets.QPushButton(parent=DockerPreferencesPageWidget)
|
||||
self.uiRestoreDefaultsPushButton.setObjectName("uiRestoreDefaultsPushButton")
|
||||
self.horizontalLayout_2.addWidget(self.uiRestoreDefaultsPushButton)
|
||||
self.verticalLayout.addLayout(self.horizontalLayout_2)
|
||||
@@ -45,4 +45,3 @@ class Ui_DockerPreferencesPageWidget(object):
|
||||
DockerPreferencesPageWidget.setWindowTitle(_translate("DockerPreferencesPageWidget", "Docker"))
|
||||
self.uiTabWidget.setTabText(self.uiTabWidget.indexOf(self.uiServerSettingsTabWidget), _translate("DockerPreferencesPageWidget", "Local settings"))
|
||||
self.uiRestoreDefaultsPushButton.setText(_translate("DockerPreferencesPageWidget", "Restore defaults"))
|
||||
|
||||
|
||||
@@ -38,13 +38,6 @@
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>11</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="selectionMode">
|
||||
<enum>QAbstractItemView::ExtendedSelection</enum>
|
||||
</property>
|
||||
@@ -66,7 +59,7 @@
|
||||
</property>
|
||||
</column>
|
||||
</widget>
|
||||
<widget class="QWidget" name="">
|
||||
<widget class="QWidget" name="layoutWidget">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QTreeWidget" name="uiDockerVMInfoTreeWidget">
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file '/home/grossmj/PycharmProjects/gns3-gui/gns3/modules/docker/ui/docker_vm_preferences_page.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.9
|
||||
# Created by: PyQt6 UI code generator 6.10.1
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
|
||||
# run again. Do not edit this file unless you know what you are doing.
|
||||
|
||||
|
||||
from PyQt6 import QtCore, QtGui, QtWidgets
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
class Ui_DockerVMPreferencesPageWidget(object):
|
||||
def setupUi(self, DockerVMPreferencesPageWidget):
|
||||
@@ -15,34 +16,29 @@ class Ui_DockerVMPreferencesPageWidget(object):
|
||||
DockerVMPreferencesPageWidget.setAccessibleDescription("")
|
||||
self.verticalLayout_2 = QtWidgets.QVBoxLayout(DockerVMPreferencesPageWidget)
|
||||
self.verticalLayout_2.setObjectName("verticalLayout_2")
|
||||
self.splitter = QtWidgets.QSplitter(DockerVMPreferencesPageWidget)
|
||||
self.splitter.setOrientation(QtCore.Qt.Horizontal)
|
||||
self.splitter = QtWidgets.QSplitter(parent=DockerVMPreferencesPageWidget)
|
||||
self.splitter.setOrientation(QtCore.Qt.Orientation.Horizontal)
|
||||
self.splitter.setObjectName("splitter")
|
||||
self.uiDockerVMsTreeWidget = QtWidgets.QTreeWidget(self.splitter)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Expanding)
|
||||
self.uiDockerVMsTreeWidget = QtWidgets.QTreeWidget(parent=self.splitter)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Preferred, QtWidgets.QSizePolicy.Policy.Expanding)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.uiDockerVMsTreeWidget.sizePolicy().hasHeightForWidth())
|
||||
self.uiDockerVMsTreeWidget.setSizePolicy(sizePolicy)
|
||||
self.uiDockerVMsTreeWidget.setMaximumSize(QtCore.QSize(160, 16777215))
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(11)
|
||||
font.setBold(True)
|
||||
font.setWeight(75)
|
||||
self.uiDockerVMsTreeWidget.setFont(font)
|
||||
self.uiDockerVMsTreeWidget.setSelectionMode(QtWidgets.QAbstractItemView.ExtendedSelection)
|
||||
self.uiDockerVMsTreeWidget.setSelectionMode(QtWidgets.QAbstractItemView.SelectionMode.ExtendedSelection)
|
||||
self.uiDockerVMsTreeWidget.setIconSize(QtCore.QSize(32, 32))
|
||||
self.uiDockerVMsTreeWidget.setRootIsDecorated(False)
|
||||
self.uiDockerVMsTreeWidget.setObjectName("uiDockerVMsTreeWidget")
|
||||
self.uiDockerVMsTreeWidget.headerItem().setText(0, "1")
|
||||
self.uiDockerVMsTreeWidget.header().setVisible(False)
|
||||
self.widget = QtWidgets.QWidget(self.splitter)
|
||||
self.widget.setObjectName("widget")
|
||||
self.verticalLayout = QtWidgets.QVBoxLayout(self.widget)
|
||||
self.layoutWidget = QtWidgets.QWidget(parent=self.splitter)
|
||||
self.layoutWidget.setObjectName("layoutWidget")
|
||||
self.verticalLayout = QtWidgets.QVBoxLayout(self.layoutWidget)
|
||||
self.verticalLayout.setContentsMargins(0, 0, 0, 0)
|
||||
self.verticalLayout.setObjectName("verticalLayout")
|
||||
self.uiDockerVMInfoTreeWidget = QtWidgets.QTreeWidget(self.widget)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Expanding)
|
||||
self.uiDockerVMInfoTreeWidget = QtWidgets.QTreeWidget(parent=self.layoutWidget)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.MinimumExpanding, QtWidgets.QSizePolicy.Policy.Expanding)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.uiDockerVMInfoTreeWidget.sizePolicy().hasHeightForWidth())
|
||||
@@ -54,18 +50,18 @@ class Ui_DockerVMPreferencesPageWidget(object):
|
||||
self.verticalLayout.addWidget(self.uiDockerVMInfoTreeWidget)
|
||||
self.horizontalLayout = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout.setObjectName("horizontalLayout")
|
||||
self.uiNewDockerVMPushButton = QtWidgets.QPushButton(self.widget)
|
||||
self.uiNewDockerVMPushButton = QtWidgets.QPushButton(parent=self.layoutWidget)
|
||||
self.uiNewDockerVMPushButton.setObjectName("uiNewDockerVMPushButton")
|
||||
self.horizontalLayout.addWidget(self.uiNewDockerVMPushButton)
|
||||
self.uiCopyDockerVMPushButton = QtWidgets.QPushButton(self.widget)
|
||||
self.uiCopyDockerVMPushButton = QtWidgets.QPushButton(parent=self.layoutWidget)
|
||||
self.uiCopyDockerVMPushButton.setEnabled(False)
|
||||
self.uiCopyDockerVMPushButton.setObjectName("uiCopyDockerVMPushButton")
|
||||
self.horizontalLayout.addWidget(self.uiCopyDockerVMPushButton)
|
||||
self.uiEditDockerVMPushButton = QtWidgets.QPushButton(self.widget)
|
||||
self.uiEditDockerVMPushButton = QtWidgets.QPushButton(parent=self.layoutWidget)
|
||||
self.uiEditDockerVMPushButton.setEnabled(False)
|
||||
self.uiEditDockerVMPushButton.setObjectName("uiEditDockerVMPushButton")
|
||||
self.horizontalLayout.addWidget(self.uiEditDockerVMPushButton)
|
||||
self.uiDeleteDockerVMPushButton = QtWidgets.QPushButton(self.widget)
|
||||
self.uiDeleteDockerVMPushButton = QtWidgets.QPushButton(parent=self.layoutWidget)
|
||||
self.uiDeleteDockerVMPushButton.setEnabled(False)
|
||||
self.uiDeleteDockerVMPushButton.setObjectName("uiDeleteDockerVMPushButton")
|
||||
self.horizontalLayout.addWidget(self.uiDeleteDockerVMPushButton)
|
||||
@@ -86,4 +82,3 @@ class Ui_DockerVMPreferencesPageWidget(object):
|
||||
self.uiCopyDockerVMPushButton.setText(_translate("DockerVMPreferencesPageWidget", "&Copy"))
|
||||
self.uiEditDockerVMPushButton.setText(_translate("DockerVMPreferencesPageWidget", "&Edit"))
|
||||
self.uiDeleteDockerVMPushButton.setText(_translate("DockerVMPreferencesPageWidget", "&Delete"))
|
||||
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file '/home/grossmj/PycharmProjects/gns3-gui/gns3/modules/docker/ui/docker_vm_wizard.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.9
|
||||
# Created by: PyQt6 UI code generator 6.10.1
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
|
||||
# run again. Do not edit this file unless you know what you are doing.
|
||||
|
||||
|
||||
from PyQt6 import QtCore, QtGui, QtWidgets
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
class Ui_DockerVMWizard(object):
|
||||
def setupUi(self, DockerVMWizard):
|
||||
@@ -17,31 +18,31 @@ class Ui_DockerVMWizard(object):
|
||||
self.uiServerWizardPage.setObjectName("uiServerWizardPage")
|
||||
self.verticalLayout = QtWidgets.QVBoxLayout(self.uiServerWizardPage)
|
||||
self.verticalLayout.setObjectName("verticalLayout")
|
||||
self.uiServerTypeGroupBox = QtWidgets.QGroupBox(self.uiServerWizardPage)
|
||||
self.uiServerTypeGroupBox = QtWidgets.QGroupBox(parent=self.uiServerWizardPage)
|
||||
self.uiServerTypeGroupBox.setObjectName("uiServerTypeGroupBox")
|
||||
self.verticalLayout_5 = QtWidgets.QVBoxLayout(self.uiServerTypeGroupBox)
|
||||
self.verticalLayout_5.setObjectName("verticalLayout_5")
|
||||
self.uiRemoteRadioButton = QtWidgets.QRadioButton(self.uiServerTypeGroupBox)
|
||||
self.uiRemoteRadioButton = QtWidgets.QRadioButton(parent=self.uiServerTypeGroupBox)
|
||||
self.uiRemoteRadioButton.setChecked(True)
|
||||
self.uiRemoteRadioButton.setObjectName("uiRemoteRadioButton")
|
||||
self.verticalLayout_5.addWidget(self.uiRemoteRadioButton)
|
||||
self.uiVMRadioButton = QtWidgets.QRadioButton(self.uiServerTypeGroupBox)
|
||||
self.uiVMRadioButton = QtWidgets.QRadioButton(parent=self.uiServerTypeGroupBox)
|
||||
self.uiVMRadioButton.setObjectName("uiVMRadioButton")
|
||||
self.verticalLayout_5.addWidget(self.uiVMRadioButton)
|
||||
self.uiLocalRadioButton = QtWidgets.QRadioButton(self.uiServerTypeGroupBox)
|
||||
self.uiLocalRadioButton = QtWidgets.QRadioButton(parent=self.uiServerTypeGroupBox)
|
||||
self.uiLocalRadioButton.setObjectName("uiLocalRadioButton")
|
||||
self.verticalLayout_5.addWidget(self.uiLocalRadioButton)
|
||||
self.verticalLayout.addWidget(self.uiServerTypeGroupBox)
|
||||
self.uiRemoteServersGroupBox = QtWidgets.QGroupBox(self.uiServerWizardPage)
|
||||
self.uiRemoteServersGroupBox = QtWidgets.QGroupBox(parent=self.uiServerWizardPage)
|
||||
self.uiRemoteServersGroupBox.setObjectName("uiRemoteServersGroupBox")
|
||||
self.gridLayout_7 = QtWidgets.QGridLayout(self.uiRemoteServersGroupBox)
|
||||
self.gridLayout_7.setObjectName("gridLayout_7")
|
||||
self.uiRemoteServersLabel = QtWidgets.QLabel(self.uiRemoteServersGroupBox)
|
||||
self.uiRemoteServersLabel = QtWidgets.QLabel(parent=self.uiRemoteServersGroupBox)
|
||||
self.uiRemoteServersLabel.setObjectName("uiRemoteServersLabel")
|
||||
self.gridLayout_7.addWidget(self.uiRemoteServersLabel, 0, 0, 1, 1)
|
||||
self.uiRemoteServersComboBox = QtWidgets.QComboBox(self.uiRemoteServersGroupBox)
|
||||
self.uiRemoteServersComboBox = QtWidgets.QComboBox(parent=self.uiRemoteServersGroupBox)
|
||||
self.uiRemoteServersComboBox.setEnabled(False)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.uiRemoteServersComboBox.sizePolicy().hasHeightForWidth())
|
||||
@@ -56,30 +57,30 @@ class Ui_DockerVMWizard(object):
|
||||
self.verticalLayout_3.setObjectName("verticalLayout_3")
|
||||
self.horizontalLayout_3 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_3.setObjectName("horizontalLayout_3")
|
||||
self.uiExistingImageRadioButton = QtWidgets.QRadioButton(self.uiImageWizardPage)
|
||||
self.uiExistingImageRadioButton = QtWidgets.QRadioButton(parent=self.uiImageWizardPage)
|
||||
self.uiExistingImageRadioButton.setObjectName("uiExistingImageRadioButton")
|
||||
self.horizontalLayout_3.addWidget(self.uiExistingImageRadioButton)
|
||||
self.uiNewImageRadioButton = QtWidgets.QRadioButton(self.uiImageWizardPage)
|
||||
self.uiNewImageRadioButton = QtWidgets.QRadioButton(parent=self.uiImageWizardPage)
|
||||
self.uiNewImageRadioButton.setObjectName("uiNewImageRadioButton")
|
||||
self.horizontalLayout_3.addWidget(self.uiNewImageRadioButton)
|
||||
self.verticalLayout_3.addLayout(self.horizontalLayout_3)
|
||||
self.gridLayout = QtWidgets.QGridLayout()
|
||||
self.gridLayout.setObjectName("gridLayout")
|
||||
self.uiImageListLabel = QtWidgets.QLabel(self.uiImageWizardPage)
|
||||
self.uiImageListLabel = QtWidgets.QLabel(parent=self.uiImageWizardPage)
|
||||
self.uiImageListLabel.setObjectName("uiImageListLabel")
|
||||
self.gridLayout.addWidget(self.uiImageListLabel, 0, 0, 1, 1)
|
||||
self.uiImageListComboBox = QtWidgets.QComboBox(self.uiImageWizardPage)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
|
||||
self.uiImageListComboBox = QtWidgets.QComboBox(parent=self.uiImageWizardPage)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.uiImageListComboBox.sizePolicy().hasHeightForWidth())
|
||||
self.uiImageListComboBox.setSizePolicy(sizePolicy)
|
||||
self.uiImageListComboBox.setObjectName("uiImageListComboBox")
|
||||
self.gridLayout.addWidget(self.uiImageListComboBox, 0, 1, 1, 1)
|
||||
self.uiImageLineEdit = QtWidgets.QLineEdit(self.uiImageWizardPage)
|
||||
self.uiImageLineEdit = QtWidgets.QLineEdit(parent=self.uiImageWizardPage)
|
||||
self.uiImageLineEdit.setObjectName("uiImageLineEdit")
|
||||
self.gridLayout.addWidget(self.uiImageLineEdit, 1, 1, 1, 1)
|
||||
self.uiImageNameLabel = QtWidgets.QLabel(self.uiImageWizardPage)
|
||||
self.uiImageNameLabel = QtWidgets.QLabel(parent=self.uiImageWizardPage)
|
||||
self.uiImageNameLabel.setObjectName("uiImageNameLabel")
|
||||
self.gridLayout.addWidget(self.uiImageNameLabel, 1, 0, 1, 1)
|
||||
self.verticalLayout_3.addLayout(self.gridLayout)
|
||||
@@ -87,47 +88,47 @@ class Ui_DockerVMWizard(object):
|
||||
self.uiNameWizardPage = QtWidgets.QWizardPage()
|
||||
self.uiNameWizardPage.setObjectName("uiNameWizardPage")
|
||||
self.formLayout = QtWidgets.QFormLayout(self.uiNameWizardPage)
|
||||
self.formLayout.setSizeConstraint(QtWidgets.QLayout.SetMaximumSize)
|
||||
self.formLayout.setFieldGrowthPolicy(QtWidgets.QFormLayout.ExpandingFieldsGrow)
|
||||
self.formLayout.setFormAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop)
|
||||
self.formLayout.setSizeConstraint(QtWidgets.QLayout.SizeConstraint.SetMaximumSize)
|
||||
self.formLayout.setFieldGrowthPolicy(QtWidgets.QFormLayout.FieldGrowthPolicy.ExpandingFieldsGrow)
|
||||
self.formLayout.setFormAlignment(QtCore.Qt.AlignmentFlag.AlignLeading|QtCore.Qt.AlignmentFlag.AlignLeft|QtCore.Qt.AlignmentFlag.AlignTop)
|
||||
self.formLayout.setContentsMargins(-1, -1, 0, -1)
|
||||
self.formLayout.setObjectName("formLayout")
|
||||
self.uiNameLabel = QtWidgets.QLabel(self.uiNameWizardPage)
|
||||
self.uiNameLabel = QtWidgets.QLabel(parent=self.uiNameWizardPage)
|
||||
self.uiNameLabel.setObjectName("uiNameLabel")
|
||||
self.formLayout.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.uiNameLabel)
|
||||
self.uiNameLineEdit = QtWidgets.QLineEdit(self.uiNameWizardPage)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
|
||||
self.formLayout.setWidget(0, QtWidgets.QFormLayout.ItemRole.LabelRole, self.uiNameLabel)
|
||||
self.uiNameLineEdit = QtWidgets.QLineEdit(parent=self.uiNameWizardPage)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.uiNameLineEdit.sizePolicy().hasHeightForWidth())
|
||||
self.uiNameLineEdit.setSizePolicy(sizePolicy)
|
||||
self.uiNameLineEdit.setObjectName("uiNameLineEdit")
|
||||
self.formLayout.setWidget(0, QtWidgets.QFormLayout.FieldRole, self.uiNameLineEdit)
|
||||
self.formLayout.setWidget(0, QtWidgets.QFormLayout.ItemRole.FieldRole, self.uiNameLineEdit)
|
||||
DockerVMWizard.addPage(self.uiNameWizardPage)
|
||||
self.uiAdaptersWizardPage = QtWidgets.QWizardPage()
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Preferred)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.uiAdaptersWizardPage.sizePolicy().hasHeightForWidth())
|
||||
self.uiAdaptersWizardPage.setSizePolicy(sizePolicy)
|
||||
self.uiAdaptersWizardPage.setObjectName("uiAdaptersWizardPage")
|
||||
self.formLayout_2 = QtWidgets.QFormLayout(self.uiAdaptersWizardPage)
|
||||
self.formLayout_2.setSizeConstraint(QtWidgets.QLayout.SetDefaultConstraint)
|
||||
self.formLayout_2.setFieldGrowthPolicy(QtWidgets.QFormLayout.ExpandingFieldsGrow)
|
||||
self.formLayout_2.setFormAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop)
|
||||
self.formLayout_2.setSizeConstraint(QtWidgets.QLayout.SizeConstraint.SetDefaultConstraint)
|
||||
self.formLayout_2.setFieldGrowthPolicy(QtWidgets.QFormLayout.FieldGrowthPolicy.ExpandingFieldsGrow)
|
||||
self.formLayout_2.setFormAlignment(QtCore.Qt.AlignmentFlag.AlignLeading|QtCore.Qt.AlignmentFlag.AlignLeft|QtCore.Qt.AlignmentFlag.AlignTop)
|
||||
self.formLayout_2.setObjectName("formLayout_2")
|
||||
self.label_2 = QtWidgets.QLabel(self.uiAdaptersWizardPage)
|
||||
self.label_2 = QtWidgets.QLabel(parent=self.uiAdaptersWizardPage)
|
||||
self.label_2.setObjectName("label_2")
|
||||
self.formLayout_2.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.label_2)
|
||||
self.uiAdaptersSpinBox = QtWidgets.QSpinBox(self.uiAdaptersWizardPage)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
|
||||
self.formLayout_2.setWidget(0, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_2)
|
||||
self.uiAdaptersSpinBox = QtWidgets.QSpinBox(parent=self.uiAdaptersWizardPage)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.uiAdaptersSpinBox.sizePolicy().hasHeightForWidth())
|
||||
self.uiAdaptersSpinBox.setSizePolicy(sizePolicy)
|
||||
self.uiAdaptersSpinBox.setMinimum(1)
|
||||
self.uiAdaptersSpinBox.setObjectName("uiAdaptersSpinBox")
|
||||
self.formLayout_2.setWidget(0, QtWidgets.QFormLayout.FieldRole, self.uiAdaptersSpinBox)
|
||||
self.formLayout_2.setWidget(0, QtWidgets.QFormLayout.ItemRole.FieldRole, self.uiAdaptersSpinBox)
|
||||
DockerVMWizard.addPage(self.uiAdaptersWizardPage)
|
||||
self.uiStartCommandWizardPage = QtWidgets.QWizardPage()
|
||||
self.uiStartCommandWizardPage.setObjectName("uiStartCommandWizardPage")
|
||||
@@ -135,8 +136,8 @@ class Ui_DockerVMWizard(object):
|
||||
self.verticalLayout_2.setObjectName("verticalLayout_2")
|
||||
self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
|
||||
self.label = QtWidgets.QLabel(self.uiStartCommandWizardPage)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Preferred)
|
||||
self.label = QtWidgets.QLabel(parent=self.uiStartCommandWizardPage)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.label.sizePolicy().hasHeightForWidth())
|
||||
@@ -144,8 +145,8 @@ class Ui_DockerVMWizard(object):
|
||||
self.label.setWordWrap(True)
|
||||
self.label.setObjectName("label")
|
||||
self.horizontalLayout_2.addWidget(self.label)
|
||||
self.uiStartCommandLineEdit = QtWidgets.QLineEdit(self.uiStartCommandWizardPage)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
|
||||
self.uiStartCommandLineEdit = QtWidgets.QLineEdit(parent=self.uiStartCommandWizardPage)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.uiStartCommandLineEdit.sizePolicy().hasHeightForWidth())
|
||||
@@ -158,33 +159,33 @@ class Ui_DockerVMWizard(object):
|
||||
self.uiConsoleWizardPage.setObjectName("uiConsoleWizardPage")
|
||||
self.formLayout_3 = QtWidgets.QFormLayout(self.uiConsoleWizardPage)
|
||||
self.formLayout_3.setObjectName("formLayout_3")
|
||||
self.label_6 = QtWidgets.QLabel(self.uiConsoleWizardPage)
|
||||
self.label_6 = QtWidgets.QLabel(parent=self.uiConsoleWizardPage)
|
||||
self.label_6.setObjectName("label_6")
|
||||
self.formLayout_3.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.label_6)
|
||||
self.uiConsoleTypeComboBox = QtWidgets.QComboBox(self.uiConsoleWizardPage)
|
||||
self.formLayout_3.setWidget(0, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_6)
|
||||
self.uiConsoleTypeComboBox = QtWidgets.QComboBox(parent=self.uiConsoleWizardPage)
|
||||
self.uiConsoleTypeComboBox.setObjectName("uiConsoleTypeComboBox")
|
||||
self.uiConsoleTypeComboBox.addItem("")
|
||||
self.uiConsoleTypeComboBox.addItem("")
|
||||
self.uiConsoleTypeComboBox.addItem("")
|
||||
self.uiConsoleTypeComboBox.addItem("")
|
||||
self.uiConsoleTypeComboBox.addItem("")
|
||||
self.formLayout_3.setWidget(0, QtWidgets.QFormLayout.FieldRole, self.uiConsoleTypeComboBox)
|
||||
self.formLayout_3.setWidget(0, QtWidgets.QFormLayout.ItemRole.FieldRole, self.uiConsoleTypeComboBox)
|
||||
DockerVMWizard.addPage(self.uiConsoleWizardPage)
|
||||
self.uiEnvironmentWizardPage = QtWidgets.QWizardPage()
|
||||
self.uiEnvironmentWizardPage.setObjectName("uiEnvironmentWizardPage")
|
||||
self.verticalLayout_4 = QtWidgets.QVBoxLayout(self.uiEnvironmentWizardPage)
|
||||
self.verticalLayout_4.setObjectName("verticalLayout_4")
|
||||
self.label_3 = QtWidgets.QLabel(self.uiEnvironmentWizardPage)
|
||||
self.label_3 = QtWidgets.QLabel(parent=self.uiEnvironmentWizardPage)
|
||||
self.label_3.setWordWrap(True)
|
||||
self.label_3.setObjectName("label_3")
|
||||
self.verticalLayout_4.addWidget(self.label_3)
|
||||
self.label_4 = QtWidgets.QLabel(self.uiEnvironmentWizardPage)
|
||||
self.label_4 = QtWidgets.QLabel(parent=self.uiEnvironmentWizardPage)
|
||||
self.label_4.setObjectName("label_4")
|
||||
self.verticalLayout_4.addWidget(self.label_4)
|
||||
self.label_5 = QtWidgets.QLabel(self.uiEnvironmentWizardPage)
|
||||
self.label_5 = QtWidgets.QLabel(parent=self.uiEnvironmentWizardPage)
|
||||
self.label_5.setObjectName("label_5")
|
||||
self.verticalLayout_4.addWidget(self.label_5)
|
||||
self.uiEnvironmentTextEdit = QtWidgets.QTextEdit(self.uiEnvironmentWizardPage)
|
||||
self.uiEnvironmentTextEdit = QtWidgets.QTextEdit(parent=self.uiEnvironmentWizardPage)
|
||||
self.uiEnvironmentTextEdit.setObjectName("uiEnvironmentTextEdit")
|
||||
self.verticalLayout_4.addWidget(self.uiEnvironmentTextEdit)
|
||||
DockerVMWizard.addPage(self.uiEnvironmentWizardPage)
|
||||
@@ -232,4 +233,3 @@ class Ui_DockerVMWizard(object):
|
||||
self.label_3.setText(_translate("DockerVMWizard", "There must be one pair by line, example: "))
|
||||
self.label_4.setText(_translate("DockerVMWizard", "MYSQL_HOST=localhost"))
|
||||
self.label_5.setText(_translate("DockerVMWizard", "MYSQL_USER=root"))
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ class IOSRouterWizard(VMWithImagesWizard, Ui_IOSRouterWizard):
|
||||
def __init__(self, ios_routers, parent):
|
||||
|
||||
super().__init__(ios_routers, parent)
|
||||
self.setPixmap(QtWidgets.QWizard.LogoPixmap, QtGui.QPixmap(":/symbols/router.svg"))
|
||||
self.setPixmap(QtWidgets.QWizard.WizardPixmap.LogoPixmap, QtGui.QPixmap(":/symbols/router.svg"))
|
||||
|
||||
self.uiTestIOSImagePushButton.clicked.connect(self._testIOSImageSlot)
|
||||
self.uiIdlePCFinderPushButton.clicked.connect(self._idlePCFinderSlot)
|
||||
@@ -80,8 +80,8 @@ class IOSRouterWizard(VMWithImagesWizard, Ui_IOSRouterWizard):
|
||||
# True if we have create a temporary project for computing IDLE PC
|
||||
self._project_created = False
|
||||
|
||||
idle_pc_rgx = QtCore.QRegExp("^(0x[0-9a-fA-F]{8})?$")
|
||||
validator = QtGui.QRegExpValidator(idle_pc_rgx, self)
|
||||
idle_pc_rgx = QtCore.QRegularExpression("^(0x[0-9a-fA-F]{8})?$")
|
||||
validator = QtGui.QRegularExpressionValidator(idle_pc_rgx, self)
|
||||
self.uiIdlepcLineEdit.setValidator(validator)
|
||||
self.uiIdlepcLineEdit.textChanged.connect(self._idlePCValidateSlot)
|
||||
self.uiIdlepcLineEdit.textChanged.emit(self.uiIdlepcLineEdit.text())
|
||||
@@ -200,10 +200,10 @@ class IOSRouterWizard(VMWithImagesWizard, Ui_IOSRouterWizard):
|
||||
validator = self.uiIdlepcLineEdit.validator()
|
||||
text_input = self.uiIdlepcLineEdit.text()
|
||||
state = validator.validate(text_input, len(text_input))[0]
|
||||
if state == QtGui.QValidator.Acceptable:
|
||||
if state == QtGui.QValidator.State.Acceptable:
|
||||
color = '#A2C964' # green
|
||||
self._idle_valid = True
|
||||
elif state == QtGui.QValidator.Intermediate:
|
||||
elif state == QtGui.QValidator.State.Intermediate:
|
||||
color = '#fff79a' # yellow
|
||||
self._idle_valid = False
|
||||
else:
|
||||
|
||||
@@ -64,8 +64,8 @@ class IOSRouterConfigurationPage(QtWidgets.QWidget, Ui_iosRouterConfigPageWidget
|
||||
self.uiIOSImageToolButton.clicked.connect(self._iosImageBrowserSlot)
|
||||
self._compute_id = None
|
||||
self._idle_valid = False
|
||||
idle_pc_rgx = QtCore.QRegExp("^(0x[0-9a-fA-F]{8})?$")
|
||||
validator = QtGui.QRegExpValidator(idle_pc_rgx, self)
|
||||
idle_pc_rgx = QtCore.QRegularExpression("^(0x[0-9a-fA-F]{8})?$")
|
||||
validator = QtGui.QRegularExpressionValidator(idle_pc_rgx, self)
|
||||
self.uiIdlepcLineEdit.setValidator(validator)
|
||||
self.uiIdlepcLineEdit.textChanged.connect(self._idlePCValidateSlot)
|
||||
self.uiIdlepcLineEdit.textChanged.emit(self.uiIdlepcLineEdit.text())
|
||||
@@ -86,10 +86,10 @@ class IOSRouterConfigurationPage(QtWidgets.QWidget, Ui_iosRouterConfigPageWidget
|
||||
|
||||
validator = self.uiIdlepcLineEdit.validator()
|
||||
state = validator.validate(self.uiIdlepcLineEdit.text(), 0)[0]
|
||||
if state == QtGui.QValidator.Acceptable:
|
||||
if state == QtGui.QValidator.State.Acceptable:
|
||||
color = '#A2C964' # green
|
||||
self._idle_valid = True
|
||||
elif state == QtGui.QValidator.Intermediate:
|
||||
elif state == QtGui.QValidator.State.Intermediate:
|
||||
color = '#fff79a' # yellow
|
||||
self._idle_valid = False
|
||||
else:
|
||||
@@ -176,7 +176,7 @@ class IOSRouterConfigurationPage(QtWidgets.QWidget, Ui_iosRouterConfigPageWidget
|
||||
symbol_path = self.uiSymbolLineEdit.text()
|
||||
dialog = SymbolSelectionDialog(self, symbol=symbol_path)
|
||||
dialog.show()
|
||||
if dialog.exec_():
|
||||
if dialog.exec():
|
||||
new_symbol_path = dialog.getSymbol()
|
||||
self.uiSymbolLineEdit.setText(new_symbol_path)
|
||||
self.uiSymbolLineEdit.setToolTip('<img src="{}"/>'.format(new_symbol_path))
|
||||
|
||||
@@ -85,7 +85,7 @@ class IOSRouterPreferencesPage(QtWidgets.QWidget, Ui_IOSRouterPreferencesPageWid
|
||||
self.uiDecompressIOSPushButton.setEnabled(single_selected)
|
||||
|
||||
if single_selected:
|
||||
key = selection[0].data(0, QtCore.Qt.UserRole)
|
||||
key = selection[0].data(0, QtCore.Qt.ItemDataRole.UserRole)
|
||||
ios_router = self._ios_routers[key]
|
||||
self._refreshInfo(ios_router)
|
||||
else:
|
||||
@@ -99,7 +99,7 @@ class IOSRouterPreferencesPage(QtWidgets.QWidget, Ui_IOSRouterPreferencesPageWid
|
||||
|
||||
wizard = IOSRouterWizard(self._ios_routers, parent=self)
|
||||
wizard.show()
|
||||
if wizard.exec_():
|
||||
if wizard.exec():
|
||||
|
||||
ios_settings = wizard.getSettings()
|
||||
key = "{server}:{name}".format(server=ios_settings["compute_id"], name=ios_settings["name"])
|
||||
@@ -127,7 +127,7 @@ class IOSRouterPreferencesPage(QtWidgets.QWidget, Ui_IOSRouterPreferencesPageWid
|
||||
item = QtWidgets.QTreeWidgetItem(self.uiIOSRoutersTreeWidget)
|
||||
item.setText(0, self._ios_routers[key]["name"])
|
||||
Controller.instance().getSymbolIcon(self._ios_routers[key]["symbol"], qpartial(self._setItemIcon, item))
|
||||
item.setData(0, QtCore.Qt.UserRole, key)
|
||||
item.setData(0, QtCore.Qt.ItemDataRole.UserRole, key)
|
||||
self._items.append(item)
|
||||
self.uiIOSRoutersTreeWidget.setCurrentItem(item)
|
||||
|
||||
@@ -138,9 +138,9 @@ class IOSRouterPreferencesPage(QtWidgets.QWidget, Ui_IOSRouterPreferencesPageWid
|
||||
|
||||
item = self.uiIOSRoutersTreeWidget.currentItem()
|
||||
if item:
|
||||
key = item.data(0, QtCore.Qt.UserRole)
|
||||
key = item.data(0, QtCore.Qt.ItemDataRole.UserRole)
|
||||
copied_ios_router_settings = copy.deepcopy(self._ios_routers[key])
|
||||
new_name, ok = QtWidgets.QInputDialog.getText(self, "Copy IOS router template", "Template name:", QtWidgets.QLineEdit.Normal, "Copy of {}".format(copied_ios_router_settings["name"]))
|
||||
new_name, ok = QtWidgets.QInputDialog.getText(self, "Copy IOS router template", "Template name:", QtWidgets.QLineEdit.EchoMode.Normal, "Copy of {}".format(copied_ios_router_settings["name"]))
|
||||
if ok:
|
||||
key = "{server}:{name}".format(server=copied_ios_router_settings["compute_id"], name=new_name)
|
||||
if key in self._ios_routers:
|
||||
@@ -154,7 +154,7 @@ class IOSRouterPreferencesPage(QtWidgets.QWidget, Ui_IOSRouterPreferencesPageWid
|
||||
item = QtWidgets.QTreeWidgetItem(self.uiIOSRoutersTreeWidget)
|
||||
item.setText(0, self._ios_routers[key]["name"])
|
||||
Controller.instance().getSymbolIcon(self._ios_routers[key]["symbol"], qpartial(self._setItemIcon, item))
|
||||
item.setData(0, QtCore.Qt.UserRole, key)
|
||||
item.setData(0, QtCore.Qt.ItemDataRole.UserRole, key)
|
||||
self._items.append(item)
|
||||
self.uiIOSRoutersTreeWidget.setCurrentItem(item)
|
||||
|
||||
@@ -165,11 +165,11 @@ class IOSRouterPreferencesPage(QtWidgets.QWidget, Ui_IOSRouterPreferencesPageWid
|
||||
|
||||
item = self.uiIOSRoutersTreeWidget.currentItem()
|
||||
if item:
|
||||
key = item.data(0, QtCore.Qt.UserRole)
|
||||
key = item.data(0, QtCore.Qt.ItemDataRole.UserRole)
|
||||
ios_router = self._ios_routers[key]
|
||||
dialog = ConfigurationDialog(ios_router["name"], ios_router, IOSRouterConfigurationPage(), parent=self)
|
||||
dialog.show()
|
||||
if dialog.exec_():
|
||||
if dialog.exec():
|
||||
# update the icon
|
||||
Controller.instance().getSymbolIcon(self._ios_routers[key]["symbol"], qpartial(self._setItemIcon, item))
|
||||
|
||||
@@ -184,7 +184,7 @@ class IOSRouterPreferencesPage(QtWidgets.QWidget, Ui_IOSRouterPreferencesPageWid
|
||||
self._ios_routers[new_key] = self._ios_routers[key]
|
||||
del self._ios_routers[key]
|
||||
item.setText(0, ios_router["name"])
|
||||
item.setData(0, QtCore.Qt.UserRole, new_key)
|
||||
item.setData(0, QtCore.Qt.ItemDataRole.UserRole, new_key)
|
||||
|
||||
self._refreshInfo(ios_router)
|
||||
|
||||
@@ -195,7 +195,7 @@ class IOSRouterPreferencesPage(QtWidgets.QWidget, Ui_IOSRouterPreferencesPageWid
|
||||
|
||||
for item in self.uiIOSRoutersTreeWidget.selectedItems():
|
||||
if item:
|
||||
key = item.data(0, QtCore.Qt.UserRole)
|
||||
key = item.data(0, QtCore.Qt.ItemDataRole.UserRole)
|
||||
|
||||
del self._ios_routers[key]
|
||||
self.uiIOSRoutersTreeWidget.takeTopLevelItem(self.uiIOSRoutersTreeWidget.indexOfTopLevelItem(item))
|
||||
@@ -272,8 +272,8 @@ class IOSRouterPreferencesPage(QtWidgets.QWidget, Ui_IOSRouterPreferencesPageWid
|
||||
except (OSError, ValueError):
|
||||
pass # ignore errors if we cannot find out the IOS image is compressed.
|
||||
if compressed:
|
||||
reply = QtWidgets.QMessageBox.question(parent, "IOS image", "Would you like to decompress this IOS image?", QtWidgets.QMessageBox.Yes, QtWidgets.QMessageBox.No)
|
||||
if reply == QtWidgets.QMessageBox.Yes:
|
||||
reply = QtWidgets.QMessageBox.question(parent, "IOS image", "Would you like to decompress this IOS image?", QtWidgets.QMessageBox.StandardButton.Yes, QtWidgets.QMessageBox.StandardButton.No)
|
||||
if reply == QtWidgets.QMessageBox.StandardButton.Yes:
|
||||
decompressed_image_path = os.path.join(cls.getImageDirectory(), os.path.basename(os.path.splitext(path)[0] + ".image"))
|
||||
worker = DecompressIOSWorker(path, decompressed_image_path)
|
||||
progress_dialog = ProgressDialog(worker,
|
||||
@@ -281,7 +281,7 @@ class IOSRouterPreferencesPage(QtWidgets.QWidget, Ui_IOSRouterPreferencesPageWid
|
||||
"Decompressing IOS image {}...".format(os.path.basename(path)),
|
||||
"Cancel", busy=True, parent=parent)
|
||||
progress_dialog.show()
|
||||
if progress_dialog.exec_() is not False:
|
||||
if progress_dialog.exec() is not False:
|
||||
path = decompressed_image_path
|
||||
|
||||
path = ImageManager.instance().askCopyUploadImage(parent, path, server, "DYNAMIPS")
|
||||
@@ -321,7 +321,7 @@ class IOSRouterPreferencesPage(QtWidgets.QWidget, Ui_IOSRouterPreferencesPageWid
|
||||
|
||||
item = self.uiIOSRoutersTreeWidget.currentItem()
|
||||
if item:
|
||||
key = item.data(0, QtCore.Qt.UserRole)
|
||||
key = item.data(0, QtCore.Qt.ItemDataRole.UserRole)
|
||||
ios_router = self._ios_routers[key]
|
||||
path = ios_router["image"]
|
||||
if not os.path.isabs(path):
|
||||
@@ -355,7 +355,7 @@ class IOSRouterPreferencesPage(QtWidgets.QWidget, Ui_IOSRouterPreferencesPageWid
|
||||
"Decompressing IOS image {}...".format(path),
|
||||
"Cancel", busy=True, parent=self)
|
||||
progress_dialog.show()
|
||||
if progress_dialog.exec_() is not False:
|
||||
if progress_dialog.exec() is not False:
|
||||
ios_router["image"] = decompressed_image_path
|
||||
self._refreshInfo(ios_router)
|
||||
|
||||
@@ -467,12 +467,12 @@ class IOSRouterPreferencesPage(QtWidgets.QWidget, Ui_IOSRouterPreferencesPageWid
|
||||
item = QtWidgets.QTreeWidgetItem(self.uiIOSRoutersTreeWidget)
|
||||
item.setText(0, ios_router["name"])
|
||||
Controller.instance().getSymbolIcon(ios_router["symbol"], qpartial(self._setItemIcon, item))
|
||||
item.setData(0, QtCore.Qt.UserRole, key)
|
||||
item.setData(0, QtCore.Qt.ItemDataRole.UserRole, key)
|
||||
self._items.append(item)
|
||||
|
||||
if self._items:
|
||||
self.uiIOSRoutersTreeWidget.setCurrentItem(self._items[0])
|
||||
self.uiIOSRoutersTreeWidget.sortByColumn(0, QtCore.Qt.AscendingOrder)
|
||||
self.uiIOSRoutersTreeWidget.sortByColumn(0, QtCore.Qt.SortOrder.AscendingOrder)
|
||||
self.uiIOSRoutersTreeWidget.setMaximumWidth(self.uiIOSRoutersTreeWidget.sizeHintForColumn(0) + 10)
|
||||
|
||||
def savePreferences(self):
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file '/home/grossmj/PycharmProjects/gns3-gui/gns3/modules/dynamips/ui/dynamips_preferences_page.ui'
|
||||
#
|
||||
# Created: Wed Dec 7 22:03:06 2016
|
||||
# by: PyQt5 UI code generator 5.2.1
|
||||
# Created by: PyQt6 UI code generator 6.10.1
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
|
||||
# run again. Do not edit this file unless you know what you are doing.
|
||||
|
||||
|
||||
from PyQt6 import QtCore, QtGui, QtWidgets
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
class Ui_DynamipsPreferencesPageWidget(object):
|
||||
def setupUi(self, DynamipsPreferencesPageWidget):
|
||||
@@ -15,35 +15,35 @@ class Ui_DynamipsPreferencesPageWidget(object):
|
||||
DynamipsPreferencesPageWidget.resize(435, 242)
|
||||
self.vboxlayout = QtWidgets.QVBoxLayout(DynamipsPreferencesPageWidget)
|
||||
self.vboxlayout.setObjectName("vboxlayout")
|
||||
self.uiTabWidget = QtWidgets.QTabWidget(DynamipsPreferencesPageWidget)
|
||||
self.uiTabWidget = QtWidgets.QTabWidget(parent=DynamipsPreferencesPageWidget)
|
||||
self.uiTabWidget.setObjectName("uiTabWidget")
|
||||
self.uiGeneralSettingsTabWidget = QtWidgets.QWidget()
|
||||
self.uiGeneralSettingsTabWidget.setObjectName("uiGeneralSettingsTabWidget")
|
||||
self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.uiGeneralSettingsTabWidget)
|
||||
self.verticalLayout_2.setContentsMargins(10, 10, 10, 10)
|
||||
self.verticalLayout_2.setObjectName("verticalLayout_2")
|
||||
self.uiDynamipsPathLabel = QtWidgets.QLabel(self.uiGeneralSettingsTabWidget)
|
||||
self.uiDynamipsPathLabel = QtWidgets.QLabel(parent=self.uiGeneralSettingsTabWidget)
|
||||
self.uiDynamipsPathLabel.setObjectName("uiDynamipsPathLabel")
|
||||
self.verticalLayout_2.addWidget(self.uiDynamipsPathLabel)
|
||||
self.horizontalLayout = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout.setObjectName("horizontalLayout")
|
||||
self.uiDynamipsPathLineEdit = QtWidgets.QLineEdit(self.uiGeneralSettingsTabWidget)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Fixed)
|
||||
self.uiDynamipsPathLineEdit = QtWidgets.QLineEdit(parent=self.uiGeneralSettingsTabWidget)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.MinimumExpanding, QtWidgets.QSizePolicy.Policy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.uiDynamipsPathLineEdit.sizePolicy().hasHeightForWidth())
|
||||
self.uiDynamipsPathLineEdit.setSizePolicy(sizePolicy)
|
||||
self.uiDynamipsPathLineEdit.setObjectName("uiDynamipsPathLineEdit")
|
||||
self.horizontalLayout.addWidget(self.uiDynamipsPathLineEdit)
|
||||
self.uiDynamipsPathToolButton = QtWidgets.QToolButton(self.uiGeneralSettingsTabWidget)
|
||||
self.uiDynamipsPathToolButton.setToolButtonStyle(QtCore.Qt.ToolButtonTextOnly)
|
||||
self.uiDynamipsPathToolButton = QtWidgets.QToolButton(parent=self.uiGeneralSettingsTabWidget)
|
||||
self.uiDynamipsPathToolButton.setToolButtonStyle(QtCore.Qt.ToolButtonStyle.ToolButtonTextOnly)
|
||||
self.uiDynamipsPathToolButton.setObjectName("uiDynamipsPathToolButton")
|
||||
self.horizontalLayout.addWidget(self.uiDynamipsPathToolButton)
|
||||
self.verticalLayout_2.addLayout(self.horizontalLayout)
|
||||
self.uiAllocateAuxConsolePortsCheckBox = QtWidgets.QCheckBox(self.uiGeneralSettingsTabWidget)
|
||||
self.uiAllocateAuxConsolePortsCheckBox = QtWidgets.QCheckBox(parent=self.uiGeneralSettingsTabWidget)
|
||||
self.uiAllocateAuxConsolePortsCheckBox.setObjectName("uiAllocateAuxConsolePortsCheckBox")
|
||||
self.verticalLayout_2.addWidget(self.uiAllocateAuxConsolePortsCheckBox)
|
||||
spacerItem = QtWidgets.QSpacerItem(20, 5, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
|
||||
spacerItem = QtWidgets.QSpacerItem(20, 5, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding)
|
||||
self.verticalLayout_2.addItem(spacerItem)
|
||||
self.uiTabWidget.addTab(self.uiGeneralSettingsTabWidget, "")
|
||||
self.uiAdvancedSettingsTabWidget = QtWidgets.QWidget()
|
||||
@@ -51,33 +51,33 @@ class Ui_DynamipsPreferencesPageWidget(object):
|
||||
self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.uiAdvancedSettingsTabWidget)
|
||||
self.verticalLayout_3.setContentsMargins(10, 10, 10, 10)
|
||||
self.verticalLayout_3.setObjectName("verticalLayout_3")
|
||||
self.uiMemoryUsageOptimisationGroupBox = QtWidgets.QGroupBox(self.uiAdvancedSettingsTabWidget)
|
||||
self.uiMemoryUsageOptimisationGroupBox = QtWidgets.QGroupBox(parent=self.uiAdvancedSettingsTabWidget)
|
||||
self.uiMemoryUsageOptimisationGroupBox.setObjectName("uiMemoryUsageOptimisationGroupBox")
|
||||
self.verticalLayout = QtWidgets.QVBoxLayout(self.uiMemoryUsageOptimisationGroupBox)
|
||||
self.verticalLayout.setContentsMargins(10, 10, 10, 10)
|
||||
self.verticalLayout.setObjectName("verticalLayout")
|
||||
self.uiGhostIOSSupportCheckBox = QtWidgets.QCheckBox(self.uiMemoryUsageOptimisationGroupBox)
|
||||
self.uiGhostIOSSupportCheckBox = QtWidgets.QCheckBox(parent=self.uiMemoryUsageOptimisationGroupBox)
|
||||
self.uiGhostIOSSupportCheckBox.setChecked(True)
|
||||
self.uiGhostIOSSupportCheckBox.setObjectName("uiGhostIOSSupportCheckBox")
|
||||
self.verticalLayout.addWidget(self.uiGhostIOSSupportCheckBox)
|
||||
self.uiMmapSupportCheckBox = QtWidgets.QCheckBox(self.uiMemoryUsageOptimisationGroupBox)
|
||||
self.uiMmapSupportCheckBox = QtWidgets.QCheckBox(parent=self.uiMemoryUsageOptimisationGroupBox)
|
||||
self.uiMmapSupportCheckBox.setChecked(True)
|
||||
self.uiMmapSupportCheckBox.setObjectName("uiMmapSupportCheckBox")
|
||||
self.verticalLayout.addWidget(self.uiMmapSupportCheckBox)
|
||||
self.uiSparseMemorySupportCheckBox = QtWidgets.QCheckBox(self.uiMemoryUsageOptimisationGroupBox)
|
||||
self.uiSparseMemorySupportCheckBox = QtWidgets.QCheckBox(parent=self.uiMemoryUsageOptimisationGroupBox)
|
||||
self.uiSparseMemorySupportCheckBox.setChecked(False)
|
||||
self.uiSparseMemorySupportCheckBox.setObjectName("uiSparseMemorySupportCheckBox")
|
||||
self.verticalLayout.addWidget(self.uiSparseMemorySupportCheckBox)
|
||||
self.verticalLayout_3.addWidget(self.uiMemoryUsageOptimisationGroupBox)
|
||||
spacerItem1 = QtWidgets.QSpacerItem(20, 5, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
|
||||
spacerItem1 = QtWidgets.QSpacerItem(20, 5, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding)
|
||||
self.verticalLayout_3.addItem(spacerItem1)
|
||||
self.uiTabWidget.addTab(self.uiAdvancedSettingsTabWidget, "")
|
||||
self.vboxlayout.addWidget(self.uiTabWidget)
|
||||
self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
|
||||
spacerItem2 = QtWidgets.QSpacerItem(164, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
|
||||
spacerItem2 = QtWidgets.QSpacerItem(164, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
|
||||
self.horizontalLayout_2.addItem(spacerItem2)
|
||||
self.uiRestoreDefaultsPushButton = QtWidgets.QPushButton(DynamipsPreferencesPageWidget)
|
||||
self.uiRestoreDefaultsPushButton = QtWidgets.QPushButton(parent=DynamipsPreferencesPageWidget)
|
||||
self.uiRestoreDefaultsPushButton.setObjectName("uiRestoreDefaultsPushButton")
|
||||
self.horizontalLayout_2.addWidget(self.uiRestoreDefaultsPushButton)
|
||||
self.vboxlayout.addLayout(self.horizontalLayout_2)
|
||||
@@ -106,4 +106,3 @@ class Ui_DynamipsPreferencesPageWidget(object):
|
||||
self.uiSparseMemorySupportCheckBox.setText(_translate("DynamipsPreferencesPageWidget", "Enable sparse memory support"))
|
||||
self.uiTabWidget.setTabText(self.uiTabWidget.indexOf(self.uiAdvancedSettingsTabWidget), _translate("DynamipsPreferencesPageWidget", "Advanced local settings"))
|
||||
self.uiRestoreDefaultsPushButton.setText(_translate("DynamipsPreferencesPageWidget", "Restore defaults"))
|
||||
|
||||
|
||||
@@ -35,13 +35,6 @@
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>11</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="selectionMode">
|
||||
<enum>QAbstractItemView::ExtendedSelection</enum>
|
||||
</property>
|
||||
@@ -63,7 +56,7 @@
|
||||
</property>
|
||||
</column>
|
||||
</widget>
|
||||
<widget class="QWidget" name="">
|
||||
<widget class="QWidget" name="layoutWidget">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QTreeWidget" name="uiIOSRouterInfoTreeWidget">
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file '/home/grossmj/PycharmProjects/gns3-gui/gns3/modules/dynamips/ui/ios_router_preferences_page.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.9
|
||||
# Created by: PyQt6 UI code generator 6.10.1
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
|
||||
# run again. Do not edit this file unless you know what you are doing.
|
||||
|
||||
|
||||
from PyQt6 import QtCore, QtGui, QtWidgets
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
class Ui_IOSRouterPreferencesPageWidget(object):
|
||||
def setupUi(self, IOSRouterPreferencesPageWidget):
|
||||
@@ -14,34 +15,29 @@ class Ui_IOSRouterPreferencesPageWidget(object):
|
||||
IOSRouterPreferencesPageWidget.resize(715, 440)
|
||||
self.verticalLayout_2 = QtWidgets.QVBoxLayout(IOSRouterPreferencesPageWidget)
|
||||
self.verticalLayout_2.setObjectName("verticalLayout_2")
|
||||
self.splitter = QtWidgets.QSplitter(IOSRouterPreferencesPageWidget)
|
||||
self.splitter.setOrientation(QtCore.Qt.Horizontal)
|
||||
self.splitter = QtWidgets.QSplitter(parent=IOSRouterPreferencesPageWidget)
|
||||
self.splitter.setOrientation(QtCore.Qt.Orientation.Horizontal)
|
||||
self.splitter.setObjectName("splitter")
|
||||
self.uiIOSRoutersTreeWidget = QtWidgets.QTreeWidget(self.splitter)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.MinimumExpanding)
|
||||
self.uiIOSRoutersTreeWidget = QtWidgets.QTreeWidget(parent=self.splitter)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Preferred, QtWidgets.QSizePolicy.Policy.MinimumExpanding)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.uiIOSRoutersTreeWidget.sizePolicy().hasHeightForWidth())
|
||||
self.uiIOSRoutersTreeWidget.setSizePolicy(sizePolicy)
|
||||
self.uiIOSRoutersTreeWidget.setMaximumSize(QtCore.QSize(160, 16777215))
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(11)
|
||||
font.setBold(True)
|
||||
font.setWeight(75)
|
||||
self.uiIOSRoutersTreeWidget.setFont(font)
|
||||
self.uiIOSRoutersTreeWidget.setSelectionMode(QtWidgets.QAbstractItemView.ExtendedSelection)
|
||||
self.uiIOSRoutersTreeWidget.setSelectionMode(QtWidgets.QAbstractItemView.SelectionMode.ExtendedSelection)
|
||||
self.uiIOSRoutersTreeWidget.setIconSize(QtCore.QSize(32, 32))
|
||||
self.uiIOSRoutersTreeWidget.setRootIsDecorated(False)
|
||||
self.uiIOSRoutersTreeWidget.setObjectName("uiIOSRoutersTreeWidget")
|
||||
self.uiIOSRoutersTreeWidget.headerItem().setText(0, "1")
|
||||
self.uiIOSRoutersTreeWidget.header().setVisible(False)
|
||||
self.widget = QtWidgets.QWidget(self.splitter)
|
||||
self.widget.setObjectName("widget")
|
||||
self.verticalLayout = QtWidgets.QVBoxLayout(self.widget)
|
||||
self.layoutWidget = QtWidgets.QWidget(parent=self.splitter)
|
||||
self.layoutWidget.setObjectName("layoutWidget")
|
||||
self.verticalLayout = QtWidgets.QVBoxLayout(self.layoutWidget)
|
||||
self.verticalLayout.setContentsMargins(0, 0, 0, 0)
|
||||
self.verticalLayout.setObjectName("verticalLayout")
|
||||
self.uiIOSRouterInfoTreeWidget = QtWidgets.QTreeWidget(self.widget)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.MinimumExpanding)
|
||||
self.uiIOSRouterInfoTreeWidget = QtWidgets.QTreeWidget(parent=self.layoutWidget)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.MinimumExpanding, QtWidgets.QSizePolicy.Policy.MinimumExpanding)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.uiIOSRouterInfoTreeWidget.sizePolicy().hasHeightForWidth())
|
||||
@@ -53,22 +49,22 @@ class Ui_IOSRouterPreferencesPageWidget(object):
|
||||
self.verticalLayout.addWidget(self.uiIOSRouterInfoTreeWidget)
|
||||
self.horizontalLayout = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout.setObjectName("horizontalLayout")
|
||||
self.uiNewIOSRouterPushButton = QtWidgets.QPushButton(self.widget)
|
||||
self.uiNewIOSRouterPushButton = QtWidgets.QPushButton(parent=self.layoutWidget)
|
||||
self.uiNewIOSRouterPushButton.setObjectName("uiNewIOSRouterPushButton")
|
||||
self.horizontalLayout.addWidget(self.uiNewIOSRouterPushButton)
|
||||
self.uiDecompressIOSPushButton = QtWidgets.QPushButton(self.widget)
|
||||
self.uiDecompressIOSPushButton = QtWidgets.QPushButton(parent=self.layoutWidget)
|
||||
self.uiDecompressIOSPushButton.setEnabled(False)
|
||||
self.uiDecompressIOSPushButton.setObjectName("uiDecompressIOSPushButton")
|
||||
self.horizontalLayout.addWidget(self.uiDecompressIOSPushButton)
|
||||
self.uiCopyIOSRouterPushButton = QtWidgets.QPushButton(self.widget)
|
||||
self.uiCopyIOSRouterPushButton = QtWidgets.QPushButton(parent=self.layoutWidget)
|
||||
self.uiCopyIOSRouterPushButton.setEnabled(False)
|
||||
self.uiCopyIOSRouterPushButton.setObjectName("uiCopyIOSRouterPushButton")
|
||||
self.horizontalLayout.addWidget(self.uiCopyIOSRouterPushButton)
|
||||
self.uiEditIOSRouterPushButton = QtWidgets.QPushButton(self.widget)
|
||||
self.uiEditIOSRouterPushButton = QtWidgets.QPushButton(parent=self.layoutWidget)
|
||||
self.uiEditIOSRouterPushButton.setEnabled(False)
|
||||
self.uiEditIOSRouterPushButton.setObjectName("uiEditIOSRouterPushButton")
|
||||
self.horizontalLayout.addWidget(self.uiEditIOSRouterPushButton)
|
||||
self.uiDeleteIOSRouterPushButton = QtWidgets.QPushButton(self.widget)
|
||||
self.uiDeleteIOSRouterPushButton = QtWidgets.QPushButton(parent=self.layoutWidget)
|
||||
self.uiDeleteIOSRouterPushButton.setEnabled(False)
|
||||
self.uiDeleteIOSRouterPushButton.setObjectName("uiDeleteIOSRouterPushButton")
|
||||
self.horizontalLayout.addWidget(self.uiDeleteIOSRouterPushButton)
|
||||
@@ -89,4 +85,3 @@ class Ui_IOSRouterPreferencesPageWidget(object):
|
||||
self.uiCopyIOSRouterPushButton.setText(_translate("IOSRouterPreferencesPageWidget", "&Copy"))
|
||||
self.uiEditIOSRouterPushButton.setText(_translate("IOSRouterPreferencesPageWidget", "&Edit"))
|
||||
self.uiDeleteIOSRouterPushButton.setText(_translate("IOSRouterPreferencesPageWidget", "&Delete"))
|
||||
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file '/home/grossmj/PycharmProjects/gns3-gui/gns3/modules/dynamips/ui/ios_router_wizard.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.9
|
||||
# Created by: PyQt6 UI code generator 6.10.1
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
|
||||
# run again. Do not edit this file unless you know what you are doing.
|
||||
|
||||
|
||||
from PyQt6 import QtCore, QtGui, QtWidgets
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
class Ui_IOSRouterWizard(object):
|
||||
def setupUi(self, IOSRouterWizard):
|
||||
@@ -17,31 +18,31 @@ class Ui_IOSRouterWizard(object):
|
||||
self.uiServerWizardPage.setObjectName("uiServerWizardPage")
|
||||
self.verticalLayout = QtWidgets.QVBoxLayout(self.uiServerWizardPage)
|
||||
self.verticalLayout.setObjectName("verticalLayout")
|
||||
self.uiServerTypeGroupBox = QtWidgets.QGroupBox(self.uiServerWizardPage)
|
||||
self.uiServerTypeGroupBox = QtWidgets.QGroupBox(parent=self.uiServerWizardPage)
|
||||
self.uiServerTypeGroupBox.setObjectName("uiServerTypeGroupBox")
|
||||
self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.uiServerTypeGroupBox)
|
||||
self.verticalLayout_3.setObjectName("verticalLayout_3")
|
||||
self.uiRemoteRadioButton = QtWidgets.QRadioButton(self.uiServerTypeGroupBox)
|
||||
self.uiRemoteRadioButton = QtWidgets.QRadioButton(parent=self.uiServerTypeGroupBox)
|
||||
self.uiRemoteRadioButton.setChecked(True)
|
||||
self.uiRemoteRadioButton.setObjectName("uiRemoteRadioButton")
|
||||
self.verticalLayout_3.addWidget(self.uiRemoteRadioButton)
|
||||
self.uiVMRadioButton = QtWidgets.QRadioButton(self.uiServerTypeGroupBox)
|
||||
self.uiVMRadioButton = QtWidgets.QRadioButton(parent=self.uiServerTypeGroupBox)
|
||||
self.uiVMRadioButton.setObjectName("uiVMRadioButton")
|
||||
self.verticalLayout_3.addWidget(self.uiVMRadioButton)
|
||||
self.uiLocalRadioButton = QtWidgets.QRadioButton(self.uiServerTypeGroupBox)
|
||||
self.uiLocalRadioButton = QtWidgets.QRadioButton(parent=self.uiServerTypeGroupBox)
|
||||
self.uiLocalRadioButton.setObjectName("uiLocalRadioButton")
|
||||
self.verticalLayout_3.addWidget(self.uiLocalRadioButton)
|
||||
self.verticalLayout.addWidget(self.uiServerTypeGroupBox)
|
||||
self.uiRemoteServersGroupBox = QtWidgets.QGroupBox(self.uiServerWizardPage)
|
||||
self.uiRemoteServersGroupBox = QtWidgets.QGroupBox(parent=self.uiServerWizardPage)
|
||||
self.uiRemoteServersGroupBox.setObjectName("uiRemoteServersGroupBox")
|
||||
self.gridLayout_7 = QtWidgets.QGridLayout(self.uiRemoteServersGroupBox)
|
||||
self.gridLayout_7.setObjectName("gridLayout_7")
|
||||
self.uiRemoteServersLabel = QtWidgets.QLabel(self.uiRemoteServersGroupBox)
|
||||
self.uiRemoteServersLabel = QtWidgets.QLabel(parent=self.uiRemoteServersGroupBox)
|
||||
self.uiRemoteServersLabel.setObjectName("uiRemoteServersLabel")
|
||||
self.gridLayout_7.addWidget(self.uiRemoteServersLabel, 0, 0, 1, 1)
|
||||
self.uiRemoteServersComboBox = QtWidgets.QComboBox(self.uiRemoteServersGroupBox)
|
||||
self.uiRemoteServersComboBox = QtWidgets.QComboBox(parent=self.uiRemoteServersGroupBox)
|
||||
self.uiRemoteServersComboBox.setEnabled(False)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.uiRemoteServersComboBox.sizePolicy().hasHeightForWidth())
|
||||
@@ -56,35 +57,35 @@ class Ui_IOSRouterWizard(object):
|
||||
self.verticalLayout_2.setObjectName("verticalLayout_2")
|
||||
self.horizontalLayout_4 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_4.setObjectName("horizontalLayout_4")
|
||||
self.uiIOSExistingImageRadioButton = QtWidgets.QRadioButton(self.uiIOSImageWizardPage)
|
||||
self.uiIOSExistingImageRadioButton = QtWidgets.QRadioButton(parent=self.uiIOSImageWizardPage)
|
||||
self.uiIOSExistingImageRadioButton.setChecked(True)
|
||||
self.uiIOSExistingImageRadioButton.setObjectName("uiIOSExistingImageRadioButton")
|
||||
self.horizontalLayout_4.addWidget(self.uiIOSExistingImageRadioButton)
|
||||
self.uiIOSNewImageRadioButton = QtWidgets.QRadioButton(self.uiIOSImageWizardPage)
|
||||
self.uiIOSNewImageRadioButton = QtWidgets.QRadioButton(parent=self.uiIOSImageWizardPage)
|
||||
self.uiIOSNewImageRadioButton.setChecked(False)
|
||||
self.uiIOSNewImageRadioButton.setObjectName("uiIOSNewImageRadioButton")
|
||||
self.horizontalLayout_4.addWidget(self.uiIOSNewImageRadioButton)
|
||||
spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
|
||||
spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
|
||||
self.horizontalLayout_4.addItem(spacerItem)
|
||||
self.verticalLayout_2.addLayout(self.horizontalLayout_4)
|
||||
self.uiIOSImageLabel = QtWidgets.QLabel(self.uiIOSImageWizardPage)
|
||||
self.uiIOSImageLabel = QtWidgets.QLabel(parent=self.uiIOSImageWizardPage)
|
||||
self.uiIOSImageLabel.setObjectName("uiIOSImageLabel")
|
||||
self.verticalLayout_2.addWidget(self.uiIOSImageLabel)
|
||||
self.horizontalLayout_5 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_5.setObjectName("horizontalLayout_5")
|
||||
self.uiIOSImageListComboBox = QtWidgets.QComboBox(self.uiIOSImageWizardPage)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
|
||||
self.uiIOSImageListComboBox = QtWidgets.QComboBox(parent=self.uiIOSImageWizardPage)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.uiIOSImageListComboBox.sizePolicy().hasHeightForWidth())
|
||||
self.uiIOSImageListComboBox.setSizePolicy(sizePolicy)
|
||||
self.uiIOSImageListComboBox.setObjectName("uiIOSImageListComboBox")
|
||||
self.horizontalLayout_5.addWidget(self.uiIOSImageListComboBox)
|
||||
self.uiIOSImageLineEdit = QtWidgets.QLineEdit(self.uiIOSImageWizardPage)
|
||||
self.uiIOSImageLineEdit = QtWidgets.QLineEdit(parent=self.uiIOSImageWizardPage)
|
||||
self.uiIOSImageLineEdit.setObjectName("uiIOSImageLineEdit")
|
||||
self.horizontalLayout_5.addWidget(self.uiIOSImageLineEdit)
|
||||
self.uiIOSImageToolButton = QtWidgets.QToolButton(self.uiIOSImageWizardPage)
|
||||
self.uiIOSImageToolButton.setToolButtonStyle(QtCore.Qt.ToolButtonTextOnly)
|
||||
self.uiIOSImageToolButton = QtWidgets.QToolButton(parent=self.uiIOSImageWizardPage)
|
||||
self.uiIOSImageToolButton.setToolButtonStyle(QtCore.Qt.ToolButtonStyle.ToolButtonTextOnly)
|
||||
self.uiIOSImageToolButton.setObjectName("uiIOSImageToolButton")
|
||||
self.horizontalLayout_5.addWidget(self.uiIOSImageToolButton)
|
||||
self.verticalLayout_2.addLayout(self.horizontalLayout_5)
|
||||
@@ -93,25 +94,25 @@ class Ui_IOSRouterWizard(object):
|
||||
self.uiNameWizardPage.setObjectName("uiNameWizardPage")
|
||||
self.gridLayout = QtWidgets.QGridLayout(self.uiNameWizardPage)
|
||||
self.gridLayout.setObjectName("gridLayout")
|
||||
self.uiNameLineEdit = QtWidgets.QLineEdit(self.uiNameWizardPage)
|
||||
self.uiNameLineEdit = QtWidgets.QLineEdit(parent=self.uiNameWizardPage)
|
||||
self.uiNameLineEdit.setObjectName("uiNameLineEdit")
|
||||
self.gridLayout.addWidget(self.uiNameLineEdit, 0, 1, 1, 1)
|
||||
self.uiChassisComboBox = QtWidgets.QComboBox(self.uiNameWizardPage)
|
||||
self.uiChassisComboBox = QtWidgets.QComboBox(parent=self.uiNameWizardPage)
|
||||
self.uiChassisComboBox.setObjectName("uiChassisComboBox")
|
||||
self.gridLayout.addWidget(self.uiChassisComboBox, 2, 1, 1, 1)
|
||||
self.uiTypeLabel = QtWidgets.QLabel(self.uiNameWizardPage)
|
||||
self.uiTypeLabel = QtWidgets.QLabel(parent=self.uiNameWizardPage)
|
||||
self.uiTypeLabel.setObjectName("uiTypeLabel")
|
||||
self.gridLayout.addWidget(self.uiTypeLabel, 1, 0, 1, 1)
|
||||
self.uiNameLabel = QtWidgets.QLabel(self.uiNameWizardPage)
|
||||
self.uiNameLabel = QtWidgets.QLabel(parent=self.uiNameWizardPage)
|
||||
self.uiNameLabel.setObjectName("uiNameLabel")
|
||||
self.gridLayout.addWidget(self.uiNameLabel, 0, 0, 1, 1)
|
||||
self.uiPlatformComboBox = QtWidgets.QComboBox(self.uiNameWizardPage)
|
||||
self.uiPlatformComboBox = QtWidgets.QComboBox(parent=self.uiNameWizardPage)
|
||||
self.uiPlatformComboBox.setObjectName("uiPlatformComboBox")
|
||||
self.gridLayout.addWidget(self.uiPlatformComboBox, 1, 1, 1, 1)
|
||||
self.uiChassisLabel = QtWidgets.QLabel(self.uiNameWizardPage)
|
||||
self.uiChassisLabel = QtWidgets.QLabel(parent=self.uiNameWizardPage)
|
||||
self.uiChassisLabel.setObjectName("uiChassisLabel")
|
||||
self.gridLayout.addWidget(self.uiChassisLabel, 2, 0, 1, 1)
|
||||
self.uiEtherSwitchCheckBox = QtWidgets.QCheckBox(self.uiNameWizardPage)
|
||||
self.uiEtherSwitchCheckBox = QtWidgets.QCheckBox(parent=self.uiNameWizardPage)
|
||||
self.uiEtherSwitchCheckBox.setObjectName("uiEtherSwitchCheckBox")
|
||||
self.gridLayout.addWidget(self.uiEtherSwitchCheckBox, 3, 0, 1, 2)
|
||||
IOSRouterWizard.addPage(self.uiNameWizardPage)
|
||||
@@ -119,11 +120,11 @@ class Ui_IOSRouterWizard(object):
|
||||
self.uiMemoryWizardPage.setObjectName("uiMemoryWizardPage")
|
||||
self.gridLayout_2 = QtWidgets.QGridLayout(self.uiMemoryWizardPage)
|
||||
self.gridLayout_2.setObjectName("gridLayout_2")
|
||||
self.uiRamLabel = QtWidgets.QLabel(self.uiMemoryWizardPage)
|
||||
self.uiRamLabel = QtWidgets.QLabel(parent=self.uiMemoryWizardPage)
|
||||
self.uiRamLabel.setObjectName("uiRamLabel")
|
||||
self.gridLayout_2.addWidget(self.uiRamLabel, 0, 0, 1, 1)
|
||||
self.uiRamSpinBox = QtWidgets.QSpinBox(self.uiMemoryWizardPage)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
|
||||
self.uiRamSpinBox = QtWidgets.QSpinBox(parent=self.uiMemoryWizardPage)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.uiRamSpinBox.sizePolicy().hasHeightForWidth())
|
||||
@@ -134,10 +135,10 @@ class Ui_IOSRouterWizard(object):
|
||||
self.uiRamSpinBox.setProperty("value", 128)
|
||||
self.uiRamSpinBox.setObjectName("uiRamSpinBox")
|
||||
self.gridLayout_2.addWidget(self.uiRamSpinBox, 0, 1, 1, 1)
|
||||
self.uiTestIOSImagePushButton = QtWidgets.QPushButton(self.uiMemoryWizardPage)
|
||||
self.uiTestIOSImagePushButton = QtWidgets.QPushButton(parent=self.uiMemoryWizardPage)
|
||||
self.uiTestIOSImagePushButton.setObjectName("uiTestIOSImagePushButton")
|
||||
self.gridLayout_2.addWidget(self.uiTestIOSImagePushButton, 0, 2, 1, 1)
|
||||
self.label = QtWidgets.QLabel(self.uiMemoryWizardPage)
|
||||
self.label = QtWidgets.QLabel(parent=self.uiMemoryWizardPage)
|
||||
self.label.setWordWrap(False)
|
||||
self.label.setOpenExternalLinks(True)
|
||||
self.label.setObjectName("label")
|
||||
@@ -147,81 +148,81 @@ class Ui_IOSRouterWizard(object):
|
||||
self.uiNetworkAdaptersWizardPage.setObjectName("uiNetworkAdaptersWizardPage")
|
||||
self.gridLayout_4 = QtWidgets.QGridLayout(self.uiNetworkAdaptersWizardPage)
|
||||
self.gridLayout_4.setObjectName("gridLayout_4")
|
||||
self.uiSlot0Label = QtWidgets.QLabel(self.uiNetworkAdaptersWizardPage)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Preferred)
|
||||
self.uiSlot0Label = QtWidgets.QLabel(parent=self.uiNetworkAdaptersWizardPage)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.uiSlot0Label.sizePolicy().hasHeightForWidth())
|
||||
self.uiSlot0Label.setSizePolicy(sizePolicy)
|
||||
self.uiSlot0Label.setObjectName("uiSlot0Label")
|
||||
self.gridLayout_4.addWidget(self.uiSlot0Label, 0, 0, 1, 1)
|
||||
self.uiSlot0comboBox = QtWidgets.QComboBox(self.uiNetworkAdaptersWizardPage)
|
||||
self.uiSlot0comboBox = QtWidgets.QComboBox(parent=self.uiNetworkAdaptersWizardPage)
|
||||
self.uiSlot0comboBox.setObjectName("uiSlot0comboBox")
|
||||
self.gridLayout_4.addWidget(self.uiSlot0comboBox, 0, 1, 1, 1)
|
||||
self.uiSlot1Label = QtWidgets.QLabel(self.uiNetworkAdaptersWizardPage)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Preferred)
|
||||
self.uiSlot1Label = QtWidgets.QLabel(parent=self.uiNetworkAdaptersWizardPage)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.uiSlot1Label.sizePolicy().hasHeightForWidth())
|
||||
self.uiSlot1Label.setSizePolicy(sizePolicy)
|
||||
self.uiSlot1Label.setObjectName("uiSlot1Label")
|
||||
self.gridLayout_4.addWidget(self.uiSlot1Label, 1, 0, 1, 1)
|
||||
self.uiSlot1comboBox = QtWidgets.QComboBox(self.uiNetworkAdaptersWizardPage)
|
||||
self.uiSlot1comboBox = QtWidgets.QComboBox(parent=self.uiNetworkAdaptersWizardPage)
|
||||
self.uiSlot1comboBox.setObjectName("uiSlot1comboBox")
|
||||
self.gridLayout_4.addWidget(self.uiSlot1comboBox, 1, 1, 1, 1)
|
||||
self.uiSlot2Label = QtWidgets.QLabel(self.uiNetworkAdaptersWizardPage)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Preferred)
|
||||
self.uiSlot2Label = QtWidgets.QLabel(parent=self.uiNetworkAdaptersWizardPage)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.uiSlot2Label.sizePolicy().hasHeightForWidth())
|
||||
self.uiSlot2Label.setSizePolicy(sizePolicy)
|
||||
self.uiSlot2Label.setObjectName("uiSlot2Label")
|
||||
self.gridLayout_4.addWidget(self.uiSlot2Label, 2, 0, 1, 1)
|
||||
self.uiSlot2comboBox = QtWidgets.QComboBox(self.uiNetworkAdaptersWizardPage)
|
||||
self.uiSlot2comboBox = QtWidgets.QComboBox(parent=self.uiNetworkAdaptersWizardPage)
|
||||
self.uiSlot2comboBox.setObjectName("uiSlot2comboBox")
|
||||
self.gridLayout_4.addWidget(self.uiSlot2comboBox, 2, 1, 1, 1)
|
||||
self.uiSlot3Label = QtWidgets.QLabel(self.uiNetworkAdaptersWizardPage)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Preferred)
|
||||
self.uiSlot3Label = QtWidgets.QLabel(parent=self.uiNetworkAdaptersWizardPage)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.uiSlot3Label.sizePolicy().hasHeightForWidth())
|
||||
self.uiSlot3Label.setSizePolicy(sizePolicy)
|
||||
self.uiSlot3Label.setObjectName("uiSlot3Label")
|
||||
self.gridLayout_4.addWidget(self.uiSlot3Label, 3, 0, 1, 1)
|
||||
self.uiSlot3comboBox = QtWidgets.QComboBox(self.uiNetworkAdaptersWizardPage)
|
||||
self.uiSlot3comboBox = QtWidgets.QComboBox(parent=self.uiNetworkAdaptersWizardPage)
|
||||
self.uiSlot3comboBox.setObjectName("uiSlot3comboBox")
|
||||
self.gridLayout_4.addWidget(self.uiSlot3comboBox, 3, 1, 1, 1)
|
||||
self.uiSlot4Label = QtWidgets.QLabel(self.uiNetworkAdaptersWizardPage)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Preferred)
|
||||
self.uiSlot4Label = QtWidgets.QLabel(parent=self.uiNetworkAdaptersWizardPage)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.uiSlot4Label.sizePolicy().hasHeightForWidth())
|
||||
self.uiSlot4Label.setSizePolicy(sizePolicy)
|
||||
self.uiSlot4Label.setObjectName("uiSlot4Label")
|
||||
self.gridLayout_4.addWidget(self.uiSlot4Label, 4, 0, 1, 1)
|
||||
self.uiSlot4comboBox = QtWidgets.QComboBox(self.uiNetworkAdaptersWizardPage)
|
||||
self.uiSlot4comboBox = QtWidgets.QComboBox(parent=self.uiNetworkAdaptersWizardPage)
|
||||
self.uiSlot4comboBox.setObjectName("uiSlot4comboBox")
|
||||
self.gridLayout_4.addWidget(self.uiSlot4comboBox, 4, 1, 1, 1)
|
||||
self.uiSlot5Label = QtWidgets.QLabel(self.uiNetworkAdaptersWizardPage)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Preferred)
|
||||
self.uiSlot5Label = QtWidgets.QLabel(parent=self.uiNetworkAdaptersWizardPage)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.uiSlot5Label.sizePolicy().hasHeightForWidth())
|
||||
self.uiSlot5Label.setSizePolicy(sizePolicy)
|
||||
self.uiSlot5Label.setObjectName("uiSlot5Label")
|
||||
self.gridLayout_4.addWidget(self.uiSlot5Label, 5, 0, 1, 1)
|
||||
self.uiSlot5comboBox = QtWidgets.QComboBox(self.uiNetworkAdaptersWizardPage)
|
||||
self.uiSlot5comboBox = QtWidgets.QComboBox(parent=self.uiNetworkAdaptersWizardPage)
|
||||
self.uiSlot5comboBox.setObjectName("uiSlot5comboBox")
|
||||
self.gridLayout_4.addWidget(self.uiSlot5comboBox, 5, 1, 1, 1)
|
||||
self.uiSlot6Label = QtWidgets.QLabel(self.uiNetworkAdaptersWizardPage)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Preferred)
|
||||
self.uiSlot6Label = QtWidgets.QLabel(parent=self.uiNetworkAdaptersWizardPage)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.uiSlot6Label.sizePolicy().hasHeightForWidth())
|
||||
self.uiSlot6Label.setSizePolicy(sizePolicy)
|
||||
self.uiSlot6Label.setObjectName("uiSlot6Label")
|
||||
self.gridLayout_4.addWidget(self.uiSlot6Label, 6, 0, 1, 1)
|
||||
self.uiSlot6comboBox = QtWidgets.QComboBox(self.uiNetworkAdaptersWizardPage)
|
||||
self.uiSlot6comboBox = QtWidgets.QComboBox(parent=self.uiNetworkAdaptersWizardPage)
|
||||
self.uiSlot6comboBox.setObjectName("uiSlot6comboBox")
|
||||
self.gridLayout_4.addWidget(self.uiSlot6comboBox, 6, 1, 1, 1)
|
||||
IOSRouterWizard.addPage(self.uiNetworkAdaptersWizardPage)
|
||||
@@ -229,37 +230,37 @@ class Ui_IOSRouterWizard(object):
|
||||
self.uiWicWizardPage.setObjectName("uiWicWizardPage")
|
||||
self.gridLayout_5 = QtWidgets.QGridLayout(self.uiWicWizardPage)
|
||||
self.gridLayout_5.setObjectName("gridLayout_5")
|
||||
self.uiWic0Label = QtWidgets.QLabel(self.uiWicWizardPage)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Preferred)
|
||||
self.uiWic0Label = QtWidgets.QLabel(parent=self.uiWicWizardPage)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.uiWic0Label.sizePolicy().hasHeightForWidth())
|
||||
self.uiWic0Label.setSizePolicy(sizePolicy)
|
||||
self.uiWic0Label.setObjectName("uiWic0Label")
|
||||
self.gridLayout_5.addWidget(self.uiWic0Label, 0, 0, 1, 1)
|
||||
self.uiWic0comboBox = QtWidgets.QComboBox(self.uiWicWizardPage)
|
||||
self.uiWic0comboBox = QtWidgets.QComboBox(parent=self.uiWicWizardPage)
|
||||
self.uiWic0comboBox.setObjectName("uiWic0comboBox")
|
||||
self.gridLayout_5.addWidget(self.uiWic0comboBox, 0, 1, 1, 1)
|
||||
self.uiWic1Label = QtWidgets.QLabel(self.uiWicWizardPage)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Preferred)
|
||||
self.uiWic1Label = QtWidgets.QLabel(parent=self.uiWicWizardPage)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.uiWic1Label.sizePolicy().hasHeightForWidth())
|
||||
self.uiWic1Label.setSizePolicy(sizePolicy)
|
||||
self.uiWic1Label.setObjectName("uiWic1Label")
|
||||
self.gridLayout_5.addWidget(self.uiWic1Label, 1, 0, 1, 1)
|
||||
self.uiWic1comboBox = QtWidgets.QComboBox(self.uiWicWizardPage)
|
||||
self.uiWic1comboBox = QtWidgets.QComboBox(parent=self.uiWicWizardPage)
|
||||
self.uiWic1comboBox.setObjectName("uiWic1comboBox")
|
||||
self.gridLayout_5.addWidget(self.uiWic1comboBox, 1, 1, 1, 1)
|
||||
self.uiWic2Label = QtWidgets.QLabel(self.uiWicWizardPage)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Preferred)
|
||||
self.uiWic2Label = QtWidgets.QLabel(parent=self.uiWicWizardPage)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.uiWic2Label.sizePolicy().hasHeightForWidth())
|
||||
self.uiWic2Label.setSizePolicy(sizePolicy)
|
||||
self.uiWic2Label.setObjectName("uiWic2Label")
|
||||
self.gridLayout_5.addWidget(self.uiWic2Label, 2, 0, 1, 1)
|
||||
self.uiWic2comboBox = QtWidgets.QComboBox(self.uiWicWizardPage)
|
||||
self.uiWic2comboBox = QtWidgets.QComboBox(parent=self.uiWicWizardPage)
|
||||
self.uiWic2comboBox.setObjectName("uiWic2comboBox")
|
||||
self.gridLayout_5.addWidget(self.uiWic2comboBox, 2, 1, 1, 1)
|
||||
IOSRouterWizard.addPage(self.uiWicWizardPage)
|
||||
@@ -267,13 +268,13 @@ class Ui_IOSRouterWizard(object):
|
||||
self.uiIdlePCWizardPage.setObjectName("uiIdlePCWizardPage")
|
||||
self.gridLayout_3 = QtWidgets.QGridLayout(self.uiIdlePCWizardPage)
|
||||
self.gridLayout_3.setObjectName("gridLayout_3")
|
||||
self.uiIdlepcLabel = QtWidgets.QLabel(self.uiIdlePCWizardPage)
|
||||
self.uiIdlepcLabel = QtWidgets.QLabel(parent=self.uiIdlePCWizardPage)
|
||||
self.uiIdlepcLabel.setObjectName("uiIdlepcLabel")
|
||||
self.gridLayout_3.addWidget(self.uiIdlepcLabel, 0, 0, 1, 1)
|
||||
self.uiIdlepcLineEdit = QtWidgets.QLineEdit(self.uiIdlePCWizardPage)
|
||||
self.uiIdlepcLineEdit = QtWidgets.QLineEdit(parent=self.uiIdlePCWizardPage)
|
||||
self.uiIdlepcLineEdit.setObjectName("uiIdlepcLineEdit")
|
||||
self.gridLayout_3.addWidget(self.uiIdlepcLineEdit, 0, 1, 1, 1)
|
||||
self.uiIdlePCFinderPushButton = QtWidgets.QPushButton(self.uiIdlePCWizardPage)
|
||||
self.uiIdlePCFinderPushButton = QtWidgets.QPushButton(parent=self.uiIdlePCWizardPage)
|
||||
self.uiIdlePCFinderPushButton.setObjectName("uiIdlePCFinderPushButton")
|
||||
self.gridLayout_3.addWidget(self.uiIdlePCFinderPushButton, 0, 2, 1, 1)
|
||||
IOSRouterWizard.addPage(self.uiIdlePCWizardPage)
|
||||
@@ -329,4 +330,3 @@ class Ui_IOSRouterWizard(object):
|
||||
self.uiIdlePCWizardPage.setSubTitle(_translate("IOSRouterWizard", "An idle-pc value is necessary to prevent IOS to use 100% of your processor or one of its cores."))
|
||||
self.uiIdlepcLabel.setText(_translate("IOSRouterWizard", "Idle-PC:"))
|
||||
self.uiIdlePCFinderPushButton.setText(_translate("IOSRouterWizard", "Idle-PC finder"))
|
||||
|
||||
|
||||
@@ -36,9 +36,9 @@ class DecompressIOSWorker(QtCore.QObject):
|
||||
"""
|
||||
|
||||
# signals to update the progress dialog.
|
||||
error = QtCore.pyqtSignal(str, bool)
|
||||
finished = QtCore.pyqtSignal()
|
||||
updated = QtCore.pyqtSignal(int)
|
||||
error = QtCore.Signal(str, bool)
|
||||
finished = QtCore.Signal()
|
||||
updated = QtCore.Signal(int)
|
||||
|
||||
def __init__(self, ios_image, destination_file):
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ class IOUDeviceWizard(VMWithImagesWizard, Ui_IOUDeviceWizard):
|
||||
def __init__(self, iou_devices, parent):
|
||||
|
||||
super().__init__(iou_devices, parent)
|
||||
self.setPixmap(QtWidgets.QWizard.LogoPixmap, QtGui.QPixmap(":/symbols/multilayer_switch.svg"))
|
||||
self.setPixmap(QtWidgets.QWizard.WizardPixmap.LogoPixmap, QtGui.QPixmap(":/symbols/multilayer_switch.svg"))
|
||||
|
||||
self.uiTypeComboBox.currentIndexChanged[str].connect(self._typeChangedSlot)
|
||||
|
||||
@@ -81,10 +81,10 @@ class IOUDeviceWizard(VMWithImagesWizard, Ui_IOUDeviceWizard):
|
||||
|
||||
if image_type == "L2 image":
|
||||
# L2 image
|
||||
self.setPixmap(QtWidgets.QWizard.LogoPixmap, QtGui.QPixmap(":/symbols/multilayer_switch.svg"))
|
||||
self.setPixmap(QtWidgets.QWizard.WizardPixmap.LogoPixmap, QtGui.QPixmap(":/symbols/multilayer_switch.svg"))
|
||||
else:
|
||||
# L3 image
|
||||
self.setPixmap(QtWidgets.QWizard.LogoPixmap, QtGui.QPixmap(":/symbols/router.svg"))
|
||||
self.setPixmap(QtWidgets.QWizard.WizardPixmap.LogoPixmap, QtGui.QPixmap(":/symbols/router.svg"))
|
||||
|
||||
def initializePage(self, page_id):
|
||||
|
||||
|
||||
@@ -144,7 +144,7 @@ class iouDeviceConfigurationPage(QtWidgets.QWidget, Ui_iouDeviceConfigPageWidget
|
||||
symbol_path = self.uiSymbolLineEdit.text()
|
||||
dialog = SymbolSelectionDialog(self, symbol=symbol_path)
|
||||
dialog.show()
|
||||
if dialog.exec_():
|
||||
if dialog.exec():
|
||||
new_symbol_path = dialog.getSymbol()
|
||||
self.uiSymbolLineEdit.setText(new_symbol_path)
|
||||
self.uiSymbolLineEdit.setToolTip('<img src="{}"/>'.format(new_symbol_path))
|
||||
|
||||
@@ -140,7 +140,7 @@ class IOUDevicePreferencesPage(QtWidgets.QWidget, Ui_IOUDevicePreferencesPageWid
|
||||
self.uiCopyIOUDevicePushButton.setEnabled(single_selected)
|
||||
|
||||
if single_selected:
|
||||
key = selection[0].data(0, QtCore.Qt.UserRole)
|
||||
key = selection[0].data(0, QtCore.Qt.ItemDataRole.UserRole)
|
||||
iou_device = self._iou_devices[key]
|
||||
self._refreshInfo(iou_device)
|
||||
else:
|
||||
@@ -153,7 +153,7 @@ class IOUDevicePreferencesPage(QtWidgets.QWidget, Ui_IOUDevicePreferencesPageWid
|
||||
|
||||
wizard = IOUDeviceWizard(self._iou_devices, parent=self)
|
||||
wizard.show()
|
||||
if wizard.exec_():
|
||||
if wizard.exec():
|
||||
|
||||
new_device_settings = wizard.getSettings()
|
||||
key = "{server}:{name}".format(server=new_device_settings["compute_id"], name=new_device_settings["name"])
|
||||
@@ -163,7 +163,7 @@ class IOUDevicePreferencesPage(QtWidgets.QWidget, Ui_IOUDevicePreferencesPageWid
|
||||
item = QtWidgets.QTreeWidgetItem(self.uiIOUDevicesTreeWidget)
|
||||
item.setText(0, self._iou_devices[key]["name"])
|
||||
Controller.instance().getSymbolIcon(self._iou_devices[key]["symbol"], qpartial(self._setItemIcon, item))
|
||||
item.setData(0, QtCore.Qt.UserRole, key)
|
||||
item.setData(0, QtCore.Qt.ItemDataRole.UserRole, key)
|
||||
self._items.append(item)
|
||||
self.uiIOUDevicesTreeWidget.setCurrentItem(item)
|
||||
|
||||
@@ -174,9 +174,9 @@ class IOUDevicePreferencesPage(QtWidgets.QWidget, Ui_IOUDevicePreferencesPageWid
|
||||
|
||||
item = self.uiIOUDevicesTreeWidget.currentItem()
|
||||
if item:
|
||||
key = item.data(0, QtCore.Qt.UserRole)
|
||||
key = item.data(0, QtCore.Qt.ItemDataRole.UserRole)
|
||||
copied_iou_device_settings = copy.deepcopy(self._iou_devices[key])
|
||||
new_name, ok = QtWidgets.QInputDialog.getText(self, "Copy IOU template", "Template name:", QtWidgets.QLineEdit.Normal, "Copy of {}".format(copied_iou_device_settings["name"]))
|
||||
new_name, ok = QtWidgets.QInputDialog.getText(self, "Copy IOU template", "Template name:", QtWidgets.QLineEdit.EchoMode.Normal, "Copy of {}".format(copied_iou_device_settings["name"]))
|
||||
if ok:
|
||||
key = "{server}:{name}".format(server=copied_iou_device_settings["compute_id"], name=new_name)
|
||||
if key in self._iou_devices:
|
||||
@@ -190,7 +190,7 @@ class IOUDevicePreferencesPage(QtWidgets.QWidget, Ui_IOUDevicePreferencesPageWid
|
||||
item = QtWidgets.QTreeWidgetItem(self.uiIOUDevicesTreeWidget)
|
||||
item.setText(0, self._iou_devices[key]["name"])
|
||||
Controller.instance().getSymbolIcon(self._iou_devices[key]["symbol"], qpartial(self._setItemIcon, item))
|
||||
item.setData(0, QtCore.Qt.UserRole, key)
|
||||
item.setData(0, QtCore.Qt.ItemDataRole.UserRole, key)
|
||||
self._items.append(item)
|
||||
self.uiIOUDevicesTreeWidget.setCurrentItem(item)
|
||||
|
||||
@@ -201,11 +201,11 @@ class IOUDevicePreferencesPage(QtWidgets.QWidget, Ui_IOUDevicePreferencesPageWid
|
||||
|
||||
item = self.uiIOUDevicesTreeWidget.currentItem()
|
||||
if item:
|
||||
key = item.data(0, QtCore.Qt.UserRole)
|
||||
key = item.data(0, QtCore.Qt.ItemDataRole.UserRole)
|
||||
iou_device = self._iou_devices[key]
|
||||
dialog = ConfigurationDialog(iou_device["name"], iou_device, iouDeviceConfigurationPage(), parent=self)
|
||||
dialog.show()
|
||||
if dialog.exec_():
|
||||
if dialog.exec():
|
||||
# update the icon
|
||||
Controller.instance().getSymbolIcon(iou_device["symbol"], qpartial(self._setItemIcon, item))
|
||||
if iou_device["name"] != item.text(0):
|
||||
@@ -218,7 +218,7 @@ class IOUDevicePreferencesPage(QtWidgets.QWidget, Ui_IOUDevicePreferencesPageWid
|
||||
self._iou_devices[new_key] = self._iou_devices[key]
|
||||
del self._iou_devices[key]
|
||||
item.setText(0, iou_device["name"])
|
||||
item.setData(0, QtCore.Qt.UserRole, new_key)
|
||||
item.setData(0, QtCore.Qt.ItemDataRole.UserRole, new_key)
|
||||
self._refreshInfo(dialog.settings())
|
||||
|
||||
def _iouDeviceDeleteSlot(self):
|
||||
@@ -228,7 +228,7 @@ class IOUDevicePreferencesPage(QtWidgets.QWidget, Ui_IOUDevicePreferencesPageWid
|
||||
|
||||
for item in self.uiIOUDevicesTreeWidget.selectedItems():
|
||||
if item:
|
||||
key = item.data(0, QtCore.Qt.UserRole)
|
||||
key = item.data(0, QtCore.Qt.ItemDataRole.UserRole)
|
||||
del self._iou_devices[key]
|
||||
self.uiIOUDevicesTreeWidget.takeTopLevelItem(self.uiIOUDevicesTreeWidget.indexOfTopLevelItem(item))
|
||||
|
||||
@@ -253,12 +253,12 @@ class IOUDevicePreferencesPage(QtWidgets.QWidget, Ui_IOUDevicePreferencesPageWid
|
||||
item.setText(0, iou_device["name"])
|
||||
Controller.instance().getSymbolIcon(iou_device["symbol"], qpartial(self._setItemIcon, item))
|
||||
|
||||
item.setData(0, QtCore.Qt.UserRole, key)
|
||||
item.setData(0, QtCore.Qt.ItemDataRole.UserRole, key)
|
||||
self._items.append(item)
|
||||
|
||||
if self._items:
|
||||
self.uiIOUDevicesTreeWidget.setCurrentItem(self._items[0])
|
||||
self.uiIOUDevicesTreeWidget.sortByColumn(0, QtCore.Qt.AscendingOrder)
|
||||
self.uiIOUDevicesTreeWidget.sortByColumn(0, QtCore.Qt.SortOrder.AscendingOrder)
|
||||
self.uiIOUDevicesTreeWidget.setMaximumWidth(self.uiIOUDevicesTreeWidget.sizeHintForColumn(0) + 10)
|
||||
|
||||
def savePreferences(self):
|
||||
|
||||
@@ -54,7 +54,7 @@ class IOUPreferencesPage(QtWidgets.QWidget, Ui_IOUPreferencesPageWidget):
|
||||
Slot to open a file browser and select an iourc file
|
||||
"""
|
||||
|
||||
documents_path = QtCore.QStandardPaths.writableLocation(QtCore.QStandardPaths.DocumentsLocation)
|
||||
documents_path = QtCore.QStandardPaths.writableLocation(QtCore.QStandardPaths.StandardLocation.DocumentsLocation)
|
||||
path, _ = QtWidgets.QFileDialog.getOpenFileName(self, "Select the IOURC file", documents_path)
|
||||
if not path:
|
||||
return
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file '/home/grossmj/PycharmProjects/gns3-gui/gns3/modules/iou/ui/iou_device_configuration_page.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.11.3
|
||||
# Created by: PyQt6 UI code generator 6.10.1
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
|
||||
# run again. Do not edit this file unless you know what you are doing.
|
||||
|
||||
|
||||
from PyQt6 import QtCore, QtGui, QtWidgets
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
class Ui_iouDeviceConfigPageWidget(object):
|
||||
def setupUi(self, iouDeviceConfigPageWidget):
|
||||
@@ -14,122 +15,122 @@ class Ui_iouDeviceConfigPageWidget(object):
|
||||
iouDeviceConfigPageWidget.resize(765, 806)
|
||||
self.verticalLayout = QtWidgets.QVBoxLayout(iouDeviceConfigPageWidget)
|
||||
self.verticalLayout.setObjectName("verticalLayout")
|
||||
self.uiTabWidget = QtWidgets.QTabWidget(iouDeviceConfigPageWidget)
|
||||
self.uiTabWidget = QtWidgets.QTabWidget(parent=iouDeviceConfigPageWidget)
|
||||
self.uiTabWidget.setObjectName("uiTabWidget")
|
||||
self.tab = QtWidgets.QWidget()
|
||||
self.tab.setObjectName("tab")
|
||||
self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.tab)
|
||||
self.verticalLayout_2.setObjectName("verticalLayout_2")
|
||||
self.uiGeneralgroupBox = QtWidgets.QGroupBox(self.tab)
|
||||
self.uiGeneralgroupBox = QtWidgets.QGroupBox(parent=self.tab)
|
||||
self.uiGeneralgroupBox.setStyleSheet("")
|
||||
self.uiGeneralgroupBox.setObjectName("uiGeneralgroupBox")
|
||||
self.gridLayout = QtWidgets.QGridLayout(self.uiGeneralgroupBox)
|
||||
self.gridLayout.setObjectName("gridLayout")
|
||||
self.uiNameLabel = QtWidgets.QLabel(self.uiGeneralgroupBox)
|
||||
self.uiNameLabel = QtWidgets.QLabel(parent=self.uiGeneralgroupBox)
|
||||
self.uiNameLabel.setObjectName("uiNameLabel")
|
||||
self.gridLayout.addWidget(self.uiNameLabel, 0, 0, 1, 1)
|
||||
self.uiNameLineEdit = QtWidgets.QLineEdit(self.uiGeneralgroupBox)
|
||||
self.uiNameLineEdit = QtWidgets.QLineEdit(parent=self.uiGeneralgroupBox)
|
||||
self.uiNameLineEdit.setObjectName("uiNameLineEdit")
|
||||
self.gridLayout.addWidget(self.uiNameLineEdit, 0, 1, 1, 1)
|
||||
self.uiDefaultNameFormatLabel = QtWidgets.QLabel(self.uiGeneralgroupBox)
|
||||
self.uiDefaultNameFormatLabel = QtWidgets.QLabel(parent=self.uiGeneralgroupBox)
|
||||
self.uiDefaultNameFormatLabel.setObjectName("uiDefaultNameFormatLabel")
|
||||
self.gridLayout.addWidget(self.uiDefaultNameFormatLabel, 1, 0, 1, 1)
|
||||
self.uiDefaultNameFormatLineEdit = QtWidgets.QLineEdit(self.uiGeneralgroupBox)
|
||||
self.uiDefaultNameFormatLineEdit = QtWidgets.QLineEdit(parent=self.uiGeneralgroupBox)
|
||||
self.uiDefaultNameFormatLineEdit.setText("")
|
||||
self.uiDefaultNameFormatLineEdit.setObjectName("uiDefaultNameFormatLineEdit")
|
||||
self.gridLayout.addWidget(self.uiDefaultNameFormatLineEdit, 1, 1, 1, 1)
|
||||
self.uiSymbolLabel = QtWidgets.QLabel(self.uiGeneralgroupBox)
|
||||
self.uiSymbolLabel = QtWidgets.QLabel(parent=self.uiGeneralgroupBox)
|
||||
self.uiSymbolLabel.setObjectName("uiSymbolLabel")
|
||||
self.gridLayout.addWidget(self.uiSymbolLabel, 2, 0, 1, 1)
|
||||
self.horizontalLayout_7 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_7.setObjectName("horizontalLayout_7")
|
||||
self.uiSymbolLineEdit = QtWidgets.QLineEdit(self.uiGeneralgroupBox)
|
||||
self.uiSymbolLineEdit = QtWidgets.QLineEdit(parent=self.uiGeneralgroupBox)
|
||||
self.uiSymbolLineEdit.setObjectName("uiSymbolLineEdit")
|
||||
self.horizontalLayout_7.addWidget(self.uiSymbolLineEdit)
|
||||
self.uiSymbolToolButton = QtWidgets.QToolButton(self.uiGeneralgroupBox)
|
||||
self.uiSymbolToolButton.setToolButtonStyle(QtCore.Qt.ToolButtonTextOnly)
|
||||
self.uiSymbolToolButton = QtWidgets.QToolButton(parent=self.uiGeneralgroupBox)
|
||||
self.uiSymbolToolButton.setToolButtonStyle(QtCore.Qt.ToolButtonStyle.ToolButtonTextOnly)
|
||||
self.uiSymbolToolButton.setObjectName("uiSymbolToolButton")
|
||||
self.horizontalLayout_7.addWidget(self.uiSymbolToolButton)
|
||||
self.gridLayout.addLayout(self.horizontalLayout_7, 2, 1, 1, 1)
|
||||
self.uiCategoryLabel = QtWidgets.QLabel(self.uiGeneralgroupBox)
|
||||
self.uiCategoryLabel = QtWidgets.QLabel(parent=self.uiGeneralgroupBox)
|
||||
self.uiCategoryLabel.setObjectName("uiCategoryLabel")
|
||||
self.gridLayout.addWidget(self.uiCategoryLabel, 3, 0, 1, 1)
|
||||
self.uiCategoryComboBox = QtWidgets.QComboBox(self.uiGeneralgroupBox)
|
||||
self.uiCategoryComboBox = QtWidgets.QComboBox(parent=self.uiGeneralgroupBox)
|
||||
self.uiCategoryComboBox.setObjectName("uiCategoryComboBox")
|
||||
self.gridLayout.addWidget(self.uiCategoryComboBox, 3, 1, 1, 1)
|
||||
self.uiIOUImageLabel = QtWidgets.QLabel(self.uiGeneralgroupBox)
|
||||
self.uiIOUImageLabel = QtWidgets.QLabel(parent=self.uiGeneralgroupBox)
|
||||
self.uiIOUImageLabel.setObjectName("uiIOUImageLabel")
|
||||
self.gridLayout.addWidget(self.uiIOUImageLabel, 4, 0, 1, 1)
|
||||
self.horizontalLayout_5 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_5.setObjectName("horizontalLayout_5")
|
||||
self.uiIOUImageLineEdit = QtWidgets.QLineEdit(self.uiGeneralgroupBox)
|
||||
self.uiIOUImageLineEdit = QtWidgets.QLineEdit(parent=self.uiGeneralgroupBox)
|
||||
self.uiIOUImageLineEdit.setObjectName("uiIOUImageLineEdit")
|
||||
self.horizontalLayout_5.addWidget(self.uiIOUImageLineEdit)
|
||||
self.uiIOUImageToolButton = QtWidgets.QToolButton(self.uiGeneralgroupBox)
|
||||
self.uiIOUImageToolButton.setToolButtonStyle(QtCore.Qt.ToolButtonTextOnly)
|
||||
self.uiIOUImageToolButton = QtWidgets.QToolButton(parent=self.uiGeneralgroupBox)
|
||||
self.uiIOUImageToolButton.setToolButtonStyle(QtCore.Qt.ToolButtonStyle.ToolButtonTextOnly)
|
||||
self.uiIOUImageToolButton.setObjectName("uiIOUImageToolButton")
|
||||
self.horizontalLayout_5.addWidget(self.uiIOUImageToolButton)
|
||||
self.gridLayout.addLayout(self.horizontalLayout_5, 4, 1, 1, 1)
|
||||
self.uiStartupConfigLabel = QtWidgets.QLabel(self.uiGeneralgroupBox)
|
||||
self.uiStartupConfigLabel = QtWidgets.QLabel(parent=self.uiGeneralgroupBox)
|
||||
self.uiStartupConfigLabel.setObjectName("uiStartupConfigLabel")
|
||||
self.gridLayout.addWidget(self.uiStartupConfigLabel, 5, 0, 1, 1)
|
||||
self.horizontalLayout_4 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_4.setObjectName("horizontalLayout_4")
|
||||
self.uiStartupConfigLineEdit = QtWidgets.QLineEdit(self.uiGeneralgroupBox)
|
||||
self.uiStartupConfigLineEdit = QtWidgets.QLineEdit(parent=self.uiGeneralgroupBox)
|
||||
self.uiStartupConfigLineEdit.setObjectName("uiStartupConfigLineEdit")
|
||||
self.horizontalLayout_4.addWidget(self.uiStartupConfigLineEdit)
|
||||
self.uiStartupConfigToolButton = QtWidgets.QToolButton(self.uiGeneralgroupBox)
|
||||
self.uiStartupConfigToolButton.setToolButtonStyle(QtCore.Qt.ToolButtonTextOnly)
|
||||
self.uiStartupConfigToolButton = QtWidgets.QToolButton(parent=self.uiGeneralgroupBox)
|
||||
self.uiStartupConfigToolButton.setToolButtonStyle(QtCore.Qt.ToolButtonStyle.ToolButtonTextOnly)
|
||||
self.uiStartupConfigToolButton.setObjectName("uiStartupConfigToolButton")
|
||||
self.horizontalLayout_4.addWidget(self.uiStartupConfigToolButton)
|
||||
self.gridLayout.addLayout(self.horizontalLayout_4, 5, 1, 1, 1)
|
||||
self.uiPrivateConfigLabel = QtWidgets.QLabel(self.uiGeneralgroupBox)
|
||||
self.uiPrivateConfigLabel = QtWidgets.QLabel(parent=self.uiGeneralgroupBox)
|
||||
self.uiPrivateConfigLabel.setObjectName("uiPrivateConfigLabel")
|
||||
self.gridLayout.addWidget(self.uiPrivateConfigLabel, 6, 0, 1, 1)
|
||||
self.horizontalLayout_6 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_6.setObjectName("horizontalLayout_6")
|
||||
self.uiPrivateConfigLineEdit = QtWidgets.QLineEdit(self.uiGeneralgroupBox)
|
||||
self.uiPrivateConfigLineEdit = QtWidgets.QLineEdit(parent=self.uiGeneralgroupBox)
|
||||
self.uiPrivateConfigLineEdit.setObjectName("uiPrivateConfigLineEdit")
|
||||
self.horizontalLayout_6.addWidget(self.uiPrivateConfigLineEdit)
|
||||
self.uiPrivateConfigToolButton = QtWidgets.QToolButton(self.uiGeneralgroupBox)
|
||||
self.uiPrivateConfigToolButton.setToolButtonStyle(QtCore.Qt.ToolButtonTextOnly)
|
||||
self.uiPrivateConfigToolButton = QtWidgets.QToolButton(parent=self.uiGeneralgroupBox)
|
||||
self.uiPrivateConfigToolButton.setToolButtonStyle(QtCore.Qt.ToolButtonStyle.ToolButtonTextOnly)
|
||||
self.uiPrivateConfigToolButton.setObjectName("uiPrivateConfigToolButton")
|
||||
self.horizontalLayout_6.addWidget(self.uiPrivateConfigToolButton)
|
||||
self.gridLayout.addLayout(self.horizontalLayout_6, 6, 1, 1, 1)
|
||||
self.uiConsoleTypeLabel = QtWidgets.QLabel(self.uiGeneralgroupBox)
|
||||
self.uiConsoleTypeLabel = QtWidgets.QLabel(parent=self.uiGeneralgroupBox)
|
||||
self.uiConsoleTypeLabel.setObjectName("uiConsoleTypeLabel")
|
||||
self.gridLayout.addWidget(self.uiConsoleTypeLabel, 7, 0, 1, 1)
|
||||
self.horizontalLayout = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout.setObjectName("horizontalLayout")
|
||||
self.uiConsoleTypeComboBox = QtWidgets.QComboBox(self.uiGeneralgroupBox)
|
||||
self.uiConsoleTypeComboBox = QtWidgets.QComboBox(parent=self.uiGeneralgroupBox)
|
||||
self.uiConsoleTypeComboBox.setObjectName("uiConsoleTypeComboBox")
|
||||
self.uiConsoleTypeComboBox.addItem("")
|
||||
self.uiConsoleTypeComboBox.addItem("")
|
||||
self.horizontalLayout.addWidget(self.uiConsoleTypeComboBox)
|
||||
self.uiConsoleAutoStartCheckBox = QtWidgets.QCheckBox(self.uiGeneralgroupBox)
|
||||
self.uiConsoleAutoStartCheckBox = QtWidgets.QCheckBox(parent=self.uiGeneralgroupBox)
|
||||
self.uiConsoleAutoStartCheckBox.setObjectName("uiConsoleAutoStartCheckBox")
|
||||
self.horizontalLayout.addWidget(self.uiConsoleAutoStartCheckBox)
|
||||
self.gridLayout.addLayout(self.horizontalLayout, 7, 1, 1, 1)
|
||||
self.verticalLayout_2.addWidget(self.uiGeneralgroupBox)
|
||||
self.uiOtherSettingsGroupBox = QtWidgets.QGroupBox(self.tab)
|
||||
self.uiOtherSettingsGroupBox = QtWidgets.QGroupBox(parent=self.tab)
|
||||
self.uiOtherSettingsGroupBox.setObjectName("uiOtherSettingsGroupBox")
|
||||
self.gridLayout_2 = QtWidgets.QGridLayout(self.uiOtherSettingsGroupBox)
|
||||
self.gridLayout_2.setObjectName("gridLayout_2")
|
||||
self.uiL1KeepalivesCheckBox = QtWidgets.QCheckBox(self.uiOtherSettingsGroupBox)
|
||||
self.uiL1KeepalivesCheckBox = QtWidgets.QCheckBox(parent=self.uiOtherSettingsGroupBox)
|
||||
self.uiL1KeepalivesCheckBox.setEnabled(True)
|
||||
self.uiL1KeepalivesCheckBox.setChecked(False)
|
||||
self.uiL1KeepalivesCheckBox.setObjectName("uiL1KeepalivesCheckBox")
|
||||
self.gridLayout_2.addWidget(self.uiL1KeepalivesCheckBox, 0, 0, 1, 2)
|
||||
self.uiDefaultValuesCheckBox = QtWidgets.QCheckBox(self.uiOtherSettingsGroupBox)
|
||||
self.uiDefaultValuesCheckBox = QtWidgets.QCheckBox(parent=self.uiOtherSettingsGroupBox)
|
||||
self.uiDefaultValuesCheckBox.setChecked(True)
|
||||
self.uiDefaultValuesCheckBox.setObjectName("uiDefaultValuesCheckBox")
|
||||
self.gridLayout_2.addWidget(self.uiDefaultValuesCheckBox, 1, 0, 1, 2)
|
||||
self.uiRamLabel = QtWidgets.QLabel(self.uiOtherSettingsGroupBox)
|
||||
self.uiRamLabel = QtWidgets.QLabel(parent=self.uiOtherSettingsGroupBox)
|
||||
self.uiRamLabel.setObjectName("uiRamLabel")
|
||||
self.gridLayout_2.addWidget(self.uiRamLabel, 2, 0, 1, 1)
|
||||
self.uiRamSpinBox = QtWidgets.QSpinBox(self.uiOtherSettingsGroupBox)
|
||||
self.uiRamSpinBox = QtWidgets.QSpinBox(parent=self.uiOtherSettingsGroupBox)
|
||||
self.uiRamSpinBox.setEnabled(False)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.uiRamSpinBox.sizePolicy().hasHeightForWidth())
|
||||
@@ -140,12 +141,12 @@ class Ui_iouDeviceConfigPageWidget(object):
|
||||
self.uiRamSpinBox.setProperty("value", 128)
|
||||
self.uiRamSpinBox.setObjectName("uiRamSpinBox")
|
||||
self.gridLayout_2.addWidget(self.uiRamSpinBox, 2, 1, 1, 1)
|
||||
self.uiNvramLabel = QtWidgets.QLabel(self.uiOtherSettingsGroupBox)
|
||||
self.uiNvramLabel = QtWidgets.QLabel(parent=self.uiOtherSettingsGroupBox)
|
||||
self.uiNvramLabel.setObjectName("uiNvramLabel")
|
||||
self.gridLayout_2.addWidget(self.uiNvramLabel, 3, 0, 1, 1)
|
||||
self.uiNvramSpinBox = QtWidgets.QSpinBox(self.uiOtherSettingsGroupBox)
|
||||
self.uiNvramSpinBox = QtWidgets.QSpinBox(parent=self.uiOtherSettingsGroupBox)
|
||||
self.uiNvramSpinBox.setEnabled(False)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.uiNvramSpinBox.sizePolicy().hasHeightForWidth())
|
||||
@@ -157,7 +158,7 @@ class Ui_iouDeviceConfigPageWidget(object):
|
||||
self.uiNvramSpinBox.setObjectName("uiNvramSpinBox")
|
||||
self.gridLayout_2.addWidget(self.uiNvramSpinBox, 3, 1, 1, 1)
|
||||
self.verticalLayout_2.addWidget(self.uiOtherSettingsGroupBox)
|
||||
spacerItem = QtWidgets.QSpacerItem(260, 301, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
|
||||
spacerItem = QtWidgets.QSpacerItem(260, 301, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding)
|
||||
self.verticalLayout_2.addItem(spacerItem)
|
||||
self.uiTabWidget.addTab(self.tab, "")
|
||||
self.tab_2 = QtWidgets.QWidget()
|
||||
@@ -165,15 +166,15 @@ class Ui_iouDeviceConfigPageWidget(object):
|
||||
self.gridLayout_5 = QtWidgets.QGridLayout(self.tab_2)
|
||||
self.gridLayout_5.setContentsMargins(10, 10, 10, 10)
|
||||
self.gridLayout_5.setObjectName("gridLayout_5")
|
||||
self.groupBox = QtWidgets.QGroupBox(self.tab_2)
|
||||
self.groupBox = QtWidgets.QGroupBox(parent=self.tab_2)
|
||||
self.groupBox.setObjectName("groupBox")
|
||||
self.gridLayout_3 = QtWidgets.QGridLayout(self.groupBox)
|
||||
self.gridLayout_3.setObjectName("gridLayout_3")
|
||||
self.uiEthernetAdaptersLabel = QtWidgets.QLabel(self.groupBox)
|
||||
self.uiEthernetAdaptersLabel = QtWidgets.QLabel(parent=self.groupBox)
|
||||
self.uiEthernetAdaptersLabel.setObjectName("uiEthernetAdaptersLabel")
|
||||
self.gridLayout_3.addWidget(self.uiEthernetAdaptersLabel, 0, 0, 1, 1)
|
||||
self.uiEthernetAdaptersSpinBox = QtWidgets.QSpinBox(self.groupBox)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
|
||||
self.uiEthernetAdaptersSpinBox = QtWidgets.QSpinBox(parent=self.groupBox)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.uiEthernetAdaptersSpinBox.sizePolicy().hasHeightForWidth())
|
||||
@@ -182,11 +183,11 @@ class Ui_iouDeviceConfigPageWidget(object):
|
||||
self.uiEthernetAdaptersSpinBox.setSingleStep(2)
|
||||
self.uiEthernetAdaptersSpinBox.setObjectName("uiEthernetAdaptersSpinBox")
|
||||
self.gridLayout_3.addWidget(self.uiEthernetAdaptersSpinBox, 0, 1, 1, 1)
|
||||
self.uiSerialAdaptersLabel = QtWidgets.QLabel(self.groupBox)
|
||||
self.uiSerialAdaptersLabel = QtWidgets.QLabel(parent=self.groupBox)
|
||||
self.uiSerialAdaptersLabel.setObjectName("uiSerialAdaptersLabel")
|
||||
self.gridLayout_3.addWidget(self.uiSerialAdaptersLabel, 1, 0, 1, 1)
|
||||
self.uiSerialAdaptersSpinBox = QtWidgets.QSpinBox(self.groupBox)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
|
||||
self.uiSerialAdaptersSpinBox = QtWidgets.QSpinBox(parent=self.groupBox)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.uiSerialAdaptersSpinBox.sizePolicy().hasHeightForWidth())
|
||||
@@ -196,14 +197,14 @@ class Ui_iouDeviceConfigPageWidget(object):
|
||||
self.uiSerialAdaptersSpinBox.setObjectName("uiSerialAdaptersSpinBox")
|
||||
self.gridLayout_3.addWidget(self.uiSerialAdaptersSpinBox, 1, 1, 1, 1)
|
||||
self.gridLayout_5.addWidget(self.groupBox, 0, 0, 1, 1)
|
||||
spacerItem1 = QtWidgets.QSpacerItem(20, 347, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
|
||||
spacerItem1 = QtWidgets.QSpacerItem(20, 347, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding)
|
||||
self.gridLayout_5.addItem(spacerItem1, 1, 0, 1, 1)
|
||||
self.uiTabWidget.addTab(self.tab_2, "")
|
||||
self.tab_3 = QtWidgets.QWidget()
|
||||
self.tab_3.setObjectName("tab_3")
|
||||
self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.tab_3)
|
||||
self.verticalLayout_3.setObjectName("verticalLayout_3")
|
||||
self.uiUsageTextEdit = QtWidgets.QPlainTextEdit(self.tab_3)
|
||||
self.uiUsageTextEdit = QtWidgets.QPlainTextEdit(parent=self.tab_3)
|
||||
self.uiUsageTextEdit.setObjectName("uiUsageTextEdit")
|
||||
self.verticalLayout_3.addWidget(self.uiUsageTextEdit)
|
||||
self.uiTabWidget.addTab(self.tab_3, "")
|
||||
@@ -247,4 +248,3 @@ class Ui_iouDeviceConfigPageWidget(object):
|
||||
self.uiSerialAdaptersSpinBox.setToolTip(_translate("iouDeviceConfigPageWidget", "1 adapter equals 4 serial interfaces"))
|
||||
self.uiTabWidget.setTabText(self.uiTabWidget.indexOf(self.tab_2), _translate("iouDeviceConfigPageWidget", "Network"))
|
||||
self.uiTabWidget.setTabText(self.uiTabWidget.indexOf(self.tab_3), _translate("iouDeviceConfigPageWidget", "Usage"))
|
||||
|
||||
|
||||
@@ -35,13 +35,6 @@
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>11</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="selectionMode">
|
||||
<enum>QAbstractItemView::ExtendedSelection</enum>
|
||||
</property>
|
||||
@@ -63,7 +56,7 @@
|
||||
</property>
|
||||
</column>
|
||||
</widget>
|
||||
<widget class="QWidget" name="">
|
||||
<widget class="QWidget" name="layoutWidget">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QTreeWidget" name="uiIOUDeviceInfoTreeWidget">
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file '/home/grossmj/PycharmProjects/gns3-gui/gns3/modules/iou/ui/iou_device_preferences_page.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.9
|
||||
# Created by: PyQt6 UI code generator 6.10.1
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
|
||||
# run again. Do not edit this file unless you know what you are doing.
|
||||
|
||||
|
||||
from PyQt6 import QtCore, QtGui, QtWidgets
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
class Ui_IOUDevicePreferencesPageWidget(object):
|
||||
def setupUi(self, IOUDevicePreferencesPageWidget):
|
||||
@@ -14,34 +15,29 @@ class Ui_IOUDevicePreferencesPageWidget(object):
|
||||
IOUDevicePreferencesPageWidget.resize(542, 449)
|
||||
self.verticalLayout_2 = QtWidgets.QVBoxLayout(IOUDevicePreferencesPageWidget)
|
||||
self.verticalLayout_2.setObjectName("verticalLayout_2")
|
||||
self.splitter = QtWidgets.QSplitter(IOUDevicePreferencesPageWidget)
|
||||
self.splitter.setOrientation(QtCore.Qt.Horizontal)
|
||||
self.splitter = QtWidgets.QSplitter(parent=IOUDevicePreferencesPageWidget)
|
||||
self.splitter.setOrientation(QtCore.Qt.Orientation.Horizontal)
|
||||
self.splitter.setObjectName("splitter")
|
||||
self.uiIOUDevicesTreeWidget = QtWidgets.QTreeWidget(self.splitter)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Expanding)
|
||||
self.uiIOUDevicesTreeWidget = QtWidgets.QTreeWidget(parent=self.splitter)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Preferred, QtWidgets.QSizePolicy.Policy.Expanding)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.uiIOUDevicesTreeWidget.sizePolicy().hasHeightForWidth())
|
||||
self.uiIOUDevicesTreeWidget.setSizePolicy(sizePolicy)
|
||||
self.uiIOUDevicesTreeWidget.setMaximumSize(QtCore.QSize(160, 16777215))
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(11)
|
||||
font.setBold(True)
|
||||
font.setWeight(75)
|
||||
self.uiIOUDevicesTreeWidget.setFont(font)
|
||||
self.uiIOUDevicesTreeWidget.setSelectionMode(QtWidgets.QAbstractItemView.ExtendedSelection)
|
||||
self.uiIOUDevicesTreeWidget.setSelectionMode(QtWidgets.QAbstractItemView.SelectionMode.ExtendedSelection)
|
||||
self.uiIOUDevicesTreeWidget.setIconSize(QtCore.QSize(32, 32))
|
||||
self.uiIOUDevicesTreeWidget.setRootIsDecorated(False)
|
||||
self.uiIOUDevicesTreeWidget.setObjectName("uiIOUDevicesTreeWidget")
|
||||
self.uiIOUDevicesTreeWidget.headerItem().setText(0, "1")
|
||||
self.uiIOUDevicesTreeWidget.header().setVisible(False)
|
||||
self.widget = QtWidgets.QWidget(self.splitter)
|
||||
self.widget.setObjectName("widget")
|
||||
self.verticalLayout = QtWidgets.QVBoxLayout(self.widget)
|
||||
self.layoutWidget = QtWidgets.QWidget(parent=self.splitter)
|
||||
self.layoutWidget.setObjectName("layoutWidget")
|
||||
self.verticalLayout = QtWidgets.QVBoxLayout(self.layoutWidget)
|
||||
self.verticalLayout.setContentsMargins(0, 0, 0, 0)
|
||||
self.verticalLayout.setObjectName("verticalLayout")
|
||||
self.uiIOUDeviceInfoTreeWidget = QtWidgets.QTreeWidget(self.widget)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Expanding)
|
||||
self.uiIOUDeviceInfoTreeWidget = QtWidgets.QTreeWidget(parent=self.layoutWidget)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.MinimumExpanding, QtWidgets.QSizePolicy.Policy.Expanding)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.uiIOUDeviceInfoTreeWidget.sizePolicy().hasHeightForWidth())
|
||||
@@ -53,18 +49,18 @@ class Ui_IOUDevicePreferencesPageWidget(object):
|
||||
self.verticalLayout.addWidget(self.uiIOUDeviceInfoTreeWidget)
|
||||
self.horizontalLayout = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout.setObjectName("horizontalLayout")
|
||||
self.uiNewIOUDevicePushButton = QtWidgets.QPushButton(self.widget)
|
||||
self.uiNewIOUDevicePushButton = QtWidgets.QPushButton(parent=self.layoutWidget)
|
||||
self.uiNewIOUDevicePushButton.setObjectName("uiNewIOUDevicePushButton")
|
||||
self.horizontalLayout.addWidget(self.uiNewIOUDevicePushButton)
|
||||
self.uiCopyIOUDevicePushButton = QtWidgets.QPushButton(self.widget)
|
||||
self.uiCopyIOUDevicePushButton = QtWidgets.QPushButton(parent=self.layoutWidget)
|
||||
self.uiCopyIOUDevicePushButton.setEnabled(False)
|
||||
self.uiCopyIOUDevicePushButton.setObjectName("uiCopyIOUDevicePushButton")
|
||||
self.horizontalLayout.addWidget(self.uiCopyIOUDevicePushButton)
|
||||
self.uiEditIOUDevicePushButton = QtWidgets.QPushButton(self.widget)
|
||||
self.uiEditIOUDevicePushButton = QtWidgets.QPushButton(parent=self.layoutWidget)
|
||||
self.uiEditIOUDevicePushButton.setEnabled(False)
|
||||
self.uiEditIOUDevicePushButton.setObjectName("uiEditIOUDevicePushButton")
|
||||
self.horizontalLayout.addWidget(self.uiEditIOUDevicePushButton)
|
||||
self.uiDeleteIOUDevicePushButton = QtWidgets.QPushButton(self.widget)
|
||||
self.uiDeleteIOUDevicePushButton = QtWidgets.QPushButton(parent=self.layoutWidget)
|
||||
self.uiDeleteIOUDevicePushButton.setEnabled(False)
|
||||
self.uiDeleteIOUDevicePushButton.setObjectName("uiDeleteIOUDevicePushButton")
|
||||
self.horizontalLayout.addWidget(self.uiDeleteIOUDevicePushButton)
|
||||
@@ -85,4 +81,3 @@ class Ui_IOUDevicePreferencesPageWidget(object):
|
||||
self.uiCopyIOUDevicePushButton.setText(_translate("IOUDevicePreferencesPageWidget", "&Copy"))
|
||||
self.uiEditIOUDevicePushButton.setText(_translate("IOUDevicePreferencesPageWidget", "&Edit"))
|
||||
self.uiDeleteIOUDevicePushButton.setText(_translate("IOUDevicePreferencesPageWidget", "&Delete"))
|
||||
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file '/home/grossmj/PycharmProjects/gns3-gui/gns3/modules/iou/ui/iou_device_wizard.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.9
|
||||
# Created by: PyQt6 UI code generator 6.10.1
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
|
||||
# run again. Do not edit this file unless you know what you are doing.
|
||||
|
||||
|
||||
from PyQt6 import QtCore, QtGui, QtWidgets
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
class Ui_IOUDeviceWizard(object):
|
||||
def setupUi(self, IOUDeviceWizard):
|
||||
@@ -17,31 +18,31 @@ class Ui_IOUDeviceWizard(object):
|
||||
self.uiServerWizardPage.setObjectName("uiServerWizardPage")
|
||||
self.gridLayout_2 = QtWidgets.QGridLayout(self.uiServerWizardPage)
|
||||
self.gridLayout_2.setObjectName("gridLayout_2")
|
||||
self.uiServerTypeGroupBox = QtWidgets.QGroupBox(self.uiServerWizardPage)
|
||||
self.uiServerTypeGroupBox = QtWidgets.QGroupBox(parent=self.uiServerWizardPage)
|
||||
self.uiServerTypeGroupBox.setObjectName("uiServerTypeGroupBox")
|
||||
self.verticalLayout = QtWidgets.QVBoxLayout(self.uiServerTypeGroupBox)
|
||||
self.verticalLayout.setObjectName("verticalLayout")
|
||||
self.uiRemoteRadioButton = QtWidgets.QRadioButton(self.uiServerTypeGroupBox)
|
||||
self.uiRemoteRadioButton = QtWidgets.QRadioButton(parent=self.uiServerTypeGroupBox)
|
||||
self.uiRemoteRadioButton.setChecked(True)
|
||||
self.uiRemoteRadioButton.setObjectName("uiRemoteRadioButton")
|
||||
self.verticalLayout.addWidget(self.uiRemoteRadioButton)
|
||||
self.uiVMRadioButton = QtWidgets.QRadioButton(self.uiServerTypeGroupBox)
|
||||
self.uiVMRadioButton = QtWidgets.QRadioButton(parent=self.uiServerTypeGroupBox)
|
||||
self.uiVMRadioButton.setObjectName("uiVMRadioButton")
|
||||
self.verticalLayout.addWidget(self.uiVMRadioButton)
|
||||
self.uiLocalRadioButton = QtWidgets.QRadioButton(self.uiServerTypeGroupBox)
|
||||
self.uiLocalRadioButton = QtWidgets.QRadioButton(parent=self.uiServerTypeGroupBox)
|
||||
self.uiLocalRadioButton.setObjectName("uiLocalRadioButton")
|
||||
self.verticalLayout.addWidget(self.uiLocalRadioButton)
|
||||
self.gridLayout_2.addWidget(self.uiServerTypeGroupBox, 0, 0, 1, 1)
|
||||
self.uiRemoteServersGroupBox = QtWidgets.QGroupBox(self.uiServerWizardPage)
|
||||
self.uiRemoteServersGroupBox = QtWidgets.QGroupBox(parent=self.uiServerWizardPage)
|
||||
self.uiRemoteServersGroupBox.setObjectName("uiRemoteServersGroupBox")
|
||||
self.gridLayout_7 = QtWidgets.QGridLayout(self.uiRemoteServersGroupBox)
|
||||
self.gridLayout_7.setObjectName("gridLayout_7")
|
||||
self.uiRemoteServersLabel = QtWidgets.QLabel(self.uiRemoteServersGroupBox)
|
||||
self.uiRemoteServersLabel = QtWidgets.QLabel(parent=self.uiRemoteServersGroupBox)
|
||||
self.uiRemoteServersLabel.setObjectName("uiRemoteServersLabel")
|
||||
self.gridLayout_7.addWidget(self.uiRemoteServersLabel, 0, 0, 1, 1)
|
||||
self.uiRemoteServersComboBox = QtWidgets.QComboBox(self.uiRemoteServersGroupBox)
|
||||
self.uiRemoteServersComboBox = QtWidgets.QComboBox(parent=self.uiRemoteServersGroupBox)
|
||||
self.uiRemoteServersComboBox.setEnabled(False)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.uiRemoteServersComboBox.sizePolicy().hasHeightForWidth())
|
||||
@@ -55,59 +56,59 @@ class Ui_IOUDeviceWizard(object):
|
||||
self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.uiNameWizardPage)
|
||||
self.verticalLayout_2.setObjectName("verticalLayout_2")
|
||||
self.formLayout_7 = QtWidgets.QFormLayout()
|
||||
self.formLayout_7.setFieldGrowthPolicy(QtWidgets.QFormLayout.ExpandingFieldsGrow)
|
||||
self.formLayout_7.setFieldGrowthPolicy(QtWidgets.QFormLayout.FieldGrowthPolicy.ExpandingFieldsGrow)
|
||||
self.formLayout_7.setObjectName("formLayout_7")
|
||||
self.uiNameLabel = QtWidgets.QLabel(self.uiNameWizardPage)
|
||||
self.uiNameLabel = QtWidgets.QLabel(parent=self.uiNameWizardPage)
|
||||
self.uiNameLabel.setObjectName("uiNameLabel")
|
||||
self.formLayout_7.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.uiNameLabel)
|
||||
self.uiNameLineEdit = QtWidgets.QLineEdit(self.uiNameWizardPage)
|
||||
self.formLayout_7.setWidget(0, QtWidgets.QFormLayout.ItemRole.LabelRole, self.uiNameLabel)
|
||||
self.uiNameLineEdit = QtWidgets.QLineEdit(parent=self.uiNameWizardPage)
|
||||
self.uiNameLineEdit.setObjectName("uiNameLineEdit")
|
||||
self.formLayout_7.setWidget(0, QtWidgets.QFormLayout.FieldRole, self.uiNameLineEdit)
|
||||
self.formLayout_7.setWidget(0, QtWidgets.QFormLayout.ItemRole.FieldRole, self.uiNameLineEdit)
|
||||
self.verticalLayout_2.addLayout(self.formLayout_7)
|
||||
self.groupBox = QtWidgets.QGroupBox(self.uiNameWizardPage)
|
||||
self.groupBox.setLayoutDirection(QtCore.Qt.LeftToRight)
|
||||
self.groupBox = QtWidgets.QGroupBox(parent=self.uiNameWizardPage)
|
||||
self.groupBox.setLayoutDirection(QtCore.Qt.LayoutDirection.LeftToRight)
|
||||
self.groupBox.setAutoFillBackground(False)
|
||||
self.groupBox.setObjectName("groupBox")
|
||||
self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.groupBox)
|
||||
self.verticalLayout_3.setObjectName("verticalLayout_3")
|
||||
self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
|
||||
self.uiExistingImageRadioButton = QtWidgets.QRadioButton(self.groupBox)
|
||||
self.uiExistingImageRadioButton = QtWidgets.QRadioButton(parent=self.groupBox)
|
||||
self.uiExistingImageRadioButton.setChecked(True)
|
||||
self.uiExistingImageRadioButton.setObjectName("uiExistingImageRadioButton")
|
||||
self.horizontalLayout_2.addWidget(self.uiExistingImageRadioButton)
|
||||
self.uiNewImageRadioButton = QtWidgets.QRadioButton(self.groupBox)
|
||||
self.uiNewImageRadioButton = QtWidgets.QRadioButton(parent=self.groupBox)
|
||||
self.uiNewImageRadioButton.setChecked(False)
|
||||
self.uiNewImageRadioButton.setObjectName("uiNewImageRadioButton")
|
||||
self.horizontalLayout_2.addWidget(self.uiNewImageRadioButton)
|
||||
spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
|
||||
spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
|
||||
self.horizontalLayout_2.addItem(spacerItem)
|
||||
self.verticalLayout_3.addLayout(self.horizontalLayout_2)
|
||||
self.formLayout_8 = QtWidgets.QFormLayout()
|
||||
self.formLayout_8.setFieldGrowthPolicy(QtWidgets.QFormLayout.AllNonFixedFieldsGrow)
|
||||
self.formLayout_8.setFieldGrowthPolicy(QtWidgets.QFormLayout.FieldGrowthPolicy.AllNonFixedFieldsGrow)
|
||||
self.formLayout_8.setObjectName("formLayout_8")
|
||||
self.uiTypeLabel = QtWidgets.QLabel(self.groupBox)
|
||||
self.uiTypeLabel = QtWidgets.QLabel(parent=self.groupBox)
|
||||
self.uiTypeLabel.setObjectName("uiTypeLabel")
|
||||
self.formLayout_8.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.uiTypeLabel)
|
||||
self.uiTypeComboBox = QtWidgets.QComboBox(self.groupBox)
|
||||
self.formLayout_8.setWidget(1, QtWidgets.QFormLayout.ItemRole.LabelRole, self.uiTypeLabel)
|
||||
self.uiTypeComboBox = QtWidgets.QComboBox(parent=self.groupBox)
|
||||
self.uiTypeComboBox.setObjectName("uiTypeComboBox")
|
||||
self.formLayout_8.setWidget(1, QtWidgets.QFormLayout.FieldRole, self.uiTypeComboBox)
|
||||
self.uiIOUImageLabel = QtWidgets.QLabel(self.groupBox)
|
||||
self.formLayout_8.setWidget(1, QtWidgets.QFormLayout.ItemRole.FieldRole, self.uiTypeComboBox)
|
||||
self.uiIOUImageLabel = QtWidgets.QLabel(parent=self.groupBox)
|
||||
self.uiIOUImageLabel.setObjectName("uiIOUImageLabel")
|
||||
self.formLayout_8.setWidget(2, QtWidgets.QFormLayout.LabelRole, self.uiIOUImageLabel)
|
||||
self.formLayout_8.setWidget(2, QtWidgets.QFormLayout.ItemRole.LabelRole, self.uiIOUImageLabel)
|
||||
self.horizontalLayout_5 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_5.setObjectName("horizontalLayout_5")
|
||||
self.uiIOUImageListComboBox = QtWidgets.QComboBox(self.groupBox)
|
||||
self.uiIOUImageListComboBox = QtWidgets.QComboBox(parent=self.groupBox)
|
||||
self.uiIOUImageListComboBox.setObjectName("uiIOUImageListComboBox")
|
||||
self.horizontalLayout_5.addWidget(self.uiIOUImageListComboBox)
|
||||
self.uiIOUImageLineEdit = QtWidgets.QLineEdit(self.groupBox)
|
||||
self.uiIOUImageLineEdit = QtWidgets.QLineEdit(parent=self.groupBox)
|
||||
self.uiIOUImageLineEdit.setObjectName("uiIOUImageLineEdit")
|
||||
self.horizontalLayout_5.addWidget(self.uiIOUImageLineEdit)
|
||||
self.uiIOUImageToolButton = QtWidgets.QToolButton(self.groupBox)
|
||||
self.uiIOUImageToolButton.setToolButtonStyle(QtCore.Qt.ToolButtonTextOnly)
|
||||
self.uiIOUImageToolButton = QtWidgets.QToolButton(parent=self.groupBox)
|
||||
self.uiIOUImageToolButton.setToolButtonStyle(QtCore.Qt.ToolButtonStyle.ToolButtonTextOnly)
|
||||
self.uiIOUImageToolButton.setObjectName("uiIOUImageToolButton")
|
||||
self.horizontalLayout_5.addWidget(self.uiIOUImageToolButton)
|
||||
self.formLayout_8.setLayout(2, QtWidgets.QFormLayout.FieldRole, self.horizontalLayout_5)
|
||||
self.formLayout_8.setLayout(2, QtWidgets.QFormLayout.ItemRole.FieldRole, self.horizontalLayout_5)
|
||||
self.verticalLayout_3.addLayout(self.formLayout_8)
|
||||
self.verticalLayout_2.addWidget(self.groupBox)
|
||||
IOUDeviceWizard.addPage(self.uiNameWizardPage)
|
||||
@@ -135,4 +136,3 @@ class Ui_IOUDeviceWizard(object):
|
||||
self.uiTypeLabel.setText(_translate("IOUDeviceWizard", "Type:"))
|
||||
self.uiIOUImageLabel.setText(_translate("IOUDeviceWizard", "IOU image:"))
|
||||
self.uiIOUImageToolButton.setText(_translate("IOUDeviceWizard", "&Browse..."))
|
||||
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# 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.9
|
||||
# Created by: PyQt6 UI code generator 6.10.1
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
|
||||
# run again. Do not edit this file unless you know what you are doing.
|
||||
|
||||
|
||||
from PyQt6 import QtCore, QtGui, QtWidgets
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
class Ui_IOUPreferencesPageWidget(object):
|
||||
def setupUi(self, IOUPreferencesPageWidget):
|
||||
@@ -14,30 +15,30 @@ class Ui_IOUPreferencesPageWidget(object):
|
||||
IOUPreferencesPageWidget.resize(490, 532)
|
||||
self.vboxlayout = QtWidgets.QVBoxLayout(IOUPreferencesPageWidget)
|
||||
self.vboxlayout.setObjectName("vboxlayout")
|
||||
self.label = QtWidgets.QLabel(IOUPreferencesPageWidget)
|
||||
self.label = QtWidgets.QLabel(parent=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)
|
||||
self.IOULicenceTextEdit = QtWidgets.QPlainTextEdit(parent=IOUPreferencesPageWidget)
|
||||
self.IOULicenceTextEdit.setObjectName("IOULicenceTextEdit")
|
||||
self.horizontalLayout_5.addWidget(self.IOULicenceTextEdit)
|
||||
self.uiIOURCPathToolButton = QtWidgets.QToolButton(IOUPreferencesPageWidget)
|
||||
self.uiIOURCPathToolButton.setToolButtonStyle(QtCore.Qt.ToolButtonTextOnly)
|
||||
self.uiIOURCPathToolButton = QtWidgets.QToolButton(parent=IOUPreferencesPageWidget)
|
||||
self.uiIOURCPathToolButton.setToolButtonStyle(QtCore.Qt.ToolButtonStyle.ToolButtonTextOnly)
|
||||
self.uiIOURCPathToolButton.setObjectName("uiIOURCPathToolButton")
|
||||
self.horizontalLayout_5.addWidget(self.uiIOURCPathToolButton)
|
||||
self.vboxlayout.addLayout(self.horizontalLayout_5)
|
||||
self.uiLicensecheckBox = QtWidgets.QCheckBox(IOUPreferencesPageWidget)
|
||||
self.uiLicensecheckBox = QtWidgets.QCheckBox(parent=IOUPreferencesPageWidget)
|
||||
self.uiLicensecheckBox.setChecked(True)
|
||||
self.uiLicensecheckBox.setObjectName("uiLicensecheckBox")
|
||||
self.vboxlayout.addWidget(self.uiLicensecheckBox)
|
||||
spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
|
||||
spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding)
|
||||
self.vboxlayout.addItem(spacerItem)
|
||||
self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
|
||||
spacerItem1 = QtWidgets.QSpacerItem(164, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
|
||||
spacerItem1 = QtWidgets.QSpacerItem(164, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
|
||||
self.horizontalLayout_2.addItem(spacerItem1)
|
||||
self.uiRestoreDefaultsPushButton = QtWidgets.QPushButton(IOUPreferencesPageWidget)
|
||||
self.uiRestoreDefaultsPushButton = QtWidgets.QPushButton(parent=IOUPreferencesPageWidget)
|
||||
self.uiRestoreDefaultsPushButton.setObjectName("uiRestoreDefaultsPushButton")
|
||||
self.horizontalLayout_2.addWidget(self.uiRestoreDefaultsPushButton)
|
||||
self.vboxlayout.addLayout(self.horizontalLayout_2)
|
||||
@@ -53,4 +54,3 @@ class Ui_IOUPreferencesPageWidget(object):
|
||||
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"))
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ class QemuImageWizard(QtWidgets.QWizard, Ui_QemuImageWizard):
|
||||
|
||||
self._node_or_server = node_or_server
|
||||
self.setupUi(self)
|
||||
self.setPixmap(QtWidgets.QWizard.LogoPixmap, QtGui.QPixmap(":/symbols/qemu_guest.svg"))
|
||||
self.setPixmap(QtWidgets.QWizard.WizardPixmap.LogoPixmap, QtGui.QPixmap(":/symbols/qemu_guest.svg"))
|
||||
|
||||
# Initialize "constants"
|
||||
self._mappings = {
|
||||
@@ -128,7 +128,7 @@ class QemuImageWizard(QtWidgets.QWizard, Ui_QemuImageWizard):
|
||||
if not '<default>' == refcount_bits:
|
||||
options["refcount_bits"] = int(refcount_bits)
|
||||
|
||||
options["lazy_refcounts"] = 'on' if QtCore.Qt.Checked == self.uiLazyRefcountsCheckBox.checkState() else 'off'
|
||||
options["lazy_refcounts"] = 'on' if QtCore.Qt.CheckState.Checked == self.uiLazyRefcountsCheckBox.checkState() else 'off'
|
||||
|
||||
elif selected_format == self.uiFormatVhdRadio:
|
||||
size_mode = self.uiVhdSizeModeRadios.checkedButton()
|
||||
@@ -145,7 +145,7 @@ class QemuImageWizard(QtWidgets.QWizard, Ui_QemuImageWizard):
|
||||
options["static"] = 'on' if size_mode == self.uiVhdFileSizeModeFixedRadio else 'off'
|
||||
|
||||
elif selected_format == self.uiFormatVmdkRadio:
|
||||
options["zeroed_grain"] = 'on' if QtCore.Qt.Checked == self.uiVmdkZeroedGrainCheckBox.checkState() else 'off'
|
||||
options["zeroed_grain"] = 'on' if QtCore.Qt.CheckState.Checked == self.uiVmdkZeroedGrainCheckBox.checkState() else 'off'
|
||||
|
||||
adapter_type = self.uiVmdkAdapterRadios.checkedButton()
|
||||
if adapter_type is not None:
|
||||
@@ -158,10 +158,10 @@ class QemuImageWizard(QtWidgets.QWizard, Ui_QemuImageWizard):
|
||||
options['adapter_type'] = adapter_type_mappings[adapter_type]
|
||||
|
||||
stream_optimized = self.uiVmdkStreamOptimizedCheckBox.checkState()
|
||||
if QtCore.Qt.Checked == stream_optimized:
|
||||
if QtCore.Qt.CheckState.Checked == stream_optimized:
|
||||
options['subformat'] = 'streamOptimized'
|
||||
else:
|
||||
two = 'twoGbMaxExtent' if QtCore.Qt.Checked == self.uiVmdkSplit2gCheckBox.checkState() else 'monolithic'
|
||||
two = 'twoGbMaxExtent' if QtCore.Qt.CheckState.Checked == self.uiVmdkSplit2gCheckBox.checkState() else 'monolithic'
|
||||
size_mode = self.uiVmdkSizeModeRadios.checkedButton()
|
||||
if size_mode is not None or two == 'twoGbMaxExtent':
|
||||
if size_mode is None:
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user