Skip to content

Commit 1d0a173

Browse files
authored
Merge pull request #3358 from GNS3/use-themed-symbols
Let the controller allocate symbols
2 parents ca3e6f0 + b236343 commit 1d0a173

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+118641
-134773
lines changed

gns3/dialogs/appliance_wizard.py

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -139,29 +139,19 @@ def initializePage(self, page_id):
139139

140140
# add symbol
141141
if self._appliance["category"] == "guest":
142-
symbol = ":/symbols/computer.svg"
142+
if self._appliance.emulator() == "docker":
143+
symbol = ":/symbols/docker_guest.svg"
144+
elif self._appliance.emulator() == "qemu":
145+
symbol = ":/symbols/qemu_guest.svg"
146+
else:
147+
symbol = ":/symbols/computer.svg"
143148
else:
144149
symbol = ":/symbols/{}.svg".format(self._appliance["category"])
145150
self.page(page_id).setPixmap(QtWidgets.QWizard.LogoPixmap, QtGui.QPixmap(symbol))
146151

147152
if self.page(page_id) == self.uiServerWizardPage:
148153

149154
Controller.instance().getSymbols(self._getSymbolsCallback)
150-
151-
if "qemu" in self._appliance:
152-
emulator_type = "qemu"
153-
elif "iou" in self._appliance:
154-
emulator_type = "iou"
155-
elif "docker" in self._appliance:
156-
emulator_type = "docker"
157-
elif "dynamips" in self._appliance:
158-
emulator_type = "dynamips"
159-
else:
160-
QtWidgets.QMessageBox.warning(self, "Appliance", "Could not determine the emulator type")
161-
162-
is_mac = ComputeManager.instance().localPlatform().startswith("darwin")
163-
is_win = ComputeManager.instance().localPlatform().startswith("win")
164-
165155
self.uiRemoteServersComboBox.clear()
166156
if len(ComputeManager.instance().remoteComputes()) == 0:
167157
self.uiRemoteRadioButton.setEnabled(False)

gns3/modules/builtin/dialogs/cloud_wizard.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def getSettings(self):
4848
"""
4949

5050
settings = {"name": self.uiNameLineEdit.text(),
51-
"symbol": ":/symbols/cloud.svg",
51+
"symbol": "cloud",
5252
"compute_id": self._compute_id}
5353

5454
return settings

gns3/modules/builtin/dialogs/ethernet_hub_wizard.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def getSettings(self):
5454
"name": "Ethernet{}".format(port_number)})
5555

5656
settings = {"name": self.uiNameLineEdit.text(),
57-
"symbol": ":/symbols/hub.svg",
57+
"symbol": "hub",
5858
"category": Node.switches,
5959
"compute_id": self._compute_id,
6060
"ports_mapping": ports}

gns3/modules/builtin/dialogs/ethernet_switch_wizard.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def getSettings(self):
5757
"ethertype": "0x8100"})
5858

5959
settings = {"name": self.uiNameLineEdit.text(),
60-
"symbol": ":/symbols/ethernet_switch.svg",
60+
"symbol": "ethernet_switch",
6161
"category": Node.switches,
6262
"compute_id": self._compute_id,
6363
"ports_mapping": ports}

gns3/modules/builtin/settings.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"remote_console_type": "none",
4141
"remote_console_http_path": "/",
4242
"default_name_format": "Cloud{0}",
43-
"symbol": ":/symbols/cloud.svg",
43+
"symbol": "cloud",
4444
"category": Node.end_devices,
4545
"ports_mapping": [],
4646
"node_type": "cloud"
@@ -49,7 +49,7 @@
4949
ETHERNET_HUB_SETTINGS = {
5050
"name": "",
5151
"default_name_format": "Hub{0}",
52-
"symbol": ":/symbols/hub.svg",
52+
"symbol": "hub",
5353
"category": Node.switches,
5454
"ports_mapping": [],
5555
"node_type": "ethernet_hub"
@@ -58,7 +58,7 @@
5858
ETHERNET_SWITCH_SETTINGS = {
5959
"name": "",
6060
"default_name_format": "Switch{0}",
61-
"symbol": ":/symbols/ethernet_switch.svg",
61+
"symbol": "ethernet_switch",
6262
"category": Node.switches,
6363
"console_type": "none",
6464
"ports_mapping": [],

gns3/modules/docker/dialogs/docker_vm_wizard.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def __init__(self, docker_containers, parent):
3939

4040
super().__init__(docker_containers, parent)
4141
self._docker_containers = docker_containers
42-
self.setPixmap(QtWidgets.QWizard.LogoPixmap, QtGui.QPixmap(":/icons/docker.png"))
42+
self.setPixmap(QtWidgets.QWizard.LogoPixmap, QtGui.QPixmap(":/symbols/docker_guest.svg"))
4343

4444
self.uiNewImageRadioButton.setChecked(True)
4545
self._existingImageRadioButtonToggledSlot(False)

gns3/modules/docker/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
DOCKER_CONTAINER_SETTINGS = {
3030
"default_name_format": "{name}-{0}",
3131
"usage": "",
32-
"symbol": ":/symbols/docker_guest.svg",
32+
"symbol": "docker_guest",
3333
"category": Node.end_devices,
3434
"start_command": "",
3535
"name": "",

gns3/modules/dynamips/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"default_name_format": "R{0}",
3535
"usage": "",
3636
"image": "",
37-
"symbol": ":/symbols/router.svg",
37+
"symbol": "router",
3838
"category": Node.routers,
3939
"startup_config": "",
4040
"private_config": "",

gns3/modules/iou/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"default_name_format": "IOU{0}",
3333
"usage": "",
3434
"path": "",
35-
"symbol": ":/symbols/multilayer_switch.svg",
35+
"symbol": "multilayer_switch",
3636
"category": Node.routers,
3737
"startup_config": "",
3838
"private_config": "",

gns3/modules/qemu/dialogs/qemu_image_wizard.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def __init__(self, parent, node, filename="disk", size=30000):
4040

4141
self._node = node
4242
self.setupUi(self)
43-
self.setPixmap(QtWidgets.QWizard.LogoPixmap, QtGui.QPixmap(":/icons/qemu.svg"))
43+
self.setPixmap(QtWidgets.QWizard.LogoPixmap, QtGui.QPixmap(":/symbols/qemu_guest.svg"))
4444

4545
# Initialize "constants"
4646
self._mappings = {

0 commit comments

Comments
 (0)