Skip to content

Commit

Permalink
CA bug fix
Browse files Browse the repository at this point in the history
Signed-off-by: Karol Trzeszczkowski <[email protected]>
  • Loading branch information
KarolTrzeszczkowski committed Feb 8, 2020
1 parent 08fa92a commit 3bbe2bb
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions mecenas/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,16 +189,12 @@ def __init__(self, parent, plugin, wallet_name, password, manager):
self.cashaccounts = self.wallet.cashacct.get_wallet_cashaccounts()
self.my_addresses = dict()
for i in self.cashaccounts:
self.my_addresses[i.name + '#' + str(i.number)]=i.address
self.my_addresses[i.name + '#' + str(i.number)] = i.address
self.my_addresses["anonymous donation"] = self.wallet.get_unused_address()
my_addy_combo = QComboBox()
my_addy_combo.addItems(list(self.my_addresses.keys()))
my_addy_combo.setCurrentIndex(0)
self.selected_distribution = 0
def on_mecenas_address():
self.mecenas_address = list(self.my_addresses.values())[my_addy_combo.currentIndex()]

my_addy_combo.currentIndexChanged.connect(on_mecenas_address)
self.my_addy_combo = QComboBox()
self.my_addy_combo.addItems(list(self.my_addresses.keys()))
self.my_addy_combo.currentIndexChanged.connect(self.mecenate_info_changed)

vbox = QVBoxLayout()
self.setLayout(vbox)
hbox = QHBoxLayout()
Expand All @@ -214,7 +210,7 @@ def on_mecenas_address():
hbox = QHBoxLayout()
vbox.addLayout(hbox)
hbox.addWidget(l)
hbox.addWidget(my_addy_combo)
hbox.addWidget(self.my_addy_combo)
hbox.addStretch(1)
l = QLabel(_("Protege address: "))
vbox.addWidget(l)
Expand Down Expand Up @@ -274,6 +270,7 @@ def on_mecenas_address():
def mecenate_info_changed(self, ):
# if any of the txid/out#/value changes
try:
self.mecenas_address = list(self.my_addresses.values())[self.my_addy_combo.currentIndex()]
self.protege_address = Address.from_string(self.protege_address_wid.text())
self.reps = int(self.repetitions.text())
self.rpayment_time = int(self.rpayment_time_wid.text())*3600*24//512
Expand Down

0 comments on commit 3bbe2bb

Please sign in to comment.