static void
midori_browser_new_window_cb (MidoriBrowser* browser,
- const gchar* uri,
+ MidoriBrowser* new_browser,
MidoriApp* app)
{
- MidoriBrowser* new_browser = midori_app_create_browser (app);
- midori_app_add_browser (app, new_browser);
+ g_object_set (new_browser,
+ "settings", app->settings,
+ "bookmarks", app->bookmarks,
+ "trash", app->trash,
+ "search-engines", app->search_engines,
+ "history", app->history,
+ NULL);
- midori_browser_add_uri (new_browser, uri);
+ midori_app_add_browser (app, new_browser);
gtk_widget_show (GTK_WIDGET (new_browser));
}
const gchar* uri,
MidoriBrowser* browser)
{
- g_signal_emit (browser, signals[NEW_WINDOW], 0, uri);
+ MidoriBrowser* new_browser = g_object_new (MIDORI_TYPE_BROWSER, NULL);
+ midori_browser_add_uri (new_browser, uri);
+ g_signal_emit (browser, signals[NEW_WINDOW], 0, new_browser);
}
static void
{
if (where == MIDORI_NEW_VIEW_WINDOW)
{
- /* MidoriBrowser* new_browser = g_object_new (MIDORI_TYPE_BROWSER,
- NULL);
- g_signal_emit (browser, signals[NEW_BROWSER], 0, new_browser); */
- g_debug ("Opening all pages in new windows not implemented");
- midori_browser_set_current_page (browser,
- midori_browser_add_tab (browser, new_view));
+ MidoriBrowser* new_browser = g_object_new (MIDORI_TYPE_BROWSER, NULL);
+ midori_browser_add_tab (new_browser, new_view);
+ midori_browser_set_current_tab (new_browser, new_view);
+ g_signal_emit (browser, signals[NEW_WINDOW], 0, new_browser);
}
else
{
GObjectClass* gobject_class;
GParamFlags flags;
+ /**
+ * MidoriBrowser::new-window:
+ * @browser: the object on which the signal is emitted
+ * @window: a new browser window
+ *
+ * Emitted when a new browser window was created.
+ *
+ * Note: Before 0.1.7 the second argument was an URI string.
+ */
signals[NEW_WINDOW] = g_signal_new (
"new-window",
G_TYPE_FROM_CLASS (class),
G_STRUCT_OFFSET (MidoriBrowserClass, new_window),
0,
NULL,
- g_cclosure_marshal_VOID__STRING,
+ g_cclosure_marshal_VOID__OBJECT,
G_TYPE_NONE, 1,
- G_TYPE_STRING);
+ MIDORI_TYPE_BROWSER);
signals[ADD_TAB] = g_signal_new (
"add-tab",
_action_window_new_activate (GtkAction* action,
MidoriBrowser* browser)
{
- g_signal_emit (browser, signals[NEW_WINDOW], 0, "");
+ MidoriBrowser* new_browser = g_object_new (MIDORI_TYPE_BROWSER, NULL);
+ midori_browser_add_uri (new_browser, "");
+ g_signal_emit (browser, signals[NEW_WINDOW], 0, new_browser);
}
static void
uri = katze_item_get_uri (item);
if (uri && *uri)
- g_signal_emit (browser, signals[NEW_WINDOW], 0, uri);
+ {
+ MidoriBrowser* new_browser = g_object_new (MIDORI_TYPE_BROWSER, NULL);
+ midori_browser_add_uri (new_browser, uri);
+ g_signal_emit (browser, signals[NEW_WINDOW], 0, new_browser);
+ }
}
static void
KatzeItem* item,
GtkWidget* widget);
+static void
+midori_view_construct_web_view (MidoriView* view);
+
struct _MidoriView
{
GtkScrolledWindow parent_instance;
"net", view->net,
"settings", view->settings,
NULL);
- midori_view_set_uri (MIDORI_VIEW (new_view), "");
+ midori_view_construct_web_view (MIDORI_VIEW (new_view));
g_signal_connect (MIDORI_VIEW (new_view)->web_view, "web-view-ready",
G_CALLBACK (webkit_web_view_web_view_ready_cb), view);
return MIDORI_VIEW (new_view)->web_view;
WebKitWebFrame* web_frame;
gpointer inspector;
+ g_return_if_fail (!view->web_view);
+
view->web_view = webkit_web_view_new ();
/* Load something to avoid a bug where WebKit might not set a main frame */