aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorXan Lopez <xan@src.gnome.org>2003-02-13 03:52:35 +0800
committerXan Lopez <xan@src.gnome.org>2003-02-13 03:52:35 +0800
commitc8d58f062a15c0a42bdaf359449cfdf8c6c8afd8 (patch)
tree94a5abe2a596869319aa39deabd92aa20112dc55 /src
parentcec20e1993813177828726bddd2ffa4e112ba0ad (diff)
downloadgsoc2013-epiphany-c8d58f062a15c0a42bdaf359449cfdf8c6c8afd8.tar
gsoc2013-epiphany-c8d58f062a15c0a42bdaf359449cfdf8c6c8afd8.tar.gz
gsoc2013-epiphany-c8d58f062a15c0a42bdaf359449cfdf8c6c8afd8.tar.bz2
gsoc2013-epiphany-c8d58f062a15c0a42bdaf359449cfdf8c6c8afd8.tar.lz
gsoc2013-epiphany-c8d58f062a15c0a42bdaf359449cfdf8c6c8afd8.tar.xz
gsoc2013-epiphany-c8d58f062a15c0a42bdaf359449cfdf8c6c8afd8.tar.zst
gsoc2013-epiphany-c8d58f062a15c0a42bdaf359449cfdf8c6c8afd8.zip
Add "Go to" button to the BE.
Add "Go to" button to the BE.
Diffstat (limited to 'src')
-rw-r--r--src/bookmarks/ephy-bookmarks-editor.c37
1 files changed, 33 insertions, 4 deletions
diff --git a/src/bookmarks/ephy-bookmarks-editor.c b/src/bookmarks/ephy-bookmarks-editor.c
index c7e5c8932..a538da8c9 100644
--- a/src/bookmarks/ephy-bookmarks-editor.c
+++ b/src/bookmarks/ephy-bookmarks-editor.c
@@ -67,7 +67,8 @@ enum
enum
{
- RESPONSE_REMOVE
+ RESPONSE_REMOVE,
+ RESPONSE_GO
};
static GObjectClass *parent_class = NULL;
@@ -207,7 +208,7 @@ ephy_bookmarks_editor_node_selected_cb (GtkWidget *view,
gtk_entry_set_text (GTK_ENTRY (editor->priv->keywords_entry),
keywords ? g_strdup (keywords) : "");
gtk_entry_set_text (GTK_ENTRY (editor->priv->location_entry),
- location ? g_strdup (location) : "");
+ location ? g_strdup (location) : "");
gtk_widget_set_sensitive (GTK_WIDGET (editor->priv->title_entry), TRUE);
gtk_widget_set_sensitive (GTK_WIDGET (editor->priv->keywords_entry), TRUE);
gtk_widget_set_sensitive (GTK_WIDGET (editor->priv->location_entry), TRUE);
@@ -242,6 +243,28 @@ ephy_bookmarks_editor_node_activated_cb (GtkWidget *view,
}
static void
+ephy_bookmarks_editor_go_to_location (EphyBookmarksEditor *editor)
+{
+ GList *selection;
+ const char *location;
+ GtkWindow *window;
+
+ selection = ephy_node_view_get_selection (editor->priv->bm_view);
+ if (selection != NULL)
+ {
+ EphyNode *bm = EPHY_NODE (selection->data);
+
+ location = ephy_node_get_property_string (bm,
+ EPHY_NODE_BMK_PROP_LOCATION);
+ g_return_if_fail (location != NULL);
+ window = gtk_window_get_transient_for (GTK_WINDOW (editor));
+ g_return_if_fail (IS_EPHY_WINDOW (window));
+ ephy_window_load_url (EPHY_WINDOW (window), location);
+ g_list_free (selection);
+ }
+}
+
+static void
ephy_bookmarks_editor_response_cb (GtkDialog *dialog,
int response_id,
EphyBookmarksEditor *editor)
@@ -254,6 +277,9 @@ ephy_bookmarks_editor_response_cb (GtkDialog *dialog,
case RESPONSE_REMOVE:
ephy_node_view_remove (editor->priv->bm_view);
break;
+ case RESPONSE_GO:
+ ephy_bookmarks_editor_go_to_location (editor);
+ break;
}
}
@@ -487,7 +513,7 @@ ephy_bookmarks_editor_construct (EphyBookmarksEditor *editor)
gtk_dialog_set_has_separator (GTK_DIALOG (editor), FALSE);
gtk_container_set_border_width (GTK_CONTAINER (editor), 6);
- gtk_widget_set_size_request (GTK_WIDGET (editor), 550, 450);
+ gtk_widget_set_size_request (GTK_WIDGET (editor), 600, 400);
g_signal_connect (G_OBJECT (editor),
"response",
G_CALLBACK (ephy_bookmarks_editor_response_cb),
@@ -507,7 +533,7 @@ ephy_bookmarks_editor_construct (EphyBookmarksEditor *editor)
ephy_node_view_add_column (key_view, _("Keywords"),
EPHY_TREE_MODEL_NODE_COL_KEYWORD, FALSE);
gtk_box_pack_start (GTK_BOX (hbox), GTK_WIDGET (key_view), FALSE, TRUE, 0);
- gtk_widget_set_size_request (GTK_WIDGET (key_view), 130, -1);
+ gtk_widget_set_size_request (GTK_WIDGET (key_view), 180, -1);
gtk_widget_show (GTK_WIDGET (key_view));
editor->priv->key_view = key_view;
g_signal_connect (G_OBJECT (key_view),
@@ -548,6 +574,9 @@ ephy_bookmarks_editor_construct (EphyBookmarksEditor *editor)
FALSE, FALSE, 0);
gtk_dialog_add_button (GTK_DIALOG (editor),
+ GTK_STOCK_JUMP_TO,
+ RESPONSE_GO);
+ gtk_dialog_add_button (GTK_DIALOG (editor),
GTK_STOCK_REMOVE,
RESPONSE_REMOVE);
gtk_dialog_add_button (GTK_DIALOG (editor),