Work on reconcile and register windows. Misc bug fixes.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@2350 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Dave Peticolas 2000-05-18 10:33:44 +00:00
parent f35f7867a6
commit 38478c2e1a
13 changed files with 272 additions and 148 deletions

View File

@ -1,3 +1,24 @@
2000-05-18 Dave Peticolas <peticola@cs.ucdavis.edu>
* src/gnome/window-reconcile.c: make the finish button sensitivity
depend on whether the reconciliation is balanced.
* src/register/gnome/gnucash-sheet.c
(gnucash_sheet_activate_cursor_cell): if the callback changes the
value, redraw.
2000-05-17 Dave Peticolas <peticola@cs.ucdavis.edu>
* src/engine/Query.c: allow sorting by reconciled date and
reconcile status.
* src/gnome/window-reconcile.c: add a 'statement date' to the
reconciliation date. This date is used to set all the reconcile
dates of the splits that get reconciled.
* src/engine/Transaction.c (xaccSplitSetReconcile): don't change
the reconcile date when the reconcile status is changed.
2000-05-18 Robert Graham Merkel <rgmerk@mira.net> 2000-05-18 Robert Graham Merkel <rgmerk@mira.net>
* src/scm/report/transaction-report-2.scm: Fixed *some* of the * src/scm/report/transaction-report-2.scm: Fixed *some* of the

View File

@ -1186,7 +1186,7 @@ xaccAccountGetParentAccount (Account * acc)
return xaccGroupGetParentAccount(acc->parent); return xaccGroupGetParentAccount(acc->parent);
} }
int GNCAccountType
xaccAccountGetType (Account *acc) xaccAccountGetType (Account *acc)
{ {
if (!acc) return NO_TYPE; if (!acc) return NO_TYPE;

View File

@ -149,7 +149,7 @@ void xaccAccountSetNotes (Account *, const char *);
void xaccAccountSetCurrency (Account *, const char *); void xaccAccountSetCurrency (Account *, const char *);
void xaccAccountSetSecurity (Account *, const char *); void xaccAccountSetSecurity (Account *, const char *);
int xaccAccountGetType (Account *); GNCAccountType xaccAccountGetType (Account *);
char * xaccAccountGetName (Account *); char * xaccAccountGetName (Account *);
char * xaccAccountGetFullName (Account *, const char separator); char * xaccAccountGetFullName (Account *, const char separator);
char * xaccAccountGetCode (Account *); char * xaccAccountGetCode (Account *);

View File

@ -418,6 +418,26 @@ acct_query_matches(QueryTerm * qt, Account * acct) {
static Query * split_sort_query = NULL; static Query * split_sort_query = NULL;
static int
date_cmp_func(Timespec *t1, Timespec *t2) {
/* check seconds */
if (t1->tv_sec < t2->tv_sec) {
return -1;
}
else if (t1->tv_sec > t2->tv_sec) {
return +1;
}
/* else, seconds match. check nanoseconds */
if (t1->tv_nsec < t2->tv_nsec) {
return -1;
}
else if (t1->tv_nsec > t2->tv_nsec) {
return +1;
}
return 0;
}
static int static int
split_cmp_func(sort_type_t how, gconstpointer ga, gconstpointer gb) { split_cmp_func(sort_type_t how, gconstpointer ga, gconstpointer gb) {
@ -452,56 +472,25 @@ split_cmp_func(sort_type_t how, gconstpointer ga, gconstpointer gb) {
break; break;
case BY_DATE: case BY_DATE:
/* if dates differ, return */ return date_cmp_func(&(ta->date_posted), &(tb->date_posted));
if ( (ta->date_posted.tv_sec) <
(tb->date_posted.tv_sec)) {
return -1;
}
else if ((ta->date_posted.tv_sec) >
(tb->date_posted.tv_sec)) {
return +1;
}
/* else, seconds match. check nanoseconds */
if ( (ta->date_posted.tv_nsec) <
(tb->date_posted.tv_nsec)) {
return -1;
}
else if ( (ta->date_posted.tv_nsec) >
(tb->date_posted.tv_nsec)) {
return +1;
}
return 0;
break; break;
case BY_DATE_ENTERED: case BY_DATE_ENTERED:
/* if dates differ, return */ return date_cmp_func(&(ta->date_entered), &(tb->date_entered));
if ( (ta->date_entered.tv_sec) <
(tb->date_entered.tv_sec)) { break;
return -1;
} case BY_DATE_RECONCILED:
else if ((ta->date_entered.tv_sec) > return date_cmp_func(&(sa->date_reconciled), &(sb->date_reconciled));
(tb->date_entered.tv_sec)) {
return +1;
}
/* else, seconds match. check nanoseconds */
if ( (ta->date_entered.tv_nsec) <
(tb->date_entered.tv_nsec)) {
return -1;
}
else if ( (ta->date_entered.tv_nsec) >
(tb->date_entered.tv_nsec)) {
return +1;
}
return 0;
break; break;
case BY_NUM: case BY_NUM:
/* sort on transaction number */ /* sort on transaction number */
da = ta->num; da = ta->num;
db = tb->num; db = tb->num;
if (gnc_strisnum(da)) { if (gnc_strisnum(da)) {
if (!gnc_strisnum(db)) { if (!gnc_strisnum(db)) {
return -1; return -1;
} }
@ -583,7 +572,30 @@ split_cmp_func(sort_type_t how, gconstpointer ga, gconstpointer gb) {
return 0; return 0;
} }
break; break;
case BY_RECONCILE:
/* Reconcile flags are sorted as: FREC = YREC < CREC = NREC */
switch (sa->reconciled) {
case YREC:
case FREC:
if (sb->reconciled == YREC)
return 0;
if (sb->reconciled == FREC)
return 0;
return -1;
break;
case CREC:
case NREC:
if (sb->reconciled == CREC)
return 0;
if (sb->reconciled == NREC)
return 0;
return 1;
break;
}
break;
case BY_NONE: case BY_NONE:
return 0; return 0;
break; break;

View File

@ -44,10 +44,12 @@ typedef enum {
BY_STANDARD, BY_STANDARD,
BY_DATE, BY_DATE,
BY_DATE_ENTERED, BY_DATE_ENTERED,
BY_DATE_RECONCILED,
BY_NUM, BY_NUM,
BY_AMOUNT, BY_AMOUNT,
BY_MEMO, BY_MEMO,
BY_DESC, BY_DESC,
BY_RECONCILE,
BY_NONE BY_NONE
} sort_type_t; } sort_type_t;

View File

@ -1997,16 +1997,11 @@ xaccSplitSetDocref (Split *split, const char *docs)
void void
xaccSplitSetReconcile (Split *split, char recn) xaccSplitSetReconcile (Split *split, char recn)
{ {
struct timeval tv;
if (!split) return; if (!split) return;
split->reconciled = recn; split->reconciled = recn;
MARK_SPLIT (split); MARK_SPLIT (split);
gettimeofday (&tv, NULL);
split->date_reconciled.tv_sec = tv.tv_sec;
split->date_reconciled.tv_nsec = 1000 * tv.tv_usec;
xaccAccountRecomputeBalance (split->acc); xaccAccountRecomputeBalance (split->acc);
} }
@ -2026,7 +2021,7 @@ xaccSplitSetDateReconciledTS (Split *split, Timespec *ts)
if (!split) return; if (!split) return;
MARK_SPLIT (split); MARK_SPLIT (split);
split->date_reconciled = *ts; split->date_reconciled = *ts;
} }
void void

View File

@ -450,10 +450,11 @@ gnc_reconcile_list_reconciled_balance(GNCReconcileList *list)
* commit the reconcile information in the list * * commit the reconcile information in the list *
* * * *
* Args: list - list to commit * * Args: list - list to commit *
* date - date to set as the reconcile date *
* Returns: nothing * * Returns: nothing *
\********************************************************************/ \********************************************************************/
void void
gnc_reconcile_list_commit(GNCReconcileList *list) gnc_reconcile_list_commit(GNCReconcileList *list, time_t date)
{ {
GtkCList *clist = GTK_CLIST(list); GtkCList *clist = GTK_CLIST(list);
Split *split; Split *split;
@ -470,7 +471,10 @@ gnc_reconcile_list_commit(GNCReconcileList *list)
split = gtk_clist_get_row_data(clist, i); split = gtk_clist_get_row_data(clist, i);
if (g_hash_table_lookup(list->reconciled, split) != NULL) if (g_hash_table_lookup(list->reconciled, split) != NULL)
{
xaccSplitSetReconcile(split, YREC); xaccSplitSetReconcile(split, YREC);
xaccSplitSetDateReconciledSecs(split, date);
}
} }
} }

View File

@ -94,7 +94,7 @@ void gnc_reconcile_list_refresh (GNCReconcileList *list);
double gnc_reconcile_list_reconciled_balance(GNCReconcileList *list); double gnc_reconcile_list_reconciled_balance(GNCReconcileList *list);
void gnc_reconcile_list_commit(GNCReconcileList *list); void gnc_reconcile_list_commit(GNCReconcileList *list, time_t date);
void gnc_reconcile_list_unselect_all(GNCReconcileList *list); void gnc_reconcile_list_unselect_all(GNCReconcileList *list);

View File

@ -43,6 +43,7 @@
#include "dialog-utils.h" #include "dialog-utils.h"
#include "reconcile-list.h" #include "reconcile-list.h"
#include "global-options.h" #include "global-options.h"
#include "gnc-dateedit.h"
#include "Refresh.h" #include "Refresh.h"
#include "query-user.h" #include "query-user.h"
#include "window-help.h" #include "window-help.h"
@ -60,11 +61,12 @@ struct _RecnWindow
{ {
Account *account; /* The account that we are reconciling */ Account *account; /* The account that we are reconciling */
double new_ending; /* The new ending balance */ double new_ending; /* The new ending balance */
time_t statement_date; /* The statement date */
GtkWidget *window; /* The reconcile window */ GtkWidget *window; /* The reconcile window */
GtkWidget *toolbar; GtkWidget *toolbar; /* Toolbar widget */
SCM toolbar_change_callback_id; SCM toolbar_change_cb_id; /* id for toolbar preference change cb */
GtkWidget *starting; /* The starting balance */ GtkWidget *starting; /* The starting balance */
GtkWidget *ending; /* The ending balance */ GtkWidget *ending; /* The ending balance */
@ -77,6 +79,11 @@ struct _RecnWindow
GtkWidget *debit; /* Debit matrix show unreconciled debit */ GtkWidget *debit; /* Debit matrix show unreconciled debit */
GtkWidget *credit; /* Credit matrix, shows credits... */ GtkWidget *credit; /* Credit matrix, shows credits... */
GtkWidget *debit_frame; /* Frame around debit matrix */
GtkWidget *credit_frame; /* Frame around credit matrix */
SCM title_change_cb_id; /* id for label preference cb */
GtkWidget *edit_item; /* Edit transaction menu item */ GtkWidget *edit_item; /* Edit transaction menu item */
GtkWidget *delete_item; /* Delete transaction menu item */ GtkWidget *delete_item; /* Delete transaction menu item */
@ -85,8 +92,7 @@ struct _RecnWindow
GtkWidget *edit_button; /* Edit transaction button */ GtkWidget *edit_button; /* Edit transaction button */
GtkWidget *delete_button; /* Delete transaction button */ GtkWidget *delete_button; /* Delete transaction button */
GtkWidget *finish_button; /* Finish reconciliation button */
char * symbol; /* Currency symbol or 's' for shares */
gboolean delete_refresh; /* do a refresh upon a window deletion */ gboolean delete_refresh; /* do a refresh upon a window deletion */
}; };
@ -94,13 +100,13 @@ struct _RecnWindow
/** PROTOTYPES ******************************************************/ /** PROTOTYPES ******************************************************/
static double recnRecalculateBalance( RecnWindow *recnData ); static double recnRecalculateBalance( RecnWindow *recnData );
static void recnClose(GtkWidget *w, gpointer data); static void recnClose(GtkWidget *w, gpointer data);
static void recnFinishCB(GtkWidget *w, gpointer data); static void recnFinishCB(GtkWidget *w, gpointer data);
static void recnCancelCB(GtkWidget *w, gpointer data); static void recnCancelCB(GtkWidget *w, gpointer data);
static void gnc_reconcile_window_set_sensitivity(RecnWindow *recnData); static void gnc_reconcile_window_set_sensitivity(RecnWindow *recnData);
static char *gnc_recn_make_window_name(Account *account); static char * gnc_recn_make_window_name(Account *account);
static void gnc_recn_set_window_name(RecnWindow *recnData); static void gnc_recn_set_window_name(RecnWindow *recnData);
/** GLOBALS *********************************************************/ /** GLOBALS *********************************************************/
@ -146,7 +152,8 @@ recnRefresh(Account *account)
* refreshes the balances in the reconcile window * * refreshes the balances in the reconcile window *
* * * *
* Args: recnData -- the reconcile window to refresh * * Args: recnData -- the reconcile window to refresh *
* Return: the reconciled balance * * Return: the difference between the nominal ending balance *
* and the 'effective' ending balance. *
\********************************************************************/ \********************************************************************/
static double static double
recnRecalculateBalance(RecnWindow *recnData) recnRecalculateBalance(RecnWindow *recnData)
@ -227,6 +234,8 @@ recnRecalculateBalance(RecnWindow *recnData)
if (reverse_balance) if (reverse_balance)
diff = -diff; diff = -diff;
gtk_widget_set_sensitive(recnData->finish_button, DEQ(diff, 0.0));
return diff; return diff;
} }
@ -271,30 +280,31 @@ gnc_start_recn_update_cb(GtkWidget *widget, GdkEventFocus *event,
* opens up the window to prompt the user to enter the ending * * opens up the window to prompt the user to enter the ending *
* balance from bank statement * * balance from bank statement *
* * * *
* NOTE: This dialog does not return until the user presses "Ok" * * NOTE: This function does not return until the user presses "Ok" *
* or "Cancel" * * or "Cancel" *
* * * *
* Args: parent - the parent of this window * * Args: parent - the parent of this window *
* account - the account to reconcile * * account - the account to reconcile *
* new_ending - returns the amount for ending balance * * new_ending - returns the amount for ending balance *
* statement_date - returns date of the statement :) *
* Return: True, if the user presses "Ok", else False * * Return: True, if the user presses "Ok", else False *
\********************************************************************/ \********************************************************************/
static gboolean static gboolean
startRecnWindow(GtkWidget *parent, Account *account, double *new_ending) startRecnWindow(GtkWidget *parent, Account *account,
double *new_ending, time_t *statement_date)
{ {
GtkWidget *dialog, *end_value; GtkWidget *dialog, *end_value, *date_value;
char *amount, *title, *currency; char *amount, *title, *currency;
GNCAccountType account_type;
GNCPrintAmountFlags flags; GNCPrintAmountFlags flags;
double dendBalance; double dendBalance;
int account_type;
int result; int result;
flags = PRTSYM | PRTSEP; flags = PRTSYM | PRTSEP;
/* Get the previous ending balance. Use the published /* Get the previous ending balance. Use the published
* account interface for this, since the ending balance * account interface for this, since the ending balance
* may have to be adjusted for stock price fluctuations. * may have to be adjusted for stock price fluctuations. */
*/
dendBalance = xaccAccountGetReconciledBalance(account); dendBalance = xaccAccountGetReconciledBalance(account);
if (gnc_reverse_balance(account)) if (gnc_reverse_balance(account))
{ {
@ -330,10 +340,13 @@ startRecnWindow(GtkWidget *parent, Account *account, double *new_ending)
GtkWidget *main_area = gtk_hbox_new(FALSE, 5); GtkWidget *main_area = gtk_hbox_new(FALSE, 5);
GtkWidget *left_column = gtk_vbox_new(TRUE, 0); GtkWidget *left_column = gtk_vbox_new(TRUE, 0);
GtkWidget *right_column = gtk_vbox_new(TRUE, 0); GtkWidget *right_column = gtk_vbox_new(TRUE, 0);
GtkWidget *date_title = gtk_label_new(STATEMENT_DATE_C_STR);
GtkWidget *start_title = gtk_label_new(START_BALN_C_STR); GtkWidget *start_title = gtk_label_new(START_BALN_C_STR);
GtkWidget *end_title = gtk_label_new(END_BALN_C_STR); GtkWidget *end_title = gtk_label_new(END_BALN_C_STR);
GtkWidget *start_value = gtk_label_new(amount); GtkWidget *start_value = gtk_label_new(amount);
GtkWidget *vbox = GNOME_DIALOG(dialog)->vbox; GtkWidget *vbox = GNOME_DIALOG(dialog)->vbox;
date_value = gnc_date_edit_new(*statement_date, GNC_F, GNC_F);
end_value = gtk_entry_new(); end_value = gtk_entry_new();
amount = xaccPrintAmount(*new_ending, flags & ~PRTSYM, currency); amount = xaccPrintAmount(*new_ending, flags & ~PRTSYM, currency);
@ -346,6 +359,7 @@ startRecnWindow(GtkWidget *parent, Account *account, double *new_ending)
gnome_dialog_editable_enters(GNOME_DIALOG(dialog), gnome_dialog_editable_enters(GNOME_DIALOG(dialog),
GTK_EDITABLE(end_value)); GTK_EDITABLE(end_value));
gtk_misc_set_alignment(GTK_MISC(date_title), 1.0, 0.5);
gtk_misc_set_alignment(GTK_MISC(start_title), 1.0, 0.5); gtk_misc_set_alignment(GTK_MISC(start_title), 1.0, 0.5);
gtk_misc_set_alignment(GTK_MISC(start_value), 0.0, 0.5); gtk_misc_set_alignment(GTK_MISC(start_value), 0.0, 0.5);
gtk_misc_set_alignment(GTK_MISC(end_title), 1.0, 0.5); gtk_misc_set_alignment(GTK_MISC(end_title), 1.0, 0.5);
@ -359,8 +373,11 @@ startRecnWindow(GtkWidget *parent, Account *account, double *new_ending)
gtk_box_pack_start(GTK_BOX(main_area), left_column, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(main_area), left_column, FALSE, FALSE, 0);
gtk_box_pack_end(GTK_BOX(main_area), right_column, TRUE, TRUE, 0); gtk_box_pack_end(GTK_BOX(main_area), right_column, TRUE, TRUE, 0);
gtk_box_pack_start(GTK_BOX(left_column), date_title, TRUE, TRUE, 3);
gtk_box_pack_start(GTK_BOX(left_column), start_title, TRUE, TRUE, 0); gtk_box_pack_start(GTK_BOX(left_column), start_title, TRUE, TRUE, 0);
gtk_box_pack_start(GTK_BOX(left_column), end_title, TRUE, TRUE, 0); gtk_box_pack_start(GTK_BOX(left_column), end_title, TRUE, TRUE, 0);
gtk_box_pack_start(GTK_BOX(right_column), date_value, TRUE, TRUE, 3);
gtk_box_pack_start(GTK_BOX(right_column), start_value, TRUE, TRUE, 0); gtk_box_pack_start(GTK_BOX(right_column), start_value, TRUE, TRUE, 0);
gtk_box_pack_start(GTK_BOX(right_column), end_value, TRUE, TRUE, 0); gtk_box_pack_start(GTK_BOX(right_column), end_value, TRUE, TRUE, 0);
@ -380,6 +397,7 @@ startRecnWindow(GtkWidget *parent, Account *account, double *new_ending)
string = gtk_entry_get_text(GTK_ENTRY(end_value)); string = gtk_entry_get_text(GTK_ENTRY(end_value));
*new_ending = xaccParseAmount(string, GNC_T); *new_ending = xaccParseAmount(string, GNC_T);
*statement_date = gnc_date_edit_get_date(GNC_DATE_EDIT(date_value));
if (gnc_reverse_balance(account)) if (gnc_reverse_balance(account))
*new_ending = -(*new_ending); *new_ending = -(*new_ending);
@ -448,39 +466,57 @@ gnc_reconcile_window_focus_cb(GtkWidget *widget, GdkEventFocus *event,
gnc_reconcile_list_unselect_all(other_list); gnc_reconcile_list_unselect_all(other_list);
} }
static GtkWidget * static void
gnc_reconcile_window_create_list_frame(Account *account, gnc_reconcile_window_set_frame_titles(RecnWindow *recnData)
GNCReconcileListType type,
RecnWindow *recnData,
GtkWidget **list_save,
GtkWidget **total_save)
{ {
GtkWidget *frame, *scrollWin, *list, *vbox, *label, *hbox;
gboolean formal; gboolean formal;
gchar * title; gchar *title;
formal = gnc_lookup_boolean_option("General", formal = gnc_lookup_boolean_option("General",
"Use accounting labels", GNC_F); "Use accounting labels", GNC_F);
if (type == RECLIST_DEBIT) if (formal)
{ title = DEBITS_STR;
if (formal)
title = DEBITS_STR;
else
title = gnc_get_debit_string(NO_TYPE);
}
else else
{ title = gnc_get_debit_string(NO_TYPE);
if (formal)
title = CREDITS_STR;
else
title = gnc_get_credit_string(NO_TYPE);
}
frame = gtk_frame_new(title); gtk_frame_set_label(GTK_FRAME(recnData->debit_frame), title);
if (!formal) if (!formal)
free(title); g_free(title);
if (formal)
title = CREDITS_STR;
else
title = gnc_get_credit_string(NO_TYPE);
gtk_frame_set_label(GTK_FRAME(recnData->credit_frame), title);
if (!formal)
g_free(title);
}
static void
set_frame_titles_cb(void *data)
{
gnc_reconcile_window_set_frame_titles(data);
}
static GtkWidget *
gnc_reconcile_window_create_list_box(Account *account,
GNCReconcileListType type,
RecnWindow *recnData,
GtkWidget **list_save,
GtkWidget **total_save)
{
GtkWidget *frame, *scrollWin, *list, *vbox, *label, *hbox;
frame = gtk_frame_new(NULL);
if (type == RECLIST_DEBIT)
recnData->debit_frame = frame;
else
recnData->credit_frame = frame;
vbox = gtk_vbox_new(FALSE, 5); vbox = gtk_vbox_new(FALSE, 5);
@ -488,9 +524,11 @@ gnc_reconcile_window_create_list_frame(Account *account,
*list_save = list; *list_save = list;
gtk_signal_connect(GTK_OBJECT(list), "toggle_reconciled", gtk_signal_connect(GTK_OBJECT(list), "toggle_reconciled",
GTK_SIGNAL_FUNC(gnc_reconcile_window_list_cb), recnData); GTK_SIGNAL_FUNC(gnc_reconcile_window_list_cb),
recnData);
gtk_signal_connect(GTK_OBJECT(list), "focus_in_event", gtk_signal_connect(GTK_OBJECT(list), "focus_in_event",
GTK_SIGNAL_FUNC(gnc_reconcile_window_focus_cb), recnData); GTK_SIGNAL_FUNC(gnc_reconcile_window_focus_cb),
recnData);
scrollWin = gtk_scrolled_window_new (NULL, NULL); scrollWin = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW (scrollWin), gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW (scrollWin),
@ -558,10 +596,13 @@ gnc_ui_reconcile_window_change_cb(GtkButton *button, gpointer data)
{ {
RecnWindow *recnData = (RecnWindow *) data; RecnWindow *recnData = (RecnWindow *) data;
double new_ending = recnData->new_ending; double new_ending = recnData->new_ending;
time_t statement_date = recnData->statement_date;
if (startRecnWindow(recnData->window, recnData->account, &new_ending)) if (startRecnWindow(recnData->window, recnData->account,
&new_ending, &statement_date))
{ {
recnData->new_ending = new_ending; recnData->new_ending = new_ending;
recnData->statement_date = statement_date;
recnRecalculateBalance(recnData); recnRecalculateBalance(recnData);
} }
} }
@ -751,7 +792,7 @@ gnc_recn_create_menu_bar(RecnWindow *recnData, GtkWidget *statusbar)
{ {
{ {
GNOME_APP_UI_ITEM, GNOME_APP_UI_ITEM,
END_BALN_MENU_E_STR_N, TOOLTIP_ADJUST_END_N, RECN_INFO_MENU_E_STR_N, TOOLTIP_RECN_INFO_N,
gnc_ui_reconcile_window_change_cb, NULL, NULL, gnc_ui_reconcile_window_change_cb, NULL, NULL,
GNOME_APP_PIXMAP_NONE, NULL, GNOME_APP_PIXMAP_NONE, NULL,
0, 0, NULL 0, 0, NULL
@ -999,6 +1040,7 @@ gnc_recn_create_tool_bar(RecnWindow *recnData)
recnData->edit_button = toolbar_info[1].widget; recnData->edit_button = toolbar_info[1].widget;
recnData->delete_button = toolbar_info[2].widget; recnData->delete_button = toolbar_info[2].widget;
recnData->finish_button = toolbar_info[6].widget;
return toolbar; return toolbar;
} }
@ -1020,6 +1062,7 @@ recnWindow(GtkWidget *parent, Account *account)
GtkWidget *vbox; GtkWidget *vbox;
GtkWidget *dock; GtkWidget *dock;
double new_ending; double new_ending;
time_t statement_date;
if (account == NULL) if (account == NULL)
return NULL; return NULL;
@ -1027,10 +1070,11 @@ recnWindow(GtkWidget *parent, Account *account)
FETCH_FROM_LIST(RecnWindow, recnList, account, account, recnData); FETCH_FROM_LIST(RecnWindow, recnList, account, account, recnData);
new_ending = xaccAccountGetBalance(account); new_ending = xaccAccountGetBalance(account);
statement_date = time(NULL);
/* Popup a little window to prompt the user to enter the /* Popup a little window to prompt the user to enter the
* ending balance for his/her bank statement */ * ending balance for his/her bank statement */
if (!startRecnWindow(parent, account, &new_ending)) if (!startRecnWindow(parent, account, &new_ending, &statement_date))
{ {
REMOVE_FROM_LIST(RecnWindow, recnList, account, account); REMOVE_FROM_LIST(RecnWindow, recnList, account, account);
free(recnData); free(recnData);
@ -1038,6 +1082,7 @@ recnWindow(GtkWidget *parent, Account *account)
} }
recnData->new_ending = new_ending; recnData->new_ending = new_ending;
recnData->statement_date = statement_date;
recnData->window = gtk_window_new(GTK_WINDOW_TOPLEVEL); recnData->window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
recnData->delete_refresh = FALSE; recnData->delete_refresh = FALSE;
@ -1052,12 +1097,8 @@ recnWindow(GtkWidget *parent, Account *account)
statusbar = gnc_recn_create_status_bar(recnData); statusbar = gnc_recn_create_status_bar(recnData);
gtk_box_pack_start(GTK_BOX(vbox), statusbar, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(vbox), statusbar, FALSE, FALSE, 0);
/* here we connect the "destroy" event to a signal handler.
* This event occurs when we call gtk_widget_destroy() on the window,
* or if we return 'FALSE' in the "delete_event" callback.
* Eventually executed by gnome_dialog_close() */
gtk_signal_connect (GTK_OBJECT (recnData->window), "destroy", gtk_signal_connect (GTK_OBJECT (recnData->window), "destroy",
GTK_SIGNAL_FUNC(recnClose), (gpointer) recnData); GTK_SIGNAL_FUNC(recnClose), recnData);
/* The menu bar */ /* The menu bar */
{ {
@ -1088,7 +1129,7 @@ recnWindow(GtkWidget *parent, Account *account)
id = gnc_register_option_change_callback(gnc_toolbar_change_cb, recnData, id = gnc_register_option_change_callback(gnc_toolbar_change_cb, recnData,
"General", "Toolbar Buttons"); "General", "Toolbar Buttons");
recnData->toolbar_change_callback_id = id; recnData->toolbar_change_cb_id = id;
gnome_dock_add_item (GNOME_DOCK(dock), GNOME_DOCK_ITEM(dock_item), gnome_dock_add_item (GNOME_DOCK(dock), GNOME_DOCK_ITEM(dock_item),
GNOME_DOCK_TOP, 1, 0, 0, TRUE); GNOME_DOCK_TOP, 1, 0, 0, TRUE);
@ -1099,8 +1140,8 @@ recnWindow(GtkWidget *parent, Account *account)
GtkWidget *frame = gtk_frame_new(NULL); GtkWidget *frame = gtk_frame_new(NULL);
GtkWidget *main_area = gtk_vbox_new(FALSE, 10); GtkWidget *main_area = gtk_vbox_new(FALSE, 10);
GtkWidget *debcred_area = gtk_hbox_new(FALSE, 15); GtkWidget *debcred_area = gtk_hbox_new(FALSE, 15);
GtkWidget *debits_frame; GtkWidget *debits_box;
GtkWidget *credits_frame; GtkWidget *credits_box;
GtkWidget *popup; GtkWidget *popup;
gnome_dock_set_client_area(GNOME_DOCK(dock), frame); gnome_dock_set_client_area(GNOME_DOCK(dock), frame);
@ -1108,21 +1149,27 @@ recnWindow(GtkWidget *parent, Account *account)
gtk_container_add(GTK_CONTAINER(frame), main_area); gtk_container_add(GTK_CONTAINER(frame), main_area);
gtk_container_set_border_width(GTK_CONTAINER(main_area), 10); gtk_container_set_border_width(GTK_CONTAINER(main_area), 10);
debits_frame = gnc_reconcile_window_create_list_frame debits_box = gnc_reconcile_window_create_list_box
(account, RECLIST_DEBIT, recnData, (account, RECLIST_DEBIT, recnData,
&recnData->debit, &recnData->total_debit); &recnData->debit, &recnData->total_debit);
credits_frame = gnc_reconcile_window_create_list_frame credits_box = gnc_reconcile_window_create_list_box
(account, RECLIST_CREDIT, recnData, (account, RECLIST_CREDIT, recnData,
&recnData->credit, &recnData->total_credit); &recnData->credit, &recnData->total_credit);
gnc_reconcile_window_set_frame_titles(recnData);
recnData->title_change_cb_id =
gnc_register_option_change_callback(set_frame_titles_cb, recnData,
"General", "Use accounting labels");
popup = gnc_recn_create_popup_menu(recnData); popup = gnc_recn_create_popup_menu(recnData);
gnome_popup_menu_attach(popup, recnData->debit, recnData); gnome_popup_menu_attach(popup, recnData->debit, recnData);
gnome_popup_menu_attach(popup, recnData->credit, recnData); gnome_popup_menu_attach(popup, recnData->credit, recnData);
gtk_box_pack_start(GTK_BOX(main_area), debcred_area, TRUE, TRUE, 0); gtk_box_pack_start(GTK_BOX(main_area), debcred_area, TRUE, TRUE, 0);
gtk_box_pack_start(GTK_BOX(debcred_area), debits_frame, TRUE, FALSE, 0); gtk_box_pack_start(GTK_BOX(debcred_area), debits_box, TRUE, FALSE, 0);
gtk_box_pack_end(GTK_BOX(debcred_area), credits_frame, TRUE, FALSE, 0); gtk_box_pack_end(GTK_BOX(debcred_area), credits_box, TRUE, FALSE, 0);
{ {
GtkWidget *hbox, *title_vbox, *value_vbox; GtkWidget *hbox, *title_vbox, *value_vbox;
@ -1221,6 +1268,8 @@ recnWindow(GtkWidget *parent, Account *account)
gtk_widget_show_all(recnData->window); gtk_widget_show_all(recnData->window);
recnRecalculateBalance(recnData);
gnc_recn_refresh_toolbar(recnData); gnc_recn_refresh_toolbar(recnData);
return recnData; return recnData;
@ -1288,7 +1337,10 @@ recnClose(GtkWidget *w, gpointer data)
REMOVE_FROM_LIST(RecnWindow, recnList, account, account); REMOVE_FROM_LIST(RecnWindow, recnList, account, account);
id = recnData->toolbar_change_callback_id; id = recnData->toolbar_change_cb_id;
gnc_unregister_option_change_callback_id(id);
id = recnData->title_change_cb_id;
gnc_unregister_option_change_callback_id(id); gnc_unregister_option_change_callback_id(id);
if (recnData->delete_refresh) if (recnData->delete_refresh)
@ -1309,18 +1361,21 @@ recnClose(GtkWidget *w, gpointer data)
static void static void
recnFinishCB(GtkWidget *w, gpointer data) recnFinishCB(GtkWidget *w, gpointer data)
{ {
RecnWindow *recnData = data; RecnWindow *recnData = data;
time_t date;
if (!DEQ(recnRecalculateBalance(recnData), 0.0)) if (!DEQ(recnRecalculateBalance(recnData), 0.0))
if (!gnc_verify_dialog_parented(GTK_WINDOW(recnData->window), if (!gnc_verify_dialog_parented(GTK_WINDOW(recnData->window),
RECN_BALN_WARN, GNC_F)) RECN_BALN_WARN, GNC_F))
return; return;
gnc_reconcile_list_commit(GNC_RECONCILE_LIST(recnData->credit)); date = recnData->statement_date;
gnc_reconcile_list_commit(GNC_RECONCILE_LIST(recnData->debit));
gnc_reconcile_list_commit(GNC_RECONCILE_LIST(recnData->credit), date);
gnc_reconcile_list_commit(GNC_RECONCILE_LIST(recnData->debit), date);
recnData->delete_refresh = TRUE; recnData->delete_refresh = TRUE;
gtk_widget_destroy(recnData->window); gtk_widget_destroy(recnData->window);
} }

View File

@ -337,6 +337,10 @@ gnc_register_sort(RegWindow *regData, int sort_code)
case BY_DATE_ENTERED: case BY_DATE_ENTERED:
xaccQuerySetSortOrder(query, BY_DATE_ENTERED, BY_STANDARD, BY_NONE); xaccQuerySetSortOrder(query, BY_DATE_ENTERED, BY_STANDARD, BY_NONE);
break; break;
case BY_DATE_RECONCILED:
xaccQuerySetSortOrder(query, BY_RECONCILE, BY_DATE_RECONCILED,
BY_STANDARD);
break;
case BY_NUM: case BY_NUM:
xaccQuerySetSortOrder(query, BY_NUM, BY_DATE, BY_AMOUNT); xaccQuerySetSortOrder(query, BY_NUM, BY_DATE, BY_AMOUNT);
break; break;
@ -381,6 +385,14 @@ gnc_register_sort_date_entered_cb(GtkWidget *w, gpointer data)
gnc_register_sort(regData, BY_DATE_ENTERED); gnc_register_sort(regData, BY_DATE_ENTERED);
} }
static void
gnc_register_sort_date_reconciled_cb(GtkWidget *w, gpointer data)
{
RegWindow *regData = data;
gnc_register_sort(regData, BY_DATE_RECONCILED);
}
static void static void
gnc_register_sort_num_cb(GtkWidget *w, gpointer data) gnc_register_sort_num_cb(GtkWidget *w, gpointer data)
{ {
@ -497,7 +509,7 @@ gnc_register_set_date_range(RegWindow *regData)
toggle = GTK_TOGGLE_BUTTON(regDateData->show_earliest); toggle = GTK_TOGGLE_BUTTON(regDateData->show_earliest);
xaccQueryPurgeTerms(regData->ledger->query, PD_DATE); xaccQueryPurgeTerms(regData->ledger->query, PD_DATE);
if (!gtk_toggle_button_get_active(toggle)) { if (!gtk_toggle_button_get_active(toggle)) {
time_t start; time_t start;
@ -1070,7 +1082,12 @@ gnc_register_create_menu_bar(RegWindow *regData, GtkWidget *statusbar)
gnc_register_sort_date_cb, NULL, NULL), gnc_register_sort_date_cb, NULL, NULL),
GNOMEUIINFO_RADIOITEM_DATA(SORT_BY_ENTERED_STR_N, GNOMEUIINFO_RADIOITEM_DATA(SORT_BY_ENTERED_STR_N,
TOOLTIP_SORT_BY_ENTERED_N, TOOLTIP_SORT_BY_ENTERED_N,
gnc_register_sort_date_entered_cb, NULL, NULL), gnc_register_sort_date_entered_cb,
NULL, NULL),
GNOMEUIINFO_RADIOITEM_DATA(SORT_BY_STMT_STR_N,
TOOLTIP_SORT_BY_STMT_N,
gnc_register_sort_date_reconciled_cb,
NULL, NULL),
GNOMEUIINFO_RADIOITEM_DATA(SORT_BY_NUM_STR_N, TOOLTIP_SORT_BY_NUM_N, GNOMEUIINFO_RADIOITEM_DATA(SORT_BY_NUM_STR_N, TOOLTIP_SORT_BY_NUM_N,
gnc_register_sort_num_cb, NULL, NULL), gnc_register_sort_num_cb, NULL, NULL),
GNOMEUIINFO_RADIOITEM_DATA(SORT_BY_AMNT_STR_N, TOOLTIP_SORT_BY_AMNT_N, GNOMEUIINFO_RADIOITEM_DATA(SORT_BY_AMNT_STR_N, TOOLTIP_SORT_BY_AMNT_N,

View File

@ -62,8 +62,8 @@
/** DIALOG BOX MESSAGES: ********************************************/ /** DIALOG BOX MESSAGES: ********************************************/
#define ABOUT_MSG _("The GnuCash personal finance manager.\n"\ #define ABOUT_MSG _("The GnuCash personal finance manager.\n"\
"The GNU way to manage your money!") "The GNU way to manage your money!")
#define ACC_ADJUST_MSG _("To adjust an account's balance, you must first\n"\ #define ACC_ADJUST_MSG _("To adjust an account's balance, you must "\
"choose an account to adjust.\n") "first\nchoose an account to adjust.\n")
#define ACC_BAD_PARENT_MSG _("You must choose a valid parent account.") #define ACC_BAD_PARENT_MSG _("You must choose a valid parent account.")
#define ACC_NEW_MSG _("Do you want to create a new account?\n"\ #define ACC_NEW_MSG _("Do you want to create a new account?\n"\
"If not, then please select an account\n"\ "If not, then please select an account\n"\
@ -82,8 +82,8 @@
"choose an account to reconcile.\n") "choose an account to reconcile.\n")
#define AMOUNT_NUM_MSG _("The amount must be a number.") #define AMOUNT_NUM_MSG _("The amount must be a number.")
#define BALANCE_NUM_MSG _("The balance must be a number.") #define BALANCE_NUM_MSG _("The balance must be a number.")
#define CHANGE_RECN_MSG _("Do you really want to mark this transaction"\ #define CHANGE_RECN_MSG _("Do you really want to mark this transaction "\
"not reconciled?\nDoing so might make future"\ "not reconciled?\nDoing so might make future "\
"reconciliation difficult!") "reconciliation difficult!")
#define DEL_SPLITS_MSG _("Delete all the splits") #define DEL_SPLITS_MSG _("Delete all the splits")
#define DEL_TRANS_MSG _("Delete the whole transaction") #define DEL_TRANS_MSG _("Delete the whole transaction")
@ -112,15 +112,15 @@
#define FILE_ECLOSE_MSG _("There was an error closing the file\n %s.") #define FILE_ECLOSE_MSG _("There was an error closing the file\n %s.")
#define FILE_NOT_FOUND_MSG _("The file \n %s\n could not be found.") #define FILE_NOT_FOUND_MSG _("The file \n %s\n could not be found.")
#define FILE_EMPTY_MSG _("The file \n %s\n is empty.") #define FILE_EMPTY_MSG _("The file \n %s\n is empty.")
#define FMB_SAVE_MSG _("Changes have been made since the last "\ #define FMB_SAVE_MSG _("Changes have been made since the last " \
"Save. Save the data to file?") "Save. Save the data to file?")
#define FMB_EEXIST_MSG _("The file \n %s\n already exists.\n"\ #define FMB_EEXIST_MSG _("The file \n %s\n already exists.\n" \
"Are you sure you want to overwrite it?") "Are you sure you want to overwrite it?")
#define FMB_INVALID_MSG _("The filepath \n %s\n"\ #define FMB_INVALID_MSG _("The filepath \n %s\n" \
"is not a valid location in the filesystem.") "is not a valid location in the filesystem.")
#define FMB_LOCKED_MSG _("The file \n %s\n"\ #define FMB_LOCKED_MSG _("The file \n %s\n" \
"appears to be in use by another user.\n"\ "appears to be in use by another user.\n" \
"If this is not right, remove the .LCK file "\ "If this is not right, remove the .LCK file " \
"and try again.") "and try again.")
#define GNOME_PRINT_MSG _("You need to install the gnome-print library.") #define GNOME_PRINT_MSG _("You need to install the gnome-print library.")
#define QIF_LOAD_FAILED_FORMAT_MSG _("QIF file load failed. %s") #define QIF_LOAD_FAILED_FORMAT_MSG _("QIF file load failed. %s")
@ -130,12 +130,13 @@
#define QUOTE_SRC_MSG _("The source for price quotes") #define QUOTE_SRC_MSG _("The source for price quotes")
#define RECN_BALN_WARN _("The account is not balanced.\n" \ #define RECN_BALN_WARN _("The account is not balanced.\n" \
"Are you sure you want to finish?") "Are you sure you want to finish?")
#define RECN_CANCEL_WARN _("You have made changes to this reconcile window.\n"\ #define RECN_CANCEL_WARN _("You have made changes to this reconcile " \
"Are you sure you want to cancel?") "window.\nAre you sure you want to cancel?")
#define RECN_TRANS_WARN _("Warning! This is a reconciled transaction. "\ #define RECN_TRANS_WARN _("Warning! This is a reconciled transaction. " \
"Do you want do continue?") "Do you want do continue?")
#define REG_CURR_MSG _("You cannot transfer funds from the %s account.\n"\ #define REG_CURR_MSG _("You cannot transfer funds from the %s " \
"It does not have a matching currency.") "account.\nIt does not have a matching " \
"currency.")
#define REPORT_ERR_MSG _("Error executing scheme report.") #define REPORT_ERR_MSG _("Error executing scheme report.")
#define REPORT_NOPARM_MSG _("This report has no parameters.") #define REPORT_NOPARM_MSG _("This report has no parameters.")
#define SHOW_CAT_MSG _("Show the income and expense accounts.") #define SHOW_CAT_MSG _("Show the income and expense accounts.")
@ -161,14 +162,16 @@
"They do not have a common currency.") "They do not have a common currency.")
#define XFER_DIFF_MSG _("The \"From\" and \"To\" accounts\n must be " \ #define XFER_DIFF_MSG _("The \"From\" and \"To\" accounts\n must be " \
"different!") "different!")
#define XFER_SAME_MSG _("You can't transfer from and to the same account!") #define XFER_SAME_MSG _("You can't transfer from and to the same " \
"account!")
#define XFER_NO_ACC_MSG _("You must specify an account to transfer from,\n"\ #define XFER_NO_ACC_MSG _("You must specify an account to transfer from,\n"\
"or to, or both, for this transaction.\n" \ "or to, or both, for this transaction.\n" \
"Otherwise, it will not be recorded.") "Otherwise, it will not be recorded.")
/* Tooltip phrases */ /* Tooltip phrases */
#define TOOLTIP_ADJUST_N N_("Adjust the balance of the selected account") #define TOOLTIP_ADJUST_N N_("Adjust the balance of the selected " \
"account")
#define TOOLTIP_ADJUST _(TOOLTIP_ADJUST_N) #define TOOLTIP_ADJUST _(TOOLTIP_ADJUST_N)
#define TOOLTIP_ADJUST_AMOUNT _("Enter the new balance") #define TOOLTIP_ADJUST_AMOUNT _("Enter the new balance")
#define TOOLTIP_ADJUST_DATE _("Enter the date you want the balance "\ #define TOOLTIP_ADJUST_DATE _("Enter the date you want the balance "\
@ -259,6 +262,9 @@
#define TOOLTIP_RECN_CANCEL _(TOOLTIP_RECN_CANCEL_N) #define TOOLTIP_RECN_CANCEL _(TOOLTIP_RECN_CANCEL_N)
#define TOOLTIP_RECN_FINISH_N N_("Finish the reconciliation of this account") #define TOOLTIP_RECN_FINISH_N N_("Finish the reconciliation of this account")
#define TOOLTIP_RECN_FINISH _(TOOLTIP_RECN_FINISH_N) #define TOOLTIP_RECN_FINISH _(TOOLTIP_RECN_FINISH_N)
#define TOOLTIP_RECN_INFO_N N_("Change the reconcile information "\
"including statement date and ending "\
"balance.")
#define TOOLTIP_RECN_REG_N N_("Reconcile the main account for this "\ #define TOOLTIP_RECN_REG_N N_("Reconcile the main account for this "\
"register") "register")
#define TOOLTIP_RECN_REG _(TOOLTIP_RECN_REG_N) #define TOOLTIP_RECN_REG _(TOOLTIP_RECN_REG_N)
@ -275,8 +281,8 @@
#define TOOLTIP_SCRUB_SUB_N N_("Identify and fix problems in the account "\ #define TOOLTIP_SCRUB_SUB_N N_("Identify and fix problems in the account "\
"and its subaccounts") "and its subaccounts")
#define TOOLTIP_SCRUB_SUB _(TOOLTIP_SCRUB_SUB_N) #define TOOLTIP_SCRUB_SUB _(TOOLTIP_SCRUB_SUB_N)
#define TOOLTIP_SCRUB_REG_N N_("Identify and fix problems in the accounts "\ #define TOOLTIP_SCRUB_REG_N N_("Identify and fix problems in the "\
"of this register") "accounts of this register")
#define TOOLTIP_SCRUB_REG _(TOOLTIP_SCRUB_REG_N) #define TOOLTIP_SCRUB_REG _(TOOLTIP_SCRUB_REG_N)
#define TOOLTIP_SET_DEFAULT _("Set the option to its default value") #define TOOLTIP_SET_DEFAULT _("Set the option to its default value")
#define TOOLTIP_SHOW_ALL_N N_("Show all of the transactions in the "\ #define TOOLTIP_SHOW_ALL_N N_("Show all of the transactions in the "\
@ -296,9 +302,13 @@
#define TOOLTIP_SORT_BY_MEMO _(TOOLTIP_SORT_BY_MEMO_N) #define TOOLTIP_SORT_BY_MEMO _(TOOLTIP_SORT_BY_MEMO_N)
#define TOOLTIP_SORT_BY_NUM_N N_("Sort by Num, then Date, then Amount") #define TOOLTIP_SORT_BY_NUM_N N_("Sort by Num, then Date, then Amount")
#define TOOLTIP_SORT_BY_NUM _(TOOLTIP_SORT_BY_NUM_N) #define TOOLTIP_SORT_BY_NUM _(TOOLTIP_SORT_BY_NUM_N)
#define TOOLTIP_SORT_BY_STMT_N N_("Sort by the statement date "\
"(unreconciled items last")
#define TOOLTIP_SORT_BY_STMT _(TOOLTIP_SORT_BY_STMT_N)
#define TOOLTIP_STANDARD_ORD_N N_("Keep normal account order") #define TOOLTIP_STANDARD_ORD_N N_("Keep normal account order")
#define TOOLTIP_STANDARD_ORD _(TOOLTIP_STANDARD_ORD_N) #define TOOLTIP_STANDARD_ORD _(TOOLTIP_STANDARD_ORD_N)
#define TOOLTIP_TRANSFER_N N_("Transfer funds from one account to another") #define TOOLTIP_TRANSFER_N N_("Transfer funds from one account to "\
"another")
#define TOOLTIP_TRANSFER _(TOOLTIP_TRANSFER_N) #define TOOLTIP_TRANSFER _(TOOLTIP_TRANSFER_N)
@ -368,6 +378,7 @@
#define PREFERENCES_MENU_STR _("_Preferences") #define PREFERENCES_MENU_STR _("_Preferences")
#define PREFERENCES_MENU_E_STR_N N_("_Preferences...") #define PREFERENCES_MENU_E_STR_N N_("_Preferences...")
#define PRINT_CHECK_MENU_E_STR_N N_("_Print Check... (unfinished!)") #define PRINT_CHECK_MENU_E_STR_N N_("_Print Check... (unfinished!)")
#define RECN_INFO_MENU_E_STR_N N_("_Reconcile Information...")
#define RECONCILE_MENU_E_STR_N N_("_Reconcile...") #define RECONCILE_MENU_E_STR_N N_("_Reconcile...")
#define RECONCILE_MENU_STR_N N_("_Reconcile") #define RECONCILE_MENU_STR_N N_("_Reconcile")
#define RECONCILE_MENU_STR _(RECONCILE_MENU_STR_N) #define RECONCILE_MENU_STR _(RECONCILE_MENU_STR_N)
@ -482,11 +493,14 @@
#define SORT_BY_MEMO_STR _(SORT_BY_MEMO_STR_N) #define SORT_BY_MEMO_STR _(SORT_BY_MEMO_STR_N)
#define SORT_BY_NUM_STR_N N_("Sort by Num") #define SORT_BY_NUM_STR_N N_("Sort by Num")
#define SORT_BY_NUM_STR _(SORT_BY_NUM_STR_N) #define SORT_BY_NUM_STR _(SORT_BY_NUM_STR_N)
#define SORT_BY_STMT_STR_N N_("Sort by statement date")
#define SORT_BY_STMT_STR _(SORT_BY_STMT_STR_N)
#define SORT_ORDER_STR _("Sort Order") #define SORT_ORDER_STR _("Sort Order")
#define START_DATE_STR _("Start date") #define START_DATE_STR _("Start date")
#define START_BALN_STR _("Starting Balance") #define START_BALN_STR _("Starting Balance")
#define STANDARD_ORDER_STR_N N_("Standard order") #define STANDARD_ORDER_STR_N N_("Standard order")
#define STANDARD_ORDER_STR _(STANDARD_ORDER_STR_N) #define STANDARD_ORDER_STR _(STANDARD_ORDER_STR_N)
#define STATEMENT_DATE_C_STR _("Statement Date:")
#define TOP_ACCT_STR _("Top level account") #define TOP_ACCT_STR _("Top level account")
#define TOTAL_SHARES_STR _("Total Shares") #define TOTAL_SHARES_STR _("Total Shares")
#define VERIFY_CHANGES_STR _("Verify Changes") #define VERIFY_CHANGES_STR _("Verify Changes")
@ -595,7 +609,7 @@
#define PARAMETERS_STR _("Parameters") #define PARAMETERS_STR _("Parameters")
#define PAYMENT_STR _("Payment") #define PAYMENT_STR _("Payment")
#define PORTFOLIO_STR _("Portfolio") #define PORTFOLIO_STR _("Portfolio")
#define POS_STR _("POS") /* Point of Sale credit card machine */ #define POS_STR _("POS") /* Point of Sale credit card machine */
#define PREFERENCES_STR _("Preferences") #define PREFERENCES_STR _("Preferences")
#define PRICE_STR _("Price") #define PRICE_STR _("Price")
#define PRINT_STR _("Print") #define PRINT_STR _("Print")

View File

@ -279,8 +279,11 @@ gnucash_sheet_activate_cursor_cell (GnucashSheet *sheet,
&cursor_pos, &start_sel, &end_sel); &cursor_pos, &start_sel, &end_sel);
if (new_text != NULL) if (new_text != NULL)
{
gnucash_sheet_cell_set_from_table (sheet, virt_row, virt_col, gnucash_sheet_cell_set_from_table (sheet, virt_row, virt_col,
cell_row, cell_col); cell_row, cell_col);
gnucash_sheet_redraw_block (sheet, virt_row, virt_col);
}
else else
{ {
gnucash_sheet_start_editing_at_cursor (sheet); gnucash_sheet_start_editing_at_cursor (sheet);
@ -712,7 +715,8 @@ gnucash_sheet_redraw_block (GnucashSheet *sheet, gint row, gint col)
y += canvas->layout.yoffset - canvas->zoom_yofs; y += canvas->layout.yoffset - canvas->zoom_yofs;
h = style->dimensions->height; h = style->dimensions->height;
w = MIN(style->dimensions->width, GTK_WIDGET(sheet)->allocation.width); w = MIN(style->dimensions->width,
GTK_WIDGET(sheet)->allocation.width);
gnome_canvas_request_redraw (canvas, x, y, x+w, y+h); gnome_canvas_request_redraw (canvas, x, y, x+w, y+h);
} }

View File

@ -59,13 +59,13 @@ ToggleRecn (BasicCell *_cell, const char *cur_val,
BasicCell *cell = (BasicCell *) _cell; BasicCell *cell = (BasicCell *) _cell;
char buff[2]; char buff[2];
/* throw up a popup if the user tries to undo a reconciled transcation /* throw up a popup if the user tries to undo a reconciled transaction
hack alert -- this sets a new precedent ... gnc_verify_dialog is hack alert -- this sets a new precedent ... gnc_verify_dialog is
defined in both the motif and the gtk subdirs; I don't think I like defined in both the motif and the gnome subdirs; I don't think I like
it that way. Now it's in ui-callbacks.h which is UI independent, it that way. Now it's in ui-callbacks.h which is UI independent,
but that's still perhaps not optimal... */ but that's still perhaps not optimal... */
if(cur_val[0] == YREC) { if (cur_val[0] == YREC) {
if(!gnc_verify_dialog(CHANGE_RECN_MSG, GNC_T)) { if(!gnc_verify_dialog(CHANGE_RECN_MSG, GNC_T)) {
return strdup(cur_val); return strdup(cur_val);
} }
@ -77,7 +77,7 @@ ToggleRecn (BasicCell *_cell, const char *cur_val,
buff[0] = NREC; buff[0] = NREC;
} }
buff[1] = 0x0; buff[1] = 0x0;
xaccSetBasicCellValue (cell, buff); xaccSetBasicCellValue (cell, buff);
return strdup (buff); return strdup (buff);
} }