Skip to content
Snippets Groups Projects
Commit 6bd154e1 authored by nkour's avatar nkour
Browse files

dedicated to dkirov. gtk28 autoconfirm for fchooser

parent a29c12a8
No related branches found
No related tags found
No related merge requests found
......@@ -286,6 +286,10 @@ def show_file_request(self, account, contact, file_props):
gtk.STOCK_SAVE, gtk.RESPONSE_OK))
dialog.set_current_name(file_props['name'])
dialog.set_default_response(gtk.RESPONSE_OK)
gtk28 = False
if gtk.gtk_version >= (2, 8, 0) and gtk.pygtk_version >= (2, 8, 0):
dialog.props.do_overwrite_confirmation = True
gtk28 = True
if last_save_dir and os.path.isdir(last_save_dir):
dialog.set_current_folder(last_save_dir)
else:
......@@ -296,10 +300,8 @@ def show_file_request(self, account, contact, file_props):
if response == gtk.RESPONSE_OK:
file_path = dialog.get_filename()
file_path = file_path.decode('utf-8')
if os.path.exists(file_path):
if not gtk28 and os.path.exists(file_path):
#FIXME: pango does not work here.
#FIXME: if gtk2.8 do this via signal
#http://developer.gnome.org/doc/API/2.0/gtk/GtkFileChooser.html#GtkFileChooser--do-overwrite-confirmation
primtext = _('This file already exists')
sectext = _('Would you like to overwrite it?')
dialog2 = dialogs.ConfirmationDialog(primtext, sectext)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment