mail-notification

Fork of Jean-Yves Lefort's mail-notification, a tray icon to notify of new mail
git clone https://code.djc.id.au/git/mail-notification/

src/mn-about-dialog.gob (2575B) - raw

      1 /*
      2  * Mail Notification
      3  * Copyright (C) 2003-2008 Jean-Yves Lefort <jylefort@brutele.be>
      4  *
      5  * This program is free software; you can redistribute it and/or modify
      6  * it under the terms of the GNU General Public License as published by
      7  * the Free Software Foundation; either version 3 of the License, or
      8  * (at your option) any later version.
      9  *
     10  * This program is distributed in the hope that it will be useful,
     11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
     12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     13  * GNU General Public License for more details.
     14  *
     15  * You should have received a copy of the GNU General Public License along
     16  * with this program; if not, write to the Free Software Foundation, Inc.,
     17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
     18  */
     19 
     20 %headertop{
     21 #include <gtk/gtk.h>
     22 %}
     23 
     24 %{
     25 #include <glib/gi18n.h>
     26 #include "mn-util.h"
     27 %}
     28 
     29 class MN:About:Dialog from Gtk:About:Dialog
     30 {
     31   class_init (class)
     32   {
     33     gtk_about_dialog_set_email_hook(self_activate_link_cb, "mailto:", NULL);
     34     gtk_about_dialog_set_url_hook(self_activate_link_cb, NULL, NULL);
     35   }
     36 
     37   init (self)
     38   {
     39     GtkAboutDialog *about = GTK_ABOUT_DIALOG(self);
     40     static const char *authors[] = { "Jean-Yves Lefort <jylefort@brutele.be>", NULL };
     41     static const char *documenters[] = { "Jean-Yves Lefort <jylefort@brutele.be>", NULL };
     42     GdkPixbuf *logo;
     43 
     44     gtk_about_dialog_set_version(about, VERSION);
     45     gtk_about_dialog_set_copyright(about, "Copyright \302\251 2003-2008 Jean-Yves Lefort");
     46     /* translators: header capitalization */
     47     gtk_about_dialog_set_comments(about, _("A Mail Notification Icon"));
     48     gtk_about_dialog_set_website(about, "http://www.nongnu.org/mailnotify");
     49     gtk_about_dialog_set_authors(about, authors);
     50     gtk_about_dialog_set_documenters(about, documenters);
     51     /*
     52      * translators: Your Name <your-email>
     53      * optionally followed by one or more: \nOther Contributor's Name <his-email>
     54      */
     55     gtk_about_dialog_set_translator_credits(about, _("translator-credits"));
     56 
     57     logo = mn_pixbuf_new(PKGDATADIR G_DIR_SEPARATOR_S "logo.png");
     58     gtk_about_dialog_set_logo(about, logo);
     59     g_object_unref(logo);
     60 
     61     g_signal_connect(self, "response", G_CALLBACK(gtk_widget_destroy), NULL);
     62   }
     63 
     64   private void
     65     activate_link_cb (GtkAboutDialog *about,
     66 		      const char *link,
     67 		      gpointer data)
     68   {
     69     const char *prefix = data;
     70     char *url;
     71 
     72     url = prefix ? g_strconcat(prefix, link, NULL) : g_strdup(link);
     73     mn_open_link(GTK_WINDOW(about), url);
     74     g_free(url);
     75   }
     76 }