electrum

Electrum Bitcoin wallet
git clone https://git.parazyd.org/electrum
Log | Files | Refs | Submodules

commit 650225e238a1a9db07d713cf202f0ed1e51a92e7
parent 28ca561bba004e4f24b45ba3e680802678581986
Author: SomberNight <somber.night@protonmail.com>
Date:   Thu,  4 Jul 2019 19:13:12 +0200

crash reporter UX

see #5483

Diffstat:
Melectrum/constants.py | 4++++
Melectrum/gui/qt/exception_window.py | 15+++++++++++----
Melectrum/gui/qt/main_window.py | 2+-
Melectrum/logging.py | 3++-
4 files changed, 18 insertions(+), 6 deletions(-)

diff --git a/electrum/constants.py b/electrum/constants.py @@ -39,6 +39,10 @@ def read_json(filename, default): return r +GIT_REPO_URL = "https://github.com/spesmilo/electrum" +GIT_REPO_ISSUES_URL = "https://github.com/spesmilo/electrum/issues" + + class AbstractNet: @classmethod diff --git a/electrum/gui/qt/exception_window.py b/electrum/gui/qt/exception_window.py @@ -33,6 +33,8 @@ from PyQt5.QtWidgets import (QWidget, QLabel, QPushButton, QTextEdit, from electrum.i18n import _ from electrum.base_crash_reporter import BaseCrashReporter from electrum.logging import Logger +from electrum import constants + from .util import MessageBoxMixin, read_QIcon, WaitingDialog @@ -97,17 +99,22 @@ class Exception_Window(BaseCrashReporter, QWidget, MessageBoxMixin, Logger): 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) + 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:') + '\n' + - str(e) + '\n' + - _("Please report this issue manually."))) + 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) diff --git a/electrum/gui/qt/main_window.py b/electrum/gui/qt/main_window.py @@ -666,7 +666,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger): def show_report_bug(self): msg = ' '.join([ _("Please report any bugs as issues on github:<br/>"), - "<a href=\"https://github.com/spesmilo/electrum/issues\">https://github.com/spesmilo/electrum/issues</a><br/><br/>", + f'''<a href="{constants.GIT_REPO_ISSUES_URL}">{constants.GIT_REPO_ISSUES_URL}</a><br/><br/>''', _("Before reporting a bug, upgrade to the most recent version of Electrum (latest release or git HEAD), and include the version number in your report."), _("Try to explain not only what the bug is, but how it occurs.") ]) diff --git a/electrum/logging.py b/electrum/logging.py @@ -243,7 +243,8 @@ def configure_logging(config): logging.getLogger('kivy').propagate = False from . import ELECTRUM_VERSION - _logger.info(f"Electrum version: {ELECTRUM_VERSION} - https://electrum.org - https://github.com/spesmilo/electrum") + from .constants import GIT_REPO_URL + _logger.info(f"Electrum version: {ELECTRUM_VERSION} - https://electrum.org - {GIT_REPO_URL}") _logger.info(f"Python version: {sys.version}. On platform: {describe_os_version()}") _logger.info(f"Logging to file: {str(_logfile_path)}") _logger.info(f"Log filters: verbosity {repr(verbosity)}, verbosity_shortcuts {repr(verbosity_shortcuts)}")