add clickable label to show/hide advanced wallet types

This commit is contained in:
ThomasV 2014-05-09 17:31:29 +02:00
parent 0fb6cdcb1a
commit c3f0f69f1e
1 changed files with 20 additions and 2 deletions

View File

@ -81,8 +81,14 @@ class InstallWizard(QDialog):
grid2 = QGridLayout() grid2 = QGridLayout()
grid2.setSpacing(5) grid2.setSpacing(5)
label2 = QLabel(_("Wallet type:")) class ClickableLabel(QLabel):
grid2.addWidget(label2, 3, 0) def mouseReleaseEvent(self, ev):
self.emit(SIGNAL('clicked()'))
label2 = ClickableLabel(_("Wallet type:") + " [+]")
hbox = QHBoxLayout()
hbox.addWidget(label2)
grid2.addLayout(hbox, 3, 0)
gb2 = QGroupBox() gb2 = QGroupBox()
grid.addWidget(gb2, 3, 0) grid.addWidget(gb2, 3, 0)
@ -98,15 +104,27 @@ class InstallWizard(QDialog):
bb3 = QRadioButton(gb2) bb3 = QRadioButton(gb2)
bb3.setText(_("Multisig wallet (2 of 2)")) bb3.setText(_("Multisig wallet (2 of 2)"))
bb3.setHidden(True)
bb4 = QRadioButton(gb2) bb4 = QRadioButton(gb2)
bb4.setText(_("Multisig wallet (2 of 3)")) bb4.setText(_("Multisig wallet (2 of 3)"))
bb4.setHidden(True)
grid2.addWidget(bb1, 4, 0) grid2.addWidget(bb1, 4, 0)
grid2.addWidget(bb2, 5, 0) grid2.addWidget(bb2, 5, 0)
grid2.addWidget(bb3, 6, 0) grid2.addWidget(bb3, 6, 0)
grid2.addWidget(bb4, 7, 0) grid2.addWidget(bb4, 7, 0)
def toggle():
x = not bb3.isHidden()
label2.setText(_("Wallet type:") + (' [+]' if x else ' [-]'))
bb3.setHidden(x)
bb4.setHidden(x)
self.connect(label2, SIGNAL('clicked()'), toggle)
grid2.addWidget(label2)
group2.addButton(bb1) group2.addButton(bb1)
group2.addButton(bb2) group2.addButton(bb2)
group2.addButton(bb3) group2.addButton(bb3)