From 229219da9cd3227cf617fe3928221785124a6e21 Mon Sep 17 00:00:00 2001 From: f321x Date: Tue, 10 Jun 2025 16:03:30 +0200 Subject: [PATCH] qt: provide clearer warning for plot feature this warning is more detailed and explains the user why the plotting feature is not available to prevent confusion. --- electrum/gui/qt/history_list.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/electrum/gui/qt/history_list.py b/electrum/gui/qt/history_list.py index 27b12e031..1c42ae5a7 100644 --- a/electrum/gui/qt/history_list.py +++ b/electrum/gui/qt/history_list.py @@ -671,13 +671,15 @@ class HistoryList(MyTreeView, AcceptFileDragDrop): def plot_history_dialog(self): try: from electrum.plot import plot_history, NothingToPlotException - except Exception as e: + except ImportError as e: _logger.error(f"could not import electrum.plot. This feature needs matplotlib to be installed. exc={e!r}") - self.main_window.show_message( - _("Can't plot history.") + '\n' + - _("Perhaps some dependencies are missing...") + " (matplotlib?)" + '\n' + - f"Error: {e!r}" - ) + self.main_window.show_message("\n\n".join([ + _("This feature requires the 'matplotlib' Python library which is not " + "included in Electrum by default."), + _("If you run Electrum from source you can install matplotlib to use this feature."), + _("It is not possible to install matplotlib inside the binary executables " + "(e.g. AppImage or Windows installation).") + ])) return try: plt = plot_history(list(self.hm.transactions.values()))