handle response dialog without needed any temp variable.

This commit is contained in:
Vincent Hanquez 2005-04-23 12:09:25 +00:00
parent f6503322ed
commit a4fd5f9572
1 changed files with 6 additions and 8 deletions

View File

@ -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)