Merge branch 'maint'

This commit is contained in:
Mike Alexander 2017-04-10 01:27:47 -04:00
commit ce79222f05
9 changed files with 98 additions and 32 deletions

View File

@ -72,23 +72,23 @@ typedef char gchar;
%typemap(in) time64 * (time64 t) "t = scm_to_int64($input); $1 = &t;"
%typemap(out) time64 * " $result = ($1) ? scm_from_int64(*($1)) : SCM_BOOL_F; "
%typemap(in) struct tm * {
%typemap(in) struct tm * (struct tm t) {
SCM tm = $input;
struct tm t = {
scm_to_int(SCM_SIMPLE_VECTOR_REF(tm, 0)),
scm_to_int(SCM_SIMPLE_VECTOR_REF(tm, 1)),
scm_to_int(SCM_SIMPLE_VECTOR_REF(tm, 2)),
scm_to_int(SCM_SIMPLE_VECTOR_REF(tm, 3)),
scm_to_int(SCM_SIMPLE_VECTOR_REF(tm, 4)),
scm_to_int(SCM_SIMPLE_VECTOR_REF(tm, 5)),
scm_to_int(SCM_SIMPLE_VECTOR_REF(tm, 6)),
scm_to_int(SCM_SIMPLE_VECTOR_REF(tm, 7)),
scm_to_int(SCM_SIMPLE_VECTOR_REF(tm, 8)),
#ifdef HAVE_STRUCT_TM_GMTOFF
scm_to_int(SCM_SIMPLE_VECTOR_REF(tm, 9)),
scm_to_locale_string(SCM_SIMPLE_VECTOR_REF(tm, 10)),
#endif
};
SCM zone;
t.tm_sec = scm_to_int(SCM_SIMPLE_VECTOR_REF(tm, 0));
t.tm_min = scm_to_int(SCM_SIMPLE_VECTOR_REF(tm, 1));
t.tm_hour = scm_to_int(SCM_SIMPLE_VECTOR_REF(tm, 2));
t.tm_mday = scm_to_int(SCM_SIMPLE_VECTOR_REF(tm, 3));
t.tm_mon = scm_to_int(SCM_SIMPLE_VECTOR_REF(tm, 4));
t.tm_year = scm_to_int(SCM_SIMPLE_VECTOR_REF(tm, 5));
t.tm_wday = scm_to_int(SCM_SIMPLE_VECTOR_REF(tm, 6));
t.tm_yday = scm_to_int(SCM_SIMPLE_VECTOR_REF(tm, 7));
t.tm_isdst = scm_to_int(SCM_SIMPLE_VECTOR_REF(tm, 8));
%#ifdef HAVE_STRUCT_TM_GMTOFF
t.tm_gmtoff = scm_to_int(SCM_SIMPLE_VECTOR_REF(tm, 9));
zone = SCM_SIMPLE_VECTOR_REF(tm, 10);
t.tm_zone = SCM_UNBNDP(zone) ? NULL : scm_to_locale_string(zone);
%#endif
$1 = &t;
}
@ -104,15 +104,38 @@ typedef char gchar;
SCM_SIMPLE_VECTOR_SET(tm, 6, scm_from_int(t->tm_wday));
SCM_SIMPLE_VECTOR_SET(tm, 7, scm_from_int(t->tm_yday));
SCM_SIMPLE_VECTOR_SET(tm, 8, scm_from_int(t->tm_isdst));
#ifdef HAVE_STRUCT_TM_GMTOFF
%#ifdef HAVE_STRUCT_TM_GMTOFF
SCM_SIMPLE_VECTOR_SET(tm, 9, scm_from_long(t->tm_gmtoff));
SCM_SIMPLE_VECTOR_SET(tm, 10, scm_from_locale_string(t->tm_zone));
#else
SCM_SIMPLE_VECTOR_SET(tm, 10, scm_from_locale_string(t->tm_zone?t->tm_zone:"Unset"));
%#else
SCM_SIMPLE_VECTOR_SET(tm, 9, scm_from_long(0));
SCM_SIMPLE_VECTOR_SET(tm, 10, scm_from_locale_string("GMT"));
#endif
%#endif
$result = tm;
}
%typemap(newfree) struct tm * "gnc_tm_free($1);"
%typemap(argout) struct tm * {
struct tm* t = $1;
SCM tm = $input;
SCM_SIMPLE_VECTOR_SET(tm, 0, scm_from_int(t->tm_sec));
SCM_SIMPLE_VECTOR_SET(tm, 1, scm_from_int(t->tm_min));
SCM_SIMPLE_VECTOR_SET(tm, 2, scm_from_int(t->tm_hour));
SCM_SIMPLE_VECTOR_SET(tm, 3, scm_from_int(t->tm_mday));
SCM_SIMPLE_VECTOR_SET(tm, 4, scm_from_int(t->tm_mon));
SCM_SIMPLE_VECTOR_SET(tm, 5, scm_from_int(t->tm_year));
SCM_SIMPLE_VECTOR_SET(tm, 6, scm_from_int(t->tm_wday));
SCM_SIMPLE_VECTOR_SET(tm, 7, scm_from_int(t->tm_yday));
SCM_SIMPLE_VECTOR_SET(tm, 8, scm_from_int(t->tm_isdst));
%#ifdef HAVE_STRUCT_TM_GMTOFF
SCM_SIMPLE_VECTOR_SET(tm, 9, scm_from_long(t->tm_gmtoff));
SCM_SIMPLE_VECTOR_SET(tm, 10, scm_from_locale_string(t->tm_zone?t->tm_zone:"Unset"));
%#else
SCM_SIMPLE_VECTOR_SET(tm, 9, scm_from_long(0));
SCM_SIMPLE_VECTOR_SET(tm, 10, scm_from_locale_string("GMT"));
%#endif
}
%define GLIST_HELPER_INOUT(ListType, ElemSwigType)
%typemap(in) ListType * {

View File

@ -199,7 +199,7 @@ Price = element price {
# from the doc string of gnc_price_class_init in src/engine/gnc-pricedb.c
element price:type { "bid" | "ask" | "last" | "nav" | "unknown" }?,
element price:type { "bid" | "ask" | "last" | "nav" | "transaction" | "unknown" }?,
element price:value { GncNumeric }
}

View File

@ -108,6 +108,9 @@ functions. */
%newobject xaccSplitGetCorrAccountFullName;
%newobject gnc_numeric_to_string;
%newobject gnc_localtime;
%newobject gnc_gmtime;
/* Parse the header file to generate wrappers */
%inline {
static QofIdType QOF_ID_BOOK_SCM (void) { return QOF_ID_BOOK; }
@ -166,6 +169,7 @@ QofBook * qof_session_get_book (QofSession *session);
const char *qof_session_get_url (QofSession *session);
%ignore qof_print_date_time_buff;
%ignore gnc_tm_free;
%include <gnc-date.h>
extern const char *gnc_default_strftime_date_format;

View File

@ -263,7 +263,8 @@ gnc_price_class_init(GNCPriceClass *klass)
"Quote type",
"The quote type is a string describing the "
"type of a price quote. Types possible now "
"are 'bid', 'ask', 'last', 'nav' and 'unknown'.",
"are 'bid', 'ask', 'last', 'nav', 'transaction', "
"and 'unknown'.",
NULL,
G_PARAM_READWRITE));

View File

@ -116,8 +116,10 @@ GType gnc_pricedb_get_type(void);
many strings in users' databases, so this string must be
translated on output instead of always being used in untranslated
form).
- type: the type of quote - types possible right now are bid, ask,
last, nav, and unknown.
- type: the type of quote - types possible right now are bid, ask, last,
nav, transaction, and unknown. 'Transaction' is set when the price is
created from an amount and value in a Split and is not available for users
to set via the GUI.
\par Implementation Details:

View File

@ -852,6 +852,25 @@
<property name="x_padding">12</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="pref/dialogs.import.hbci/use-ns-transaction-text">
<property name="label" translatable="yes">Use Non-SWIFT _transaction text</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="right_attach">4</property>
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
<property name="x_padding">12</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="checkbutton3">
<property name="label" translatable="yes">_Verbose debug messages</property>
@ -864,8 +883,8 @@
</object>
<packing>
<property name="right_attach">4</property>
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
<property name="top_attach">4</property>
<property name="bottom_attach">5</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
<property name="x_padding">12</property>

View File

@ -321,7 +321,7 @@ join_ab_strings_cb(const gchar *str, gpointer user_data)
if (!str || !*str)
return NULL;
tmp = g_strdup(str);
g_strstrip(tmp);
gnc_utf8_strip_invalid(tmp);
@ -366,10 +366,21 @@ gchar *
gnc_ab_get_purpose(const AB_TRANSACTION *ab_trans)
{
const GWEN_STRINGLIST *ab_purpose;
const char *ab_transactionText = NULL;
gchar *gnc_description = NULL;
g_return_val_if_fail(ab_trans, g_strdup(""));
if (gnc_prefs_get_bool(GNC_PREFS_GROUP_AQBANKING, GNC_PREF_USE_TRANSACTION_TXT))
{
/* According to AqBanking, some of the non-swift lines have a special
* meaning. Some banks place valuable text into the transaction text,
* hence we put this text in front of the purpose. */
ab_transactionText = AB_Transaction_GetTransactionText(ab_trans);
if (ab_transactionText)
gnc_description = g_strdup(ab_transactionText);
}
ab_purpose = AB_Transaction_GetPurpose(ab_trans);
if (ab_purpose)
GWEN_StringList_ForEach(ab_purpose, join_ab_strings_cb,

View File

@ -70,11 +70,12 @@ G_BEGIN_DECLS
# define AQBANKING_VERSION_4_EXACTLY
#endif
#define GNC_PREFS_GROUP_AQBANKING "dialogs.import.hbci"
#define GNC_PREF_FORMAT_SWIFT940 "format-swift-mt940"
#define GNC_PREF_FORMAT_SWIFT942 "format-swift-mt942"
#define GNC_PREF_FORMAT_DTAUS "format-dtaus"
#define GNC_PREF_VERBOSE_DEBUG "verbose-debug"
#define GNC_PREFS_GROUP_AQBANKING "dialogs.import.hbci"
#define GNC_PREF_FORMAT_SWIFT940 "format-swift-mt940"
#define GNC_PREF_FORMAT_SWIFT942 "format-swift-mt942"
#define GNC_PREF_FORMAT_DTAUS "format-dtaus"
#define GNC_PREF_USE_TRANSACTION_TXT "use-ns-transaction-text"
#define GNC_PREF_VERBOSE_DEBUG "verbose-debug"
typedef struct _GncABImExContextImport GncABImExContextImport;

View File

@ -20,6 +20,11 @@
<summary>Remember the PIN in memory</summary>
<description>If active, the PIN for HBCI/AqBanking actions will be remembered in memory during a session. Otherwise it will have to be entered again each time during a session when it is needed.</description>
</key>
<key name="use-ns-transaction-text" type="b">
<default>true</default>
<summary>Put the transaction text in front of the purpose of a transaction.</summary>
<description>Some banks place part of transaction description as "transaction text" in the MT940 file. Normally GNUcash ignores this text. However by activating this option, the transaction text is used for the transaction description too.</description>
</key>
<key name="verbose-debug" type="b">
<default>false</default>
<summary>Verbose HBCI debug messages</summary>