Commit 171c9cac authored by Victor Ananjevsky's avatar Victor Ananjevsky

fix uri handler in html dialog

parent 8ba82ecd
...@@ -96,7 +96,7 @@ policy_cb (WebKitWebView *v, WebKitPolicyDecision *pd, WebKitPolicyDecisionType ...@@ -96,7 +96,7 @@ policy_cb (WebKitWebView *v, WebKitPolicyDecision *pd, WebKitPolicyDecisionType
g_app_info_launch_default_for_uri (uri, NULL, NULL); g_app_info_launch_default_for_uri (uri, NULL, NULL);
} }
} }
else if (options.html_data.uri_cmd) else if (options.data.uri_handler && options.data.uri_handler[0])
{ {
gchar *v1, *v2, *cmd; gchar *v1, *v2, *cmd;
gint status; gint status;
...@@ -120,7 +120,10 @@ policy_cb (WebKitWebView *v, WebKitPolicyDecision *pd, WebKitPolicyDecisionType ...@@ -120,7 +120,10 @@ policy_cb (WebKitWebView *v, WebKitPolicyDecision *pd, WebKitPolicyDecisionType
g_setenv ("YAD_HTML_BUTTON", v1, TRUE); g_setenv ("YAD_HTML_BUTTON", v1, TRUE);
g_setenv ("YAD_HTML_STATE", v2, TRUE); g_setenv ("YAD_HTML_STATE", v2, TRUE);
cmd = g_strdup_printf ("%s '%s'", options.html_data.uri_cmd, uri); if (g_strstr_len (options.data.uri_handler, -1, "%s") != NULL)
cmd = g_strdup_printf (options.data.uri_handler, uri);
else
cmd = g_strdup_printf ("%s '%s'", options.data.uri_handler, uri);
status = run_command_sync (cmd, NULL); status = run_command_sync (cmd, NULL);
g_free (cmd); g_free (cmd);
......
...@@ -375,8 +375,6 @@ static GOptionEntry html_options[] = { ...@@ -375,8 +375,6 @@ static GOptionEntry html_options[] = {
N_("Set mime type of input stream data"), N_("TYPE") }, N_("Set mime type of input stream data"), N_("TYPE") },
{ "encoding", 0, 0, G_OPTION_ARG_STRING, &options.html_data.encoding, { "encoding", 0, 0, G_OPTION_ARG_STRING, &options.html_data.encoding,
N_("Set encoding of input stream data"), N_("ENCODING") }, N_("Set encoding of input stream data"), N_("ENCODING") },
{ "uri-handler", 0, 0, G_OPTION_ARG_STRING, &options.html_data.uri_cmd,
N_("Set external handler for clicked uri"), N_("CMD") },
{ "user-agent", 0, 0, G_OPTION_ARG_STRING, &options.html_data.user_agent, { "user-agent", 0, 0, G_OPTION_ARG_STRING, &options.html_data.user_agent,
N_("Set user agent string"), N_("STRING") }, N_("Set user agent string"), N_("STRING") },
{ "user-style", 0, 0, G_OPTION_ARG_STRING, &options.html_data.user_style, { "user-style", 0, 0, G_OPTION_ARG_STRING, &options.html_data.user_style,
...@@ -1658,7 +1656,6 @@ yad_options_init (void) ...@@ -1658,7 +1656,6 @@ yad_options_init (void)
options.html_data.print_uri = FALSE; options.html_data.print_uri = FALSE;
options.html_data.mime = NULL; options.html_data.mime = NULL;
options.html_data.encoding = NULL; options.html_data.encoding = NULL;
options.html_data.uri_cmd = NULL;
options.html_data.user_agent = "YAD-Webkit (" VERSION ")"; options.html_data.user_agent = "YAD-Webkit (" VERSION ")";
options.html_data.user_style = NULL; options.html_data.user_style = NULL;
#endif #endif
......
...@@ -326,7 +326,6 @@ typedef struct { ...@@ -326,7 +326,6 @@ typedef struct {
gboolean print_uri; gboolean print_uri;
gchar *mime; gchar *mime;
gchar *encoding; gchar *encoding;
gchar *uri_cmd;
gchar *user_agent; gchar *user_agent;
gchar *user_style; gchar *user_style;
} YadHtmlData; } YadHtmlData;
......
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