[gnome-packagekit] trivial: do not show the internal error if the user declined the transaction
- From: Richard Hughes <rhughes src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gnome-packagekit] trivial: do not show the internal error if the user declined the transaction
- Date: Tue, 2 Feb 2010 12:43:51 +0000 (UTC)
commit 528dacb84c3aafa4f829a4b6f82ac38aafffce0a
Author: Richard Hughes <richard hughsie com>
Date: Tue Feb 2 12:43:27 2010 +0000
trivial: do not show the internal error if the user declined the transaction
src/gpk-enum.h | 4 ++++
src/gpk-update-viewer.c | 7 +++++--
2 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/src/gpk-enum.h b/src/gpk-enum.h
index 5e97daa..ec16aa1 100644
--- a/src/gpk-enum.h
+++ b/src/gpk-enum.h
@@ -64,6 +64,10 @@ typedef enum {
#define PK_MESSAGE_ENUM_REPO_FOR_DEVELOPERS_ONLY (PK_MESSAGE_ENUM_REPO_METADATA_DOWNLOAD_FAILED + 1)
#endif
+#if (!PK_CHECK_VERSION(0,6,2))
+#define PK_CLIENT_ERROR_DECLINED_SIMULATION PK_CLIENT_ERROR_FAILED
+#endif
+
void gpk_enum_test (gpointer data);
const gchar *gpk_role_enum_to_localised_past (PkRoleEnum role)
G_GNUC_CONST;
diff --git a/src/gpk-update-viewer.c b/src/gpk-update-viewer.c
index a688f20..4f55b36 100644
--- a/src/gpk-update-viewer.c
+++ b/src/gpk-update-viewer.c
@@ -439,8 +439,11 @@ gpk_update_viewer_update_packages_cb (PkTask *task, GAsyncResult *res, GpkUpdate
/* get the results */
results = pk_task_generic_finish (task, res, &error);
if (results == NULL) {
- /* TRANSLATORS: the PackageKit request did not complete, and it did not send an error */
- gpk_update_viewer_error_dialog (update_viewer, _("Could not update packages"), NULL, error->message);
+ if (error->domain != PK_CLIENT_ERROR ||
+ error->code != PK_CLIENT_ERROR_DECLINED_SIMULATION) {
+ /* TRANSLATORS: the PackageKit request did not complete, and it did not send an error */
+ gpk_update_viewer_error_dialog (update_viewer, _("Could not update packages"), NULL, error->message);
+ }
g_error_free (error);
/* re-enable the package list */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]