Esempio n. 1
0
    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()
Esempio n. 2
0
def msgBox(text, icon=QMessageBox.Information, title=""):
    """
    :param text:
    :param icon:
    :param title:
    """
    x = QMessageBox()
    if title: x.setWindowTitle(title)
    x.setText(text)
    x.setIcon(icon)
    x.exec()
Esempio n. 3
0
 def onDelChannelEvent(self, schid, channel, invokerID, invokerName,
                       invokerUniqueIdentifier):
     if self.schid == schid and self.channel == channel:
         msgBox = QMessageBox()
         msgBox.setText(
             "Channel \"{0}\" got deleted by \"{1}\"\n\nStopping Queue!".
             format(self.cname, invokerName))
         msgBox.setIcon(QMessageBox.Warning)
         msgBox.exec()
         self.schid = 0
         self.channel = 0
         self.password = ""
         self.name = ""
Esempio n. 4
0
def msgBox(text, icon=QMessageBox.Information):
    x = QMessageBox()
    x.setText(text)
    x.setIcon(icon)
    x.exec()