def onRemoveButtonClicked(self, pluginname): if pluginname in self.host.plugins: if self.cfg.getboolean("general", "uninstallQuestion"): def cbox_state_changed(state): if state == Qt.Checked: self.cfg.set("general", "uninstallQuestion", "False") else: self.cfg.set("general", "uninstallQuestion", "True") cbox = QCheckBox(self._tr("Don't ask me again")) cbox.connect("stateChanged(int)", cbox_state_changed) msgbox = QMessageBox(self) msgbox.setInformativeText(self._tr("Do you really want to " "delete plugin {name}?\n" "This will erase all " "script data of the " "plugin from disk."). format(name=pluginname)) msgbox.setIcon(4) # QMessageBox::Icon::Question = 4 msgbox.setStandardButtons(QMessageBox.Ok | QMessageBox.Cancel) msgbox.setDefaultButton(QMessageBox.Cancel) msgbox.setCheckBox(cbox) if msgbox.exec_() != QMessageBox.Ok: return if pluginname in self.host.active: self.host.deactivate(pluginname) devtools.PluginInstaller.removePlugin(pluginname) self.host.reload() self.host.start() self.setupList()