Commit e9cda5b1 authored by Naba Kumar's avatar Naba Kumar

symbol-db: Show empty result for emty search entry text. Restore ctrl+l to search shortcut.

parent 147c7a08
......@@ -299,18 +299,11 @@ on_goto_file_tag_decl_activate (GtkAction *action, SymbolDBPlugin *sdb_plugin)
static void
on_find_symbol (GtkAction *action, SymbolDBPlugin *sdb_plugin)
{
#if 0
DEBUG_PRINT ("on_find_symbol (GtkAction *action, gpointer user_data)");
GtkEntry * entry;
anjuta_shell_present_widget(ANJUTA_PLUGIN(sdb_plugin)->shell,
sdb_plugin->dbv_main, NULL);
entry = symbol_db_view_search_get_entry (
SYMBOL_DB_VIEW_SEARCH (sdb_plugin->dbv_view_tree_search));
entry = NULL;
gtk_notebook_set_current_page (GTK_NOTEBOOK(sdb_plugin->dbv_notebook), 2);
gtk_widget_grab_focus (GTK_WIDGET (entry));
#endif
gtk_widget_grab_focus (GTK_WIDGET (sdb_plugin->search_entry));
}
static GtkActionEntry actions[] =
......@@ -2133,10 +2126,11 @@ symbol_db_activate (AnjutaPlugin *plugin)
gtk_notebook_append_page (GTK_NOTEBOOK (sdb_plugin->dbv_notebook),
view, gtk_label_new (_("Global" )));
/* Global symbols */
/* Search symbols */
view = symbol_db_view_new (SYMBOL_DB_VIEW_SEARCH,
sdb_plugin->sdbe_project,
sdb_plugin);
sdb_plugin->search_entry = symbol_db_view_get_search_entry (view);
gtk_notebook_append_page (GTK_NOTEBOOK (sdb_plugin->dbv_notebook),
view, gtk_label_new (_("Search" )));
......
......@@ -111,6 +111,7 @@ struct _SymbolDBPlugin {
GtkWidget *progress_bar_system; /* symbol db progress bar - system (globals) */
GtkTreeModel *file_model; /* File symbols model */
GtkWidget *search_entry; /* The search entry box */
GtkWidget *pref_tree_view; /* Preferences treeview */
/* current editor */
......
......@@ -95,6 +95,9 @@ sdb_model_search_get_children (SymbolDBModel *model, gint tree_level,
if (tree_level > 0)
return NULL; /* It's a flat list */
if (priv->search_pattern == NULL || strlen (priv->search_pattern) == 2)
return NULL;
g_object_get (model, "symbol-db-engine", &dbe, NULL);
......
......@@ -217,7 +217,14 @@ symbol_db_view_new (SymbolViewType view_type,
gtk_widget_show (vbox);
gtk_box_pack_start (GTK_BOX (vbox), entry, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), sw, TRUE, TRUE, 0);
g_object_set_data (G_OBJECT (vbox), "search_entry", entry);
return vbox;
}
return sw;
}
GtkWidget*
symbol_db_view_get_search_entry (GtkWidget *search_view)
{
return g_object_get_data (G_OBJECT (search_view), "search_entry");
}
......@@ -34,6 +34,8 @@ typedef enum {
GtkWidget* symbol_db_view_new (SymbolViewType view_type,
SymbolDBEngine *dbe, SymbolDBPlugin *plugin);
GtkWidget* symbol_db_view_get_search_entry (GtkWidget *search_view);
G_END_DECLS
#endif /* _SYMBOL_DB_VIEWS_H_ */
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