[gnome-packagekit/glib2: 71/79] Moo



commit 2e33bda76f743ebdd4802cafd41309b0744e3df5
Author: Richard Hughes <richard hughsie com>
Date:   Mon Oct 5 13:19:15 2009 +0100

    Moo

 src/gpk-dbus-task.c |  104 +++++++++++++++++++++++++-------------------------
 1 files changed, 52 insertions(+), 52 deletions(-)
---
diff --git a/src/gpk-dbus-task.c b/src/gpk-dbus-task.c
index 638d89e..0c546c5 100644
--- a/src/gpk-dbus-task.c
+++ b/src/gpk-dbus-task.c
@@ -256,6 +256,58 @@ gpk_dbus_task_error_msg (GpkDbusTask *dtask, const gchar *title, GError *error)
 }
 
 /**
+ * gpk_dbus_task_handle_error:
+ **/
+static void
+gpk_dbus_task_handle_error (GpkDbusTask *dtask, PkItemErrorCode *error_item)
+{
+	gboolean ret;
+	GError *error = NULL;
+	const gchar *title;
+	const gchar *message;
+	NotifyNotification *notification;
+	GtkWidget *widget;
+
+	/* save for later */
+	dtask->priv->last_exit_code = error_item->code;
+
+	/* ignore some errors */
+	if (error_item->code == PK_ERROR_ENUM_NO_LICENSE_AGREEMENT ||
+	    error_item->code == PK_ERROR_ENUM_PROCESS_KILL ||
+	    error_item->code == PK_ERROR_ENUM_TRANSACTION_CANCELLED) {
+		egg_warning ("ignoring %s", pk_error_enum_to_text (error_item->code));
+	}
+
+	egg_debug ("code was %s", pk_error_enum_to_text (error_item->code));
+
+	/* use a modal dialog if showing progress, else use libnotify */
+	title = gpk_error_enum_to_localised_text (error_item->code);
+	message = gpk_error_enum_to_localised_message (error_item->code);
+	if (dtask->priv->show_progress) {
+		widget = GTK_WIDGET (gpk_modal_dialog_get_window (dtask->priv->dialog));
+		gpk_error_dialog_modal (GTK_WINDOW (widget), title, message, error_item->details);
+		return;
+	}
+
+	/* save this globally */
+	g_free (dtask->priv->error_details);
+	dtask->priv->error_details = g_markup_escape_text (error_item->details, -1);
+
+	/* do the bubble */
+	notification = notify_notification_new (title, message, "help-browser", NULL);
+	notify_notification_set_timeout (notification, 15000);
+	notify_notification_set_urgency (notification, NOTIFY_URGENCY_LOW);
+	notify_notification_add_action (notification, "show-error-details",
+					/* TRANSLATORS: button: show details about the error */
+					_("Show details"), gpk_dbus_task_libnotify_cb, dtask, NULL);
+	ret = notify_notification_show (notification, &error);
+	if (!ret) {
+		egg_warning ("error: %s", error->message);
+		g_error_free (error);
+	}
+}
+
+/**
  * gpk_dbus_task_install_packages_cb:
  **/
 static void
@@ -442,58 +494,6 @@ gpk_dbus_task_set_status (GpkDbusTask *dtask, PkStatusEnum status)
 }
 
 /**
- * gpk_dbus_task_handle_error:
- **/
-static void
-gpk_dbus_task_handle_error (GpkDbusTask *dtask, PkItemErrorCode *error_item)
-{
-	gboolean ret;
-	GError *error = NULL;
-	const gchar *title;
-	const gchar *message;
-	NotifyNotification *notification;
-	GtkWidget *widget;
-
-	/* save for later */
-	dtask->priv->last_exit_code = error_item->code;
-
-	/* ignore some errors */
-	if (error_item->code == PK_ERROR_ENUM_NO_LICENSE_AGREEMENT ||
-	    error_item->code == PK_ERROR_ENUM_PROCESS_KILL ||
-	    error_item->code == PK_ERROR_ENUM_TRANSACTION_CANCELLED) {
-		egg_warning ("ignoring %s", pk_error_enum_to_text (error_item->code));
-	}
-
-	egg_debug ("code was %s", pk_error_enum_to_text (error_item->code));
-
-	/* use a modal dialog if showing progress, else use libnotify */
-	title = gpk_error_enum_to_localised_text (error_item->code);
-	message = gpk_error_enum_to_localised_message (error_item->code);
-	if (dtask->priv->show_progress) {
-		widget = GTK_WIDGET (gpk_modal_dialog_get_window (dtask->priv->dialog));
-		gpk_error_dialog_modal (GTK_WINDOW (widget), title, message, details);
-		return;
-	}
-
-	/* save this globally */
-	g_free (dtask->priv->error_details);
-	dtask->priv->error_details = g_markup_escape_text (error_item->details, -1);
-
-	/* do the bubble */
-	notification = notify_notification_new (title, message, "help-browser", NULL);
-	notify_notification_set_timeout (notification, 15000);
-	notify_notification_set_urgency (notification, NOTIFY_URGENCY_LOW);
-	notify_notification_add_action (notification, "show-error-details",
-					/* TRANSLATORS: button: show details about the error */
-					_("Show details"), gpk_dbus_task_libnotify_cb, dtask, NULL);
-	ret = notify_notification_show (notification, &error);
-	if (!ret) {
-		egg_warning ("error: %s", error->message);
-		g_error_free (error);
-	}
-}
-
-/**
  * gpk_dbus_task_button_close_cb:
  **/
 static void



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