rpms/gnome-packagekit/devel gpk-dont-show-initial-package.patch, NONE, 1.1 gpk-dont-show-refresh-when-update-packages.patch, NONE, 1.1 gpk-hide-icon-when--update-packages.patch, NONE, 1.1 gpk-select-all-hide-more.patch, NONE, 1.1 gpk-select-all.patch, NONE, 1.1 gpk-show-icon-no-severity.patch, NONE, 1.1 gnome-packagekit.spec, 1.19, 1.20

Richard Hughes (rhughes) fedora-extras-commits at redhat.com
Wed Apr 9 17:48:01 UTC 2008


Author: rhughes

Update of /cvs/pkgs/rpms/gnome-packagekit/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv14149

Modified Files:
	gnome-packagekit.spec 
Added Files:
	gpk-dont-show-initial-package.patch 
	gpk-dont-show-refresh-when-update-packages.patch 
	gpk-hide-icon-when--update-packages.patch 
	gpk-select-all-hide-more.patch gpk-select-all.patch 
	gpk-show-icon-no-severity.patch 
Log Message:
* Sat Apr  9 2008 Richard Hughes  <rhughes at redhat.com> - 0.1.11-2
- Fix a plethora of GUI bugs by pulling some fixes from upstream


gpk-dont-show-initial-package.patch:

--- NEW FILE gpk-dont-show-initial-package.patch ---
commit 2e5c2f0cb7aaa4cffe72900af4ab49afbd98404a
Author: Richard Hughes <richard at hughsie.com>
Date:   Wed Apr 9 01:30:56 2008 +0100

    don't show the initial package when we are updating multiple packages

diff --git a/src/gpk-common.c b/src/gpk-common.c
index afef117..2861f87 100644
--- a/src/gpk-common.c
+++ b/src/gpk-common.c
@@ -1060,7 +1060,7 @@ gpk_role_enum_to_localised_present (PkRoleEnum role)
 		text = _("Refreshing package cache");
 		break;
 	case PK_ROLE_ENUM_UPDATE_PACKAGES:
-		text = _("Updating package");
+		text = _("Updating packages");
 		break;
 	case PK_ROLE_ENUM_UPDATE_SYSTEM:
 		text = _("Updating system");
diff --git a/src/gpk-watch.c b/src/gpk-watch.c
index ee7b152..37a5818 100644
--- a/src/gpk-watch.c
+++ b/src/gpk-watch.c
@@ -699,7 +699,8 @@ gpk_watch_populate_menu_with_jobs (GpkWatch *watch, GtkMenu *menu)
 		localised_status = gpk_status_enum_to_localised_text (item->status);
 
 		icon_name = gpk_status_enum_to_icon_name (item->status);
-		if (pk_strzero (item->package_id) == FALSE) {
+		if (!pk_strzero (item->package_id) &&
+		    item->role != PK_ROLE_ENUM_UPDATE_PACKAGES) {
 			package = gpk_package_get_name (item->package_id);
 			text = g_strdup_printf ("%s %s (%s)", localised_role, package, localised_status);
 			g_free (package);

gpk-dont-show-refresh-when-update-packages.patch:

--- NEW FILE gpk-dont-show-refresh-when-update-packages.patch ---
commit 66f991ad90b6cbb93a2c5ef9f5f83d745b06a962
Author: Richard Hughes <richard at hughsie.com>
Date:   Wed Apr 9 01:28:38 2008 +0100

    don't show the refresh menuitem if we are doing an update-packages call either

diff --git a/src/gpk-watch.c b/src/gpk-watch.c
index e4adc1c..ee7b152 100644
--- a/src/gpk-watch.c
+++ b/src/gpk-watch.c
@@ -244,6 +244,7 @@ gpk_watch_task_list_changed_cb (PkTaskList *tlist, GpkWatch *watch)
 	g_return_if_fail (GPK_IS_WATCH (watch));
 
 	if (pk_task_list_contains_role (tlist, PK_ROLE_ENUM_REFRESH_CACHE) ||
+	    pk_task_list_contains_role (tlist, PK_ROLE_ENUM_UPDATE_PACKAGES) ||
 	    pk_task_list_contains_role (tlist, PK_ROLE_ENUM_UPDATE_SYSTEM)) {
 		watch->priv->show_refresh_in_menu = FALSE;
 	} else {

gpk-hide-icon-when--update-packages.patch:

--- NEW FILE gpk-hide-icon-when--update-packages.patch ---
commit cadda07e052373f8fb6894984ce332105393ec9a
Author: Richard Hughes <richard at hughsie.com>
Date:   Wed Apr 9 02:11:02 2008 +0100

    hide the icon when we are updating multiple packages also

diff --git a/src/gpk-notify.c b/src/gpk-notify.c
index 1d184cd..e619f34 100644
--- a/src/gpk-notify.c
+++ b/src/gpk-notify.c
@@ -993,7 +993,8 @@ gpk_notify_task_list_changed_cb (PkTaskList *tlist, GpkNotify *notify)
 {
 	g_return_if_fail (GPK_IS_NOTIFY (notify));
 	/* hide icon if we are updating */
-	if (pk_task_list_contains_role (tlist, PK_ROLE_ENUM_UPDATE_SYSTEM)) {
+	if (pk_task_list_contains_role (tlist, PK_ROLE_ENUM_UPDATE_SYSTEM) ||
+	    pk_task_list_contains_role (tlist, PK_ROLE_ENUM_UPDATE_PACKAGES)) {
 		gpk_smart_icon_set_icon_name (notify->priv->sicon, NULL);
 	}
 }

gpk-select-all-hide-more.patch:

--- NEW FILE gpk-select-all-hide-more.patch ---
commit a8abc084f33359d18db243e20f17a214c39c9d3e
Author: Richard Hughes <richard at hughsie.com>
Date:   Tue Apr 8 18:53:06 2008 +0100

    we don't want to show 'Select all' if they are all checked

diff --git a/src/gpk-update-viewer.c b/src/gpk-update-viewer.c
index e726527..1915b53 100644
--- a/src/gpk-update-viewer.c
+++ b/src/gpk-update-viewer.c
@@ -1593,24 +1593,63 @@ pk_updates_detail_popup_menu_select_none (GtkWidget *menuitem, gpointer userdata
 }
 
 /**
+ * pk_updates_get_checked_status:
+ **/
+void
+pk_updates_get_checked_status (gboolean *all_checked, gboolean *none_checked)
+{
+	GtkTreeView *treeview;
+	gboolean valid;
+	gboolean update;
+	GtkTreeIter iter;
+	GtkTreeModel *model;
+
+	/* get the first iter in the list */
+	treeview = GTK_TREE_VIEW (glade_xml_get_widget (glade_xml, "treeview_updates"));
+	model = gtk_tree_view_get_model (treeview);
+	valid = gtk_tree_model_get_iter_first (model, &iter);
+	*all_checked = TRUE;
+	*none_checked = TRUE;
+	while (valid) {
+		gtk_tree_model_get (model, &iter, PACKAGES_COLUMN_SELECT, &update, -1);
+		if (update) {
+			*none_checked = FALSE;
+		} else {
+			*all_checked = FALSE;
+		}
+		valid = gtk_tree_model_iter_next (model, &iter);
+	}
+}
+
+/**
  * pk_updates_detail_popup_menu_create:
  **/
 void
 pk_updates_detail_popup_menu_create (GtkWidget *treeview, GdkEventButton *event, gpointer userdata)
 {
-	GtkWidget *menu, *menuitem;
+	GtkWidget *menu;
+	GtkWidget *menuitem;
+	gboolean all_checked;
+	gboolean none_checked;
 
 	menu = gtk_menu_new();
 
-	menuitem = gtk_menu_item_new_with_label ("Select all");
-	g_signal_connect (menuitem, "activate",
-			  G_CALLBACK (pk_updates_detail_popup_menu_select_all), treeview);
-	gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
+	/* we don't want to show 'Select all' if they are all checked */
+	pk_updates_get_checked_status (&all_checked, &none_checked);
 
-	menuitem = gtk_menu_item_new_with_label ("Unselect all");
-	g_signal_connect (menuitem, "activate",
-			  G_CALLBACK (pk_updates_detail_popup_menu_select_none), treeview);
-	gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
+	if (!all_checked) {
+		menuitem = gtk_menu_item_new_with_label ("Select all");
+		g_signal_connect (menuitem, "activate",
+				  G_CALLBACK (pk_updates_detail_popup_menu_select_all), treeview);
+		gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
+	}
+
+	if (!none_checked) {
+		menuitem = gtk_menu_item_new_with_label ("Unselect all");
+		g_signal_connect (menuitem, "activate",
+				  G_CALLBACK (pk_updates_detail_popup_menu_select_none), treeview);
+		gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
+	}
 
 	menuitem = gtk_menu_item_new_with_label ("Ignore this package");
 	gtk_widget_set_sensitive (GTK_WIDGET (menuitem), FALSE);

gpk-select-all.patch:

--- NEW FILE gpk-select-all.patch ---
commit ec9c197442980e843480ac500a0c80dbb92744f5
Author: Richard Hughes <richard at hughsie.com>
Date:   Tue Apr 8 18:44:46 2008 +0100

    add a context menu in gpk-update-viewer to select or unselect all the updates. fixes rh#441010

diff --git a/src/gpk-update-viewer.c b/src/gpk-update-viewer.c
index 81682fd..e726527 100644
--- a/src/gpk-update-viewer.c
+++ b/src/gpk-update-viewer.c
@@ -1174,7 +1174,7 @@ pk_update_update_last_updated_time (void)
 	return TRUE;
 }
 
-static void 
+static void
 pk_updates_restart_cb (GtkWidget *widget, gpointer data)
 {
 	gpk_restart_system ();
@@ -1549,6 +1549,125 @@ pk_updates_changed_cb (PkClient *client, gpointer data)
 }
 
 /**
+ * pk_updates_detail_popup_menu_select_all:
+ **/
+void
+pk_updates_detail_popup_menu_select_all (GtkWidget *menuitem, gpointer userdata)
+{
+	GtkTreeView *treeview = GTK_TREE_VIEW (userdata);
+	gboolean valid;
+	GtkTreeIter iter;
+	GtkTreeModel *model;
+
+	/* get the first iter in the list */
+	model = gtk_tree_view_get_model (treeview);
+	valid = gtk_tree_model_get_iter_first (model, &iter);
+	while (valid) {
+		gtk_tree_model_get (model, &iter, -1);
+		gtk_list_store_set (GTK_LIST_STORE (model), &iter,
+				    PACKAGES_COLUMN_SELECT, TRUE, -1);
+		valid = gtk_tree_model_iter_next (model, &iter);
+	}
+}
+
+/**
+ * pk_updates_detail_popup_menu_select_none:
+ **/
+void
+pk_updates_detail_popup_menu_select_none (GtkWidget *menuitem, gpointer userdata)
+{
+	GtkTreeView *treeview = GTK_TREE_VIEW (userdata);
+	gboolean valid;
+	GtkTreeIter iter;
+	GtkTreeModel *model;
+
+	/* get the first iter in the list */
+	model = gtk_tree_view_get_model (treeview);
+	valid = gtk_tree_model_get_iter_first (model, &iter);
+	while (valid) {
+		gtk_tree_model_get (model, &iter, -1);
+		gtk_list_store_set (GTK_LIST_STORE (model), &iter,
+				    PACKAGES_COLUMN_SELECT, FALSE, -1);
+		valid = gtk_tree_model_iter_next (model, &iter);
+	}
+}
+
+/**
+ * pk_updates_detail_popup_menu_create:
+ **/
+void
+pk_updates_detail_popup_menu_create (GtkWidget *treeview, GdkEventButton *event, gpointer userdata)
+{
+	GtkWidget *menu, *menuitem;
+
+	menu = gtk_menu_new();
+
+	menuitem = gtk_menu_item_new_with_label ("Select all");
+	g_signal_connect (menuitem, "activate",
+			  G_CALLBACK (pk_updates_detail_popup_menu_select_all), treeview);
+	gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
+
+	menuitem = gtk_menu_item_new_with_label ("Unselect all");
+	g_signal_connect (menuitem, "activate",
+			  G_CALLBACK (pk_updates_detail_popup_menu_select_none), treeview);
+	gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
+
+	menuitem = gtk_menu_item_new_with_label ("Ignore this package");
+	gtk_widget_set_sensitive (GTK_WIDGET (menuitem), FALSE);
+	g_signal_connect (menuitem, "activate",
+			  G_CALLBACK (pk_updates_detail_popup_menu_select_all), treeview);
+	gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
+
+	gtk_widget_show_all (menu);
+	gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL,
+		        (event != NULL) ? event->button : 0,
+		        gdk_event_get_time((GdkEvent*)event));
+}
+
+/**
+ * pk_updates_detail_button_pressed:
+ **/
+gboolean
+pk_updates_detail_button_pressed (GtkWidget *treeview, GdkEventButton *event, gpointer userdata)
+{
+	GtkTreeSelection *selection;
+
+	/* single click with the right mouse button? */
+	if (event->type != GDK_BUTTON_PRESS || event->button != 3) {
+		/* we did not handle this */
+		return FALSE;
+	}
+
+	pk_debug ("Single right click on the tree view");
+
+	/* select the row */
+	selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (treeview));
+	if (gtk_tree_selection_count_selected_rows (selection) <= 1) {
+		GtkTreePath *path;
+		/* Get tree path for row that was clicked */
+		if (gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW (treeview), (gint) event->x, (gint) event->y, &path, NULL, NULL, NULL)) {
+			gtk_tree_selection_unselect_all (selection);
+			gtk_tree_selection_select_path (selection, path);
+			gtk_tree_path_free (path);
+		}
+	}
+
+	/* create */
+	pk_updates_detail_popup_menu_create (treeview, event, userdata);
+	return TRUE;
+}
+
+/**
+ * pk_updates_detail_popup_menu:
+ **/
+gboolean
+pk_updates_detail_popup_menu (GtkWidget *treeview, gpointer userdata)
+{
+	pk_updates_detail_popup_menu_create (treeview, NULL, userdata);
+	return TRUE;
+}
+
+/**
  * main:
  **/
 int
@@ -1840,6 +1959,10 @@ main (int argc, char *argv[])
 	widget = glade_xml_get_widget (glade_xml, "treeview_updates");
 	gtk_tree_view_set_model (GTK_TREE_VIEW (widget),
 				 GTK_TREE_MODEL (list_store_details));
+	g_signal_connect (widget, "popup-menu",
+			  G_CALLBACK (pk_updates_detail_popup_menu), NULL);
+	g_signal_connect (widget, "button-press-event",
+			  G_CALLBACK (pk_updates_detail_button_pressed), NULL);
 
 	selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (widget));
 	gtk_tree_selection_set_mode (selection, GTK_SELECTION_BROWSE);

gpk-show-icon-no-severity.patch:

--- NEW FILE gpk-show-icon-no-severity.patch ---
commit 5cf99815c8b8a7ec0ec11d00a22801bb750fee73
Author: Richard Hughes <richard at hughsie.com>
Date:   Wed Apr 9 02:17:26 2008 +0100

    show the icon when we have updates without severity

diff --git a/src/gpk-notify.c b/src/gpk-notify.c
index e619f34..79ba168 100644
--- a/src/gpk-notify.c
+++ b/src/gpk-notify.c
@@ -691,6 +691,7 @@ gpk_notify_query_updates_finished_cb (PkClient *client, PkExitEnum exit, guint r
 	PkUpdateEnum update;
 	PkPackageId *ident;
 	GPtrArray *security_array;
+	const gchar *icon;
 
 	g_return_if_fail (GPK_IS_NOTIFY (notify));
 
@@ -734,26 +735,22 @@ gpk_notify_query_updates_finished_cb (PkClient *client, PkExitEnum exit, guint r
 		goto out;
 	}
 
+	/* work out icon */
+	icon = gpk_notify_get_best_update_icon (notify, client);
+	gpk_smart_icon_set_icon_name (notify->priv->sicon, icon);
+
+	/* make tooltip */
+	if (status_security->len != 0) {
+		g_string_set_size (status_security, status_security->len-1);
+	}
+	g_string_append_printf (status_tooltip, ngettext ("There is %d update pending",
+							  "There are %d updates pending", length), length);
+	gpk_smart_icon_set_tooltip (notify->priv->sicon, status_tooltip->str);
+
 	/* is policy none? */
 	if (update == PK_UPDATE_ENUM_NONE) {
-		const gchar *icon;
 		pk_debug ("not updating as policy NONE");
 
-		/* work out icon */
-		icon = gpk_notify_get_best_update_icon (notify, client);
-
-		/* trim off extra newlines */
-		if (status_security->len != 0) {
-			g_string_set_size (status_security, status_security->len-1);
-		}
-
-		/* make tooltip */
-		g_string_append_printf (status_tooltip, ngettext ("There is %d update pending",
-								  "There are %d updates pending", length), length);
-
-		gpk_smart_icon_set_icon_name (notify->priv->sicon, icon);
-		gpk_smart_icon_set_tooltip (notify->priv->sicon, status_tooltip->str);
-
 		/* do we warn the user? */
 		if (security_array->len > 0) {
 			gpk_notify_critical_updates_warning (notify, status_security->str, length);
@@ -765,6 +762,10 @@ gpk_notify_query_updates_finished_cb (PkClient *client, PkExitEnum exit, guint r
 	ret = gpk_notify_check_on_battery (notify);
 	if (!ret) {
 		pk_debug ("on battery so not doing update");
+		/* do we warn the user? */
+		if (security_array->len > 0) {
+			gpk_notify_critical_updates_warning (notify, status_security->str, length);
+		}
 		goto out;
 	}
 


Index: gnome-packagekit.spec
===================================================================
RCS file: /cvs/pkgs/rpms/gnome-packagekit/devel/gnome-packagekit.spec,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- gnome-packagekit.spec	6 Apr 2008 05:37:39 -0000	1.19
+++ gnome-packagekit.spec	9 Apr 2008 17:47:26 -0000	1.20
@@ -4,7 +4,7 @@
 Summary:   GNOME PackageKit Client
 Name:      gnome-packagekit
 Version:   %{packagekit_version}
-Release:   1%{?dist}
+Release:   2%{?dist}
 License:   GPLv2+
 Group:     Applications/System
 URL:       http://www.packagekit.org
@@ -13,6 +13,13 @@
 Patch0:    gnome-packagekit-enable-kde.patch
 # handle failed restarts a little better
 Patch1:	   ck-multi.patch
+# pull some UI fixes from upstream
+Patch2:	   gpk-select-all.patch
+Patch3:	   gpk-select-all-hide-more.patch
+Patch4:	   gpk-dont-show-initial-package.patch
+Patch5:	   gpk-dont-show-refresh-when-update-packages.patch
+Patch6:	   gpk-show-icon-no-severity.patch
+Patch7:	   gpk-hide-icon-when--update-packages.patch
 Requires:  gtk2 >= 2.12.0
 Requires:  gnome-icon-theme
 Requires:  libnotify >= 0.4.3
@@ -52,6 +59,12 @@
 %setup -q
 %patch0 -p1
 %patch1 -p1 -b .ck-multi
+%patch2 -p1 -b .gpk-select-all
+%patch3 -p1 -b .gpk-select-all-hide-more
+%patch4 -p1 -b .gpk-dont-show-initial-package
+%patch5 -p1 -b .gpk-dont-show-refresh-when-update-packages
+%patch6 -p1 -b .gpk-show-icon-no-severity
+%patch7 -p1 -b .gpk-hide-icon-when--update-packages
 
 %build
 %configure --disable-scrollkeeper --disable-schemas-install
@@ -126,6 +139,9 @@
 %{_datadir}/applications/gpk-*.desktop
 
 %changelog
+* Sat Apr  9 2008 Richard Hughes  <rhughes at redhat.com> - 0.1.11-2
+- Fix a plethora of GUI bugs by pulling some fixes from upstream
+
 * Sat Apr  5 2008 Matthias Clasen  <mclasen at redhat.com> - 0.1.11-1
 - Update to 0.1.11
 




More information about the fedora-extras-commits mailing list