#include <config.h>
#endif
-#include "midori-view.h"
+#include "midori-addons.h"
#include "midori-app.h"
-#include "midori-websettings.h"
#include "midori-browser.h"
-#include "midori-stock.h"
+#include "midori-console.h"
#include "midori-extension.h"
+#include "midori-panel.h"
+#include "midori-stock.h"
+#include "midori-view.h"
+#include "midori-websettings.h"
+
#include "sokoke.h"
#include "gjs.h"
return TRUE;
}
+static void
+midori_view_console_message_cb (GtkWidget* view,
+ const gchar* message,
+ gint line,
+ const gchar* source_id,
+ MidoriConsole* console)
+{
+ midori_console_add (console, message, line, source_id);
+}
+
+static void
+midori_browser_add_tab_cb (MidoriBrowser* browser,
+ MidoriView* view,
+ MidoriConsole* console)
+{
+ g_signal_connect (view, "console-message",
+ G_CALLBACK (midori_view_console_message_cb), console);
+}
+
+static void
+midori_app_add_browser_cb (MidoriApp* app,
+ MidoriBrowser* browser,
+ KatzeNet* net)
+{
+ GtkWidget* panel;
+ GtkWidget* addon;
+ GtkWidget* toolbar;
+
+ panel = katze_object_get_object (browser, "panel");
+
+ /* Transfers */
+ /* addon = midori_view_new (net);
+ gtk_widget_show (addon);
+ midori_panel_append_page (MIDORI_PANEL (panel), addon, NULL,
+ STOCK_TRANSFERS, _("Transfers")); */
+
+ /* Console */
+ addon = midori_console_new ();
+ gtk_widget_show (addon);
+ toolbar = midori_console_get_toolbar (MIDORI_CONSOLE (addon));
+ gtk_widget_show (toolbar);
+ midori_panel_append_page (MIDORI_PANEL (panel), addon, toolbar,
+ STOCK_CONSOLE, _("Console"));
+ g_signal_connect (browser, "add-tab",
+ G_CALLBACK (midori_browser_add_tab_cb), addon);
+
+ /* Userscripts */
+ addon = midori_addons_new (GTK_WIDGET (browser), MIDORI_ADDON_USER_SCRIPTS);
+ gtk_widget_show (addon);
+ toolbar = midori_addons_get_toolbar (MIDORI_ADDONS (addon));
+ gtk_widget_show (toolbar);
+ midori_panel_append_page (MIDORI_PANEL (panel), addon, toolbar,
+ STOCK_SCRIPTS, _("Userscripts"));
+ /* Userstyles */
+ addon = midori_addons_new (GTK_WIDGET (browser), MIDORI_ADDON_USER_STYLES);
+ gtk_widget_show (addon);
+ toolbar = midori_addons_get_toolbar (MIDORI_ADDONS (addon));
+ gtk_widget_show (toolbar);
+ midori_panel_append_page (MIDORI_PANEL (panel), addon, toolbar,
+ STOCK_STYLES, _("Userstyles"));
+
+ /* Extensions */
+ addon = midori_addons_new (GTK_WIDGET (browser), MIDORI_ADDON_EXTENSIONS);
+ gtk_widget_show (addon);
+ toolbar = midori_addons_get_toolbar (MIDORI_ADDONS (addon));
+ gtk_widget_show (toolbar);
+ midori_panel_append_page (MIDORI_PANEL (panel), addon, toolbar,
+ STOCK_EXTENSIONS, _("Extensions"));
+}
+
static void
midori_browser_session_cb (MidoriBrowser* browser,
gpointer arg1,
"history", history,
"extensions", extensions,
NULL);
+ g_signal_connect (app, "add-browser",
+ G_CALLBACK (midori_app_add_browser_cb), NULL);
n = katze_array_get_length (extensions);
for (i = 0; i < n; i++)
#include "midori-source.h"
#include "midori-preferences.h"
#include "midori-panel.h"
-#include "midori-addons.h"
-#include "midori-console.h"
#include "midori-locationaction.h"
#include "midori-searchaction.h"
#include "midori-stock.h"
GtkWidget* panel;
GtkWidget* panel_bookmarks;
GtkWidget* panel_history;
- GtkWidget* panel_console;
GtkWidget* panel_pageholder;
GtkWidget* notebook;
_midori_browser_activate_action (browser, action);
}
-static void
-midori_view_console_message_cb (GtkWidget* view,
- const gchar* message,
- gint line,
- const gchar* source_id,
- MidoriBrowser* browser)
-{
- midori_console_add (MIDORI_CONSOLE (browser->panel_console),
- message, line, source_id);
-}
-
static void
midori_view_attach_inspector_cb (GtkWidget* view,
GtkWidget* inspector_view,
midori_view_notify_statusbar_text_cb, browser,
"signal::activate-action",
midori_view_activate_action_cb, browser,
- "signal::console-message",
- midori_view_console_message_cb, browser,
"signal::attach-inspector",
midori_view_attach_inspector_cb, browser,
"signal::new-tab",
GtkWidget* treeview;
GtkWidget* toolbar;
GtkToolItem* toolitem;
- GtkWidget* panel;
GtkRcStyle* rcstyle;
GtkWidget* scrolled;
box, toolbar,
STOCK_BOOKMARKS, _("Bookmarks"));
- /* Transfers */
- panel = midori_view_new (browser->net);
- gtk_widget_show (panel);
- midori_panel_append_page (MIDORI_PANEL (browser->panel),
- panel, NULL,
- STOCK_TRANSFERS, _("Transfers"));
-
- /* Console */
- browser->panel_console = midori_console_new ();
- gtk_widget_show (browser->panel_console);
- toolbar = midori_console_get_toolbar (MIDORI_CONSOLE (browser->panel_console));
- gtk_widget_show (toolbar);
- midori_panel_append_page (MIDORI_PANEL (browser->panel),
- browser->panel_console, toolbar,
- STOCK_CONSOLE, _("Console"));
-
/* History */
box = gtk_vbox_new (FALSE, 0);
treestore = gtk_tree_store_new (2, KATZE_TYPE_ITEM, G_TYPE_INT);
/* i18n: A panel showing a user specified web page */
STOCK_PAGE_HOLDER, _("Pageholder"));
- /* Userscripts */
- panel = midori_addons_new (GTK_WIDGET (browser), MIDORI_ADDON_USER_SCRIPTS);
- gtk_widget_show (panel);
- toolbar = midori_addons_get_toolbar (MIDORI_ADDONS (panel));
- gtk_widget_show (toolbar);
- midori_panel_append_page (MIDORI_PANEL (browser->panel),
- panel, toolbar,
- STOCK_SCRIPTS, _("Userscripts"));
- /* Userstyles */
- panel = midori_addons_new (GTK_WIDGET (browser), MIDORI_ADDON_USER_STYLES);
- gtk_widget_show (panel);
- toolbar = midori_addons_get_toolbar (MIDORI_ADDONS (panel));
- gtk_widget_show (toolbar);
- midori_panel_append_page (MIDORI_PANEL (browser->panel),
- panel, toolbar,
- STOCK_STYLES, _("Userstyles"));
-
- /* Extensions */
- panel = midori_addons_new (GTK_WIDGET (browser), MIDORI_ADDON_EXTENSIONS);
- gtk_widget_show (panel);
- toolbar = midori_addons_get_toolbar (MIDORI_ADDONS (panel));
- gtk_widget_show (toolbar);
- midori_panel_append_page (MIDORI_PANEL (browser->panel),
- panel, toolbar,
- STOCK_EXTENSIONS, _("Extensions"));
-
/* Notebook, containing all views */
vpaned = gtk_vpaned_new ();
gtk_paned_pack2 (GTK_PANED (hpaned), vpaned, FALSE, FALSE);