~ubuntu-branches/debian/sid/link-monitor-applet/sid

« back to all changes in this revision

Viewing changes to src/lm-about-dialog.gob

  • Committer: Bazaar Package Importer
  • Author(s): Adriaan Peeters
  • Date: 2008-03-30 22:26:13 UTC
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: james.westby@ubuntu.com-20080330222613-5aubcuo9mgg2n7st
Tags: upstream-3.0
ImportĀ upstreamĀ versionĀ 3.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * Copyright (C) 2006 Jean-Yves Lefort <jylefort@brutele.be>
 
2
 * Link Monitor Applet
 
3
 * Copyright (C) 2004-2008 Jean-Yves Lefort <jylefort@brutele.be>
3
4
 *
4
5
 * This program is free software; you can redistribute it and/or modify
5
6
 * it under the terms of the GNU General Public License as published by
6
 
 * the Free Software Foundation; either version 2 of the License, or
 
7
 * the Free Software Foundation; either version 3 of the License, or
7
8
 * (at your option) any later version.
8
9
 *
9
10
 * This program is distributed in the hope that it will be useful,
11
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
13
 * GNU General Public License for more details.
13
14
 *
14
 
 * You should have received a copy of the GNU General Public License
15
 
 * along with this program; if not, write to the Free Software
16
 
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
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.
17
18
 */
18
19
 
19
 
requires 2.0.14
20
 
 
21
20
%headertop{
22
21
#include <gtk/gtk.h>
23
22
%}
24
23
 
25
24
%{
26
 
#include "config.h"
27
25
#include <glib/gi18n.h>
28
26
#include <gnome.h>
29
27
#include "lm-util.h"
45
43
    GdkPixbuf *logo;
46
44
 
47
45
    /* translators: header capitalization */
48
 
    gtk_about_dialog_set_name(about, _("Link Monitor"));
 
46
    gtk_about_dialog_set_program_name(about, _("Link Monitor"));
49
47
    gtk_about_dialog_set_version(about, VERSION);
50
 
    gtk_about_dialog_set_copyright(about, "Copyright \302\251 2004-2006 Jean-Yves Lefort");
 
48
    gtk_about_dialog_set_copyright(about, "Copyright \302\251 2004-2008 Jean-Yves Lefort");
51
49
    gtk_about_dialog_set_comments(about, _("The link monitor displays the round-trip time to one or more hosts."));
52
50
    gtk_about_dialog_set_website(about, "http://www.nongnu.org/link-monitor");
53
51
    gtk_about_dialog_set_authors(about, authors);
59
57
    gtk_about_dialog_set_translator_credits(about, _("translator-credits"));
60
58
 
61
59
    logo = lm_pixbuf_new(GNOMEPIXMAPSDIR G_DIR_SEPARATOR_S "link-monitor-applet.png");
62
 
    if (logo)
63
 
      {
64
 
        gtk_about_dialog_set_logo(about, logo);
65
 
        g_object_unref(logo);
66
 
      }
 
60
    gtk_about_dialog_set_logo(about, logo);
 
61
    g_object_unref(logo);
 
62
 
 
63
    g_signal_connect(self, "response", G_CALLBACK(gtk_widget_destroy), NULL);
67
64
  }
68
65
 
69
66
  private void
70
67
    activate_link_cb (GtkAboutDialog *about,
71
 
                      const char *link,
 
68
                      const char *link_,
72
69
                      gpointer data)
73
70
  {
74
71
    GError *err = NULL;
75
72
    const char *prefix = data;
76
73
    char *url;
77
74
 
78
 
    url = prefix ? g_strconcat(prefix, link, NULL) : g_strdup(link);
 
75
    url = prefix ? g_strconcat(prefix, link_, NULL) : g_strdup(link_);
79
76
    if (! gnome_url_show(url, &err))
80
77
      {
81
 
        lm_error_dialog(GTK_WINDOW(about), _("Unable to open link"), "%s", err->message);
 
78
        lm_show_error_dialog(GTK_WINDOW(about), _("Unable to open link"), "%s", err->message);
82
79
        g_error_free(err);
83
80
      }
84
81
    g_free(url);