aboutsummaryrefslogtreecommitdiffstats
path: root/src/ephy-shell.c
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@it.gnome.org>2003-06-04 23:27:13 +0800
committerMarco Pesenti Gritti <mpeseng@src.gnome.org>2003-06-04 23:27:13 +0800
commit96b34afe3a6bffb9cb7a6671403de31644688cce (patch)
tree19394a0f2cbac65bfb8d8da8544199f3604fcec8 /src/ephy-shell.c
parent29bbfe00469fe536bbf0f1025cde834cec3bec0b (diff)
downloadgsoc2013-epiphany-96b34afe3a6bffb9cb7a6671403de31644688cce.tar
gsoc2013-epiphany-96b34afe3a6bffb9cb7a6671403de31644688cce.tar.gz
gsoc2013-epiphany-96b34afe3a6bffb9cb7a6671403de31644688cce.tar.bz2
gsoc2013-epiphany-96b34afe3a6bffb9cb7a6671403de31644688cce.tar.lz
gsoc2013-epiphany-96b34afe3a6bffb9cb7a6671403de31644688cce.tar.xz
gsoc2013-epiphany-96b34afe3a6bffb9cb7a6671403de31644688cce.tar.zst
gsoc2013-epiphany-96b34afe3a6bffb9cb7a6671403de31644688cce.zip
Make sure to rebuild on add bookmark and on topic removal. Update on idle,
2003-06-04 Marco Pesenti Gritti <marco@it.gnome.org> * src/bookmarks/ephy-bookmarks-menu.c: (ephy_bookmarks_menu_rebuild), (do_updates), (bookmarks_tree_changed_cb), (ephy_bookmarks_menu_init): * src/bookmarks/ephy-bookmarks.c: (bookmarks_changed_cb), (topics_removed_cb), (ephy_bookmarks_add): Make sure to rebuild on add bookmark and on topic removal. Update on idle, so things like importing bookmarks doesnt take two days. * src/ephy-notebook.c: (notebook_drag_data_received_cb): * src/ephy-shell.c: (ephy_init_services), (load_homepage), (ephy_shell_new_tab): * src/ephy-shell.h: * src/ephy-window.c: (setup_window): * src/session.c: (parse_embed): Drop NOT_JUMP_TO flag, we dont have a pref anymore. On new page instead of really clone the page, just clone the url (put it in the address entry). So if the user need it it's easy to load, but there are not the inacceptable slow downs of real cloning. Let's see how this works ...
Diffstat (limited to 'src/ephy-shell.c')
-rw-r--r--src/ephy-shell.c95
1 files changed, 23 insertions, 72 deletions
diff --git a/src/ephy-shell.c b/src/ephy-shell.c
index fa566acad..a2c374cfa 100644
--- a/src/ephy-shell.c
+++ b/src/ephy-shell.c
@@ -63,12 +63,6 @@ struct EphyShellPrivate
GtkWidget *history_window;
};
-enum
-{
- STARTPAGE_HOME,
- STARTPAGE_LAST
-};
-
static void
ephy_shell_class_init (EphyShellClass *klass);
static void
@@ -360,7 +354,6 @@ ephy_init_services (EphyShell *gs)
/* preload the prefs */
/* it also enables notifiers support */
eel_gconf_monitor_add ("/apps/epiphany");
- eel_gconf_monitor_add ("/apps/nautilus/preferences");
eel_gconf_monitor_add ("/system/proxy");
#ifdef ENABLE_NAUTILUS_VIEW
@@ -371,58 +364,21 @@ ephy_init_services (EphyShell *gs)
}
-static char *
-build_homepage_url (EphyShell *gs,
- EphyEmbed *previous_embed)
+static void
+load_homepage (EphyEmbed *embed)
{
- const gchar *last_page_url;
- gchar *home_page_url;
- gint page_type;
- EphyHistory *gh;
- char *result = NULL;
+ char *home;
- if (previous_embed == NULL)
- {
- page_type = STARTPAGE_HOME;
- }
- else
- {
- page_type = STARTPAGE_LAST;
- }
+ home = eel_gconf_get_string(CONF_GENERAL_HOMEPAGE);
- /* return the appropriate page */
- if (page_type == STARTPAGE_HOME)
- {
- /* get location of home page */
- home_page_url = eel_gconf_get_string(CONF_GENERAL_HOMEPAGE);
- result = home_page_url;
- }
- else if (page_type == STARTPAGE_LAST)
+ if (home == NULL)
{
- if (previous_embed != NULL)
- {
- ephy_embed_get_location (previous_embed,
- TRUE,
- &result);
- }
-
- if (result == NULL)
- {
- /* get location of last page */
- gh = ephy_embed_shell_get_global_history
- (EPHY_EMBED_SHELL (gs));
- last_page_url = ephy_history_get_last_page (gh);
- result = g_strdup (last_page_url);
- }
+ home = g_strdup ("about:blank");
}
- if (result == NULL)
- {
- /* even in case of error, it's a good default */
- result = g_strdup ("about:blank");
- }
+ ephy_embed_load_url (embed, home);
- return result;
+ g_free (home);
}
/**
@@ -478,14 +434,14 @@ ephy_shell_new_tab (EphyShell *shell,
EphyEmbed *previous_embed = NULL;
GtkWidget *nb;
gint position;
+ Toolbar *toolbar;
in_new_window = !eel_gconf_get_boolean (CONF_TABS_TABBED);
if (flags & EPHY_NEW_TAB_IN_NEW_WINDOW) in_new_window = TRUE;
if (flags & EPHY_NEW_TAB_IN_EXISTING_WINDOW) in_new_window = FALSE;
- if (flags & EPHY_NEW_TAB_JUMP) jump_to = TRUE;
- if (flags & EPHY_NEW_TAB_DONT_JUMP_TO) jump_to = FALSE;
+ jump_to = (flags & EPHY_NEW_TAB_JUMP);
if (!in_new_window && parent_window != NULL)
{
@@ -496,6 +452,8 @@ ephy_shell_new_tab (EphyShell *shell,
window = ephy_window_new ();
}
+ toolbar = ephy_window_get_toolbar (window);
+
if (previous_tab)
{
previous_embed = ephy_tab_get_embed (previous_tab);
@@ -523,30 +481,23 @@ ephy_shell_new_tab (EphyShell *shell,
jump_to);
gtk_widget_show (GTK_WIDGET(window));
- if (flags & EPHY_NEW_TAB_HOME_PAGE ||
- flags & EPHY_NEW_TAB_NEW_PAGE)
- {
- Toolbar *toolbar;
-
- toolbar = ephy_window_get_toolbar (window);
- toolbar_edit_location (toolbar);
- }
-
if (flags & EPHY_NEW_TAB_HOME_PAGE)
{
- char *homepage;
-
- homepage = build_homepage_url (shell, previous_embed);
- g_assert (homepage != NULL);
-
- ephy_embed_load_url (embed, homepage);
+ toolbar_edit_location (toolbar);
- g_free (homepage);
+ load_homepage (embed);
}
else if (flags & EPHY_NEW_TAB_NEW_PAGE)
{
- ephy_embed_load_url (embed, "about:blank");
- ephy_embed_copy_page (embed, previous_embed, DISPLAY_NORMAL);
+ char *previous_address = NULL;
+
+ g_return_val_if_fail (previous_embed != NULL, NULL);
+ ephy_embed_get_location (previous_embed, TRUE,
+ &previous_address);
+ toolbar_set_location (toolbar, previous_address);
+ toolbar_edit_location (toolbar);
+
+ load_homepage (embed);
}
else if (flags & EPHY_NEW_TAB_OPEN_PAGE)
{