[gnome-builder] about: just use GtkAboutDialog for now.



commit b90ad23dfd349ca64af852a7c9982a06534b2326
Author: Christian Hergert <christian hergert me>
Date:   Sun Sep 14 20:09:03 2014 -0700

    about: just use GtkAboutDialog for now.

 ARTISTS                                   |    2 +
 AUTHORS                                   |    1 +
 src/app/gb-application.c                  |   45 +++++++++++++++++++++++++++--
 src/resources/gnome-builder.gresource.xml |    4 ++
 4 files changed, 49 insertions(+), 3 deletions(-)
---
diff --git a/ARTISTS b/ARTISTS
new file mode 100644
index 0000000..4091784
--- /dev/null
+++ b/ARTISTS
@@ -0,0 +1,2 @@
+Allan Day
+Jakub Steiner
diff --git a/AUTHORS b/AUTHORS
index 8d4beeb..ef5c516 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -1,3 +1,4 @@
 Carlos Soriano
 Christian Hergert
+Cosimo Cecchi
 Jakub Steiner
diff --git a/TRANSLATORS b/TRANSLATORS
new file mode 100644
index 0000000..e69de29
diff --git a/src/app/gb-application.c b/src/app/gb-application.c
index 5fb8b91..f9f7f1d 100644
--- a/src/app/gb-application.c
+++ b/src/app/gb-application.c
@@ -17,7 +17,11 @@
  */
 
 #define G_LOG_DOMAIN "app"
-#define ADWAITA_CSS "resource:///org/gnome/builder/css/builder.Adwaita.css"
+#define ADWAITA_CSS  "resource:///org/gnome/builder/css/builder.Adwaita.css"
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
 
 #include <glib/gi18n.h>
 
@@ -205,13 +209,48 @@ on_about_activate (GSimpleAction *action,
                    gpointer       user_data)
 {
   GtkWindow *window;
+  GList *list;
+  GBytes *bytes;
+  gchar **authors;
+  gchar **artists;
+  gchar *translators;
+
+  list = gtk_application_get_windows (GTK_APPLICATION (user_data));
+
+  bytes = g_resources_lookup_data ("/org/gnome/builder/AUTHORS", 0, NULL);
+  authors = g_strsplit (g_bytes_get_data (bytes, NULL), "\n", 0);
+  g_bytes_unref (bytes);
 
-  window = g_object_new (GB_TYPE_ABOUT_WINDOW,
-                         "title", _("About Builder"),
+  bytes = g_resources_lookup_data ("/org/gnome/builder/ARTISTS", 0, NULL);
+  artists = g_strsplit (g_bytes_get_data (bytes, NULL), "\n", 0);
+  g_bytes_unref (bytes);
+
+  bytes = g_resources_lookup_data ("/org/gnome/builder/TRANSLATORS", 0, NULL);
+  translators = g_strdup (g_bytes_get_data (bytes, NULL));
+  g_bytes_unref (bytes);
+
+  window = g_object_new (GTK_TYPE_ABOUT_DIALOG,
+                         "artists", artists,
+                         "authors", authors,
+                         "comments", _("Builder is an IDE for writing GNOME applications."),
+                         "copyright", "Copyright © 2014 Christian Hergert",
+                         "license-type", GTK_LICENSE_GPL_3_0,
+                         "logo-icon-name", "builder",
+                         "modal", TRUE,
+                         "program-name", _("GNOME Builder"),
+                         "transient-for", list ? list->data : NULL,
+                         "translator-credits", translators,
+                         "version", PACKAGE_VERSION,
+                         "website", "https://live.gnome.org/Apps/Builder";,
+                         "website-label", _("Builder Website"),
                          "window-position", GTK_WIN_POS_CENTER,
                          NULL);
 
   gtk_window_present (window);
+
+  g_strfreev (authors);
+  g_strfreev (artists);
+  g_free (translators);
 }
 
 static void
diff --git a/src/resources/gnome-builder.gresource.xml b/src/resources/gnome-builder.gresource.xml
index da72954..e9dfee6 100644
--- a/src/resources/gnome-builder.gresource.xml
+++ b/src/resources/gnome-builder.gresource.xml
@@ -1,6 +1,10 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <gresources>
   <gresource prefix="/org/gnome/builder">
+    <file alias="AUTHORS">../../AUTHORS</file>
+    <file alias="ARTISTS">../../ARTISTS</file>
+    <file alias="TRANSLATORS">../../TRANSLATORS</file>
+
     <file>css/builder.Adwaita.css</file>
     <file>css/markdown.css</file>
 


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