gnome-terminal r3107 - trunk/src
- From: chpe svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-terminal r3107 - trunk/src
- Date: Mon, 29 Sep 2008 13:09:58 +0000 (UTC)
Author: chpe
Date: Mon Sep 29 13:09:57 2008
New Revision: 3107
URL: http://svn.gnome.org/viewvc/gnome-terminal?rev=3107&view=rev
Log:
Add about dialogue hooks.
Modified:
trunk/src/terminal.c
Modified: trunk/src/terminal.c
==============================================================================
--- trunk/src/terminal.c (original)
+++ trunk/src/terminal.c Mon Sep 29 13:09:57 2008
@@ -1254,6 +1254,40 @@
return event.xproperty.time;
}
+static void
+about_url_hook (GtkAboutDialog *about,
+ const char *link,
+ gpointer user_data)
+{
+ GError *error = NULL;
+
+ if (!gtk_show_uri (gtk_widget_get_screen (GTK_WIDGET (about)),
+ link,
+ gtk_get_current_event_time (),
+ &error))
+ {
+ terminal_util_show_error_dialog (GTK_WINDOW (about), NULL,
+ _("Could not open link: %s"),
+ error->message);
+ g_error_free (error);
+ }
+}
+
+static void
+about_email_hook (GtkAboutDialog *about,
+ const char *email_address,
+ gpointer user_data)
+{
+ char *escaped, *uri;
+
+ escaped = g_uri_escape_string (email_address, NULL, FALSE);
+ uri = g_strdup_printf ("mailto:%s", escaped);
+ g_free (escaped);
+
+ about_url_hook (about, uri, user_data);
+ g_free (uri);
+}
+
int
main (int argc, char **argv)
{
@@ -1427,6 +1461,9 @@
gtk_window_set_default_icon_name (GNOME_TERMINAL_ICON_NAME);
+ gtk_about_dialog_set_url_hook (about_url_hook, NULL, NULL);
+ gtk_about_dialog_set_email_hook (about_email_hook, NULL, NULL);
+
g_assert (parsing_results->post_execute_args == NULL);
terminal_app_initialize (parsing_results->use_factory);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]