Esempio n. 1
0
    def __init__(self, main_window, exctype, value, tb):
        BaseCrashReporter.__init__(self, exctype, value, tb)
        self.main_window = main_window

        QWidget.__init__(self)
        self.setWindowTitle('Axe Electrum - ' + _('An Error Occurred'))
        self.setMinimumSize(600, 300)

        Logger.__init__(self)

        main_box = QVBoxLayout()

        heading = QLabel('<h2>' + BaseCrashReporter.CRASH_TITLE + '</h2>')
        main_box.addWidget(heading)
        main_box.addWidget(QLabel(BaseCrashReporter.CRASH_MESSAGE))

        main_box.addWidget(QLabel(BaseCrashReporter.REQUEST_HELP_MESSAGE))

        collapse_info = QPushButton(_("Show report contents"))
        collapse_info.clicked.connect(
            lambda: self.msg_box(QMessageBox.NoIcon,
                                 self,
                                 _("Report contents"),
                                 self.get_report_string(),
                                 rich_text=True))

        main_box.addWidget(collapse_info)

        main_box.addWidget(QLabel(BaseCrashReporter.DESCRIBE_ERROR_MESSAGE))

        self.description_textfield = QTextEdit()
        self.description_textfield.setFixedHeight(50)
        self.description_textfield.setPlaceholderText(
            _("Do not enter sensitive/private information here. "
              "The report will be visible on the public issue tracker."))
        main_box.addWidget(self.description_textfield)

        main_box.addWidget(QLabel(BaseCrashReporter.ASK_CONFIRM_SEND))

        buttons = QHBoxLayout()

        report_button = QPushButton(_('Send Bug Report'))
        report_button.clicked.connect(self.send_report)
        report_button.setIcon(read_QIcon("tab_send.png"))
        buttons.addWidget(report_button)

        never_button = QPushButton(_('Never'))
        never_button.clicked.connect(self.show_never)
        buttons.addWidget(never_button)

        close_button = QPushButton(_('Not Now'))
        close_button.clicked.connect(self.close)
        buttons.addWidget(close_button)

        main_box.addLayout(buttons)

        self.setLayout(main_box)
        self.show()
Esempio n. 2
0
 def __init__(self, main_window, exctype, value, tb):
     BaseCrashReporter.__init__(self, exctype, value, tb)
     Factory.Popup.__init__(self)
     self.main_window = main_window
     self.title = BaseCrashReporter.CRASH_TITLE
     self.title_size = "24sp"
     self.ids.crash_message.text = BaseCrashReporter.CRASH_MESSAGE
     self.ids.request_help_message.text = BaseCrashReporter.REQUEST_HELP_MESSAGE
     self.ids.describe_error_message.text = BaseCrashReporter.DESCRIBE_ERROR_MESSAGE
Esempio n. 3
0
    def __init__(self, main_window, exctype, value, tb):
        BaseCrashReporter.__init__(self, exctype, value, tb)
        self.main_window = main_window
        QWidget.__init__(self)
        self.setWindowTitle('Electrum-AXE - ' + _('An Error Occurred'))
        self.setMinimumSize(600, 300)

        main_box = QVBoxLayout()

        heading = QLabel('<h2>' + BaseCrashReporter.CRASH_TITLE + '</h2>')
        main_box.addWidget(heading)
        main_box.addWidget(QLabel(BaseCrashReporter.CRASH_MESSAGE))

        main_box.addWidget(QLabel(BaseCrashReporter.REQUEST_HELP_MESSAGE))

        collapse_info = QPushButton(_("Show report contents"))
        collapse_info.clicked.connect(
            lambda: self.msg_box(QMessageBox.NoIcon, self, _(
                "Report contents"), self.get_report_string()))

        main_box.addWidget(collapse_info)

        main_box.addWidget(QLabel(BaseCrashReporter.DESCRIBE_ERROR_MESSAGE))

        self.description_textfield = QTextEdit()
        self.description_textfield.setFixedHeight(50)
        main_box.addWidget(self.description_textfield)

        main_box.addWidget(QLabel(BaseCrashReporter.ASK_CONFIRM_SEND))

        buttons = QHBoxLayout()

        report_button = QPushButton(_('Send Bug Report'))
        report_button.clicked.connect(self.send_report)
        report_button.setIcon(QIcon(":icons/tab_send.png"))
        buttons.addWidget(report_button)

        never_button = QPushButton(_('Never'))
        never_button.clicked.connect(self.show_never)
        buttons.addWidget(never_button)

        close_button = QPushButton(_('Not Now'))
        close_button.clicked.connect(self.close)
        buttons.addWidget(close_button)

        main_box.addLayout(buttons)

        self.setLayout(main_box)
        self.show()
Esempio n. 4
0
    def send_report(self):
        def on_success(response):
            # note: 'response' coming from (remote) crash reporter server.
            # It contains a URL to the GitHub issue, so we allow rich text.
            self.show_message(parent=self,
                              title=_("Crash report"),
                              msg=response,
                              rich_text=True)
            self.close()

        def on_failure(exc_info):
            e = exc_info[1]
            self.logger.error(
                'There was a problem with the automatic reporting',
                exc_info=exc_info)
            self.show_critical(
                parent=self,
                msg=(
                    _('There was a problem with the automatic reporting:') +
                    '<br/>' + repr(e)[:120] + '<br/>' +
                    _("Please report this issue manually") +
                    f' <a href="{constants.GIT_REPO_ISSUES_URL}">on GitHub</a>.'
                ),
                rich_text=True)

        proxy = self.main_window.network.proxy
        task = lambda: BaseCrashReporter.send_report(
            self, self.main_window.network.asyncio_loop, proxy)
        msg = _('Sending crash report...')
        WaitingDialog(self, msg, task, on_success, on_failure)
Esempio n. 5
0
 def send_report(self):
     try:
         response = BaseCrashReporter.send_report(self, "/crash.json").json()
     except requests.exceptions.RequestException:
         self.show_popup(_('Unable to send report'), _("Please check your network connection."))
     else:
         self.show_popup(_('Report sent'), response["text"])
         if response["location"]:
             self.open_url(response["location"])
     self.dismiss()
 def send_report(self):
     try:
         response = BaseCrashReporter.send_report(self)
     except BaseException as e:
         traceback.print_exc(file=sys.stderr)
         self.main_window.show_critical(
             _('There was a problem with the automatic reporting:') + '\n' +
             str(e) + '\n' + _("Please report this issue manually."))
         return
     QMessageBox.about(self, _("Crash report"), response.text)
     self.close()
Esempio n. 7
0
 def send_report(self):
     try:
         proxy = self.main_window.network.proxy
         response = BaseCrashReporter.send_report(self, self.main_window.network.asyncio_loop, proxy)
     except BaseException as e:
         self.logger.exception('There was a problem with the automatic reporting')
         self.main_window.show_critical(_('There was a problem with the automatic reporting:') + '\n' +
                                        str(e) + '\n' +
                                        _("Please report this issue manually."))
         return
     QMessageBox.about(self, _("Crash report"), response)
     self.close()
Esempio n. 8
0
 def send_report(self):
     try:
         loop = self.main_window.network.asyncio_loop
         proxy = self.main_window.network.proxy
         response = json.loads(
             BaseCrashReporter.send_report(self, loop, proxy,
                                           "/crash.json"))
     except (ValueError, ClientError):
         self.show_popup(_('Unable to send report'),
                         _("Please check your network connection."))
     else:
         self.show_popup(_('Report sent'), response["text"])
         if response["location"]:
             self.open_url(response["location"])
     self.dismiss()
Esempio n. 9
0
 def send_report(self):
     try:
         loop = self.main_window.network.asyncio_loop
         proxy = self.main_window.network.proxy
         # FIXME network request in GUI thread...
         response = json.loads(
             BaseCrashReporter.send_report(self,
                                           loop,
                                           proxy,
                                           "/crash.json",
                                           timeout=10))
     except (ValueError, ClientError):
         #self.logger.debug("", exc_info=True)
         self.show_popup(_('Unable to send report'),
                         _("Please check your network connection."))
     else:
         self.show_popup(_('Report sent'), response["text"])
         if response["location"]:
             self.open_url(response["location"])
     self.dismiss()