[gnome-applets/wip/muktupavels/help-about: 7/9] command: use gp_applet_show_about



commit f0233a3471ebe83a31f6d9c6c161f3bf3d664d3d
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Fri Apr 3 04:33:36 2020 +0300

    command: use gp_applet_show_about

 gnome-applets/command/command-applet.c | 35 ++++++++++++++++++++++------------
 gnome-applets/command/command-applet.h |  2 ++
 gnome-applets/ga-module.c              |  2 ++
 3 files changed, 27 insertions(+), 12 deletions(-)
---
diff --git a/gnome-applets/command/command-applet.c b/gnome-applets/command/command-applet.c
index eb6ca3259..ff07d087b 100644
--- a/gnome-applets/command/command-applet.c
+++ b/gnome-applets/command/command-applet.c
@@ -74,20 +74,12 @@ static const GActionEntry applet_menu_actions [] = {
     {NULL}
 };
 
-/* Show the about dialog */
 static void
-command_about_callback (GSimpleAction *action, GVariant *parameter, gpointer data)
+command_about_callback (GSimpleAction *action,
+                        GVariant      *parameter,
+                        gpointer       user_data)
 {
-    const char* authors[] = { "Stefano Karapetsas <stefano karapetsas com>", NULL };
-
-    gtk_show_about_dialog(NULL,
-                          "version", VERSION,
-                          "copyright", "Copyright © 2013-2014 Stefano Karapetsas",
-                          "authors", authors,
-                          "comments", _("Shows the output of a command"),
-                          "translator-credits", _("translator-credits"),
-                          "logo-icon-name", APPLET_ICON,
-    NULL );
+  gp_applet_show_about (GP_APPLET (user_data));
 }
 
 /* Show the preferences dialog */
@@ -404,3 +396,22 @@ command_applet_init (CommandApplet *self)
 {
   gp_applet_set_flags (GP_APPLET (self), GP_APPLET_FLAGS_EXPAND_MINOR);
 }
+
+void
+command_applet_setup_about (GtkAboutDialog *dialog)
+{
+  const char **authors;
+  const char *copyright;
+
+  authors = (const char *[])
+    {
+      "Stefano Karapetsas <stefano karapetsas com>",
+      NULL
+    };
+
+  copyright = "Copyright © 2013-2014 Stefano Karapetsas";
+
+  gtk_about_dialog_set_authors (dialog, authors);
+  gtk_about_dialog_set_translator_credits (dialog, _("translator-credits"));
+  gtk_about_dialog_set_copyright (dialog, copyright);
+}
diff --git a/gnome-applets/command/command-applet.h b/gnome-applets/command/command-applet.h
index 4e83ba110..4d92dcb92 100644
--- a/gnome-applets/command/command-applet.h
+++ b/gnome-applets/command/command-applet.h
@@ -25,6 +25,8 @@ G_BEGIN_DECLS
 #define COMMAND_TYPE_APPLET (command_applet_get_type ())
 G_DECLARE_FINAL_TYPE (CommandApplet, command_applet, COMMAND, APPLET, GpApplet)
 
+void command_applet_setup_about (GtkAboutDialog *dialog);
+
 G_END_DECLS
 
 #endif
diff --git a/gnome-applets/ga-module.c b/gnome-applets/ga-module.c
index 8362086ef..2f5245e5a 100644
--- a/gnome-applets/ga-module.c
+++ b/gnome-applets/ga-module.c
@@ -105,6 +105,8 @@ ga_get_applet_info (const char *id)
       name = _("Command");
       description = _("Shows the output of a command");
       icon_name = "utilities-terminal";
+
+      about_func = command_applet_setup_about;
     }
 #ifdef BUILD_CPUFREQ_APPLET
   else if (g_strcmp0 (id, "cpufreq") == 0)


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