Make sure that all columns are always visible in the reconcile list.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@7525 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
David Hampton 2002-11-23 05:39:13 +00:00
parent 0ea484dfc4
commit 8e073443a2
2 changed files with 32 additions and 15 deletions

View File

@ -11,6 +11,15 @@
* src/gnome-utils/dialog-utils.h: Added many comments for docs. * src/gnome-utils/dialog-utils.h: Added many comments for docs.
2002-11-22 David Hampton <hampton@employees.org>
* src/gnome/reconcile-list.c
(gnc_reconcile_list_recompute_widths): Always make the contents of
the reconciliation window fit within the allocated space.
(gnc_reconcile_list_fill): For a split with a zero value, if the
number field is non-null then assume this split is for a check and
force it the credit list.
2002-11-22 Christian Stimming <stimming@tuhh.de> 2002-11-22 Christian Stimming <stimming@tuhh.de>
* src/gnome-utils/dialog-account-pick.[hc]: Move the account * src/gnome-utils/dialog-account-pick.[hc]: Move the account

View File

@ -577,17 +577,14 @@ gnc_reconcile_list_recompute_widths (GNCReconcileList *list, gint allocated)
desc_width = width; desc_width = width;
} }
/* Did the list use its full allocation? */ /* Did the list use its full allocation?
*
* Add/subtract any underage/overage to/from the description column
*/
if (allocated <= 1) if (allocated <= 1)
allocated = list->prev_allocation; allocated = list->prev_allocation;
if (allocated <= 0)
return;
list->prev_allocation = allocated; list->prev_allocation = allocated;
excess = allocated - total_width - VSCROLLBAR_SLOP; excess = allocated - total_width - VSCROLLBAR_SLOP;
if (excess <= 0)
return;
/* Add any extra allocation to the description column */
gtk_clist_set_column_width (clist, 2, desc_width + excess); gtk_clist_set_column_width (clist, 2, desc_width + excess);
} }
@ -968,10 +965,13 @@ gnc_reconcile_list_fill(GNCReconcileList *list)
{ {
gnc_numeric amount; gnc_numeric amount;
Timespec ts; Timespec ts;
const gchar *trans_num;
char recn; char recn;
int row; int row, len;
split = splits->data; split = splits->data;
trans = xaccSplitGetParent (split);
trans_num = xaccTransGetNum (trans);
recn = xaccSplitGetReconcile(split); recn = xaccSplitGetReconcile(split);
if ((recn != NREC) && (recn != CREC)) if ((recn != NREC) && (recn != CREC))
@ -979,17 +979,25 @@ gnc_reconcile_list_fill(GNCReconcileList *list)
amount = xaccSplitGetAmount (split); amount = xaccSplitGetAmount (split);
if (gnc_numeric_negative_p (amount) && list->list_type == RECLIST_DEBIT) if (gnc_numeric_negative_p (amount)) {
continue; if (list->list_type == RECLIST_DEBIT) {
if (!gnc_numeric_negative_p (amount) && list->list_type == RECLIST_CREDIT) continue;
continue; }
} else if (gnc_numeric_positive_p (amount)) {
trans = xaccSplitGetParent (split); if (list->list_type == RECLIST_CREDIT) {
continue;
}
} else {
len = trans_num ? strlen(trans_num) : 0;
if ((len && (list->list_type == RECLIST_DEBIT)) ||
(!len && (list->list_type == RECLIST_CREDIT)))
continue;
}
xaccTransGetDatePostedTS (trans, &ts); xaccTransGetDatePostedTS (trans, &ts);
strings[0] = gnc_print_date (ts); strings[0] = gnc_print_date (ts);
strings[1] = xaccTransGetNum (trans); strings[1] = trans_num;
strings[2] = xaccTransGetDescription (trans); strings[2] = xaccTransGetDescription (trans);
strings[3] = xaccPrintAmount (gnc_numeric_abs (amount), print_info); strings[3] = xaccPrintAmount (gnc_numeric_abs (amount), print_info);
strings[4] = ""; strings[4] = "";