]> www.fi.muni.cz Git - evince.git/commitdiff
Draw Loading message during xfer job. Fix for the bug #329495.
authorNickolay V. Shmyrev <nshmyrev@src.gnome.org>
Tue, 7 Feb 2006 20:09:23 +0000 (20:09 +0000)
committerNickolay V. Shmyrev <nshmyrev@src.gnome.org>
Tue, 7 Feb 2006 20:09:23 +0000 (20:09 +0000)
* shell/ev-view-private.h:
* shell/ev-view.c: (ev_view_expose_event), (ev_view_set_loading),
(ev_view_set_document):
* shell/ev-view.h:
* shell/ev-window.c: (ev_window_load_job_cb),
(ev_window_xfer_job_cb), (ev_window_open_uri), (ev_window_dispose),
(ev_window_init):

Draw Loading message during xfer job. Fix for the bug #329495.

ChangeLog
shell/ev-view-private.h
shell/ev-view.c
shell/ev-view.h
shell/ev-window.c

index 29fc5da3ff1efd8b436ed847af4953455f416097..ec1efdd8e6ef2b35c867966bd2aa533ce84e1c69 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2006-02-07  Nickolay V. Shmyrev  <nshmyrev@yandex.ru>
+
+       * shell/ev-view-private.h:
+       * shell/ev-view.c: (ev_view_expose_event), (ev_view_set_loading),
+       (ev_view_set_document):
+       * shell/ev-view.h:
+       * shell/ev-window.c: (ev_window_load_job_cb),
+       (ev_window_xfer_job_cb), (ev_window_open_uri), (ev_window_dispose),
+       (ev_window_init):
+
+       Draw Loading message during xfer job. Fix for the bug #329495.
+
 2006-02-03  Nickolay V. Shmyrev  <nshmyrev@yandex.ru>
 
        * comics/comics-document.c: (comics_regex_quote),
index 91f43154de25ca9fcda006ea79def8b8ce1ea2cf..9619b6d7e6d9d25ef505149e43e7c5ef7d5089f5 100644 (file)
@@ -92,6 +92,7 @@ struct _EvView {
        double scale;
        int spacing;
 
+       gboolean loading;
        gboolean continuous;
        gboolean dual_page;
        gboolean fullscreen;
index dae30b9c38a51d7c2bf3e97fc6b3a4ab2fe72b1c..47c4eaec8d5f623de694877daa3a628866652ea5 100644 (file)
@@ -209,6 +209,9 @@ static void       draw_one_page                              (EvView
                                                              GdkRectangle       *page_area,
                                                              GtkBorder          *border,
                                                              GdkRectangle       *expose_area);
+static void      draw_loading_text                          (EvView             *view,
+                                                             GdkRectangle       *page_area,
+                                                             GdkRectangle       *expose_area);
 
 /*** Callbacks ***/
 static void       find_changed_cb                            (EvDocument         *document,
@@ -1619,6 +1622,12 @@ ev_view_expose_event (GtkWidget      *widget,
        EvView *view = EV_VIEW (widget);
        int i;
 
+       if (view->loading) {
+               draw_loading_text (view,
+                                  &(widget->allocation),
+                                  &(event->area));
+       }
+
        if (view->document == NULL)
                return FALSE;
 
@@ -2689,12 +2698,22 @@ clear_caches (EvView *view)
        }
 }
 
+void
+ev_view_set_loading (EvView      *view,
+                    gboolean      loading)
+{
+       view->loading = loading;
+       gtk_widget_queue_draw (GTK_WIDGET (view));
+}
+
 void
 ev_view_set_document (EvView     *view,
                      EvDocument *document)
 {
        g_return_if_fail (EV_IS_VIEW (view));
 
+       view->loading = FALSE;
+       
        if (document != view->document) {
                clear_caches (view);
 
index 0378f285543aa6b7399c736696571361c11ab402..0c0a86287cd1cae6d4bc0629d0955e44c21cb432 100644 (file)
@@ -60,6 +60,8 @@ GType           ev_sizing_mode_get_type   (void) G_GNUC_CONST;
 GtkWidget*     ev_view_new               (void);
 void           ev_view_set_document      (EvView         *view,
                                           EvDocument     *document);
+void           ev_view_set_loading       (EvView         *view,
+                                          gboolean        loading);
 
 /* Clipboard */
 void           ev_view_copy              (EvView         *view);
index a3a4457d8e8ed7b0488b19aa93fcb3e68f56c469..5424c6a2e01a5b96c6b98088b7ca4af9d69191bc 100644 (file)
@@ -102,7 +102,6 @@ struct _EvWindowPrivate {
        GtkWidget *find_bar;
        GtkWidget *scrolled_window;
        GtkWidget *view;
-       GtkWidget *page_view;
        GtkWidget *password_view;
        GtkWidget *sidebar_thumbs;
        GtkWidget *sidebar_links;
@@ -954,6 +953,8 @@ ev_window_load_job_cb  (EvJobLoad *job,
        g_assert (document);
        g_assert (document != ev_window->priv->document);
        g_assert (job->uri);
+       
+       ev_view_set_loading (EV_VIEW (ev_window->priv->view), FALSE);
 
        if (ev_window->priv->password_document) {
                g_object_unref (ev_window->priv->password_document);
@@ -1007,6 +1008,7 @@ ev_window_xfer_job_cb  (EvJobXfer *job,
        if (job->error != NULL) {
                unable_to_load (ev_window, job->error->message);
                ev_window_clear_jobs (ev_window);
+               ev_view_set_loading (EV_VIEW (ev_window->priv->view), FALSE);
        } else {
                char *uri;
                
@@ -1069,6 +1071,7 @@ ev_window_open_uri (EvWindow *ev_window, const char *uri)
        ev_window_close_dialogs (ev_window);
        ev_window_clear_jobs (ev_window);
        ev_window_clear_local_uri (ev_window);
+       ev_view_set_loading (EV_VIEW (ev_window->priv->view), TRUE);
        
        ev_window->priv->xfer_job = ev_job_xfer_new (uri);
        g_signal_connect (ev_window->priv->xfer_job,
@@ -2705,11 +2708,6 @@ ev_window_dispose (GObject *object)
                priv->view = NULL;
        }
 
-       if (priv->page_view) {
-               g_object_unref (priv->page_view);
-               priv->page_view = NULL;
-       }
-
        if (priv->load_job || priv->xfer_job) {
                ev_window_clear_jobs (window);
        }
@@ -3434,7 +3432,6 @@ ev_window_init (EvWindow *ev_window)
 
        /* We own a ref on these widgets, as we can swap them in and out */
        g_object_ref (ev_window->priv->view);
-       //g_object_ref (ev_window->priv->page_view);
        g_object_ref (ev_window->priv->password_view);
 
        gtk_container_add (GTK_CONTAINER (ev_window->priv->scrolled_window),