[gedit/wip/search] Regex search, finally
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit/wip/search] Regex search, finally
- Date: Wed, 14 Aug 2013 18:01:15 +0000 (UTC)
commit dec9283840e8b8a700e48c0ea46e0bea26bf5811
Author: Sébastien Wilmet <swilmet gnome org>
Date: Wed Aug 14 19:53:25 2013 +0200
Regex search, finally
Regex errors are not reported, but it's usable.
gedit/gedit-replace-dialog.c | 6 ++++++
gedit/gedit-replace-dialog.ui | 21 +++++++++++++++++++--
2 files changed, 25 insertions(+), 2 deletions(-)
---
diff --git a/gedit/gedit-replace-dialog.c b/gedit/gedit-replace-dialog.c
index 2bb9c76..c454fa4 100644
--- a/gedit/gedit-replace-dialog.c
+++ b/gedit/gedit-replace-dialog.c
@@ -46,6 +46,7 @@ struct _GeditReplaceDialogPrivate
GtkWidget *replace_text_entry;
GtkWidget *match_case_checkbutton;
GtkWidget *entire_word_checkbutton;
+ GtkWidget *regex_checkbutton;
GtkWidget *backwards_checkbutton;
GtkWidget *wrap_around_checkbutton;
@@ -144,6 +145,7 @@ gedit_replace_dialog_class_init (GeditReplaceDialogClass *klass)
gtk_widget_class_bind_template_child_private (widget_class, GeditReplaceDialog, replace_label);
gtk_widget_class_bind_template_child_private (widget_class, GeditReplaceDialog,
match_case_checkbutton);
gtk_widget_class_bind_template_child_private (widget_class, GeditReplaceDialog,
entire_word_checkbutton);
+ gtk_widget_class_bind_template_child_private (widget_class, GeditReplaceDialog, regex_checkbutton);
gtk_widget_class_bind_template_child_private (widget_class, GeditReplaceDialog,
backwards_checkbutton);
gtk_widget_class_bind_template_child_private (widget_class, GeditReplaceDialog,
wrap_around_checkbutton);
}
@@ -327,6 +329,10 @@ gedit_replace_dialog_init (GeditReplaceDialog *dlg)
dlg->priv->search_settings, "at-word-boundaries",
G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
+ g_object_bind_property (dlg->priv->regex_checkbutton, "active",
+ dlg->priv->search_settings, "regex-enabled",
+ G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
+
g_object_bind_property (dlg->priv->wrap_around_checkbutton, "active",
dlg->priv->search_settings, "wrap-around",
G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
diff --git a/gedit/gedit-replace-dialog.ui b/gedit/gedit-replace-dialog.ui
index 3ab7da1..9b900d3 100644
--- a/gedit/gedit-replace-dialog.ui
+++ b/gedit/gedit-replace-dialog.ui
@@ -182,6 +182,23 @@
</packing>
</child>
<child>
+ <object class="GtkCheckButton" id="regex_checkbutton">
+ <property name="label" translatable="yes">Match as _regular expression</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="use_underline">True</property>
+ <property name="xalign">0</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
<object class="GtkCheckButton" id="backwards_checkbutton">
<property name="label" translatable="yes">Search _backwards</property>
<property name="use_action_appearance">False</property>
@@ -195,7 +212,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
- <property name="position">2</property>
+ <property name="position">3</property>
</packing>
</child>
<child>
@@ -213,7 +230,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
- <property name="position">3</property>
+ <property name="position">4</property>
</packing>
</child>
</object>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]