From b234bf160a55da0cd4500a8205578bea9f63f335 Mon Sep 17 00:00:00 2001 From: Nick Treleaven Date: Fri, 24 Aug 2007 11:19:26 +0000 Subject: [PATCH] Fix saving the wrong document when using Save All with unnamed documents. git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@1818 ea778897-0a13-0410-b9d1-a72fbfd435f5 --- ChangeLog | 7 +++++++ src/callbacks.c | 8 +++++++- src/dialogs.c | 4 ++-- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index b07bd9ad..f63a3b5f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2007-08-24 Nick Treleaven + + * src/dialogs.c, src/callbacks.c: + Fix saving the wrong document when using Save All with unnamed + documents. + + 2007-08-23 Enrico Tröger * src/document.c: Fix invalid filetype setting when using Save All and diff --git a/src/callbacks.c b/src/callbacks.c index 0e6ec75a..ff102fc6 100644 --- a/src/callbacks.c +++ b/src/callbacks.c @@ -228,12 +228,18 @@ on_save_all1_activate (GtkMenuItem *menuitem, { gint i, idx, max = gtk_notebook_get_n_pages(GTK_NOTEBOOK(app->notebook)); gint cur_idx = document_get_cur_idx(); - for(i = 0; i < max; i++) + + for (i = 0; i < max; i++) { idx = document_get_n_idx(i); if (! doc_list[idx].changed) continue; if (doc_list[idx].file_name == NULL) + { + // display unnamed document + gtk_notebook_set_current_page(GTK_NOTEBOOK(app->notebook), + document_get_notebook_page(idx)); dialogs_show_save_as(); + } else document_save_file(idx, FALSE); } diff --git a/src/dialogs.c b/src/dialogs.c index d6bca009..0d627339 100644 --- a/src/dialogs.c +++ b/src/dialogs.c @@ -451,8 +451,8 @@ on_file_save_dialog_response (GtkDialog *dialog, #endif -/* This shows the file selection dialog to save a file, returning TRUE if - * the file was saved. */ +/* Show the Save As dialog for the current notebook page. + * Returns: TRUE if the file was saved. */ gboolean dialogs_show_save_as() { #if GEANY_USE_WIN32_DIALOG