aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2004-12-02 23:16:41 +0800
committerChristian Persch <chpe@src.gnome.org>2004-12-02 23:16:41 +0800
commit37cc7f0bb5f9e4e7257ff9b7106dd92467590d43 (patch)
treed2c21062ffb30b383187311a657c26148c5ddf28 /src
parent2f0a4969602af118edfcb2959d422b7c03e022b0 (diff)
downloadgsoc2013-epiphany-37cc7f0bb5f9e4e7257ff9b7106dd92467590d43.tar
gsoc2013-epiphany-37cc7f0bb5f9e4e7257ff9b7106dd92467590d43.tar.gz
gsoc2013-epiphany-37cc7f0bb5f9e4e7257ff9b7106dd92467590d43.tar.bz2
gsoc2013-epiphany-37cc7f0bb5f9e4e7257ff9b7106dd92467590d43.tar.lz
gsoc2013-epiphany-37cc7f0bb5f9e4e7257ff9b7106dd92467590d43.tar.xz
gsoc2013-epiphany-37cc7f0bb5f9e4e7257ff9b7106dd92467590d43.tar.zst
gsoc2013-epiphany-37cc7f0bb5f9e4e7257ff9b7106dd92467590d43.zip
Update bookmarks from HTTP 301. Fixes bug #126312.
2004-12-02 Christian Persch <chpe@cvs.gnome.org> * embed/ephy-history.c: (ephy_history_class_init): * embed/ephy-history.h: * embed/mozilla/EphyHistoryListener.cpp: * embed/mozilla/EphyHistoryListener.h: * embed/mozilla/EphyUtils.cpp: * embed/mozilla/EphyUtils.h: * embed/mozilla/GlobalHistory.cpp: * embed/mozilla/GlobalHistory.h: * embed/mozilla/Makefile.am: * src/bookmarks/ephy-bookmarks.c: (redirect_cb), (ephy_setup_history_notifiers): * src/ephy-window.c: (confirm_close_with_modified_forms), (ensure_window_group), (ephy_window_init): Update bookmarks from HTTP 301. Fixes bug #126312.
Diffstat (limited to 'src')
-rw-r--r--src/bookmarks/ephy-bookmarks.c25
-rw-r--r--src/ephy-window.c27
2 files changed, 42 insertions, 10 deletions
diff --git a/src/bookmarks/ephy-bookmarks.c b/src/bookmarks/ephy-bookmarks.c
index e12eec366..0d520f2ac 100644
--- a/src/bookmarks/ephy-bookmarks.c
+++ b/src/bookmarks/ephy-bookmarks.c
@@ -476,6 +476,29 @@ history_cleared_cb (EphyHistory *history, EphyBookmarks *bookmarks)
clear_favorites (bookmarks);
}
+#include <gtk/gtkmessagedialog.h>
+#include <gtk/gtkdialog.h>
+
+static void
+redirect_cb (EphyHistory *history,
+ const char *from_uri,
+ const char *to_uri,
+ EphyBookmarks *eb)
+{
+ EphyNode *bookmark;
+ GValue value = { 0, };
+
+ bookmark = ephy_bookmarks_find_bookmark (eb, from_uri);
+ if (bookmark != NULL)
+ {
+ g_value_init (&value, G_TYPE_STRING);
+ g_value_set_string (&value, to_uri);
+ ephy_node_set_property (bookmark, EPHY_NODE_BMK_PROP_LOCATION,
+ &value);
+ g_value_unset (&value);
+ }
+}
+
static void
ephy_setup_history_notifiers (EphyBookmarks *eb)
{
@@ -492,6 +515,8 @@ ephy_setup_history_notifiers (EphyBookmarks *eb)
G_CALLBACK (history_site_visited_cb), eb);
g_signal_connect (history, "cleared",
G_CALLBACK (history_cleared_cb), eb);
+ g_signal_connect (history, "redirect",
+ G_CALLBACK (redirect_cb), eb);
}
static void
diff --git a/src/ephy-window.c b/src/ephy-window.c
index 8b70cf6c1..d7c65dd45 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -685,7 +685,6 @@ static gboolean
confirm_close_with_modified_forms (EphyWindow *window)
{
GtkWidget *dialog;
- GtkWindowGroup *group;
int response;
dialog = gtk_message_dialog_new
@@ -708,15 +707,7 @@ confirm_close_with_modified_forms (EphyWindow *window)
/* FIXME set title */
gtk_window_set_icon_name (GTK_WINDOW (dialog), "web-browser");
- group = GTK_WINDOW (window)->group;
- if (group == NULL)
- {
- group = gtk_window_group_new ();
- gtk_window_group_add_window (group, GTK_WINDOW (window));
- g_object_unref (group);
- }
-
- gtk_window_group_add_window (group, GTK_WINDOW (dialog));
+ gtk_window_group_add_window (GTK_WINDOW (window)->group, GTK_WINDOW (dialog));
response = gtk_dialog_run (GTK_DIALOG (dialog));
@@ -2366,6 +2357,20 @@ open_bookmark_cb (EphyBookmarksMenu *menu,
}
static void
+ensure_window_group (EphyWindow *window)
+{
+ GtkWindowGroup *group;
+
+ group = GTK_WINDOW (window)->group;
+ if (group == NULL)
+ {
+ group = gtk_window_group_new ();
+ gtk_window_group_add_window (group, GTK_WINDOW (window));
+ g_object_unref (group);
+ }
+}
+
+static void
ephy_window_init (EphyWindow *window)
{
EphyExtension *manager;
@@ -2380,6 +2385,8 @@ ephy_window_init (EphyWindow *window)
g_object_ref (ephy_shell);
+ ensure_window_group (window);
+
/* Setup the UI manager and connect verbs */
setup_ui_manager (window);