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

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:
file = dialog.get_filename() break
if os.path.exists(file): file = dialog.get_filename()
ok = True if os.path.exists(file):
else: break
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)