Пример #1
0
    def _symbolBrowserSlot(self):
        """
        Slot to open the symbol browser and select a new symbol.
        """

        symbol_path = self.uiSymbolLineEdit.text()
        dialog = SymbolSelectionDialog(self, symbol=symbol_path)
        dialog.show()
        if dialog.exec_():
            new_symbol_path = dialog.getSymbol()
            self.uiSymbolLineEdit.setText(new_symbol_path)
            self.uiSymbolLineEdit.setToolTip('<img src="{}"/>'.format(new_symbol_path))
Пример #2
0
    def _symbolSelectionSlot(self):
        """
        Slot to select a symbol for the QEMU VM.
        """

        dialog = SymbolSelectionDialog(self)
        dialog.show()
        if dialog.exec_():
            normal_symbol, selected_symbol = dialog.getSymbols()
            self.uiSymbolPushButton.setIcon(QtGui.QIcon(normal_symbol))
            self.uiSymbolPushButton.setProperty("default_symbol", normal_symbol)
            self.uiSymbolPushButton.setProperty("hover_symbol", selected_symbol)
Пример #3
0
    def _symbolBrowserSlot(self):
        """
        Slot to open the symbol browser and select a new symbol.
        """

        symbol_path = self.uiSymbolLineEdit.text()
        dialog = SymbolSelectionDialog(self, symbol=symbol_path)
        dialog.show()
        if dialog.exec_():
            new_symbol_path = dialog.getSymbol()
            self.uiSymbolLineEdit.setText(new_symbol_path)
            self.uiSymbolLineEdit.setToolTip('<img src="{}"/>'.format(new_symbol_path))
Пример #4
0
 def _changeSymbolSlot(self):
     """Change a symbol for a Docker image."""
     item = self.uiDockerVMsTreeWidget.currentItem()
     if item:
         key = item.data(0, QtCore.Qt.UserRole)
         docker_image = self._docker_images[key]
         dialog = SymbolSelectionDialog(self,
                                        symbol=docker_image["symbol"],
                                        category=docker_image["category"])
         dialog.show()
         if dialog.exec_():
             normal_symbol, selected_symbol = dialog.getSymbols()
             category = dialog.getCategory()
             item.setIcon(0, QtGui.QIcon(normal_symbol))
             docker_image["symbol"] = normal_symbol
             docker_image["category"] = category
    def _changeSymbolSlot(self):
        """
        Change a symbol for an IOS router.
        """

        item = self.uiIOSRoutersTreeWidget.currentItem()
        if item:
            key = item.data(0, QtCore.Qt.UserRole)
            ios_router = self._ios_routers[key]
            dialog = SymbolSelectionDialog(self, symbol=ios_router["default_symbol"], category=ios_router["category"])
            dialog.show()
            if dialog.exec_():
                normal_symbol, selected_symbol = dialog.getSymbols()
                category = dialog.getCategory()
                item.setIcon(0, QtGui.QIcon(normal_symbol))
                ios_router["default_symbol"] = normal_symbol
                ios_router["hover_symbol"] = selected_symbol
                ios_router["category"] = category
 def _changeSymbolSlot(self):
     """Change a symbol for a Docker image."""
     item = self.uiDockerVMsTreeWidget.currentItem()
     if item:
         key = item.data(0, QtCore.Qt.UserRole)
         docker_image = self._docker_images[key]
         dialog = SymbolSelectionDialog(
             self, symbol=docker_image["symbol"],
             category=docker_image["category"])
         dialog.show()
         if dialog.exec_():
             normal_symbol, selected_symbol = dialog.getSymbols()
             category = dialog.getCategory()
             item.setIcon(0, QtGui.QIcon(normal_symbol))
             docker_image["symbol"] = normal_symbol
             docker_image["category"] = category
Пример #7
0
    def _changeSymbolSlot(self):
        """
        Change a symbol for a QEMU VM.
        """

        item = self.uiQemuVMsTreeWidget.currentItem()
        if item:
            key = item.data(0, QtCore.Qt.UserRole)
            qemu_vm = self._qemu_vms[key]
            dialog = SymbolSelectionDialog(self,
                                           symbol=qemu_vm["default_symbol"],
                                           category=qemu_vm["category"])
            dialog.show()
            if dialog.exec_():
                normal_symbol, selected_symbol = dialog.getSymbols()
                category = dialog.getCategory()
                item.setIcon(0, QtGui.QIcon(normal_symbol))
                qemu_vm["default_symbol"] = normal_symbol
                qemu_vm["hover_symbol"] = selected_symbol
                qemu_vm["category"] = category
    def _changeSymbolSlot(self):
        """
        Change a symbol for an IOU device.
        """

        item = self.uiIOUDevicesTreeWidget.currentItem()
        if item:
            key = item.data(0, QtCore.Qt.UserRole)
            iou_device = self._iou_devices[key]
            dialog = SymbolSelectionDialog(self, symbol=iou_device["default_symbol"], category=iou_device["category"])
            dialog.show()
            if dialog.exec_():
                normal_symbol, selected_symbol = dialog.getSymbols()
                category = dialog.getCategory()
                item.setIcon(0, QtGui.QIcon(normal_symbol))
                iou_device["default_symbol"] = normal_symbol
                iou_device["hover_symbol"] = selected_symbol
                iou_device["category"] = category
    def _changeSymbolSlot(self):
        """
        Change a symbol for an IOS router.
        """

        dialog = SymbolSelectionDialog(self)
        dialog.show()
        if dialog.exec_():
            normal_symbol, selected_symbol = dialog.getSymbols()
            category = dialog.getCategory()
            item = self.uiIOSRoutersTreeWidget.currentItem()
            if item:
                item.setIcon(0, QtGui.QIcon(normal_symbol))
                key = item.data(0, QtCore.Qt.UserRole)
                ios_router = self._ios_routers[key]
                ios_router["default_symbol"] = normal_symbol
                ios_router["hover_symbol"] = selected_symbol
                ios_router["category"] = category
Пример #10
0
    def _changeSymbolSlot(self):
        """
        Change a symbol for a QEMU VM.
        """

        dialog = SymbolSelectionDialog(self)
        dialog.show()
        if dialog.exec_():
            normal_symbol, selected_symbol = dialog.getSymbols()
            category = dialog.getCategory()
            item = self.uiQemuVMsTreeWidget.currentItem()
            if item:
                item.setIcon(0, QtGui.QIcon(normal_symbol))
                key = item.data(0, QtCore.Qt.UserRole)
                qemu_vm = self._qemu_vms[key]
                qemu_vm["default_symbol"] = normal_symbol
                qemu_vm["hover_symbol"] = selected_symbol
                qemu_vm["category"] = category
    def _changeSymbolSlot(self):
        """
        Change a symbol for a VirtualBox VM.
        """

        item = self.uiVirtualBoxVMsTreeWidget.currentItem()
        if item:
            key = item.data(0, QtCore.Qt.UserRole)
            vbox_vm = self._virtualbox_vms[key]
            dialog = SymbolSelectionDialog(self, symbol=vbox_vm["default_symbol"], category=vbox_vm["category"])
            dialog.show()
            if dialog.exec_():
                normal_symbol, selected_symbol = dialog.getSymbols()
                category = dialog.getCategory()
                item.setIcon(0, QtGui.QIcon(normal_symbol))
                vbox_vm["default_symbol"] = normal_symbol
                vbox_vm["hover_symbol"] = selected_symbol
                vbox_vm["category"] = category