gnucash maint: [assistant-stock-transaction] ellipsise memo, add tooltip to summary
Christopher Lam
clam at code.gnucash.org
Thu Aug 18 12:31:50 EDT 2022
Updated via https://github.com/Gnucash/gnucash/commit/78f3b33b (commit)
from https://github.com/Gnucash/gnucash/commit/7e1cb7e2 (commit)
commit 78f3b33b0cb6e99c06f3e52f7a2dcf2f00025803
Author: Christopher Lam <christopher.lck at gmail.com>
Date: Fri Aug 19 00:23:52 2022 +0800
[assistant-stock-transaction] ellipsise memo, add tooltip to summary
Tooltip contains the full Memo field.
diff --git a/gnucash/gnome/assistant-stock-transaction.cpp b/gnucash/gnome/assistant-stock-transaction.cpp
index d95ef30d2..1ec3edeaa 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,
Summary of changes:
gnucash/gnome/assistant-stock-transaction.cpp | 7 +++++++
1 file changed, 7 insertions(+)
More information about the gnucash-changes
mailing list