aboutsummaryrefslogtreecommitdiffstats
path: root/src/ephy-shell.c
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@it.gnome.org>2003-05-21 19:15:52 +0800
committerMarco Pesenti Gritti <mpeseng@src.gnome.org>2003-05-21 19:15:52 +0800
commit8c7107742c5058841b22e52535a5ab316e44ad6e (patch)
tree22bd63369a6fda486d4da3bf9c52e7b3e048ad75 /src/ephy-shell.c
parent811b8c4ba8f54cfa747db421adc07a35b0b30d43 (diff)
downloadgsoc2013-epiphany-8c7107742c5058841b22e52535a5ab316e44ad6e.tar
gsoc2013-epiphany-8c7107742c5058841b22e52535a5ab316e44ad6e.tar.gz
gsoc2013-epiphany-8c7107742c5058841b22e52535a5ab316e44ad6e.tar.bz2
gsoc2013-epiphany-8c7107742c5058841b22e52535a5ab316e44ad6e.tar.lz
gsoc2013-epiphany-8c7107742c5058841b22e52535a5ab316e44ad6e.tar.xz
gsoc2013-epiphany-8c7107742c5058841b22e52535a5ab316e44ad6e.tar.zst
gsoc2013-epiphany-8c7107742c5058841b22e52535a5ab316e44ad6e.zip
Cleanup new tab logic, and ever use window for new instances.
2003-05-21 Marco Pesenti Gritti <marco@it.gnome.org> * src/bookmarks/ephy-bookmarks-editor.c: (cmd_open_bookmarks_in_tabs), (ephy_bookmarks_editor_node_activated_cb): * src/ephy-automation.c: (impl_ephy_automation_loadurl): * src/ephy-history-window.c: (cmd_open_bookmarks_in_tabs), (cmd_open_bookmarks_in_browser): * src/ephy-notebook.c: (notebook_drag_data_received_cb): * src/ephy-shell.c: (ephy_shell_new_tab): * src/ephy-shell.h: * src/popup-commands.c: (popup_cmd_link_in_new_window), (popup_cmd_link_in_new_tab), (popup_cmd_image_in_new_tab), (popup_cmd_image_in_new_window), (popup_cmd_frame_in_new_tab), (popup_cmd_frame_in_new_window): * src/window-commands.c: (window_cmd_file_new_window), (window_cmd_file_new_tab), (window_cmd_view_page_source): Cleanup new tab logic, and ever use window for new instances.
Diffstat (limited to 'src/ephy-shell.c')
-rw-r--r--src/ephy-shell.c66
1 files changed, 32 insertions, 34 deletions
diff --git a/src/ephy-shell.c b/src/ephy-shell.c
index 6322a04ef..4fcbcdf28 100644
--- a/src/ephy-shell.c
+++ b/src/ephy-shell.c
@@ -473,7 +473,7 @@ ephy_shell_new_tab (EphyShell *shell,
EphyTab *tab;
EphyEmbed *embed;
gboolean in_new_window;
- gboolean grouped = FALSE;
+ gboolean grouped;
gboolean jump_to;
EphyEmbed *previous_embed = NULL;
GtkWidget *nb;
@@ -503,25 +503,19 @@ ephy_shell_new_tab (EphyShell *shell,
previous_embed = ephy_tab_get_embed (previous_tab);
}
- if (url != NULL || flags & EPHY_NEW_TAB_IS_A_COPY ||
- flags & EPHY_NEW_TAB_VIEW_SOURCE)
- {
- grouped = TRUE;
- }
-
- if (flags & EPHY_NEW_TAB_APPEND_GROUPED) grouped = TRUE;
- if (flags & EPHY_NEW_TAB_APPEND_LAST) grouped = FALSE;
+ grouped = (flags & EPHY_NEW_TAB_OPEN_PAGE ||
+ flags & EPHY_NEW_TAB_APPEND_GROUPED ||
+ flags & EPHY_NEW_TAB_CLONE_PAGE);
- if ((flags & EPHY_NEW_TAB_APPEND_AFTER) && previous_embed != NULL)
+ if (flags & EPHY_NEW_TAB_APPEND_AFTER)
{
+ g_assert (previous_embed != NULL);
nb = ephy_window_get_notebook (window);
- position = gtk_notebook_page_num (GTK_NOTEBOOK (nb),
+ position = gtk_notebook_page_num (GTK_NOTEBOOK (nb),
GTK_WIDGET (previous_embed)) + 1;
}
- else
- {
- position = grouped ? EPHY_NOTEBOOK_INSERT_GROUPED : EPHY_NOTEBOOK_INSERT_LAST;
- }
+
+ position = grouped ? EPHY_NOTEBOOK_INSERT_GROUPED : EPHY_NOTEBOOK_INSERT_LAST;
tab = ephy_tab_new ();
embed = ephy_tab_get_embed (tab);
@@ -529,46 +523,50 @@ ephy_shell_new_tab (EphyShell *shell,
ephy_window_add_tab (window, tab,
position,
jump_to);
+ gtk_widget_show (GTK_WIDGET(window));
- if (flags & EPHY_NEW_TAB_RAISE_WINDOW)
+ if (flags & EPHY_NEW_TAB_HOME_PAGE ||
+ flags & EPHY_NEW_TAB_NEW_PAGE)
{
- gtk_window_present (GTK_WINDOW(window));
- }
- else
- {
- gtk_widget_show (GTK_WIDGET(window));
+ Toolbar *toolbar;
+
+ toolbar = ephy_window_get_toolbar (window);
+ toolbar_edit_location (toolbar);
}
- if (flags & EPHY_NEW_TAB_HOMEPAGE)
+ if (flags & EPHY_NEW_TAB_HOME_PAGE)
{
- Toolbar *toolbar;
char *homepage;
homepage = build_homepage_url (shell, previous_embed);
g_assert (homepage != NULL);
- toolbar = ephy_window_get_toolbar (window);
- toolbar_edit_location (toolbar);
-
ephy_embed_load_url (embed, homepage);
g_free (homepage);
}
- else if ((flags & EPHY_NEW_TAB_IS_A_COPY) ||
- (flags & EPHY_NEW_TAB_VIEW_SOURCE))
+ else if (flags & EPHY_NEW_TAB_NEW_PAGE)
{
- EmbedDisplayType display_type =
- (flags & EPHY_NEW_TAB_VIEW_SOURCE) ?
- DISPLAY_AS_SOURCE : DISPLAY_NORMAL;
ephy_embed_load_url (embed, "about:blank");
- ephy_embed_copy_page (embed, previous_embed, display_type);
+ ephy_embed_copy_page (embed, previous_embed, DISPLAY_NORMAL);
}
- else if (url)
+ else if (flags & EPHY_NEW_TAB_OPEN_PAGE)
{
+ g_assert (url != NULL);
ephy_embed_load_url (embed, url);
}
+ else if (flags & EPHY_NEW_TAB_CLONE_PAGE)
+ {
+ EmbedDisplayType display_type;
+
+ display_type = (flags & EPHY_NEW_TAB_SOURCE_MODE) ?
+ DISPLAY_AS_SOURCE : DISPLAY_NORMAL;
+
+ ephy_embed_load_url (embed, "about:blank");
+ ephy_embed_copy_page (embed, previous_embed, display_type);
+ }
- if (flags & EPHY_NEW_TAB_FULLSCREEN)
+ if (flags & EPHY_NEW_TAB_FULLSCREEN_MODE)
{
ephy_window_set_chrome (window, EMBED_CHROME_OPENASFULLSCREEN |
EMBED_CHROME_DEFAULT);