use resource file; change default ui
This commit is contained in:
parent
7ce6860f42
commit
bf303ef50c
|
@ -49,15 +49,15 @@ if __name__ == '__main__':
|
||||||
wallet = Wallet(interface)
|
wallet = Wallet(interface)
|
||||||
wallet.set_path(options.wallet_path)
|
wallet.set_path(options.wallet_path)
|
||||||
|
|
||||||
cmd = args[0] if len(args) > 0 else 'gtk'
|
cmd = args[0] if len(args) > 0 else 'qt'
|
||||||
firstarg = args[1] if len(args) > 1 else ''
|
firstarg = args[1] if len(args) > 1 else ''
|
||||||
|
|
||||||
|
|
||||||
if cmd in ['gtk','qt'] or re.match('^bitcoin:', cmd):
|
if cmd in ['gtk','qt'] or re.match('^bitcoin:', cmd):
|
||||||
if cmd == 'qt':
|
if cmd == 'gtk':
|
||||||
import gui_qt as gui
|
|
||||||
else:
|
|
||||||
import gui
|
import gui
|
||||||
|
else:
|
||||||
|
import gui_qt as gui
|
||||||
|
|
||||||
interface.get_servers()
|
interface.get_servers()
|
||||||
gui = gui.ElectrumGui(wallet)
|
gui = gui.ElectrumGui(wallet)
|
||||||
|
|
|
@ -7,6 +7,8 @@ from PyQt4.QtCore import *
|
||||||
import PyQt4.QtCore as QtCore
|
import PyQt4.QtCore as QtCore
|
||||||
import PyQt4.QtGui as QtGui
|
import PyQt4.QtGui as QtGui
|
||||||
|
|
||||||
|
import icons_rc
|
||||||
|
|
||||||
from wallet import format_satoshis
|
from wallet import format_satoshis
|
||||||
from decimal import Decimal
|
from decimal import Decimal
|
||||||
|
|
||||||
|
@ -82,18 +84,18 @@ class ElectrumWindow(QMainWindow):
|
||||||
if self.wallet.interface.is_connected:
|
if self.wallet.interface.is_connected:
|
||||||
if self.wallet.interface.blocks == 0:
|
if self.wallet.interface.blocks == 0:
|
||||||
text = "Server not ready"
|
text = "Server not ready"
|
||||||
icon = QIcon("icons/status_disconnected.png")
|
icon = QIcon(":icons/status_disconnected.png")
|
||||||
elif not self.wallet.interface.was_polled:
|
elif not self.wallet.interface.was_polled:
|
||||||
text = "Synchronizing..."
|
text = "Synchronizing..."
|
||||||
icon = QIcon("icons/status_waiting.svg")
|
icon = QIcon(":icons/status_waiting.svg")
|
||||||
else:
|
else:
|
||||||
c, u = self.wallet.get_balance()
|
c, u = self.wallet.get_balance()
|
||||||
text = "Balance: %s "%( format_satoshis(c) )
|
text = "Balance: %s "%( format_satoshis(c) )
|
||||||
if u: text += "[%s unconfirmed]"%( format_satoshis(u,True) )
|
if u: text += "[%s unconfirmed]"%( format_satoshis(u,True) )
|
||||||
icon = QIcon("icons/status_connected.png")
|
icon = QIcon(":icons/status_connected.png")
|
||||||
else:
|
else:
|
||||||
text = "Not connected"
|
text = "Not connected"
|
||||||
icon = QIcon("icons/status_disconnected.png")
|
icon = QIcon(":icons/status_disconnected.png")
|
||||||
|
|
||||||
self.statusBar().showMessage(text)
|
self.statusBar().showMessage(text)
|
||||||
self.status_button.setIcon( icon )
|
self.status_button.setIcon( icon )
|
||||||
|
@ -201,11 +203,11 @@ class ElectrumWindow(QMainWindow):
|
||||||
if tx['height']:
|
if tx['height']:
|
||||||
conf = self.wallet.interface.blocks - tx['height'] + 1
|
conf = self.wallet.interface.blocks - tx['height'] + 1
|
||||||
time_str = datetime.datetime.fromtimestamp( tx['nTime']).isoformat(' ')[:-3]
|
time_str = datetime.datetime.fromtimestamp( tx['nTime']).isoformat(' ')[:-3]
|
||||||
icon = QIcon("icons/confirmed.png")
|
icon = QIcon(":icons/confirmed.png")
|
||||||
else:
|
else:
|
||||||
conf = 0
|
conf = 0
|
||||||
time_str = 'pending'
|
time_str = 'pending'
|
||||||
icon = QIcon("icons/unconfirmed.svg")
|
icon = QIcon(":icons/unconfirmed.svg")
|
||||||
v = tx['value']
|
v = tx['value']
|
||||||
balance += v
|
balance += v
|
||||||
label = self.wallet.labels.get(tx_hash)
|
label = self.wallet.labels.get(tx_hash)
|
||||||
|
@ -444,10 +446,10 @@ class ElectrumWindow(QMainWindow):
|
||||||
def create_status_bar(self):
|
def create_status_bar(self):
|
||||||
sb = QStatusBar()
|
sb = QStatusBar()
|
||||||
sb.setFixedHeight(35)
|
sb.setFixedHeight(35)
|
||||||
sb.addPermanentWidget( StatusBarButton( QIcon("icons/lock.svg"), "Password", lambda: self.change_password_dialog(self.wallet, self) ) )
|
sb.addPermanentWidget( StatusBarButton( QIcon(":icons/lock.svg"), "Password", lambda: self.change_password_dialog(self.wallet, self) ) )
|
||||||
sb.addPermanentWidget( StatusBarButton( QIcon("icons/preferences.png"), "Preferences", self.settings_dialog ) )
|
sb.addPermanentWidget( StatusBarButton( QIcon(":icons/preferences.png"), "Preferences", self.settings_dialog ) )
|
||||||
sb.addPermanentWidget( StatusBarButton( QIcon("icons/seed.png"), "Seed", lambda: self.show_seed_dialog(self.wallet, self) ) )
|
sb.addPermanentWidget( StatusBarButton( QIcon(":icons/seed.png"), "Seed", lambda: self.show_seed_dialog(self.wallet, self) ) )
|
||||||
self.status_button = StatusBarButton( QIcon("icons/status_disconnected.png"), "Network", lambda: self.network_dialog(self.wallet, self) )
|
self.status_button = StatusBarButton( QIcon(":icons/status_disconnected.png"), "Network", lambda: self.network_dialog(self.wallet, self) )
|
||||||
sb.addPermanentWidget( self.status_button )
|
sb.addPermanentWidget( self.status_button )
|
||||||
self.setStatusBar(sb)
|
self.setStatusBar(sb)
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
<RCC>
|
||||||
|
<qresource prefix="/" >
|
||||||
|
<file>icons/confirmed.png</file>
|
||||||
|
<file>icons/lock.svg</file>
|
||||||
|
<file>icons/preferences.png</file>
|
||||||
|
<file>icons/seed.png</file>
|
||||||
|
<file>icons/status_connected.png</file>
|
||||||
|
<file>icons/status_disconnected.png</file>
|
||||||
|
<file>icons/status_waiting.svg</file>
|
||||||
|
<file>icons/unconfirmed.svg</file>
|
||||||
|
</qresource>
|
||||||
|
</RCC>
|
|
@ -1,5 +1,6 @@
|
||||||
#!/usr/bin/python
|
#!/usr/bin/python
|
||||||
|
|
||||||
|
# pyrcc4 icons.qrc -o icons_rc.py
|
||||||
# python setup.py sdist --format=zip,gztar
|
# python setup.py sdist --format=zip,gztar
|
||||||
|
|
||||||
from distutils.core import setup
|
from distutils.core import setup
|
||||||
|
|
Loading…
Reference in New Issue