#define STOCK_NEWSFEED "gtk-index" // "newsfeed"
#define STOCK_PLUGINS GTK_STOCK_CONVERT // "plugin"
#define STOCK_POPUPS_BLOCKED "popup-hidden"
-#define STOCK_SOURCE_VIEW "stock_view-html-source" // "view-source"
#define STOCK_TAB_CLOSE GTK_STOCK_CLOSE // "tab-close"
#define STOCK_WINDOW_CLOSE GTK_STOCK_CLOSE // "window-close"
{ STOCK_NEWSFEED, "Newsfeed", 0, 0, NULL },
{ STOCK_PLUGINS, "_Plugins", 0, 0, NULL },
{ STOCK_POPUPS_BLOCKED, "Blocked Popups", 0, 0, NULL },
- { STOCK_SOURCE_VIEW, "View Source", 0, 0, NULL },
{ STOCK_TAB_CLOSE, "C_lose Tab", 0, 0, NULL },
{ STOCK_TAB_NEW, "New _Tab", 0, 0, NULL },
{ STOCK_WINDOW_CLOSE, "_Close Window", 0, 0, NULL },
if (!uri && !webkit_web_view_has_selection (WEBKIT_WEB_VIEW (web_view)))
{
- // TODO: menu items
- // UndoTabClose
- // sep
- // BookmarkNew
- // SaveAs
- // SourceView
- // Print
+ GtkAction* action = _action_by_name (browser, "UndoTabClose");
+ GtkWidget* menuitem = gtk_action_create_menu_item (action);
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
+ menuitem = gtk_separator_menu_item_new ();
+ gtk_widget_show (menuitem);
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
+ action = _action_by_name (browser, "BookmarkNew");
+ menuitem = gtk_action_create_menu_item (action);
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
+ action = _action_by_name (browser, "SaveAs");
+ menuitem = gtk_action_create_menu_item (action);
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
+ action = _action_by_name (browser, "SourceView");
+ menuitem = gtk_action_create_menu_item (action);
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
+ action = _action_by_name (browser, "Print");
+ menuitem = gtk_action_create_menu_item (action);
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
}
}
{ "ZoomNormal", GTK_STOCK_ZOOM_100,
NULL, "<Ctrl>0",
"hm?", NULL/*G_CALLBACK (_action_zoom_normal_activate)*/ },
- { "SourceView", STOCK_SOURCE_VIEW,
- NULL, "",
+ { "SourceView", NULL,
+ "View Source", "",
"hm?", /*G_CALLBACK (_action_source_view_activate)*/ },
- { "SelectionSourceView", STOCK_SOURCE_VIEW,
+ { "SelectionSourceView", NULL,
"View Selection Source", "",
"hm?", NULL/*G_CALLBACK (_action_selection_source_view_activate)*/ },
{ "Fullscreen", GTK_STOCK_FULLSCREEN,
"<separator/>"
"<menuitem action='TrashEmpty'/>"
"</menu>"
+ "<menuitem action='UndoTabClose'/>"
"<separator/>"
"<menuitem action='Find'/>"
"<menuitem action='FindNext'/>"
case PROP_SETTINGS:
katze_object_assign (priv->settings, g_value_get_object (value));
g_object_ref (priv->settings);
- // FIXME: Assign settings to each web view
+ gtk_container_foreach (GTK_CONTAINER (priv->notebook),
+ (GtkCallback*) midori_web_view_set_settings,
+ priv->settings);
break;
case PROP_TRASH:
; // FIXME: Disconnect handlers
MidoriWebView* web_view)
{
const gchar* uri = g_object_get_data (G_OBJECT (widget), "uri");
- g_print ("selected: %s\n", uri);
g_signal_emit (web_view, signals[NEW_TAB], 0, uri);
}
G_CALLBACK (midori_web_view_menu_new_tab_activate_cb), web_view);
gtk_widget_show (menuitem);
}
- // FIXME: We are leaking 'text' which is not const be should be.
+ // FIXME: We are leaking 'text' which is not const but should be.
}
}
return GTK_WIDGET (web_view);
}
+/**
+ * midori_web_view_set_settings:
+ * @web_view: a #MidoriWebView
+ * @web_settings: a #MidoriWebSettings
+ *
+ * Assigns a settings instance to the web view.
+ **/
+void
+midori_web_view_set_settings (MidoriWebView* web_view,
+ MidoriWebSettings* web_settings)
+{
+ g_object_set (web_view, "settings", web_settings, NULL);
+}
+
/**
* midori_web_view_get_proxy_menu_item:
* @web_view: a #MidoriWebView
+++ /dev/null
-/*
- Copyright (C) 2007 Christian Dywan <christian@twotoasts.de>
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- See the file COPYING for the full license text.
-*/
-
-#ifndef __UI_H__
-#define __UI_H__ 1
-
-#endif /* !__UI_H__ */