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