diff options
author | Marcos ChavarrÃa Teijeiro <chavarria1991@gmail.com> | 2014-10-21 11:11:15 +0200 |
---|---|---|
committer | David King <amigadave@amigadave.com> | 2015-06-22 10:39:52 +0100 |
commit | ccd94656fb1027ed28d601c4244ea968636e4a3a (patch) | |
tree | 084927d7cd19a2dda25eb981d5df60281642f2ac /libyelp | |
parent | 9bae912e121e600c423ec64ea9e39622e2243599 (diff) | |
download | yelp-ccd94656fb1027ed28d601c4244ea968636e4a3a.tar.gz |
yelp-view: Replace "script-alert" signal by "script-dialog" signal
Diffstat (limited to 'libyelp')
-rw-r--r-- | libyelp/yelp-view.c | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/libyelp/yelp-view.c b/libyelp/yelp-view.c index f3161b2c..50e4ed8c 100644 --- a/libyelp/yelp-view.c +++ b/libyelp/yelp-view.c @@ -82,9 +82,8 @@ static void popup_save_code (GtkMenuItem *item, static void view_populate_popup (YelpView *view, GtkMenu *menu, gpointer data); -static void view_script_alert (YelpView *view, - WebKitWebFrame *frame, - gchar *message, +static gboolean view_script_dialog (YelpView *view, + WebKitScriptDialog *dialog, gpointer data); static gboolean view_policy_decision_requested (YelpView *view, WebKitPolicyDecision *decision, @@ -276,8 +275,8 @@ yelp_view_init (YelpView *view) G_CALLBACK (view_set_vadjustment), NULL); g_signal_connect (view, "populate-popup", G_CALLBACK (view_populate_popup), NULL); - g_signal_connect (view, "script-alert", - G_CALLBACK (view_script_alert), NULL); + g_signal_connect (view, "script-dialog", + G_CALLBACK (view_script_dialog), NULL); priv->print_action = g_simple_action_new ("yelp-view-print", NULL); g_signal_connect (priv->print_action, @@ -1472,13 +1471,18 @@ view_populate_popup (YelpView *view, gtk_widget_show_all (GTK_WIDGET (menu)); } -static void -view_script_alert (YelpView *view, - WebKitWebFrame *frame, - gchar *message, - gpointer data) +static gboolean +view_script_dialog (YelpView *view, + WebKitScriptDialog *dialog, + gpointer data) { - printf ("\n\n===ALERT===\n%s\n\n", message); + WebKitScriptDialogType type = webkit_script_dialog_get_dialog_type (dialog); + + if (type != WEBKIT_SCRIPT_DIALOG_ALERT) + return FALSE; + + printf ("\n\n===ALERT===\n%s\n\n", webkit_script_dialog_get_message (dialog)); + return TRUE; } static gboolean |