SF.net SVN: geany:[3797] trunk

eht16 at users.sourceforge.net eht16 at xxxxx
Sun May 17 17:16:25 UTC 2009


Revision: 3797
          http://geany.svn.sourceforge.net/geany/?rev=3797&view=rev
Author:   eht16
Date:     2009-05-17 17:16:24 +0000 (Sun, 17 May 2009)

Log Message:
-----------
Don't close the Save As dialog when saving the file didn't succeed.

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/src/dialogs.c

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2009-05-17 15:46:09 UTC (rev 3796)
+++ trunk/ChangeLog	2009-05-17 17:16:24 UTC (rev 3797)
@@ -5,6 +5,8 @@
    in a comment on the same line as the variable declaration.
  * src/search.c:
    Remember the additional Find in Files search flags at startup.
+ * src/dialogs.c:
+   Don't close the Save As dialog when saving the file didn't succeed.
 
 
 2009-05-13  Nick Treleaven  <nick(dot)treleaven(at)btinternet(dot)com>

Modified: trunk/src/dialogs.c
===================================================================
--- trunk/src/dialogs.c	2009-05-17 15:46:09 UTC (rev 3796)
+++ trunk/src/dialogs.c	2009-05-17 17:16:24 UTC (rev 3797)
@@ -333,16 +333,17 @@
 
 
 #if ! GEANY_USE_WIN32_DIALOG
-static void handle_save_as(const gchar *utf8_filename, gboolean open_new_tab, gboolean rename_file)
+static gboolean handle_save_as(const gchar *utf8_filename, gboolean open_new_tab, gboolean rename_file)
 {
 	GeanyDocument *doc = document_get_current();
+	gboolean success = FALSE;
 
-	g_return_if_fail(NZV(utf8_filename));
+	g_return_val_if_fail(NZV(utf8_filename), FALSE);
 
 	if (open_new_tab)
 	{	/* "open" the saved file in a new tab and switch to it */
 		doc = document_clone(doc, utf8_filename);
-		document_save_file_as(doc, NULL);
+		success = document_save_file_as(doc, NULL);
 	}
 	else
 	{
@@ -356,10 +357,11 @@
 			tm_workspace_remove_object(doc->tm_file, TRUE, TRUE);
 			doc->tm_file = NULL;
 		}
-		document_save_file_as(doc, utf8_filename);
+		success = document_save_file_as(doc, utf8_filename);
 
 		build_menu_update(doc);
 	}
+	return success;
 }
 
 
@@ -369,6 +371,7 @@
                                         gpointer user_data)
 {
 	gboolean rename_file = FALSE;
+	gboolean success = FALSE;
 
 	switch (response)
 	{
@@ -390,13 +393,14 @@
 			}
 			utf8_filename = utils_get_utf8_from_locale(new_filename);
 
-			handle_save_as(utf8_filename, open_new_tab, rename_file);
+			success = handle_save_as(utf8_filename, open_new_tab, rename_file);
 
 			g_free(utf8_filename);
 			g_free(new_filename);
 		}
 	}
-	gtk_widget_hide(ui_widgets.save_filesel);
+	if (success)
+		gtk_widget_hide(ui_widgets.save_filesel);
 }
 #endif
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the Commits mailing list