~ubuntu-branches/ubuntu/oneiric/xfdesktop4/oneiric

« back to all changes in this revision

Viewing changes to settings/main.c

  • Committer: Bazaar Package Importer
  • Author(s): Lionel Le Folgoc
  • Date: 2011-01-30 19:41:34 UTC
  • mfrom: (1.1.33 upstream)
  • Revision ID: james.westby@ubuntu.com-20110130194134-b45mng2xmuxsl6ms
Tags: 4.8.1-0ubuntu1
New upstream bugfix release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
 *  Copyright (c) 2008 Stephan Arts <stephan@xfce.org>
5
5
 *  Copyright (c) 2008 Brian Tarricone <bjt23@cornell.edu>
6
6
 *  Copyright (c) 2008 Jérôme Guelfucci <jerome.guelfucci@gmail.com>
 
7
 *  Copyright (c) 2011 Jannis Pohlmann <jannis@xfce.org>
7
8
 *
8
9
 *  This program is free software; you can redistribute it and/or modify
9
10
 *  it under the terms of the GNU General Public License as published by
212
213
xfdesktop_settings_create_all_previews(gpointer data)
213
214
{
214
215
    GtkTreeModel *model = data;
 
216
    GtkTreeView *tree_view;
215
217
    GtkTreeIter iter;
216
218
 
217
219
    gdk_threads_enter();
220
222
            xfdesktop_settings_do_single_preview(model, &iter);
221
223
        } while(gtk_tree_model_iter_next(model, &iter));
222
224
    }
 
225
 
 
226
    /* if possible, scroll to the selected image */
 
227
    tree_view = g_object_get_data(G_OBJECT(model), "xfdesktop-tree-view");
 
228
    if(tree_view) {
 
229
        GtkTreeSelection *selection = gtk_tree_view_get_selection(tree_view);
 
230
 
 
231
        if(gtk_tree_selection_get_mode(selection) != GTK_SELECTION_MULTIPLE
 
232
           && gtk_tree_selection_get_selected(selection, NULL, &iter)) 
 
233
        {
 
234
            GtkTreePath *path = gtk_tree_model_get_path(model, &iter);
 
235
            gtk_tree_view_scroll_to_cell(tree_view, path, NULL, TRUE, 0.0, 0.0);
 
236
        }
 
237
    }
 
238
    g_object_set_data(G_OBJECT(model), "xfdesktop-tree-view", NULL);
 
239
 
223
240
    gdk_threads_leave();
224
241
 
225
242
    g_object_unref(G_OBJECT(model));
693
710
    if(image_file_iter) {
694
711
        gtk_tree_selection_select_iter(sel, image_file_iter);
695
712
        gtk_tree_iter_free(image_file_iter);
 
713
 
 
714
        /* remember the tree view to scroll to the selected image in the
 
715
         * thread that creates all the previews */
 
716
        g_object_set_data_full(G_OBJECT(ls), "xfdesktop-tree-view", 
 
717
                               g_object_ref(panel->image_treeview),
 
718
                               g_object_unref);
696
719
    }
697
720
 
698
721
    /* generate previews of each image -- the new thread will own