Skip to content

Commit

Permalink
Bug 754710 - Add column sorting to Qif import Match views
Browse files Browse the repository at this point in the history
  • Loading branch information
Bob-IT committed May 12, 2019
1 parent 9504b70 commit d7b40c7
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions gnucash/import-export/qif-imp/assistant-qif-import.c
Expand Up @@ -529,6 +529,14 @@ create_account_picker_view (GtkWidget *widget,
G_TYPE_STRING, G_TYPE_BOOLEAN,
PANGO_TYPE_ELLIPSIZE_MODE);
gtk_tree_view_set_model (view, GTK_TREE_MODEL(store));

/* prevent the rows being dragged to a different order */
gtk_tree_view_set_reorderable (view, FALSE);

/* default sort order */
gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE(store),
ACCOUNT_COL_QIF_NAME,
GTK_SORT_ASCENDING);
g_object_unref (store);

renderer = gtk_cell_renderer_text_new ();
Expand All @@ -539,9 +547,12 @@ create_account_picker_view (GtkWidget *widget,
"ellipsize",
ACCOUNT_COL_ELLIPSIZE,
NULL);
g_object_set (column, "expand", TRUE, NULL);
gtk_tree_view_column_set_resizable (column, TRUE);

g_object_set (G_OBJECT(column), "expand", TRUE, "reorderable",
TRUE, "resizable", TRUE, NULL);

gtk_tree_view_append_column (view, column);
gtk_tree_view_column_set_sort_column_id (column, ACCOUNT_COL_QIF_NAME);

renderer = gtk_cell_renderer_text_new ();
column = gtk_tree_view_column_new_with_attributes (_("GnuCash account name"),
Expand All @@ -552,9 +563,11 @@ create_account_picker_view (GtkWidget *widget,
ACCOUNT_COL_ELLIPSIZE,
NULL);

g_object_set (column, "expand", TRUE, NULL);
gtk_tree_view_column_set_resizable (column, TRUE);
g_object_set (G_OBJECT(column), "expand", TRUE, "reorderable",
TRUE, "resizable", TRUE, NULL);

gtk_tree_view_append_column (view, column);
gtk_tree_view_column_set_sort_column_id (column, ACCOUNT_COL_GNC_NAME);

renderer = gtk_cell_renderer_toggle_new ();
g_object_set(renderer, "activatable", FALSE, NULL);
Expand Down

0 comments on commit d7b40c7

Please sign in to comment.