Ejemplo n.º 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))
Ejemplo n.º 2
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
Ejemplo n.º 4
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