mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
*** empty log message ***
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@2522 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
ff6f0c4b41
commit
cd29cf5d47
1
AUTHORS
1
AUTHORS
@ -58,6 +58,7 @@ Bob Drzyzgula <bob@mostly.com> for budgeting design notes
|
||||
Paul Fenwick <pjf@schools.net.au> ASX support
|
||||
Hubert Figuiere <hfiguiere@teaser.fr> patch to gnc-prices
|
||||
Jan-Uwe Finck <ju_finck@mail.netwave.de> for German message translation
|
||||
Kevin Finn <kevinfinn@mediaone.net> auto-decimal point patch
|
||||
Ron Forrester <rjf@aracnet.com> for gnome patches
|
||||
Dave Freese <DFreese@osc.uscg.mil> for leap-year fix
|
||||
John Goerzen <jgoerzen@complete.org> file i/o fix for 64-bit architectures
|
||||
|
@ -1,3 +1,9 @@
|
||||
2000-06-28 Robert Graham Merkel <rgmerk@mira.net>
|
||||
|
||||
* src/gnome/dialog-totd.c: If somebody tries to open a second
|
||||
tip of the day window, just raise the original. Fixes a crash
|
||||
when somebody tried to do this before.
|
||||
|
||||
2000-06-27 Robert Graham Merkel <rgmerk@mira.net>
|
||||
|
||||
* src/gnome/dialog-totd.c: Added code to make "Tip of the day"
|
||||
|
@ -315,6 +315,10 @@
|
||||
|
||||
<dd>for German message translation</dd>
|
||||
|
||||
<dt><a href="mailto:kevinfinn@mediaone.net">Kevin Finn</a></dt>
|
||||
|
||||
<dd>auto-decimal point patch</dd>
|
||||
|
||||
<dt><a href="mailto:rjf@aracnet.com">Ron Forrester</a></dt>
|
||||
|
||||
<dd>for gnome patches</dd>
|
||||
|
@ -6,7 +6,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"POT-Creation-Date: 2000-06-26 23:00-0700\n"
|
||||
"POT-Creation-Date: 2000-06-27 21:56-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"
|
||||
@ -285,7 +285,7 @@ msgstr ""
|
||||
#: messages-i18n.c:54
|
||||
msgid ""
|
||||
"You have disabled \"Tip of the Day\"\n"
|
||||
"You can re-enable them from the General\n"
|
||||
"You can re-enable tips from the General\n"
|
||||
"section of the Preferences menu"
|
||||
msgstr ""
|
||||
|
||||
|
@ -579,6 +579,7 @@ xaccTransLookup (const GUID *guid)
|
||||
void
|
||||
xaccSplitSetBaseValue (Split *s, double value, const char * base_currency)
|
||||
{
|
||||
int adjust_price = 0;
|
||||
if (!s) return;
|
||||
|
||||
MARK_SPLIT(s);
|
||||
@ -592,7 +593,8 @@ xaccSplitSetBaseValue (Split *s, double value, const char * base_currency)
|
||||
if (force_double_entry) {
|
||||
PERR ("split must have a parent\n");
|
||||
assert (s->acc);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
/* if there's already a share-amount set, we need to respect
|
||||
* that and adjust the price to make this balance. */
|
||||
if (!DEQEPS(s->damount, 0.0, ZERO_THRESH_VALUE)) {
|
||||
@ -605,33 +607,41 @@ xaccSplitSetBaseValue (Split *s, double value, const char * base_currency)
|
||||
}
|
||||
}
|
||||
|
||||
if(s->acc &&
|
||||
s->acc->security &&
|
||||
safe_strcmp(s->acc->security, s->acc->currency) &&
|
||||
!DEQEPS(s->damount, 0.0, ZERO_THRESH_VALUE)) {
|
||||
adjust_price = 1;
|
||||
}
|
||||
|
||||
/* The value of a split depends on the currency we express the
|
||||
* value in. This may or may not require a divide.
|
||||
*/
|
||||
if (!safe_strcmp(s->acc->currency, base_currency)) {
|
||||
if (!DEQEPS(s->damount, 0.0, ZERO_THRESH_VALUE)) {
|
||||
if (adjust_price) {
|
||||
DEVIDE(s->share_price, value, s->damount);
|
||||
}
|
||||
else {
|
||||
DEVIDE(s->damount, value, s->share_price);
|
||||
}
|
||||
} else
|
||||
if (!safe_strcmp(s->acc->security, base_currency)) {
|
||||
s->damount = value;
|
||||
} else
|
||||
if ((0x0==base_currency) && (0 == force_double_entry)) {
|
||||
if (!DEQEPS(s->damount, 0.0, ZERO_THRESH_VALUE)) {
|
||||
}
|
||||
else if (!safe_strcmp(s->acc->security, base_currency)) {
|
||||
s->damount = value;
|
||||
s->share_price = 1.0;
|
||||
}
|
||||
else if ((0x0==base_currency) && (0 == force_double_entry)) {
|
||||
if (adjust_price) {
|
||||
DEVIDE(s->share_price, value, s->damount);
|
||||
}
|
||||
else {
|
||||
DEVIDE(s->damount, value, s->share_price);
|
||||
}
|
||||
} else
|
||||
{
|
||||
PERR ("inappropriate base currency %s "
|
||||
"given split currency=%s and security=%s\n",
|
||||
base_currency, s->acc->currency, s->acc->security);
|
||||
return;
|
||||
}
|
||||
else {
|
||||
PERR ("inappropriate base currency %s "
|
||||
"given split currency=%s and security=%s\n",
|
||||
base_currency, s->acc->currency, s->acc->security);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -59,6 +59,9 @@ gncLogLevel loglevel[MOD_NUM] =
|
||||
GNC_LOG_WARNING, /* QUERY */
|
||||
};
|
||||
|
||||
/* xaccParseAmount configuration */
|
||||
gncBoolean auto_decimal_enabled;
|
||||
|
||||
/* Set the logging level of the given module. */
|
||||
void
|
||||
gnc_set_log_level(gncModuleType module, gncLogLevel level)
|
||||
@ -926,6 +929,17 @@ double xaccParseAmount (const char * instr, gncBoolean monetary)
|
||||
}
|
||||
}
|
||||
|
||||
} else if( auto_decimal_enabled ) {
|
||||
/* no decimal point and auto decimal point enabled, so assume that
|
||||
* the value is an integer number of cents.
|
||||
*/
|
||||
amount += ((double) (atoi (str)));
|
||||
amount *= 0.01; /* temporarily assume two decimal points */
|
||||
|
||||
/* Note: further additions to amount after this point will
|
||||
* generate incorrect results.
|
||||
*/
|
||||
|
||||
} else {
|
||||
amount += ((double) (atoi (str)));
|
||||
}
|
||||
|
@ -263,6 +263,9 @@ char * xaccPrintAmountArgs (double val,
|
||||
/* Parse i18n amount strings */
|
||||
double xaccParseAmount (const char * instr, gncBoolean monetary);
|
||||
|
||||
/* Affects parsing of numerical amounts in xaccParseAmount */
|
||||
extern gncBoolean auto_decimal_enabled;
|
||||
|
||||
|
||||
/** TEMPLATES ******************************************************/
|
||||
/*
|
||||
|
@ -68,8 +68,15 @@ static void totd_close_cb(GtkWidget *widget, gpointer data);
|
||||
|
||||
void gnc_ui_totd_dialog_create_and_run(void)
|
||||
{
|
||||
gnc_ui_totd_dialog_create();
|
||||
gtk_widget_show_all(win);
|
||||
if(win == NULL)
|
||||
{
|
||||
gnc_ui_totd_dialog_create();
|
||||
gtk_widget_show_all(win);
|
||||
}
|
||||
else
|
||||
{
|
||||
gdk_window_raise(win->window);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@ -158,6 +165,7 @@ totd_close_cb(GtkWidget *widget, gpointer data)
|
||||
{
|
||||
gboolean new_enabled = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(disable_cb));
|
||||
gtk_widget_destroy(GTK_WIDGET(win));
|
||||
win = NULL;
|
||||
if(new_enabled != old_enabled)
|
||||
{
|
||||
gnc_set_boolean_option("General",
|
||||
|
@ -73,6 +73,8 @@ static void gnc_configure_reverse_balance(void);
|
||||
static void gnc_configure_sr_label_callbacks();
|
||||
static void gnc_configure_auto_raise_cb(void *);
|
||||
static void gnc_configure_auto_raise(void);
|
||||
static void gnc_configure_auto_decimal_cb(void *);
|
||||
static void gnc_configure_auto_decimal(void);
|
||||
|
||||
/** GLOBALS *********************************************************/
|
||||
/* This static indicates the debugging module that this .o belongs to. */
|
||||
@ -91,6 +93,8 @@ static SCM register_colors_callback_id = SCM_UNDEFINED;
|
||||
static SCM register_borders_callback_id = SCM_UNDEFINED;
|
||||
static SCM reverse_balance_callback_id = SCM_UNDEFINED;
|
||||
static SCM auto_raise_callback_id = SCM_UNDEFINED;
|
||||
static SCM auto_decimal_callback_id = SCM_UNDEFINED;
|
||||
|
||||
|
||||
/* ============================================================== */
|
||||
|
||||
@ -181,6 +185,12 @@ gnucash_ui_init()
|
||||
NULL, "Register",
|
||||
"Auto-Raise Lists");
|
||||
|
||||
gnc_configure_auto_decimal();
|
||||
auto_decimal_callback_id =
|
||||
gnc_register_option_change_callback(gnc_configure_auto_decimal_cb,
|
||||
NULL, "General",
|
||||
"Automatic Decimal Point");
|
||||
|
||||
gnc_configure_sr_label_callbacks();
|
||||
|
||||
xaccRecnCellSetStringGetter(gnc_get_reconcile_str);
|
||||
@ -722,4 +732,36 @@ gnc_configure_reverse_balance(void)
|
||||
free(choice);
|
||||
}
|
||||
|
||||
/* gnc_configure_auto_decimal_cb
|
||||
* Callback called when options change -
|
||||
* sets auto decimal option and refreshes the UI
|
||||
*
|
||||
* Args: Nothing
|
||||
* Returns: Nothing
|
||||
*/
|
||||
|
||||
static void
|
||||
gnc_configure_auto_decimal_cb(void *not_used)
|
||||
{
|
||||
gnc_configure_auto_decimal();
|
||||
gnc_group_ui_refresh(gncGetCurrentGroup());
|
||||
}
|
||||
|
||||
/* gnc_configure_auto_decimal
|
||||
* Setup the global value of the auto decimal field.
|
||||
*
|
||||
* Args: Nothing
|
||||
* Returns: Nothing
|
||||
*/
|
||||
static void
|
||||
gnc_configure_auto_decimal(void)
|
||||
{
|
||||
auto_decimal_enabled =
|
||||
(gncBoolean) gnc_lookup_boolean_option("General",
|
||||
"Automatic Decimal Point",
|
||||
GNC_F);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/****************** END OF FILE **********************/
|
||||
|
@ -141,7 +141,7 @@
|
||||
"Do you want do continue?")
|
||||
|
||||
#define REENABLE_TIPS_MSG _("You have disabled \"Tip of the Day\"\n" \
|
||||
"You can re-enable them from the General\n" \
|
||||
"You can re-enable tips from the General\n" \
|
||||
"section of the Preferences menu")
|
||||
#define REG_CURR_MSG _("You cannot transfer funds from the %s " \
|
||||
"account.\nIt does not have a matching " \
|
||||
|
@ -388,6 +388,11 @@ the account instead of opening a register." #f))
|
||||
"General" "Display \"Tip of the Day\""
|
||||
"f" "Display hints for using GnuCash at startup" #t))
|
||||
|
||||
(gnc:register-configuration-option
|
||||
(gnc:make-simple-boolean-option
|
||||
"General" "Automatic Decimal Point"
|
||||
"g" "Automatically insert a decimal point into values that are entered without one. Example: '2000' is changed to '20.00'." #f))
|
||||
|
||||
;(gnc:register-configuration-option
|
||||
; (gnc:make-number-range-option
|
||||
; "General" "Default precision"
|
||||
|
@ -3,4 +3,11 @@
|
||||
"You can access the manual under the Help menu.")
|
||||
("GnuCash does not use categories like Quicken."
|
||||
"Instead, you should use Income and Expense accounts.")
|
||||
("In the reconcile window, you can press the spacebar"
|
||||
"to mark transactions as reconciled."
|
||||
"You can also press Tab and Shift-Tab to move between"
|
||||
"deposits and withdrawals.")
|
||||
("When entering check numbers in the register, you can"
|
||||
"press '+' to enter the next number. You can use '+'"
|
||||
"and '-' to increment and decrement the number, respectively.")
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user