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
This commit is contained in:
Cole Robinson 2012-10-14 00:15:04 -04:00
parent 63ba65d374
commit 71e5ac2a0a

View File

@ -208,11 +208,11 @@ def browse_local(parent, dialog_name, conn, start_folder=None,
if choose_button is None: if choose_button is None:
choose_button = gtk.STOCK_OPEN choose_button = gtk.STOCK_OPEN
fcdialog = gtk.FileChooserDialog(dialog_name, parent, fcdialog = gtk.FileChooserDialog(title=dialog_name,
dialog_type, parent=parent,
(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, action=dialog_type,
choose_button, gtk.RESPONSE_ACCEPT), buttons=(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL,
None) choose_button, gtk.RESPONSE_ACCEPT))
fcdialog.set_default_response(gtk.RESPONSE_ACCEPT) fcdialog.set_default_response(gtk.RESPONSE_ACCEPT)
# If confirm is set, warn about a file overwrite # 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) fcdialog.set_current_folder(start_folder)
# Run the dialog and parse the response # Run the dialog and parse the response
response = fcdialog.run() ret = None
fcdialog.hide() if fcdialog.run() == gtk.RESPONSE_ACCEPT:
if (response == gtk.RESPONSE_ACCEPT): ret = fcdialog.get_filename()
filename = fcdialog.get_filename() fcdialog.destroy()
fcdialog.destroy()
ret = filename
else:
fcdialog.destroy()
ret = None
# Store the chosen directory in gconf if necessary # Store the chosen directory in gconf if necessary
if ret and browse_reason and not ret.startswith("/dev"): if ret and browse_reason and not ret.startswith("/dev"):