From 89f1d9c97e7862f32807841ff245207f17236896 Mon Sep 17 00:00:00 2001 From: Guido Günther Date: Sat, 9 Aug 2014 15:38:06 +0200 Subject: Add about dialog --- src/app-menu.ui | 4 ++++ src/uplanfahr.c | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) 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 @@ -9,6 +9,10 @@
+ + _About + app.about + _Quit app.quit 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 #include #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 ", + 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} } }; -- cgit v1.2.3