Example #1
0
    def sendBugReport(self):
        if not self._excInfoSet():
            exctype, excvalue, tracebackobj = sys.exc_info()
        else:
            exctype = self.exctype
            excvalue = self.excvalue
            tracebackobj = self.tracebackobj

        error = traceback.format_exception_only(exctype, excvalue)[-1].strip()
        appname = QtWidgets.QApplication.applicationName()
        if appname:
            subject = '[%s] Bug report - %s' % (appname, error)
        else:
            subject = 'Bug report - %s' % error
        body = '[Please insert your comments and additional info here.]'
        body += '\n\n' + '-' * 80 + '\n'
        body += ''.join(utils.format_bugreport(
            exctype, excvalue, tracebackobj,
            extra_info=qtsupport.format_qt_info()))

        url = QtCore.QUrl('mailto:%s <%s>' % (info.author, info.author_email))
        url.addQueryItem('subject', subject)
        url.addQueryItem('body', body)

        ret = QtGui.QDesktopServices.openUrl(url)
        if not ret:
            msg = self.tr('Unable to send the bug-report.\n'
                          'Please save the bug-report on file and send it '
                          'manually.')
            QtWidgets.QMessageBox.warning(self, self.tr('WARNING'), msg)
Example #2
0
    def sendBugReport(self):
        if not self._excInfoSet():
            exctype, excvalue, tracebackobj = sys.exc_info()
        else:
            exctype = self.exctype
            excvalue = self.excvalue
            tracebackobj = self.tracebackobj

        error = traceback.format_exception_only(exctype, excvalue)[-1].strip()
        appname = QtWidgets.QApplication.applicationName()
        if appname:
            subject = f'[{appname}] Bug report - {error}'
        else:
            subject = 'Bug report - %s' % error
        body = '[Please insert your comments and additional info here.]'
        body += '\n\n' + '-' * 80 + '\n'
        body += ''.join(
            utils.format_bugreport(exctype,
                                   excvalue,
                                   tracebackobj,
                                   extra_info=qtsupport.format_qt_info()))

        url = QtCore.QUrl(f'mailto:{info.author} <{info.author_email}>')
        url.addQueryItem('subject', subject)
        url.addQueryItem('body', body)

        ret = QtGui.QDesktopServices.openUrl(url)
        if not ret:
            msg = self.tr('Unable to send the bug-report.\n'
                          'Please save the bug-report on file and send it '
                          'manually.')
            QtWidgets.QMessageBox.warning(self, self.tr('WARNING'), msg)
Example #3
0
    def setPlatformInfo(self):
        tablewidget = self.platformTableWidget

        platform_info = utils.format_platform_info()
        platform_info.extend(qtsupport.format_qt_info())

        tablewidget.setRowCount(len(platform_info))
        for index, line in enumerate(platform_info):
            name, value = line.split(':', 1)
            tablewidget.setItem(index, 0, QtWidgets.QTableWidgetItem(name))
            tablewidget.setItem(index, 1, QtWidgets.QTableWidgetItem(value))

        header = tablewidget.horizontalHeader()
        header.resizeSections(QtWidgets.QHeaderView.ResizeToContents)
        header.setStretchLastSection(True)
Example #4
0
    def setPlatformInfo(self):
        tablewidget = self.platformTableWidget

        platform_info = utils.format_platform_info()
        platform_info.extend(qtsupport.format_qt_info())

        tablewidget.setRowCount(len(platform_info))
        for index, line in enumerate(platform_info):
            name, value = line.split(':', 1)
            tablewidget.setItem(index, 0, QtWidgets.QTableWidgetItem(name))
            tablewidget.setItem(index, 1, QtWidgets.QTableWidgetItem(value))

        header = tablewidget.horizontalHeader()
        header.resizeSections(QtWidgets.QHeaderView.ResizeToContents)
        header.setStretchLastSection(True)