i18n reconciled header and flag values.

Robert Graham Merkel's date patch.
Fix bug in options saving.
New tips-of-the-day.
Updated po files.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@2520 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Dave Peticolas
2000-06-27 08:08:45 +00:00
parent 075cbd9157
commit bdc2cc4f94
24 changed files with 2544 additions and 2098 deletions

View File

@@ -1,10 +1,43 @@
2000-06-27 Dave Peticolas <dave@krondo.com>
* src/gnome/top-level.c (gnucash_ui_init): set the reconciled cell
string getter to the dialog-utils function for i18ning the reconcile
flag value.
* src/engine/Transaction.c (xaccSplitSetReconcile): make sure the
reconciled flag given is good.
* src/register/splitreg.c: modify for the changes in the reconcile
cell.
* src/SplitLedger.c: modify for the changes in the reconcile cell.
* src/register/recncell.c: make the reconcile cell a real object,
not just a BasicCell with some extra functions. Add functionality
for distinguishing between the flag value and the displayed value.
2000-06-26 Dave Peticolas <dave@krondo.com>
* src/gnome/dialog-utils.c (gnc_get_reconcile_str): new function.
Return i18n'd string for reconciled flag.
* src/gnome/reconcile-list.c: use i18n'd reconciled flag string.
* src/scm/tip-of-the-day.scm: put the check for whether tips
should be shown or not inside the hook. We can't do the check
here because the options haven't been loaded yet.
* src/scm/options.scm: fix bug in writing options. Use 'write'
to output section and option names for proper escaping.
2000-06-27 Robert Graham Merkel <rgmerk@mira.net>
* src/scm/date-utilities.scm: Added date-granularity timepair comparison
functions.
* src/scm/date-utilities.scm: Added date-granularity timepair
comparison functions. Removed direct access functions to the time
structures in various functions (Dave also worked on this).
* src/scm/report/transaction-report.scm: Changed to use date
comparison functions in date-utilities.scm
comparison functions in date-utilities.scm.
2000-06-26 Robert Graham Merkel <rgmerk@mira.net>

825
po/de.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

833
po/fr.po

File diff suppressed because it is too large Load Diff

View File

@@ -6,7 +6,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2000-06-26 13:15-0700\n"
"POT-Creation-Date: 2000-06-26 23:00-0700\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -1739,6 +1739,26 @@ msgstr ""
msgid "Yes"
msgstr ""
#: messages-i18n.c:412
msgid "cleared:c"
msgstr ""
#: messages-i18n.c:413
msgid "frozen:f"
msgstr ""
#: messages-i18n.c:414
msgid "not cleared:n"
msgstr ""
#: messages-i18n.c:415
msgid "Reconciled:R"
msgstr ""
#: messages-i18n.c:416
msgid "reconciled:y"
msgstr ""
#: po/guile_strings.txt:1
msgid "String Option"
msgstr ""

824
po/ja.po

File diff suppressed because it is too large Load Diff

838
po/sv.po

File diff suppressed because it is too large Load Diff

View File

@@ -2208,7 +2208,8 @@ xaccSRSaveRegEntryToSCM (SplitRegister *reg, SCM trans_scm, SCM split_scm)
gnc_trans_scm_set_description(trans_scm, reg->descCell->cell.value);
if (MOD_RECN & changed)
gnc_split_scm_set_reconcile_state(split_scm, reg->recnCell->value[0]);
gnc_split_scm_set_reconcile_state(split_scm,
xaccRecnCellGetFlag(reg->recnCell));
if (MOD_ACTN & changed)
gnc_split_scm_set_action(split_scm, reg->actionCell->cell.value);
@@ -2513,8 +2514,8 @@ xaccSRSaveChangedCells (SplitRegister *reg, Transaction *trans, Split *split)
}
if (MOD_RECN & changed) {
DEBUG ("MOD_RECN: %c\n", reg->recnCell->value[0]);
xaccSplitSetReconcile (split, reg->recnCell->value[0]);
DEBUG ("MOD_RECN: %c\n", xaccRecnCellGetFlag(reg->recnCell));
xaccSplitSetReconcile (split, xaccRecnCellGetFlag(reg->recnCell));
}
if (MOD_ACTN & changed) {
@@ -2834,7 +2835,6 @@ xaccSRLoadRegEntry (SplitRegister *reg, Split *split)
SRInfo *info = xaccSRGetInfo(reg);
Split *blank_split = xaccSplitLookup(&info->blank_split_guid);
SplitRegisterType reg_type = reg->type;
char buff[2];
double baln;
/* don't even bother doing a load if there is no current cursor */
@@ -2847,7 +2847,7 @@ xaccSRLoadRegEntry (SplitRegister *reg, Split *split)
xaccSetDateCellValueSecs (reg->dateCell, 0);
xaccSetNumCellValue (reg->numCell, "");
xaccSetQuickFillCellValue (reg->descCell, "");
xaccSetBasicCellValue (reg->recnCell, "");
xaccRecnCellSetFlag (reg->recnCell, NREC);
xaccSetPriceCellValue (reg->shrsCell, 0.0);
xaccSetPriceCellValue (reg->balanceCell, 0.0);
@@ -2876,9 +2876,7 @@ xaccSRLoadRegEntry (SplitRegister *reg, Split *split)
xaccSetQuickFillCellValue (reg->descCell,
xaccTransGetDescription (trans));
buff[0] = xaccSplitGetReconcile (split);
buff[1] = 0x0;
xaccSetBasicCellValue (reg->recnCell, buff);
xaccRecnCellSetFlag (reg->recnCell, xaccSplitGetReconcile (split));
/* If the reverse_balance callback is present use that.
* Otherwise, reverse income and expense by default. */
@@ -2959,10 +2957,6 @@ xaccSRLoadRegEntry (SplitRegister *reg, Split *split)
xaccSetQuickFillCellValue (reg->memoCell, xaccSplitGetMemo (split));
buff[0] = xaccSplitGetReconcile (split);
buff[1] = 0x0;
xaccSetBasicCellValue (reg->recnCell, buff);
if ((STOCK_REGISTER == reg_type) ||
(CURRENCY_REGISTER == reg_type) ||
(PORTFOLIO_LEDGER == reg_type))

View File

@@ -2061,6 +2061,18 @@ xaccSplitSetReconcile (Split *split, char recn)
{
if (!split) return;
switch (recn)
{
case NREC:
case CREC:
case YREC:
case FREC:
break;
default:
PERR("Bad reconciled flag");
return;
}
split->reconciled = recn;
MARK_SPLIT (split);

View File

@@ -1084,3 +1084,26 @@ gnc_window_adjust_for_screen(GtkWindow * window)
gdk_window_resize(GTK_WIDGET(window)->window, width, height);
gtk_widget_queue_resize(GTK_WIDGET(window));
}
/********************************************************************\
* gnc_get_reconcile_str *
* return the i18n'd string for the given reconciled flag *
* *
* Args: reconciled_flag - the flag to stringize *
* Returns: the i18n'd reconciled string *
\********************************************************************/
const char *
gnc_get_reconcile_str(char reconciled_flag)
{
switch (reconciled_flag)
{
case NREC: return NOT_CLEARED_ABBREV;
case CREC: return CLEARED_ABBREV;
case YREC: return RECONCILED_ABBREV;
case FREC: return FROZEN_ABBREV;
default:
PERR("Bad reconciled flag\n");
return NULL;
}
}

View File

@@ -167,4 +167,6 @@ int gnc_option_menu_get_active(GtkWidget * option_menu);
void gnc_window_adjust_for_screen(GtkWindow * window);
const char * gnc_get_reconcile_str(char reconciled_flag);
#endif

View File

@@ -27,10 +27,10 @@
#include <gnome.h>
#include "gnucash.h"
#include "messages.h"
#include "Query.h"
#include "reconcile-listP.h"
#include "dialog-utils.h"
#include "FileDialog.h"
#include "messages.h"
#include "date.h"
#include "util.h"
@@ -114,7 +114,7 @@ gnc_reconcile_list_init(GNCReconcileList *list)
NUM_STR,
DESC_STR,
AMT_STR,
"?",
RECONCILE_ABBREV,
NULL
};
@@ -233,8 +233,8 @@ static void
gnc_reconcile_list_toggle(GNCReconcileList *list)
{
Split *split, *current;
char recn_str[2];
gboolean reconciled;
const char *recn_str;
char recn;
gint row;
@@ -262,7 +262,8 @@ gnc_reconcile_list_toggle(GNCReconcileList *list)
}
recn = xaccSplitGetReconcile(split);
g_snprintf(recn_str, 2, "%c", reconciled ? YREC : recn);
recn = reconciled ? YREC : recn;
recn_str = gnc_get_reconcile_str(recn);
gtk_clist_set_text(GTK_CLIST(list), row, 4, recn_str);
gnc_reconcile_list_set_row_style(list, row, reconciled);
@@ -582,7 +583,6 @@ gnc_reconcile_list_fill(GNCReconcileList *list)
Split *split;
const char *currency;
char recn_str[2];
char recn;
double amount;
@@ -590,7 +590,6 @@ gnc_reconcile_list_fill(GNCReconcileList *list)
account_type = xaccAccountGetType(list->account);
currency = xaccAccountGetCurrency(list->account);
strings[4] = recn_str;
strings[5] = NULL;
if ((account_type == STOCK) || (account_type == MUTUAL) ||
@@ -625,11 +624,11 @@ gnc_reconcile_list_fill(GNCReconcileList *list)
strings[3] = xaccPrintAmount(DABS(amount), flags, currency);
reconciled = g_hash_table_lookup(list->reconciled, split) != NULL;
g_snprintf(recn_str, 2, "%c", reconciled ? YREC : recn);
recn = reconciled ? YREC : recn;
strings[4] = (char *) gnc_get_reconcile_str(recn);
row = gtk_clist_append(GTK_CLIST(list), strings);
gtk_clist_set_row_data(GTK_CLIST(list), row, (gpointer) split);
gtk_clist_set_row_data(GTK_CLIST(list), row, split);
gnc_reconcile_list_set_row_style(list, row, reconciled);

View File

@@ -25,6 +25,8 @@
#include <gtk/gtkclist.h>
#include "Query.h"
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */

View File

@@ -54,6 +54,7 @@
#include "guile-util.h"
#include "splitreg.h"
#include "combocell.h"
#include "recncell.h"
/** PROTOTYPES ******************************************************/
@@ -182,6 +183,8 @@ gnucash_ui_init()
gnc_configure_sr_label_callbacks();
xaccRecnCellSetStringGetter(gnc_get_reconcile_str);
mainWindow();
gnucash_style_init();

View File

@@ -676,5 +676,12 @@
#define YEARS_STR _("Years")
#define YES_STR _("Yes")
/* single letters */
#define CLEARED_ABBREV _("cleared:c"+8)
#define FROZEN_ABBREV _("frozen:f"+7)
#define NOT_CLEARED_ABBREV _("not cleared:n"+12)
#define RECONCILE_ABBREV _("Reconciled:R"+11)
#define RECONCILED_ABBREV _("reconciled:y"+11)
#endif /* __XACC_MESSAGES_I18N_H__ */

View File

@@ -269,7 +269,7 @@ layout_init_normal(GnucashSheet *sheet, SheetBlockStyle *style)
{CHARS_MIN | CHARS_MAX,RESIZABLE,0,0,3,0,5,0,0,0,0,0,0,0,NULL},
{CHARS_MIN | FILL,RESIZABLE,0,0,20,0,0,0,0,0,0,0,0,0,NULL},
{STRING_MIN,RESIZABLE,0,0,0,0,10,0,0,0,0,0,0,0,XFRM_STR},
{STRING_FIXED,0,1,0,0,0,0,0,0,0,0,0,0,0,"R"},
{STRING_FIXED,0,1,0,0,0,0,0,0,0,0,0,0,0,RECONCILE_ABBREV},
{CHARS_MIN | CHARS_MAX,RESIZABLE,0,0,9,0,10,0,0,0,0,0,0,0,NULL},
{SAME_SIZE,RESIZABLE,0,0,0,0,0,0,0,0,0,0,0,5,NULL},
{SAME_SIZE,RESIZABLE,0,0,0,0,0,0,0,0,0,0,0,5,NULL},
@@ -304,7 +304,7 @@ layout_init_ledger(GnucashSheet *sheet, SheetBlockStyle *style)
{CHARS_MIN | FILL,RESIZABLE,0,0,20,0,0,0,0,0,0,0,0,0,NULL},
{STRING_MIN,RESIZABLE,0,0,0,0,10,0,0,0,0,0,0,0,XFTO_STR},
{STRING_MIN,RESIZABLE,0,0,0,0,10,0,0,0,0,0,0,0,XFRM_STR},
{STRING_FIXED,0,1,0,0,0,0,0,0,0,0,0,0,0,"R"},
{STRING_FIXED,0,1,0,0,0,0,0,0,0,0,0,0,0,RECONCILE_ABBREV},
{CHARS_MIN | CHARS_MAX,RESIZABLE,0,0,9,0,10,0,0,0,0,0,0,0,NULL},
{SAME_SIZE,RESIZABLE,0,0,0,0,0,0,0,0,0,0,0,6,NULL},
}};
@@ -338,7 +338,7 @@ layout_init_double(GnucashSheet *sheet, SheetBlockStyle *style)
{CHARS_MIN | CHARS_MAX,RESIZABLE,0,0,3,0,5,0,0,0,0,0,0,0,NULL},
{CHARS_MIN | FILL,RESIZABLE,0,0,20,0,0,0,0,0,0,0,0,0,NULL},
{STRING_MIN,RESIZABLE,0,0,0,0,0,0,0,0,0,0,0,0,XFRM_STR},
{STRING_FIXED,0,1,0,0,0,0,0,0,0,0,0,0,0,"R"},
{STRING_FIXED,0,1,0,0,0,0,0,0,0,0,0,0,0,RECONCILE_ABBREV},
{CHARS_MIN | CHARS_MAX,RESIZABLE,0,0,9,0,10,0,0,0,0,0,0,0,NULL},
{SAME_SIZE,RESIZABLE,0,0,0,0,0,0,0,0,0,0,0,5,NULL},
{SAME_SIZE,RESIZABLE,0,0,0,0,0,0,0,0,0,0,0,5,NULL}},
@@ -382,7 +382,7 @@ layout_init_ledger_double(GnucashSheet *sheet, SheetBlockStyle *style)
{CHARS_MIN | FILL,RESIZABLE,0,0,20,0,0,0,0,0,0,0,0,0,NULL},
{STRING_MIN,RESIZABLE,0,0,0,0,0,0,0,0,0,0,0,0,XFTO_STR},
{STRING_MIN,RESIZABLE,0,0,0,0,0,0,0,0,0,0,0,0,XFRM_STR},
{STRING_FIXED,0,1,0,0,0,0,0,0,0,0,0,0,0,"R"},
{STRING_FIXED,0,1,0,0,0,0,0,0,0,0,0,0,0,RECONCILE_ABBREV},
{CHARS_MIN | CHARS_MAX,RESIZABLE,0,0,9,0,10,0,0,0,0,0,0,0,NULL},
{SAME_SIZE,RESIZABLE,0,0,0,0,0,0,0,0,0,0,0,6,NULL}},
{{LEFT_ALIGNED|RIGHT_ALIGNED,RESIZABLE,0,0,0,0,0,0,0,0,0,0,0,0,NULL},
@@ -424,7 +424,7 @@ layout_init_stock(GnucashSheet *sheet, SheetBlockStyle *style)
{CHARS_MIN | CHARS_MAX,RESIZABLE,0,0,3,0,5,0,0,0,0,0,0,0,NULL},
{CHARS_MIN | FILL,RESIZABLE,0,0,20,0,0,0,0,0,0,0,0,0,NULL},
{STRING_MIN,RESIZABLE,0,0,0,0,0,0,0,0,0,0,0,0,XFRM_STR},
{STRING_FIXED,0,1,0,0,0,0,0,0,0,0,0,0,0,"R"},
{STRING_FIXED,0,1,0,0,0,0,0,0,0,0,0,0,0,RECONCILE_ABBREV},
{CHARS_MIN | CHARS_MAX,RESIZABLE,0,0,9,0,10,0,0,0,0,0,0,0,NULL},
{SAME_SIZE,RESIZABLE,0,0,0,0,0,0,0,0,0,0,0,5,NULL},
{SAME_SIZE,RESIZABLE,0,0,0,0,0,0,0,0,0,0,0,5,NULL},
@@ -463,7 +463,7 @@ layout_init_stock_ledger(GnucashSheet *sheet, SheetBlockStyle *style)
{CHARS_MIN | FILL,RESIZABLE,0,0,20,0,0,0,0,0,0,0,0,0,NULL},
{STRING_MIN,RESIZABLE,0,0,0,0,0,0,0,0,0,0,0,0,XFTO_STR},
{STRING_MIN,RESIZABLE,0,0,0,0,0,0,0,0,0,0,0,0,XFRM_STR},
{STRING_FIXED,0,1,0,0,0,0,0,0,0,0,0,0,0,"R"},
{STRING_FIXED,0,1,0,0,0,0,0,0,0,0,0,0,0,RECONCILE_ABBREV},
{CHARS_MIN | CHARS_MAX,RESIZABLE,0,0,9,0,10,0,0,0,0,0,0,0,NULL},
{SAME_SIZE,RESIZABLE,0,0,0,0,0,0,0,0,0,0,0,6,NULL},
{SAME_SIZE,RESIZABLE,0,0,0,0,0,0,0,0,0,0,0,6,NULL},
@@ -502,7 +502,7 @@ layout_init_stock_double(GnucashSheet *sheet, SheetBlockStyle *style)
{CHARS_MIN | CHARS_MAX,RESIZABLE,0,0,3,0,5,0,0,0,0,0,0,0,NULL},
{CHARS_MIN,RESIZABLE,0,0,20,0,0,0,0,0,0,0,0,0,NULL},
{STRING_MIN | FILL,RESIZABLE,0,0,0,0,0,0,0,0,0,0,0,0,XFRM_STR},
{STRING_FIXED, 0,1,0,0,0,0,0,0,0,0,0,0,0,"R"},
{STRING_FIXED, 0,1,0,0,0,0,0,0,0,0,0,0,0,RECONCILE_ABBREV},
{CHARS_MIN | CHARS_MAX,RESIZABLE,0,0,9,0,10,0,0,0,0,0,0,0,NULL},
{SAME_SIZE,RESIZABLE,0,0,0,0,0,0,0,0,0,0,0,5,NULL},
{SAME_SIZE,RESIZABLE,0,0,0,0,0,0,0,0,0,0,0,5,NULL},
@@ -554,7 +554,7 @@ layout_init_stock_ledger_double(GnucashSheet *sheet, SheetBlockStyle *style)
{CHARS_MIN,RESIZABLE,0,0,20,0,0,0,0,0,0,0,0,0,NULL},
{STRING_MIN | FILL,RESIZABLE,0,0,0,0,0,0,0,0,0,0,0,0,XFTO_STR},
{STRING_MIN | FILL,RESIZABLE,0,0,0,0,0,0,0,0,0,0,0,0,XFRM_STR},
{STRING_FIXED, 0,1,0,0,0,0,0,0,0,0,0,0,0,"R"},
{STRING_FIXED, 0,1,0,0,0,0,0,0,0,0,0,0,0,RECONCILE_ABBREV},
{CHARS_MIN | CHARS_MAX,RESIZABLE,0,0,9,0,10,0,0,0,0,0,0,0,NULL},
{SAME_SIZE,RESIZABLE,0,0,0,0,0,0,0,0,0,0,0,6,NULL},
{SAME_SIZE,RESIZABLE,0,0,0,0,0,0,0,0,0,0,0,6,NULL},

View File

@@ -47,74 +47,115 @@
*/
#include "Transaction.h"
static RecnCellStringGetter string_getter = NULL;
/* ================================================ */
static const char *
RecnCellGetString(char reconciled_flag)
{
static char str[2] = { 0, 0 };
if (string_getter != NULL)
return (string_getter)(reconciled_flag);
str[0] = reconciled_flag;
return str;
}
/* ================================================ */
static const char *
ToggleRecn (BasicCell *_cell, const char *cur_val,
ToggleRecn (BasicCell *_cell,
const char *cur_val,
int *cursor_position,
int *start_selection,
int *end_selection)
{
BasicCell *cell = (BasicCell *) _cell;
char buff[2];
RecnCell *cell = (RecnCell *) _cell;
/* throw up a popup if the user tries to undo a reconciled transaction
hack alert -- this sets a new precedent ... gnc_verify_dialog is
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,
but that's still perhaps not optimal... */
/* throw up a popup if the user tries to undo a reconciled transaction
hack alert -- this sets a new precedent. gnc_verify_dialog is 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, but that's
still perhaps not optimal. */
if (cur_val[0] == YREC) {
if(!gnc_verify_dialog(CHANGE_RECN_MSG, GNC_T)) {
return strdup(cur_val);
}
}
if (cell->reconciled_flag == YREC)
if (!gnc_verify_dialog(CHANGE_RECN_MSG, GNC_T))
return NULL;
if (NREC == cur_val[0]) {
buff[0] = CREC;
} else {
buff[0] = NREC;
}
buff[1] = 0x0;
if (cell->reconciled_flag == NREC) {
cell->reconciled_flag = CREC;
} else {
cell->reconciled_flag = NREC;
}
xaccSetBasicCellValue (cell, buff);
return strdup (buff);
xaccRecnCellSetFlag (cell, cell->reconciled_flag);
return strdup (_cell->value);
}
/* ================================================ */
BasicCell *
RecnCell *
xaccMallocRecnCell (void)
{
BasicCell *cell;
cell = xaccMallocBasicCell();
xaccInitRecnCell (cell);
return cell;
RecnCell * cell = malloc(sizeof(RecnCell));
assert(cell != NULL);
xaccInitRecnCell (cell);
return cell;
}
/* ================================================ */
void
xaccInitRecnCell (BasicCell *cell)
xaccInitRecnCell (RecnCell *cell)
{
char buff[2];
xaccInitBasicCell(&cell->cell);
buff[0] = NREC;
buff[1] = 0x0;
xaccRecnCellSetFlag(cell, NREC);
if (cell->value) free (cell->value);
cell ->value = strdup (buff);
cell->enter_cell = ToggleRecn;
cell->cell.enter_cell = ToggleRecn;
}
/* ================================================ */
void
xaccDestroyRecnCell (BasicCell *cell)
xaccDestroyRecnCell (RecnCell *cell)
{
xaccDestroyBasicCell (cell);
xaccDestroyBasicCell (&cell->cell);
}
/* ================================================ */
void
xaccRecnCellSetFlag (RecnCell *cell, char reconciled_flag)
{
const char *string;
cell->reconciled_flag = reconciled_flag;
string = RecnCellGetString(reconciled_flag);
xaccSetBasicCellValue(&cell->cell, string);
}
/* ================================================ */
char
xaccRecnCellGetFlag (RecnCell *cell)
{
return cell->reconciled_flag;
}
/* ================================================ */
void
xaccRecnCellSetStringGetter (RecnCellStringGetter getter)
{
string_getter = getter;
}
/* --------------- end of file ---------------------- */

View File

@@ -24,10 +24,10 @@
*
* FUNCTION:
* The RecnCell object implements a cell handler
* that will cycle throguh a series of single-character
* that will cycle through a series of single-character
* values when clicked upon by the mouse.
*
* hack alert -- ther should be a way of specifying what these values
* hack alert -- there should be a way of specifying what these values
* are, instead of having them hard coded as they currently are.
*
* HISTORY:
@@ -39,10 +39,24 @@
#include "basiccell.h"
/* installs a callback to handle reconcile flag */
BasicCell * xaccMallocRecnCell (void);
void xaccInitRecnCell (BasicCell *);
void xaccDestroyRecnCell (BasicCell *);
typedef const char * (*RecnCellStringGetter)(char);
typedef struct _RecnCell
{
BasicCell cell;
char reconciled_flag; /* The actual flag value */
} RecnCell;
RecnCell * xaccMallocRecnCell (void);
void xaccInitRecnCell (RecnCell *);
void xaccDestroyRecnCell (RecnCell *);
void xaccRecnCellSetFlag (RecnCell *, char reconciled_flag);
char xaccRecnCellGetFlag (RecnCell *);
void xaccRecnCellSetStringGetter (RecnCellStringGetter getter);
#endif /* __XACC_RECN_CELL_C__ */

View File

@@ -177,7 +177,7 @@ configLabels (SplitRegister *reg)
LABEL (DATE, DATE_STR);
LABEL (NUM, NUM_STR);
LABEL (DESC, DESC_STR);
LABEL (RECN, "R");
LABEL (RECN, RECONCILE_ABBREV);
LABEL (SHRS, TOTAL_SHARES_STR);
LABEL (BALN, BALN_STR);
LABEL (ACTN, ACTION_STR);
@@ -376,7 +376,7 @@ configLayout (SplitRegister *reg)
FANCY (NUM, num, 1, 0);
FANCY (DESC, desc, 2, 0);
FANCY (MXFRM, mxfrm, 3, 0);
BASIC (RECN, recn, 4, 0);
FANCY (RECN, recn, 4, 0);
FANCY (DEBT, debit, 5, 0);
FANCY (CRED, credit, 6, 0);
FANCY (BALN, balance, 7, 0);
@@ -389,7 +389,7 @@ configLayout (SplitRegister *reg)
FANCY (NUM, num, 1, 0);
FANCY (DESC, desc, 2, 0);
FANCY (XTO, xto, 3, 0);
BASIC (RECN, recn, 4, 0);
FANCY (RECN, recn, 4, 0);
FANCY (DEBT, debit, 5, 0);
FANCY (CRED, credit, 6, 0);
FANCY (BALN, balance, 7, 0);
@@ -406,7 +406,7 @@ configLayout (SplitRegister *reg)
FANCY (NUM, num, 1, 0);
FANCY (DESC, desc, 2, 0);
FANCY (MXFRM, mxfrm, 3, 0);
BASIC (RECN, recn, 4, 0);
FANCY (RECN, recn, 4, 0);
FANCY (DEBT, debit, 5, 0);
FANCY (CRED, credit, 6, 0);
FANCY (BALN, balance, 7, 0);
@@ -425,7 +425,7 @@ configLayout (SplitRegister *reg)
FANCY (DESC, desc, 2, 0);
FANCY (XTO, xto, 3, 0);
FANCY (MXFRM, mxfrm, 4, 0);
BASIC (RECN, recn, 5, 0);
FANCY (RECN, recn, 5, 0);
FANCY (DEBT, debit, 6, 0);
FANCY (CRED, credit, 7, 0);
@@ -438,7 +438,7 @@ configLayout (SplitRegister *reg)
FANCY (DESC, desc, 2, 0);
FANCY (XTO, mxfrm, 3, 0);
FANCY (XFRM, xto, 4, 0);
BASIC (RECN, recn, 5, 0);
FANCY (RECN, recn, 5, 0);
FANCY (DEBT, debit, 6, 0);
FANCY (CRED, credit, 7, 0);
@@ -455,7 +455,7 @@ configLayout (SplitRegister *reg)
FANCY (DESC, desc, 2, 0);
FANCY (XTO, xto, 3, 0);
FANCY (MXFRM, mxfrm, 4, 0);
BASIC (RECN, recn, 5, 0);
FANCY (RECN, recn, 5, 0);
FANCY (DEBT, debit, 6, 0);
FANCY (CRED, credit, 7, 0);
@@ -471,7 +471,7 @@ configLayout (SplitRegister *reg)
FANCY (NUM, num, 1, 0);
FANCY (DESC, desc, 2, 0);
FANCY (MXFRM, mxfrm, 3, 0);
BASIC (RECN, recn, 4, 0);
FANCY (RECN, recn, 4, 0);
FANCY (DEBT, debit, 5, 0);
FANCY (CRED, credit, 6, 0);
FANCY (PRIC, price, 7, 0);
@@ -487,7 +487,7 @@ configLayout (SplitRegister *reg)
FANCY (NUM, num, 1, 0);
FANCY (DESC, desc, 2, 0);
FANCY (XTO, xto, 3, 0);
BASIC (RECN, recn, 4, 0);
FANCY (RECN, recn, 4, 0);
FANCY (DEBT, debit, 5, 0);
FANCY (CRED, credit, 6, 0);
FANCY (PRIC, price, 7, 0);
@@ -507,7 +507,7 @@ configLayout (SplitRegister *reg)
FANCY (NUM, num, 1, 0);
FANCY (DESC, desc, 2, 0);
FANCY (MXFRM, mxfrm, 3, 0);
BASIC (RECN, recn, 4, 0);
FANCY (RECN, recn, 4, 0);
FANCY (DEBT, debit, 5, 0);
FANCY (CRED, credit, 6, 0);
FANCY (PRIC, price, 7, 0);
@@ -527,7 +527,7 @@ configLayout (SplitRegister *reg)
FANCY (DESC, desc, 2, 0);
FANCY (XTO, xto, 3, 0);
FANCY (MXFRM, mxfrm, 4, 0);
BASIC (RECN, recn, 5, 0);
FANCY (RECN, recn, 5, 0);
FANCY (DEBT, debit, 6, 0);
FANCY (CRED, credit, 7, 0);
FANCY (PRIC, price, 8, 0);
@@ -543,7 +543,7 @@ configLayout (SplitRegister *reg)
FANCY (DESC, desc, 2, 0);
FANCY (XTO, mxfrm, 3, 0);
FANCY (XFRM, xto, 4, 0);
BASIC (RECN, recn, 5, 0);
FANCY (RECN, recn, 5, 0);
FANCY (DEBT, debit, 6, 0);
FANCY (CRED, credit, 7, 0);
FANCY (PRIC, price, 8, 0);
@@ -563,7 +563,7 @@ configLayout (SplitRegister *reg)
FANCY (DESC, desc, 2, 0);
FANCY (XTO, xto, 3, 0);
FANCY (MXFRM, mxfrm, 4, 0);
BASIC (RECN, recn, 5, 0);
FANCY (RECN, recn, 5, 0);
FANCY (DEBT, debit, 6, 0);
FANCY (CRED, credit, 7, 0);
FANCY (PRIC, price, 8, 0);
@@ -600,7 +600,7 @@ configLayout (SplitRegister *reg)
i = prev_r; \
for (j=prev_c+1; j<curs->numCols; j++) { \
if ((reg->nullCell != curs->cells[i][j]) && \
(reg->recnCell != curs->cells[i][j]) && \
((BasicCell *) reg->recnCell != curs->cells[i][j]) && \
(XACC_CELL_ALLOW_INPUT & curs->cells[i][j]->input_output)) \
{ \
NEXT_RIGHT (i, j); \
@@ -609,7 +609,7 @@ configLayout (SplitRegister *reg)
for (i=prev_r+1; i<curs->numRows; i++) { \
for (j=0; j<curs->numCols; j++) { \
if ((reg->nullCell != curs->cells[i][j]) && \
(reg->recnCell != curs->cells[i][j]) && \
((BasicCell *) reg->recnCell != curs->cells[i][j]) && \
(XACC_CELL_ALLOW_INPUT & curs->cells[i][j]->input_output)) \
{ \
NEXT_RIGHT (i, j); \
@@ -623,7 +623,7 @@ configLayout (SplitRegister *reg)
i = r; \
for (j=c; j<curs->numCols; j++) { \
if ((reg->nullCell != curs->cells[i][j]) && \
(reg->recnCell != curs->cells[i][j]) && \
((BasicCell *) reg->recnCell != curs->cells[i][j]) && \
(XACC_CELL_ALLOW_INPUT & curs->cells[i][j]->input_output)) \
{ \
FIRST_RIGHT (i, j); \
@@ -637,7 +637,7 @@ configLayout (SplitRegister *reg)
i = r; \
for (j=c+1; j<curs->numCols; j++) { \
if ((reg->nullCell != curs->cells[i][j]) && \
(reg->recnCell != curs->cells[i][j]) && \
((BasicCell *) reg->recnCell != curs->cells[i][j]) && \
(XACC_CELL_ALLOW_INPUT & curs->cells[i][j]->input_output)) \
{ \
NEXT_RIGHT (i, j); \
@@ -655,7 +655,7 @@ configLayout (SplitRegister *reg)
i = 0; \
for (j=0; j<reg->split_cursor->numCols; j++) { \
if ((reg->nullCell != reg->split_cursor->cells[i][j]) && \
(reg->recnCell != reg->split_cursor->cells[i][j]) && \
((BasicCell *) reg->recnCell != reg->split_cursor->cells[i][j]) && \
(XACC_CELL_ALLOW_INPUT & reg->split_cursor->cells[i][j]->input_output)) \
{ \
NEXT_RIGHT (i+1, j); \
@@ -680,7 +680,7 @@ configLayout (SplitRegister *reg)
i = prev_r; \
for (j=prev_c -1; j>=0; j--) { \
if ((reg->nullCell != curs->cells[i][j]) && \
(reg->recnCell != curs->cells[i][j]) && \
((BasicCell *) reg->recnCell != curs->cells[i][j]) && \
(XACC_CELL_ALLOW_INPUT & curs->cells[i][j]->input_output)) \
{ \
NEXT_LEFT (i, j); \
@@ -689,7 +689,7 @@ configLayout (SplitRegister *reg)
for (i=prev_r-1; i>=0; i--) { \
for (j=curs->numCols-1; j>=0; j--) { \
if ((reg->nullCell != curs->cells[i][j]) && \
(reg->recnCell != curs->cells[i][j]) && \
((BasicCell *) reg->recnCell != curs->cells[i][j]) && \
(XACC_CELL_ALLOW_INPUT & curs->cells[i][j]->input_output)) \
{ \
NEXT_LEFT (i, j); \
@@ -702,7 +702,7 @@ configLayout (SplitRegister *reg)
i = r; \
for (j=c; j>=0; j--) { \
if ((reg->nullCell != curs->cells[i][j]) && \
(reg->recnCell != curs->cells[i][j]) && \
((BasicCell *) reg->recnCell != curs->cells[i][j]) && \
(XACC_CELL_ALLOW_INPUT & curs->cells[i][j]->input_output)) \
{ \
LAST_LEFT (i, j); \
@@ -715,7 +715,7 @@ configLayout (SplitRegister *reg)
i = r; \
for (j=c-1; j>=0; j--) { \
if ((reg->nullCell != curs->cells[i][j]) && \
(reg->recnCell != curs->cells[i][j]) && \
((BasicCell *) reg->recnCell != curs->cells[i][j]) && \
(XACC_CELL_ALLOW_INPUT & curs->cells[i][j]->input_output)) \
{ \
NEXT_LEFT (i, j); \
@@ -732,7 +732,7 @@ configLayout (SplitRegister *reg)
i = reg->split_cursor->numRows-1; \
for (j=reg->split_cursor->numCols-1; j>=0; j--) { \
if ((reg->nullCell != reg->split_cursor->cells[i][j]) && \
(reg->recnCell != reg->split_cursor->cells[i][j]) && \
((BasicCell *) reg->recnCell != reg->split_cursor->cells[i][j]) && \
(XACC_CELL_ALLOW_INPUT & reg->split_cursor->cells[i][j]->input_output)) \
{ \
NEXT_LEFT (i-1, j); \
@@ -1090,7 +1090,7 @@ xaccInitSplitRegister (SplitRegister *reg,
/* The reconcile cell should only be entered with the pointer,
* and only then when the user clicks directly on the cell.
*/
reg->recnCell->input_output |= XACC_CELL_ALLOW_EXACT_ONLY;
reg->recnCell->cell.input_output |= XACC_CELL_ALLOW_EXACT_ONLY;
/* Initialize price cells */
xaccSetPriceCellValue (reg->debitCell, 0.0);
@@ -1221,7 +1221,7 @@ xaccDestroySplitRegister (SplitRegister *reg)
xaccDestroyDateCell (reg->dateCell);
xaccDestroyNumCell (reg->numCell);
xaccDestroyQuickFillCell (reg->descCell);
xaccDestroyBasicCell (reg->recnCell);
xaccDestroyRecnCell (reg->recnCell);
xaccDestroyPriceCell (reg->shrsCell);
xaccDestroyPriceCell (reg->balanceCell);
@@ -1274,7 +1274,7 @@ xaccSplitRegisterGetChangeFlag (SplitRegister *reg)
changed |= MOD_DATE & reg->dateCell->cell.changed;
changed |= MOD_NUM & reg->numCell->cell.changed;
changed |= MOD_DESC & reg->descCell->cell.changed;
changed |= MOD_RECN & reg->recnCell->changed;
changed |= MOD_RECN & reg->recnCell->cell.changed;
changed |= MOD_ACTN & reg->actionCell->cell.changed;
changed |= MOD_XFRM & reg->xfrmCell->cell.changed;
@@ -1300,7 +1300,7 @@ xaccSplitRegisterClearChangeFlag (SplitRegister *reg)
reg->dateCell->cell.changed = 0;
reg->numCell->cell.changed = 0;
reg->descCell->cell.changed = 0;
reg->recnCell->changed = 0;
reg->recnCell->cell.changed = 0;
reg->actionCell->cell.changed = 0;
reg->xfrmCell->cell.changed = 0;
@@ -1652,7 +1652,7 @@ xaccSplitRegisterSaveCursor(SplitRegister *sr, SplitRegisterBuffer *srb)
saveCell(&sr->dateCell->cell, &srb->dateCell);
saveCell(&sr->numCell->cell, &srb->numCell);
saveCell(&sr->descCell->cell, &srb->descCell);
saveCell(sr->recnCell, &srb->recnCell);
saveCell(&sr->recnCell->cell, &srb->recnCell);
saveCell(&sr->shrsCell->cell, &srb->shrsCell);
saveCell(&sr->balanceCell->cell, &srb->balanceCell);
saveCell(&sr->actionCell->cell, &srb->actionCell);
@@ -1693,7 +1693,7 @@ xaccSplitRegisterRestoreCursorChanged(SplitRegister *sr,
restoreCellChanged(&sr->dateCell->cell, &srb->dateCell);
restoreCellChanged(&sr->numCell->cell, &srb->numCell);
restoreCellChanged(&sr->descCell->cell, &srb->descCell);
restoreCellChanged(sr->recnCell, &srb->recnCell);
restoreCellChanged(&sr->recnCell->cell, &srb->recnCell);
restoreCellChanged(&sr->shrsCell->cell, &srb->shrsCell);
restoreCellChanged(&sr->balanceCell->cell, &srb->balanceCell);
restoreCellChanged(&sr->actionCell->cell, &srb->actionCell);

View File

@@ -36,7 +36,7 @@
* The xaccConfigSplitRegister() subroutine allows the configuration
* of the register to be changed on the fly (dynamically). In particular,
* the register type, and/or the flags controlling the register display
* can be changed on the fly ...
* can be changed on the fly.
*
* DESIGN HOPES:
* Should probably move at least some of the layout to a config
@@ -56,6 +56,7 @@
#include "quickfillcell.h"
#include "pricecell.h"
#include "numcell.h"
#include "recncell.h"
#include "table-allgui.h"
/* defined register types */
@@ -175,7 +176,7 @@ struct _SplitRegister {
DateCell * dateCell;
NumCell * numCell;
QuickFillCell * descCell;
BasicCell * recnCell; /* main transaction line reconcile */
RecnCell * recnCell; /* main transaction line reconcile */
PriceCell * shrsCell;
PriceCell * balanceCell;
BasicCell * nullCell;

View File

@@ -22,35 +22,43 @@
(gnc:support "dateutils.scm")
(gnc:depend "srfi/srfi-19.scm")
(define (gnc:timepair->secs tp)
(inexact->exact
(+ (car tp)
(/ (cdr tp) 1000000000))))
(define (gnc:timepair->date tp)
(localtime (gnc:timepair->secs tp)))
;; get stuff from localtime date vector
(define (gnc:date-get-year datevec)
(+ 1900 (vector-ref datevec 5)))
(+ 1900 (tm:year datevec)))
(define (gnc:date-get-month-day datevec)
(vector-ref datevec 3))
(tm:mday datevec))
;; get month with january==1
(define (gnc:date-get-month datevec)
(+ (vector-ref datevec 4) 1))
(+ (tm:mon datevec) 1))
(define (gnc:date-get-week-day datevec)
(+ (vector-ref datevec 6) 1))
(+ (tm:wday datevec) 1))
;; jan 1 == 1
(define (gnc:date-get-year-day datevec)
(+ (vector-ref datevec 7) 1))
(+ (tm:yday datevec) 1))
(define (gnc:timepair-get-year tp)
(gnc:date-get-year (localtime (gnc:timepair->secs tp))))
(gnc:date-get-year (gnc:timepair->date tp)))
(define (gnc:timepair-get-month-day tp)
(gnc:date-get-month (localtime (gnc:timepair->secs tp))))
(gnc:date-get-month (gnc:timepair->date tp)))
(define (gnc:timepair-get-month tp)
(gnc:date-get-month (localtime (gnc:timepair->secs tp))))
(gnc:date-get-month (gnc:timepair->date tp)))
(define (gnc:timepair-get-week-day tp)
(gnc:date-get-week-day (localtime (gnc:timepair->secs tp))))
(gnc:date-get-week-day (gnc:timepair->date tp)))
(define (gnc:timepair-get-year-day tp)
(gnc:date-get-year-day (localtime (gnc:timepair->secs tp))))
(gnc:date-get-year-day (gnc:timepair->date tp)))
(define (gnc:date-get-month-string datevec)
(strftime "%B" datevec))
@@ -123,7 +131,7 @@
;; Modify a date
(define (moddate op adate delta)
(let ((newtm (localtime (car adate))))
(let ((newtm (gnc:timepair->date adate)))
(begin
(set-tm:sec newtm (op (tm:sec newtm) (tm:sec delta)))
(set-tm:min newtm (op (tm:min newtm) (tm:min delta)))
@@ -235,13 +243,6 @@
(set-tm:mon ddt 1)
ddt))
(define (gnc:timepair->secs tp)
(inexact->exact
(+ (car tp)
(/ (cdr tp) 1000000000))))
(define (gnc:timepair->date tp)
(localtime (gnc:timepair->secs tp)))
;; Find difference in seconds time 1 and time2
(define (gnc:timepair-delta t1 t2)
@@ -253,14 +254,14 @@
;;; Added from transaction-report.scm
(define (gnc:timepair-to-datestring tp)
(let ((bdtime (localtime (gnc:timepair->secs tp))))
(let ((bdtime (gnc:timepair->date tp)))
(strftime "%x" bdtime)))
;; given a timepair contains any time on a certain day (local time)
;; converts it to be midday that day.
(define (gnc:timepair-canonical-day-time tp)
(let ((bdt (localtime (gnc:timepair->secs tp))))
(let ((bdt (gnc:timepair->date tp)))
(set-tm:sec bdt 0)
(set-tm:min bdt 0)
(set-tm:hour bdt 12)
@@ -268,7 +269,7 @@
(cons newtime 0))))
(define (gnc:timepair-start-day-time tp)
(let ((bdt (localtime (gnc:timepair->secs tp))))
(let ((bdt (gnc:timepair->date tp)))
(set-tm:sec bdt 0)
(set-tm:min bdt 0)
(set-tm:hour bdt 0)
@@ -276,7 +277,7 @@
(cons newtime 0))))
(define (gnc:timepair-end-day-time tp)
(let ((bdt (localtime (gnc:timepair->secs tp))))
(let ((bdt (gnc:timepair->date tp)))
(set-tm:sec bdt 59)
(set-tm:min bdt 59)
(set-tm:hour bdt 23)

View File

@@ -527,8 +527,8 @@
(name (gnc:option-name option)))
(string-append
"(let ((option (gnc:lookup-option " options-string "\n"
" \"" section "\"\n"
" \"" name "\")))\n"
" " (gnc:value->string section) "\n"
" " (gnc:value->string name) ")))\n"
" (" restore-code " option))\n\n")))
(define (generate-forms port)

View File

@@ -1,5 +1,6 @@
(
("Hello World" "I'm a teapot")
("Hi there" "Yoo hoo!")
("Misc Tips" "Yes, it's me!!")
("The GnuCash online manual has a lot of helpful information."
"You can access the manual under the Help menu.")
("GnuCash does not use categories like Quicken."
"Instead, you should use Income and Expense accounts.")
)

View File

@@ -100,11 +100,11 @@
(gnc:read-tips)
(let ((tip-opt (gnc:lookup-global-option "General"
"Display \"Tip of the Day\"")))
(if (gnc:option-value tip-opt)
(let ((mainopen-hook (gnc:hook-lookup 'main-window-opened-hook)))
(gnc:hook-add-dangler
mainopen-hook
(lambda (window)
(gnc:ui-totd-dialog-create-and-run))))))
(let ((mainopen-hook (gnc:hook-lookup 'main-window-opened-hook)))
(gnc:hook-add-dangler
mainopen-hook
(lambda (window)
(let ((tip-opt (gnc:lookup-global-option "General"
"Display \"Tip of the Day\"")))
(if (gnc:option-value tip-opt)
(gnc:ui-totd-dialog-create-and-run))))))