[gnome-photos] main-window: Prevent multiple about dialogs from opening



commit daba68adac4f1902c7f800df2b27348ec8569479
Author: Alessandro Bono <shadow openaliasbox org>
Date:   Tue Feb 24 23:53:07 2015 +0100

    main-window: Prevent multiple about dialogs from opening
    
    https://bugzilla.gnome.org/show_bug.cgi?id=744841

 src/photos-main-window.c |   42 ++++++++++++++++--------------------------
 1 files changed, 16 insertions(+), 26 deletions(-)
---
diff --git a/src/photos-main-window.c b/src/photos-main-window.c
index 96fdb3e..6100aa9 100644
--- a/src/photos-main-window.c
+++ b/src/photos-main-window.c
@@ -457,30 +457,20 @@ photos_main_window_new (GtkApplication *application)
 void
 photos_main_window_show_about (PhotosMainWindow *self)
 {
-  GtkWidget *about_dialog;
-
-  about_dialog = gtk_about_dialog_new ();
-  gtk_window_set_modal (GTK_WINDOW (about_dialog), TRUE);
-  gtk_window_set_transient_for (GTK_WINDOW (about_dialog), GTK_WINDOW (self));
-
-  gtk_about_dialog_set_artists (GTK_ABOUT_DIALOG (about_dialog), PHOTOS_ARTISTS);
-  gtk_about_dialog_set_authors (GTK_ABOUT_DIALOG (about_dialog), PHOTOS_AUTHORS);
-  gtk_about_dialog_set_comments (GTK_ABOUT_DIALOG (about_dialog),
-                                 _("Access, organize and share your photos on GNOME"));
-  gtk_about_dialog_set_copyright (GTK_ABOUT_DIALOG (about_dialog),
-                                  "Copyright © 2013 Intel Corporation. All rights reserved.\n"
-                                  "Copyright © 2014, 2015 Pranav Kant\n"
-                                  "Copyright © 2012, 2013, 2014 Red Hat, Inc.");
-  gtk_about_dialog_set_license_type (GTK_ABOUT_DIALOG (about_dialog), GTK_LICENSE_GPL_2_0);
-  gtk_about_dialog_set_logo_icon_name (GTK_ABOUT_DIALOG (about_dialog), PACKAGE_TARNAME);
-  gtk_about_dialog_set_program_name (GTK_ABOUT_DIALOG (about_dialog), _(PACKAGE_NAME));
-  gtk_about_dialog_set_version (GTK_ABOUT_DIALOG (about_dialog), _(PACKAGE_VERSION));
-  gtk_about_dialog_set_website (GTK_ABOUT_DIALOG (about_dialog), PACKAGE_URL);
-  gtk_about_dialog_set_wrap_license (GTK_ABOUT_DIALOG (about_dialog), TRUE);
-
-  /* Translators: Put your names here */
-  gtk_about_dialog_set_translator_credits (GTK_ABOUT_DIALOG (about_dialog), _("translator-credits"));
-
-  gtk_widget_show (about_dialog);
-  g_signal_connect (about_dialog, "response", G_CALLBACK (gtk_widget_destroy), NULL);
+  gtk_show_about_dialog (GTK_WINDOW (self),
+                         "artists", PHOTOS_ARTISTS,
+                         "authors", PHOTOS_AUTHORS,
+                         "comments", _("Access, organize and share your photos on GNOME"),
+                         "copyright", _("Copyright © 2013 Intel Corporation. All rights reserved.\n"
+                                        "Copyright © 2014, 2015 Pranav Kant\n"
+                                        "Copyright © 2012, 2013, 2014 Red Hat, Inc."),
+                         "license-type", GTK_LICENSE_GPL_2_0,
+                         "logo-icon-name", PACKAGE_TARNAME,
+                         "program-name", _(PACKAGE_NAME),
+                         "version", _(PACKAGE_VERSION),
+                         "website", PACKAGE_URL,
+                         "wrap-license", TRUE,
+                         /* Translators: Put your names here */
+                         "translator-credits", _("translator-credits"),
+                         NULL);
 }


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