Re: Built-in help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



At 03.10.2008 16:44, Hans Breuer wrote:
At 03.10.2008 15:50, Tor Lillqvist wrote:
As far as I know there is no GIO/win32 backend which supports http.
Http is supported in libgio itself (using the winhttp API from
winhttp.dll, which is looked up at run-time, so if you lack that, it
won't work). See gio/win32/gwinhttp*.c.

The DLL is available on my computer (xp sp3), but my GLIB version is just one week too old (beginning of August).

With a new enough gio it indeed works fine. I have also tried the GIMP with Jerney's installer under vista, same here: it just works for me.

Afterwards I have intentional broken the code in web-browser.c (with: url++;). When ShellExecute() failed there indeed was no error message at all.

The attached patch fixes this, but also adds a lot of hard to translate strings. Should it be commited ?

-------- Hans "at" Breuer "dot" Org -----------
Tell me what you need, and I'll tell you how to
get along without it.                -- Dilbert
Index: web-browser.c
===================================================================
--- web-browser.c	(revision 27115)
+++ web-browser.c	(working copy)
@@ -120,9 +120,61 @@
 browser_open_url (const gchar *url)
 {
 #ifdef G_OS_WIN32
+  HINSTANCE hinst = ShellExecute (GetDesktopWindow(), "open", url, NULL, NULL, SW_SHOW);
+  
+  if ((gint) hinst <= 32)
+    {
+      const char *err;
+      
+      switch ((gint) hinst)
+        {
+	  case 0 :
+	    err = _("The operating system is out of memory or resources.");
+	    break;
+	  case ERROR_FILE_NOT_FOUND :
+	    err = _("The specified file was not found.");
+	    break;
+	  case ERROR_PATH_NOT_FOUND :
+	    err = _("The specified path was not found.");
+	    break;
+	  case ERROR_BAD_FORMAT	:
+	    err = _("The .exe file is invalid (non-Microsoft Win32 .exe or error in .exe image).");
+	    break;
+	  case SE_ERR_ACCESSDENIED :
+	    err = _("The operating system denied access to the specified file.");
+	    break;
+	  case SE_ERR_ASSOCINCOMPLETE :
+	    err = _("The file name association is incomplete or invalid.");
+	    break;
+	  case SE_ERR_DDEBUSY :
+	    err = _("DDE transaction busy");
+	    break;
+	  case SE_ERR_DDEFAIL :
+	    err = _("The DDE transaction failed.");
+	    break;
+	  case SE_ERR_DDETIMEOUT :
+	    err = _("The DDE transaction timed out.");
+	    break;
+	  case SE_ERR_DLLNOTFOUND :
+	    err = _("The specified DLL was not found.");
+	    break;
+	  case SE_ERR_NOASSOC :
+	    err = _("There is no application associated with the given file name extension.");
+	    break;
+	  case SE_ERR_OOM :
+	    err = _("There was not enough memory to complete the operation.");
+	    break;
+	  case SE_ERR_SHARE:
+	    err = _("A sharing violation occurred.");
+	    break;
+	  default :
+	    err = _("Unknown Windows error.");
+	}
+      g_message (_("Failed to open the url '%s'\n%s"), url, err);
+      return FALSE;
+    }
 
-  return ((gint) ShellExecute (GetDesktopWindow(), "open", url, NULL, NULL, SW_SHOW) > 32);
-
+  return TRUE;
 #else
 
   GError    *error = NULL;
_______________________________________________
Gimp-developer mailing list
Gimp-developer@xxxxxxxxxxxxxxxxxxxxxx
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer

[Index of Archives]     [Video For Linux]     [Photo]     [Yosemite News]     [gtk]     [GIMP for Windows]     [KDE]     [GEGL]     [Gimp's Home]     [Gimp on GUI]     [Gimp on Windows]     [Steve's Art]

  Powered by Linux