From a4fd5f9572e4dd0c55cf59a4b9cc535aa1c9cc30 Mon Sep 17 00:00:00 2001 From: Vincent Hanquez Date: Sat, 23 Apr 2005 12:09:25 +0000 Subject: [PATCH] handle response dialog without needed any temp variable. --- src/config.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/config.py b/src/config.py index 24d9db6c0..9a56b968f 100644 --- a/src/config.py +++ b/src/config.py @@ -499,15 +499,13 @@ class Preferences_window: file = os.path.join(os.getcwd(), file) dialog.set_filename(file) file = '' - ok = False - while not ok: + while 1: response = dialog.run() - if response == gtk.RESPONSE_OK: - file = dialog.get_filename() - if os.path.exists(file): - ok = True - else: - ok = True + if response != gtk.RESPONSE_OK: + break + file = dialog.get_filename() + if os.path.exists(file): + break dialog.destroy() if file: self.xml.get_widget('sounds_entry').set_text(file)