Merge branch 'maint' into unstable

Conflicts:
- gnucash/gnome-utils/gnc-main-window.c
  I have chosen to ignore the changes pulled in from maint. The same change will
  be reimplemented in a followup commit.
- po/ru.po
  Same here. The translation conflicted too much and there's a
  translation update available for unstable I will pull in soon.
This commit is contained in:
Geert Janssens 2018-01-25 10:24:53 +01:00
commit 52b0c06d30
4 changed files with 41 additions and 8 deletions

View File

@ -237,7 +237,8 @@ time64 time64CanonicalDayTime(time64 t);
$1 = g_list_reverse (path);
}
void gnc_quote_source_set_fq_installed (GList *sources_list);
void gnc_quote_source_set_fq_installed (const char* version_string,
GList *sources_list);
%clear GList *;
%ignore gnc_quote_source_set_fq_installed;
%ignore gnc_commodity_table_get_quotable_commodities;

View File

@ -143,7 +143,7 @@ struct gnc_new_iso_code
#define GNC_NEW_ISO_CODES \
(sizeof(gnc_new_iso_codes) / sizeof(struct gnc_new_iso_code))
static gboolean fq_is_installed = FALSE;
static char *fq_version = NULL;
struct gnc_quote_source_s
{
@ -244,7 +244,20 @@ static GList *new_quote_sources = NULL;
gboolean
gnc_quote_source_fq_installed (void)
{
return fq_is_installed;
return (fq_version != NULL);
}
/********************************************************************
* gnc_quote_source_fq_version
*
* This function the version of the Finance::Quote module installed
* on a user's computer or NULL if no installation is found.
********************************************************************/
const char*
gnc_quote_source_fq_version (void)
{
return fq_version;
}
/********************************************************************
@ -495,6 +508,7 @@ gnc_quote_source_get_internal_name (const gnc_quote_source *source)
return source->internal_name;
}
/********************************************************************
* gnc_quote_source_set_fq_installed
*
@ -502,18 +516,27 @@ gnc_quote_source_get_internal_name (const gnc_quote_source *source)
* installed.
********************************************************************/
void
gnc_quote_source_set_fq_installed (const GList *sources_list)
gnc_quote_source_set_fq_installed (const char* version_string,
const GList *sources_list)
{
gnc_quote_source *source;
char *source_name;
const GList *node;
ENTER(" ");
fq_is_installed = TRUE;
if (!sources_list)
return;
if (fq_version)
{
g_free (fq_version);
fq_version = NULL;
}
if (version_string)
fq_version = g_strdup (version_string);
for (node = sources_list; node; node = node->next)
{
source_name = node->data;

View File

@ -143,13 +143,21 @@ typedef enum
} QuoteSourceType;
/** This function indicates whether or not the Finance::Quote module
* is installed on a users computer. This includes any other related
* is installed on a user's computer. This includes any other related
* modules that gnucash need to process F::Q information.
*
* @return TRUE is F::Q is installed properly.
*/
gboolean gnc_quote_source_fq_installed (void);
/** This function returns the version of the Finance::Quote module
* installed on a user's computer. If no proper installation is found
* it will return NULL.
*
* @return a version string or NULL
*/
const char* gnc_quote_source_fq_version (void);
/** Update gnucash internal tables based on what Finance::Quote
* sources are installed. Sources that have been explicitly coded
* into gnucash are marked sensitive/insensitive based upon whether
@ -159,7 +167,8 @@ gboolean gnc_quote_source_fq_installed (void);
* @param sources_list A list of strings containing the source names
* as they are known to F::Q.
*/
void gnc_quote_source_set_fq_installed (const GList *sources_list);
void gnc_quote_source_set_fq_installed (const char* version_string,
const GList *sources_list);
/** Return the number of entries for a given type of quote source.
*

View File

@ -623,4 +623,4 @@ Run 'gnc-fq-update' as root to install them.") "\n")))
(format #t "Found Finance::Quote version ~A" (car sources))
(newline)
(gnc:msg "Found Finance::Quote version " (car sources))
(gnc-quote-source-set-fq-installed (cdr sources))))))
(gnc-quote-source-set-fq-installed (car sources) (cdr sources))))))