Fixed GroupBox layout in installwizard

This commit is contained in:
kizmc 2015-08-26 18:35:21 +02:00
parent 9455815ad0
commit 77ebea15d0
1 changed files with 22 additions and 4 deletions

View File

@ -87,25 +87,37 @@ class InstallWizard(QDialog):
def restore_or_create(self):
vbox = QVBoxLayout()
main_label = QLabel(_("Electrum could not find an existing wallet."))
vbox.addWidget(main_label)
grid = QGridLayout()
grid.setSpacing(5)
gb1 = QGroupBox(_("What do you want to do?"))
vbox.addWidget(gb1)
vbox1 = QVBoxLayout()
gb1.setLayout(vbox1)
b1 = QRadioButton(gb1)
b1.setText(_("Create new wallet"))
b1.setChecked(True)
b2 = QRadioButton(gb1)
b2.setText(_("Restore a wallet or import keys"))
group1 = QButtonGroup()
group1.addButton(b1)
group1.addButton(b2)
vbox.addWidget(b1)
vbox.addWidget(b2)
vbox1.addWidget(b1)
vbox1.addWidget(b2)
gb2 = QGroupBox(_("Wallet type:"))
vbox.addWidget(gb2)
vbox2 = QVBoxLayout()
gb2.setLayout(vbox2)
group2 = QButtonGroup()
self.wallet_types = [
@ -120,9 +132,10 @@ class InstallWizard(QDialog):
continue
button = QRadioButton(gb2)
button.setText(name)
vbox.addWidget(button)
vbox2.addWidget(button)
group2.addButton(button)
group2.setId(button, i)
if i==0:
button.setChecked(True)
@ -326,11 +339,15 @@ class InstallWizard(QDialog):
vbox.addWidget(QLabel(title))
gb2 = QGroupBox(msg)
vbox.addWidget(gb2)
vbox2 = QVBoxLayout()
gb2.setLayout(vbox2)
group2 = QButtonGroup()
for i,c in enumerate(choices):
button = QRadioButton(gb2)
button.setText(c[1])
vbox.addWidget(button)
vbox2.addWidget(button)
group2.addButton(button)
group2.setId(button, i)
if i==0:
@ -427,6 +444,7 @@ class InstallWizard(QDialog):
elif wallet_type == 'hardware':
hardware_wallets = map(lambda x:(x[1],x[2]), filter(lambda x:x[0]=='hardware', electrum.wallet.wallet_types))
wallet_type = self.choice(_("Hardware Wallet"), 'Select your hardware wallet', hardware_wallets)
if not wallet_type:
return
elif wallet_type == 'twofactor':