Fixed weird behaviour of Save all tool button and menu item.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@763 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
parent
e6e2f9020b
commit
01127d7e0a
@ -1,8 +1,14 @@
|
||||
2006-08-26 Enrico Tröger <enrico.troeger@uvena.de>
|
||||
|
||||
* src/geany.h, src/main.c, src/utils.c:
|
||||
Fixed weird behaviour of Save all tool button and menu item.
|
||||
|
||||
|
||||
2006-08-23 Enrico Tröger <enrico.troeger@uvena.de>
|
||||
|
||||
* src/prefs.c, src/vte.c:
|
||||
Added new VTE settings to the preferences dialog.
|
||||
Improved ignore menu bar accelerator settings.
|
||||
Improved ignore menu bar accelerator setting.
|
||||
Keep current working directory when restarting the VTE
|
||||
(happens when hitting Ctrl+C).
|
||||
* src/document.c: Added counter when using "Replace All" and display
|
||||
|
@ -163,7 +163,7 @@ typedef struct MyApp
|
||||
GtkWidget *menu_copy_items[5];
|
||||
GtkWidget *redo_items[3];
|
||||
GtkWidget *undo_items[3];
|
||||
GtkWidget *save_buttons[2];
|
||||
GtkWidget *save_buttons[4];
|
||||
GtkWidget *sensitive_buttons[37];
|
||||
GtkWidget *open_colorsel;
|
||||
GtkWidget *open_fontsel;
|
||||
|
@ -262,6 +262,8 @@ static void main_init(void)
|
||||
app->menu_insert_include_item[1] = lookup_widget(app->window, "insert_include2");
|
||||
app->save_buttons[0] = lookup_widget(app->window, "menu_save1");
|
||||
app->save_buttons[1] = lookup_widget(app->window, "toolbutton10");
|
||||
app->save_buttons[2] = lookup_widget(app->window, "menu_save_all1");
|
||||
app->save_buttons[3] = lookup_widget(app->window, "toolbutton22");
|
||||
app->sensitive_buttons[0] = lookup_widget(app->window, "menu_close1");
|
||||
app->sensitive_buttons[1] = lookup_widget(app->window, "toolbutton15");
|
||||
app->sensitive_buttons[2] = lookup_widget(app->window, "menu_change_font1");
|
||||
|
15
src/utils.c
15
src/utils.c
@ -248,8 +248,23 @@ void utils_update_popup_goto_items(gboolean enable)
|
||||
|
||||
void utils_save_buttons_toggle(gboolean enable)
|
||||
{
|
||||
guint i;
|
||||
guint dirty_tabs = 0;
|
||||
|
||||
gtk_widget_set_sensitive(app->save_buttons[0], enable);
|
||||
gtk_widget_set_sensitive(app->save_buttons[1], enable);
|
||||
|
||||
// save all menu item and tool button
|
||||
for (i = 0; i < 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,
|
||||
// we need the save all button / item
|
||||
if (doc_list[i].is_valid && doc_list[i].changed)
|
||||
dirty_tabs++;
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user