Bring query_choice into the new framework.

This commit is contained in:
Neil Booth 2016-01-13 19:49:58 +09:00
parent ef1f649d58
commit cb8bc4ec73
1 changed files with 4 additions and 11 deletions

View File

@ -107,6 +107,8 @@ class InstallWizard(WindowModalDialog, WizardBase):
outer_vbox.addLayout(hbox) outer_vbox.addLayout(hbox)
outer_vbox.addLayout(Buttons(self.cancel_button, self.next_button)) outer_vbox.addLayout(Buttons(self.cancel_button, self.next_button))
self.set_icon(':icons/electrum.png') self.set_icon(':icons/electrum.png')
self.show()
self.raise_()
def set_icon(self, filename): def set_icon(self, filename):
prior_filename, self.icon_filename = self.icon_filename, filename prior_filename, self.icon_filename = self.icon_filename, filename
@ -120,9 +122,6 @@ class InstallWizard(WindowModalDialog, WizardBase):
prior_layout = self.main_widget.layout() prior_layout = self.main_widget.layout()
if prior_layout: if prior_layout:
QWidget().setLayout(prior_layout) QWidget().setLayout(prior_layout)
else:
self.show()
self.raise_()
self.main_widget.setLayout(layout) self.main_widget.setLayout(layout)
self.cancel_button.setEnabled(True) self.cancel_button.setEnabled(True)
self.next_button.setEnabled(True) self.next_button.setEnabled(True)
@ -328,14 +327,8 @@ class InstallWizard(WindowModalDialog, WizardBase):
def query_choice(self, msg, choices): def query_choice(self, msg, choices):
clayout = ChoicesLayout(msg, choices) clayout = ChoicesLayout(msg, choices)
next_button = OkButton(self, _('Next')) self.next_button.setEnabled(bool(choices))
next_button.setEnabled(bool(choices)) self.set_main_layout(clayout.layout())
layout = clayout.layout()
layout.addStretch(1)
layout.addLayout(Buttons(CancelButton(self), next_button))
self.set_layout(layout)
if not self.exec_():
raise UserCancelled
return clayout.selected_index() return clayout.selected_index()
def query_multisig(self, action): def query_multisig(self, action):