Commit d7ec47dc authored by Paolo Borelli's avatar Paolo Borelli

clear search highlight menu item

parent 9486599b
2006-02-24 Steve Frécinaux <steve@istique.net>
* gedit/gedit-ui.xml:
* gedit/gedit-ui.h:
* gedit/gedit-commands.h:
* gedit/gedit-commands-search.c:
Add a new menu entry: Search -> Clear highlight
2006-02-24 Paolo Borelli <pborelli@katamail.com>
* gedit/gedit-ui.h: s/Panel/Pane as per ui review.
......
......@@ -709,6 +709,20 @@ gedit_cmd_search_find_prev (GtkAction *action,
do_find_again (window, TRUE);
}
void
gedit_cmd_search_clear_highlight (GtkAction *action,
GeditWindow *window)
{
GtkWidget *doc;
gedit_debug (DEBUG_COMMANDS);
doc = gedit_window_get_active_document (window);
gedit_document_set_search_text (GEDIT_DOCUMENT (doc),
"",
GEDIT_SEARCH_DONT_SET_FLAGS);
}
void
gedit_cmd_search_goto_line (GtkAction *action,
GeditWindow *window)
......
......@@ -111,6 +111,8 @@ void gedit_cmd_search_find_prev (GtkAction *action,
GeditWindow *window);
void gedit_cmd_search_replace (GtkAction *action,
GeditWindow *window);
void gedit_cmd_search_clear_highlight (GtkAction *action,
GeditWindow *window);
void gedit_cmd_search_goto_line (GtkAction *action,
GeditWindow *window);
......
......@@ -117,6 +117,8 @@ static const GtkActionEntry gedit_menu_entries[] =
N_("Search backwards for the same text"), G_CALLBACK (gedit_cmd_search_find_prev) },
{ "SearchReplace", GTK_STOCK_FIND_AND_REPLACE, N_("_Replace..."), "<control>H",
N_("Search for and replace text"), G_CALLBACK (gedit_cmd_search_replace) },
{ "SearchClearHighlight", NULL, N_("_Clear Highlight"), "<shift><control>K",
N_("Clear highlighting of search matches"), G_CALLBACK (gedit_cmd_search_clear_highlight) },
{ "SearchGoToLine", GTK_STOCK_JUMP_TO, N_("Go to _Line..."), "<control>I",
N_("Go to a specific line"), G_CALLBACK (gedit_cmd_search_goto_line) },
......
......@@ -93,6 +93,7 @@
<menuitem name="SearchFindNextMenu" action="SearchFindNext"/>
<menuitem name="SearchFindPreviousMenu" action="SearchFindPrevious"/>
<menuitem name="SearchReplaceMenu" action="SearchReplace"/>
<menuitem name="SearchClearHighlight" action="SearchClearHighlight"/>
<separator/>
<menuitem name="SearchGoToLineMenu" action="SearchGoToLine"/>
</menu>
......
......@@ -560,6 +560,11 @@ set_sensitivity_according_to_tab (GeditWindow *window,
"SearchFindPrevious");
gtk_action_set_sensitive (action, state_normal && b);
action = gtk_action_group_get_action (window->priv->action_group,
"SearchClearHighlight");
gtk_action_set_sensitive (action, state_normal && b);
action = gtk_action_group_get_action (window->priv->action_group,
"SearchGoToLine");
gtk_action_set_sensitive (action, state_normal);
......@@ -1973,6 +1978,10 @@ can_search_again (GeditDocument *doc,
action = gtk_action_group_get_action (window->priv->action_group,
"SearchFindPrevious");
gtk_action_set_sensitive (action, sensitive);
action = gtk_action_group_get_action (window->priv->action_group,
"SearchClearHighlight");
gtk_action_set_sensitive (action, sensitive);
}
static void
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment