[nautilus-actions] Force the treeview to grab the focus at startup



commit 120043ef2e52f76182cd1bfad79d48d21f08fe89
Author: Pierre Wieser <pwieser trychlos org>
Date:   Fri Oct 9 14:34:59 2009 +0200

    Force the treeview to grab the focus at startup

 ChangeLog                     |    1 +
 src/nact/nact-iactions-list.c |    4 ++++
 src/nact/nact-main-window.c   |    6 ------
 3 files changed, 5 insertions(+), 6 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 0c715a1..feb3d31 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -10,6 +10,7 @@
 	* src/nact/nact-iactions-list.c:
 	* src/nact/nact-iactions-list.h (nact_iactions_list_brief_tree_dump):
 	Briefly dump the tree store content.
+	(nact_iactions_list_runtime_init_toplevel): Grab the focus at start.
 
 	* src/nact/nact-main-menubar.c (nact_main_menubar_runtime_init):
 	Display a Maintainer menu when in maintainer mode.
diff --git a/src/nact/nact-iactions-list.c b/src/nact/nact-iactions-list.c
index 3bcbcba..8492dd1 100644
--- a/src/nact/nact-iactions-list.c
+++ b/src/nact/nact-iactions-list.c
@@ -459,6 +459,10 @@ nact_iactions_list_runtime_init_toplevel( NactIActionsList *instance, GList *ite
 		 * so that callbacks are triggered at last
 		 */
 		nact_iactions_list_fill( instance, items );
+
+		/* force the treeview to have the focus at start
+		 */
+		gtk_widget_grab_focus( GTK_WIDGET( treeview ));
 	}
 }
 
diff --git a/src/nact/nact-main-window.c b/src/nact/nact-main-window.c
index b1c8b10..17bd3ff 100644
--- a/src/nact/nact-main-window.c
+++ b/src/nact/nact-main-window.c
@@ -906,12 +906,6 @@ on_base_runtime_init_toplevel( NactMainWindow *window, gpointer user_data )
 		/* fill the IActionsList at last so that all signals are connected
 		 */
 		nact_iactions_list_runtime_init_toplevel( NACT_IACTIONS_LIST( window ), tree );
-
-		/* forces a no-selection when the list is initially empty
-		 */
-		/*if( !g_slist_length( wnd->private->actions )){
-			set_current_action( NACT_MAIN_WINDOW( window ), NULL );
-		}*/
 	}
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]