-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathqt.py
More file actions
31 lines (24 loc) · 1004 Bytes
/
qt.py
File metadata and controls
31 lines (24 loc) · 1004 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import weakref
from PyQt5 import QtGui
from electroncash.plugins import BasePlugin, hook
from electroncash_gui.qt.main_window import StatusBarButton
from . import ui
class Plugin(BasePlugin):
@hook
def init_qt(self, gui):
for window in gui.windows:
dialog = ui.WalletConnectDialog(window, self)
sbbtn = StatusBarButton(self.icon(), "Wallet Connect", dialog.show)
sb = window.statusBar()
sb.insertPermanentWidget(3, sbbtn)
window._wallet_connect_btn = weakref.ref(sbbtn)
@hook
def on_new_window(self, window):
dialog =ui.WalletConnectDialog(window, self)
sbbtn = StatusBarButton(self.icon(), "Wallet Connect", dialog.show)
sb = window.statusBar()
sb.insertPermanentWidget(3, sbbtn)
window._wallet_connect_btn = weakref.ref(sbbtn)
def icon(self):
from .resources import qInitResources # lazy importing
return QtGui.QIcon(":walletconnect/assets/Icon.svg")