gtranslator r3666 - trunk/src
- From: icq svn gnome org
- To: svn-commits-list gnome org
- Subject: gtranslator r3666 - trunk/src
- Date: Mon, 22 Sep 2008 09:41:50 +0000 (UTC)
Author: icq
Date: Mon Sep 22 09:41:50 2008
New Revision: 3666
URL: http://svn.gnome.org/viewvc/gtranslator?rev=3666&view=rev
Log:
2008-08-07 Ignacio Casal Quinteiro <nacho resa gmail com>
* main.c (main):
* utils.c (gtranslator_utils_activate_email):
* utils.h:
Added email hook function.
Modified:
trunk/src/ChangeLog
trunk/src/main.c
trunk/src/utils.c
trunk/src/utils.h
Modified: trunk/src/main.c
==============================================================================
--- trunk/src/main.c (original)
+++ trunk/src/main.c Mon Sep 22 09:41:50 2008
@@ -162,6 +162,7 @@
engine = gtranslator_plugins_engine_get_default ();
gtk_about_dialog_set_url_hook (gtranslator_utils_activate_url, NULL, NULL);
+ gtk_about_dialog_set_email_hook (gtranslator_utils_activate_email, NULL, NULL);
/*
* Load profiles list
Modified: trunk/src/utils.c
==============================================================================
--- trunk/src/utils.c (original)
+++ trunk/src/utils.c Mon Sep 22 09:41:50 2008
@@ -700,6 +700,40 @@
}
/**
+ * gtranslator_utils_activate_email:
+ * @dialog: a #GtkAboutDialog
+ * @email: the email to show
+ * @data: useless data variable
+ *
+ * Shows the corresponding @email in the default mailer.
+ */
+void
+gtranslator_utils_activate_email (GtkAboutDialog *dialog,
+ const gchar *email,
+ gpointer data)
+{
+ //FIXME: gtk_url_show deprecates this func.
+ gchar *open[3];
+
+ if (g_find_program_in_path ("xdg-email"))
+ {
+ open[0] = "xdg-email";
+ }
+ else return;
+
+ open[1] = (gchar *)email;
+ open[2] = NULL;
+
+ gdk_spawn_on_screen (gdk_screen_get_default (),
+ NULL,
+ open,
+ NULL,
+ G_SPAWN_SEARCH_PATH,
+ NULL,
+ NULL, NULL, NULL);
+}
+
+/**
* gtranslator_utils_help_display:
* @parent: a #GtkWindow
* @doc_id: the name of the type of doc
Modified: trunk/src/utils.h
==============================================================================
--- trunk/src/utils.h (original)
+++ trunk/src/utils.h Mon Sep 22 09:41:50 2008
@@ -67,6 +67,10 @@
void gtranslator_utils_activate_url (GtkAboutDialog *dialog,
const gchar *url,
gpointer data);
+
+void gtranslator_utils_activate_email (GtkAboutDialog *dialog,
+ const gchar *email,
+ gpointer data);
void gtranslator_utils_help_display (GtkWindow *parent,
const gchar *doc_id,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]