From 1855bcb17de9099469f25aca331b3afa232a3908 Mon Sep 17 00:00:00 2001 From: bitromortac Date: Thu, 15 Oct 2020 07:03:03 +0200 Subject: [PATCH] qt: reflect running gossip in lightning icon --- electrum/gui/icons/lightning_disconnected.png | Bin 0 -> 4825 bytes electrum/gui/qt/main_window.py | 8 ++++++-- 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 electrum/gui/icons/lightning_disconnected.png diff --git a/electrum/gui/icons/lightning_disconnected.png b/electrum/gui/icons/lightning_disconnected.png new file mode 100644 index 0000000000000000000000000000000000000000..cf71ceeab73048563c20dab4a6a0b13b43ec9e85 GIT binary patch literal 4825 zcmV;~5+?15P) zaB^>EX>4U6ba`-PAZ2)IW&i+q+O?T!b|kqCg#YstJ^~kzAdkcKJ>S5`_XlQ4BWZe_ zwpA@!O5RD)AL{Lujf10^ItE#k25}BclC8A*4IGcec=0(Y-T%OAC2UCe69z14b=8?Qd-rI zrjFM@^Y!30<@NhvdGE`0pDrj~TA7Jbj5~$o`5V*Ag7o}$yMF%)&-tXB=M)?VN%b`t z4*9gax1;wT9rVe`Z)fhS_utRHI6wB+_4LJ;<>ezzzIh|$FW1xiH1Xra>D{9E`Nj}` z{VcUv!B&A|Trh?mkZm2GQfIXfO54dQ43Nu- zV;)S=+2>v-0uxL5$G|-oz=j3qJNCDa?q?7D_=o{AM?8DEuq4JIC#5;~lTIoNe;_+{ zJC*0N^gUDv^b%INwyr~HV#nq60EG%=NpOJ#orT=ePH1x7HJbyAQctYU=b7+DV&N3r zG8YcQF{Fi1l31jD?;XWvp?=g+v7{g%akPDckmuU?T`ld|5&_wz9NbK`F!h?6!`@}| z&}|j2z=fp^V&6%U(!wgKb@8>&NpXcSNDmd}3liU^`o__H@5Zkl$rI|fkw=|kYNtrm zN$MU<*o8u}4D4J_09OMXz@D>aw}@#BIqu%~?%)B;t~}_-?%4MkQWnH*l8@soLpmy?Of}cs}z|Ywo*~|E5hkg8s zc};3v70YMC{|MqNej}BVFV`nwSLI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934%s^*s)ZfP;F=PghP$RfKO5^ zRTeaG(vyX+ZtLMI;iAtA*aE=GRe%0kFGv0X`S;cF5^Kch00000NkvXXu0mjfao03L literal 0 HcmV?d00001 diff --git a/electrum/gui/qt/main_window.py b/electrum/gui/qt/main_window.py index 9cf22c054..e58def2f9 100644 --- a/electrum/gui/qt/main_window.py +++ b/electrum/gui/qt/main_window.py @@ -2153,7 +2153,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger): sb.addPermanentWidget(self.seed_button) self.lightning_button = None if self.wallet.has_lightning() and self.network: - self.lightning_button = StatusBarButton(read_QIcon("lightning.png"), _("Lightning Network"), self.gui_object.show_lightning_dialog) + self.lightning_button = StatusBarButton(read_QIcon("lightning_disconnected.png"), _("Lightning Network"), self.gui_object.show_lightning_dialog) self.update_lightning_icon() sb.addPermanentWidget(self.lightning_button) self.status_button = None @@ -2193,8 +2193,12 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger): def update_lightning_icon(self): if self.lightning_button is None: return - if not self.network.is_lightning_running(): + if not self.network.lngossip.has_started: return + + # display colorful lightning icon to signal connection + self.lightning_button.setIcon(read_QIcon("lightning.png")) + cur, total = self.network.lngossip.get_sync_progress_estimate() # self.logger.debug(f"updating lngossip sync progress estimate: cur={cur}, total={total}") progress_percent = 0