aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXan Lopez <xan@src.gnome.org>2009-02-16 06:20:52 +0800
committerXan Lopez <xan@src.gnome.org>2009-02-16 06:20:52 +0800
commit60293e52bf139ae8b7e667efb3ee6b8576298a12 (patch)
tree4446c91791255d29323e5c20dbcc312fb606b3fa
parent84b808dedd7821373c05bd43b8562670fbc620f4 (diff)
downloadgsoc2013-epiphany-60293e52bf139ae8b7e667efb3ee6b8576298a12.tar
gsoc2013-epiphany-60293e52bf139ae8b7e667efb3ee6b8576298a12.tar.gz
gsoc2013-epiphany-60293e52bf139ae8b7e667efb3ee6b8576298a12.tar.bz2
gsoc2013-epiphany-60293e52bf139ae8b7e667efb3ee6b8576298a12.tar.lz
gsoc2013-epiphany-60293e52bf139ae8b7e667efb3ee6b8576298a12.tar.xz
gsoc2013-epiphany-60293e52bf139ae8b7e667efb3ee6b8576298a12.tar.zst
gsoc2013-epiphany-60293e52bf139ae8b7e667efb3ee6b8576298a12.zip
Add option to open new windows in tabs.
Only available as a gconf key for now, /apps/epiphany/general/open_new_windows_in_tab. Patch by Alejandro G. Castro. Bug #571593 svn path=/trunk/; revision=8783
-rw-r--r--data/epiphany.schemas.in12
-rw-r--r--lib/ephy-prefs.h1
-rw-r--r--src/ephy-window.c22
3 files changed, 32 insertions, 3 deletions
diff --git a/data/epiphany.schemas.in b/data/epiphany.schemas.in
index 81fadca59..a847aa295 100644
--- a/data/epiphany.schemas.in
+++ b/data/epiphany.schemas.in
@@ -167,6 +167,18 @@
"icons", and "text".</long>
</locale>
</schema>
+ <schema>
+ <key>/schemas/apps/epiphany/general/open_new_windows_in_tab</key>
+ <applyto>/apps/epiphany/general/open_new_windows_in_tab</applyto>
+ <owner>epiphany</owner>
+ <type>bool</type>
+ <default>false</default>
+ <locale name="C">
+ <short>Force new windows to be opened in tabs</short>
+ <long>Force new window requests to be opened in tabs instead
+ of using a new window.</long>
+ </locale>
+ </schema>
<schema>
<key>/schemas/apps/epiphany/general/show_toolbars</key>
<applyto>/apps/epiphany/general/show_toolbars</applyto>
diff --git a/lib/ephy-prefs.h b/lib/ephy-prefs.h
index f62335590..33d5388c9 100644
--- a/lib/ephy-prefs.h
+++ b/lib/ephy-prefs.h
@@ -37,6 +37,7 @@ G_BEGIN_DECLS
#define CONF_WINDOWS_SHOW_STATUSBAR "/apps/epiphany/general/show_statusbar"
#define CONF_INTERFACE_MIDDLE_CLICK_OPEN_URL "/apps/epiphany/general/middle_click_open_url"
#define CONF_INTERFACE_TOOLBAR_STYLE "/apps/epiphany/general/toolbar_style"
+#define CONF_INTERFACE_OPEN_NEW_WINDOWS_IN_TAB "/apps/epiphany/general/open_new_windows_in_tab"
#define CONF_AUTO_DOWNLOADS "/apps/epiphany/general/automatic_downloads"
#define CONF_DESKTOP_IS_HOME_DIR "/apps/nautilus/preferences/desktop_is_home_dir"
#define CONF_NETWORK_MANAGED "/apps/epiphany/general/managed_network"
diff --git a/src/ephy-window.c b/src/ephy-window.c
index dacaee3e0..f826ba74f 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -2496,11 +2496,27 @@ create_web_view_cb (WebKitWebView *web_view,
{
EphyEmbed *embed;
WebKitWebView *new_web_view;
+ EphyNewTabFlags flags;
+ EphyWindow *parent_window;
+
+ if (eel_gconf_get_boolean (CONF_INTERFACE_OPEN_NEW_WINDOWS_IN_TAB))
+ {
+ parent_window = window;
+ flags = EPHY_NEW_TAB_IN_EXISTING_WINDOW |
+ EPHY_NEW_TAB_JUMP;
+
+ }
+ else
+ {
+ parent_window = NULL;
+ flags = EPHY_NEW_TAB_IN_NEW_WINDOW |
+ EPHY_NEW_TAB_DONT_SHOW_WINDOW;
+ }
embed = ephy_shell_new_tab_full (ephy_shell_get_default (),
- NULL, NULL, NULL,
- EPHY_NEW_TAB_IN_NEW_WINDOW |
- EPHY_NEW_TAB_DONT_SHOW_WINDOW,
+ parent_window,
+ NULL, NULL,
+ flags,
EPHY_EMBED_CHROME_ALL,
FALSE,
0);