aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/app-menu.ui4
-rw-r--r--src/uplanfahr.c33
2 files changed, 37 insertions, 0 deletions
diff --git a/src/app-menu.ui b/src/app-menu.ui
index b0eddb6..ae0f89e 100644
--- a/src/app-menu.ui
+++ b/src/app-menu.ui
@@ -10,6 +10,10 @@
</section>
<section>
<item>
+ <attribute name="label" translatable="yes">_About</attribute>
+ <attribute name="action">app.about</attribute>
+ </item>
+ <item>
<attribute name="label" translatable="yes">_Quit</attribute>
<attribute name="action">app.quit</attribute>
<attribute name="accel"><![CDATA[<Ctrl>Q]]></attribute>
diff --git a/src/uplanfahr.c b/src/uplanfahr.c
index e87d25e..d936165 100644
--- a/src/uplanfahr.c
+++ b/src/uplanfahr.c
@@ -1,3 +1,6 @@
+#include "config.h"
+
+#include <glib/gi18n.h>
#include <gtk/gtk.h>
#include "uplanfahr.h"
@@ -34,6 +37,35 @@ preferences_activated (GSimpleAction *action,
gtk_window_present (GTK_WINDOW (prefs));
}
+
+static void
+about_activated (GSimpleAction *action,
+ GVariant *parameter,
+ gpointer app)
+{
+ GtkWindow *parent = gtk_application_get_active_window (GTK_APPLICATION (app));
+
+ const gchar *authors[] = {
+ "Guido Günther <agx@sigxcpu.org>",
+ NULL
+ };
+
+ gtk_show_about_dialog (parent,
+ "authors", authors,
+ "version", VERSION,
+ "logo-icon-name", "uplanfahr",
+ "copyright",
+ "Copyright (C) 2014 Guido Günther",
+ "website-label", PACKAGE " website",
+ "website",
+ "https://honk.sigxcpu.org/piki/projects/libplanfahr",
+ "license", "GNU General Public License Version 3",
+ /* Translators: add the translators of your language here */
+ "translator-credits", _("translator-credits"),
+ NULL);
+}
+
+
static void
quit_activated (GSimpleAction *action,
GVariant *parameter,
@@ -45,6 +77,7 @@ quit_activated (GSimpleAction *action,
static GActionEntry app_entries[] =
{
{ "preferences", preferences_activated, NULL, NULL, NULL, {0, 0, 0} },
+ { "about", about_activated, NULL, NULL, NULL, {0, 0, 0} },
{ "quit", quit_activated, NULL, NULL, NULL, {0, 0, 0} }
};