[nautilus-actions] nact_iactions_list_select_row(): Fix keyboard focus on new items
- From: Pierre Wieser <pwieser src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [nautilus-actions] nact_iactions_list_select_row(): Fix keyboard focus on new items
- Date: Sat, 26 Sep 2009 22:48:05 +0000 (UTC)
commit aee85135bcda578cb13ac764d3d565d133a6810d
Author: Pierre Wieser <pwieser trychlos org>
Date: Sat Sep 19 19:14:25 2009 +0200
nact_iactions_list_select_row(): Fix keyboard focus on new items
ChangeLog | 1 +
src/nact/nact-iactions-list.c | 27 ++++++++++++++++++++++-----
2 files changed, 23 insertions(+), 5 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index b9d7d67..3e609da 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -29,6 +29,7 @@
nact_iactions_list_has_exportable(): New function.
nact_iactions_list_is_filling_list(): Removed function.
toggle_collapse(): Activate shortcuts on menus.
+ nact_iactions_list_select_row(): Fix keyboard focus on new items.
* src/nact/nact-iaction-tab.c:
* src/nact/nact-icommand-tab.c:
diff --git a/src/nact/nact-iactions-list.c b/src/nact/nact-iactions-list.c
index e692a21..dac3505 100644
--- a/src/nact/nact-iactions-list.c
+++ b/src/nact/nact-iactions-list.c
@@ -121,6 +121,7 @@ static void on_iactions_list_item_updated( NactIActionsList *instance, N
static void on_iactions_list_item_updated_treeview( NactIActionsList *instance, NAObject *object );
static void on_iactions_list_selection_changed( NactIActionsList *instance, GSList *selected_items );
static void select_first_row( NactIActionsList *instance );
+static void select_row( GtkTreeView *treeview, GtkTreeModel *model, GtkTreeIter *iter );
static void set_selection_changed_mode( NactIActionsList *instance, gboolean authorized );
static void toggle_collapse( NactIActionsList *instance );
static gboolean toggle_collapse_iter( NactIActionsList *instance, GtkTreeView *treeview, GtkTreeModel *model, GtkTreeIter *iter, NAObject *object, gpointer user_data );
@@ -670,7 +671,6 @@ nact_iactions_list_insert_items( NactIActionsList *instance, GList *items )
na_object_check_edition_status( it->data );
}
- gtk_tree_selection_unselect_all( selection );
nact_iactions_list_select_row( instance, last_path );
/*gtk_tree_path_free( last_path );*/
@@ -820,22 +820,29 @@ nact_iactions_list_select_row( NactIActionsList *instance, GtkTreePath *path )
GtkTreeIter iter;
treeview = get_actions_list_treeview( instance );
+
selection = gtk_tree_view_get_selection( treeview );
+ gtk_tree_selection_unselect_all( selection );
+
model = gtk_tree_view_get_model( treeview );
if( gtk_tree_model_get_iter( model, &iter, path )){
- gtk_tree_selection_select_iter( selection, &iter );
+ /*gtk_tree_selection_select_iter( selection, &iter );*/
+ select_row( treeview, model, &iter );
} else {
gtk_tree_path_next( path );
if( gtk_tree_model_get_iter( model, &iter, path )){
- gtk_tree_selection_select_iter( selection, &iter );
+ /*gtk_tree_selection_select_iter( selection, &iter );*/
+ select_row( treeview, model, &iter );
} else if( gtk_tree_path_prev( path ) && gtk_tree_model_get_iter( model, &iter, path )){
- gtk_tree_selection_select_iter( selection, &iter );
+ /*gtk_tree_selection_select_iter( selection, &iter );*/
+ select_row( treeview, model, &iter );
} else if( gtk_tree_path_up( path ) && gtk_tree_model_get_iter( model, &iter, path )){
- gtk_tree_selection_select_iter( selection, &iter );
+ /*gtk_tree_selection_select_iter( selection, &iter );*/
+ select_row( treeview, model, &iter );
}
}
@@ -1345,6 +1352,16 @@ select_first_row( NactIActionsList *instance )
}
static void
+select_row( GtkTreeView *treeview, GtkTreeModel *model, GtkTreeIter *iter )
+{
+ GtkTreePath *path;
+
+ path = gtk_tree_model_get_path( model, iter );
+ gtk_tree_view_set_cursor( treeview, path, NULL, FALSE );
+ gtk_tree_path_free( path );
+}
+
+static void
set_selection_changed_mode( NactIActionsList *instance, gboolean authorized )
{
g_object_set_data( G_OBJECT( instance ), SELECTION_CHANGED_SIGNAL_MODE, GINT_TO_POINTER( authorized ));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]