Commit 4230a82b authored by Massimo Cora's avatar Massimo Cora

fixed #357275 – allow user to jump directly to Symbols / Search

	* plugins/symbol-db/anjuta-symbol-db-plugin.ui:
	* plugins/symbol-db/plugin.c (on_find_symbol),
	(symbol_db_activate):
	* plugins/symbol-db/plugin.h:
	* plugins/symbol-db/symbol-db-view-search.c (sdb_view_search_init),
	(symbol_db_view_search_get_entry):
	* plugins/symbol-db/symbol-db-view-search.h:
	fixed #357275 – allow user to jump directly to Symbols / Search

svn path=/trunk/; revision=4645
parent 22b16797
2009-01-28 Massimo Cora' <mcora@svn.gnome.org>
* plugins/symbol-db/anjuta-symbol-db-plugin.ui:
* plugins/symbol-db/plugin.c (on_find_symbol),
(symbol_db_activate):
* plugins/symbol-db/plugin.h:
* plugins/symbol-db/symbol-db-view-search.c (sdb_view_search_init),
(symbol_db_view_search_get_entry):
* plugins/symbol-db/symbol-db-view-search.h:
fixed #357275 – allow user to jump directly to Symbols / Search
2009-01-28 Sébastien Granjoux <seb.sfo@free.fr>
* plugins/scintilla/text_editor.h,
<!--*- xml -*-->
<ui>
<menubar name="MenuMain">
<menu name="MenuEdit" action="ActionMenuEdit">
<placeholder name="PlaceholderEditMenus">
<placeholder name="PlaceholderEditSearchMenus">
<menu name="Search" action="ActionMenuEditSearch">
<menuitem name="FindSymbol" action="ActionEditSearchFindSymbol"/>
</menu>
</placeholder>
</placeholder>
</menu>
</menubar>
<popup name="PopupDocumentManager">
<menu name="Goto" action="ActionMenuGoto">
<menuitem name="TagDecl" action="ActionSymbolDBGotoDecl" />
......
......@@ -23,6 +23,7 @@
*/
#include <config.h>
#include <gio/gio.h>
#include <libanjuta/anjuta-shell.h>
......@@ -269,6 +270,18 @@ on_goto_file_tag_decl_activate (GtkAction *action, SymbolDBPlugin *sdb_plugin)
}
}
static void
on_find_symbol (GtkAction *action, SymbolDBPlugin *sdb_plugin)
{
DEBUG_PRINT ("on_find_symbol (GtkAction *action, gpointer user_data)");
GtkEntry * entry;
entry = symbol_db_view_search_get_entry (
SYMBOL_DB_VIEW_SEARCH (sdb_plugin->dbv_view_tree_search));
gtk_notebook_set_current_page (sdb_plugin->dbv_notebook, 2);
gtk_widget_grab_focus (GTK_WIDGET (entry));
}
static GtkActionEntry actions[] =
{
{ "ActionMenuGoto", NULL, N_("_Goto"), NULL, NULL, NULL},
......@@ -290,6 +303,12 @@ static GtkActionEntry actions[] =
}
};
static GtkActionEntry actions_search[] = {
{ "ActionEditSearchFindSymbol", GTK_STOCK_FIND, N_("_Find Symbol"),
"<control>l", N_("Find Symbol"),
G_CALLBACK (on_find_symbol)}
};
static void
enable_view_signals (SymbolDBPlugin *sdb_plugin, gboolean enable, gboolean force)
{
......@@ -2256,11 +2275,19 @@ symbol_db_activate (AnjutaPlugin *plugin)
sdb_plugin->popup_action_group =
anjuta_ui_add_action_group_entries (sdb_plugin->ui,
"ActionGroupPopupSymbolDB",
_("Symbol db popup actions"),
_("SymbolDb popup actions"),
actions,
G_N_ELEMENTS (actions),
GETTEXT_PACKAGE, FALSE, plugin);
sdb_plugin->menu_action_group =
anjuta_ui_add_action_group_entries (sdb_plugin->ui,
"ActionGroupEditSearchSymbolDB",
_("SymbolDb menu actions"),
actions_search,
G_N_ELEMENTS (actions_search),
GETTEXT_PACKAGE, FALSE, plugin);
/* Add UI */
sdb_plugin->merge_id =
anjuta_ui_merge (sdb_plugin->ui, UI_FILE);
......
......@@ -61,6 +61,7 @@ struct _SymbolDBPlugin {
/* ui merge */
GtkActionGroup *popup_action_group;
GtkActionGroup *menu_action_group;
gint merge_id;
/* editor monitor */
......
......@@ -445,24 +445,19 @@ sdb_view_search_sort_iter_compare_func (GtkTreeModel *model, GtkTreeIter *a,
static void
sdb_view_search_init (SymbolDBViewSearch * search)
{
SymbolDBViewSearchPriv *priv;
GtkTreeViewColumn *column;
GtkCellRenderer *renderer;
GtkWidget *frame, *list_sw;
/* allocate space for a SymbolDBViewSearchPriv class. */
priv = g_new0 (SymbolDBViewSearchPriv, 1);
search->priv = priv;
priv->idle_complete = 0;
priv->idle_filter = 0;
priv->idle_filter = 0;
priv->completion = g_completion_new (NULL);
priv->hitlist = gtk_tree_view_new ();
priv->model = GTK_TREE_MODEL (gtk_tree_store_new (COLUMN_MAX, GDK_TYPE_PIXBUF,
G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INT, G_TYPE_STRING, G_TYPE_INT));
......@@ -699,3 +694,13 @@ symbol_db_view_search_new (SymbolDBEngine *dbe)
return GTK_WIDGET (search);
}
GtkEntry *
symbol_db_view_search_get_entry (SymbolDBViewSearch *search)
{
SymbolDBViewSearchPriv *priv;
priv = search->priv;
g_return_val_if_fail (search != NULL, NULL);
return GTK_ENTRY (priv->entry);
}
......@@ -67,6 +67,8 @@ symbol_db_view_search_clear (SymbolDBViewSearch *search);
GtkWidget *
symbol_db_view_search_new (SymbolDBEngine *dbe);
GtkEntry *
symbol_db_view_search_get_entry (SymbolDBViewSearch *search);
G_END_DECLS
......
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