rename WizardChoiceDialog (ambiguous)
This commit is contained in:
@@ -46,7 +46,6 @@ class ChoiceDialog(Factory.Popup):
|
|||||||
|
|
||||||
def __init__(self, title, choices, key, callback, keep_choice_order=False):
|
def __init__(self, title, choices, key, callback, keep_choice_order=False):
|
||||||
Factory.Popup.__init__(self)
|
Factory.Popup.__init__(self)
|
||||||
print(choices, type(choices))
|
|
||||||
if keep_choice_order:
|
if keep_choice_order:
|
||||||
orig_index = {choice: i for (i, choice) in enumerate(choices)}
|
orig_index = {choice: i for (i, choice) in enumerate(choices)}
|
||||||
sort_key = lambda x: orig_index[x[0]]
|
sort_key = lambda x: orig_index[x[0]]
|
||||||
|
|||||||
@@ -151,7 +151,7 @@ Builder.load_string('''
|
|||||||
value: 2
|
value: 2
|
||||||
|
|
||||||
|
|
||||||
<ChoiceDialog>
|
<WizardChoiceDialog>
|
||||||
message : ''
|
message : ''
|
||||||
Widget:
|
Widget:
|
||||||
size_hint: 1, 1
|
size_hint: 1, 1
|
||||||
@@ -744,10 +744,10 @@ class WizardConfirmDialog(WizardDialog):
|
|||||||
return (True,)
|
return (True,)
|
||||||
|
|
||||||
|
|
||||||
class ChoiceDialog(WizardDialog):
|
class WizardChoiceDialog(WizardDialog):
|
||||||
|
|
||||||
def __init__(self, wizard, **kwargs):
|
def __init__(self, wizard, **kwargs):
|
||||||
super(ChoiceDialog, self).__init__(wizard, **kwargs)
|
super(WizardChoiceDialog, self).__init__(wizard, **kwargs)
|
||||||
self.title = kwargs.get('message', '')
|
self.title = kwargs.get('message', '')
|
||||||
self.message = kwargs.get('message', '')
|
self.message = kwargs.get('message', '')
|
||||||
choices = kwargs.get('choices', [])
|
choices = kwargs.get('choices', [])
|
||||||
@@ -791,7 +791,7 @@ class CLButton(ToggleButton):
|
|||||||
self.root.script_type = self.script_type
|
self.root.script_type = self.script_type
|
||||||
self.root.set_text(self.value)
|
self.root.set_text(self.value)
|
||||||
|
|
||||||
class ChoiceLineDialog(ChoiceDialog):
|
class ChoiceLineDialog(WizardChoiceDialog):
|
||||||
title = StringProperty('')
|
title = StringProperty('')
|
||||||
message1 = StringProperty('')
|
message1 = StringProperty('')
|
||||||
message2 = StringProperty('')
|
message2 = StringProperty('')
|
||||||
@@ -1094,7 +1094,7 @@ class InstallWizard(BaseWizard, Widget):
|
|||||||
def choice_dialog(self, **kwargs):
|
def choice_dialog(self, **kwargs):
|
||||||
choices = kwargs['choices']
|
choices = kwargs['choices']
|
||||||
if len(choices) > 1:
|
if len(choices) > 1:
|
||||||
ChoiceDialog(self, **kwargs).open()
|
WizardChoiceDialog(self, **kwargs).open()
|
||||||
else:
|
else:
|
||||||
f = kwargs['run_next']
|
f = kwargs['run_next']
|
||||||
f(choices[0][0])
|
f(choices[0][0])
|
||||||
|
|||||||
Reference in New Issue
Block a user