Make escape sequence parsing in search a GUI checkbox option

This commit is contained in:
bl0ckeduser
2013-09-22 11:29:49 -04:00
parent 9b7c40cb73
commit 24dc1853b7
6 changed files with 111 additions and 10 deletions

View File

@@ -70,6 +70,7 @@ struct _PlumaSearchDialogPrivate
GtkWidget *entire_word_checkbutton;
GtkWidget *backwards_checkbutton;
GtkWidget *wrap_around_checkbutton;
GtkWidget *parse_escapes_checkbutton;
GtkWidget *find_button;
GtkWidget *replace_button;
GtkWidget *replace_all_button;
@@ -357,6 +358,7 @@ pluma_search_dialog_init (PlumaSearchDialog *dlg)
"entire_word_checkbutton", &dlg->priv->entire_word_checkbutton,
"search_backwards_checkbutton", &dlg->priv->backwards_checkbutton,
"wrap_around_checkbutton", &dlg->priv->wrap_around_checkbutton,
"parse_escapes_checkbutton", &dlg->priv->parse_escapes_checkbutton,
NULL);
g_free (file);
@@ -632,3 +634,21 @@ pluma_search_dialog_get_wrap_around (PlumaSearchDialog *dialog)
return gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->priv->wrap_around_checkbutton));
}
void
pluma_search_dialog_set_parse_escapes (PlumaSearchDialog *dialog,
gboolean parse_escapes)
{
g_return_if_fail (PLUMA_IS_SEARCH_DIALOG (dialog));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->priv->parse_escapes_checkbutton),
parse_escapes);
}
gboolean
pluma_search_dialog_get_parse_escapes (PlumaSearchDialog *dialog)
{
g_return_val_if_fail (PLUMA_IS_SEARCH_DIALOG (dialog), FALSE);
return gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->priv->parse_escapes_checkbutton));
}

View File

@@ -123,6 +123,11 @@ void pluma_search_dialog_set_wrap_around (PlumaSearchDialog *dialog,
gboolean wrap_around);
gboolean pluma_search_dialog_get_wrap_around (PlumaSearchDialog *dialog);
void pluma_search_dialog_set_parse_escapes (PlumaSearchDialog *dialog,
gboolean parse_escapes);
gboolean pluma_search_dialog_get_parse_escapes (PlumaSearchDialog *dialog);
G_END_DECLS
#endif /* __PLUMA_SEARCH_DIALOG_H__ */

View File

@@ -229,6 +229,24 @@
<property name="fill">False</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="parse_escapes_checkbutton">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">_Parse escape sequences (e.g. \n)</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<property name="active">True</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
</object>
<packing>
<property name="padding">0</property>