* src/gnome/dialog-totd.c (totd_close_cb): increment tip on

close so we open with the next one

	* src/scm/tip-of-the-day.scm: make current tip number a preference
	so it is saved and restored

	* src/gnome/druid-commodity.c: same as below

	* src/gnome/druid-qif-import.c: same as below

	* src/gnome/dialog-commodity.c: prevent user from creating
	a new iso commodity

	* src/gnome/gnc-html.c: set busy cursor on html widget
	while request is being processed

	* src/gnome/window-main.c: hierarchy not heirarchy

	* src/gnome/window-help.c: specify the help window as the
	request dialog parent

	* doc/sgml/C/xacc-dochack.sgml: remove and fix broken links

	* src/engine/io-gncxml-r.c (gnc_is_xml_data_file): don't print
	a warning just because we couldn't open the file


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@3777 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Dave Peticolas
2001-03-14 11:24:56 +00:00
parent 859a6da3af
commit b822036c82
16 changed files with 230 additions and 112 deletions

View File

@@ -1,5 +1,39 @@
2001-03-14 Dave Peticolas <dave@krondo.com>
* src/gnome/dialog-totd.c (totd_close_cb): increment tip on
close so we open with the next one
* src/scm/tip-of-the-day.scm: make current tip number a preference
so it is saved and restored
* src/gnome/druid-commodity.c: same as below
* src/gnome/druid-qif-import.c: same as below
* src/gnome/dialog-commodity.c: prevent user from creating
a new iso commodity
* src/gnome/gnc-html.c: set busy cursor on html widget
while request is being processed
* src/gnome/window-main.c: hierarchy not heirarchy
* src/gnome/window-help.c: specify the help window as the
request dialog parent
* doc/sgml/C/xacc-dochack.sgml: remove and fix broken links
2001-03-13 Dave Peticolas <dave@krondo.com>
* src/engine/io-gncxml-r.c (gnc_is_xml_data_file): don't print
a warning just because we couldn't open the file
* src/FileDialog.c (gncPostFileOpen): clear the non-iso
commodities before loading the new file
* src/SplitLedger.c (xaccSRGetEntryHandler): convert imbalance
to transaction currency fraction
* src/FileDialog.c (gncFileNew): clear the non-iso commodities
* src/engine/gnc-commodity.c (gnc_commodity_table_remove_non_iso):

View File

@@ -27,10 +27,6 @@ The Definitive Guide (online)</ULINK>
</PARA>
</LISTITEM>
<LISTITEM> <PARA> <ULINK URL=
"http://www.oasis-open.com/davenport/dbdoc/">References for the
DocBook DTD </ULINK> </PARA> </LISTITEM>
<LISTITEM> <PARA><ULINK URL=
"http://www.oasis-open.org/docbook/documentation/index.html"> DocBook
- Documentation</ULINK></PARA> </LISTITEM>
@@ -41,19 +37,19 @@ DocBook</ULINK></PARA>
</LISTITEM>
<LISTITEM>
<PARA> <ULINK URL="http://fallout.campusview.indiana.edu/~jfieber/docbook/doc/over/index.html"> DocBook
<PARA> <ULINK URL="http://ella.slis.indiana.edu/~jfieber/docbook/doc/over/index.html"> DocBook
Overview </ULINK> </PARA>
</LISTITEM>
<LISTITEM>
<PARA> <ULINK URL="http://fallout.campusview.indiana.edu/~jfieber/docbook/doc/user/index.html"> DocBook User
<PARA> <ULINK URL="http://ella.slis.indiana.edu/~jfieber/docbook/doc/user/index.html"> DocBook User
Guide </ULINK> </PARA>
</LISTITEM>
<LISTITEM>
<PARA> <ULINK URL="http://fallout.campusview.indiana.edu/~jfieber/docbook/doc/ref/index.html"> DocBook
<PARA> <ULINK URL="http://ella.slis.indiana.edu/~jfieber/docbook/doc/ref/index.html"> DocBook
Reference Guide </ULINK> </PARA>
</LISTITEM>
<LISTITEM>
<PARA> <ULINK URL="http://fallout.campusview.indiana.edu/~jfieber/docbook/doc/maint/index.html">DocBook
<PARA> <ULINK URL="http://ella.slis.indiana.edu/~jfieber/docbook/doc/maint/index.html">DocBook
Customization Guide </ULINK> </PARA>
</LISTITEM>
<LISTITEM ID="MODULARDOCBOOK">
@@ -63,17 +59,13 @@ Modular DocBook Stylesheets </ULINK> </PARA>
<LISTITEM>
<PARA><ULINK URL="http://nwalsh.com/docbook/edbsyn/"> The
nwalsh.com Home Page - Extended DocBook Synopses </ULINK>
</PARA>
<PARA> Adds tags for DocBook to support object oriented languages like
Java, C++, and IDL, including such new entities as classes, fields,
methods, exceptions, and so forth...
methods, exceptions, and so forth.
</PARA>
</LISTITEM>
<LISTITEM>
<PARA> <ULINK URL="http://nwalsh.com/docbook/qr/quickref.htm"> DocBook V3.0 Quick
Reference </ULINK> </PARA>
</LISTITEM>
<LISTITEM>
<PARA> <ULINK URL="http://nis-www.lanl.gov/~rosalia/mydocs/docbook-intro.html"> Get
@@ -86,16 +78,7 @@ of graphics, and more information on ``interesting'' crossreferencing.</PARA>
</LISTITEM>
<LISTITEM>
<PARA><ULINK URL="http://lwn.net/2000/features/DocBook/">Exploring SGML DocBook </ULINK>
</PARA>
</LISTITEM>
<LISTITEM>
<PARA> <ULINK URL="http://itrc.uwaterloo.ca/~papresco/SgmlTools/demo.html"> DocBook
SGMLTOOLS demo </ULINK> </PARA>
</LISTITEM>
<LISTITEM>
<PARA> <ULINK URL="http://nwalsh.com/docbook/nutshell.html">DocBook in a Nutshell </ULINK></PARA>
</LISTITEM>
<LISTITEM> <PARA><ULINK URL=
@@ -106,10 +89,6 @@ DFW Unix User's Group
</PARA>
</LISTITEM>
<LISTITEM>
<PARA><ULINK URL="http://www.freebsd.org/%7enik/primer/index.html"> FreeBSD Documentation
Project Primer for New Contributors (SGMLTools)</ULINK> </PARA>
</LISTITEM>
<LISTITEM>
<PARA><ULINK URL="http://www.sslug.dk/%7epto/docbook.html">Getting started with SGMLTOOLS and DOCBOOK</ULINK></PARA>
</LISTITEM>
</ITEMIZEDLIST> </PARA>

View File

@@ -170,7 +170,7 @@ gncCreateFailHandler (const char *file)
{
const char *format = _("The database\n"
" %s\n"
"doesn't seem to exist. Do you want to create it?\n");
"doesn't seem to exist. Do you want to create it?\n");
char *message;
gboolean result;
@@ -300,6 +300,8 @@ gncPostFileOpen (const char * filename)
gnc_book_destroy (current_book);
current_book = NULL;
gnc_commodity_table_remove_non_iso (gnc_engine_commodities ());
/* load the accounts from the users datafile */
/* but first, check to make sure we've got a book going. */
new_book = gnc_book_new ();

View File

@@ -3600,6 +3600,7 @@ xaccSRGetEntryHandler (VirtualLocation virt_loc,
if (split == NULL)
{
gnc_numeric imbalance;
gnc_commodity *currency;
trans = xaccSRGetTrans (reg, virt_loc.vcell_loc);
imbalance = xaccTransGetImbalance (trans);
@@ -3624,6 +3625,14 @@ xaccSRGetEntryHandler (VirtualLocation virt_loc,
imbalance = gnc_numeric_abs (imbalance);
currency = xaccTransGetCurrency (trans);
if (!currency)
currency = gnc_locale_default_currency ();
imbalance = gnc_numeric_convert (imbalance,
gnc_commodity_get_fraction (currency),
GNC_RND_ROUND);
return xaccPrintAmount (imbalance,
gnc_split_value_print_info (split, FALSE));
break;

View File

@@ -360,7 +360,8 @@ gnc_is_xml_data_file(const gchar *filename)
g_return_val_if_fail(filename, result);
f = fopen(filename, "r");
g_return_val_if_fail(f, result);
if (!f)
return result;
num_read = fread(first_chunk, sizeof(char), sizeof(first_chunk) - 1, f);
if(num_read == 0) goto cleanup_and_exit;

View File

@@ -31,6 +31,7 @@
#include "window-help.h"
#include "FileDialog.h"
#include "query-user.h"
#include "gnc-engine-util.h"
#include "gnc-ui.h"
@@ -142,7 +143,8 @@ gnc_ui_select_commodity_create(const gnc_commodity * orig_sel,
/* build the menus of namespaces and commodities */
namespace =
gnc_ui_update_namespace_picker(retval->namespace_combo,
gnc_commodity_get_namespace(orig_sel));
gnc_commodity_get_namespace(orig_sel),
TRUE, FALSE);
gnc_ui_update_commodity_picker(retval->commodity_combo, namespace,
gnc_commodity_get_printname(orig_sel));
g_free(namespace);
@@ -253,20 +255,21 @@ gnc_ui_select_commodity_new_cb(GtkButton * button,
GtkWidget * dialog = GTK_WIDGET(user_data);
SelectCommodityWindow * w =
gtk_object_get_data(GTK_OBJECT(dialog), "select_commodity_struct");
char * namespace =
gtk_entry_get_text(GTK_ENTRY(w->namespace_entry));
const gnc_commodity * new_commodity =
gnc_ui_new_commodity_modal(namespace, dialog);
if(new_commodity) {
char *namespace;
namespace =
gnc_ui_update_namespace_picker(w->namespace_combo,
gnc_commodity_get_namespace
(new_commodity));
(new_commodity),
TRUE, FALSE);
g_free(namespace);
gnc_ui_update_commodity_picker(w->commodity_combo,
gnc_commodity_get_namespace(new_commodity),
@@ -314,27 +317,65 @@ gnc_ui_select_commodity_namespace_changed_cb(GtkEditable * entry,
* gnc_ui_update_namespace_picker
********************************************************************/
char *
gnc_ui_update_namespace_picker(GtkWidget * combobox,
const char * init_string) {
const char * init_string,
gboolean include_iso,
gboolean include_all) {
GList * namespaces;
char * active;
/* fetch a list of the namespaces */
namespaces = gnc_commodity_table_get_namespaces(gnc_engine_commodities());
if (!include_all)
namespaces = gnc_commodity_table_get_namespaces(gnc_engine_commodities());
else
{
namespaces = NULL;
namespaces = g_list_prepend (namespaces, GNC_COMMODITY_NS_ISO);
namespaces = g_list_prepend (namespaces, GNC_COMMODITY_NS_NASDAQ);
namespaces = g_list_prepend (namespaces, GNC_COMMODITY_NS_NYSE);
namespaces = g_list_prepend (namespaces, GNC_COMMODITY_NS_EUREX);
namespaces = g_list_prepend (namespaces, GNC_COMMODITY_NS_MUTUAL);
namespaces = g_list_prepend (namespaces, GNC_COMMODITY_NS_AMEX);
}
namespaces = g_list_sort(namespaces, g_strcmp);
{
GList *node;
node = g_list_find_custom (namespaces, GNC_COMMODITY_NS_ISO, g_strcmp);
if (node && !include_iso)
{
namespaces = g_list_remove_link (namespaces, node);
g_list_free_1 (node);
}
node = g_list_find_custom (namespaces, GNC_COMMODITY_NS_LEGACY, g_strcmp);
if (node)
{
namespaces = g_list_remove_link (namespaces, node);
g_list_free_1 (node);
}
}
/* stick them in the combobox */
gtk_combo_set_popdown_strings(GTK_COMBO(combobox), namespaces);
if (!include_iso &&
safe_strcmp (init_string, GNC_COMMODITY_NS_ISO) == 0)
init_string = NULL;
/* set the entry text */
if(init_string) {
active = g_strdup(init_string);
}
else {
else if (namespaces) {
active = g_strdup(namespaces->data);
}
}
else
active = g_strdup("");
gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(combobox)->entry), active);
g_list_free(namespaces);
@@ -390,7 +431,8 @@ gnc_ui_new_commodity_create(const char * selected_namespace,
GTK_SIGNAL_FUNC(new_commodity_close), retval);
namespace = gnc_ui_update_namespace_picker(retval->namespace_combo,
selected_namespace);
selected_namespace,
FALSE, TRUE);
g_free(namespace);
return retval;
@@ -454,6 +496,14 @@ gnc_ui_new_commodity_ok_cb(GtkButton * button,
gnc_commodity * c;
if (safe_strcmp (namespace, GNC_COMMODITY_NS_ISO) == 0)
{
gnc_warning_dialog_parented(dialog,
_("You may not create a new ISO4217 "
"commodity."));
return;
}
if(fullname && fullname[0] &&
namespace && namespace[0] &&
mnemonic && mnemonic[0]) {

View File

@@ -46,7 +46,11 @@ gnc_commodity *
gnc_ui_new_commodity_modal(const char * default_namespace,
GtkWidget * parent);
char * gnc_ui_update_namespace_picker(GtkWidget * combobox, const char * sel);
char * gnc_ui_update_namespace_picker(GtkWidget * combobox,
const char * sel,
gboolean include_iso,
gboolean include_all);
void gnc_ui_update_commodity_picker(GtkWidget * combobox,
const char * namespace,
const char * sel);

View File

@@ -26,12 +26,12 @@
#include <gnome.h>
#include "global-options.h"
#include "query-user.h"
#include "messages.h"
#include "tip-of-the-day.h"
#include "dialog-totd.h"
#include "global-options.h"
#include "gnc-ui.h"
#include "messages.h"
#include "query-user.h"
#include "tip-of-the-day.h"
/* This static indicates the debugging module that this .o belongs to. */
@@ -85,7 +85,8 @@ static GtkWidget *
gnc_ui_totd_dialog_create(void)
{
char *new_hint;
win = gnome_dialog_new(_("Tip of the Day:"),
win = gnome_dialog_new(_("Tip of the Day"),
GNOME_STOCK_BUTTON_PREV,
GNOME_STOCK_BUTTON_NEXT,
GNOME_STOCK_BUTTON_CLOSE,
@@ -171,6 +172,8 @@ totd_close_cb(GtkWidget *widget, gpointer data)
gboolean new_enabled =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(disable_cb));
gnc_increment_tip();
gtk_widget_destroy(GTK_WIDGET(win));
win = NULL;
if (new_enabled != old_enabled)

View File

@@ -245,7 +245,7 @@ make_commodity_druid_page(gnc_commodity * comm) {
"national currencies, \nuse \"ISO4217\". "
"Enter a new type in the box if the ones in the\n"
"pick list are inappropriate."));
gtk_label_set_justify (GTK_LABEL(info_label), GTK_JUSTIFY_LEFT);
gtk_box_pack_start(GTK_BOX(top_vbox), info_label, TRUE, TRUE, 0);
@@ -257,7 +257,8 @@ make_commodity_druid_page(gnc_commodity * comm) {
retval->new_type_entry = (GTK_COMBO(retval->new_type_combo))->entry;
gnc_ui_update_namespace_picker(retval->new_type_combo,
gnc_commodity_get_namespace(comm));
gnc_commodity_get_namespace(comm),
TRUE, TRUE);
temp = gtk_hbox_new(FALSE, 0);
gtk_box_pack_start(GTK_BOX(top_vbox), temp, FALSE, FALSE, 5);
@@ -383,21 +384,33 @@ gnc_ui_commodity_druid_comm_check_cb(GnomeDruidPage * page, gpointer druid,
if((strlen(new_type) == 0) ||
(strlen(new_name) == 0) ||
(strlen(new_mnemonic) == 0)) {
gnc_warning_dialog(_("You must put values for the type, name,\n"
"and abbreviation of the currency/stock."));
gnc_warning_dialog_parented(cd->window,
_("You must put values for the type, name,\n"
"and abbreviation of the currency/stock."));
return TRUE;
}
else {
new_comm = g_hash_table_lookup(cd->new_map, dpage->old_name);
assert(new_comm);
/* fill in the commodity structure info */
gnc_commodity_set_fullname(new_comm, new_name);
gnc_commodity_set_namespace(new_comm, new_type);
gnc_commodity_set_mnemonic(new_comm, new_mnemonic);
return FALSE;
if (safe_strcmp (new_type, GNC_COMMODITY_NS_ISO) == 0 &&
!gnc_commodity_table_lookup (gnc_engine_commodities (),
new_type, new_mnemonic))
{
gnc_warning_dialog_parented(cd->window,
_("You must enter an existing ISO4217 "
"currency or enter a different type."));
return TRUE;
}
new_comm = g_hash_table_lookup(cd->new_map, dpage->old_name);
assert(new_comm);
/* fill in the commodity structure info */
gnc_commodity_set_fullname(new_comm, new_name);
gnc_commodity_set_namespace(new_comm, new_type);
gnc_commodity_set_mnemonic(new_comm, new_mnemonic);
return FALSE;
}
static void

View File

@@ -26,26 +26,26 @@
#include "config.h"
#include <gnome.h>
#include <guile/gh.h>
#include <stdio.h>
#include <sys/time.h>
#include <unistd.h>
#include <guile/gh.h>
#include "druid-qif-import.h"
#include "Account.h"
#include "FileBox.h"
#include "FileDialog.h"
#include "dialog-account-picker.h"
#include "dialog-commodity.h"
#include "global-options.h"
#include "window-help.h"
#include "messages.h"
#include "gnc-ui.h"
#include "Account.h"
#include "FileDialog.h"
#include "FileBox.h"
#include "dialog-utils.h"
#include "query-user.h"
#include "druid-qif-import.h"
#include "global-options.h"
#include "gnc-component-manager.h"
#include "gnc-engine-util.h"
#include "gnc-ui-util.h"
#include "gnc-ui.h"
#include "messages.h"
#include "query-user.h"
#include "window-help.h"
#include <g-wrap-runtime-guile.h>
@@ -887,7 +887,8 @@ gnc_ui_qif_import_default_acct_next_cb(GnomeDruidPage * page,
SCM scm_name;
if(!acct_name || acct_name[0] == 0) {
gnc_warning_dialog(_("You must enter an account name."));
gnc_warning_dialog_parented(wind->window,
_("You must enter an account name."));
return TRUE;
}
else {
@@ -1435,18 +1436,32 @@ gnc_ui_qif_import_comm_check_cb(GnomeDruidPage * page,
int show_matches;
if(!namespace || (namespace[0] == 0)) {
gnc_warning_dialog(_("You must enter a Type for the commodity."));
gnc_warning_dialog_parented(wind->window,
_("You must enter a Type for the commodity."));
return TRUE;
}
else if(!name || (name[0] == 0)) {
gnc_warning_dialog(_("You must enter a name for the commodity."));
gnc_warning_dialog_parented(wind->window,
_("You must enter a name for the commodity."));
return TRUE;
}
else if(!mnemonic || (mnemonic[0] == 0)) {
gnc_warning_dialog(_("You must enter an abbreviation for the commodity."));
gnc_warning_dialog_parented
(wind->window, _("You must enter an abbreviation for the commodity."));
return TRUE;
}
if (safe_strcmp (namespace, GNC_COMMODITY_NS_ISO) == 0 &&
!gnc_commodity_table_lookup (gnc_engine_commodities (),
namespace, mnemonic))
{
gnc_warning_dialog_parented(wind->window,
_("You must enter an existing ISO4217 "
"currency or enter a different type."));
return TRUE;
}
if(page == (g_list_last(wind->commodity_pages))->data) {
/* it's time to import the accounts. */
show_matches = gnc_ui_qif_import_convert(wind);
@@ -1600,8 +1615,9 @@ make_qif_druid_page(gnc_commodity * comm) {
retval->new_type_entry = (GTK_COMBO(retval->new_type_combo))->entry;
gnc_ui_update_namespace_picker(retval->new_type_combo,
gnc_commodity_get_namespace(comm));
gnc_commodity_get_namespace(comm),
TRUE, TRUE);
info_label =
gtk_label_new(_("Enter the full name of the commodity, "
"such as \"Red Hat Stock\""));

View File

@@ -357,7 +357,7 @@ gnc_html_http_request_cb(const gchar * uri, int completed_ok,
GList * current;
handles = g_hash_table_lookup(html->request_info, uri);
/* handles will be NULL for an HTTP POST transaction, where we are
* displaying the reply data. */
if(!handles) {
@@ -407,6 +407,8 @@ gnc_html_http_request_cb(const gchar * uri, int completed_ok,
g_hash_table_remove(html->request_info, uri);
}
}
gnc_unset_busy_cursor (html->html);
}
@@ -434,6 +436,7 @@ gnc_html_start_request(gnc_html * html, gchar * uri, GtkHTMLStream * handle) {
if(need_request) {
gnc_http_start_request(html->http, uri, gnc_html_http_request_cb,
(gpointer)html);
gnc_set_busy_cursor (html->html);
}
}
@@ -668,7 +671,6 @@ gnc_html_set_base_cb(GtkHTML * gtkhtml, const gchar * base,
html->base_type = type;
html->base_location = location;
}

View File

@@ -242,9 +242,9 @@ gnc_help_window_goto_button_cb(GtkWidget * w, gpointer data) {
char * label = NULL;
GtkWidget * dlg = gnome_request_dialog(FALSE,
_("Enter URI:"), "", 250,
_("Enter URI to load:"), "", 250,
&goto_string_cb, &url,
NULL);
GTK_WINDOW (help->toplevel));
retval = gnome_dialog_run_and_close(GNOME_DIALOG(dlg));
if((retval == 0) && url && (strlen(url) > 0)) {

View File

@@ -787,7 +787,7 @@ gnc_ui_xml_v2_cb(GtkWidget *widget, gpointer menuItem)
}
static void
gnc_ui_account_heirarchy_cb(GtkWidget *widget, gpointer menuItem)
gnc_ui_account_hierarchy_cb(GtkWidget *widget, gpointer menuItem)
{
}
@@ -1392,9 +1392,9 @@ gnc_main_create_menus(GnomeApp *app, GtkWidget *account_tree,
},
{
GNOME_APP_UI_ITEM,
N_("Write _Account Heirarchy"),
N_("Write just the account heirarchy"),
gnc_ui_account_heirarchy_cb, NULL, NULL,
N_("Write _Account Hierarchy"),
N_("Write just the account hierarchy"),
gnc_ui_account_hierarchy_cb, NULL, NULL,
GNOME_APP_PIXMAP_NONE, NULL,
0, 0, NULL
},

View File

@@ -42,7 +42,7 @@
(gnc:depend "report/report-list.scm")
(gnc:depend "qif-import/qif-import.scm")
(gnc:depend "printing/print-check.scm")
(gnc:depend "src/price-quotes.scm")
(gnc:depend "price-quotes.scm")
;; Load the system configs
(if (not (gnc:load-system-config-if-needed))

View File

@@ -126,6 +126,10 @@
(let ((getter (gnc:option-getter option)))
(getter)))
(define (gnc:option-set-value option value)
(let ((setter (gnc:option-setter option)))
(setter value)))
(define (gnc:option-index-get-name option index)
(let* ((option-data-fns (gnc:option-data-fns option))
(name-fn (vector-ref option-data-fns 2)))

View File

@@ -30,13 +30,9 @@
(define (non-negative-integer? value)
(and (integer? value) (>= value 0)))
(define gnc:*current-tip-number*
(gnc:make-config-var
"Which tip we're up to"
; (lambda (x) (if (and (integer? x) (>= x 0)) '(x) #f))
(lambda (var value) (if (non-negative-integer? value) (list value) #f))
=
0))
(gnc:register-configuration-option
(gnc:make-internal-option
"__tips" "current_tip_number" 0))
(define gnc:*number-of-tips*
(gnc:make-config-var
@@ -62,35 +58,40 @@
(set! gnc:*tip-list* (read in-port))
(set! gnc:*tip-list*
(map (lambda (pair) (cadr pair)) gnc:*tip-list*))
(if (not (= (length gnc:*tip-list*)
(gnc:config-var-value-get gnc:*current-tip-number*)))
(begin
(if (not (= (length gnc:*tip-list*) (gnc:current-tip-number)))
(begin
(gnc:config-var-value-set! gnc:*number-of-tips* #t
(length gnc:*tip-list*))
(if (<= (gnc:config-var-value-get gnc:*number-of-tips*)
(gnc:config-var-value-get gnc:*current-tip-number*))
(gnc:config-var-value-set! #t gnc:*current-tip-number 0))))
(gnc:current-tip-number))
(gnc:reset-tip-number))))
(close-port in-port)
#f))
(define (gnc:current-tip-number)
(gnc:option-value (gnc:lookup-global-option "__tips" "current_tip_number")))
(define (gnc:get-current-tip)
(_ (list-ref gnc:*tip-list*
(gnc:config-var-value-get gnc:*current-tip-number*))))
(_ (list-ref gnc:*tip-list* (gnc:current-tip-number))))
(define (gnc:reset-tip-number)
(let ((opt (gnc:lookup-global-option "__tips" "current_tip_number")))
(gnc:option-set-value opt 0)))
(define (gnc:increment-tip-number)
(let ((new-value (+ (gnc:config-var-value-get gnc:*current-tip-number*) 1)))
(let ((new-value (+ (gnc:current-tip-number) 1))
(opt (gnc:lookup-global-option "__tips" "current_tip_number")))
(if (< new-value (gnc:config-var-value-get gnc:*number-of-tips*))
(gnc:config-var-value-set! gnc:*current-tip-number* #t new-value)
(gnc:config-var-value-set! gnc:*current-tip-number* #t 0))))
(gnc:option-set-value opt new-value)
(gnc:option-set-value opt 0))))
(define (gnc:decrement-tip-number)
(let ((new-value (- (gnc:config-var-value-get gnc:*current-tip-number*) 1)))
(let ((new-value (- (gnc:current-tip-number) 1))
(opt (gnc:lookup-global-option "__tips" "current_tip_number")))
(if (< new-value 0)
(gnc:config-var-value-set! gnc:*current-tip-number* #t
(- (gnc:config-var-value-get
gnc:*number-of-tips*) 1))
(gnc:config-var-value-set! gnc:*current-tip-number* #t new-value))))
(gnc:option-set-value opt (- (gnc:config-var-value-get
gnc:*number-of-tips*) 1))
(gnc:option-set-value opt new-value))))
(gnc:read-tips)