]> www.fi.muni.cz Git - evince.git/commitdiff
Start rendering pages before any other jobs.
authorCarlos Garcia Campos <carlosgc@gnome.org>
Sun, 22 Apr 2007 17:12:42 +0000 (17:12 +0000)
committerCarlos Garcia Campos <carlosgc@src.gnome.org>
Sun, 22 Apr 2007 17:12:42 +0000 (17:12 +0000)
2007-04-22  Carlos Garcia Campos  <carlosgc@gnome.org>
* shell/ev-window.c: (ev_window_setup_document),
(ev_window_set_document), (ev_window_load_job_cb):
* shell/ev-view.c: (setup_caches):
* shell/ev-sidebar-thumbnails.c: (ev_sidebar_thumbnails_set_document):
Start rendering pages before any other jobs.

svn path=/trunk/; revision=2417

ChangeLog
shell/ev-sidebar-thumbnails.c
shell/ev-view.c
shell/ev-window.c

index 83a372e1b442ece0ece5956b15f8aae77f7b5b71..d176dfbb237c6546bb1e137b7925a2ba995cc87f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2007-04-22  Carlos Garcia Campos  <carlosgc@gnome.org>
+
+       * shell/ev-window.c: (ev_window_setup_document),
+       (ev_window_set_document), (ev_window_load_job_cb):
+       * shell/ev-view.c: (setup_caches):
+       * shell/ev-sidebar-thumbnails.c: (ev_sidebar_thumbnails_set_document):
+
+       Start rendering pages before any other jobs. 
+
 2007-04-22  Carlos Garcia Campos  <carlosgc@gnome.org>
 
        * shell/ev-window.c: (ev_window_stop_fullscreen),
index 75b735d1b877d8cca75bb5b000f19ae63b6a355c..d6a8af51e8127248cde6077e3ac752792d02242b 100644 (file)
@@ -676,6 +676,9 @@ ev_sidebar_thumbnails_set_document (EvSidebarPage   *sidebar_page,
        g_signal_connect (priv->page_cache, "page-changed", G_CALLBACK (page_changed_cb), sidebar_thumbnails);
        sidebar_thumbnails->priv->start_page = 0;
        sidebar_thumbnails->priv->end_page = 0;
+       page_changed_cb (priv->page_cache,
+                        ev_page_cache_get_current_page (priv->page_cache),
+                        sidebar_thumbnails);
        adjustment_changed_cb (sidebar_thumbnails);
 }
 
index a7641f84e18b5fea5eed6634ff5f7468234d9f77..d496a68eff824484928ec0260e5a1cc085af00d1 100644 (file)
@@ -3471,6 +3471,9 @@ setup_caches (EvView *view)
        g_signal_connect (view->page_cache, "page-changed", G_CALLBACK (page_changed_cb), view);
        view->pixbuf_cache = ev_pixbuf_cache_new (GTK_WIDGET (view), view->document);
        g_signal_connect (view->pixbuf_cache, "job-finished", G_CALLBACK (job_finished_cb), view);
+       page_changed_cb (view->page_cache,
+                        ev_page_cache_get_current_page (view->page_cache),
+                        view);
 }
 
 static void
index f584d99573319e181d7626417f49726ff4fbe6ab..770c916a523f0763f584f4fcfc3a3302ed21c52b 100644 (file)
@@ -849,7 +849,7 @@ setup_sidebar_from_metadata (EvWindow *window, EvDocument *document)
                } else if (strcmp (page_id, THUMBNAILS_SIDEBAR_ID) && ev_sidebar_page_support_document (EV_SIDEBAR_PAGE (thumbs), document)) {
                        ev_sidebar_set_page (EV_SIDEBAR (sidebar), thumbs);
                } else if (strcmp (page_id, ATTACHMENTS_SIDEBAR_ID) && ev_sidebar_page_support_document (EV_SIDEBAR_PAGE (attachments), document)) {
-                       ev_sidebar_set_page (EV_SIDEBAR (sidebar), thumbs);
+                       ev_sidebar_set_page (EV_SIDEBAR (sidebar), attachments);
                }
                g_value_unset (&sidebar_page);
        } else if (document && ev_sidebar_page_support_document (EV_SIDEBAR_PAGE (links), document)) {
@@ -1058,22 +1058,14 @@ ev_window_set_icon_from_thumbnail (EvJobThumbnail *job,
        ev_window_clear_thumbnail_job (ev_window);
 }
 
-static void
+static gboolean
 ev_window_setup_document (EvWindow *ev_window)
 {
        const EvDocumentInfo *info;
-       EvDocument *document;
-       EvView *view = EV_VIEW (ev_window->priv->view);
+       EvDocument *document = ev_window->priv->document;
        EvSidebar *sidebar = EV_SIDEBAR (ev_window->priv->sidebar);
        GtkAction *action;
-
-       document = ev_window->priv->document;
-       ev_window->priv->page_cache = ev_page_cache_get (ev_window->priv->document);
-       g_signal_connect (ev_window->priv->page_cache, "page-changed",
-                         G_CALLBACK (page_changed_cb), ev_window);
-       g_signal_connect (ev_window->priv->page_cache, "history-changed",
-                         G_CALLBACK (history_changed_cb), ev_window);
-
+       
        if (EV_IS_DOCUMENT_FIND (document)) {
                g_signal_connect_object (G_OBJECT (document),
                                         "find_changed",
@@ -1102,16 +1094,12 @@ ev_window_setup_document (EvWindow *ev_window)
                g_object_unref (rc);
        }
 
-       ev_sidebar_set_document (sidebar, document);
-
-       if (ev_page_cache_get_n_pages (ev_window->priv->page_cache) > 0) {
-               ev_view_set_document (view, document);
-       }
        ev_window_set_page_mode (ev_window, PAGE_MODE_DOCUMENT);
-
        ev_window_title_set_document (ev_window->priv->title, document);
        ev_window_title_set_uri (ev_window->priv->title, ev_window->priv->uri);
 
+       ev_sidebar_set_document (sidebar, document);
+
        action = gtk_action_group_get_action (ev_window->priv->action_group, PAGE_SELECTOR_ACTION);
        ev_page_action_set_document (EV_PAGE_ACTION (action), document);
        ev_window_setup_action_sensitivity (ev_window);
@@ -1127,12 +1115,36 @@ ev_window_setup_document (EvWindow *ev_window)
                                                   ev_window->priv->document);
        }
        
+       info = ev_page_cache_get_info (ev_window->priv->page_cache);
+       update_document_mode (ev_window, info->mode);
+
+       return FALSE;
+}
+
+static void
+ev_window_set_document (EvWindow *ev_window, EvDocument *document)
+{
+       EvView *view = EV_VIEW (ev_window->priv->view);
+
+       if (ev_window->priv->document)
+               g_object_unref (ev_window->priv->document);
+       ev_window->priv->document = g_object_ref (document);
+       
+       ev_window->priv->page_cache = ev_page_cache_get (ev_window->priv->document);
+       g_signal_connect (ev_window->priv->page_cache, "page-changed",
+                         G_CALLBACK (page_changed_cb), ev_window);
+       g_signal_connect (ev_window->priv->page_cache, "history-changed",
+                         G_CALLBACK (history_changed_cb), ev_window);
+
        setup_size_from_metadata (ev_window);
-       setup_document_from_metadata (ev_window);
        setup_sidebar_from_metadata (ev_window, document);
+       setup_document_from_metadata (ev_window);
 
-       info = ev_page_cache_get_info (ev_window->priv->page_cache);
-       update_document_mode (ev_window, info->mode);
+       if (ev_page_cache_get_n_pages (ev_window->priv->page_cache) > 0) {
+               ev_view_set_document (view, document);
+       }
+
+       g_idle_add ((GSourceFunc)ev_window_setup_document, ev_window);
 }
 
 static void
@@ -1278,10 +1290,8 @@ ev_window_load_job_cb  (EvJobLoad *job,
 
        /* Success! */
        if (job->error == NULL) {
-               if (ev_window->priv->document)
-                       g_object_unref (ev_window->priv->document);
-               ev_window->priv->document = g_object_ref (document);
-
+               ev_window_set_document (ev_window, document);
+               
                if (job->mode != EV_WINDOW_MODE_PREVIEW) {
                        setup_view_from_metadata (ev_window);
                }
@@ -1290,8 +1300,6 @@ ev_window_load_job_cb  (EvJobLoad *job,
                        ev_window_add_recent (ev_window, ev_window->priv->uri);
                }
 
-               ev_window_setup_document (ev_window);
-
                if (job->dest) {
                        EvLink *link;
                        EvLinkAction *link_action;