Turn "replace and find by default" boolean pref into a "various" preference.

This commit is contained in:
Roland Pallai 2014-10-09 23:57:03 +02:00
parent 985829afe0
commit 9b2ccb9965
5 changed files with 9 additions and 25 deletions

View File

@ -1405,23 +1405,6 @@
<property name="position">3</property> <property name="position">3</property>
</packing> </packing>
</child> </child>
<child>
<object class="GtkCheckButton" id="check_replace_entry_activates_replace_and_find">
<property name="label" translatable="yes">Enter in replace window activates Replace &amp; Find</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="tooltip_text" translatable="yes">Enter in replace window activates Replace &amp; Find instead of Replace</property>
<property name="use_underline">True</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">4</property>
</packing>
</child>
</object> </object>
</child> </child>
</object> </object>

View File

@ -1891,9 +1891,6 @@ Use the current file's directory for Find in Files
active file. When this option is disabled, the directory of the last use of the Find in Files active file. When this option is disabled, the directory of the last use of the Find in Files
dialog is used. See `Find in Files`_ for details. dialog is used. See `Find in Files`_ for details.
Enter in replace window performs Replace & Find instead of Replace
Select Replace & Find as default action when pressing enter in Replace dialog.
Projects Projects
```````` ````````
@ -2612,6 +2609,11 @@ extract_filetype_regex Regex to extract filetype name from file S
via capture group one. via capture group one.
**Search related** **Search related**
find_selection_type See `Find selection`_. 0 immediately find_selection_type See `Find selection`_. 0 immediately
**Replace related**
replace_and_find_by_default Set ``Replace & Find`` button as default so
it will be activated when the Enter key is
pressed while one of the text fields has
focus. false immediately
**Build Menu related** **Build Menu related**
number_ft_menu_items The maximum number of menu items in the 2 on restart number_ft_menu_items The maximum number of menu items in the 2 on restart
filetype section of the Build menu. filetype section of the Build menu.

View File

@ -227,6 +227,8 @@ static void init_pref_groups(void)
"find_selection_type", GEANY_FIND_SEL_CURRENT_WORD); "find_selection_type", GEANY_FIND_SEL_CURRENT_WORD);
stash_group_add_string(group, &file_prefs.extract_filetype_regex, stash_group_add_string(group, &file_prefs.extract_filetype_regex,
"extract_filetype_regex", GEANY_DEFAULT_FILETYPE_REGEX); "extract_filetype_regex", GEANY_DEFAULT_FILETYPE_REGEX);
stash_group_add_boolean(group, &search_prefs.replace_and_find_by_default,
"replace_and_find_by_default", FALSE);
/* Note: Interface-related various prefs are in ui_init_prefs() */ /* Note: Interface-related various prefs are in ui_init_prefs() */

View File

@ -192,9 +192,6 @@ static void init_prefs(void)
"pref_search_always_wrap", FALSE, "check_hide_find_dialog"); "pref_search_always_wrap", FALSE, "check_hide_find_dialog");
stash_group_add_toggle_button(group, &search_prefs.use_current_file_dir, stash_group_add_toggle_button(group, &search_prefs.use_current_file_dir,
"pref_search_current_file_dir", TRUE, "check_fif_current_dir"); "pref_search_current_file_dir", TRUE, "check_fif_current_dir");
stash_group_add_toggle_button(group, &search_prefs.replace_entry_activates_replace_and_find,
"pref_search_replace_entry_activates_replace_and_find", FALSE,
"check_replace_entry_activates_replace_and_find");
stash_group_add_boolean(group, &find_dlg.all_expanded, "find_all_expanded", FALSE); stash_group_add_boolean(group, &find_dlg.all_expanded, "find_all_expanded", FALSE);
stash_group_add_boolean(group, &replace_dlg.all_expanded, "replace_all_expanded", FALSE); stash_group_add_boolean(group, &replace_dlg.all_expanded, "replace_all_expanded", FALSE);
/* dialog positions */ /* dialog positions */
@ -1376,7 +1373,7 @@ static void
on_replace_entry_activate(GtkEntry *entry, gpointer user_data) on_replace_entry_activate(GtkEntry *entry, gpointer user_data)
{ {
on_replace_dialog_response(NULL, on_replace_dialog_response(NULL,
search_prefs.replace_entry_activates_replace_and_find ? GEANY_RESPONSE_REPLACE_AND_FIND : GEANY_RESPONSE_REPLACE, search_prefs.replace_and_find_by_default ? GEANY_RESPONSE_REPLACE_AND_FIND : GEANY_RESPONSE_REPLACE,
NULL); NULL);
} }

View File

@ -61,7 +61,7 @@ typedef struct GeanySearchPrefs
gboolean use_current_word; /**< Use current word for default search text */ gboolean use_current_word; /**< Use current word for default search text */
gboolean use_current_file_dir; /* find in files directory to use on showing dialog */ gboolean use_current_file_dir; /* find in files directory to use on showing dialog */
gboolean hide_find_dialog; /* hide the find dialog on next or previous */ gboolean hide_find_dialog; /* hide the find dialog on next or previous */
gboolean replace_entry_activates_replace_and_find; /* enter in replace entry does Replace & Find */ gboolean replace_and_find_by_default; /* enter in replace window performs Replace & Find instead of Replace */
enum GeanyFindSelOptions find_selection_type; enum GeanyFindSelOptions find_selection_type;
} }
GeanySearchPrefs; GeanySearchPrefs;