anjuta r4497 - in trunk: . plugins/document-manager plugins/search
- From: jhs svn gnome org
- To: svn-commits-list gnome org
- Subject: anjuta r4497 - in trunk: . plugins/document-manager plugins/search
- Date: Sun, 28 Dec 2008 10:03:53 +0000 (UTC)
Author: jhs
Date: Sun Dec 28 10:03:52 2008
New Revision: 4497
URL: http://svn.gnome.org/viewvc/anjuta?rev=4497&view=rev
Log:
2008-12-28 Adam Dingle <adam medovina org>
* plugins/document-manager/anjuta-document-manager.ui:
* plugins/search/Makefile.am:
* plugins/search/anjuta-search.ui:
* plugins/search/plugin.c (activate_plugin):
Fixed #565278 â remove Next Occurrence and Previous Occurrence commands
Removed:
trunk/plugins/search/anjuta-go-match-next-16.png
trunk/plugins/search/anjuta-go-match-next-24.png
trunk/plugins/search/anjuta-go-match-next.svg
trunk/plugins/search/anjuta-go-match-prev-16.png
trunk/plugins/search/anjuta-go-match-prev-24.png
trunk/plugins/search/anjuta-go-match-prev.svg
Modified:
trunk/ChangeLog
trunk/plugins/document-manager/anjuta-document-manager.ui
trunk/plugins/search/Makefile.am
trunk/plugins/search/anjuta-search.ui
trunk/plugins/search/plugin.c
Modified: trunk/plugins/document-manager/anjuta-document-manager.ui
==============================================================================
--- trunk/plugins/document-manager/anjuta-document-manager.ui (original)
+++ trunk/plugins/document-manager/anjuta-document-manager.ui Sun Dec 28 10:03:52 2008
@@ -93,8 +93,6 @@
<separator name="separator15"/>
<placeholder name="PlaceholderGotoMenus"/>
<separator />
- <placeholder name="PlaceholderGotoOccurence" />
- <separator />
<placeholder name="PlaceholderGotoMessages" />
<separator />
<placeholder name="PlaceholderGotoSymbol" />
Modified: trunk/plugins/search/Makefile.am
==============================================================================
--- trunk/plugins/search/Makefile.am (original)
+++ trunk/plugins/search/Makefile.am Sun Dec 28 10:03:52 2008
@@ -6,11 +6,7 @@
search_pixmapsdir = $(anjuta_image_dir)
search_pixmaps_DATA = \
anjuta-search-plugin.svg \
- anjuta-search-plugin-48.png \
- anjuta-go-match-next-16.png \
- anjuta-go-match-next-24.png \
- anjuta-go-match-prev-16.png \
- anjuta-go-match-prev-24.png
+ anjuta-search-plugin-48.png
plugin_in_files = anjuta-search.plugin.in
%.plugin: %.plugin.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache
Modified: trunk/plugins/search/anjuta-search.ui
==============================================================================
--- trunk/plugins/search/anjuta-search.ui (original)
+++ trunk/plugins/search/anjuta-search.ui Sun Dec 28 10:03:52 2008
@@ -15,13 +15,5 @@
</placeholder>
</placeholder>
</menu>
- <menu name="MenuView" action="ActionMenuView">
- <menu name="Goto" action="ActionMenuGoto">
- <placeholder name="PlaceholderGotoOccurence">
- <menuitem name="PreviousOccurance" action="ActionEditGotoOccurancePrev" />
- <menuitem name="NextOccurance" action="ActionEditGotoOccuranceNext" />
- </placeholder>
- </menu>
- </menu>
</menubar>
</ui>
Modified: trunk/plugins/search/plugin.c
==============================================================================
--- trunk/plugins/search/plugin.c (original)
+++ trunk/plugins/search/plugin.c Sun Dec 28 10:03:52 2008
@@ -32,58 +32,6 @@
#define UI_FILE PACKAGE_DATA_DIR"/ui/anjuta-search.ui"
#define ICON_FILE "anjuta-search-plugin-48.png"
-#define ANJUTA_PIXMAP_MATCH_NEXT "anjuta-go-match-next"
-#define ANJUTA_PIXMAP_MATCH_PREV "anjuta-go-match-prev"
-#define ANJUTA_STOCK_MATCH_NEXT "anjuta-match-next"
-#define ANJUTA_STOCK_MATCH_PREV "anjuta-match-prev"
-
-/* Find next occurence of expression in Editor
- Caching of FileBuffer might be useful here to improve performance
- Returns: TRUE = found, FALSE = not found
-*/
-
-static gboolean find_incremental(IAnjutaEditor* te, gchar* expression,
- SearchDirection dir)
-{
- FileBuffer* fb = file_buffer_new_from_te (te);
- SearchExpression* se = g_new0(SearchExpression, 1);
- MatchInfo* info;
- gboolean ret;
-
- se->search_str = expression;
- se->regex = FALSE;
- se->greedy = FALSE;
- se->match_case = FALSE;
- se->whole_word = FALSE;
- se->whole_line = FALSE;
- se->word_start = FALSE;
- se->no_limit = FALSE;
- se->actions_max = 1;
- se->regex_info = NULL;
-
- info = get_next_match(fb, dir, se);
-
- if (info != NULL)
- {
- IAnjutaIterable *start, *end;
- start = ianjuta_editor_get_position_from_offset (te, info->pos, NULL);
- end = ianjuta_editor_get_position_from_offset (te, info->pos + info->len, NULL);
- ianjuta_editor_selection_set (IANJUTA_EDITOR_SELECTION (te),
- start, end, NULL);
- g_object_unref (start);
- g_object_unref (end);
- ret = TRUE;
- }
- else
- ret = FALSE;
-
- match_info_free(info);
- file_buffer_free(fb);
- g_free(se);
-
- return ret;
-}
-
static void
on_find1_activate (GtkAction * action, gpointer user_data)
{
@@ -115,78 +63,6 @@
search_replace_previous();
}
-static void
-on_prev_occur(GtkAction * action, gpointer user_data)
-{
- IAnjutaEditor* te;
- IAnjutaDocumentManager *docman;
- IAnjutaDocument* doc;
- SearchPlugin *plugin;
- gint return_;
- gchar *buffer = NULL;
-
- plugin = ANJUTA_PLUGIN_SEARCH (user_data);
- docman = anjuta_shell_get_interface (ANJUTA_PLUGIN (plugin)->shell,
- IAnjutaDocumentManager, NULL);
- doc = ianjuta_document_manager_get_current_document(docman, NULL);
- te = IANJUTA_IS_EDITOR(doc) ? IANJUTA_EDITOR(doc) : NULL;
- if(!te) return;
- if ((buffer = ianjuta_editor_selection_get (IANJUTA_EDITOR_SELECTION (te), NULL)))
- {
- g_strstrip(buffer);
- if ('\0' == *buffer)
- {
- g_free(buffer);
- buffer = NULL;
- }
- }
- if (NULL == buffer)
- {
- buffer = ianjuta_editor_get_current_word(te, NULL);
- if (!buffer)
- return;
- }
- return_= find_incremental(te, buffer, SD_BACKWARD);
-
- g_free(buffer);
-}
-
-static void
-on_next_occur(GtkAction * action, gpointer user_data)
-{
- IAnjutaEditor* te;
- IAnjutaDocumentManager *docman;
- IAnjutaDocument* doc;
- SearchPlugin *plugin;
- gint return_;
- gchar *buffer = NULL;
-
- plugin = ANJUTA_PLUGIN_SEARCH (user_data);
- docman = anjuta_shell_get_interface (ANJUTA_PLUGIN (plugin)->shell,
- IAnjutaDocumentManager, NULL);
- doc = ianjuta_document_manager_get_current_document(docman, NULL);
- te = IANJUTA_IS_EDITOR(doc) ? IANJUTA_EDITOR(doc) : NULL;
- if(!te) return;
- if ((buffer = ianjuta_editor_selection_get (IANJUTA_EDITOR_SELECTION (te), NULL)))
- {
- g_strstrip(buffer);
- if ('\0' == *buffer)
- {
- g_free(buffer);
- buffer = NULL;
- }
- }
- if (NULL == buffer)
- {
- buffer = ianjuta_editor_get_current_word(te, NULL);
- if (!buffer)
- return;
- }
- return_= find_incremental(te, buffer, SD_FORWARD);
-
- g_free(buffer);
-}
-
static GtkActionEntry actions_search[] = {
{ "ActionMenuEditSearch", NULL, N_("_Search"), NULL, NULL, NULL},
{ "ActionEditSearchFind", GTK_STOCK_FIND, N_("_Find..."), "<control><alt>f",
@@ -209,14 +85,6 @@
{ "ActionEditSearchInFiles", NULL, N_("Fin_d in Files..."), NULL,
N_("Search for a string in multiple files or directories"),
G_CALLBACK (on_find_in_files1_activate)},
- { "ActionEditGotoOccuranceNext", ANJUTA_STOCK_MATCH_NEXT,
- N_("Ne_xt Occurrence"), NULL,
- N_("Find the next occurrence of current word"),
- G_CALLBACK (on_next_occur)},
- { "ActionEditGotoOccurancePrev",ANJUTA_STOCK_MATCH_PREV,
- N_("Pre_vious Occurrence"), NULL,
- N_("Find the previous occurrence of current word"),
- G_CALLBACK (on_prev_occur)},
};
gpointer parent_class;
@@ -224,22 +92,11 @@
static gboolean
activate_plugin (AnjutaPlugin *plugin)
{
- static gboolean init = FALSE;
AnjutaUI *ui;
SearchPlugin* splugin = ANJUTA_PLUGIN_SEARCH (plugin);
IAnjutaDocumentManager* docman = anjuta_shell_get_interface(ANJUTA_PLUGIN(plugin)->shell,
IAnjutaDocumentManager, NULL);
-
- if (!init)
- {
- BEGIN_REGISTER_ICON (plugin);
- REGISTER_ICON_FULL (ANJUTA_PIXMAP_MATCH_NEXT, ANJUTA_STOCK_MATCH_NEXT);
- REGISTER_ICON_FULL (ANJUTA_PIXMAP_MATCH_PREV, ANJUTA_STOCK_MATCH_PREV);
- END_REGISTER_ICON;
- init = TRUE;
- }
-
ui = anjuta_shell_get_ui (plugin->shell, NULL);
anjuta_ui_add_action_group_entries (ui, "ActionGroupSearch",
_("Searching..."),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]