split "always wrap search and hide find dialog" pref into "always wrap search" and "hide find dialog"
This commit is contained in:
parent
eb064df5b6
commit
4ffbd8f9ad
26
geany.glade
26
geany.glade
@ -3841,11 +3841,31 @@
|
||||
<property name="spacing">0</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkCheckButton" id="check_ask_suppress_search_dialogs">
|
||||
<widget class="GtkCheckButton" id="check_always_wrap_search">
|
||||
<property name="visible">True</property>
|
||||
<property name="tooltip" translatable="yes">Always wrap search around the document and hide the Find dialog after clicking Find Next/Previous</property>
|
||||
<property name="tooltip" translatable="yes">Always wrap search around the document</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label" translatable="yes">Always wrap search and hide the Find dialog</property>
|
||||
<property name="label" translatable="yes">Always wrap search</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<property name="active">False</property>
|
||||
<property name="inconsistent">False</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkCheckButton" id="check_hide_find_dialog">
|
||||
<property name="visible">True</property>
|
||||
<property name="tooltip" translatable="yes">Hide the Find dialog after clicking Find Next/Previous</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label" translatable="yes">Hide the Find dialog</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
|
||||
@ -1939,7 +1939,7 @@ gint document_find_text(GeanyDocument *doc, const gchar *text, const gchar *orig
|
||||
}
|
||||
|
||||
/* we searched only part of the document, so ask whether to wraparound. */
|
||||
if (search_prefs.suppress_dialogs ||
|
||||
if (search_prefs.always_wrap ||
|
||||
dialogs_show_question_full(parent, GTK_STOCK_FIND, GTK_STOCK_CANCEL,
|
||||
_("Wrap search and find again?"), _("\"%s\" was not found."), original_text))
|
||||
{
|
||||
|
||||
@ -2574,7 +2574,8 @@ create_prefs_dialog (void)
|
||||
GtkWidget *frame36;
|
||||
GtkWidget *alignment39;
|
||||
GtkWidget *vbox36;
|
||||
GtkWidget *check_ask_suppress_search_dialogs;
|
||||
GtkWidget *check_always_wrap_search;
|
||||
GtkWidget *check_hide_find_dialog;
|
||||
GtkWidget *check_search_use_current_word;
|
||||
GtkWidget *check_fif_current_dir;
|
||||
GtkWidget *label215;
|
||||
@ -3195,10 +3196,15 @@ create_prefs_dialog (void)
|
||||
gtk_widget_show (vbox36);
|
||||
gtk_container_add (GTK_CONTAINER (alignment39), vbox36);
|
||||
|
||||
check_ask_suppress_search_dialogs = gtk_check_button_new_with_mnemonic (_("Always wrap search and hide the Find dialog"));
|
||||
gtk_widget_show (check_ask_suppress_search_dialogs);
|
||||
gtk_box_pack_start (GTK_BOX (vbox36), check_ask_suppress_search_dialogs, FALSE, FALSE, 0);
|
||||
gtk_tooltips_set_tip (tooltips, check_ask_suppress_search_dialogs, _("Always wrap search around the document and hide the Find dialog after clicking Find Next/Previous"), NULL);
|
||||
check_always_wrap_search = gtk_check_button_new_with_mnemonic (_("Always wrap search"));
|
||||
gtk_widget_show (check_always_wrap_search);
|
||||
gtk_box_pack_start (GTK_BOX (vbox36), check_always_wrap_search, FALSE, FALSE, 0);
|
||||
gtk_tooltips_set_tip (tooltips, check_always_wrap_search, _("Always wrap search around the document"), NULL);
|
||||
|
||||
check_hide_find_dialog = gtk_check_button_new_with_mnemonic (_("Hide the Find dialog"));
|
||||
gtk_widget_show (check_hide_find_dialog);
|
||||
gtk_box_pack_start (GTK_BOX (vbox36), check_hide_find_dialog, FALSE, FALSE, 0);
|
||||
gtk_tooltips_set_tip (tooltips, check_hide_find_dialog, _("Hide the Find dialog after clicking Find Next/Previous"), NULL);
|
||||
|
||||
check_search_use_current_word = gtk_check_button_new_with_mnemonic (_("Use the current word under the cursor for Find dialogs"));
|
||||
gtk_widget_show (check_search_use_current_word);
|
||||
@ -5185,7 +5191,8 @@ create_prefs_dialog (void)
|
||||
GLADE_HOOKUP_OBJECT (prefs_dialog, frame36, "frame36");
|
||||
GLADE_HOOKUP_OBJECT (prefs_dialog, alignment39, "alignment39");
|
||||
GLADE_HOOKUP_OBJECT (prefs_dialog, vbox36, "vbox36");
|
||||
GLADE_HOOKUP_OBJECT (prefs_dialog, check_ask_suppress_search_dialogs, "check_ask_suppress_search_dialogs");
|
||||
GLADE_HOOKUP_OBJECT (prefs_dialog, check_always_wrap_search, "check_always_wrap_search");
|
||||
GLADE_HOOKUP_OBJECT (prefs_dialog, check_hide_find_dialog, "check_hide_find_dialog");
|
||||
GLADE_HOOKUP_OBJECT (prefs_dialog, check_search_use_current_word, "check_search_use_current_word");
|
||||
GLADE_HOOKUP_OBJECT (prefs_dialog, check_fif_current_dir, "check_fif_current_dir");
|
||||
GLADE_HOOKUP_OBJECT (prefs_dialog, label215, "label215");
|
||||
|
||||
@ -150,8 +150,6 @@ static void init_pref_groups(void)
|
||||
stash_group_add_toggle_button(group, &interface_prefs.highlighting_invert_all,
|
||||
"highlighting_invert_all", FALSE, "check_highlighting_invert");
|
||||
|
||||
stash_group_add_toggle_button(group, &search_prefs.suppress_dialogs,
|
||||
"pref_main_suppress_search_dialogs", FALSE, "check_ask_suppress_search_dialogs");
|
||||
stash_group_add_toggle_button(group, &search_prefs.use_current_word,
|
||||
"pref_main_search_use_current_word", TRUE, "check_search_use_current_word");
|
||||
|
||||
@ -693,6 +691,17 @@ static void load_dialog_prefs(GKeyFile *config)
|
||||
utils_get_setting_boolean(config, PACKAGE, "use_safe_file_saving", FALSE));
|
||||
}
|
||||
|
||||
/* compatibility with Geany 0.21 */
|
||||
{
|
||||
gboolean suppress_search_dialogs = utils_get_setting_boolean(config, PACKAGE, "pref_main_suppress_search_dialogs", FALSE);
|
||||
|
||||
if (!g_key_file_has_key(config, "search", "pref_search_always_wrap", NULL))
|
||||
g_key_file_set_boolean(config, "search", "pref_search_always_wrap", suppress_search_dialogs);
|
||||
|
||||
if (!g_key_file_has_key(config, "search", "pref_search_hide_find_dialog", NULL))
|
||||
g_key_file_set_boolean(config, "search", "pref_search_hide_find_dialog", suppress_search_dialogs);
|
||||
}
|
||||
|
||||
/* read stash prefs */
|
||||
settings_action(config, SETTING_READ);
|
||||
|
||||
|
||||
@ -189,6 +189,10 @@ static void init_prefs(void)
|
||||
|
||||
group = stash_group_new("search");
|
||||
configuration_add_pref_group(group, TRUE);
|
||||
stash_group_add_toggle_button(group, &search_prefs.always_wrap,
|
||||
"pref_search_hide_find_dialog", FALSE, "check_always_wrap_search");
|
||||
stash_group_add_toggle_button(group, &search_prefs.hide_find_dialog,
|
||||
"pref_search_always_wrap", FALSE, "check_hide_find_dialog");
|
||||
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);
|
||||
@ -1253,9 +1257,7 @@ on_find_dialog_response(GtkDialog *dialog, gint response, gpointer user_data)
|
||||
gint result = document_find_text(doc, search_data.text, search_data.original_text, search_data.flags,
|
||||
(response == GEANY_RESPONSE_FIND_PREVIOUS), TRUE, GTK_WIDGET(find_dlg.dialog));
|
||||
ui_set_search_entry_background(find_dlg.entry, (result > -1));
|
||||
check_close = FALSE;
|
||||
if (search_prefs.suppress_dialogs)
|
||||
check_close = TRUE;
|
||||
check_close = search_prefs.hide_find_dialog;
|
||||
break;
|
||||
}
|
||||
case GEANY_RESPONSE_FIND_IN_FILE:
|
||||
|
||||
@ -55,9 +55,10 @@ enum GeanyFindSelOptions
|
||||
/** Search preferences */
|
||||
typedef struct GeanySearchPrefs
|
||||
{
|
||||
gboolean suppress_dialogs;
|
||||
gboolean always_wrap; /* don't ask whether to wrap search */
|
||||
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 hide_find_dialog; /* hide the find dialog on next or previous */
|
||||
enum GeanyFindSelOptions find_selection_type;
|
||||
}
|
||||
GeanySearchPrefs;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user