aboutsummaryrefslogtreecommitdiffstats
path: root/src/ephy-shell.c
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2005-01-30 23:20:36 +0800
committerChristian Persch <chpe@src.gnome.org>2005-01-30 23:20:36 +0800
commit8f01817138c1852b319898a5de3f4b9f244cdea5 (patch)
tree3473088e9fc4b6200a85e6714183e6f8482b2963 /src/ephy-shell.c
parent58dba74abaf6313221c50629e546dc4492672486 (diff)
downloadgsoc2013-epiphany-8f01817138c1852b319898a5de3f4b9f244cdea5.tar
gsoc2013-epiphany-8f01817138c1852b319898a5de3f4b9f244cdea5.tar.gz
gsoc2013-epiphany-8f01817138c1852b319898a5de3f4b9f244cdea5.tar.bz2
gsoc2013-epiphany-8f01817138c1852b319898a5de3f4b9f244cdea5.tar.lz
gsoc2013-epiphany-8f01817138c1852b319898a5de3f4b9f244cdea5.tar.xz
gsoc2013-epiphany-8f01817138c1852b319898a5de3f4b9f244cdea5.tar.zst
gsoc2013-epiphany-8f01817138c1852b319898a5de3f4b9f244cdea5.zip
Move new-window signal to the embed single, and new window creation from
2005-01-30 Christian Persch <chpe@cvs.gnome.org> * doc/reference/tmpl/ephy-embed.sgml: * embed/ephy-embed-single.c: (ephy_embed_single_iface_init): * embed/ephy-embed-single.h: * embed/ephy-embed.c: (ephy_embed_base_init): * embed/ephy-embed.h: * embed/mozilla/mozilla-embed-single.cpp: * embed/mozilla/mozilla-embed.cpp: * embed/mozilla/mozilla-embed.h: * lib/ephy-marshal.list: * lib/ephy-prefs.h: * src/ephy-shell.c: (ephy_shell_new_window_cb), (impl_get_embed_single): * src/ephy-tab.c: (ephy_tab_new_window_cb): Move new-window signal to the embed single, and new window creation from EphyTab to EphyShell.
Diffstat (limited to 'src/ephy-shell.c')
-rw-r--r--src/ephy-shell.c42
1 files changed, 38 insertions, 4 deletions
diff --git a/src/ephy-shell.c b/src/ephy-shell.c
index 1fc08162a..9af0c98e5 100644
--- a/src/ephy-shell.c
+++ b/src/ephy-shell.c
@@ -45,6 +45,7 @@
#include "ephy-toolbar.h"
#include "ephy-automation.h"
#include "print-dialog.h"
+#include "ephy-prefs.h"
#ifdef ENABLE_DBUS
#include "ephy-dbus.h"
@@ -150,6 +151,37 @@ ephy_shell_class_init (EphyShellClass *klass)
g_type_class_add_private (object_class, sizeof(EphyShellPrivate));
}
+static EphyEmbed *
+ephy_shell_new_window_cb (EphyEmbedSingle *single,
+ EphyEmbed *parent_embed,
+ EphyEmbedChrome chromemask,
+ EphyShell *shell)
+{
+ EphyTab *new_tab;
+ EphyWindow *window;
+
+ LOG ("ephy_shell_new_window_cb tab chrome %d", chromemask);
+
+ /* FIXME in lockdown-fullscreen mode, always add a new tab instead */
+
+ if (eel_gconf_get_boolean (CONF_LOCKDOWN_DISABLE_JAVASCRIPT_CHROME))
+ {
+ window = ephy_window_new ();
+ }
+ else
+ {
+ window = ephy_window_new_with_chrome (chromemask);
+ }
+
+ new_tab = ephy_tab_new ();
+ gtk_widget_show (GTK_WIDGET (new_tab));
+
+ ephy_window_add_tab (window, new_tab, -1, FALSE);
+
+ return ephy_tab_get_embed (new_tab);
+}
+
+
static gboolean
ephy_shell_add_sidebar_cb (EphyEmbedSingle *embed_single,
const char *url,
@@ -189,18 +221,20 @@ ephy_shell_add_sidebar_cb (EphyEmbedSingle *embed_single,
static GObject*
impl_get_embed_single (EphyEmbedShell *embed_shell)
{
- EphyShell *shell;
+ EphyShell *shell = EPHY_SHELL (embed_shell);
GObject *embed_single;
embed_single = EPHY_EMBED_SHELL_CLASS (parent_class)->get_embed_single (embed_shell);
- shell = EPHY_SHELL (embed_shell);
-
if (embed_single != NULL && shell->priv->embed_single_connected == FALSE)
{
+ g_signal_connect_object (embed_single, "new-window",
+ G_CALLBACK (ephy_shell_new_window_cb),
+ shell, G_CONNECT_AFTER);
+
g_signal_connect_object (embed_single, "add-sidebar",
G_CALLBACK (ephy_shell_add_sidebar_cb),
- embed_shell, G_CONNECT_AFTER);
+ shell, G_CONNECT_AFTER);
shell->priv->embed_single_connected = TRUE;
}