diff --git a/ChangeLog b/ChangeLog index 56fdd9da..0154df61 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2006-09-03 Enrico Tröger + + * src/utils.c: Save All button is also active when only one file is + changed(improves usability). + + 2006-09-02 Enrico Tröger * src/document.c, src/search.c: diff --git a/src/utils.c b/src/utils.c index 11cabe74..d1ae227b 100644 --- a/src/utils.c +++ b/src/utils.c @@ -249,7 +249,7 @@ void utils_update_popup_goto_items(gboolean enable) void utils_save_buttons_toggle(gboolean enable) { guint i; - guint dirty_tabs = 0; + gboolean dirty_tabs = FALSE; gtk_widget_set_sensitive(app->save_buttons[0], enable); gtk_widget_set_sensitive(app->save_buttons[1], enable); @@ -257,14 +257,14 @@ void utils_save_buttons_toggle(gboolean enable) // save all menu item and tool button for (i = 0; i < (guint) gtk_notebook_get_n_pages(GTK_NOTEBOOK(app->notebook)); i++) { - // count the amount of tabs where changes were made and if they are more than one, + // count the amount of files where changes were made and if there are some, // we need the save all button / item - if (doc_list[i].is_valid && doc_list[i].changed) - dirty_tabs++; + if (! dirty_tabs && doc_list[i].is_valid && doc_list[i].changed) + dirty_tabs = TRUE; } - gtk_widget_set_sensitive(app->save_buttons[2], (dirty_tabs > 1) ? TRUE : FALSE); - gtk_widget_set_sensitive(app->save_buttons[3], (dirty_tabs > 1) ? TRUE : FALSE); + gtk_widget_set_sensitive(app->save_buttons[2], (dirty_tabs > 0) ? TRUE : FALSE); + gtk_widget_set_sensitive(app->save_buttons[3], (dirty_tabs > 0) ? TRUE : FALSE); }