[frogr] New function: frogr_util_open_multiple_uris
- From: Mario Sanchez Prada <msanchez src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [frogr] New function: frogr_util_open_multiple_uris
- Date: Wed, 29 Jun 2011 09:29:00 +0000 (UTC)
commit 58f9ef1921fe01be46fb612612ac012e00f2d945
Author: Mario Sanchez Prada <msanchez igalia com>
Date: Wed Jun 29 11:28:41 2011 +0200
New function: frogr_util_open_multiple_uris
src/frogr-util.c | 22 ++++++++++++++++++++--
src/frogr-util.h | 2 ++
2 files changed, 22 insertions(+), 2 deletions(-)
---
diff --git a/src/frogr-util.c b/src/frogr-util.c
index ac75568..11afd0d 100644
--- a/src/frogr-util.c
+++ b/src/frogr-util.c
@@ -25,7 +25,6 @@
#include <glib/gi18n.h>
#include <gtk/gtk.h>
-#ifndef GTK_API_VERSION_3
static gboolean
_spawn_command (const gchar* cmd)
{
@@ -43,7 +42,6 @@ _spawn_command (const gchar* cmd)
}
return TRUE;
}
-#endif
const gchar *
_get_data_dir (void)
@@ -139,6 +137,26 @@ frogr_util_open_uri (const gchar *url)
}
}
+void
+frogr_util_open_multiple_uris (const gchar *uris)
+{
+ gchar *command = NULL;
+
+ /* Early return */
+ if (uris == NULL)
+ return;
+
+#ifdef MAC_INTEGRATION
+ /* In MacOSX neither gnome-open nor gtk_show_uri() will work */
+ command = g_strdup_printf ("open %s", uris);
+#else
+ command = g_strdup_printf ("gnome-open %s", uris);
+#endif /* ifdef MAC_INTEGRATION */
+
+ _spawn_command (command);
+ g_free (command);
+}
+
static void
_show_message_dialog (GtkWindow *parent, const gchar *message, GtkMessageType type)
{
diff --git a/src/frogr-util.h b/src/frogr-util.h
index 772bb40..29afeaf 100644
--- a/src/frogr-util.h
+++ b/src/frogr-util.h
@@ -31,6 +31,8 @@ const gchar *frogr_util_get_locale_dir (void);
void frogr_util_open_uri (const gchar *url);
+void frogr_util_open_multiple_uris (const gchar *uris);
+
void frogr_util_show_info_dialog (GtkWindow *parent, const gchar *message);
void frogr_util_show_warning_dialog (GtkWindow *parent, const gchar *message);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]