self.config = config
self.init_plugins()
+ self.create_status_bar()
+
self.wallet.interface.register_callback('updated', lambda: self.emit(QtCore.SIGNAL('update_wallet')))
self.wallet.interface.register_callback('banner', lambda: self.emit(QtCore.SIGNAL('banner_signal')))
self.wallet.interface.register_callback('disconnected', lambda: self.emit(QtCore.SIGNAL('update_status')))
tabs.setMinimumSize(600, 400)
tabs.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
self.setCentralWidget(tabs)
- self.create_status_bar()
g = self.config.get("winpos-qt",[100, 100, 840, 400])
self.setGeometry(g[0], g[1], g[2], g[3])
def address_label_changed(self, item, column, l, column_addr, column_label):
-
if column == column_label:
addr = unicode( item.text(column_addr) )
text = unicode( item.text(column_label) )
for address in account[is_change]:
h = self.wallet.history.get(address,[])
- if not is_change:
- if h == []:
- gap += 1
- if gap > self.wallet.gap_limit:
- is_red = True
- else:
- gap = 0
+ if h == []:
+ gap += 1
+ if gap > self.wallet.gap_limit:
+ is_red = True
+ else:
+ gap = 0
num_tx = '*' if h == ['*'] else "%d"%len(h)
item = QTreeWidgetItem( [ address, '', '', num_tx] )
for address in self.wallet.addressbook:
label = self.wallet.labels.get(address,'')
- n = 0
- for tx in self.wallet.transactions.values():
- if address in map(lambda x: x[0], tx.outputs): n += 1
-
+ n = self.wallet.get_num_tx(address)
item = QTreeWidgetItem( [ address, label, "%d"%n] )
item.setFont(0, QFont(MONOSPACE_FONT))
# 32 = label can be edited (bool)
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) ) )
+ self.lock_icon = QIcon(":icons/lock.png") if self.wallet.use_encryption else QIcon(":icons/unlock.png")
+ self.password_button = StatusBarButton( self.lock_icon, _("Password"), lambda: self.change_password_dialog(self.wallet, self) )
+ sb.addPermanentWidget( self.password_button )
sb.addPermanentWidget( StatusBarButton( QIcon(":icons/preferences.png"), _("Preferences"), self.settings_dialog ) )
if self.wallet.seed:
sb.addPermanentWidget( StatusBarButton( QIcon(":icons/seed.png"), _("Seed"), self.show_seed_dialog ) )
self.status_button = StatusBarButton( QIcon(":icons/status_disconnected.png"), _("Network"), lambda: self.network_dialog(self.wallet, self) )
sb.addPermanentWidget( self.status_button )
+ self.run_hook('create_status_bar', (sb,))
+
self.setStatusBar(sb)
def go_lite(self):
return ElectrumWindow.change_password_dialog(wallet, parent) # Retry
wallet.update_password(seed, password, new_password)
+ if parent:
+ icon = QIcon(":icons/lock.png") if wallet.use_encryption else QIcon(":icons/unlock.png")
+ parent.password_button.setIcon( icon )
+
@staticmethod
def seed_dialog(wallet, parent=None):
for key, value in json.loads(data).items():
self.wallet.labels[key] = value
self.wallet.save()
- QMessageBox.information(None, _("Labels imported"), _("Your labels where imported from")+" '%s'" % str(labelsFile))
+ QMessageBox.information(None, _("Labels imported"), _("Your labels were imported from")+" '%s'" % str(labelsFile))
except (IOError, os.error), reason:
QMessageBox.critical(None, _("Unable to import labels"), _("Electrum was unable to import your labels.")+"\n" + str(reason))
vbox = QVBoxLayout()
tabs = QTabWidget(self)
+ self.settings_tab = tabs
vbox.addWidget(tabs)
tab1 = QWidget()
traceback.print_exc(file=sys.stdout)
grid_plugins.setRowStretch(i+1,1)
+ self.run_hook('create_settings_tab', tabs)
+
vbox.addLayout(ok_cancel_buttons(d))
d.setLayout(vbox)
self.config.set_key('currency', cur_request, True)
self.update_wallet()
+ self.run_hook('close_settings_dialog')
+
if need_restart:
QMessageBox.warning(self, _('Success'), _('Please restart Electrum to activate the new GUI settings'), _('OK'))
for p in protocol_letters:
i = protocol_letters.index(p)
j = server_protocol.model().index(i,0)
- if p not in pp.keys():
+ if p not in pp.keys() and interface.is_connected:
server_protocol.model().setData(j, QtCore.QVariant(0), QtCore.Qt.UserRole-1)
else:
server_protocol.model().setData(j, QtCore.QVariant(0,False), QtCore.Qt.UserRole-1)