[gnome-software] offline updates: Show the error dialog with a parent window



commit 44fd3f0ab5d114c46c4d603f71d7de1916077605
Author: Rafal Luzynski <digitalfreak lingonborough com>
Date:   Wed Jun 10 20:59:08 2015 -0400

    offline updates: Show the error dialog with a parent window
    
    This patch shows the main window first and then sets it as
    a transient parent of the offline update error message dialog.
    
    Partially fixes https://bugzilla.gnome.org/show_bug.cgi?id=748936

 src/gs-application.c     |    7 ++++++-
 src/gs-offline-updates.c |    4 ++--
 src/gs-offline-updates.h |    4 +++-
 3 files changed, 11 insertions(+), 4 deletions(-)
---
diff --git a/src/gs-application.c b/src/gs-application.c
index 09d0e47..284cd17 100644
--- a/src/gs-application.c
+++ b/src/gs-application.c
@@ -458,7 +458,12 @@ show_offline_updates_error (GSimpleAction *action,
                            GVariant      *parameter,
                            gpointer       data)
 {
-       gs_offline_updates_show_error ();
+       GsApplication *app = GS_APPLICATION (data);
+
+       initialize_ui_and_present_window (app);
+
+       gs_shell_set_mode (app->shell, GS_SHELL_MODE_UPDATES);
+       gs_offline_updates_show_error (app->shell);
 }
 
 static void
diff --git a/src/gs-offline-updates.c b/src/gs-offline-updates.c
index 248da86..d741ec5 100644
--- a/src/gs-offline-updates.c
+++ b/src/gs-offline-updates.c
@@ -253,7 +253,7 @@ insert_details_widget (GtkMessageDialog *dialog, const gchar *details)
 }
 
 void
-gs_offline_updates_show_error (void)
+gs_offline_updates_show_error (GsShell *shell)
 {
        const gchar *title;
        const gchar *secondary;
@@ -279,7 +279,7 @@ gs_offline_updates_show_error (void)
        secondary = prepare_secondary_text (pk_error);
        geeky = prepare_details (pk_error);
 
-       dialog = gtk_message_dialog_new_with_markup (NULL,
+       dialog = gtk_message_dialog_new_with_markup (gs_shell_get_window (shell),
                                         0,
                                         GTK_MESSAGE_INFO,
                                         GTK_BUTTONS_CLOSE,
diff --git a/src/gs-offline-updates.h b/src/gs-offline-updates.h
index 39d38f3..30ec348 100644
--- a/src/gs-offline-updates.h
+++ b/src/gs-offline-updates.h
@@ -24,9 +24,11 @@
 
 #include <gtk/gtk.h>
 
+#include "gs-shell.h"
+
 G_BEGIN_DECLS
 
-void     gs_offline_updates_show_error         (void);
+void     gs_offline_updates_show_error         (GsShell *shell);
 
 GPermission    *gs_offline_updates_permission_get      (void);
 gboolean         gs_updates_are_managed                (void);


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