Use new stuff from patch 1/4 to set save widgets sensitivity according to sym_change_count.
Signed-off-by: Karsten Wiese <[EMAIL PROTECTED]> diff -pur 2.6.18/scripts/kconfig/gconf.c rt3-kw/scripts/kconfig/gconf.c --- 2.6.18/scripts/kconfig/gconf.c 2006-09-23 20:03:17.000000000 +0200 +++ 2.6.18-kw/scripts/kconfig/gconf.c 2006-09-24 14:36:46.000000000 +0200 @@ -38,8 +38,6 @@ static gboolean show_all = FALSE; static gboolean show_debug = FALSE; static gboolean resizeable = FALSE; -static gboolean config_changed = FALSE; - static char nohelp_text[] = N_("Sorry, no help available for this option yet.\n"); @@ -50,6 +48,8 @@ GtkWidget *text_w = NULL; GtkWidget *hpaned = NULL; GtkWidget *vpaned = NULL; GtkWidget *back_btn = NULL; +GtkWidget *save_btn = NULL; +GtkWidget *save_menu_item = NULL; GtkTextTag *tag1, *tag2; GdkColor color; @@ -75,7 +75,7 @@ static void display_tree_part(void); static void update_tree(struct menu *src, GtkTreeIter * dst); static void set_node(GtkTreeIter * node, struct menu *menu, gchar ** row); static gchar **fill_row(struct menu *menu); - +static void sym_change_count_changed(int count); /* Helping/Debugging Functions */ @@ -224,6 +224,10 @@ void init_main_window(const gchar * glad gtk_check_menu_item_set_active((GtkCheckMenuItem *) widget, show_value); + save_btn = glade_xml_get_widget(xml, "button3"); + save_menu_item = glade_xml_get_widget(xml, "save1"); + sym_change_count_changed_set(sym_change_count_changed); + style = gtk_widget_get_style(main_wnd); widget = glade_xml_get_widget(xml, "toolbar1"); @@ -512,14 +516,14 @@ static void text_insert_msg(const char * /* Main Windows Callbacks */ -void on_save1_activate(GtkMenuItem * menuitem, gpointer user_data); +void on_save_activate(GtkMenuItem * menuitem, gpointer user_data); gboolean on_window1_delete_event(GtkWidget * widget, GdkEvent * event, gpointer user_data) { GtkWidget *dialog, *label; gint result; - if (config_changed == FALSE) + if (!sym_change_count()) return FALSE; dialog = gtk_dialog_new_with_buttons(_("Warning !"), @@ -543,7 +547,7 @@ gboolean on_window1_delete_event(GtkWidg result = gtk_dialog_run(GTK_DIALOG(dialog)); switch (result) { case GTK_RESPONSE_YES: - on_save1_activate(NULL, NULL); + on_save_activate(NULL, NULL); return FALSE; case GTK_RESPONSE_NO: return FALSE; @@ -621,12 +625,10 @@ void on_load1_activate(GtkMenuItem * men } -void on_save1_activate(GtkMenuItem * menuitem, gpointer user_data) +void on_save_activate(GtkMenuItem * menuitem, gpointer user_data) { if (conf_write(NULL)) text_insert_msg(_("Error"), _("Unable to save configuration !")); - - config_changed = FALSE; } @@ -819,12 +821,6 @@ void on_load_clicked(GtkButton * button, } -void on_save_clicked(GtkButton * button, gpointer user_data) -{ - on_save1_activate(NULL, user_data); -} - - void on_single_clicked(GtkButton * button, gpointer user_data) { view_mode = SINGLE_VIEW; @@ -899,7 +895,6 @@ static void renderer_edited(GtkCellRende sym_set_string_value(sym, new_def); - config_changed = TRUE; update_tree(&rootmenu, NULL); gtk_tree_path_free(path); @@ -930,7 +925,6 @@ static void change_sym_value(struct menu if (!sym_tristate_within_range(sym, newval)) newval = yes; sym_set_tristate_value(sym, newval); - config_changed = TRUE; if (view_mode == FULL_VIEW) update_tree(&rootmenu, NULL); else if (view_mode == SPLIT_VIEW) { @@ -1633,3 +1627,9 @@ int main(int ac, char *av[]) return 0; } + +static void sym_change_count_changed(int count) +{ + gtk_widget_set_sensitive(save_btn, count); + gtk_widget_set_sensitive(save_menu_item, count); +} Nur in 2.6.18-kw/scripts/kconfig: gconf.c~. diff -pur 2.6.18/scripts/kconfig/gconf.glade rt3-kw/scripts/kconfig/gconf.glade --- 2.6.18/scripts/kconfig/gconf.glade 2006-06-18 03:49:35.000000000 +0200 +++ 2.6.18-kw/scripts/kconfig/gconf.glade 2006-09-24 02:04:10.000000000 +0200 @@ -70,7 +70,7 @@ <property name="tooltip" translatable="yes">Save the config in .config</property> <property name="label" translatable="yes">_Save</property> <property name="use_underline">True</property> - <signal name="activate" handler="on_save1_activate"/> + <signal name="activate" handler="on_save_activate"/> <accelerator key="S" modifiers="GDK_CONTROL_MASK" signal="activate"/> <child internal-child="image"> @@ -380,7 +380,7 @@ <property name="visible_horizontal">True</property> <property name="visible_vertical">True</property> <property name="is_important">False</property> - <signal name="clicked" handler="on_save_clicked"/> + <signal name="clicked" handler="on_save_activate"/> </widget> <packing> <property name="expand">False</property> ___________________________________________________________ Telefonate ohne weitere Kosten vom PC zum PC: http://messenger.yahoo.de ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ kbuild-devel mailing list kbuild-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kbuild-devel