handle response dialog without needed any temp variable.
This commit is contained in:
parent
f6503322ed
commit
a4fd5f9572
|
@ -499,15 +499,13 @@ class Preferences_window:
|
||||||
file = os.path.join(os.getcwd(), file)
|
file = os.path.join(os.getcwd(), file)
|
||||||
dialog.set_filename(file)
|
dialog.set_filename(file)
|
||||||
file = ''
|
file = ''
|
||||||
ok = False
|
while 1:
|
||||||
while not ok:
|
|
||||||
response = dialog.run()
|
response = dialog.run()
|
||||||
if response == gtk.RESPONSE_OK:
|
if response != gtk.RESPONSE_OK:
|
||||||
|
break
|
||||||
file = dialog.get_filename()
|
file = dialog.get_filename()
|
||||||
if os.path.exists(file):
|
if os.path.exists(file):
|
||||||
ok = True
|
break
|
||||||
else:
|
|
||||||
ok = True
|
|
||||||
dialog.destroy()
|
dialog.destroy()
|
||||||
if file:
|
if file:
|
||||||
self.xml.get_widget('sounds_entry').set_text(file)
|
self.xml.get_widget('sounds_entry').set_text(file)
|
||||||
|
|
Loading…
Reference in New Issue