[hotssh] Add about dialog



commit 3ead681942ed4f6985bce079877342862bce42ca
Author: Yosef Or Boczko <yoseforb gmail com>
Date:   Wed Nov 27 03:50:48 2013 +0200

    Add about dialog
    
    https://bugzilla.gnome.org/show_bug.cgi?id=719388

 po/POTFILES.in   |    1 +
 src/app-menu.ui  |    4 ++++
 src/hotssh-app.c |   32 ++++++++++++++++++++++++++++++++
 3 files changed, 37 insertions(+), 0 deletions(-)
---
diff --git a/po/POTFILES.in b/po/POTFILES.in
index de74901..7ff1cc9 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -1,4 +1,5 @@
 [encoding: UTF-8]
+src/hotssh-app.c
 src/hotssh-win.c
 src/hotssh-tab.c
 [type: gettext/glade]src/app-menu.ui
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/hotssh-app.c b/src/hotssh-app.c
index 32e05fe..b05b469 100644
--- a/src/hotssh-app.c
+++ b/src/hotssh-app.c
@@ -18,6 +18,8 @@
  * Boston, MA 02111-1307, USA.
  */
 
+#include "config.h"
+
 #include "hotssh-app.h"
 #include "hotssh-search-provider.h"
 #include "hotssh-win.h"
@@ -25,6 +27,8 @@
 
 #include "libgsystem.h"
 
+#include <glib/gi18n.h>
+
 struct _HotSshApp
 {
   GtkApplication parent;
@@ -57,6 +61,33 @@ preferences_activated (GSimpleAction *action,
 }
 
 static void
+about_activated (GSimpleAction *action,
+                 GVariant      *parameter,
+                 gpointer       app)
+{
+  const gchar *authors[] = {
+    "Colin Walters <walters verbum org>",
+    NULL
+  };
+  GtkWindow *parent;
+
+  parent = gtk_application_get_active_window (GTK_APPLICATION (app));
+
+  gtk_show_about_dialog (parent,
+                         "authors", authors,
+                         "comments", _("SSH client"),
+                         "copyright", "Copyright \xc2\xa9 2013 Colin Walters",
+                         "license-type", GTK_LICENSE_LGPL_2_1,
+                         "logo-icon-name", "hotssh",
+                         "program-name", _("HotSSH"),
+                         "translator-credits", _("translator_credits"),
+                         "version", PACKAGE_VERSION,
+                         "website", "https://wiki.gnome.org/Apps/HotSSH";,
+                         "website-label", _("HotSSH Website"),
+                         NULL);
+}
+
+static void
 quit_activated (GSimpleAction *action,
                 GVariant      *parameter,
                 gpointer       app)
@@ -67,6 +98,7 @@ quit_activated (GSimpleAction *action,
 static GActionEntry app_entries[] =
 {
   { "preferences", preferences_activated, NULL, NULL, NULL },
+  { "about", about_activated, NULL, NULL, NULL },
   { "quit", quit_activated, NULL, NULL, NULL }
 };
 


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