]> saetta.ns0.it Git - solipa/libsolipa/commitdiff
Sostituita g_app_info_launch_default_for_uri con ShellExecute in win32.
authorAndrea Zagli <a.zagli@comune.scandicci.fi.it>
Mon, 10 Dec 2012 08:35:46 +0000 (09:35 +0100)
committerAndrea Zagli <a.zagli@comune.scandicci.fi.it>
Mon, 10 Dec 2012 08:35:46 +0000 (09:35 +0100)
src/Makefile.am
src/utils.c
src/utils.h

index 14023d42c8fe656975a6515cd42397921d49c49e..d7efa0b59d3503708727c7a56c4fe53a9726dc5a 100644 (file)
@@ -1,7 +1,7 @@
 guidir = $(datadir)/$(PACKAGE)/gui
 
 if PLATFORM_WIN32
-WIN32_LIBS=-lwsock32
+WIN32_LIBS=-lwsock32 -lshell32
 else
 WIN32_LIBS=
 endif
index 44ebb1739842cd0af804423418906eec5b6d18c7..4917ece97e8b63ebe026b5ab4bd97c3bf847a83b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010-2011 Andrea Zagli <azagli@libero.it>
+ * Copyright (C) 2010-2012 Andrea Zagli <azagli@libero.it>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
 #include <gio/gio.h>
 #include <gtk/gtk.h>
 
+#ifdef G_OS_WIN32
+       #include <windows.h>
+       #include <winuser.h>
+       #include <shellapi.h>
+#endif
+
 #include "solipa.h"
 #include "utils.h"
 
@@ -1880,6 +1886,24 @@ solipa_gstring_initial_capital (GString *gstring)
 void
 solipa_apri_collegamento (GtkWindow *transient, const gchar *indirizzo)
 {
+#ifdef G_OS_WIN32
+
+       /* da rimuovere quando gnome-vfs-extra (o gvfs) sarĂ  compilabile in win */
+       guint err;
+
+       err = ShellExecute (NULL, "open", indirizzo, NULL, NULL, SW_SHOW);
+       if (err < 33)
+               {
+                       solipa_message_dialog (GTK_WIDGET (transient),
+                                              GTK_MESSAGE_WARNING,
+                                              GTK_BUTTONS_OK,
+                                              g_strdup_printf ("Impossibile aprire il collegamento selezionato (%s): %d.",
+                                                               indirizzo,
+                                                               err));
+               }
+
+#else
+
        GAppInfo *gappinfo;
        GError *error;
 
@@ -1893,6 +1917,8 @@ solipa_apri_collegamento (GtkWindow *transient, const gchar *indirizzo)
                                                                indirizzo,
                                                                error != NULL && error->message != NULL ? error->message : "nessun dettaglio"));
                }
+
+#endif
 }
 
 /**
index b3b7f8168550099221891c8f8ba1992e9856dd6a..d6b6817ee81dca9f2732b43deb4005971f523c84 100644 (file)
@@ -103,6 +103,8 @@ GdkPixbuf *solipa_file_get_icon_as_pixbuf (const gchar *filename, GtkWidget *wid
 
 void solipa_gstring_initial_capital (GString *gstring);
 
+void solipa_apri_collegamento (GtkWindow *transient, const gchar *indirizzo);
+
 gchar *g_mkdtemp (gchar *tmpl);