Support external Download Manager with newer WebKit
This commit is contained in:
parent
07aed45bd9
commit
88ebdf3944
2 changed files with 9 additions and 7 deletions
|
@ -427,7 +427,7 @@ midori_preferences_set_settings (MidoriPreferences* preferences,
|
||||||
INDENTED_ADD (label, 0, 1, 0, 1);
|
INDENTED_ADD (label, 0, 1, 0, 1);
|
||||||
button = katze_property_proxy (settings, "download-folder", "folder");
|
button = katze_property_proxy (settings, "download-folder", "folder");
|
||||||
FILLED_ADD (button, 1, 2, 0, 1);
|
FILLED_ADD (button, 1, 2, 0, 1);
|
||||||
#else
|
#endif
|
||||||
label = katze_property_label (settings, "download-manager");
|
label = katze_property_label (settings, "download-manager");
|
||||||
INDENTED_ADD (label, 0, 1, 1, 2);
|
INDENTED_ADD (label, 0, 1, 1, 2);
|
||||||
hbox = gtk_hbox_new (FALSE, 4);
|
hbox = gtk_hbox_new (FALSE, 4);
|
||||||
|
@ -442,7 +442,6 @@ midori_preferences_set_settings (MidoriPreferences* preferences,
|
||||||
g_signal_connect (entry, "focus-out-event",
|
g_signal_connect (entry, "focus-out-event",
|
||||||
G_CALLBACK (proxy_download_manager_icon_cb), button);
|
G_CALLBACK (proxy_download_manager_icon_cb), button);
|
||||||
FILLED_ADD (hbox, 1, 2, 1, 2);
|
FILLED_ADD (hbox, 1, 2, 1, 2);
|
||||||
#endif
|
|
||||||
label = katze_property_label (settings, "text-editor");
|
label = katze_property_label (settings, "text-editor");
|
||||||
INDENTED_ADD (label, 0, 1, 2, 3);
|
INDENTED_ADD (label, 0, 1, 2, 3);
|
||||||
hbox = gtk_hbox_new (FALSE, 4);
|
hbox = gtk_hbox_new (FALSE, 4);
|
||||||
|
|
|
@ -926,6 +926,7 @@ midori_web_view_menu_save_as_activate_cb (GtkWidget* widget,
|
||||||
{
|
{
|
||||||
g_signal_emit (view, signals[SAVE_AS], 0, view->link_uri);
|
g_signal_emit (view, signals[SAVE_AS], 0, view->link_uri);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static void
|
static void
|
||||||
midori_web_view_menu_download_activate_cb (GtkWidget* widget,
|
midori_web_view_menu_download_activate_cb (GtkWidget* widget,
|
||||||
|
@ -933,7 +934,6 @@ midori_web_view_menu_download_activate_cb (GtkWidget* widget,
|
||||||
{
|
{
|
||||||
sokoke_spawn_program (view->download_manager, view->link_uri);
|
sokoke_spawn_program (view->download_manager, view->link_uri);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
midori_web_view_menu_add_bookmark_activate_cb (GtkWidget* widget,
|
midori_web_view_menu_add_bookmark_activate_cb (GtkWidget* widget,
|
||||||
|
@ -1026,10 +1026,11 @@ webkit_web_view_populate_popup_cb (WebKitWebView* web_view,
|
||||||
g_signal_connect (menuitem, "activate",
|
g_signal_connect (menuitem, "activate",
|
||||||
G_CALLBACK (midori_web_view_menu_save_as_activate_cb), view);
|
G_CALLBACK (midori_web_view_menu_save_as_activate_cb), view);
|
||||||
gtk_widget_show (menuitem);
|
gtk_widget_show (menuitem);
|
||||||
|
#endif
|
||||||
if (view->download_manager && *view->download_manager)
|
if (view->download_manager && *view->download_manager)
|
||||||
{
|
{
|
||||||
menuitem = gtk_image_menu_item_new_with_mnemonic (
|
menuitem = gtk_image_menu_item_new_with_mnemonic (
|
||||||
_("_Download Link destination"));
|
_("Download with Download _Manager"));
|
||||||
icon = gtk_image_new_from_stock (GTK_STOCK_SAVE_AS,
|
icon = gtk_image_new_from_stock (GTK_STOCK_SAVE_AS,
|
||||||
GTK_ICON_SIZE_MENU);
|
GTK_ICON_SIZE_MENU);
|
||||||
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menuitem), icon);
|
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menuitem), icon);
|
||||||
|
@ -1038,7 +1039,6 @@ webkit_web_view_populate_popup_cb (WebKitWebView* web_view,
|
||||||
G_CALLBACK (midori_web_view_menu_download_activate_cb), view);
|
G_CALLBACK (midori_web_view_menu_download_activate_cb), view);
|
||||||
gtk_widget_show (menuitem);
|
gtk_widget_show (menuitem);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
menuitem = gtk_image_menu_item_new_from_stock (STOCK_BOOKMARK_ADD, NULL);
|
menuitem = gtk_image_menu_item_new_from_stock (STOCK_BOOKMARK_ADD, NULL);
|
||||||
gtk_menu_shell_insert (GTK_MENU_SHELL (menu), menuitem, 5);
|
gtk_menu_shell_insert (GTK_MENU_SHELL (menu), menuitem, 5);
|
||||||
g_signal_connect (menuitem, "activate",
|
g_signal_connect (menuitem, "activate",
|
||||||
|
@ -1079,8 +1079,11 @@ webkit_web_view_populate_popup_cb (WebKitWebView* web_view,
|
||||||
items = gtk_container_get_children (GTK_CONTAINER (menu));
|
items = gtk_container_get_children (GTK_CONTAINER (menu));
|
||||||
menuitem = (GtkWidget*)g_list_nth_data (items, 3);
|
menuitem = (GtkWidget*)g_list_nth_data (items, 3);
|
||||||
/* hack to localize menu item */
|
/* hack to localize menu item */
|
||||||
|
if (GTK_IS_BIN (menuitem))
|
||||||
|
{
|
||||||
label = gtk_bin_get_child (GTK_BIN (menuitem));
|
label = gtk_bin_get_child (GTK_BIN (menuitem));
|
||||||
gtk_label_set_label (GTK_LABEL (label), D_("gtk20", "_Refresh"));
|
gtk_label_set_label (GTK_LABEL (label), D_("gtk20", "_Refresh"));
|
||||||
|
}
|
||||||
g_list_free (items);
|
g_list_free (items);
|
||||||
menuitem = gtk_image_menu_item_new_with_mnemonic (_("Undo Close Tab"));
|
menuitem = gtk_image_menu_item_new_with_mnemonic (_("Undo Close Tab"));
|
||||||
icon = gtk_image_new_from_stock (GTK_STOCK_UNDELETE, GTK_ICON_SIZE_MENU);
|
icon = gtk_image_new_from_stock (GTK_STOCK_UNDELETE, GTK_ICON_SIZE_MENU);
|
||||||
|
|
Loading…
Reference in a new issue