[gnome-software] Drop spinner for screenshot loading



commit 1c8b7126b3d4ceead847427f9f88a44b5db0ee7a
Author: Matthias Clasen <mclasen redhat com>
Date:   Wed Dec 18 21:05:53 2013 -0500

    Drop spinner for screenshot loading
    
    We already have the images loading one at a time and we have a
    background to indicate where they will go. The spinners introduce
    a lot of visual noise which isn't needed and can be distracting.
    So, just drop them.
    https://bugzilla.gnome.org/show_bug.cgi?id=712146

 src/gs-screenshot-image.c |   44 --------------------------------------------
 src/screenshot-image.ui   |   12 ------------
 2 files changed, 0 insertions(+), 56 deletions(-)
---
diff --git a/src/gs-screenshot-image.c b/src/gs-screenshot-image.c
index 730b4a7..8be98b5 100644
--- a/src/gs-screenshot-image.c
+++ b/src/gs-screenshot-image.c
@@ -35,11 +35,9 @@ struct _GsScreenshotImagePrivate
        GtkWidget       *image1;
        GtkWidget       *image2;
        GtkWidget       *label_error;
-       GtkWidget       *spinner;
        SoupSession     *session;
        gchar           *cachedir;
        gchar           *filename;
-       guint            spinner_id;
        const gchar     *current_image;
        guint            width;
        guint            height;
@@ -82,12 +80,6 @@ gs_screenshot_image_set_error (GsScreenshotImage *ssimg, const gchar *message)
 
        priv = gs_screenshot_image_get_instance_private (ssimg);
 
-       /* cancel the spinner timeout */
-       if (priv->spinner_id != 0) {
-               g_source_remove (priv->spinner_id);
-               priv->spinner_id = 0;
-       }
-
        gtk_stack_set_visible_child_name (GTK_STACK (priv->stack), "error");
        gtk_label_set_label (GTK_LABEL (priv->label_error), message);
        gtk_widget_get_size_request (priv->stack, &width, &height);
@@ -106,15 +98,6 @@ gs_screenshot_show_image (GsScreenshotImage *ssimg)
        GsScreenshotImagePrivate *priv;
        priv = gs_screenshot_image_get_instance_private (ssimg);
 
-       /* cancel the spinner timeout */
-       if (priv->spinner_id != 0) {
-               g_source_remove (priv->spinner_id);
-               priv->spinner_id = 0;
-       }
-
-       /* stop loading */
-       gtk_spinner_stop (GTK_SPINNER (priv->spinner));
-
        /* show icon */
        if (g_strcmp0 (priv->current_image, "image1") == 0) {
                gtk_image_set_from_file (GTK_IMAGE (priv->image2), priv->filename);
@@ -179,21 +162,6 @@ gs_screenshot_image_set_cachedir (GsScreenshotImage *ssimg, const gchar *cachedi
 }
 
 /**
- * gs_screenshot_image_show_spinner:
- **/
-static gboolean
-gs_screenshot_image_show_spinner (gpointer user_data)
-{
-       GsScreenshotImage *ssimg = GS_SCREENSHOT_IMAGE (user_data);
-       GsScreenshotImagePrivate *priv;
-       priv = gs_screenshot_image_get_instance_private (ssimg);
-       gtk_spinner_start (GTK_SPINNER (priv->spinner));
-       gtk_stack_set_visible_child_name (GTK_STACK (priv->stack), "spinner");
-       priv->spinner_id = 0;
-       return FALSE;
-}
-
-/**
  * gs_screenshot_image_set_screenshot:
  **/
 void
@@ -310,11 +278,6 @@ gs_screenshot_image_load_async (GsScreenshotImage *ssimg,
        soup_session_queue_message (priv->session, msg,
                                    gs_screenshot_image_complete_cb,
                                    g_object_ref (ssimg));
-       if (priv->spinner_id != 0)
-               g_source_remove (priv->spinner_id);
-       priv->spinner_id = g_timeout_add (250, gs_screenshot_image_show_spinner, ssimg);
-       g_source_set_name_by_id (priv->spinner_id,
-                                "[gnome-software] gs_screenshot_image_show_spinner");
 out:
        g_free (basename);
        g_free (sizedir);
@@ -334,12 +297,6 @@ gs_screenshot_image_destroy (GtkWidget *widget)
 
        priv = gs_screenshot_image_get_instance_private (ssimg);
 
-       /* cancel the spinner timeout */
-       if (priv->spinner_id != 0) {
-               g_source_remove (priv->spinner_id);
-               priv->spinner_id = 0;
-       }
-
        g_clear_object (&priv->screenshot);
        g_free (priv->cachedir);
        priv->cachedir = NULL;
@@ -406,7 +363,6 @@ gs_screenshot_image_class_init (GsScreenshotImageClass *klass)
                                                     "/org/gnome/software/screenshot-image.ui");
 
        gtk_widget_class_bind_template_child_private (widget_class, GsScreenshotImage, stack);
-       gtk_widget_class_bind_template_child_private (widget_class, GsScreenshotImage, spinner);
        gtk_widget_class_bind_template_child_private (widget_class, GsScreenshotImage, image1);
        gtk_widget_class_bind_template_child_private (widget_class, GsScreenshotImage, image2);
        gtk_widget_class_bind_template_child_private (widget_class, GsScreenshotImage, box_error);
diff --git a/src/screenshot-image.ui b/src/screenshot-image.ui
index c6839aa..059a9ce 100644
--- a/src/screenshot-image.ui
+++ b/src/screenshot-image.ui
@@ -32,18 +32,6 @@
           </packing>
         </child>
         <child>
-          <object class="GtkSpinner" id="spinner">
-            <property name="visible">True</property>
-            <property name="width_request">16</property>
-            <property name="height_request">16</property>
-            <property name="halign">center</property>
-            <property name="valign">center</property>
-          </object>
-          <packing>
-            <property name="name">spinner</property>
-          </packing>
-        </child>
-        <child>
           <object class="GtkBox" id="box_error">
             <property name="visible">True</property>
             <property name="halign">center</property>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]