SF.net SVN: geany:[3512] trunk

ntrel at users.sourceforge.net ntrel at xxxxx
Tue Jan 27 17:50:46 UTC 2009


Revision: 3512
          http://geany.svn.sourceforge.net/geany/?rev=3512&view=rev
Author:   ntrel
Date:     2009-01-27 17:50:45 +0000 (Tue, 27 Jan 2009)

Log Message:
-----------
Remember whether find/replace all expanders were expanded.

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/src/search.c

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2009-01-27 13:54:05 UTC (rev 3511)
+++ trunk/ChangeLog	2009-01-27 17:50:45 UTC (rev 3512)
@@ -3,6 +3,8 @@
  * src/interface.c, geany.glade:
    Split Prefs dialog General tab into sub-notebook with Startup and
    Miscellaneous tabs. Merge Search tab into Miscellaneous tab.
+ * src/search.c:
+   Remember whether find/replace all expanders were expanded.
 
 
 2009-01-26  Frank Lanitz  <frank(at)frank(dot)uvena(dot)de>

Modified: trunk/src/search.c
===================================================================
--- trunk/src/search.c	2009-01-27 13:54:05 UTC (rev 3511)
+++ trunk/src/search.c	2009-01-27 17:50:45 UTC (rev 3512)
@@ -99,9 +99,16 @@
 
 static struct
 {
+	gboolean all_expanded;
+}
+find_dlg = {FALSE};
+
+static struct
+{
 	GtkWidget *find_entry;
+	gboolean all_expanded;
 }
-replace_widgets = {NULL};
+replace_widgets = {NULL, FALSE};
 
 static struct
 {
@@ -154,6 +161,8 @@
 	configuration_add_pref_group(group, TRUE);
 	stash_group_add_toggle_button(group, &search_prefs.use_current_file_dir,
 		"pref_search_current_file_dir", TRUE, "check_fif_current_dir");
+	stash_group_add_boolean(group, &find_dlg.all_expanded, "find_all_expanded", FALSE);
+	stash_group_add_boolean(group, &replace_widgets.all_expanded, "replace_all_expanded", FALSE);
 
 	group = stash_group_new("search");
 	fif_prefs = group;
@@ -340,6 +349,14 @@
 }
 
 
+static void on_expander_activated(GtkExpander *exp, gpointer data)
+{
+	gboolean *setting = data;
+
+	*setting = gtk_expander_get_expanded(exp);
+}
+
+
 void search_show_find_dialog(void)
 {
 	GeanyDocument *doc = document_get_current();
@@ -401,6 +418,10 @@
 
 		/* Now add the multiple match options */
 		exp = gtk_expander_new_with_mnemonic(_("_Find All"));
+		gtk_expander_set_expanded(GTK_EXPANDER(exp), find_dlg.all_expanded);
+		g_signal_connect_after(exp, "activate",
+			G_CALLBACK(on_expander_activated), &find_dlg.all_expanded);
+
 		bbox = gtk_hbutton_box_new();
 
 		button = gtk_button_new_with_mnemonic(_("_Mark"));
@@ -536,6 +557,10 @@
 
 	/* Now add the multiple replace options */
 	exp = gtk_expander_new_with_mnemonic(_("Re_place All"));
+	gtk_expander_set_expanded(GTK_EXPANDER(exp), replace_widgets.all_expanded);
+	g_signal_connect_after(exp, "activate",
+		G_CALLBACK(on_expander_activated), &replace_widgets.all_expanded);
+
 	bbox = gtk_hbutton_box_new();
 
 	button = gtk_button_new_with_mnemonic(_("In Sessi_on"));


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the Commits mailing list