From: handa Date: Wed, 20 Jun 2007 12:38:57 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: REL-0-9-0~1 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=66ca1be222fafd0720f7906ae75af77866f241c0;p=m17n%2Fm17n-im-config.git *** empty log message *** --- diff --git a/src/mim-config.c b/src/mim-config.c index 04c01cf..a05d212 100644 --- a/src/mim-config.c +++ b/src/mim-config.c @@ -432,29 +432,31 @@ make_store_for_input_methods () } static gboolean -revert_to_saved (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, - gpointer data) +reset_to_default (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, + gpointer data) { - enum MimStatus status; + enum MimStatus status, new_status; MSymbol lang, name; MimConfigStatus *config_status = data; + MPlist *empty = mplist (); gtk_tree_model_get (model, iter, COL_LANG, &lang, COL_NAME, &name, -1); if (lang == Mnil) return FALSE; - gtk_tree_model_get (model, iter, COL_STATUS, &status, -1); - if (status != MIM_STATUS_MODIFIED) + gtk_tree_model_get (model, iter, COL_STATUS, &status, -1); + if (status == MIM_STATUS_DEFAULT) return FALSE; - minput_config_variable (lang, name, Mnil, NULL); - minput_config_command (lang, name, Mnil, NULL); - status = get_mim_status (lang, name); - update_child_row (model, iter, status, config_status, NULL); + minput_config_variable (lang, name, Mnil, empty); + minput_config_command (lang, name, Mnil, empty); + new_status = get_mim_status (lang, name); + if (status != new_status) + update_child_row (model, iter, new_status, config_status, NULL); return FALSE; } static gboolean -set_as_saved (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, - gpointer data) +revert_to_saved (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, + gpointer data) { enum MimStatus status; MSymbol lang, name; @@ -466,31 +468,29 @@ set_as_saved (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gtk_tree_model_get (model, iter, COL_STATUS, &status, -1); if (status != MIM_STATUS_MODIFIED) return FALSE; + minput_config_variable (lang, name, Mnil, NULL); + minput_config_command (lang, name, Mnil, NULL); status = get_mim_status (lang, name); update_child_row (model, iter, status, config_status, NULL); return FALSE; } static gboolean -reset_to_default (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, - gpointer data) +set_as_saved (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, + gpointer data) { - enum MimStatus status, new_status; + enum MimStatus status; MSymbol lang, name; MimConfigStatus *config_status = data; - MPlist *empty = mplist (); gtk_tree_model_get (model, iter, COL_LANG, &lang, COL_NAME, &name, -1); if (lang == Mnil) return FALSE; - gtk_tree_model_get (model, iter, COL_STATUS, &status, -1); - if (status == MIM_STATUS_DEFAULT) + gtk_tree_model_get (model, iter, COL_STATUS, &status, -1); + if (status != MIM_STATUS_MODIFIED) return FALSE; - minput_config_variable (lang, name, Mnil, empty); - minput_config_command (lang, name, Mnil, empty); - new_status = get_mim_status (lang, name); - if (status != new_status) - update_child_row (model, iter, new_status, config_status, NULL); + status = get_mim_status (lang, name); + update_child_row (model, iter, status, config_status, NULL); return FALSE; }