From 78f3b33b0cb6e99c06f3e52f7a2dcf2f00025803 Mon Sep 17 00:00:00 2001 From: Christopher Lam Date: Fri, 19 Aug 2022 00:23:52 +0800 Subject: [PATCH] [assistant-stock-transaction] ellipsise memo, add tooltip to summary Tooltip contains the full Memo field. --- gnucash/gnome/assistant-stock-transaction.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gnucash/gnome/assistant-stock-transaction.cpp b/gnucash/gnome/assistant-stock-transaction.cpp index d95ef30d2d..1ec3edeaae 100644 --- a/gnucash/gnome/assistant-stock-transaction.cpp +++ b/gnucash/gnome/assistant-stock-transaction.cpp @@ -75,6 +75,7 @@ enum split_cols { SPLIT_COL_ACCOUNT = 0, SPLIT_COL_MEMO, + SPLIT_COL_MEMO_ESCAPED, SPLIT_COL_DEBIT, SPLIT_COL_CREDIT, NUM_SPLIT_COLS @@ -674,6 +675,7 @@ check_page (GtkListStore *list, gnc_numeric& debit, gnc_numeric& credit, } auto memostr = gtk_entry_get_text (GTK_ENTRY (memo)); + auto memostr_escaped = g_markup_escape_text (memostr, -1); const gchar *acctstr; if (ignore_account) @@ -693,9 +695,11 @@ check_page (GtkListStore *list, gnc_numeric& debit, gnc_numeric& credit, gtk_list_store_set (list, &iter, SPLIT_COL_ACCOUNT, acctstr, SPLIT_COL_MEMO, memostr, + SPLIT_COL_MEMO_ESCAPED, memostr_escaped, SPLIT_COL_DEBIT, debit_side ? amtstr : "", SPLIT_COL_CREDIT, !debit_side ? amtstr : "", -1); + g_free (memostr_escaped); } static inline Account* @@ -1152,6 +1156,7 @@ get_treeview (GtkBuilder *builder, const gchar *treeview_label) gtk_tree_view_append_column(view, column); renderer = gtk_cell_renderer_text_new(); + g_object_set (renderer, "ellipsize", PANGO_ELLIPSIZE_END, nullptr); column = gtk_tree_view_column_new_with_attributes (_("Memo"), renderer, "text", SPLIT_COL_MEMO, nullptr); gtk_tree_view_column_set_expand (column, true); @@ -1247,6 +1252,8 @@ stock_assistant_create (StockTransactionInfo *info) info->finish_summary = get_widget (builder, "finish_summary"); g_signal_connect (G_OBJECT(info->window), "destroy", G_CALLBACK (stock_assistant_window_destroy_cb), info); + gtk_tree_view_set_tooltip_column (GTK_TREE_VIEW (info->finish_split_view), + SPLIT_COL_MEMO_ESCAPED); gtk_assistant_set_forward_page_func (GTK_ASSISTANT(info->window), (GtkAssistantPageFunc)forward_page_func,