Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:11.4
gnome-packagekit
gnome-packagekit-BNC383261.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File gnome-packagekit-BNC383261.patch of Package gnome-packagekit
Index: gnome-packagekit-2.30.0/src/gpk-check-update.c =================================================================== --- gnome-packagekit-2.30.0.orig/src/gpk-check-update.c +++ gnome-packagekit-2.30.0/src/gpk-check-update.c @@ -454,6 +454,11 @@ gpk_check_update_show_error (GpkCheckUpd g_object_unref (cupdate->priv->error_code); cupdate->priv->error_code = g_object_ref (error_code); + if (error_enum == PK_ERROR_ENUM_DEP_RESOLUTION_FAILED) { + gpk_error_dialog_modal_yast (NULL, title, message, pk_error_get_details (error_code)); + goto out; + } + /* do the bubble */ egg_debug ("title=%s, message=%s", title, message); notification = notify_notification_new_with_status_icon (title, message, "help-browser", cupdate->priv->status_icon); Index: gnome-packagekit-2.30.0/src/gpk-dbus-task.c =================================================================== --- gnome-packagekit-2.30.0.orig/src/gpk-dbus-task.c +++ gnome-packagekit-2.30.0/src/gpk-dbus-task.c @@ -337,7 +337,7 @@ gpk_dbus_task_error_msg (GpkDbusTask *dt /* hide the main window */ window = gpk_modal_dialog_get_window (dtask->priv->dialog); - gpk_error_dialog_modal_with_time (window, title, message, details, dtask->priv->timestamp); + gpk_error_dialog_modal_with_time (window, title, message, details, dtask->priv->timestamp, FALSE); } /** Index: gnome-packagekit-2.30.0/src/gpk-error.c =================================================================== --- gnome-packagekit-2.30.0.orig/src/gpk-error.c +++ gnome-packagekit-2.30.0/src/gpk-error.c @@ -33,6 +33,32 @@ #include "gpk-common.h" #include "gpk-error.h" +static gboolean +gpk_error_dialog_run_yast (gpointer unused) +{ + gboolean retval; + GError *error = NULL; + + PkControl *control = pk_control_new (); + if (!pk_control_suggest_daemon_quit(control, NULL, &error)) + egg_debug ("Failure calling pk_control_suggest_daemon_quit:%s", error->message); + g_object_unref (control); + + retval = g_spawn_command_line_async ("gnomesu -- /sbin/yast2 online_update", NULL); + if (!retval) + egg_debug ("Failure launching yast2 online_update"); + return FALSE; +} + +static void +gpk_error_dialog_yast_cb (GtkButton *button, gpointer data) +{ + egg_debug ("user wants to try YaST..."); + /* we want to make sure and finish up outstanding stuff before we launch yast so we can release the libzypp lock */ + g_timeout_add_seconds (2, gpk_error_dialog_run_yast, NULL); + gtk_main_quit (); +} + /** * gpk_error_dialog_expanded_cb: **/ @@ -61,13 +87,15 @@ gpk_error_dialog_expanded_cb (GObject *o * Shows a modal error, and blocks until the user clicks close **/ gboolean -gpk_error_dialog_modal_with_time (GtkWindow *window, const gchar *title, const gchar *message, const gchar *details, guint timestamp) +gpk_error_dialog_modal_with_time (GtkWindow *window, const gchar *title, const gchar *message, const gchar *details, guint timestamp, gboolean prompt_yast) { GtkWidget *widget; + GtkWidget *button; GtkBuilder *builder; GtkTextBuffer *buffer = NULL; guint retval; GError *error = NULL; + gchar *full_message; g_return_val_if_fail (message != NULL, FALSE); @@ -110,8 +138,22 @@ gpk_error_dialog_modal_with_time (GtkWin gtk_label_set_label (GTK_LABEL (widget), title); /* message */ + if (prompt_yast) { + egg_debug ("DEP_RES failed - will ask if they want to try yast"); + full_message = g_strconcat (message, "\n\n", _("To try and manually resolve problems use the YaST \"Online Update\" module"), NULL); + button = gtk_button_new_with_label(_("Start YaST and install updates manually")); + g_signal_connect (button, "clicked", G_CALLBACK (gpk_error_dialog_yast_cb), NULL); + /* add to box */ + widget = GTK_WIDGET (gtk_builder_get_object (builder, "dialog_error")); + widget = gtk_dialog_get_action_area (GTK_DIALOG(widget)); + gtk_box_pack_start (GTK_BOX (widget), button, TRUE, TRUE, 0); + gtk_widget_show (button); + } + else + full_message = g_strdup (message); widget = GTK_WIDGET (gtk_builder_get_object (builder, "label_message")); - gtk_label_set_markup (GTK_LABEL (widget), message); + gtk_label_set_markup (GTK_LABEL (widget), full_message); + g_free (full_message); /* show text in the expander */ if (details == NULL || details[0] == '\0') { @@ -155,7 +197,13 @@ out_build: gboolean gpk_error_dialog_modal (GtkWindow *window, const gchar *title, const gchar *message, const gchar *details) { - return gpk_error_dialog_modal_with_time (window, title, message, details, 0); + return gpk_error_dialog_modal_with_time (window, title, message, details, 0, FALSE); +} + +gboolean +gpk_error_dialog_modal_yast (GtkWindow *window, const gchar *title, const gchar *message, const gchar *details) +{ + return gpk_error_dialog_modal_with_time (window, title, message, details, 0, TRUE); } /** Index: gnome-packagekit-2.30.0/src/gpk-error.h =================================================================== --- gnome-packagekit-2.30.0.orig/src/gpk-error.h +++ gnome-packagekit-2.30.0/src/gpk-error.h @@ -37,7 +37,12 @@ gboolean gpk_error_dialog_modal_with_ti const gchar *title, const gchar *message, const gchar *details, - guint timestamp); + guint timestamp, + gboolean prompt_yast); +gboolean gpk_error_dialog_modal_yast (GtkWindow *window, + const gchar *title, + const gchar *message, + const gchar *details); G_END_DECLS Index: gnome-packagekit-2.30.0/src/gpk-update-viewer.c =================================================================== --- gnome-packagekit-2.30.0.orig/src/gpk-update-viewer.c +++ gnome-packagekit-2.30.0/src/gpk-update-viewer.c @@ -487,8 +487,12 @@ gpk_update_viewer_update_packages_cb (Pk CA_PROP_EVENT_DESCRIPTION, _("Failed to update"), NULL); window = GTK_WINDOW(gtk_builder_get_object (priv->builder, "dialog_updates")); - gpk_error_dialog_modal (window, gpk_error_enum_to_localised_text (pk_error_get_code (error_code)), - gpk_error_enum_to_localised_message (pk_error_get_code (error_code)), pk_error_get_details (error_code)); + if (pk_error_get_code (error_code) == PK_ERROR_ENUM_DEP_RESOLUTION_FAILED) { + gpk_error_dialog_modal_yast (window, gpk_error_enum_to_localised_text (pk_error_get_code (error_code)), + gpk_error_enum_to_localised_message (pk_error_get_code (error_code)), pk_error_get_details (error_code)); + } else + gpk_error_dialog_modal (window, gpk_error_enum_to_localised_text (pk_error_get_code (error_code)), + gpk_error_enum_to_localised_message (pk_error_get_code (error_code)), pk_error_get_details (error_code)); /* re-enable the package list */ gpk_update_viewer_packages_set_sensitive (update_viewer, TRUE); @@ -2098,8 +2102,12 @@ gpk_update_viewer_get_details_cb (PkClie egg_warning ("failed to get details: %s, %s", pk_error_enum_to_text (pk_error_get_code (error_code)), pk_error_get_details (error_code)); window = GTK_WINDOW(gtk_builder_get_object (priv->builder, "dialog_updates")); - gpk_error_dialog_modal (window, gpk_error_enum_to_localised_text (pk_error_get_code (error_code)), - gpk_error_enum_to_localised_message (pk_error_get_code (error_code)), pk_error_get_details (error_code)); + if (pk_error_get_code (error_code) == PK_ERROR_ENUM_DEP_RESOLUTION_FAILED) { + gpk_error_dialog_modal_yast (window, gpk_error_enum_to_localised_text (pk_error_get_code (error_code)), + gpk_error_enum_to_localised_message (pk_error_get_code (error_code)), pk_error_get_details (error_code)); + } else + gpk_error_dialog_modal (window, gpk_error_enum_to_localised_text (pk_error_get_code (error_code)), + gpk_error_enum_to_localised_message (pk_error_get_code (error_code)), pk_error_get_details (error_code)); goto out; } @@ -2197,8 +2205,12 @@ gpk_update_viewer_get_update_detail_cb ( egg_warning ("failed to get update details: %s, %s", pk_error_enum_to_text (pk_error_get_code (error_code)), pk_error_get_details (error_code)); window = GTK_WINDOW(gtk_builder_get_object (priv->builder, "dialog_updates")); - gpk_error_dialog_modal (window, gpk_error_enum_to_localised_text (pk_error_get_code (error_code)), - gpk_error_enum_to_localised_message (pk_error_get_code (error_code)), pk_error_get_details (error_code)); + if (pk_error_get_code (error_code) == PK_ERROR_ENUM_DEP_RESOLUTION_FAILED) { + gpk_error_dialog_modal_yast (window, gpk_error_enum_to_localised_text (pk_error_get_code (error_code)), + gpk_error_enum_to_localised_message (pk_error_get_code (error_code)), pk_error_get_details (error_code)); + } else + gpk_error_dialog_modal (window, gpk_error_enum_to_localised_text (pk_error_get_code (error_code)), + gpk_error_enum_to_localised_message (pk_error_get_code (error_code)), pk_error_get_details (error_code)); goto out; } @@ -2582,8 +2594,12 @@ gpk_update_viewer_get_updates_cb (PkClie egg_warning ("failed to get updates: %s, %s", pk_error_enum_to_text (pk_error_get_code (error_code)), pk_error_get_details (error_code)); window = GTK_WINDOW(gtk_builder_get_object (priv->builder, "dialog_updates")); - gpk_error_dialog_modal (window, gpk_error_enum_to_localised_text (pk_error_get_code (error_code)), - gpk_error_enum_to_localised_message (pk_error_get_code (error_code)), pk_error_get_details (error_code)); + if (pk_error_get_code (error_code) == PK_ERROR_ENUM_DEP_RESOLUTION_FAILED) { + gpk_error_dialog_modal_yast (window, gpk_error_enum_to_localised_text (pk_error_get_code (error_code)), + gpk_error_enum_to_localised_message (pk_error_get_code (error_code)), pk_error_get_details (error_code)); + } else + gpk_error_dialog_modal (window, gpk_error_enum_to_localised_text (pk_error_get_code (error_code)), + gpk_error_enum_to_localised_message (pk_error_get_code (error_code)), pk_error_get_details (error_code)); goto out; } @@ -2994,8 +3010,12 @@ gpk_update_viewer_get_distro_upgrades_cb egg_warning ("failed to get list of distro upgrades: %s, %s", pk_error_enum_to_text (pk_error_get_code (error_code)), pk_error_get_details (error_code)); window = GTK_WINDOW(gtk_builder_get_object (priv->builder, "dialog_updates")); - gpk_error_dialog_modal (window, gpk_error_enum_to_localised_text (pk_error_get_code (error_code)), - gpk_error_enum_to_localised_message (pk_error_get_code (error_code)), pk_error_get_details (error_code)); + if (pk_error_get_code (error_code) == PK_ERROR_ENUM_DEP_RESOLUTION_FAILED) { + gpk_error_dialog_modal_yast (window, gpk_error_enum_to_localised_text (pk_error_get_code (error_code)), + gpk_error_enum_to_localised_message (pk_error_get_code (error_code)), pk_error_get_details (error_code)); + } else + gpk_error_dialog_modal (window, gpk_error_enum_to_localised_text (pk_error_get_code (error_code)), + gpk_error_enum_to_localised_message (pk_error_get_code (error_code)), pk_error_get_details (error_code)); goto out; }
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor