[darcs-to-svn @ GossipAboutDialog]
authorXavier Claessens <xclaesse@src.gnome.org>
Sat, 12 May 2007 20:39:54 +0000 (20:39 +0000)
committerXavier Claessens <xclaesse@src.gnome.org>
Sat, 12 May 2007 20:39:54 +0000 (20:39 +0000)
svn path=/trunk/; revision=50

libempathy-gtk/Makefile.am
libempathy-gtk/empathy-main-window.c
libempathy-gtk/gossip-about-dialog.c [new file with mode: 0644]
libempathy-gtk/gossip-about-dialog.h [new file with mode: 0644]
src/empathy-main.c

index 1810fc4..057b80e 100644 (file)
@@ -29,6 +29,7 @@ libempathy_gtk_la_SOURCES =                                                   \
        gossip-geometry.c                       gossip-geometry.h               \
        gossip-status-presets.c                 gossip-status-presets.h         \
        gossip-presence-chooser.c               gossip-presence-chooser.h       \
+       gossip-about-dialog.c                   gossip-about-dialog.h           \
        gossip-ui-utils.c                       gossip-ui-utils.h
 
 libempathy_gtk_la_LIBADD =                             \
index b53f666..ecb8362 100644 (file)
@@ -41,6 +41,8 @@
 #include "gossip-geometry.h"
 #include "gossip-preferences.h"
 #include "gossip-accounts-dialog.h"
+#include "gossip-about-dialog.h"
+
 
 #define DEBUG_DOMAIN "MainWindow"
 
@@ -517,7 +519,7 @@ static void
 main_window_help_about_cb (GtkWidget         *widget,
                           EmpathyMainWindow *window)
 {
-       //gossip_about_dialog_new (GTK_WINDOW (window->window));
+       gossip_about_dialog_new (GTK_WINDOW (window->window));
 }
 
 static void
diff --git a/libempathy-gtk/gossip-about-dialog.c b/libempathy-gtk/gossip-about-dialog.c
new file mode 100644 (file)
index 0000000..7b5990c
--- /dev/null
@@ -0,0 +1,111 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * Copyright (C) 2006-2007 Imendio AB
+ * Copyright (C) 2007 Collabora Ltd.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ * 
+ * Authors: Martyn Russell <martyn@imendio.com>
+ *          Xavier Claessens <xclaesse@gmail.com>
+ */
+
+#include "config.h"
+
+#include <glib/gi18n.h>
+#include <gtk/gtkaboutdialog.h>
+#include <gtk/gtksizegroup.h>
+#include <glade/glade.h>
+
+#include "gossip-about-dialog.h"
+#include "gossip-ui-utils.h"
+
+#define WEB_SITE "http://telepathy.freedesktop.org/wiki/Empathy"
+
+static void about_dialog_activate_link_cb (GtkAboutDialog  *about,
+                                          const gchar     *link,
+                                          gpointer         data);
+
+static const char *authors[] = {
+       "Mikael Hallendal",
+       "Richard Hult",
+       "Martyn Russell",
+       "Geert-Jan Van den Bogaerde",
+       "Kevin Dougherty",
+       "Eitan Isaacson",
+       "Xavier Claessens",
+       NULL
+};
+
+static const char *documenters[] = {
+       NULL
+};
+
+static const char *artists[] = {
+       NULL
+};
+
+static const char *license[] = {
+       N_("Empathy is free software; you can redistribute it and/or modify "
+          "it under the terms of the GNU General Public License as published by "
+          "the Free Software Foundation; either version 2 of the License, or "
+          "(at your option) any later version."),
+       N_("Empathy is distributed in the hope that it will be useful, "
+          "but WITHOUT ANY WARRANTY; without even the implied warranty of "
+          "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the "
+          "GNU General Public License for more details."),
+       N_("You should have received a copy of the GNU General Public License "
+          "along with Empathy; if not, write to the Free Software Foundation, Inc., "
+          "51 Franklin Street, Fifth Floor, Boston, MA 02110-130159 USA")
+};
+
+static void
+about_dialog_activate_link_cb (GtkAboutDialog *about,
+                              const gchar    *link,
+                              gpointer        data)
+{
+       gossip_url_show (link);
+}
+
+void
+gossip_about_dialog_new (GtkWindow *parent)
+{
+       gchar *license_trans;
+
+       gtk_about_dialog_set_url_hook (about_dialog_activate_link_cb, NULL, NULL);
+
+       license_trans = g_strconcat (_(license[0]), "\n\n",
+                                    _(license[1]), "\n\n",
+                                    _(license[2]), "\n\n",
+                                    NULL);
+
+       gtk_show_about_dialog (parent,
+                              "artists", artists,
+                              "authors", authors,
+                              "comments", _("An Instant Messaging client for GNOME"),
+                              "license", license_trans,
+                              "wrap-license", TRUE,
+                              "copyright", "Imendio AB 2002-2007\nCollabora Ltd 2007",
+                              "documenters", documenters,
+                              "logo-icon-name", "empathy",
+                              "translator-credits", _("translator-credits"),
+                              "version", PACKAGE_VERSION,
+                              "website", WEB_SITE,
+                              NULL);
+
+       g_free (license_trans);
+}
+
+
diff --git a/libempathy-gtk/gossip-about-dialog.h b/libempathy-gtk/gossip-about-dialog.h
new file mode 100644 (file)
index 0000000..0e5b9d4
--- /dev/null
@@ -0,0 +1,34 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * Copyright (C) 2006-2007 Imendio AB
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ * Authors: Martyn Russell <martyn@imendio.com>
+ */
+
+#ifndef __GOSSIP_ABOUT_DIALOG_H__
+#define __GOSSIP_ABOUT_DIALOG_H__
+
+#include <gtk/gtkwindow.h>
+
+G_BEGIN_DECLS
+
+void gossip_about_dialog_new (GtkWindow *parent);
+
+G_END_DECLS
+
+#endif /*  __GOSSIP_ABOUT_DIALOG_H__ */
index d693ba6..8dcc52c 100644 (file)
@@ -133,6 +133,8 @@ main (int argc, char *argv[])
 
        gtk_init (&argc, &argv);
 
+       g_set_application_name (PACKAGE_NAME);
+
        /* Setting up channel filter */
        filter = empathy_filter_new ();
        g_signal_connect (filter, "new-channel",