Save All button is also active when only one file is changed(improves usability).

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@784 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
Enrico Tröger 2006-09-03 13:30:12 +00:00
parent f74ae89922
commit c6b20543ac
2 changed files with 12 additions and 6 deletions

View File

@ -1,3 +1,9 @@
2006-09-03 Enrico Tröger <enrico.troeger@uvena.de>
* src/utils.c: Save All button is also active when only one file is
changed(improves usability).
2006-09-02 Enrico Tröger <enrico.troeger@uvena.de>
* src/document.c, src/search.c:

View File

@ -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);
}