aboutsummaryrefslogtreecommitdiffstats
path: root/src/history-dialog.c
diff options
context:
space:
mode:
authorXan Lopez <xan@src.gnome.org>2003-02-21 01:22:05 +0800
committerXan Lopez <xan@src.gnome.org>2003-02-21 01:22:05 +0800
commit147faa7b5aa35e676d97dfce0952695022b7a3a0 (patch)
tree11c590b74cf2ee91e7a09c898954336ba8c1ebd9 /src/history-dialog.c
parenta923f76715c4cca404b318f5370b8098b4b0a83f (diff)
downloadgsoc2013-epiphany-147faa7b5aa35e676d97dfce0952695022b7a3a0.tar
gsoc2013-epiphany-147faa7b5aa35e676d97dfce0952695022b7a3a0.tar.gz
gsoc2013-epiphany-147faa7b5aa35e676d97dfce0952695022b7a3a0.tar.bz2
gsoc2013-epiphany-147faa7b5aa35e676d97dfce0952695022b7a3a0.tar.lz
gsoc2013-epiphany-147faa7b5aa35e676d97dfce0952695022b7a3a0.tar.xz
gsoc2013-epiphany-147faa7b5aa35e676d97dfce0952695022b7a3a0.tar.zst
gsoc2013-epiphany-147faa7b5aa35e676d97dfce0952695022b7a3a0.zip
History go to button.
History go to button.
Diffstat (limited to 'src/history-dialog.c')
-rwxr-xr-xsrc/history-dialog.c53
1 files changed, 50 insertions, 3 deletions
diff --git a/src/history-dialog.c b/src/history-dialog.c
index 4c32327a3..70710252a 100755
--- a/src/history-dialog.c
+++ b/src/history-dialog.c
@@ -55,6 +55,9 @@ void
history_entry_changed_cb (GtkWidget *widget,
HistoryDialog *dialog);
void
+history_go_button_clicked_cb (GtkWidget *button,
+ HistoryDialog *dialog);
+void
history_ok_button_clicked_cb (GtkWidget *button,
HistoryDialog *dialog);
void
@@ -75,6 +78,7 @@ struct HistoryDialogPrivate
EphyHistoryModel *nodemodel;
GtkTreeModel *filtermodel;
EphyTreeModelSort *sortmodel;
+ GtkWidget *go_button;
gboolean group;
gboolean embedded;
};
@@ -89,7 +93,8 @@ enum
{
PROP_TREEVIEW,
PROP_WORD,
- PROP_TIME
+ PROP_TIME,
+ PROP_GO_BUTTON
};
static const
@@ -98,6 +103,7 @@ EphyDialogProperty properties [] =
{ PROP_TREEVIEW, "history_treeview", NULL, PT_NORMAL, NULL },
{ PROP_WORD, "history_entry", CONF_HISTORY_SEARCH_TEXT, PT_NORMAL, NULL },
{ PROP_TIME, "history_time_optionmenu", CONF_HISTORY_SEARCH_TIME, PT_NORMAL, NULL },
+ { PROP_GO_BUTTON, "history_go_button", NULL, PT_NORMAL, NULL },
{ -1, NULL, NULL }
};
@@ -207,6 +213,16 @@ add_column (HistoryDialog *dialog,
}
static void
+history_view_selection_changed_cb (GtkTreeSelection *selection,
+ HistoryDialog *dialog)
+{
+ if (gtk_tree_selection_count_selected_rows (selection))
+ gtk_widget_set_sensitive (GTK_WIDGET (dialog->priv->go_button), TRUE);
+ else
+ gtk_widget_set_sensitive (GTK_WIDGET (dialog->priv->go_button), FALSE);
+}
+
+static void
history_view_row_activated_cb (GtkTreeView *treeview,
GtkTreePath *path,
GtkTreeViewColumn *column,
@@ -226,7 +242,7 @@ history_view_row_activated_cb (GtkTreeView *treeview,
node = ephy_history_model_node_from_iter (dialog->priv->nodemodel, &iter);
location = ephy_node_get_property_string (node, EPHY_NODE_PAGE_PROP_LOCATION);
g_return_if_fail (location != NULL);
- embed = ephy_embed_dialog_get_embed (EPHY_EMBED_DIALOG(dialog));
+ embed = ephy_embed_dialog_get_embed (EPHY_EMBED_DIALOG (dialog));
ephy_embed_load_url (embed, location);
}
@@ -277,6 +293,11 @@ history_dialog_setup_view (HistoryDialog *dialog)
"row_activated",
G_CALLBACK (history_view_row_activated_cb),
dialog);
+
+ g_signal_connect (gtk_tree_view_get_selection (dialog->priv->treeview),
+ "changed",
+ G_CALLBACK (history_view_selection_changed_cb),
+ dialog);
}
static GTime
@@ -383,12 +404,13 @@ history_dialog_set_embedded (HistoryDialog *dialog,
{
dialog->priv->embedded = embedded;
- ephy_dialog_construct (EPHY_DIALOG(dialog),
+ ephy_dialog_construct (EPHY_DIALOG (dialog),
properties,
"epiphany.glade",
embedded ?
"history_dock_box" :
"history_dialog");
+ dialog->priv->go_button = ephy_dialog_get_control (EPHY_DIALOG (dialog), PROP_GO_BUTTON);
dialog->priv->treeview = GTK_TREE_VIEW (
ephy_dialog_get_control (EPHY_DIALOG(dialog),
@@ -465,6 +487,31 @@ history_time_optionmenu_changed_cb (GtkWidget *widget,
}
void
+history_go_button_clicked_cb (GtkWidget *button,
+ HistoryDialog *dialog)
+{
+ GtkTreeSelection *selection;
+ GtkTreeIter iter, iter2;
+ EphyNode *node;
+ EphyEmbed *embed;
+ const char *location;
+
+ selection = gtk_tree_view_get_selection (dialog->priv->treeview);
+ g_return_if_fail (selection != NULL);
+ gtk_tree_selection_get_selected (selection, NULL, &iter);
+ gtk_tree_model_sort_convert_iter_to_child_iter
+ (GTK_TREE_MODEL_SORT (dialog->priv->sortmodel), &iter2, &iter);
+ egg_tree_model_filter_convert_iter_to_child_iter
+ (EGG_TREE_MODEL_FILTER (dialog->priv->filtermodel), &iter, &iter2);
+
+ node = ephy_history_model_node_from_iter (dialog->priv->nodemodel, &iter);
+ location = ephy_node_get_property_string (node, EPHY_NODE_PAGE_PROP_LOCATION);
+ g_return_if_fail (location != NULL);
+ embed = ephy_embed_dialog_get_embed (EPHY_EMBED_DIALOG (dialog));
+ ephy_embed_load_url (embed, location);
+}
+
+void
history_ok_button_clicked_cb (GtkWidget *button,
HistoryDialog *dialog)
{