electrum

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

commit 0a36a557cccc369897745ba672ffa99eccf1ee2a
parent 8cc5ffc10aebfe9cf8c794e2b81bd0de461417df
Author: thomasv <thomasv@gitorious>
Date:   Mon, 13 Feb 2012 15:22:15 +0100

settings dialog

Diffstat:
Mclient/gui_qt.py | 40++++++++++++++++++++++++++++++++++++++++
1 file changed, 40 insertions(+), 0 deletions(-)

diff --git a/client/gui_qt.py b/client/gui_qt.py @@ -8,6 +8,7 @@ import PyQt4.QtCore as QtCore import PyQt4.QtGui as QtGui from wallet import format_satoshis +from decimal import Decimal def restore_create_dialog(wallet): pass @@ -359,6 +360,7 @@ class ElectrumWindow(QMainWindow): b.setToolTip("Preferences") b.setFlat(True) b.setMaximumWidth(25) + b.clicked.connect(self.settings_dialog) hbox.addWidget(b) icon = QIcon("icons/seed.png") @@ -498,6 +500,44 @@ class ElectrumWindow(QMainWindow): self.wallet.update_password(seed, new_password) + def settings_dialog(self): + d = QDialog(self) + d.setModal(1) + + grid = QGridLayout() + grid.setSpacing(8) + + msg = 'These are the settings of your wallet' + grid.addWidget(QLabel(msg), 0, 0, 1, 2) + + fee_line = QLineEdit() + fee_line.setText("%s"% str( Decimal( self.wallet.fee)/100000000 ) ) + grid.addWidget(QLabel('Fee'), 2, 0) + grid.addWidget(fee_line, 2, 1) + + b = QPushButton("Cancel") + grid.addWidget(b, 5, 1) + b.clicked.connect(d.reject) + + b = QPushButton("OK") + grid.addWidget(b, 5, 2) + b.clicked.connect(d.accept) + + d.setLayout(grid) + + if not d.exec_(): return + + fee = str(fee_line.text()) + try: + fee = int( 100000000 * Decimal(fee) ) + except: + QMessageBox.warning(self, 'Error', 'Invalid value:%s'%fee, 'OK') + return + + self.wallet.fee = fee + self.wallet.save() + + class BitcoinGUI():