[Xfce4-commits] <terminal:master> Use gtk_show_uri and new dialog hook and new version of exo.
Nick Schermer
nick at xfce.org
Wed Aug 26 21:42:04 CEST 2009
Updating branch refs/heads/master
to 94320f13ea0695a357f5544cad259cb98112a330 (commit)
from 73edd41de67f459ef8e77fc238b854956408d862 (commit)
commit 94320f13ea0695a357f5544cad259cb98112a330
Author: Nick Schermer <nick at xfce.org>
Date: Wed Aug 26 21:41:05 2009 +0200
Use gtk_show_uri and new dialog hook and new version of exo.
configure.in.in | 2 +-
terminal/terminal-dialogs.c | 11 ++++++++++-
terminal/terminal-widget.c | 15 ++++++++++-----
3 files changed, 21 insertions(+), 7 deletions(-)
diff --git a/configure.in.in b/configure.in.in
index 7dc5fc5..9ebd977 100644
--- a/configure.in.in
+++ b/configure.in.in
@@ -82,7 +82,7 @@ dnl ***********************************
dnl *** Check for required packages ***
dnl ***********************************
XDT_CHECK_PACKAGE([EXO], [exo-0.3], [0.3.4], [],
- [XDT_CHECK_PACKAGE([EXO], [exo-1], [0.3.100])])
+ [XDT_CHECK_PACKAGE([EXO], [exo-1], [0.5.0])])
XDT_CHECK_PACKAGE([GTK], [gtk+-2.0], [2.14.0])
XDT_CHECK_PACKAGE([VTE], [vte], [0.17.1])
XDT_CHECK_PACKAGE([GIO], [gio-2.0], [2.16.0])
diff --git a/terminal/terminal-dialogs.c b/terminal/terminal-dialogs.c
index 397737a..b164926 100644
--- a/terminal/terminal-dialogs.c
+++ b/terminal/terminal-dialogs.c
@@ -69,9 +69,18 @@ terminal_dialogs_show_about (GtkWindow *parent)
/* try to load the about logo */
logo = gdk_pixbuf_new_from_file_at_size (DATADIR "/icons/hicolor/scalable/apps/Terminal.svg", 168, 168, NULL);
- /* open the about dialog */
+ /* set dialog hook on gtk versions older then 2.18 */
+#if !GTK_CHECK_VERSION (2, 18, 0)
+#if EXO_CHECK_VERSION (0, 5, 0)
+ gtk_about_dialog_set_email_hook (exo_gtk_url_about_dialog_hook, NULL, NULL);
+ gtk_about_dialog_set_url_hook (exo_gtk_url_about_dialog_hook, NULL, NULL);
+#else
gtk_about_dialog_set_email_hook (exo_url_about_dialog_hook, NULL, NULL);
gtk_about_dialog_set_url_hook (exo_url_about_dialog_hook, NULL, NULL);
+#endif
+#endif
+
+ /* open the about dialog */
gtk_show_about_dialog (parent,
"authors", authors,
"artists", artists,
diff --git a/terminal/terminal-widget.c b/terminal/terminal-widget.c
index 440c8e1..d409b2e 100644
--- a/terminal/terminal-widget.c
+++ b/terminal/terminal-widget.c
@@ -660,9 +660,10 @@ terminal_widget_open_uri (TerminalWidget *widget,
const gchar *link,
gint tag)
{
- GError *error = NULL;
- gchar *uri;
- guint i;
+ GError *error = NULL;
+ gchar *uri;
+ guint i;
+ GdkScreen *screen;
for (i = 0; i < G_N_ELEMENTS (regex_patterns); i++)
{
@@ -693,8 +694,12 @@ terminal_widget_open_uri (TerminalWidget *widget,
}
/* try to open the URI with the responsible application */
- if (!exo_url_show_on_screen (uri, NULL,
- gtk_widget_get_screen (GTK_WIDGET (widget)), &error))
+ screen = gtk_widget_get_screen (GTK_WIDGET (widget));
+#if EXO_CHECK_VERSION (0, 5, 0)
+ if (!gtk_show_uri (screen, uri, gtk_get_current_event_time (), &error))
+#else
+ if (!exo_url_show_on_screen (uri, NULL, screen, &error))
+#endif
{
/* tell the user that we were unable to open the responsible application */
terminal_dialogs_show_error (widget, error, _("Failed to open the URL `%s'"), uri);
More information about the Xfce4-commits
mailing list