Commit 2704ea2b authored by Jonathan Blandford's avatar Jonathan Blandford Committed by Jonathan Blandford

it's amazing how well things work sometimes, even when they're completely

Thu Nov  1 15:45:04 2001  Jonathan Blandford  <jrb@redhat.com>

	* gtk/gtktreemodelsort.c (gtk_tree_model_sort_rows_reordered):
	it's amazing how well things work sometimes, even when they're
	completely wrong.

	* gtk/gtktreeview.c (gtk_tree_view_real_collapse_row): Fix bug
	where you could try to collapse a node w/o it having children.

	(gtk_tree_view_class_init): remove Shift L<->R as they already
	existed for expand/collapse.
parent b852358d
Thu Nov 1 15:45:04 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreemodelsort.c (gtk_tree_model_sort_rows_reordered):
it's amazing how well things work sometimes, even when they're
completely wrong.
* gtk/gtktreeview.c (gtk_tree_view_real_collapse_row): Fix bug
where you could try to collapse a node w/o it having children.
(gtk_tree_view_class_init): remove Shift L<->R as they already
existed for expand/collapse.
Thu Nov 1 12:21:31 2001 Jonathan Blandford <jrb@redhat.com> Thu Nov 1 12:21:31 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_focus_to_cursor): Fix crash * gtk/gtktreeview.c (gtk_tree_view_focus_to_cursor): Fix crash
......
Thu Nov 1 15:45:04 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreemodelsort.c (gtk_tree_model_sort_rows_reordered):
it's amazing how well things work sometimes, even when they're
completely wrong.
* gtk/gtktreeview.c (gtk_tree_view_real_collapse_row): Fix bug
where you could try to collapse a node w/o it having children.
(gtk_tree_view_class_init): remove Shift L<->R as they already
existed for expand/collapse.
Thu Nov 1 12:21:31 2001 Jonathan Blandford <jrb@redhat.com> Thu Nov 1 12:21:31 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_focus_to_cursor): Fix crash * gtk/gtktreeview.c (gtk_tree_view_focus_to_cursor): Fix crash
......
Thu Nov 1 15:45:04 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreemodelsort.c (gtk_tree_model_sort_rows_reordered):
it's amazing how well things work sometimes, even when they're
completely wrong.
* gtk/gtktreeview.c (gtk_tree_view_real_collapse_row): Fix bug
where you could try to collapse a node w/o it having children.
(gtk_tree_view_class_init): remove Shift L<->R as they already
existed for expand/collapse.
Thu Nov 1 12:21:31 2001 Jonathan Blandford <jrb@redhat.com> Thu Nov 1 12:21:31 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_focus_to_cursor): Fix crash * gtk/gtktreeview.c (gtk_tree_view_focus_to_cursor): Fix crash
......
Thu Nov 1 15:45:04 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreemodelsort.c (gtk_tree_model_sort_rows_reordered):
it's amazing how well things work sometimes, even when they're
completely wrong.
* gtk/gtktreeview.c (gtk_tree_view_real_collapse_row): Fix bug
where you could try to collapse a node w/o it having children.
(gtk_tree_view_class_init): remove Shift L<->R as they already
existed for expand/collapse.
Thu Nov 1 12:21:31 2001 Jonathan Blandford <jrb@redhat.com> Thu Nov 1 12:21:31 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_focus_to_cursor): Fix crash * gtk/gtktreeview.c (gtk_tree_view_focus_to_cursor): Fix crash
......
Thu Nov 1 15:45:04 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreemodelsort.c (gtk_tree_model_sort_rows_reordered):
it's amazing how well things work sometimes, even when they're
completely wrong.
* gtk/gtktreeview.c (gtk_tree_view_real_collapse_row): Fix bug
where you could try to collapse a node w/o it having children.
(gtk_tree_view_class_init): remove Shift L<->R as they already
existed for expand/collapse.
Thu Nov 1 12:21:31 2001 Jonathan Blandford <jrb@redhat.com> Thu Nov 1 12:21:31 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_focus_to_cursor): Fix crash * gtk/gtktreeview.c (gtk_tree_view_focus_to_cursor): Fix crash
......
Thu Nov 1 15:45:04 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreemodelsort.c (gtk_tree_model_sort_rows_reordered):
it's amazing how well things work sometimes, even when they're
completely wrong.
* gtk/gtktreeview.c (gtk_tree_view_real_collapse_row): Fix bug
where you could try to collapse a node w/o it having children.
(gtk_tree_view_class_init): remove Shift L<->R as they already
existed for expand/collapse.
Thu Nov 1 12:21:31 2001 Jonathan Blandford <jrb@redhat.com> Thu Nov 1 12:21:31 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_focus_to_cursor): Fix crash * gtk/gtktreeview.c (gtk_tree_view_focus_to_cursor): Fix crash
......
Thu Nov 1 15:45:04 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreemodelsort.c (gtk_tree_model_sort_rows_reordered):
it's amazing how well things work sometimes, even when they're
completely wrong.
* gtk/gtktreeview.c (gtk_tree_view_real_collapse_row): Fix bug
where you could try to collapse a node w/o it having children.
(gtk_tree_view_class_init): remove Shift L<->R as they already
existed for expand/collapse.
Thu Nov 1 12:21:31 2001 Jonathan Blandford <jrb@redhat.com> Thu Nov 1 12:21:31 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_focus_to_cursor): Fix crash * gtk/gtktreeview.c (gtk_tree_view_focus_to_cursor): Fix crash
......
...@@ -676,7 +676,7 @@ gtk_tree_model_sort_rows_reordered (GtkTreeModel *s_model, ...@@ -676,7 +676,7 @@ gtk_tree_model_sort_rows_reordered (GtkTreeModel *s_model,
SortLevel *level; SortLevel *level;
GtkTreeIter iter; GtkTreeIter iter;
gint *tmp_array; gint *tmp_array;
int i; int i, j;
GtkTreePath *path; GtkTreePath *path;
GtkTreeModelSort *tree_model_sort = GTK_TREE_MODEL_SORT (data); GtkTreeModelSort *tree_model_sort = GTK_TREE_MODEL_SORT (data);
...@@ -716,11 +716,18 @@ gtk_tree_model_sort_rows_reordered (GtkTreeModel *s_model, ...@@ -716,11 +716,18 @@ gtk_tree_model_sort_rows_reordered (GtkTreeModel *s_model,
tmp_array = g_new (int, level->array->len); tmp_array = g_new (int, level->array->len);
for (i = 0; i < level->array->len; i++) for (i = 0; i < level->array->len; i++)
tmp_array[new_order[i]] = g_array_index (level->array, SortElt, i).offset; {
for (j = 0; j < level->array->len; j++)
{
if (g_array_index (level->array, SortElt, i).offset == new_order[j])
tmp_array[i] = j;
}
}
for (i = 0; i < level->array->len; i++) for (i = 0; i < level->array->len; i++)
g_array_index (level->array, SortElt, i).offset = tmp_array[i]; g_array_index (level->array, SortElt, i).offset = tmp_array[i];
g_free (tmp_array); g_free (tmp_array);
if (tree_model_sort->sort_column_id == -1 && if (tree_model_sort->sort_column_id == -1 &&
tree_model_sort->default_sort_func == (GtkTreeIterCompareFunc) 0x1) tree_model_sort->default_sort_func == (GtkTreeIterCompareFunc) 0x1)
{ {
......
...@@ -806,14 +806,6 @@ gtk_tree_view_class_init (GtkTreeViewClass *class) ...@@ -806,14 +806,6 @@ gtk_tree_view_class_init (GtkTreeViewClass *class)
GTK_TYPE_ENUM, GTK_MOVEMENT_VISUAL_POSITIONS, GTK_TYPE_ENUM, GTK_MOVEMENT_VISUAL_POSITIONS,
GTK_TYPE_INT, -1); GTK_TYPE_INT, -1);
gtk_binding_entry_add_signal (binding_set, GDK_Right, GDK_SHIFT_MASK, "move_cursor", 2,
GTK_TYPE_ENUM, GTK_MOVEMENT_VISUAL_POSITIONS,
GTK_TYPE_INT, 1);
gtk_binding_entry_add_signal (binding_set, GDK_Left, GDK_SHIFT_MASK, "move_cursor", 2,
GTK_TYPE_ENUM, GTK_MOVEMENT_VISUAL_POSITIONS,
GTK_TYPE_INT, -1);
gtk_binding_entry_add_signal (binding_set, GDK_Right, GDK_CONTROL_MASK|GDK_SHIFT_MASK, "move_cursor", 2, gtk_binding_entry_add_signal (binding_set, GDK_Right, GDK_CONTROL_MASK|GDK_SHIFT_MASK, "move_cursor", 2,
GTK_TYPE_ENUM, GTK_MOVEMENT_VISUAL_POSITIONS, GTK_TYPE_ENUM, GTK_MOVEMENT_VISUAL_POSITIONS,
GTK_TYPE_INT, 1); GTK_TYPE_INT, 1);
...@@ -7586,6 +7578,8 @@ gtk_tree_view_real_expand_row (GtkTreeView *tree_view, ...@@ -7586,6 +7578,8 @@ gtk_tree_view_real_expand_row (GtkTreeView *tree_view,
if (node->children) if (node->children)
return TRUE; return TRUE;
if (! GTK_RBNODE_FLAG_SET (node, GTK_RBNODE_IS_PARENT))
return FALSE;
gtk_tree_model_get_iter (tree_view->priv->model, &iter, path); gtk_tree_model_get_iter (tree_view->priv->model, &iter, path);
if (! gtk_tree_model_iter_has_child (tree_view->priv->model, &iter)) if (! gtk_tree_model_iter_has_child (tree_view->priv->model, &iter))
...@@ -7690,6 +7684,9 @@ gtk_tree_view_real_collapse_row (GtkTreeView *tree_view, ...@@ -7690,6 +7684,9 @@ gtk_tree_view_real_collapse_row (GtkTreeView *tree_view,
gint x, y; gint x, y;
GList *list; GList *list;
if (node->children == NULL)
return FALSE;
gtk_tree_model_get_iter (tree_view->priv->model, &iter, path); gtk_tree_model_get_iter (tree_view->priv->model, &iter, path);
g_signal_emit (G_OBJECT (tree_view), tree_view_signals[TEST_COLLAPSE_ROW], 0, &iter, path, &collapse); g_signal_emit (G_OBJECT (tree_view), tree_view_signals[TEST_COLLAPSE_ROW], 0, &iter, path, &collapse);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment