Blob Blame History Raw
From 7eab29ff1d2fb9d26db3102b7ffd6e3dcde640af Mon Sep 17 00:00:00 2001
Message-Id: <7eab29ff1d2fb9d26db3102b7ffd6e3dcde640af.1351081950.git.crobinso@redhat.com>
In-Reply-To: <6f95a37c1dd600f05b6678d1c142d38050eddf73.1351081950.git.crobinso@redhat.com>
References: <6f95a37c1dd600f05b6678d1c142d38050eddf73.1351081950.git.crobinso@redhat.com>
From: Cole Robinson <crobinso@redhat.com>
Date: Sun, 14 Oct 2012 00:15:04 -0400
Subject: [PATCH 3/3] browse_local: Fix choosing directory of F17

Seems hiding the dialog before retrieving the directory path stopped
working. Remove the needlessness anyways

https://bugzilla.redhat.com/show_bug.cgi?id=849450
(cherry picked from commit 71e5ac2a0a8578f466c74d5100943d44815ab8bd)
---
 src/virtManager/util.py | 23 +++++++++--------------
 1 file changed, 9 insertions(+), 14 deletions(-)

diff --git a/src/virtManager/util.py b/src/virtManager/util.py
index 6b8a953..b75541c 100644
--- a/src/virtManager/util.py
+++ b/src/virtManager/util.py
@@ -208,11 +208,11 @@ def browse_local(parent, dialog_name, conn, start_folder=None,
     if choose_button is None:
         choose_button = gtk.STOCK_OPEN
 
-    fcdialog = gtk.FileChooserDialog(dialog_name, parent,
-                                     dialog_type,
-                                     (gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL,
-                                      choose_button, gtk.RESPONSE_ACCEPT),
-                                      None)
+    fcdialog = gtk.FileChooserDialog(title=dialog_name,
+                                parent=parent,
+                                action=dialog_type,
+                                buttons=(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL,
+                                         choose_button, gtk.RESPONSE_ACCEPT))
     fcdialog.set_default_response(gtk.RESPONSE_ACCEPT)
 
     # If confirm is set, warn about a file overwrite
@@ -245,15 +245,10 @@ def browse_local(parent, dialog_name, conn, start_folder=None,
             fcdialog.set_current_folder(start_folder)
 
     # Run the dialog and parse the response
-    response = fcdialog.run()
-    fcdialog.hide()
-    if (response == gtk.RESPONSE_ACCEPT):
-        filename = fcdialog.get_filename()
-        fcdialog.destroy()
-        ret = filename
-    else:
-        fcdialog.destroy()
-        ret = None
+    ret = None
+    if fcdialog.run() == gtk.RESPONSE_ACCEPT:
+        ret = fcdialog.get_filename()
+    fcdialog.destroy()
 
     # Store the chosen directory in gconf if necessary
     if ret and browse_reason and not ret.startswith("/dev"):
-- 
1.7.11.7