[gnome-applets/wip/muktupavels/help-about] geyes: use gp_applet_show_about



commit e0db74be3069a332be70e022d4eff4e7a95184d7
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Fri Apr 3 15:39:25 2020 +0300

    geyes: use gp_applet_show_about

 gnome-applets/ga-module.c          |  2 ++
 gnome-applets/geyes/geyes-applet.c | 58 +++++++++++++++++++++++---------------
 gnome-applets/geyes/geyes-applet.h |  2 ++
 3 files changed, 40 insertions(+), 22 deletions(-)
---
diff --git a/gnome-applets/ga-module.c b/gnome-applets/ga-module.c
index 422bf9c33..b40cf94d8 100644
--- a/gnome-applets/ga-module.c
+++ b/gnome-applets/ga-module.c
@@ -136,6 +136,8 @@ ga_get_applet_info (const char *id)
       name = _("Eyes");
       description = _("A set of eyeballs for your panel");
       icon_name = "gnome-eyes-applet";
+
+      about_func = eyes_applet_setup_about;
     }
   else if (g_strcmp0 (id, "gweather") == 0)
     {
diff --git a/gnome-applets/geyes/geyes-applet.c b/gnome-applets/geyes/geyes-applet.c
index 56ef458c4..5fd1c838c 100644
--- a/gnome-applets/geyes/geyes-applet.c
+++ b/gnome-applets/geyes/geyes-applet.c
@@ -158,28 +158,7 @@ about_cb (GSimpleAction *action,
           GVariant      *parameter,
           gpointer       user_data)
 {
-        static const gchar *authors [] = {
-               "Dave Camp <campd oit edu>",
-               NULL
-       };
-
-       const gchar *documenters[] = {
-                "Arjan Scherpenisse <acscherp wins uva nl>",
-                "Telsa Gwynne <hobbit aloss ukuu org uk>",
-                "Sun GNOME Documentation Team <gdocteam sun com>",
-               NULL
-       };
-
-       gtk_show_about_dialog (NULL,
-               "version",      VERSION,
-               "comments",     _("A goofy set of eyes for the GNOME "
-                                 "panel. They follow your mouse."),
-               "copyright",    "\xC2\xA9 1999 Dave Camp",
-               "authors",      authors,
-               "documenters",  documenters,
-               "translator-credits",   _("translator-credits"),
-               "logo-icon-name",       "gnome-eyes-applet",
-               NULL);
+  gp_applet_show_about (GP_APPLET (user_data));
 }
 
 static int
@@ -412,3 +391,38 @@ eyes_applet_init (EyesApplet *self)
 
   theme_dirs_create ();
 }
+
+void
+eyes_applet_setup_about (GtkAboutDialog *dialog)
+{
+  const char *comments;
+  const char **authors;
+  const char **documenters;
+  const char *copyright;
+
+  comments = _("A goofy set of eyes for the GNOME panel. They "
+               "follow your mouse.");
+
+  authors = (const char *[])
+    {
+      "Dave Camp <campd oit edu>",
+      NULL
+    };
+
+  documenters = (const char *[])
+    {
+      "Arjan Scherpenisse <acscherp wins uva nl>",
+      "Telsa Gwynne <hobbit aloss ukuu org uk>",
+      "Sun GNOME Documentation Team <gdocteam sun com>",
+      NULL
+    };
+
+  copyright = "\xC2\xA9 1999 Dave Camp";
+
+  gtk_about_dialog_set_comments (dialog, comments);
+
+  gtk_about_dialog_set_authors (dialog, authors);
+  gtk_about_dialog_set_documenters (dialog, documenters);
+  gtk_about_dialog_set_translator_credits (dialog, _("translator-credits"));
+  gtk_about_dialog_set_copyright (dialog, copyright);
+}
diff --git a/gnome-applets/geyes/geyes-applet.h b/gnome-applets/geyes/geyes-applet.h
index a6616602a..686665161 100644
--- a/gnome-applets/geyes/geyes-applet.h
+++ b/gnome-applets/geyes/geyes-applet.h
@@ -25,6 +25,8 @@ G_BEGIN_DECLS
 #define EYES_TYPE_APPLET (eyes_applet_get_type ())
 G_DECLARE_FINAL_TYPE (EyesApplet, eyes_applet, EYES, APPLET, GpApplet)
 
+void eyes_applet_setup_about (GtkAboutDialog *dialog);
+
 G_END_DECLS
 
 #endif


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