[gnome-packagekit] Do not use an animated icon in the update control panel



commit 9db252faa20103eb40cc7ad9fca486935ceaa440
Author: Richard Hughes <richard hughsie com>
Date:   Thu Sep 30 22:07:30 2010 +0100

    Do not use an animated icon in the update control panel

 data/gpk-prefs.ui     |   73 +++++++++++++++++++++++++++++++++++++++++--------
 src/cc-update-panel.c |   26 +++++++----------
 2 files changed, 72 insertions(+), 27 deletions(-)
---
diff --git a/data/gpk-prefs.ui b/data/gpk-prefs.ui
index 6720b84..40c3124 100644
--- a/data/gpk-prefs.ui
+++ b/data/gpk-prefs.ui
@@ -32,6 +32,8 @@
                     </attributes>
                   </object>
                   <packing>
+                    <property name="expand">True</property>
+                    <property name="fill">True</property>
                     <property name="position">0</property>
                   </packing>
                 </child>
@@ -133,6 +135,8 @@
                             </child>
                           </object>
                           <packing>
+                            <property name="expand">True</property>
+                            <property name="fill">True</property>
                             <property name="position">0</property>
                           </packing>
                         </child>
@@ -145,6 +149,8 @@
                             <property name="draw_indicator">True</property>
                           </object>
                           <packing>
+                            <property name="expand">True</property>
+                            <property name="fill">True</property>
                             <property name="position">1</property>
                           </packing>
                         </child>
@@ -159,6 +165,7 @@
                               </object>
                               <packing>
                                 <property name="expand">False</property>
+                                <property name="fill">True</property>
                                 <property name="position">0</property>
                               </packing>
                             </child>
@@ -172,11 +179,14 @@
                               </object>
                               <packing>
                                 <property name="expand">False</property>
+                                <property name="fill">True</property>
                                 <property name="position">1</property>
                               </packing>
                             </child>
                           </object>
                           <packing>
+                            <property name="expand">True</property>
+                            <property name="fill">True</property>
                             <property name="position">2</property>
                           </packing>
                         </child>
@@ -184,12 +194,15 @@
                     </child>
                   </object>
                   <packing>
+                    <property name="expand">True</property>
+                    <property name="fill">True</property>
                     <property name="position">1</property>
                   </packing>
                 </child>
               </object>
               <packing>
                 <property name="expand">False</property>
+                <property name="fill">True</property>
                 <property name="position">0</property>
               </packing>
             </child>
@@ -208,6 +221,7 @@
                   </object>
                   <packing>
                     <property name="expand">False</property>
+                    <property name="fill">True</property>
                     <property name="position">0</property>
                   </packing>
                 </child>
@@ -243,12 +257,12 @@
                           </object>
                           <packing>
                             <property name="expand">False</property>
+                            <property name="fill">True</property>
                             <property name="position">0</property>
                           </packing>
                         </child>
                         <child>
                           <object class="GtkScrolledWindow" id="scrolledwindow_repo">
-                            <property name="visible">True</property>
                             <property name="can_focus">True</property>
                             <property name="hscrollbar_policy">never</property>
                             <property name="vscrollbar_policy">automatic</property>
@@ -261,34 +275,61 @@
                             </child>
                           </object>
                           <packing>
+                            <property name="expand">True</property>
+                            <property name="fill">True</property>
                             <property name="position">1</property>
                           </packing>
                         </child>
                         <child>
-                          <object class="GtkViewport" id="viewport_animation_preview">
+                          <object class="GtkViewport" id="viewport_status">
+                            <property name="visible">True</property>
                             <property name="resize_mode">queue</property>
                             <child>
-                              <object class="GtkHBox" id="hbox_animation">
+                              <object class="GtkHBox" id="hbox_status">
                                 <property name="visible">True</property>
-                                <property name="spacing">6</property>
                                 <child>
-                                  <object class="GtkLabel" id="label_animation">
+                                  <object class="GtkHBox" id="hbox_status2">
                                     <property name="visible">True</property>
-                                    <property name="label">Another action is in progress.</property>
-                                    <attributes>
-                                      <attribute name="weight" value="bold"/>
-                                    </attributes>
+                                    <property name="spacing">12</property>
+                                    <child>
+                                      <object class="GtkImage" id="image_status">
+                                        <property name="visible">True</property>
+                                        <property name="stock">gtk-execute</property>
+                                        <property name="icon-size">6</property>
+                                      </object>
+                                      <packing>
+                                        <property name="expand">False</property>
+                                        <property name="fill">True</property>
+                                        <property name="position">0</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <object class="GtkLabel" id="label_status">
+                                        <property name="visible">True</property>
+                                        <property name="label">Another action is in progress.</property>
+                                        <attributes>
+                                          <attribute name="weight" value="bold"/>
+                                        </attributes>
+                                      </object>
+                                      <packing>
+                                        <property name="expand">False</property>
+                                        <property name="fill">True</property>
+                                        <property name="position">2</property>
+                                      </packing>
+                                    </child>
                                   </object>
                                   <packing>
-                                    <property name="expand">False</property>
-                                    <property name="position">2</property>
+                                    <property name="expand">True</property>
+                                    <property name="fill">False</property>
+                                    <property name="position">0</property>
                                   </packing>
                                 </child>
                               </object>
                             </child>
                           </object>
                           <packing>
-                            <property name="expand">False</property>
+                            <property name="expand">True</property>
+                            <property name="fill">True</property>
                             <property name="position">2</property>
                           </packing>
                         </child>
@@ -303,6 +344,7 @@
                           </object>
                           <packing>
                             <property name="expand">False</property>
+                            <property name="fill">True</property>
                             <property name="position">3</property>
                           </packing>
                         </child>
@@ -310,16 +352,22 @@
                     </child>
                   </object>
                   <packing>
+                    <property name="expand">True</property>
+                    <property name="fill">True</property>
                     <property name="position">1</property>
                   </packing>
                 </child>
               </object>
               <packing>
+                <property name="expand">True</property>
+                <property name="fill">True</property>
                 <property name="position">1</property>
               </packing>
             </child>
           </object>
           <packing>
+            <property name="expand">True</property>
+            <property name="fill">True</property>
             <property name="position">2</property>
           </packing>
         </child>
@@ -346,6 +394,7 @@
           </object>
           <packing>
             <property name="expand">False</property>
+            <property name="fill">True</property>
             <property name="pack_type">end</property>
             <property name="position">0</property>
           </packing>
diff --git a/src/cc-update-panel.c b/src/cc-update-panel.c
index 1fc302f..f6a7cd2 100644
--- a/src/cc-update-panel.c
+++ b/src/cc-update-panel.c
@@ -35,7 +35,6 @@
 #include "gpk-gnome.h"
 #include "gpk-enum.h"
 #include "gpk-error.h"
-#include "gpk-animated-icon.h"
 
 struct _CcUpdatePanelPrivate {
 	GtkBuilder		*builder;
@@ -46,7 +45,6 @@ struct _CcUpdatePanelPrivate {
 	GtkTreePath		*path_tmp;
 	const gchar		*id_tmp;
 	PkStatusEnum		 status;
-	GtkWidget		*image_animation;
 	guint			 status_id;
 };
 
@@ -407,14 +405,19 @@ cc_update_panel_status_changed_timeout_cb (CcUpdatePanel *panel)
 	GtkWidget *widget;
 
 	/* set the text and show */
-	widget = GTK_WIDGET (gtk_builder_get_object (panel->priv->builder, "viewport_animation_preview"));
+	widget = GTK_WIDGET (gtk_builder_get_object (panel->priv->builder, "scrolledwindow_repo"));
+	gtk_widget_hide (widget);
+	widget = GTK_WIDGET (gtk_builder_get_object (panel->priv->builder, "viewport_status"));
 	gtk_widget_show (widget);
-	widget = GTK_WIDGET (gtk_builder_get_object (panel->priv->builder, "label_animation"));
+	widget = GTK_WIDGET (gtk_builder_get_object (panel->priv->builder, "label_status"));
 	text = gpk_status_enum_to_localised_text (panel->priv->status);
 	gtk_label_set_label (GTK_LABEL (widget), text);
 
 	/* set icon */
-	gpk_set_animated_icon_from_status (GPK_ANIMATED_ICON (panel->priv->image_animation), panel->priv->status, GTK_ICON_SIZE_LARGE_TOOLBAR);
+	widget = GTK_WIDGET (gtk_builder_get_object (panel->priv->builder, "image_status"));
+	gtk_image_set_from_icon_name (GTK_IMAGE (widget),
+				      gpk_status_enum_to_icon_name (panel->priv->status),
+				      GTK_ICON_SIZE_DIALOG);
 
 	/* never repeat */
 	panel->priv->status_id = 0;
@@ -444,9 +447,10 @@ cc_update_panel_progress_cb (PkProgress *progress, PkProgressType type, CcUpdate
 			g_source_remove (panel->priv->status_id);
 			panel->priv->status_id = 0;
 		}
-		widget = GTK_WIDGET (gtk_builder_get_object (panel->priv->builder, "viewport_animation_preview"));
+		widget = GTK_WIDGET (gtk_builder_get_object (panel->priv->builder, "viewport_status"));
 		gtk_widget_hide (widget);
-		gpk_animated_icon_enable_animation (GPK_ANIMATED_ICON (panel->priv->image_animation), FALSE);
+		widget = GTK_WIDGET (gtk_builder_get_object (panel->priv->builder, "scrolledwindow_repo"));
+		gtk_widget_show (widget);
 		goto out;
 	}
 
@@ -848,7 +852,6 @@ cc_update_panel_init (CcUpdatePanel *panel)
 	guint retval;
 	GError *error = NULL;
 	GtkTreeSelection *selection;
-	GtkBox *box;
 
 	panel->priv = CC_UPDATE_PREFS_GET_PRIVATE (panel);
 
@@ -895,13 +898,6 @@ cc_update_panel_init (CcUpdatePanel *panel)
 	cc_update_panel_upgrade_freq_combo_setup (panel);
 	cc_update_panel_auto_update_combo_setup (panel);
 
-	/* add animated widget */
-	panel->priv->image_animation = gpk_animated_icon_new ();
-	box = GTK_BOX (gtk_builder_get_object (panel->priv->builder, "hbox_animation"));
-	gtk_box_pack_start (box, panel->priv->image_animation, FALSE, FALSE, 0);
-	gtk_box_reorder_child (box, panel->priv->image_animation, 0);
-	gtk_widget_show (panel->priv->image_animation);
-
 	widget = GTK_WIDGET (gtk_builder_get_object (panel->priv->builder, "checkbutton_detail"));
 	g_settings_bind (panel->priv->settings,
 			 GPK_SETTINGS_REPO_SHOW_DETAILS,



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