electrum

Electrum Bitcoin wallet
git clone https://git.parazyd.org/electrum
Log | Files | Refs | Submodules

commit bf303ef50cbd9b68336c7a6668f8cf467ed7d002
parent 7ce6860f423256af6935c47495b94881f5836b7a
Author: thomasv <thomasv@gitorious>
Date:   Tue, 14 Feb 2012 11:33:09 +0100

use resource file; change default ui

Diffstat:
Mclient/electrum | 8++++----
Mclient/gui_qt.py | 22++++++++++++----------
Aclient/icons.qrc | 12++++++++++++
Mclient/setup.py | 1+
4 files changed, 29 insertions(+), 14 deletions(-)

diff --git a/client/electrum b/client/electrum @@ -49,15 +49,15 @@ if __name__ == '__main__': wallet = Wallet(interface) 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 '' if cmd in ['gtk','qt'] or re.match('^bitcoin:', cmd): - if cmd == 'qt': - import gui_qt as gui - else: + if cmd == 'gtk': import gui + else: + import gui_qt as gui interface.get_servers() gui = gui.ElectrumGui(wallet) diff --git a/client/gui_qt.py b/client/gui_qt.py @@ -7,6 +7,8 @@ from PyQt4.QtCore import * import PyQt4.QtCore as QtCore import PyQt4.QtGui as QtGui +import icons_rc + from wallet import format_satoshis from decimal import Decimal @@ -82,18 +84,18 @@ class ElectrumWindow(QMainWindow): if self.wallet.interface.is_connected: if self.wallet.interface.blocks == 0: text = "Server not ready" - icon = QIcon("icons/status_disconnected.png") + icon = QIcon(":icons/status_disconnected.png") elif not self.wallet.interface.was_polled: text = "Synchronizing..." - icon = QIcon("icons/status_waiting.svg") + icon = QIcon(":icons/status_waiting.svg") else: c, u = self.wallet.get_balance() text = "Balance: %s "%( format_satoshis(c) ) if u: text += "[%s unconfirmed]"%( format_satoshis(u,True) ) - icon = QIcon("icons/status_connected.png") + icon = QIcon(":icons/status_connected.png") else: text = "Not connected" - icon = QIcon("icons/status_disconnected.png") + icon = QIcon(":icons/status_disconnected.png") self.statusBar().showMessage(text) self.status_button.setIcon( icon ) @@ -201,11 +203,11 @@ class ElectrumWindow(QMainWindow): if tx['height']: conf = self.wallet.interface.blocks - tx['height'] + 1 time_str = datetime.datetime.fromtimestamp( tx['nTime']).isoformat(' ')[:-3] - icon = QIcon("icons/confirmed.png") + icon = QIcon(":icons/confirmed.png") else: conf = 0 time_str = 'pending' - icon = QIcon("icons/unconfirmed.svg") + icon = QIcon(":icons/unconfirmed.svg") v = tx['value'] balance += v label = self.wallet.labels.get(tx_hash) @@ -444,10 +446,10 @@ class ElectrumWindow(QMainWindow): def create_status_bar(self): sb = QStatusBar() sb.setFixedHeight(35) - 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/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) ) + 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/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) ) sb.addPermanentWidget( self.status_button ) self.setStatusBar(sb) diff --git a/client/icons.qrc b/client/icons.qrc @@ -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> diff --git a/client/setup.py b/client/setup.py @@ -1,5 +1,6 @@ #!/usr/bin/python +# pyrcc4 icons.qrc -o icons_rc.py # python setup.py sdist --format=zip,gztar from distutils.core import setup