2004-09-14 Matthias Clasen <mclasen@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_focus_to_cursor): Set the cursor
to the first selected row instead of always to the first row if there
is no cursor. (#143270, Jean Bréfort)
* tests/testfilechooser.c (main): Fix a few typos.
+2004-09-14 Matthias Clasen <mclasen@redhat.com>
+
+ * gtk/gtktreeview.c (gtk_tree_view_focus_to_cursor): Set the cursor
+ to the first selected row instead of always to the first row if there
+ is no cursor. (#143270, Jean Bréfort)
+
+ * tests/testfilechooser.c (main): Fix a few typos.
+
2004-09-13 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkexpander.c:
2004-09-13 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkexpander.c:
+2004-09-14 Matthias Clasen <mclasen@redhat.com>
+
+ * gtk/gtktreeview.c (gtk_tree_view_focus_to_cursor): Set the cursor
+ to the first selected row instead of always to the first row if there
+ is no cursor. (#143270, Jean Bréfort)
+
+ * tests/testfilechooser.c (main): Fix a few typos.
+
2004-09-13 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkexpander.c:
2004-09-13 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkexpander.c:
+2004-09-14 Matthias Clasen <mclasen@redhat.com>
+
+ * gtk/gtktreeview.c (gtk_tree_view_focus_to_cursor): Set the cursor
+ to the first selected row instead of always to the first row if there
+ is no cursor. (#143270, Jean Bréfort)
+
+ * tests/testfilechooser.c (main): Fix a few typos.
+
2004-09-13 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkexpander.c:
2004-09-13 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkexpander.c:
+2004-09-14 Matthias Clasen <mclasen@redhat.com>
+
+ * gtk/gtktreeview.c (gtk_tree_view_focus_to_cursor): Set the cursor
+ to the first selected row instead of always to the first row if there
+ is no cursor. (#143270, Jean Bréfort)
+
+ * tests/testfilechooser.c (main): Fix a few typos.
+
2004-09-13 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkexpander.c:
2004-09-13 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkexpander.c:
if (cursor_path == NULL)
{
if (cursor_path == NULL)
{
- cursor_path = gtk_tree_path_new_first ();
+ /* Consult the selection before defaulting to the first element */
+ GtkTreeSelection *selection;
+ GtkTreeModel *model;
+ GList *selected_rows;
+
+ selection = gtk_tree_view_get_selection (tree_view);
+ selected_rows = gtk_tree_selection_get_selected_rows (selection, &model);
+ if (selected_rows)
+ {
+ cursor_path = gtk_tree_path_copy((const GtkTreePath *)(selected_rows->data));
+ g_list_foreach (selected_rows, (GFunc)gtk_tree_path_free, NULL);
+ g_list_free (selected_rows);
+ }
+ else
+ cursor_path = gtk_tree_path_new_first ();
+
gtk_tree_row_reference_free (tree_view->priv->cursor);
tree_view->priv->cursor = NULL;
gtk_tree_row_reference_free (tree_view->priv->cursor);
tree_view->priv->cursor = NULL;
g_signal_connect (button, "clicked",
G_CALLBACK (set_folder_nonexistent_cb), dialog);
g_signal_connect (button, "clicked",
G_CALLBACK (set_folder_nonexistent_cb), dialog);
- button = gtk_button_new_with_label ("set_current_folder (\"/usr/nonexistent\"");
+ button = gtk_button_new_with_label ("set_current_folder (\"/usr/nonexistent\")");
gtk_container_add (GTK_CONTAINER (vbbox), button);
g_signal_connect (button, "clicked",
G_CALLBACK (set_folder_existing_nonexistent_cb), dialog);
gtk_container_add (GTK_CONTAINER (vbbox), button);
g_signal_connect (button, "clicked",
G_CALLBACK (set_folder_existing_nonexistent_cb), dialog);
- button = gtk_button_new_with_label ("set_filename (\"/nonexistent\"");
+ button = gtk_button_new_with_label ("set_filename (\"/nonexistent\")");
gtk_container_add (GTK_CONTAINER (vbbox), button);
g_signal_connect (button, "clicked",
G_CALLBACK (set_filename_nonexistent_cb), dialog);
gtk_container_add (GTK_CONTAINER (vbbox), button);
g_signal_connect (button, "clicked",
G_CALLBACK (set_filename_nonexistent_cb), dialog);
- button = gtk_button_new_with_label ("set_filename (\"/usr/nonexistent\"");
+ button = gtk_button_new_with_label ("set_filename (\"/usr/nonexistent\")");
gtk_container_add (GTK_CONTAINER (vbbox), button);
g_signal_connect (button, "clicked",
G_CALLBACK (set_filename_existing_nonexistent_cb), dialog);
gtk_container_add (GTK_CONTAINER (vbbox), button);
g_signal_connect (button, "clicked",
G_CALLBACK (set_filename_existing_nonexistent_cb), dialog);