Scroll to make the selected printer visible. (#418403, Nickolay V.

2007-03-16  Matthias Clasen  <mclasen@redhat.com>

        * gtk/gtkprintunixdialog.c (printer_added_cb): Scroll to
        make the selected printer visible.  (#418403, Nickolay V. Shmyrev,
        patch by Christian Persch)



svn path=/trunk/; revision=17531
This commit is contained in:
Matthias Clasen 2007-03-16 05:13:10 +00:00 committed by Matthias Clasen
parent 244bbfa043
commit 7a66837a80
2 changed files with 15 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2007-03-16 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkprintunixdialog.c (printer_added_cb): Scroll to
make the selected printer visible. (#418403, Nickolay V. Shmyrev,
patch by Christian Persch)
2007-03-15 Federico Mena Quintero <federico@novell.com> 2007-03-15 Federico Mena Quintero <federico@novell.com>
Merged from gtk-2-10: Merged from gtk-2-10:

View File

@ -427,6 +427,7 @@ printer_added_cb (GtkPrintBackend *backend,
GtkPrintUnixDialogPrivate *priv = dialog->priv; GtkPrintUnixDialogPrivate *priv = dialog->priv;
GtkTreeIter iter, filter_iter; GtkTreeIter iter, filter_iter;
GtkTreeSelection *selection; GtkTreeSelection *selection;
GtkTreePath *path;
gtk_list_store_append (GTK_LIST_STORE (priv->printer_list), &iter); gtk_list_store_append (GTK_LIST_STORE (priv->printer_list), &iter);
@ -446,7 +447,8 @@ printer_added_cb (GtkPrintBackend *backend,
gtk_tree_model_filter_convert_child_iter_to_iter (priv->printer_list_filter, gtk_tree_model_filter_convert_child_iter_to_iter (priv->printer_list_filter,
&filter_iter, &iter); &filter_iter, &iter);
path = gtk_tree_model_get_path (GTK_TREE_MODEL (priv->printer_list_filter), &filter_iter);
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->printer_treeview)); selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->printer_treeview));
if (priv->waiting_for_printer != NULL && if (priv->waiting_for_printer != NULL &&
@ -455,6 +457,8 @@ printer_added_cb (GtkPrintBackend *backend,
{ {
priv->internal_printer_change = TRUE; priv->internal_printer_change = TRUE;
gtk_tree_selection_select_iter (selection, &filter_iter); gtk_tree_selection_select_iter (selection, &filter_iter);
gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (priv->printer_treeview),
path, NULL, TRUE, 0.5, 0.0);
priv->internal_printer_change = FALSE; priv->internal_printer_change = FALSE;
g_free (priv->waiting_for_printer); g_free (priv->waiting_for_printer);
priv->waiting_for_printer = NULL; priv->waiting_for_printer = NULL;
@ -464,8 +468,12 @@ printer_added_cb (GtkPrintBackend *backend,
{ {
priv->internal_printer_change = TRUE; priv->internal_printer_change = TRUE;
gtk_tree_selection_select_iter (selection, &filter_iter); gtk_tree_selection_select_iter (selection, &filter_iter);
gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (priv->printer_treeview),
path, NULL, TRUE, 0.5, 0.0);
priv->internal_printer_change = FALSE; priv->internal_printer_change = FALSE;
} }
gtk_tree_path_free (path);
} }
static void static void