aboutsummaryrefslogtreecommitdiffstats
path: root/lib/widgets
diff options
context:
space:
mode:
authorXan Lopez <xan@src.gnome.org>2003-07-14 16:37:06 +0800
committerXan Lopez <xan@src.gnome.org>2003-07-14 16:37:06 +0800
commite5e726afd351863297a2b87c64ffeed43a83e430 (patch)
treeffa3369d4d15d8381d120b72fbb720634dd27519 /lib/widgets
parent2c7314e543cb6b8fce33e5818c9913cfb3e5507c (diff)
downloadgsoc2013-epiphany-e5e726afd351863297a2b87c64ffeed43a83e430.tar
gsoc2013-epiphany-e5e726afd351863297a2b87c64ffeed43a83e430.tar.gz
gsoc2013-epiphany-e5e726afd351863297a2b87c64ffeed43a83e430.tar.bz2
gsoc2013-epiphany-e5e726afd351863297a2b87c64ffeed43a83e430.tar.lz
gsoc2013-epiphany-e5e726afd351863297a2b87c64ffeed43a83e430.tar.xz
gsoc2013-epiphany-e5e726afd351863297a2b87c64ffeed43a83e430.tar.zst
gsoc2013-epiphany-e5e726afd351863297a2b87c64ffeed43a83e430.zip
Don't use event->string, is deprecated (#117346). Also improve intelligent
* lib/widgets/ephy-node-view.c: (ephy_node_view_select_node_by_key), (ephy_node_view_remove): Don't use event->string, is deprecated (#117346). Also improve intelligent selection. * src/pdm-dialog.c: (pdm_dialog_remove_button_clicked_cb), (pdm_cmd_delete_selection), (pdm_key_pressed_cb), (setup_action): Connect del keys to delete action, also implement intelligent selection after deletion (I want to be known as Mr. Intelligent Selection from now, spread the word).
Diffstat (limited to 'lib/widgets')
-rw-r--r--lib/widgets/ephy-node-view.c27
1 files changed, 20 insertions, 7 deletions
diff --git a/lib/widgets/ephy-node-view.c b/lib/widgets/ephy-node-view.c
index 4651a738c..6e000358a 100644
--- a/lib/widgets/ephy-node-view.c
+++ b/lib/widgets/ephy-node-view.c
@@ -430,8 +430,11 @@ ephy_node_view_select_node_by_key (EphyNodeView *view, GdkEventKey *event)
gchar *string;
gchar *event_string;
gboolean found = FALSE;
+ gchar outbuf[6];
+ gint length;
- event_string = g_utf8_casefold (event->string, -1);
+ length = g_unichar_to_utf8 (gdk_keyval_to_unicode (event->keyval), outbuf);
+ event_string = g_utf8_casefold (outbuf, length);
if (!gtk_tree_model_get_iter_first (view->priv->sortmodel, &iter))
{
@@ -973,10 +976,11 @@ ephy_node_view_remove (EphyNodeView *view)
EphyNode *node;
GtkTreeIter iter, iter2;
GtkTreePath *path;
+ GtkTreeRowReference *row_ref = NULL;
- /* Before removing we try to select the next node in the view. If that is
+ /* Before removing we try to get a reference to the next node in the view. If that is
* not available we try with the previous one, and if that is absent too,
- * we do not select anything (which equals to select the topic "All")
+ * we will not select anything (which equals to select the topic "All")
*/
list = ephy_node_view_get_selection (view);
@@ -993,18 +997,17 @@ ephy_node_view_remove (EphyNodeView *view)
if (gtk_tree_model_iter_next (GTK_TREE_MODEL (view->priv->sortmodel), &iter))
{
path = gtk_tree_model_get_path (GTK_TREE_MODEL (view->priv->sortmodel), &iter);
- gtk_tree_view_set_cursor (GTK_TREE_VIEW (view), path, NULL, FALSE);
- gtk_tree_path_free (path);
+ row_ref = gtk_tree_row_reference_new (GTK_TREE_MODEL (view->priv->sortmodel), path);
}
else
{
path = gtk_tree_model_get_path (GTK_TREE_MODEL (view->priv->sortmodel), &iter2);
if (gtk_tree_path_prev (path))
{
- gtk_tree_view_set_cursor (GTK_TREE_VIEW (view), path, NULL, FALSE);
+ row_ref = gtk_tree_row_reference_new (GTK_TREE_MODEL (view->priv->sortmodel), path);
}
- gtk_tree_path_free (path);
}
+ gtk_tree_path_free (path);
for (; list != NULL; list = list->next)
{
@@ -1012,6 +1015,16 @@ ephy_node_view_remove (EphyNodeView *view)
}
g_list_free (list);
+
+ /* Select the "next" node */
+
+ if (row_ref != NULL)
+ {
+ path = gtk_tree_row_reference_get_path (row_ref);
+ gtk_tree_view_set_cursor (GTK_TREE_VIEW (view), path, NULL, FALSE);
+ gtk_tree_row_reference_free (row_ref);
+ gtk_tree_path_free (path);
+ }
}
void