Exemplo n.º 1
0
    def about(self):
        """Shows the about box."""
        # TODO: copyright string below should be a constant
        QtGui.QMessageBox.about(\
            self,
            self.tr("About Reportbug-NG"),"""Reportbug-NG """ +
                rng.getInstalledPackageVersion("reportbug-ng") + """\n""" +
            self.tr(\
"""Reportbug-NG is a graphical interface for searching, filtering, reporting
or manipulating bugs in Debian's Bug Tracking System.""") + """\n""" +
            self.tr(\
"""Copyright (C) 2007-2014 Bastian Venthur <venthur at debian org>

Homepage: http://reportbug-ng.alioth.debian.org

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version."""))
Exemplo n.º 2
0
    def about(self):
        """Shows the about box."""
        # TODO: copyright string below should be a constant
        QtWidgets.QMessageBox.about(\
            self,
            self.tr("About Reportbug-NG"),"""Reportbug-NG """ +
                rng.getInstalledPackageVersion("reportbug-ng") + """\n""" +
            self.tr(\
"""Reportbug-NG is a graphical interface for searching, filtering, reporting
or manipulating bugs in Debian's Bug Tracking System.""") + """\n""" +
            self.tr(\
"""Copyright (C) 2007-2014 Bastian Venthur <venthur at debian org>

Homepage: http://reportbug-ng.alioth.debian.org

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version."""))
Exemplo n.º 3
0
    def __submit_dialog(self, type):
        """Setup and spawn the submit dialog."""
        dialog = SubmitDialog()
        dialog.checkBox_script.setChecked(self.settings.script)
        dialog.checkBox_presubj.setChecked(self.settings.presubj)

        if type == 'wnpp':
            dialog.wnpp_groupBox.setEnabled(1)
            dialog.wnpp_groupBox.setChecked(1)
            dialog.groupBox_other.setEnabled(0)
            package = self.currentPackage
            to = "*****@*****.**"
        elif type == 'newbug':
            dialog.wnpp_groupBox.setEnabled(1)
            dialog.wnpp_groupBox.setChecked(0)
            package = self.currentPackage
            to = "*****@*****.**"
        elif type == 'moreinfo':
            dialog.wnpp_groupBox.setEnabled(0)
            dialog.comboBoxSeverity.setEnabled(0)
            dialog.checkBoxSecurity.setEnabled(0)
            dialog.checkBoxPatch.setEnabled(0)
            dialog.checkBoxL10n.setEnabled(0)
            package = self.currentBug.package
            to = "*****@*****.**" % self.currentBug.bug_num
        elif type == 'close':
            dialog.groupBox_other.setEnabled(0)
            dialog.wnpp_groupBox.setEnabled(0)
            dialog.comboBoxSeverity.setEnabled(0)
            dialog.checkBoxSecurity.setEnabled(0)
            dialog.checkBoxPatch.setEnabled(0)
            dialog.checkBoxL10n.setEnabled(0)
            dialog.lineEditSummary.setText("Done: %s" % self.currentBug.subject)
            package = self.currentBug.package
            to = "*****@*****.**" % self.currentBug.bug_num
        else:
            self.logger.critical("Received unknown submit dialog type!")

        version = rng.getInstalledPackageVersion(package)
        dialog.lineEditPackage.setText(package)
        dialog.lineEditVersion.setText(version)
        for action in rng.WNPP_ACTIONS:
            dialog.wnpp_comboBox.addItem(action)
        for sev in rng.SEVERITY:
            dialog.comboBoxSeverity.addItem(sev)
        # Set default severity to 'normal'
        dialog.comboBoxSeverity.setCurrentIndex(4)

        # Run the dialog
        if dialog.exec_() == dialog.Accepted:
            package = dialog.lineEditPackage.text()
            version = dialog.lineEditVersion.text()
            severity = unicode(dialog.comboBoxSeverity.currentText()).lower()
            tags = []
            cc = []
            if dialog.checkBoxL10n.isChecked():
                tags.append("l10n")
            if dialog.checkBoxPatch.isChecked():
                tags.append("patch")
            if dialog.checkBoxSecurity.isChecked():
                tags.append("security")
                cc.append("*****@*****.**")
            mua = self.settings.lastmua
            script = dialog.checkBox_script.isChecked()
            presubj = dialog.checkBox_presubj.isChecked()

            body, subject = '', ''
            # WNPP Bugreport
            if dialog.wnpp_comboBox.isEnabled():
                action = dialog.wnpp_comboBox.currentText()
                descr = dialog.wnpp_lineEdit.text()
                body = rng.prepare_wnpp_body(action, package, version)
                subject = rng.prepare_wnpp_subject(action, package, descr)
            # Closing a bug
            elif type == 'close':
                severity = ""
                subject = unicode(dialog.lineEditSummary.text())
                body = rng.prepare_minimal_body(package, version, severity, tags, cc)
            # New or moreinfo
            else:
                if type == 'moreinfo':
                    severity = ""
                subject = unicode("[%s] %s" % (package, dialog.lineEditSummary.text()))
                body = rng.prepareBody(package, version, severity, tags, cc, script)

            if len(subject) == 0:
                subject = "Please enter a subject before submitting the report."

            if presubj:
                txt = rng.get_presubj(package)
                if txt:
                    QtGui.QMessageBox.information(self, "Information", txt)
            thread.start_new_thread(rng.prepareMail, (mua, to, subject, body))
Exemplo n.º 4
0
    def __submit_dialog(self, type):
        """Setup and spawn the submit dialog."""
        dialog = SubmitDialog()
        dialog.checkBox_script.setChecked(self.settings.script)
        dialog.checkBox_presubj.setChecked(self.settings.presubj)

        if type == 'wnpp':
            dialog.wnpp_groupBox.setEnabled(1)
            dialog.wnpp_groupBox.setChecked(1)
            dialog.groupBox_other.setEnabled(0)
            package = self.currentPackage
            to = "*****@*****.**"
        elif type == 'newbug':
            dialog.wnpp_groupBox.setEnabled(1)
            dialog.wnpp_groupBox.setChecked(0)
            package = self.currentPackage
            to = "*****@*****.**"
        elif type == 'moreinfo':
            dialog.wnpp_groupBox.setEnabled(0)
            dialog.comboBoxSeverity.setEnabled(0)
            dialog.checkBoxSecurity.setEnabled(0)
            dialog.checkBoxPatch.setEnabled(0)
            dialog.checkBoxL10n.setEnabled(0)
            package = self.currentBug.package
            to = "*****@*****.**" % self.currentBug.bug_num
        elif type == 'close':
            dialog.groupBox_other.setEnabled(0)
            dialog.wnpp_groupBox.setEnabled(0)
            dialog.comboBoxSeverity.setEnabled(0)
            dialog.checkBoxSecurity.setEnabled(0)
            dialog.checkBoxPatch.setEnabled(0)
            dialog.checkBoxL10n.setEnabled(0)
            dialog.lineEditSummary.setText("Done: %s" %
                                           self.currentBug.subject)
            package = self.currentBug.package
            to = "*****@*****.**" % self.currentBug.bug_num
        else:
            self.logger.critical("Received unknown submit dialog type!")

        version = rng.getInstalledPackageVersion(package)
        dialog.lineEditPackage.setText(package)
        dialog.lineEditVersion.setText(version)
        for action in rng.WNPP_ACTIONS:
            dialog.wnpp_comboBox.addItem(action)
        for sev in rng.SEVERITY:
            dialog.comboBoxSeverity.addItem(sev)
        # Set default severity to 'normal'
        dialog.comboBoxSeverity.setCurrentIndex(4)

        # Run the dialog
        if dialog.exec_() == dialog.Accepted:
            package = dialog.lineEditPackage.text()
            version = dialog.lineEditVersion.text()
            severity = unicode(dialog.comboBoxSeverity.currentText()).lower()
            tags = []
            cc = []
            if dialog.checkBoxL10n.isChecked():
                tags.append("l10n")
            if dialog.checkBoxPatch.isChecked():
                tags.append("patch")
            if dialog.checkBoxSecurity.isChecked():
                tags.append("security")
                cc.append("*****@*****.**")
            mua = self.settings.lastmua
            script = dialog.checkBox_script.isChecked()
            presubj = dialog.checkBox_presubj.isChecked()

            body, subject = '', ''
            # WNPP Bugreport
            if dialog.wnpp_comboBox.isEnabled():
                action = dialog.wnpp_comboBox.currentText()
                descr = dialog.wnpp_lineEdit.text()
                body = rng.prepare_wnpp_body(action, package, version)
                subject = rng.prepare_wnpp_subject(action, package, descr)
            # Closing a bug
            elif type == 'close':
                severity = ""
                subject = unicode(dialog.lineEditSummary.text())
                body = rng.prepare_minimal_body(package, version, severity,
                                                tags, cc)
            # New or moreinfo
            else:
                if type == 'moreinfo':
                    severity = ""
                subject = unicode("[%s] %s" %
                                  (package, dialog.lineEditSummary.text()))
                body = rng.prepareBody(package, version, severity, tags, cc,
                                       script)

            if len(subject) == 0:
                subject = "Please enter a subject before submitting the report."

            if presubj:
                txt = rng.get_presubj(package)
                if txt:
                    QtWidgets.QMessageBox.information(self, "Information", txt)
            thread.start_new_thread(rng.prepareMail, (mua, to, subject, body))