add switch-gui button for qt
This commit is contained in:
parent
558ba16bc2
commit
30de518be9
|
@ -13,6 +13,7 @@
|
|||
<file>icons/status_connected.png</file>
|
||||
<file>icons/status_disconnected.png</file>
|
||||
<file>icons/status_waiting.png</file>
|
||||
<file>icons/switchgui.png</file>
|
||||
<file>icons/unconfirmed.png</file>
|
||||
<file>icons/network.png</file>
|
||||
</qresource>
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 1.6 KiB |
|
@ -88,14 +88,17 @@ def load_theme_paths():
|
|||
|
||||
class ElectrumGui(QObject):
|
||||
|
||||
def __init__(self, wallet, config):
|
||||
def __init__(self, wallet, config, expert=None):
|
||||
super(QObject, self).__init__()
|
||||
|
||||
self.wallet = wallet
|
||||
self.config = config
|
||||
self.check_qt_version()
|
||||
self.app = QApplication(sys.argv)
|
||||
|
||||
self.expert = expert
|
||||
if self.expert != None:
|
||||
self.app = self.expert.app
|
||||
else:
|
||||
self.app = QApplication(sys.argv)
|
||||
|
||||
def check_qt_version(self):
|
||||
qtVersion = qVersion()
|
||||
|
@ -122,14 +125,15 @@ class ElectrumGui(QObject):
|
|||
|
||||
if url:
|
||||
self.set_url(url)
|
||||
|
||||
timer = Timer()
|
||||
timer.start()
|
||||
self.expert = gui_qt.ElectrumWindow(self.wallet, self.config)
|
||||
self.expert.app = self.app
|
||||
self.expert.connect_slots(timer)
|
||||
self.expert.update_wallet()
|
||||
self.app.exec_()
|
||||
|
||||
if self.expert == None:
|
||||
timer = Timer()
|
||||
timer.start()
|
||||
self.expert = gui_qt.ElectrumWindow(self.wallet, self.config)
|
||||
self.expert.app = self.app
|
||||
self.expert.connect_slots(timer)
|
||||
self.expert.update_wallet()
|
||||
self.app.exec_()
|
||||
|
||||
def expand(self):
|
||||
"""Hide the lite mode window and show pro-mode."""
|
||||
|
|
|
@ -294,6 +294,7 @@ class ElectrumWindow(QMainWindow):
|
|||
|
||||
def __init__(self, wallet, config):
|
||||
QMainWindow.__init__(self)
|
||||
self.lite = None
|
||||
self.wallet = wallet
|
||||
self.config = config
|
||||
self.wallet.interface.register_callback('updated', self.update_callback)
|
||||
|
@ -1108,6 +1109,9 @@ class ElectrumWindow(QMainWindow):
|
|||
def create_status_bar(self):
|
||||
sb = QStatusBar()
|
||||
sb.setFixedHeight(35)
|
||||
qtVersion = qVersion()
|
||||
if (int(qtVersion[0]) >= 4 and int(qtVersion[2]) >= 7):
|
||||
sb.addPermanentWidget( StatusBarButton( QIcon(":icons/switchgui.png"), "Switch to Lite Mode", self.go_lite ) )
|
||||
if self.wallet.seed:
|
||||
sb.addPermanentWidget( StatusBarButton( QIcon(":icons/lock.png"), "Password", lambda: self.change_password_dialog(self.wallet, self) ) )
|
||||
sb.addPermanentWidget( StatusBarButton( QIcon(":icons/preferences.png"), "Preferences", self.settings_dialog ) )
|
||||
|
@ -1116,6 +1120,15 @@ class ElectrumWindow(QMainWindow):
|
|||
self.status_button = StatusBarButton( QIcon(":icons/status_disconnected.png"), "Network", lambda: self.network_dialog(self.wallet, self) )
|
||||
sb.addPermanentWidget( self.status_button )
|
||||
self.setStatusBar(sb)
|
||||
|
||||
def go_lite(self):
|
||||
import gui_lite
|
||||
self.hide()
|
||||
if self.lite:
|
||||
self.lite.mini.show()
|
||||
else:
|
||||
self.lite = gui_lite.ElectrumGui(self.wallet, self.config, self)
|
||||
self.lite.main(None)
|
||||
|
||||
def new_contact_dialog(self):
|
||||
text, ok = QInputDialog.getText(self, _('New Contact'), _('Address') + ':')
|
||||
|
|
Loading…
Reference in New Issue