Commit f764641c authored by Vincent Geddes's avatar Vincent Geddes

Fix and improve URL launching on win32.

        * gladeui/glade-utils.c, src/glade-project-window.c: Fix and improve URL
          launching on win32.

svn path=/trunk/; revision=1352
parent 303d3972
......@@ -9,6 +9,9 @@
* gladeui/glade-app.c: Change GtkMessageType of _warning_ dialogs from
GTK_MESSAGE_INFO to GTK_MESSAGE_WARNING.
* gladeui/glade-utils.c, src/glade-project-window.c: Fix and improve URL
launching on win32.
2007-06-13 Juan Pablo Ugarte <juanpablougarte@gmail.com>
* gladeui/glade-widget-adaptor.c: added some extra checks in
......
......@@ -19,17 +19,8 @@
* Authors:
* Chema Celorio <chema@celorio.com>
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <string.h>
#include <gtk/gtktooltips.h>
#include <gdk/gdkkeysyms.h>
#include <gmodule.h>
#include <glib/gi18n-lib.h>
#include <glib/gstdio.h>
#include <errno.h>
#include "glade.h"
#include "glade-project.h"
......@@ -43,14 +34,18 @@
#include "glade-clipboard.h"
#include "glade-fixed.h"
#include <string.h>
#include <gtk/gtktooltips.h>
#include <gdk/gdkkeysyms.h>
#include <gmodule.h>
#include <glib/gi18n-lib.h>
#include <glib/gstdio.h>
#include <errno.h>
#ifdef G_OS_WIN32
long __stdcall
ShellExecuteA (long hwnd,
const char* lpOperation,
const char* lpFile,
const char* lpParameters,
const char* lpDirectory,
int nShowCmd);
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <shellapi.h>
#endif
#define GLADE_UTIL_SELECTION_NODE_SIZE 7
......@@ -1681,16 +1676,15 @@ glade_util_object_is_loading (GObject *object)
}
#ifdef G_OS_WIN32
#define SW_NORMAL 1
static gboolean
glade_util_url_show_win32 (const gchar *url)
{
gint retval;
/* win32 API call */
retval = ShellExecuteA (NULL, "open", url, NULL, NULL, SW_NORMAL);
HINSTANCE h;
h = ShellExecuteA (NULL, "open", url, NULL, NULL, SW_SHOWNORMAL);
if (retval <= 32)
if ((int)h <= 32)
return FALSE;
return TRUE;
......
......@@ -101,22 +101,22 @@ about_dialog_activate_link_func (GtkAboutDialog *dialog, const gchar *link, Glad
if (!retval)
{
warning_dialog = gtk_message_dialog_new (GTK_WINDOW (gpw->priv->window),
GTK_DIALOG_MODAL,
GTK_MESSAGE_WARNING,
GTK_BUTTONS_OK,
_("Could not display the URL '%s'"),
link);
warning_dialog = gtk_message_dialog_new (GTK_WINDOW (dialog),
GTK_DIALOG_MODAL,
GTK_MESSAGE_ERROR,
GTK_BUTTONS_OK,
_("Could not display the URL '%s'"),
link);
gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (warning_dialog),
_("No suitable web browser executable could be found."));
_("No suitable web browser could be found."));
gtk_window_set_title (GTK_WINDOW (warning_dialog), "");
g_signal_connect_swapped (warning_dialog, "response",
G_CALLBACK (gtk_widget_destroy),
dialog);
warning_dialog);
gtk_widget_show (warning_dialog);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment