static void shell_searchbar_save_search_filter (EShellSearchbar *searchbar) { EShellView *shell_view; EActionComboBox *action_combo_box; GtkRadioAction *radio_action; GKeyFile *key_file; const gchar *action_name; const gchar *state_group; const gchar *key; shell_view = e_shell_searchbar_get_shell_view (searchbar); state_group = e_shell_searchbar_get_state_group (searchbar); g_return_if_fail (state_group != NULL); key = STATE_KEY_SEARCH_FILTER; key_file = e_shell_view_get_state_key_file (shell_view); action_combo_box = e_shell_searchbar_get_filter_combo_box (searchbar); radio_action = e_action_combo_box_get_action (action_combo_box); if (radio_action != NULL) radio_action = e_radio_action_get_current_action (radio_action); if (radio_action != NULL) { action_name = gtk_action_get_name (GTK_ACTION (radio_action)); g_key_file_set_string (key_file, state_group, key, action_name); } else g_key_file_remove_key (key_file, state_group, key, NULL); e_shell_view_set_state_dirty (shell_view); }
static void shell_searchbar_save_search_text (EShellSearchbar *searchbar) { EShellView *shell_view; GKeyFile *key_file; const gchar *search_text; const gchar *state_group; const gchar *key; shell_view = e_shell_searchbar_get_shell_view (searchbar); state_group = e_shell_searchbar_get_state_group (searchbar); g_return_if_fail (state_group != NULL); key = STATE_KEY_SEARCH_TEXT; key_file = e_shell_view_get_state_key_file (shell_view); search_text = e_shell_searchbar_get_search_text (searchbar); if (search_text != NULL && *search_text != '\0') g_key_file_set_string (key_file, state_group, key, search_text); else g_key_file_remove_key (key_file, state_group, key, NULL); e_shell_view_set_state_dirty (shell_view); }
static void shell_searchbar_save_search_scope (EShellSearchbar *searchbar) { EShellView *shell_view; EActionComboBox *action_combo_box; GtkRadioAction *radio_action; GKeyFile *key_file; const gchar *action_name; const gchar *state_group; const gchar *key; shell_view = e_shell_searchbar_get_shell_view (searchbar); /* Search scope is hard-coded to the default state group. */ state_group = STATE_GROUP_DEFAULT; key = STATE_KEY_SEARCH_SCOPE; key_file = e_shell_view_get_state_key_file (shell_view); action_combo_box = e_shell_searchbar_get_scope_combo_box (searchbar); radio_action = e_action_combo_box_get_action (action_combo_box); if (radio_action != NULL) radio_action = e_radio_action_get_current_action (radio_action); if (radio_action != NULL) { action_name = gtk_action_get_name (GTK_ACTION (radio_action)); g_key_file_set_string (key_file, state_group, key, action_name); } else g_key_file_remove_key (key_file, state_group, key, NULL); e_shell_view_set_state_dirty (shell_view); }
static void action_address_book_manage_groups_cb (GtkAction *action, EBookShellView *book_shell_view) { EShellView *shell_view; ESourceSelector *selector; shell_view = E_SHELL_VIEW (book_shell_view); selector = e_book_shell_sidebar_get_selector (book_shell_view->priv->book_shell_sidebar); if (e_source_selector_manage_groups (selector) && e_source_selector_save_groups_setup (selector, e_shell_view_get_state_key_file (shell_view))) e_shell_view_set_state_dirty (shell_view); }