[anjuta] document-manager: Save search box settings
- From: Sebastien Granjoux <sgranjoux src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [anjuta] document-manager: Save search box settings
- Date: Mon, 18 Feb 2013 18:45:29 +0000 (UTC)
commit d9e01c8dae02d9b4a6c634aa32da9ba52a434d64
Author: SÃbastien Granjoux <seb sfo free fr>
Date: Sun Feb 17 18:09:29 2013 +0100
document-manager: Save search box settings
plugins/document-manager/plugin.c | 5 +++++
plugins/document-manager/search-box.c | 25 +++++++++++++++++++++++++
plugins/document-manager/search-box.h | 3 +++
3 files changed, 33 insertions(+), 0 deletions(-)
---
diff --git a/plugins/document-manager/plugin.c b/plugins/document-manager/plugin.c
index 76ac95e..bdb7606 100644
--- a/plugins/document-manager/plugin.c
+++ b/plugins/document-manager/plugin.c
@@ -1376,6 +1376,9 @@ on_session_load (AnjutaShell *shell, AnjutaSessionPhase phase,
anjuta_bookmarks_session_load (ANJUTA_BOOKMARKS (plugin->bookmarks),
session);
+
+ search_box_session_load (SEARCH_BOX (plugin->search_box),
+ session);
}
static void
@@ -1424,6 +1427,8 @@ on_session_save (AnjutaShell *shell, AnjutaSessionPhase phase,
anjuta_bookmarks_session_save (ANJUTA_BOOKMARKS (plugin->bookmarks),
session);
+
+ search_box_session_save (SEARCH_BOX (plugin->search_box), session);
}
static gboolean
diff --git a/plugins/document-manager/search-box.c b/plugins/document-manager/search-box.c
index 59d2639..8e08815 100644
--- a/plugins/document-manager/search-box.c
+++ b/plugins/document-manager/search-box.c
@@ -853,6 +853,11 @@ do_popup_menu (GtkWidget* widget, GdkEventButton *event, SearchBox* search_box)
if (!gtk_menu_get_attach_widget(GTK_MENU (search_box->priv->popup_menu)))
gtk_menu_attach_to_widget (GTK_MENU (search_box->priv->popup_menu), widget, NULL);
+
+ gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(search_box->priv->case_action),
search_box->priv->case_sensitive);
+ gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(search_box->priv->regex_action),
search_box->priv->regex_mode);
+ gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(search_box->priv->highlight_action),
search_box->priv->highlight_all);
+
gtk_menu_popup (GTK_MENU (search_box->priv->popup_menu), NULL, NULL, NULL, NULL,
button, event_time);
@@ -1198,3 +1203,23 @@ void search_box_set_replace_string (SearchBox* search_box, const gchar* replace)
gtk_entry_set_text (GTK_ENTRY (search_box->priv->replace_entry), replace);
}
+
+void
+search_box_session_load (SearchBox* search_box, AnjutaSession* session)
+{
+ g_return_if_fail (search_box != NULL && SEARCH_IS_BOX(search_box));
+
+ search_box->priv->case_sensitive = anjuta_session_get_int (session, "Search Box", "Case Sensitive") ?
TRUE : FALSE;
+ search_box->priv->regex_mode = anjuta_session_get_int (session, "Search Box", "Regular Expression") ?
TRUE : FALSE;
+ search_box->priv->highlight_all = anjuta_session_get_int (session, "Search Box", "Highlight Match") ?
TRUE : FALSE;
+}
+
+void
+search_box_session_save (SearchBox* search_box, AnjutaSession* session)
+{
+ g_return_if_fail (search_box != NULL && SEARCH_IS_BOX(search_box));
+
+ anjuta_session_set_int (session, "Search Box", "Case Sensitive", search_box->priv->case_sensitive ? 1
: 0);
+ anjuta_session_set_int (session, "Search Box", "Regular Expression", search_box->priv->regex_mode ? 1
: 0);
+ anjuta_session_set_int (session, "Search Box", "Highlight Match", search_box->priv->highlight_all ? 1
: 0);
+}
diff --git a/plugins/document-manager/search-box.h b/plugins/document-manager/search-box.h
index 10e84bb..30dded3 100644
--- a/plugins/document-manager/search-box.h
+++ b/plugins/document-manager/search-box.h
@@ -74,6 +74,9 @@ void search_box_set_search_string (SearchBox* search_box, const gchar* search);
const gchar* search_box_get_replace_string (SearchBox* search_box);
void search_box_set_replace_string (SearchBox* search_box, const gchar* replace);
+void search_box_session_load (SearchBox* search_box, AnjutaSession* session);
+void search_box_session_save (SearchBox* search_box, AnjutaSession* session);
+
G_END_DECLS
#endif /* _SEARCH_BOX_H_ */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]