From dfa5fc5f9dafb5f6c56e543da21d000a7498cfaf Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Wed, 27 Sep 2017 01:27:39 -0400 Subject: MqTabBody: Implement "Open ... in New Window" actions --- (limited to 'src') diff --git a/src/tab-body.c b/src/tab-body.c index 3e196e1..58f3eea 100644 --- a/src/tab-body.c +++ b/src/tab-body.c @@ -51,7 +51,11 @@ static void menu_open_link_win_activate_cb(GtkAction __attribute__((unused)) *action, MqTabBody *body) { - g_print("Open Link in New Window\n"); + gchar *uris[2] = { + webkit_hit_test_result_get_link_uri(body->hit_test_result), + NULL + }; + mq_application_add_window(body->tab->application, &uris); } static void @@ -75,7 +79,11 @@ static void menu_open_image_win_activate_cb(GtkAction __attribute__((unused)) *action, MqTabBody *body) { - g_print("Open Image in New Window\n"); + gchar *uris[2] = { + webkit_hit_test_result_get_image_uri(body->hit_test_result), + NULL + }; + mq_application_add_window(body->tab->application, &uris); } static void @@ -99,7 +107,11 @@ static void menu_open_video_win_activate_cb(GtkAction __attribute__((unused)) *action, MqTabBody *body) { - g_print("Open Video in New Window\n"); + gchar *uris[2] = { + webkit_hit_test_result_get_media_uri(body->hit_test_result), + NULL + }; + mq_application_add_window(body->tab->application, &uris); } static void @@ -123,7 +135,11 @@ static void menu_open_audio_win_activate_cb(GtkAction __attribute__((unused)) *action, MqTabBody *body) { - g_print("Open Audio in New Window\n"); + gchar *uris[2] = { + webkit_hit_test_result_get_media_uri(body->hit_test_result), + NULL + }; + mq_application_add_window(body->tab->application, &uris); } #define ITEM_DECLS \ -- cgit v0.9.1