[gnome-packagekit] Scroll to the package being processed in the update list. Fixes rh#510984



commit c44d7c2b88fcfb0db2b6d12c926d66a13ca8c9a6
Author: Richard Hughes <richard hughsie com>
Date:   Mon Jul 20 17:21:41 2009 +0100

    Scroll to the package being processed in the update list. Fixes rh#510984

 data/gnome-packagekit.schemas.in |   12 ++++++++++++
 src/gpk-common.h                 |    1 +
 src/gpk-update-viewer.c          |    9 +++++++++
 3 files changed, 22 insertions(+), 0 deletions(-)
---
diff --git a/data/gnome-packagekit.schemas.in b/data/gnome-packagekit.schemas.in
index 76c0c66..63e7059 100644
--- a/data/gnome-packagekit.schemas.in
+++ b/data/gnome-packagekit.schemas.in
@@ -440,6 +440,18 @@
     </schema>
 
     <schema>
+      <key>/schemas/apps/gnome-packagekit/update-viewer/scroll_active</key>
+      <applyto>/apps/gnome-packagekit/update-viewer/scroll_active</applyto>
+      <owner>gnome-packagekit</owner>
+      <type>bool</type>
+      <default>true</default>
+      <locale name="C">
+        <short>Scroll to packages as they are downloaded</short>
+        <long>Scroll to packages in the update list as they are downloaded or installed.</long>
+      </locale>
+    </schema>
+
+    <schema>
       <key>/schemas/apps/gnome-packagekit/enable_font_helper</key>
       <applyto>/apps/gnome-packagekit/enable_font_helper</applyto>
       <owner>gnome-packagekit</owner>
diff --git a/src/gpk-common.h b/src/gpk-common.h
index 107e1a0..85ebccb 100644
--- a/src/gpk-common.h
+++ b/src/gpk-common.h
@@ -72,6 +72,7 @@ G_BEGIN_DECLS
 #define GPK_CONF_APPLICATION_SEARCH_MODE	"/apps/gnome-packagekit/application/search_mode"
 #define GPK_CONF_UPDATE_VIEWER_MOBILE_BBAND	"/apps/gnome-packagekit/update-viewer/notify_mobile_connection"
 #define GPK_CONF_UPDATE_VIEWER_ONLY_NEWEST	"/apps/gnome-packagekit/update-viewer/only_newest"
+#define GPK_CONF_UPDATE_VIEWER_SCROLL_ACTIVE	"/apps/gnome-packagekit/update-viewer/scroll_active"
 
 #define GPK_BUGZILLA_URL			"https://bugs.freedesktop.org/";
 
diff --git a/src/gpk-update-viewer.c b/src/gpk-update-viewer.c
index d1543d0..f4315a2 100644
--- a/src/gpk-update-viewer.c
+++ b/src/gpk-update-viewer.c
@@ -581,9 +581,11 @@ gpk_update_viewer_package_cb (PkClient *client, const PkPackageObj *obj, gpointe
 	GtkTreeView *treeview;
 	GtkTreeIter iter;
 	GtkTreeModel *model;
+	GtkTreeViewColumn *column;
 	GtkWidget *widget;
 	GtkTreePath *path;
 	gboolean selected;
+	gboolean scroll;
 
 	pk_client_get_role (client, &role, NULL, NULL);
 	egg_debug ("role = %s, package = %s:%s:%s", pk_role_enum_to_text (role),
@@ -616,6 +618,13 @@ gpk_update_viewer_package_cb (PkClient *client, const PkPackageObj *obj, gpointe
 
 		gtk_tree_model_get_iter (model, &iter, path);
 
+		/* scroll to the active cell */
+		scroll = gconf_client_get_bool (gconf_client, GPK_CONF_UPDATE_VIEWER_SCROLL_ACTIVE, NULL);
+		if (scroll) {
+			column = gtk_tree_view_get_column (treeview, 3);
+			gtk_tree_view_scroll_to_cell (treeview, path, column, FALSE, 0.0f, 0.0f);
+		}
+
 		/* if the info is finished, change the status to past tense */
 		if (obj->info == PK_INFO_ENUM_FINISHED) {
 			gtk_tree_model_get (model, &iter,



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