tadd clickable label to show/hide advanced wallet types - electrum - Electrum Bitcoin wallet HTML git clone https://git.parazyd.org/electrum DIR Log DIR Files DIR Refs DIR Submodules --- DIR commit c3f0f69f1eb642c0ec7806760c2af92c6d49e942 DIR parent 0fb6cdcb1a75f7f8f4c7c5b0e8fdaf67145d9326 HTML Author: ThomasV <thomasv@gitorious> Date: Fri, 9 May 2014 17:31:29 +0200 add clickable label to show/hide advanced wallet types Diffstat: M gui/qt/installwizard.py | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) --- DIR diff --git a/gui/qt/installwizard.py b/gui/qt/installwizard.py t@@ -81,8 +81,14 @@ class InstallWizard(QDialog): grid2 = QGridLayout() grid2.setSpacing(5) - label2 = QLabel(_("Wallet type:")) - grid2.addWidget(label2, 3, 0) + class ClickableLabel(QLabel): + def mouseReleaseEvent(self, ev): + self.emit(SIGNAL('clicked()')) + + label2 = ClickableLabel(_("Wallet type:") + " [+]") + hbox = QHBoxLayout() + hbox.addWidget(label2) + grid2.addLayout(hbox, 3, 0) gb2 = QGroupBox() grid.addWidget(gb2, 3, 0) t@@ -98,15 +104,27 @@ class InstallWizard(QDialog): bb3 = QRadioButton(gb2) bb3.setText(_("Multisig wallet (2 of 2)")) + bb3.setHidden(True) bb4 = QRadioButton(gb2) bb4.setText(_("Multisig wallet (2 of 3)")) + bb4.setHidden(True) grid2.addWidget(bb1, 4, 0) grid2.addWidget(bb2, 5, 0) grid2.addWidget(bb3, 6, 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(bb2) group2.addButton(bb3)