mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Merge branch 'maint'
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -2,7 +2,6 @@
|
||||
*.gmo
|
||||
*.go
|
||||
*.gschema.xml
|
||||
*.gschema.xml.in
|
||||
*.gschema.valid
|
||||
*.la
|
||||
*.lo
|
||||
|
||||
@@ -762,10 +762,6 @@ set(PLATFORM_OSX 1)
|
||||
set(HAVE_OSX_KEYCHAIN 1)
|
||||
endif()
|
||||
|
||||
if(GLIB2_VERSION VERSION_GREATER_EQUAL 2.46.0)
|
||||
set(HAVE_GLIB_2_46 1)
|
||||
endif()
|
||||
|
||||
if(DISABLE_DEPRECATED_GNOME)
|
||||
set(GNOME_DISABLE_DEPRECATED 1)
|
||||
endif()
|
||||
|
||||
122
NEWS
122
NEWS
@@ -1,6 +1,126 @@
|
||||
Version history:
|
||||
------- -------
|
||||
4.7 - 7 March 2021
|
||||
4.7 - 26 September 2021
|
||||
The eighth release of the 4.x stable series.
|
||||
|
||||
Compatibility Notice
|
||||
|
||||
In order to allow flatpak users to share preferences with
|
||||
installations outside of the sandbox we need to change the preference
|
||||
path from /org/gnucash to /org/gnucash/GnuCash. This release of
|
||||
GnuCash does that and it will automatically migrate existing
|
||||
preferences. It does not, however, continue to write preferences to
|
||||
the old path and it runs the migration only once. If you go back and
|
||||
forth between GnuCash 4.7 and an older versions you'll have two sets
|
||||
of preferences, one for GnuCash 4.7 and later and another for GnuCash
|
||||
4.6 and earlier. This includes the file history list and last-opened
|
||||
file.
|
||||
|
||||
Between 4.6 and 4.7, the following bugfixes were accomplished:
|
||||
|
||||
Bug 87847 - RFE: Create a 'checkbox' cell type
|
||||
Bug 766052 - Job report payments wrong when payment contains splits
|
||||
Bug 797596 - New-owner - improved representation of payments with multiple
|
||||
non-APAR splits
|
||||
Bug 798142 - Tax rate appears as a fraction
|
||||
Bug 798180 - Update to macOS Big Sur 11.3 breaks Finance Quote
|
||||
Bug 798205 - Some transactions dropped with no apparent cause or warnings
|
||||
for credit card ofx import
|
||||
Do not exclude from import a transaction that has an FITID
|
||||
which matches an already existing split. This is because it
|
||||
(1) may be a coincidence and therefore the transaction
|
||||
needs to be added or
|
||||
(2) could be on a transfer from the account being imported
|
||||
to another bank account which has already been imported,
|
||||
and so needs to be matched, not added.
|
||||
Bug 798208 - management fee transactions are ignored on OFX import
|
||||
Bug 798211 - Equity statement double calculates unrealized gain
|
||||
Bug 798219 - apply/OK truncates exchange rates from 4 to 2 decimal places;
|
||||
enter doesn't
|
||||
Bug 798221 - Transfer funds between accounts with different currencies
|
||||
crashes Gnucash on macOS
|
||||
Bug 798224 - Scheduled transactions are created with date-entered copied
|
||||
from the template transaction.
|
||||
Bug 798229 - GncDate::c_formats is being created and destroyed twice
|
||||
resulting in a double free crash on every exit.
|
||||
Bug 798234 - Cut Transaction discards the reference to the description/memo
|
||||
strings so that Paste Transaction will paste uninitialised
|
||||
data (or other strings)
|
||||
Bug 798235 - Reconciliation Ending Balance not recalculated the 2nd and
|
||||
subsequent times Statement Date is updated.
|
||||
Bug 798237 - Logging during XML file loading degrades performance
|
||||
significantly
|
||||
Bug 798238 - "New security" dialog doesn't save the "Display symbol"
|
||||
Bug 798250 - Gnucash permanent hang on save while loading report
|
||||
Bug 798256 - Crash in recnFinishCB
|
||||
Bug 798298 - Re-imported transactions no longer ignored
|
||||
Bug 798303 - account list is sorted wrong by amount
|
||||
Bug 798312 - Opening the help for dialogues in the wrong language.
|
||||
|
||||
The following fixes and improvements were not associated with bug reports:
|
||||
|
||||
Lots of memory-leaks plugged
|
||||
Change the preferences path to org.gnucash.GnuCash to comply with flatpak
|
||||
requirements and migrate existing preferences to the new paths. This
|
||||
won't provide for automatic sync between a system-installed GnuCash and
|
||||
a flatpak one unless the system-installed one is GnuCash 4.7 or later.
|
||||
Please see the Wiki for more information and a procedure to convert your
|
||||
existing preferences.
|
||||
Cleanup - minimal glib=2.56.1 - drop all conditionals on older versions
|
||||
Add code to handle ofx files that include transfers between accounts
|
||||
During transaction import, ignore splits whose account is not the
|
||||
destination account
|
||||
Do not drop a potential match just because it has an online_id.
|
||||
Now that we don't exclude from import a transaction with an FITID that
|
||||
matches an already existing transaction, if one accidentally re-imports
|
||||
a transaction, this allows it to be automatically matched against the
|
||||
previously imported transaction.
|
||||
Add test for Transaction GetDate() in python bindings, pursuant to
|
||||
Bug 798284.
|
||||
In find customer dialog, add a column for "Shipping Contact" parameter
|
||||
Prep early splash screen messages for translation
|
||||
Change text for SX preference option 'Review created transactions' to
|
||||
better align with existing SX text.
|
||||
Fixed an XML backend problem where trying to open a locked file would clear
|
||||
the lock even if one didn't ask to, so the next attempt would find the
|
||||
file unlocked even if still open in another instance.
|
||||
Fix 2 crashes in Generic Transaction Matcher
|
||||
Handle very large denominators from Finance::Quote's OpenExchange source
|
||||
Update file extension in man pages per mailing list post.
|
||||
Changed some option names:
|
||||
* From "Show Accounts until level" to "Levels of Subaccounts"
|
||||
* From "Extra notes" to "Extra Notes"
|
||||
* From "Report title" to "Report Title"
|
||||
* From "Invoice number" to "Invoice Number" to ensure it matches all
|
||||
other invoice reports.
|
||||
Fix missing mnemonic keys after changes to GNCAmountEdit
|
||||
With the changes to GNCAmountEdit, the way the mnemonic keys are
|
||||
associated to the entry widget of the GNCAmountEdit needs to change so
|
||||
have created a function gnc_amount_edit_make_mnemeonic_target which does
|
||||
the same as GNCDateEdit.
|
||||
Fix rounding in Stock Split Assistant to correct earlier commit that rounded
|
||||
the share price to that of the currency.
|
||||
[Portfolio Reports] Allow share digits to 9 decimal places to match the
|
||||
maximum commodity fraction.
|
||||
|
||||
New API
|
||||
|
||||
None
|
||||
|
||||
Deprecations
|
||||
|
||||
Date options with a time of day setting.
|
||||
Removing the only use, an example in hello-world.scm. GnuCash doesn't use
|
||||
this value in any of its own report options and the feature will be
|
||||
removed in GnuCash 5. Related to bug 798297 Pref "Use 24-hour clock"
|
||||
obsolete?.
|
||||
gnc:owner-report-create
|
||||
|
||||
New and Updated Translations: Chinese (Simplified), Croatian, Finnish, French,
|
||||
German, Hebrew, Italian, Japanese, Portuguese, Portuguese (Brazil), Swedish,
|
||||
Ukrainian
|
||||
|
||||
4.6 - 27 June 2021
|
||||
The seventh release of the 4.x stable series.
|
||||
Between 4.5 and 4.6, the following bugfixes were accomplished:
|
||||
|
||||
|
||||
@@ -108,9 +108,6 @@
|
||||
/* Define to 1 if you have the `getuid' function. */
|
||||
#cmakedefine HAVE_GETUID 1
|
||||
|
||||
/* Configure g_settings_list_keys deprecation */
|
||||
#cmakedefine HAVE_GLIB_2_46 1
|
||||
|
||||
/* Define to 1 if you have the <glob.h> header file. */
|
||||
#cmakedefine HAVE_GLOB_H 1
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ unset(gschema_depends CACHE)
|
||||
add_subdirectory (gnome)
|
||||
add_subdirectory (gnome-utils)
|
||||
add_subdirectory (gnome-search)
|
||||
add_subdirectory (gschemas)
|
||||
add_subdirectory (gtkbuilder)
|
||||
add_subdirectory (html)
|
||||
add_subdirectory (import-export)
|
||||
@@ -15,7 +16,6 @@ add_subdirectory (python)
|
||||
add_subdirectory (register)
|
||||
add_subdirectory (report)
|
||||
add_subdirectory (ui)
|
||||
add_subdirectory (gschemas)
|
||||
|
||||
add_definitions (-DHAVE_CONFIG_H)
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ gnc_add_swig_guile_command (swig-gnome-utils-c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/gnome-utils.i ""
|
||||
)
|
||||
|
||||
set (WARNINGS_SCHEMA ${DATADIR_BUILD}/glib-2.0/schemas/org.gnucash.warnings.gschema.xml)
|
||||
set (WARNINGS_SCHEMA ${DATADIR_BUILD}/glib-2.0/schemas/org.gnucash.GnuCash.warnings.gschema.xml)
|
||||
set (GNC_WARNINGS_C ${CMAKE_CURRENT_BINARY_DIR}/gnc-warnings.c)
|
||||
set (GNC_WARNINGS_H ${CMAKE_CURRENT_BINARY_DIR}/gnc-warnings.h)
|
||||
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
#include "gnc-main-window.h"
|
||||
#include "gnc-gui-query.h"
|
||||
#include "dialog-utils.h"
|
||||
#include <qoflog.h>
|
||||
|
||||
#define GNC_PREF_AUTOSAVE_SHOW_EXPLANATION "autosave-show-explanation"
|
||||
#define GNC_PREF_AUTOSAVE_INTERVAL "autosave-interval-minutes"
|
||||
@@ -44,6 +45,7 @@
|
||||
# undef G_LOG_DOMAIN
|
||||
#endif
|
||||
#define G_LOG_DOMAIN "gnc.gui.autosave"
|
||||
static const QofLogModule log_module = G_LOG_DOMAIN;
|
||||
|
||||
static void
|
||||
autosave_remove_timer_cb(QofBook *book, gpointer key, gpointer user_data);
|
||||
@@ -156,14 +158,14 @@ static gboolean autosave_confirm(GtkWidget *toplevel)
|
||||
|
||||
/* Should we show this explanation again? */
|
||||
gnc_prefs_set_bool(GNC_PREFS_GROUP_GENERAL, GNC_PREF_AUTOSAVE_SHOW_EXPLANATION, show_expl_again);
|
||||
g_debug("autosave_timeout_cb: Show explanation again=%s\n",
|
||||
DEBUG("autosave_timeout_cb: Show explanation again=%s\n",
|
||||
(show_expl_again ? "TRUE" : "FALSE"));
|
||||
|
||||
/* Should we switch off autosave? */
|
||||
if (switch_off_autosave)
|
||||
{
|
||||
gnc_prefs_set_float(GNC_PREFS_GROUP_GENERAL, GNC_PREF_AUTOSAVE_INTERVAL, 0);
|
||||
g_debug("autosave_timeout_cb: User chose to disable auto-save.\n");
|
||||
DEBUG("autosave_timeout_cb: User chose to disable auto-save.\n");
|
||||
}
|
||||
|
||||
return save_now;
|
||||
@@ -177,7 +179,7 @@ static gboolean autosave_timeout_cb(gpointer user_data)
|
||||
gboolean save_now = TRUE;
|
||||
GtkWidget *toplevel;
|
||||
|
||||
g_debug("autosave_timeout_cb called\n");
|
||||
DEBUG("autosave_timeout_cb called\n");
|
||||
|
||||
/* Is there already a save in progress? If yes, return FALSE so that
|
||||
the timeout is automatically destroyed and the function will not
|
||||
@@ -199,17 +201,17 @@ static gboolean autosave_timeout_cb(gpointer user_data)
|
||||
|
||||
if (save_now)
|
||||
{
|
||||
g_debug("autosave_timeout_cb: Really trigger auto-save now.\n");
|
||||
DEBUG("autosave_timeout_cb: Really trigger auto-save now.\n");
|
||||
|
||||
/* Timeout has passed - save the file. */
|
||||
if (GNC_IS_MAIN_WINDOW(toplevel))
|
||||
gnc_main_window_set_progressbar_window( GNC_MAIN_WINDOW( toplevel ) );
|
||||
else
|
||||
g_debug("autosave_timeout_cb: toplevel is not a GNC_MAIN_WINDOW\n");
|
||||
DEBUG("autosave_timeout_cb: toplevel is not a GNC_MAIN_WINDOW\n");
|
||||
if (GNC_IS_WINDOW(toplevel))
|
||||
gnc_window_set_progressbar_window( GNC_WINDOW( toplevel ) );
|
||||
else
|
||||
g_debug("autosave_timeout_cb: toplevel is not a GNC_WINDOW\n");
|
||||
DEBUG("autosave_timeout_cb: toplevel is not a GNC_WINDOW\n");
|
||||
|
||||
gnc_file_save (GTK_WINDOW (toplevel));
|
||||
|
||||
@@ -223,7 +225,7 @@ static gboolean autosave_timeout_cb(gpointer user_data)
|
||||
}
|
||||
else
|
||||
{
|
||||
g_debug("autosave_timeout_cb: No auto-save this time, let the timeout run again.\n");
|
||||
DEBUG("autosave_timeout_cb: No auto-save this time, let the timeout run again.\n");
|
||||
/* Return TRUE so that the timeout is not removed but will be
|
||||
triggered again after the next time interval. */
|
||||
return TRUE;
|
||||
@@ -239,7 +241,7 @@ autosave_remove_timer_cb(QofBook *book, gpointer key, gpointer user_data)
|
||||
if (autosave_source_id > 0)
|
||||
{
|
||||
res = g_source_remove (autosave_source_id);
|
||||
g_debug("Removing auto save timer with id %d, result=%s\n",
|
||||
DEBUG("Removing auto save timer with id %d, result=%s\n",
|
||||
autosave_source_id, (res ? "TRUE" : "FALSE"));
|
||||
|
||||
/* Set the event source id to zero. */
|
||||
@@ -269,7 +271,7 @@ static void gnc_autosave_add_timer(QofBook *book)
|
||||
guint autosave_source_id =
|
||||
g_timeout_add_seconds(interval_mins * 60,
|
||||
autosave_timeout_cb, book);
|
||||
g_debug("Adding new auto-save timer with id %d\n", autosave_source_id);
|
||||
DEBUG("Adding new auto-save timer with id %d\n", autosave_source_id);
|
||||
|
||||
/* Save the event source id for a potential removal, and also
|
||||
set the callback upon book closing */
|
||||
@@ -281,13 +283,13 @@ static void gnc_autosave_add_timer(QofBook *book)
|
||||
|
||||
void gnc_autosave_dirty_handler (QofBook *book, gboolean dirty)
|
||||
{
|
||||
g_debug("gnc_main_window_autosave_dirty(dirty = %s)\n",
|
||||
DEBUG("gnc_main_window_autosave_dirty(dirty = %s)\n",
|
||||
(dirty ? "TRUE" : "FALSE"));
|
||||
if (dirty)
|
||||
{
|
||||
if (qof_book_is_readonly(book))
|
||||
{
|
||||
//g_debug("Book is read-only, ignoring dirty flag");
|
||||
//DEBUG("Book is read-only, ignoring dirty flag");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -303,7 +305,7 @@ void gnc_autosave_dirty_handler (QofBook *book, gboolean dirty)
|
||||
}
|
||||
else
|
||||
{
|
||||
g_debug("Shutting down book, ignoring dirty book");
|
||||
DEBUG("Shutting down book, ignoring dirty book");
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -33,6 +33,9 @@
|
||||
#include <stdlib.h>
|
||||
#include "gnc-date.h"
|
||||
#include "dialog-utils.h"
|
||||
#include <qoflog.h>
|
||||
|
||||
static const QofLogModule log_module = G_LOG_DOMAIN;
|
||||
|
||||
/**
|
||||
* Marking ...
|
||||
@@ -531,21 +534,21 @@ _gnc_dense_cal_set_month(GncDenseCal *dcal, GDateMonth mon, gboolean redraw)
|
||||
dcal->month = mon;
|
||||
g_timer_start(t);
|
||||
recompute_first_of_month_offset(dcal);
|
||||
g_debug("recompute_first_of_month_offset: %f", g_timer_elapsed(t, NULL) * 1000.);
|
||||
DEBUG("recompute_first_of_month_offset: %f", g_timer_elapsed(t, NULL) * 1000.);
|
||||
g_timer_start(t);
|
||||
recompute_extents(dcal);
|
||||
g_debug("recompute_extents: %f", g_timer_elapsed(t, NULL) * 1000.);
|
||||
DEBUG("recompute_extents: %f", g_timer_elapsed(t, NULL) * 1000.);
|
||||
if (redraw && gtk_widget_get_realized(GTK_WIDGET(dcal)))
|
||||
{
|
||||
g_timer_start(t);
|
||||
recompute_x_y_scales(dcal);
|
||||
g_debug("recompute_x_y_scales: %f", g_timer_elapsed(t, NULL) * 1000.);
|
||||
DEBUG("recompute_x_y_scales: %f", g_timer_elapsed(t, NULL) * 1000.);
|
||||
g_timer_start(t);
|
||||
gnc_dense_cal_draw_to_buffer(dcal);
|
||||
g_debug("draw_to_buffer: %f", g_timer_elapsed(t, NULL) * 1000.);
|
||||
DEBUG("draw_to_buffer: %f", g_timer_elapsed(t, NULL) * 1000.);
|
||||
g_timer_start(t);
|
||||
gtk_widget_queue_draw(GTK_WIDGET(dcal->cal_drawing_area));
|
||||
g_debug("queue_draw: %f", g_timer_elapsed(t, NULL) * 1000.);
|
||||
DEBUG("queue_draw: %f", g_timer_elapsed(t, NULL) * 1000.);
|
||||
}
|
||||
g_timer_stop(t);
|
||||
g_timer_destroy(t);
|
||||
@@ -883,7 +886,7 @@ gnc_dense_cal_draw(GtkWidget *widget, cairo_t *cr, gpointer user_data)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#define LOG_AND_RESET(timer, msg) do { g_debug("%s: %f", msg, g_timer_elapsed(timer, NULL) * 1000.); g_timer_reset(timer); } while (0);
|
||||
#define LOG_AND_RESET(timer, msg) do { DEBUG("%s: %f", msg, g_timer_elapsed(timer, NULL) * 1000.); g_timer_reset(timer); } while (0);
|
||||
|
||||
static void
|
||||
gnc_dense_cal_draw_to_buffer(GncDenseCal *dcal)
|
||||
@@ -900,7 +903,7 @@ gnc_dense_cal_draw_to_buffer(GncDenseCal *dcal)
|
||||
gchar *primary_color_class, *secondary_color_class, *marker_color_class;
|
||||
|
||||
timer = g_timer_new();
|
||||
g_debug("drawing");
|
||||
DEBUG("drawing");
|
||||
widget = GTK_WIDGET(dcal);
|
||||
|
||||
if (!dcal->surface)
|
||||
@@ -1361,7 +1364,7 @@ _gdc_view_option_changed(GtkComboBox *widget, gpointer user_data)
|
||||
if (!gtk_combo_box_get_active_iter(widget, &iter))
|
||||
return;
|
||||
gtk_tree_model_get(model, &iter, VIEW_OPTS_COLUMN_NUM_MONTHS, &months_val, -1);
|
||||
g_debug("changing to %d months", months_val);
|
||||
DEBUG("changing to %d months", months_val);
|
||||
gnc_dense_cal_set_num_months(GNC_DENSE_CAL(user_data), months_val);
|
||||
}
|
||||
|
||||
@@ -1791,7 +1794,7 @@ wheres_this(GncDenseCal *dcal, int x, int y)
|
||||
if (g_date_get_julian(&d) >= g_date_get_julian(&startD))
|
||||
{
|
||||
/* we're past the end of the displayed calendar, thus -1 */
|
||||
g_debug("%d >= %d", g_date_get_julian(&d), g_date_get_julian(&startD));
|
||||
DEBUG("%d >= %d", g_date_get_julian(&d), g_date_get_julian(&startD));
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -1909,7 +1912,7 @@ static void
|
||||
gdc_model_added_cb(GncDenseCalModel *model, guint added_tag, gpointer user_data)
|
||||
{
|
||||
GncDenseCal *cal = GNC_DENSE_CAL(user_data);
|
||||
g_debug("gdc_model_added_cb update\n");
|
||||
DEBUG("gdc_model_added_cb update\n");
|
||||
gdc_add_tag_markings(cal, added_tag);
|
||||
}
|
||||
|
||||
@@ -1918,7 +1921,7 @@ gdc_model_update_cb(GncDenseCalModel *model, guint update_tag, gpointer user_dat
|
||||
{
|
||||
GncDenseCal *cal = GNC_DENSE_CAL (user_data);
|
||||
gint num_marks = 0;
|
||||
g_debug ("gdc_model_update_cb update for tag [%d]\n", update_tag);
|
||||
DEBUG ("gdc_model_update_cb update for tag [%d]\n", update_tag);
|
||||
num_marks = gnc_dense_cal_model_get_instance_count (cal->model, update_tag);
|
||||
// We need to redraw if there are no mark, to ensure they're all erased.
|
||||
gdc_mark_remove (cal, update_tag, num_marks==0);
|
||||
@@ -1930,7 +1933,7 @@ static void
|
||||
gdc_model_removing_cb(GncDenseCalModel *model, guint remove_tag, gpointer user_data)
|
||||
{
|
||||
GncDenseCal *cal = GNC_DENSE_CAL(user_data);
|
||||
g_debug("gdc_model_removing_cb update [%d]\n", remove_tag);
|
||||
DEBUG("gdc_model_removing_cb update [%d]\n", remove_tag);
|
||||
gdc_mark_remove(cal, remove_tag, TRUE);
|
||||
}
|
||||
|
||||
@@ -1983,7 +1986,7 @@ gdc_mark_add(GncDenseCal *dcal,
|
||||
newMark->info = g_strdup(info);
|
||||
newMark->tag = tag;
|
||||
newMark->ourMarks = NULL;
|
||||
g_debug("saving mark with tag [%d]\n", newMark->tag);
|
||||
DEBUG("saving mark with tag [%d]\n", newMark->tag);
|
||||
|
||||
for (i = 0; i < size; i++)
|
||||
{
|
||||
@@ -2016,7 +2019,7 @@ gdc_mark_remove(GncDenseCal *dcal, guint mark_to_remove, gboolean redraw)
|
||||
/* Ignore non-realistic marks */
|
||||
if ((gint)mark_to_remove == -1)
|
||||
{
|
||||
g_debug("mark_to_remove = -1");
|
||||
DEBUG("mark_to_remove = -1");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2029,12 +2032,12 @@ gdc_mark_remove(GncDenseCal *dcal, guint mark_to_remove, gboolean redraw)
|
||||
}
|
||||
if (iter == NULL)
|
||||
{
|
||||
g_message("couldn't find tag [%d]", mark_to_remove);
|
||||
PINFO("couldn't find tag [%d]", mark_to_remove);
|
||||
return;
|
||||
}
|
||||
if (mark_data == NULL)
|
||||
{
|
||||
g_debug("mark_data == null");
|
||||
DEBUG("mark_data == null");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -520,7 +520,7 @@ gnc_frequency_setup(GncFrequency *gf, GList *recurrences, const GDate *start_dat
|
||||
else
|
||||
{
|
||||
Recurrence *r = (Recurrence*)recurrences->data;
|
||||
g_debug("recurrence period [%d]", recurrenceGetPeriodType(r));
|
||||
DEBUG("recurrence period [%d]", recurrenceGetPeriodType(r));
|
||||
switch (recurrenceGetPeriodType(r))
|
||||
{
|
||||
case PERIOD_ONCE:
|
||||
|
||||
@@ -267,7 +267,10 @@ gnc_gnome_help_yelp_anchor_fix (GtkWindow *parent, const char *file_name, const
|
||||
{
|
||||
gchar *filename = g_build_filename (help_path, *langs, help_file, NULL);
|
||||
if (g_file_test (filename, G_FILE_TEST_EXISTS))
|
||||
{
|
||||
full_path = g_strdup (filename);
|
||||
break;
|
||||
}
|
||||
g_free (filename);
|
||||
}
|
||||
g_free (help_path);
|
||||
|
||||
@@ -25,10 +25,12 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include "gnc-gobject-utils.h"
|
||||
#include <qoflog.h>
|
||||
|
||||
#include <gtk/gtk.h> // For gtk_main_quit(). Can't get this to work with
|
||||
// a g_source attached to the main glib context.
|
||||
|
||||
static const QofLogModule log_module = G_LOG_DOMAIN;
|
||||
|
||||
static void gnc_gobject_weak_cb (gpointer user_data, GObject *object);
|
||||
|
||||
@@ -70,7 +72,7 @@ static void
|
||||
gnc_gobject_dump_gobject (GObject *object, const gchar *name)
|
||||
{
|
||||
//printf("Enter %s: object %p, name %s\n", G_STRFUNC, object, name);
|
||||
g_message(" object %p, ref count %d", object, object->ref_count);
|
||||
PINFO(" object %p, ref count %d", object, object->ref_count);
|
||||
//printf("Leave %s:\n", G_STRFUNC);
|
||||
}
|
||||
|
||||
@@ -85,7 +87,7 @@ static gboolean
|
||||
gnc_gobject_dump_list (const gchar *name, GList *list, gpointer user_data)
|
||||
{
|
||||
//printf("Enter %s: name %s, list %p\n", G_STRFUNC, name, list);
|
||||
g_message(" %d %s", g_list_length(list), name);
|
||||
PINFO(" %d %s", g_list_length(list), name);
|
||||
g_list_foreach(list, (GFunc)gnc_gobject_dump_gobject, (gpointer)name);
|
||||
//printf("Leave %s:\n", G_STRFUNC);
|
||||
return TRUE;
|
||||
@@ -108,7 +110,7 @@ gnc_gobject_tracking_dump (void)
|
||||
|
||||
if (g_hash_table_size(table) > 0)
|
||||
{
|
||||
g_message("The following objects remain alive:");
|
||||
PINFO("The following objects remain alive:");
|
||||
g_hash_table_foreach_remove(table, (GHRFunc)gnc_gobject_dump_list, NULL);
|
||||
}
|
||||
//printf("Leave %s:\n", G_STRFUNC);
|
||||
|
||||
@@ -784,7 +784,7 @@ gnc_main_window_restore_window (GncMainWindow *window, GncMainWindowSaveData *da
|
||||
(pos[1] + (geom ? geom[1] : 0) < 0) ||
|
||||
(pos[1] > gdk_screen_height()))
|
||||
{
|
||||
g_debug("position %dx%d, size%dx%d is offscreen; will not move",
|
||||
DEBUG("position %dx%d, size%dx%d is offscreen; will not move",
|
||||
pos[0], pos[1], geom ? geom[0] : 0, geom ? geom[1] : 0);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -34,9 +34,11 @@
|
||||
#include <glib.h>
|
||||
#include "gnc-sx-instance-dense-cal-adapter.h"
|
||||
#include "gnc-dense-cal.h"
|
||||
#include <qoflog.h>
|
||||
|
||||
#undef G_LOG_DOMAIN
|
||||
#define G_LOG_DOMAIN "gnc.gui.sx.adapter.sx-dense-cal"
|
||||
static const QofLogModule log_module = G_LOG_DOMAIN;
|
||||
|
||||
static void gnc_sx_instance_dense_cal_adapter_dispose(GObject *obj);
|
||||
static void gnc_sx_instance_dense_cal_adapter_finalize(GObject *obj);
|
||||
@@ -94,7 +96,7 @@ static void
|
||||
gsidca_instances_added_cb(GncSxInstanceModel *model, SchedXaction *sx_added, gpointer user_data)
|
||||
{
|
||||
GncSxInstanceDenseCalAdapter *adapter = GNC_SX_INSTANCE_DENSE_CAL_ADAPTER(user_data);
|
||||
g_debug("instance added\n");
|
||||
DEBUG("instance added\n");
|
||||
if (xaccSchedXactionGetEnabled(sx_added))
|
||||
{
|
||||
g_signal_emit_by_name(adapter, "added", GPOINTER_TO_UINT(sx_added));
|
||||
@@ -106,7 +108,7 @@ gsidca_instances_updated_cb(GncSxInstanceModel *model, SchedXaction *sx_updated,
|
||||
{
|
||||
GncSxInstanceDenseCalAdapter *adapter = GNC_SX_INSTANCE_DENSE_CAL_ADAPTER(user_data);
|
||||
gnc_sx_instance_model_update_sx_instances(model, sx_updated);
|
||||
g_debug("instances updated\n");
|
||||
DEBUG("instances updated\n");
|
||||
if (xaccSchedXactionGetEnabled(sx_updated))
|
||||
{
|
||||
g_signal_emit_by_name(adapter, "update", GPOINTER_TO_UINT((gpointer)sx_updated));
|
||||
@@ -121,7 +123,7 @@ static void
|
||||
gsidca_instances_removing_cb(GncSxInstanceModel *model, SchedXaction *sx_to_be_removed, gpointer user_data)
|
||||
{
|
||||
GncSxInstanceDenseCalAdapter *adapter = GNC_SX_INSTANCE_DENSE_CAL_ADAPTER(user_data);
|
||||
g_debug("removing instance...\n");
|
||||
DEBUG("removing instance...\n");
|
||||
g_signal_emit_by_name(adapter, "removing", GPOINTER_TO_UINT(sx_to_be_removed));
|
||||
gnc_sx_instance_model_remove_sx_instances(model, sx_to_be_removed);
|
||||
}
|
||||
|
||||
@@ -9,13 +9,13 @@ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
||||
* displayed to the user always or once. *
|
||||
* *
|
||||
* ATTENTION: this file is autogenerated based on the gsettings *
|
||||
* schema file org.gnucash.warnings.gschema.xml.in *
|
||||
* schema file org.gnucash.GnuCash.warnings.gschema.xml.in *
|
||||
* *
|
||||
* If you need any modifications in this file, please update the *
|
||||
* schema source file (or the xsl translation file depending on the *
|
||||
* kind of change required) instead. *
|
||||
* *
|
||||
* Copyright (C) 2013 Geert Janssens <geert@kobaltwit.be> *
|
||||
* Copyright (C) 2013 Geert Janssens <geert@kobaltwit.be> *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or *
|
||||
* modify it under the terms of the GNU General Public License as *
|
||||
@@ -40,7 +40,7 @@ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
||||
#include <gnc-warnings.h>
|
||||
|
||||
static GncWarningSpec warning_spec [] =
|
||||
{<xsl:for-each select="//schema[@id='org.gnucash.warnings.permanent']/key">
|
||||
{<xsl:for-each select="//schema[@id='org.gnucash.GnuCash.warnings.permanent']/key">
|
||||
{ GNC_PREF_WARN_<xsl:value-of select="translate(@name,$smallcase,$uppercase)"/>,
|
||||
"<xsl:value-of select="summary"/>",
|
||||
"<xsl:value-of select="description"/>",
|
||||
@@ -56,4 +56,4 @@ const GncWarningSpec *gnc_get_warnings (void)
|
||||
<xsl:variable name="smallcase" select="'-abcdefghijklmnopqrstuvwxyz'" />
|
||||
<xsl:variable name="uppercase" select="'_ABCDEFGHIJKLMNOPQRSTUVWXYZ'" />
|
||||
|
||||
</xsl:stylesheet>
|
||||
</xsl:stylesheet>
|
||||
|
||||
@@ -9,13 +9,13 @@ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
||||
* displayed to the user always or once. *
|
||||
* *
|
||||
* ATTENTION: this file is autogenerated based on the gsettings *
|
||||
* schema file org.gnucash.warnings.gschema.xml.in *
|
||||
* schema file org.gnucash.GnuCash.warnings.gschema.xml.in *
|
||||
* *
|
||||
* If you need any modifications in this file, please update the *
|
||||
* schema source file (or the xsl translation file depending on the *
|
||||
* kind of change required) instead. *
|
||||
* *
|
||||
* Copyright (C) 2013 Geert Janssens <geert@kobaltwit.be> *
|
||||
* Copyright (C) 2013 Geert Janssens <geert@kobaltwit.be> *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or *
|
||||
* modify it under the terms of the GNU General Public License as *
|
||||
@@ -41,10 +41,10 @@ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
<xsl:for-each select="//schema[@id='org.gnucash.warnings.permanent']/key">
|
||||
<xsl:for-each select="//schema[@id='org.gnucash.GnuCash.warnings.permanent']/key">
|
||||
#define GNC_PREF_WARN_<xsl:value-of select="translate(@name,$smallcase,$uppercase)"/> "<xsl:value-of select="@name"/>"</xsl:for-each>
|
||||
|
||||
enum {<xsl:for-each select="//schema[@id='org.gnucash.warnings.permanent']/key">
|
||||
enum {<xsl:for-each select="//schema[@id='org.gnucash.GnuCash.warnings.permanent']/key">
|
||||
WARN_<xsl:value-of select="translate(@name,$smallcase,$uppercase)"/>,</xsl:for-each>
|
||||
};
|
||||
|
||||
@@ -62,4 +62,4 @@ const GncWarningSpec *gnc_get_warnings (void);
|
||||
<xsl:variable name="smallcase" select="'-abcdefghijklmnopqrstuvwxyz'" />
|
||||
<xsl:variable name="uppercase" select="'_ABCDEFGHIJKLMNOPQRSTUVWXYZ'" />
|
||||
|
||||
</xsl:stylesheet>
|
||||
</xsl:stylesheet>
|
||||
|
||||
@@ -53,6 +53,9 @@
|
||||
#include "dialog-transfer.h"
|
||||
#include "dialog-print-check.h"
|
||||
#include "gnc-general-search.h"
|
||||
#include <qoflog.h>
|
||||
|
||||
static const QofLogModule log_module = G_LOG_DOMAIN;
|
||||
|
||||
#define DIALOG_PAYMENT_CM_CLASS "payment-dialog"
|
||||
|
||||
@@ -1561,7 +1564,7 @@ gboolean gnc_ui_payment_is_customer_payment(const Transaction *txn)
|
||||
{
|
||||
/* Transaction isn't valid for a payment, just return the default
|
||||
* Calling code will have to handle this situation properly */
|
||||
g_message("No asset splits in txn \"%s\"; cannot use this for assigning a payment.",
|
||||
PINFO("No asset splits in txn \"%s\"; cannot use this for assigning a payment.",
|
||||
xaccTransGetDescription(txn));
|
||||
return result;
|
||||
}
|
||||
@@ -1569,7 +1572,7 @@ gboolean gnc_ui_payment_is_customer_payment(const Transaction *txn)
|
||||
assetaccount_split = xaccTransGetFirstPaymentAcctSplit(txn);
|
||||
amount = xaccSplitGetValue(assetaccount_split);
|
||||
result = gnc_numeric_positive_p(amount); // positive amounts == customer
|
||||
//g_message("Amount=%s", gnc_numeric_to_string(amount));
|
||||
//PINFO("Amount=%s", gnc_numeric_to_string(amount));
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -1618,7 +1621,7 @@ static Split *select_payment_split (GtkWindow *parent, Transaction *txn)
|
||||
_("The selected transaction doesn't have splits that can be assigned as a payment"));
|
||||
gtk_dialog_run (GTK_DIALOG(dialog));
|
||||
gtk_widget_destroy (dialog);
|
||||
g_message("No asset splits in txn \"%s\"; cannot use this for assigning a payment.",
|
||||
PINFO("No asset splits in txn \"%s\"; cannot use this for assigning a payment.",
|
||||
xaccTransGetDescription(txn));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -947,7 +947,7 @@ format_read_item_placement(const gchar *file,
|
||||
}
|
||||
goto failed;
|
||||
}
|
||||
g_debug("Check file %s, group %s, key %s, value: %s",
|
||||
DEBUG("Check file %s, group %s, key %s, value: %s",
|
||||
file, KF_GROUP_ITEMS, key, value);
|
||||
g_free(key);
|
||||
|
||||
@@ -965,7 +965,7 @@ format_read_item_placement(const gchar *file,
|
||||
if (error)
|
||||
goto failed;
|
||||
value = doubles_to_string(dd, dd_len);
|
||||
g_debug("Check file %s, group %s, key %s, length %"G_GSIZE_FORMAT"; values: %s",
|
||||
DEBUG("Check file %s, group %s, key %s, length %"G_GSIZE_FORMAT"; values: %s",
|
||||
file, KF_GROUP_ITEMS, key, dd_len, value);
|
||||
g_free(value);
|
||||
|
||||
@@ -1002,7 +1002,7 @@ format_read_item_placement(const gchar *file,
|
||||
g_key_file_get_string(key_file, KF_GROUP_ITEMS, key, &error);
|
||||
if (!error)
|
||||
{
|
||||
g_debug("Check file %s, group %s, key %s, value: %s",
|
||||
DEBUG("Check file %s, group %s, key %s, value: %s",
|
||||
file, KF_GROUP_ITEMS, key, data->font);
|
||||
}
|
||||
else
|
||||
@@ -1020,7 +1020,7 @@ format_read_item_placement(const gchar *file,
|
||||
g_key_file_get_string(key_file, KF_GROUP_ITEMS, key, &error);
|
||||
if (!error)
|
||||
{
|
||||
g_debug("Check file %s, group %s, key %s, value: %s",
|
||||
DEBUG("Check file %s, group %s, key %s, value: %s",
|
||||
file, KF_GROUP_ITEMS, key, value);
|
||||
name = g_utf8_strdown(value, -1);
|
||||
if (strcmp(name, "right") == 0)
|
||||
@@ -1048,7 +1048,7 @@ format_read_item_placement(const gchar *file,
|
||||
g_key_file_get_boolean(key_file, KF_GROUP_ITEMS, key, &error);
|
||||
if (!error)
|
||||
{
|
||||
g_debug("Check file %s, group %s, key %s, value: %d",
|
||||
DEBUG("Check file %s, group %s, key %s, value: %d",
|
||||
file, KF_GROUP_ITEMS, key, bval);
|
||||
data->blocking = bval;
|
||||
}
|
||||
@@ -1073,7 +1073,7 @@ format_read_item_placement(const gchar *file,
|
||||
&error);
|
||||
if (error)
|
||||
goto failed;
|
||||
g_debug("Check file %s, group %s, key %s, value: %s",
|
||||
DEBUG("Check file %s, group %s, key %s, value: %s",
|
||||
file, KF_GROUP_ITEMS, key, data->filename);
|
||||
g_free(key);
|
||||
break;
|
||||
@@ -1084,7 +1084,7 @@ format_read_item_placement(const gchar *file,
|
||||
&error);
|
||||
if (error)
|
||||
goto failed;
|
||||
g_debug("Check file %s, group %s, key %s, value: %s",
|
||||
DEBUG("Check file %s, group %s, key %s, value: %s",
|
||||
file, KF_GROUP_ITEMS, key, data->text);
|
||||
g_free(key);
|
||||
break;
|
||||
@@ -1094,7 +1094,7 @@ format_read_item_placement(const gchar *file,
|
||||
bval = g_key_file_get_boolean(key_file, KF_GROUP_ITEMS, key, &error);
|
||||
if (!error)
|
||||
{
|
||||
g_debug("Check file %s, group %s, key %s, value: %d",
|
||||
DEBUG("Check file %s, group %s, key %s, value: %d",
|
||||
file, KF_GROUP_ITEMS, key, bval);
|
||||
data->print_date_format = bval;
|
||||
}
|
||||
@@ -1244,14 +1244,14 @@ format_read_general_info(const gchar *file,
|
||||
parts = g_strsplit(value, "-", -1);
|
||||
format->guid = g_strjoinv("", parts);
|
||||
g_strfreev(parts);
|
||||
g_debug("Check file %s, group %s, key %s, value: %s",
|
||||
DEBUG("Check file %s, group %s, key %s, value: %s",
|
||||
file, KF_GROUP_TOP, KF_KEY_GUID, format->guid);
|
||||
|
||||
format->title =
|
||||
g_key_file_get_string(key_file, KF_GROUP_TOP, KF_KEY_TITLE, &error);
|
||||
if (!error)
|
||||
{
|
||||
g_debug("Check file %s, group %s, key %s, value: %s",
|
||||
DEBUG("Check file %s, group %s, key %s, value: %s",
|
||||
file, KF_GROUP_TOP, KF_KEY_TITLE, format->title);
|
||||
}
|
||||
else
|
||||
@@ -1266,7 +1266,7 @@ format_read_general_info(const gchar *file,
|
||||
&error);
|
||||
if (!error)
|
||||
{
|
||||
g_debug("Check file %s, group %s, key %s, value: %d",
|
||||
DEBUG("Check file %s, group %s, key %s, value: %d",
|
||||
file, KF_GROUP_TOP, KF_KEY_BLOCKING, format->blocking);
|
||||
}
|
||||
else
|
||||
@@ -1291,7 +1291,7 @@ format_read_general_info(const gchar *file,
|
||||
&error);
|
||||
if (!error)
|
||||
{
|
||||
g_debug("Check file %s, group %s, key %s, value: %d",
|
||||
DEBUG("Check file %s, group %s, key %s, value: %d",
|
||||
file, KF_GROUP_TOP, KF_KEY_DATE_FORMAT, format->print_date_format);
|
||||
}
|
||||
else
|
||||
@@ -1316,7 +1316,7 @@ format_read_general_info(const gchar *file,
|
||||
&error);
|
||||
if (!error)
|
||||
{
|
||||
g_debug("Check file %s, group %s, key %s, value: %d",
|
||||
DEBUG("Check file %s, group %s, key %s, value: %d",
|
||||
file, KF_GROUP_TOP, KF_KEY_SHOW_GRID, format->show_grid);
|
||||
}
|
||||
else
|
||||
@@ -1334,7 +1334,7 @@ format_read_general_info(const gchar *file,
|
||||
&error);
|
||||
if (!error)
|
||||
{
|
||||
g_debug("Check file %s, group %s, key %s, value: %d",
|
||||
DEBUG("Check file %s, group %s, key %s, value: %d",
|
||||
file, KF_GROUP_TOP, KF_KEY_SHOW_BOXES, format->show_boxes);
|
||||
}
|
||||
else
|
||||
@@ -1351,7 +1351,7 @@ format_read_general_info(const gchar *file,
|
||||
g_key_file_get_string(key_file, KF_GROUP_TOP, KF_KEY_FONT, &error);
|
||||
if (!error)
|
||||
{
|
||||
g_debug("Check file %s, group %s, key %s, value: %s",
|
||||
DEBUG("Check file %s, group %s, key %s, value: %s",
|
||||
file, KF_GROUP_TOP, KF_KEY_FONT, format->font);
|
||||
}
|
||||
else
|
||||
@@ -1367,7 +1367,7 @@ format_read_general_info(const gchar *file,
|
||||
g_key_file_get_double(key_file, KF_GROUP_TOP, KF_KEY_ROTATION, &error);
|
||||
if (!error)
|
||||
{
|
||||
g_debug("Check file %s, group %s, key %s, value: %f",
|
||||
DEBUG("Check file %s, group %s, key %s, value: %f",
|
||||
file, KF_GROUP_TOP, KF_KEY_ROTATION, format->rotation);
|
||||
}
|
||||
else
|
||||
@@ -1385,7 +1385,7 @@ format_read_general_info(const gchar *file,
|
||||
if (!error)
|
||||
{
|
||||
value = doubles_to_string(dd, dd_len);
|
||||
g_debug("Check file %s, group %s, key %s, length %"G_GSIZE_FORMAT"; values: %s",
|
||||
DEBUG("Check file %s, group %s, key %s, length %"G_GSIZE_FORMAT"; values: %s",
|
||||
file, KF_GROUP_TOP, KF_KEY_TRANSLATION, dd_len, value);
|
||||
g_free(value);
|
||||
|
||||
@@ -1867,14 +1867,14 @@ draw_text(GtkPrintContext *context, const gchar *text, check_item_t *data,
|
||||
/* Clip text to the enclosing rectangle */
|
||||
if (data->w && data->h)
|
||||
{
|
||||
g_debug("Text clip rectangle, coords %f,%f, size %f,%f",
|
||||
DEBUG("Text clip rectangle, coords %f,%f, size %f,%f",
|
||||
data->x, data->y - data->h, data->w, data->h);
|
||||
cairo_rectangle(cr, data->x, data->y - data->h, data->w, data->h);
|
||||
cairo_clip_preserve(cr);
|
||||
}
|
||||
|
||||
/* Draw the text */
|
||||
g_debug("Text move to %f,%f, print '%s'", data->x, data->y,
|
||||
DEBUG("Text move to %f,%f, print '%s'", data->x, data->y,
|
||||
text ? text : "(null)");
|
||||
cairo_move_to(cr, data->x, data->y - height);
|
||||
pango_cairo_show_layout(cr, layout);
|
||||
@@ -1963,13 +1963,13 @@ draw_picture(GtkPrintContext *context, check_item_t *data)
|
||||
if (data->w && data->h)
|
||||
{
|
||||
cairo_rectangle(cr, data->x, data->y - data->h, data->w, data->h);
|
||||
g_debug("Picture clip rectangle, user coords %f,%f, user size %f,%f",
|
||||
DEBUG("Picture clip rectangle, user coords %f,%f, user size %f,%f",
|
||||
data->x, data->y - data->h, data->w, data->h);
|
||||
}
|
||||
else
|
||||
{
|
||||
cairo_rectangle(cr, data->x, data->y - pix_h, pix_w, pix_h);
|
||||
g_debug("Picture clip rectangle, user coords %f,%f, pic size %d,%d",
|
||||
DEBUG("Picture clip rectangle, user coords %f,%f, pic size %d,%d",
|
||||
data->x, data->y - data->h, pix_w, pix_h);
|
||||
}
|
||||
cairo_clip_preserve(cr);
|
||||
@@ -2265,8 +2265,8 @@ draw_check_format(GtkPrintContext *context, gint position,
|
||||
* need to be moved (hence the test for position > 0 above. */
|
||||
cairo_translate(cr, 0, format->height); /* Translation is relative to previous
|
||||
check translation, not to page border ! */
|
||||
g_debug("Position %d translated by %f relative to previous check (pre-defined)", position, format->height);
|
||||
g_debug(" by %f relative to page (pre-defined)", position * format->height);
|
||||
DEBUG("Position %d translated by %f relative to previous check (pre-defined)", position, format->height);
|
||||
DEBUG(" by %f relative to page (pre-defined)", position * format->height);
|
||||
}
|
||||
else if (position == pcd->position_max)
|
||||
{
|
||||
@@ -2275,10 +2275,10 @@ draw_check_format(GtkPrintContext *context, gint position,
|
||||
x = multip * gtk_spin_button_get_value(pcd->translation_x);
|
||||
y = multip * gtk_spin_button_get_value(pcd->translation_y);
|
||||
cairo_translate(cr, x, y);
|
||||
g_debug("Position translated by %f,%f (custom)", x, y);
|
||||
DEBUG("Position translated by %f,%f (custom)", x, y);
|
||||
r = gtk_spin_button_get_value(pcd->check_rotation);
|
||||
cairo_rotate(cr, r * DEGREES_TO_RADIANS);
|
||||
g_debug("Position rotated by %f degrees (custom)", r);
|
||||
DEBUG("Position rotated by %f degrees (custom)", r);
|
||||
}
|
||||
|
||||
/* Draw layout boxes if requested. Also useful when determining check
|
||||
@@ -2317,12 +2317,12 @@ draw_check_custom(GtkPrintContext *context, gpointer user_data)
|
||||
degrees = gtk_spin_button_get_value(pcd->check_rotation);
|
||||
cr = gtk_print_context_get_cairo_context(context);
|
||||
cairo_rotate(cr, degrees * DEGREES_TO_RADIANS);
|
||||
g_debug("Page rotated by %f degrees", degrees);
|
||||
DEBUG("Page rotated by %f degrees", degrees);
|
||||
|
||||
x = multip * gtk_spin_button_get_value(pcd->translation_x);
|
||||
y = multip * gtk_spin_button_get_value(pcd->translation_y);
|
||||
cairo_translate(cr, x, y);
|
||||
g_debug("Page translated by %f,%f", x, y);
|
||||
DEBUG("Page translated by %f,%f", x, y);
|
||||
|
||||
item.x = multip * gtk_spin_button_get_value(pcd->payee_x);
|
||||
item.y = multip * gtk_spin_button_get_value(pcd->payee_y);
|
||||
@@ -2438,9 +2438,9 @@ draw_page(GtkPrintOperation *operation,
|
||||
|
||||
/* Do page level translations/rotations */
|
||||
cairo_translate(cr, format->trans_x, format->trans_y);
|
||||
g_debug("Page translated by %f,%f", format->trans_x, format->trans_y);
|
||||
DEBUG("Page translated by %f,%f", format->trans_x, format->trans_y);
|
||||
cairo_rotate(cr, format->rotation * DEGREES_TO_RADIANS);
|
||||
g_debug("Page rotated by %f degrees", format->rotation);
|
||||
DEBUG("Page rotated by %f degrees", format->rotation);
|
||||
|
||||
/* The grid is useful when determining check layouts */
|
||||
if (format->show_grid)
|
||||
|
||||
@@ -364,7 +364,7 @@ gnc_sxed_check_dates_changed (GncSxEditorDialog *sxed)
|
||||
sx_start_date = *xaccSchedXactionGetStartDate (sxed->sx);
|
||||
sx_schedule_str = recurrenceListToString (gnc_sx_get_schedule (sxed->sx));
|
||||
|
||||
g_debug ("dialog schedule [%s], sx schedule [%s]",
|
||||
DEBUG ("dialog schedule [%s], sx schedule [%s]",
|
||||
dialog_schedule_str, sx_schedule_str);
|
||||
|
||||
schedules_are_the_same = (strcmp (dialog_schedule_str,
|
||||
@@ -1000,7 +1000,7 @@ gnc_sxed_save_sx (GncSxEditorDialog *sxed)
|
||||
gnc_sx_set_schedule (sxed->sx, schedule);
|
||||
{
|
||||
gchar *recurrence_str = recurrenceListToCompactString (schedule);
|
||||
g_debug ("recurrences parsed [%s]", recurrence_str);
|
||||
DEBUG ("recurrences parsed [%s]", recurrence_str);
|
||||
g_free (recurrence_str);
|
||||
}
|
||||
|
||||
@@ -1173,7 +1173,7 @@ gnc_ui_scheduled_xaction_editor_dialog_create (GtkWindow *parent,
|
||||
sx);
|
||||
if (dlgExists)
|
||||
{
|
||||
g_debug ("dialog already exists; using that one.");
|
||||
DEBUG ("dialog already exists; using that one.");
|
||||
sxed = (GncSxEditorDialog*)dlgExists->data;
|
||||
gtk_window_present (GTK_WINDOW (sxed->dialog));
|
||||
g_list_free (dlgExists);
|
||||
|
||||
@@ -421,7 +421,7 @@ gnc_sxed_check_changed (GncSxEditorDialog2 *sxed)
|
||||
sx_start_date = *xaccSchedXactionGetStartDate (sxed->sx);
|
||||
sx_schedule_str = recurrenceListToString (gnc_sx_get_schedule (sxed->sx));
|
||||
|
||||
g_debug ("dialog schedule [%s], sx schedule [%s]",
|
||||
DEBUG ("dialog schedule [%s], sx schedule [%s]",
|
||||
dialog_schedule_str, sx_schedule_str);
|
||||
|
||||
schedules_are_the_same = (strcmp (dialog_schedule_str, sx_schedule_str) == 0);
|
||||
@@ -485,7 +485,7 @@ check_credit_debit_balance (gpointer key,
|
||||
if (gnc_numeric_zero_p (gnc_numeric_sub_fixed (tcds->debitSum,
|
||||
tcds->creditSum)))
|
||||
{
|
||||
g_debug ("%p | true [%s - %s = %s]",
|
||||
DEBUG ("%p | true [%s - %s = %s]",
|
||||
key,
|
||||
gnc_numeric_to_string (tcds->debitSum),
|
||||
gnc_numeric_to_string (tcds->creditSum),
|
||||
@@ -494,7 +494,7 @@ check_credit_debit_balance (gpointer key,
|
||||
}
|
||||
else
|
||||
{
|
||||
g_debug ("%p | false [%s - %s = %s]",
|
||||
DEBUG ("%p | false [%s - %s = %s]",
|
||||
key,
|
||||
gnc_numeric_to_string (tcds->debitSum),
|
||||
gnc_numeric_to_string (tcds->creditSum),
|
||||
@@ -970,7 +970,7 @@ gnc_sxed_save_sx (GncSxEditorDialog2 *sxed )
|
||||
gnc_sx_set_schedule (sxed->sx, schedule);
|
||||
{
|
||||
gchar *recurrence_str = recurrenceListToCompactString (schedule);
|
||||
g_debug("recurrences parsed [%s]", recurrence_str);
|
||||
DEBUG("recurrences parsed [%s]", recurrence_str);
|
||||
g_free (recurrence_str);
|
||||
}
|
||||
|
||||
@@ -1122,7 +1122,7 @@ gnc_ui_scheduled_xaction_editor_dialog_create2 (GtkWindow *parent,
|
||||
sx);
|
||||
if (dlgExists != NULL)
|
||||
{
|
||||
g_debug ("dialog already exists; using that one.");
|
||||
DEBUG ("dialog already exists; using that one.");
|
||||
sxed = (GncSxEditorDialog2*)dlgExists->data;
|
||||
gtk_window_present (GTK_WINDOW (sxed->dialog));
|
||||
g_list_free (dlgExists);
|
||||
|
||||
@@ -650,16 +650,16 @@ gnc_sx_trans_window_response_cb (GtkDialog *dialog,
|
||||
switch (response)
|
||||
{
|
||||
case GTK_RESPONSE_OK:
|
||||
g_debug(" OK");
|
||||
DEBUG(" OK");
|
||||
sxftd_ok_clicked(sxfti);
|
||||
break;
|
||||
case SXFTD_RESPONSE_ADVANCED:
|
||||
g_debug(" ADVANCED");
|
||||
DEBUG(" ADVANCED");
|
||||
sxftd_advanced_clicked(sxfti);
|
||||
break;
|
||||
case GTK_RESPONSE_CANCEL:
|
||||
default:
|
||||
g_debug(" CANCEL");
|
||||
DEBUG(" CANCEL");
|
||||
sxftd_close(sxfti, TRUE);
|
||||
break;
|
||||
|
||||
|
||||
@@ -938,7 +938,7 @@ variable_value_changed_cb (GtkCellRendererText *cell,
|
||||
gnc_numeric parsed_num;
|
||||
char *endStr = NULL;
|
||||
|
||||
g_debug ("variable to [%s] at path [%s]", value, path);
|
||||
DEBUG ("variable to [%s] at path [%s]", value, path);
|
||||
if (!gtk_tree_model_get_iter_from_string (GTK_TREE_MODEL(dialog->editing_model), &tree_iter, path))
|
||||
{
|
||||
g_warning ("invalid path [%s]", path);
|
||||
@@ -955,7 +955,7 @@ variable_value_changed_cb (GtkCellRendererText *cell,
|
||||
|| gnc_numeric_check (parsed_num) != GNC_ERROR_OK)
|
||||
{
|
||||
gchar *value_copy = g_strdup (value);
|
||||
g_debug ("value=[%s] endStr[%s]", value, endStr);
|
||||
DEBUG ("value=[%s] endStr[%s]", value, endStr);
|
||||
if (strlen (g_strstrip (value_copy)) == 0)
|
||||
{
|
||||
gnc_numeric invalid_num = gnc_numeric_error (GNC_ERROR_ARG);
|
||||
@@ -1155,7 +1155,7 @@ dialog_response_cb (GtkDialog *dialog, gint response_id, GncSxSinceLastRunDialog
|
||||
{
|
||||
GList *unbound_variables;
|
||||
unbound_variables = gnc_sx_instance_model_check_variables (app_dialog->editing_model->instances);
|
||||
g_message ("%d variables unbound", g_list_length (unbound_variables));
|
||||
PINFO ("%d variables unbound", g_list_length (unbound_variables));
|
||||
if (g_list_length (unbound_variables) > 0)
|
||||
{
|
||||
// focus first variable
|
||||
|
||||
@@ -1581,7 +1581,7 @@ gnc_budget_view_refresh (GncBudgetView *budget_view)
|
||||
num_periods = gnc_budget_get_num_periods (priv->budget);
|
||||
|
||||
col_list = priv->period_col_list;
|
||||
totals_col_list = priv->totals_col_list;
|
||||
totals_col_list = g_list_reverse (priv->totals_col_list);
|
||||
num_periods_visible = g_list_length (col_list);
|
||||
|
||||
/* Hide any unneeded extra columns */
|
||||
@@ -1592,9 +1592,9 @@ gnc_budget_view_refresh (GncBudgetView *budget_view)
|
||||
col_list = g_list_delete_link (col_list, g_list_last (col_list));
|
||||
num_periods_visible = g_list_length (col_list);
|
||||
|
||||
col = GTK_TREE_VIEW_COLUMN((g_list_last (totals_col_list))->data);
|
||||
col = GTK_TREE_VIEW_COLUMN(totals_col_list->data);
|
||||
gtk_tree_view_remove_column (GTK_TREE_VIEW(priv->totals_tree_view), col);
|
||||
totals_col_list = g_list_delete_link (totals_col_list, g_list_last (totals_col_list));
|
||||
totals_col_list = g_list_delete_link (totals_col_list, totals_col_list);
|
||||
}
|
||||
|
||||
gnc_tree_view_configure_columns (GNC_TREE_VIEW(priv->tree_view));
|
||||
|
||||
@@ -821,7 +821,7 @@ static void gnc_business_assign_payment (GtkWindow *parent,
|
||||
if (xaccTransCountSplits(trans) <= 1)
|
||||
return;
|
||||
|
||||
//g_message("Creating payment dialog with trans %p", trans);
|
||||
//PINFO("Creating payment dialog with trans %p", trans);
|
||||
gnc_ui_payment_new_with_txn(parent, owner, trans);
|
||||
}
|
||||
|
||||
|
||||
@@ -1657,7 +1657,7 @@ gnc_plugin_page_account_tree_cmd_delete_account (GtkAction *action, GncPluginPag
|
||||
acct_name = g_strdup (_("(no name)"));
|
||||
|
||||
if (gnc_account_n_children(account) > 1) {
|
||||
gchar* message = g_strdup_printf("Account '%s' has more than one subaccount, move subaccounts or delete them before attempting to delete this account.", acct_name);
|
||||
gchar* message = g_strdup_printf(_("The account \"%s\" has more than one subaccount.\n\nMove the subaccounts or delete them before attempting to delete this account."), acct_name);
|
||||
gnc_error_dialog(GTK_WINDOW(window),"%s", message);
|
||||
g_free (message);
|
||||
g_free(acct_name);
|
||||
|
||||
@@ -769,7 +769,7 @@ gnc_plugin_page_sx_list_cmd_edit (GtkAction *action, GncPluginPageSxList *page)
|
||||
gppsl_update_selected_list (page, TRUE, NULL);
|
||||
for (GList *list = to_edit; list != NULL; list = list->next)
|
||||
{
|
||||
g_debug ("to-edit [%s]\n", xaccSchedXactionGetName ((SchedXaction*)list->data));
|
||||
DEBUG ("to-edit [%s]\n", xaccSchedXactionGetName ((SchedXaction*)list->data));
|
||||
gppsl_update_selected_list (page, FALSE, list->data);
|
||||
}
|
||||
|
||||
@@ -877,7 +877,7 @@ gnc_plugin_page_sx_list_cmd_delete (GtkAction *action, GncPluginPageSxList *page
|
||||
gppsl_update_selected_list (page, TRUE, NULL);
|
||||
for (GList *list = to_delete; list != NULL; list = list->next)
|
||||
{
|
||||
g_debug("to-delete [%s]\n", xaccSchedXactionGetName ((SchedXaction*)list->data));
|
||||
DEBUG("to-delete [%s]\n", xaccSchedXactionGetName ((SchedXaction*)list->data));
|
||||
gppsl_update_selected_list (page, FALSE, list->data);
|
||||
}
|
||||
g_list_foreach (to_delete, (GFunc)_destroy_sx, NULL);
|
||||
|
||||
@@ -313,8 +313,21 @@ recnRecalculateBalance (RecnWindow *recnData)
|
||||
}
|
||||
|
||||
|
||||
/* amount_edit_focus_out_cb
|
||||
* Callback on focus-out event for statement Ending Balance.
|
||||
* Sets the user_set_value flag true if the amount entered is
|
||||
* different to the calculated Ending Balance as at the default
|
||||
* Statement Date. This prevents the entered Ending Balance
|
||||
* being recalculated if the Statement Date is changed.
|
||||
*
|
||||
* Args: widget - Ending Balance widget
|
||||
* event - event triggering this callback
|
||||
* data - structure containing info about this
|
||||
* reconciliation process.
|
||||
* Returns: False - propagate the event to the widget's parent.
|
||||
*/
|
||||
static gboolean
|
||||
gnc_start_recn_update_cb(GtkWidget *widget, GdkEventFocus *event,
|
||||
amount_edit_focus_out_cb(GtkWidget *widget, GdkEventFocus *event,
|
||||
startRecnWindowData *data)
|
||||
{
|
||||
gnc_numeric value;
|
||||
@@ -336,12 +349,19 @@ gnc_start_recn_update_cb(GtkWidget *widget, GdkEventFocus *event,
|
||||
}
|
||||
|
||||
|
||||
/* If the user changed the date edit widget, update the
|
||||
* ending balance to reflect the ending balance of the account
|
||||
* on the date that the date edit was changed to.
|
||||
/* recn_date_changed_cb
|
||||
* Callback on date_changed event for Statement Date.
|
||||
* If the user changed the date edit widget, and the Ending
|
||||
* Balance wasn't entered, update the Ending Balance to reflect
|
||||
* the ending balance of the account as at Statement Date.
|
||||
*
|
||||
* Args: widget - Statement Date edit widget
|
||||
* data - structure containing info about this
|
||||
* reconciliation.
|
||||
* Returns: none.
|
||||
*/
|
||||
static void
|
||||
gnc_start_recn_date_changed (GtkWidget *widget, startRecnWindowData *data)
|
||||
recn_date_changed_cb (GtkWidget *widget, startRecnWindowData *data)
|
||||
{
|
||||
GNCDateEdit *gde = GNC_DATE_EDIT (widget);
|
||||
gnc_numeric new_balance;
|
||||
@@ -402,8 +422,6 @@ actions on this account. Please double-check this is the date you intended."));
|
||||
/* update the amount edit with the amount */
|
||||
gnc_amount_edit_set_amount (GNC_AMOUNT_EDIT (data->end_value),
|
||||
new_balance);
|
||||
|
||||
gnc_start_recn_update_cb (GTK_WIDGET(data->end_value), NULL, data);
|
||||
}
|
||||
|
||||
|
||||
@@ -414,7 +432,7 @@ gnc_start_recn_children_changed (GtkWidget *widget, startRecnWindowData *data)
|
||||
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
|
||||
|
||||
/* Force an update of the ending balance */
|
||||
gnc_start_recn_date_changed (data->date_value, data);
|
||||
recn_date_changed_cb (data->date_value, data);
|
||||
}
|
||||
|
||||
|
||||
@@ -750,7 +768,7 @@ startRecnWindow(GtkWidget *parent, Account *account,
|
||||
|
||||
/* need to get a callback on date changes to update the recn balance */
|
||||
g_signal_connect ( G_OBJECT (date_value), "date_changed",
|
||||
G_CALLBACK (gnc_start_recn_date_changed), (gpointer) &data );
|
||||
G_CALLBACK (recn_date_changed_cb), (gpointer) &data );
|
||||
|
||||
print_info.use_symbol = 0;
|
||||
gnc_amount_edit_set_print_info (GNC_AMOUNT_EDIT (end_value), print_info);
|
||||
@@ -762,7 +780,7 @@ startRecnWindow(GtkWidget *parent, Account *account,
|
||||
entry = gnc_amount_edit_gtk_entry (GNC_AMOUNT_EDIT (end_value));
|
||||
gtk_editable_select_region (GTK_EDITABLE(entry), 0, -1);
|
||||
fo_handler_id = g_signal_connect (G_OBJECT(entry), "focus-out-event",
|
||||
G_CALLBACK(gnc_start_recn_update_cb),
|
||||
G_CALLBACK(amount_edit_focus_out_cb),
|
||||
(gpointer) &data);
|
||||
gtk_entry_set_activates_default(GTK_ENTRY(entry), TRUE);
|
||||
|
||||
|
||||
@@ -90,7 +90,7 @@ static void
|
||||
update_message(const gchar *msg)
|
||||
{
|
||||
gnc_update_splash_screen(msg, GNC_SPLASH_PERCENTAGE_UNKNOWN);
|
||||
g_message("%s", msg);
|
||||
PINFO("%s", msg);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -137,10 +137,6 @@ gnc_log_init (const std::vector <std::string> log_flags,
|
||||
g_free (tracefilename);
|
||||
}
|
||||
|
||||
// set a reasonable default.
|
||||
qof_log_set_default(QOF_LOG_WARNING);
|
||||
gnc_log_default();
|
||||
|
||||
if (gnc_prefs_is_debugging_enabled())
|
||||
{
|
||||
qof_log_set_level ("", QOF_LOG_INFO);
|
||||
@@ -274,9 +270,6 @@ Gnucash::CoreApp::parse_command_line (int argc, char **argv)
|
||||
|
||||
gnc_prefs_set_debugging (m_debug);
|
||||
gnc_prefs_set_extra (m_extra);
|
||||
|
||||
if (m_gsettings_prefix)
|
||||
gnc_gsettings_set_prefix (m_gsettings_prefix->c_str());
|
||||
}
|
||||
|
||||
/* Define command line options common to all gnucash binaries. */
|
||||
@@ -296,9 +289,7 @@ Gnucash::CoreApp::add_common_program_options (void)
|
||||
("log", bpo::value (&m_log_flags),
|
||||
_("Log level overrides, of the form \"modulename={debug,info,warn,crit,error}\"\nExamples: \"--log qof=debug\" or \"--log gnc.backend.file.sx=info\"\nThis can be invoked multiple times."))
|
||||
("logto", bpo::value (&m_log_to_filename),
|
||||
_("File to log into; defaults to \"/tmp/gnucash.trace\"; can be \"stderr\" or \"stdout\"."))
|
||||
("gsettings-prefix", bpo::value (&m_gsettings_prefix),
|
||||
_("Set the prefix for gsettings schemas for gsettings queries. This can be useful to have a different settings tree while debugging."));
|
||||
_("File to log into; defaults to \"/tmp/gnucash.trace\"; can be \"stderr\" or \"stdout\"."));
|
||||
|
||||
bpo::options_description hidden_options(_("Hidden Options"));
|
||||
hidden_options.add_options()
|
||||
|
||||
@@ -145,9 +145,6 @@ scm_run_gnucash (void *data, [[maybe_unused]] int argc, [[maybe_unused]] char **
|
||||
scm_set_current_module(main_mod);
|
||||
scm_c_use_module("gnucash app-utils");
|
||||
|
||||
/* Check whether the settings need a version update */
|
||||
gnc_gsettings_version_upgrade ();
|
||||
|
||||
gnc_gnome_utils_init();
|
||||
gnc_search_core_initialize ();
|
||||
gnc_hook_add_dangler(HOOK_UI_SHUTDOWN, (GFunc)gnc_search_core_finalize, NULL, NULL);
|
||||
|
||||
@@ -1,32 +1,38 @@
|
||||
|
||||
set(gschema_SOURCES
|
||||
org.gnucash.dialogs.business.gschema.xml
|
||||
org.gnucash.dialogs.checkprinting.gschema.xml
|
||||
org.gnucash.dialogs.commodities.gschema.xml
|
||||
org.gnucash.dialogs.export.csv.gschema.xml
|
||||
org.gnucash.dialogs.gschema.xml
|
||||
org.gnucash.dialogs.import.csv.gschema.xml
|
||||
org.gnucash.dialogs.import.generic.gschema.xml
|
||||
org.gnucash.dialogs.import.qif.gschema.xml
|
||||
org.gnucash.dialogs.reconcile.gschema.xml
|
||||
org.gnucash.dialogs.sxs.gschema.xml
|
||||
org.gnucash.dialogs.totd.gschema.xml
|
||||
org.gnucash.general.finance-quote.gschema.xml
|
||||
org.gnucash.gschema.xml
|
||||
org.gnucash.history.gschema.xml
|
||||
org.gnucash.warnings.gschema.xml
|
||||
org.gnucash.window.pages.account.tree.gschema.xml
|
||||
org.gnucash.window.pages.gschema.xml
|
||||
org.gnucash.GnuCash.deprecated.gschema.xml
|
||||
org.gnucash.GnuCash.dialogs.business.gschema.xml
|
||||
org.gnucash.GnuCash.dialogs.checkprinting.gschema.xml
|
||||
org.gnucash.GnuCash.dialogs.commodities.gschema.xml
|
||||
org.gnucash.GnuCash.dialogs.export.csv.gschema.xml
|
||||
org.gnucash.GnuCash.dialogs.gschema.xml
|
||||
org.gnucash.GnuCash.dialogs.import.csv.gschema.xml
|
||||
org.gnucash.GnuCash.dialogs.import.generic.gschema.xml
|
||||
org.gnucash.GnuCash.dialogs.import.qif.gschema.xml
|
||||
org.gnucash.GnuCash.dialogs.reconcile.gschema.xml
|
||||
org.gnucash.GnuCash.dialogs.sxs.gschema.xml
|
||||
org.gnucash.GnuCash.dialogs.totd.gschema.xml
|
||||
org.gnucash.GnuCash.general.finance-quote.gschema.xml
|
||||
org.gnucash.GnuCash.gschema.xml
|
||||
org.gnucash.GnuCash.history.gschema.xml
|
||||
org.gnucash.GnuCash.warnings.gschema.xml
|
||||
org.gnucash.GnuCash.window.pages.account.tree.gschema.xml
|
||||
org.gnucash.GnuCash.window.pages.gschema.xml
|
||||
)
|
||||
|
||||
add_gschema_targets("${gschema_SOURCES}")
|
||||
|
||||
# Provide gnucash runtime with a list of migratable preferences
|
||||
configure_file(migratable-prefs.xml ${DATADIR_BUILD}/${PROJECT_NAME}/migratable-prefs.xml COPYONLY)
|
||||
install(FILES ${DATADIR_BUILD}/${PROJECT_NAME}/migratable-prefs.xml
|
||||
DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME})
|
||||
|
||||
# Handle gschemas.compiled
|
||||
if (COMPILE_GSCHEMAS)
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${SCHEMADIR_BUILD}/gschemas.compiled
|
||||
COMMAND ${CMAKE_COMMAND} -E env ${GLIB_COMPILE_SCHEMAS} ${SCHEMADIR_BUILD}
|
||||
COMMAND ${CMAKE_COMMAND} -E env ${GLIB_COMPILE_SCHEMAS} --strict ${SCHEMADIR_BUILD}
|
||||
DEPENDS ${gschema_depends}
|
||||
)
|
||||
|
||||
@@ -45,10 +51,10 @@ if (COMPILE_GSCHEMAS)
|
||||
endif()
|
||||
execute_process(
|
||||
COMMAND ${SHELL} -c \"echo Compiling gschema files in \$ENV\{DESTDIR\}${CMAKE_INSTALL_FULL_DATADIR}/glib-2.0/schemas ;
|
||||
${GLIB_COMPILE_SCHEMAS} \$ENV\{DESTDIR\}${CMAKE_INSTALL_FULL_DATADIR}/glib-2.0/schemas\")")
|
||||
${GLIB_COMPILE_SCHEMAS} --strict \$ENV\{DESTDIR\}${CMAKE_INSTALL_FULL_DATADIR}/glib-2.0/schemas\")")
|
||||
endif()
|
||||
|
||||
set(gschemas_DIST_local "")
|
||||
set(gschemas_DIST_local migratable-prefs.xml)
|
||||
foreach(file ${gschema_SOURCES})
|
||||
list(APPEND gschemas_DIST_local ${file}.in)
|
||||
endforeach()
|
||||
|
||||
1299
gnucash/gschemas/migratable-prefs.xml
Normal file
1299
gnucash/gschemas/migratable-prefs.xml
Normal file
File diff suppressed because it is too large
Load Diff
1691
gnucash/gschemas/org.gnucash.GnuCash.deprecated.gschema.xml.in
Normal file
1691
gnucash/gschemas/org.gnucash.GnuCash.deprecated.gschema.xml.in
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,17 +1,17 @@
|
||||
<schemalist gettext-domain="@PROJECT_NAME@">
|
||||
<schema id="org.gnucash.dialogs.business" path="/org/gnucash/dialogs/business/">
|
||||
<child name="customer-search" schema="org.gnucash.dialogs.business.customer-search"/>
|
||||
<child name="employee-search" schema="org.gnucash.dialogs.business.employee-search"/>
|
||||
<child name="invoice-search" schema="org.gnucash.dialogs.business.invoice-search"/>
|
||||
<child name="job-search" schema="org.gnucash.dialogs.business.job-search"/>
|
||||
<child name="order-search" schema="org.gnucash.dialogs.business.order-search"/>
|
||||
<child name="vendor-search" schema="org.gnucash.dialogs.business.vendor-search"/>
|
||||
<child name="invoice" schema="org.gnucash.dialogs.business.invoice"/>
|
||||
<child name="bill" schema="org.gnucash.dialogs.business.bill"/>
|
||||
<child name="tax-tables" schema="org.gnucash.dialogs.business.tax-tables"/>
|
||||
<schema id="org.gnucash.GnuCash.dialogs.business" path="/org/gnucash/GnuCash/dialogs/business/">
|
||||
<child name="customer-search" schema="org.gnucash.GnuCash.dialogs.business.customer-search"/>
|
||||
<child name="employee-search" schema="org.gnucash.GnuCash.dialogs.business.employee-search"/>
|
||||
<child name="invoice-search" schema="org.gnucash.GnuCash.dialogs.business.invoice-search"/>
|
||||
<child name="job-search" schema="org.gnucash.GnuCash.dialogs.business.job-search"/>
|
||||
<child name="order-search" schema="org.gnucash.GnuCash.dialogs.business.order-search"/>
|
||||
<child name="vendor-search" schema="org.gnucash.GnuCash.dialogs.business.vendor-search"/>
|
||||
<child name="invoice" schema="org.gnucash.GnuCash.dialogs.business.invoice"/>
|
||||
<child name="bill" schema="org.gnucash.GnuCash.dialogs.business.bill"/>
|
||||
<child name="tax-tables" schema="org.gnucash.GnuCash.dialogs.business.tax-tables"/>
|
||||
</schema>
|
||||
|
||||
<schema id="org.gnucash.dialogs.business.customer-search" path="/org/gnucash/dialogs/business/customer-search/">
|
||||
<schema id="org.gnucash.GnuCash.dialogs.business.customer-search" path="/org/gnucash/GnuCash/dialogs/business/customer-search/">
|
||||
<key name="last-geometry" type="(iiii)">
|
||||
<default>(-1,-1,-1,-1)</default>
|
||||
<summary>Last window position and size</summary>
|
||||
@@ -26,7 +26,7 @@
|
||||
</key>
|
||||
</schema>
|
||||
|
||||
<schema id="org.gnucash.dialogs.business.employee-search" path="/org/gnucash/dialogs/business/employee-search/">
|
||||
<schema id="org.gnucash.GnuCash.dialogs.business.employee-search" path="/org/gnucash/GnuCash/dialogs/business/employee-search/">
|
||||
<key name="last-geometry" type="(iiii)">
|
||||
<default>(-1,-1,-1,-1)</default>
|
||||
<summary>Last window position and size</summary>
|
||||
@@ -41,7 +41,7 @@
|
||||
</key>
|
||||
</schema>
|
||||
|
||||
<schema id="org.gnucash.dialogs.business.invoice-search" path="/org/gnucash/dialogs/business/invoice-search/">
|
||||
<schema id="org.gnucash.GnuCash.dialogs.business.invoice-search" path="/org/gnucash/GnuCash/dialogs/business/invoice-search/">
|
||||
<key name="last-geometry" type="(iiii)">
|
||||
<default>(-1,-1,-1,-1)</default>
|
||||
<summary>Last window position and size</summary>
|
||||
@@ -56,7 +56,7 @@
|
||||
</key>
|
||||
</schema>
|
||||
|
||||
<schema id="org.gnucash.dialogs.business.job-search" path="/org/gnucash/dialogs/business/job-search/">
|
||||
<schema id="org.gnucash.GnuCash.dialogs.business.job-search" path="/org/gnucash/GnuCash/dialogs/business/job-search/">
|
||||
<key name="last-geometry" type="(iiii)">
|
||||
<default>(-1,-1,-1,-1)</default>
|
||||
<summary>Last window position and size</summary>
|
||||
@@ -71,7 +71,7 @@
|
||||
</key>
|
||||
</schema>
|
||||
|
||||
<schema id="org.gnucash.dialogs.business.order-search" path="/org/gnucash/dialogs/business/order-search/">
|
||||
<schema id="org.gnucash.GnuCash.dialogs.business.order-search" path="/org/gnucash/GnuCash/dialogs/business/order-search/">
|
||||
<key name="last-geometry" type="(iiii)">
|
||||
<default>(-1,-1,-1,-1)</default>
|
||||
<summary>Last window position and size</summary>
|
||||
@@ -86,7 +86,7 @@
|
||||
</key>
|
||||
</schema>
|
||||
|
||||
<schema id="org.gnucash.dialogs.business.vendor-search" path="/org/gnucash/dialogs/business/vendor-search/">
|
||||
<schema id="org.gnucash.GnuCash.dialogs.business.vendor-search" path="/org/gnucash/GnuCash/dialogs/business/vendor-search/">
|
||||
<key name="last-geometry" type="(iiii)">
|
||||
<default>(-1,-1,-1,-1)</default>
|
||||
<summary>Last window position and size</summary>
|
||||
@@ -101,7 +101,7 @@
|
||||
</key>
|
||||
</schema>
|
||||
|
||||
<schema id="org.gnucash.dialogs.business.invoice" path="/org/gnucash/dialogs/business/invoice/">
|
||||
<schema id="org.gnucash.GnuCash.dialogs.business.invoice" path="/org/gnucash/GnuCash/dialogs/business/invoice/">
|
||||
<key name="tax-included" type="b">
|
||||
<default>true</default>
|
||||
<summary>Is tax included in this type of business entry?</summary>
|
||||
@@ -143,7 +143,7 @@
|
||||
<description>If this field is active then multiple entries in an invoice that transfer to the same account will be accumulated into a single split. This field can be overridden per invoice in the Posting dialog.</description>
|
||||
</key>
|
||||
</schema>
|
||||
<schema id="org.gnucash.dialogs.business.bill" path="/org/gnucash/dialogs/business/bill/">
|
||||
<schema id="org.gnucash.GnuCash.dialogs.business.bill" path="/org/gnucash/GnuCash/dialogs/business/bill/">
|
||||
<key name="tax-included" type="b">
|
||||
<default>true</default>
|
||||
<summary>Is tax included in this type of business entry?</summary>
|
||||
@@ -166,7 +166,7 @@
|
||||
</key>
|
||||
</schema>
|
||||
|
||||
<schema id="org.gnucash.dialogs.business.tax-tables" path="/org/gnucash/dialogs/business/tax-tables/">
|
||||
<schema id="org.gnucash.GnuCash.dialogs.business.tax-tables" path="/org/gnucash/GnuCash/dialogs/business/tax-tables/">
|
||||
<key name="last-geometry" type="(iiii)">
|
||||
<default>(-1,-1,-1,-1)</default>
|
||||
<summary>Last window position and size</summary>
|
||||
@@ -1,5 +1,5 @@
|
||||
<schemalist gettext-domain="@PROJECT_NAME@">
|
||||
<schema id="org.gnucash.dialogs.checkprinting" path="/org/gnucash/dialogs/print-checks/">
|
||||
<schema id="org.gnucash.GnuCash.dialogs.checkprinting" path="/org/gnucash/GnuCash/dialogs/print-checks/">
|
||||
<key name="check-format-guid" type="s">
|
||||
<default>''</default>
|
||||
<summary>GUID of predefined check format to use</summary>
|
||||
@@ -1,5 +1,5 @@
|
||||
<schemalist gettext-domain="@PROJECT_NAME@">
|
||||
<schema id="org.gnucash.dialogs.commodities" path="/org/gnucash/dialogs/commodities/">
|
||||
<schema id="org.gnucash.GnuCash.dialogs.commodities" path="/org/gnucash/GnuCash/dialogs/commodities/">
|
||||
<key name="include-iso" type="b">
|
||||
<default>false</default>
|
||||
<summary>Show currencies in this dialog</summary>
|
||||
@@ -1,5 +1,5 @@
|
||||
<schemalist gettext-domain="@PROJECT_NAME@">
|
||||
<schema id="org.gnucash.dialogs.export.csv" path="/org/gnucash/dialogs/export/csv/">
|
||||
<schema id="org.gnucash.GnuCash.dialogs.export.csv" path="/org/gnucash/GnuCash/dialogs/export/csv/">
|
||||
<key name="last-geometry" type="(iiii)">
|
||||
<default>(-1,-1,-1,-1)</default>
|
||||
<summary>Last window position and size</summary>
|
||||
@@ -1,32 +1,32 @@
|
||||
<schemalist gettext-domain="@PROJECT_NAME@">
|
||||
<schema id="org.gnucash.dialogs" path="/org/gnucash/dialogs/">
|
||||
<child name="account" schema="org.gnucash.dialogs.account"/>
|
||||
<child name="imap-editor" schema="org.gnucash.dialogs.imap-editor"/>
|
||||
<child name="preferences" schema="org.gnucash.dialogs.preferences"/>
|
||||
<child name="price-editor" schema="org.gnucash.dialogs.price-editor"/>
|
||||
<child name="pricedb-editor" schema="org.gnucash.dialogs.pricedb-editor"/>
|
||||
<child name="reset-warnings" schema="org.gnucash.dialogs.reset-warnings"/>
|
||||
<child name="tax-info" schema="org.gnucash.dialogs.tax-info"/>
|
||||
<child name="fincalc" schema="org.gnucash.dialogs.fincalc"/>
|
||||
<child name="find" schema="org.gnucash.dialogs.find"/>
|
||||
<child name="find-account" schema="org.gnucash.dialogs.find-account"/>
|
||||
<child name="export-accounts" schema="org.gnucash.dialogs.export-accounts"/>
|
||||
<child name="log-replay" schema="org.gnucash.dialogs.log-replay"/>
|
||||
<child name="open-save" schema="org.gnucash.dialogs.open-save"/>
|
||||
<child name="report" schema="org.gnucash.dialogs.report"/>
|
||||
<child name="report-saved-configs" schema="org.gnucash.dialogs.report-saved-configs"/>
|
||||
<child name="lot-viewer" schema="org.gnucash.dialogs.lot-viewer"/>
|
||||
<child name="new-user" schema="org.gnucash.dialogs.new-user"/>
|
||||
<child name="new-hierarchy" schema="org.gnucash.dialogs.new-hierarchy"/>
|
||||
<child name="search" schema="org.gnucash.dialogs.search"/>
|
||||
<child name="transfer" schema="org.gnucash.dialogs.transfer"/>
|
||||
<child name="business-doclink" schema="org.gnucash.dialogs.business-doclink"/>
|
||||
<child name="trans-doclink" schema="org.gnucash.dialogs.trans-doclink"/>
|
||||
<child name="style-sheet" schema="org.gnucash.dialogs.style-sheet"/>
|
||||
<child name="options" schema="org.gnucash.dialogs.options"/>
|
||||
<schema id="org.gnucash.GnuCash.dialogs" path="/org/gnucash/GnuCash/dialogs/">
|
||||
<child name="account" schema="org.gnucash.GnuCash.dialogs.account"/>
|
||||
<child name="imap-editor" schema="org.gnucash.GnuCash.dialogs.imap-editor"/>
|
||||
<child name="preferences" schema="org.gnucash.GnuCash.dialogs.preferences"/>
|
||||
<child name="price-editor" schema="org.gnucash.GnuCash.dialogs.price-editor"/>
|
||||
<child name="pricedb-editor" schema="org.gnucash.GnuCash.dialogs.pricedb-editor"/>
|
||||
<child name="reset-warnings" schema="org.gnucash.GnuCash.dialogs.reset-warnings"/>
|
||||
<child name="tax-info" schema="org.gnucash.GnuCash.dialogs.tax-info"/>
|
||||
<child name="fincalc" schema="org.gnucash.GnuCash.dialogs.fincalc"/>
|
||||
<child name="find" schema="org.gnucash.GnuCash.dialogs.find"/>
|
||||
<child name="find-account" schema="org.gnucash.GnuCash.dialogs.find-account"/>
|
||||
<child name="export-accounts" schema="org.gnucash.GnuCash.dialogs.export-accounts"/>
|
||||
<child name="log-replay" schema="org.gnucash.GnuCash.dialogs.log-replay"/>
|
||||
<child name="open-save" schema="org.gnucash.GnuCash.dialogs.open-save"/>
|
||||
<child name="report" schema="org.gnucash.GnuCash.dialogs.report"/>
|
||||
<child name="report-saved-configs" schema="org.gnucash.GnuCash.dialogs.report-saved-configs"/>
|
||||
<child name="lot-viewer" schema="org.gnucash.GnuCash.dialogs.lot-viewer"/>
|
||||
<child name="new-user" schema="org.gnucash.GnuCash.dialogs.new-user"/>
|
||||
<child name="new-hierarchy" schema="org.gnucash.GnuCash.dialogs.new-hierarchy"/>
|
||||
<child name="search" schema="org.gnucash.GnuCash.dialogs.search"/>
|
||||
<child name="transfer" schema="org.gnucash.GnuCash.dialogs.transfer"/>
|
||||
<child name="business-doclink" schema="org.gnucash.GnuCash.dialogs.business-doclink"/>
|
||||
<child name="trans-doclink" schema="org.gnucash.GnuCash.dialogs.trans-doclink"/>
|
||||
<child name="style-sheet" schema="org.gnucash.GnuCash.dialogs.style-sheet"/>
|
||||
<child name="options" schema="org.gnucash.GnuCash.dialogs.options"/>
|
||||
</schema>
|
||||
|
||||
<schema id="org.gnucash.dialogs.account" path="/org/gnucash/dialogs/account/">
|
||||
<schema id="org.gnucash.GnuCash.dialogs.account" path="/org/gnucash/GnuCash/dialogs/account/">
|
||||
<key name="last-geometry" type="(iiii)">
|
||||
<default>(-1,-1,-1,-1)</default>
|
||||
<summary>Last window position and size</summary>
|
||||
@@ -36,7 +36,7 @@
|
||||
</key>
|
||||
</schema>
|
||||
|
||||
<schema id="org.gnucash.dialogs.imap-editor" path="/org/gnucash/dialogs/imap-editor/">
|
||||
<schema id="org.gnucash.GnuCash.dialogs.imap-editor" path="/org/gnucash/GnuCash/dialogs/imap-editor/">
|
||||
<key type="(iiii)" name="last-geometry">
|
||||
<default>(-1,-1,-1,-1)</default>
|
||||
<summary>Last window position and size</summary>
|
||||
@@ -46,7 +46,7 @@
|
||||
</key>
|
||||
</schema>
|
||||
|
||||
<schema id="org.gnucash.dialogs.find-account" path="/org/gnucash/dialogs/find-account/">
|
||||
<schema id="org.gnucash.GnuCash.dialogs.find-account" path="/org/gnucash/GnuCash/dialogs/find-account/">
|
||||
<key type="(iiii)" name="last-geometry">
|
||||
<default>(-1,-1,-1,-1)</default>
|
||||
<summary>Last window position and size</summary>
|
||||
@@ -56,7 +56,7 @@
|
||||
</key>
|
||||
</schema>
|
||||
|
||||
<schema id="org.gnucash.dialogs.preferences" path="/org/gnucash/dialogs/preferences/">
|
||||
<schema id="org.gnucash.GnuCash.dialogs.preferences" path="/org/gnucash/GnuCash/dialogs/preferences/">
|
||||
<key name="last-geometry" type="(iiii)">
|
||||
<default>(-1,-1,-1,-1)</default>
|
||||
<summary>Last window position and size</summary>
|
||||
@@ -66,7 +66,7 @@
|
||||
</key>
|
||||
</schema>
|
||||
|
||||
<schema id="org.gnucash.dialogs.price-editor" path="/org/gnucash/dialogs/price-editor/">
|
||||
<schema id="org.gnucash.GnuCash.dialogs.price-editor" path="/org/gnucash/GnuCash/dialogs/price-editor/">
|
||||
<key name="last-geometry" type="(iiii)">
|
||||
<default>(-1,-1,-1,-1)</default>
|
||||
<summary>Last window position and size</summary>
|
||||
@@ -76,7 +76,7 @@
|
||||
</key>
|
||||
</schema>
|
||||
|
||||
<schema id="org.gnucash.dialogs.pricedb-editor" path="/org/gnucash/dialogs/pricedb-editor/">
|
||||
<schema id="org.gnucash.GnuCash.dialogs.pricedb-editor" path="/org/gnucash/GnuCash/dialogs/pricedb-editor/">
|
||||
<key name="last-geometry" type="(iiii)">
|
||||
<default>(-1,-1,-1,-1)</default>
|
||||
<summary>Last window position and size</summary>
|
||||
@@ -86,7 +86,7 @@
|
||||
</key>
|
||||
</schema>
|
||||
|
||||
<schema id="org.gnucash.dialogs.reset-warnings" path="/org/gnucash/dialogs/reset-warnings/">
|
||||
<schema id="org.gnucash.GnuCash.dialogs.reset-warnings" path="/org/gnucash/GnuCash/dialogs/reset-warnings/">
|
||||
<key name="last-geometry" type="(iiii)">
|
||||
<default>(-1,-1,-1,-1)</default>
|
||||
<summary>Last window position and size</summary>
|
||||
@@ -96,7 +96,7 @@
|
||||
</key>
|
||||
</schema>
|
||||
|
||||
<schema id="org.gnucash.dialogs.tax-info" path="/org/gnucash/dialogs/tax-info/">
|
||||
<schema id="org.gnucash.GnuCash.dialogs.tax-info" path="/org/gnucash/GnuCash/dialogs/tax-info/">
|
||||
<key name="paned-position" type="i">
|
||||
<default>0</default>
|
||||
<summary>Position of the horizontal pane divider.</summary>
|
||||
@@ -111,7 +111,7 @@
|
||||
</key>
|
||||
</schema>
|
||||
|
||||
<schema id="org.gnucash.dialogs.fincalc" path="/org/gnucash/dialogs/fincalc/">
|
||||
<schema id="org.gnucash.GnuCash.dialogs.fincalc" path="/org/gnucash/GnuCash/dialogs/fincalc/">
|
||||
<key name="last-geometry" type="(iiii)">
|
||||
<default>(-1,-1,-1,-1)</default>
|
||||
<summary>Last window position and size</summary>
|
||||
@@ -121,7 +121,7 @@
|
||||
</key>
|
||||
</schema>
|
||||
|
||||
<schema id="org.gnucash.dialogs.find" path="/org/gnucash/dialogs/find/">
|
||||
<schema id="org.gnucash.GnuCash.dialogs.find" path="/org/gnucash/GnuCash/dialogs/find/">
|
||||
<key name="last-geometry" type="(iiii)">
|
||||
<default>(-1,-1,-1,-1)</default>
|
||||
<summary>Last window position and size</summary>
|
||||
@@ -136,7 +136,7 @@
|
||||
</key>
|
||||
</schema>
|
||||
|
||||
<schema id="org.gnucash.dialogs.export-accounts" path="/org/gnucash/dialogs/export-accounts/">
|
||||
<schema id="org.gnucash.GnuCash.dialogs.export-accounts" path="/org/gnucash/GnuCash/dialogs/export-accounts/">
|
||||
<key name="last-path" type="s">
|
||||
<default>''</default>
|
||||
<summary>Last pathname used</summary>
|
||||
@@ -144,7 +144,7 @@
|
||||
</key>
|
||||
</schema>
|
||||
|
||||
<schema id="org.gnucash.dialogs.log-replay" path="/org/gnucash/dialogs/log-replay/">
|
||||
<schema id="org.gnucash.GnuCash.dialogs.log-replay" path="/org/gnucash/GnuCash/dialogs/log-replay/">
|
||||
<key name="last-path" type="s">
|
||||
<default>''</default>
|
||||
<summary>Last pathname used</summary>
|
||||
@@ -152,7 +152,7 @@
|
||||
</key>
|
||||
</schema>
|
||||
|
||||
<schema id="org.gnucash.dialogs.open-save" path="/org/gnucash/dialogs/open-save/">
|
||||
<schema id="org.gnucash.GnuCash.dialogs.open-save" path="/org/gnucash/GnuCash/dialogs/open-save/">
|
||||
<key name="last-path" type="s">
|
||||
<default>''</default>
|
||||
<summary>Last pathname used</summary>
|
||||
@@ -160,7 +160,7 @@
|
||||
</key>
|
||||
</schema>
|
||||
|
||||
<schema id="org.gnucash.dialogs.report" path="/org/gnucash/dialogs/report/">
|
||||
<schema id="org.gnucash.GnuCash.dialogs.report" path="/org/gnucash/GnuCash/dialogs/report/">
|
||||
<key name="last-path" type="s">
|
||||
<default>''</default>
|
||||
<summary>Last pathname used</summary>
|
||||
@@ -168,7 +168,7 @@
|
||||
</key>
|
||||
</schema>
|
||||
|
||||
<schema id="org.gnucash.dialogs.report-saved-configs" path="/org/gnucash/dialogs/report-saved-configs/">
|
||||
<schema id="org.gnucash.GnuCash.dialogs.report-saved-configs" path="/org/gnucash/GnuCash/dialogs/report-saved-configs/">
|
||||
<key name="last-geometry" type="(iiii)">
|
||||
<default>(-1,-1,-1,-1)</default>
|
||||
<summary>Last window position and size</summary>
|
||||
@@ -178,7 +178,7 @@
|
||||
</key>
|
||||
</schema>
|
||||
|
||||
<schema id="org.gnucash.dialogs.lot-viewer" path="/org/gnucash/dialogs/lot-viewer/">
|
||||
<schema id="org.gnucash.GnuCash.dialogs.lot-viewer" path="/org/gnucash/GnuCash/dialogs/lot-viewer/">
|
||||
<key name="hpane-position" type="i">
|
||||
<default>200</default>
|
||||
<summary>Position of the horizontal pane divider.</summary>
|
||||
@@ -198,7 +198,7 @@
|
||||
</key>
|
||||
</schema>
|
||||
|
||||
<schema id="org.gnucash.dialogs.new-user" path="/org/gnucash/dialogs/new-user/">
|
||||
<schema id="org.gnucash.GnuCash.dialogs.new-user" path="/org/gnucash/GnuCash/dialogs/new-user/">
|
||||
<key name="first-startup" type="b">
|
||||
<default>true</default>
|
||||
<summary>Show the new user window</summary>
|
||||
@@ -206,7 +206,7 @@
|
||||
</key>
|
||||
</schema>
|
||||
|
||||
<schema id="org.gnucash.dialogs.new-hierarchy" path="/org/gnucash/dialogs/new-hierarchy/">
|
||||
<schema id="org.gnucash.GnuCash.dialogs.new-hierarchy" path="/org/gnucash/GnuCash/dialogs/new-hierarchy/">
|
||||
<key name="last-geometry" type="(iiii)">
|
||||
<default>(-1,-1,-1,-1)</default>
|
||||
<summary>Last window position and size</summary>
|
||||
@@ -221,7 +221,7 @@
|
||||
</key>
|
||||
</schema>
|
||||
|
||||
<schema id="org.gnucash.dialogs.search" path="/org/gnucash/dialogs/search/">
|
||||
<schema id="org.gnucash.GnuCash.dialogs.search" path="/org/gnucash/GnuCash/dialogs/search/">
|
||||
<key name="new-search-limit" type="d">
|
||||
<default>1.0</default>
|
||||
<summary>Default to 'new search' if fewer than this number of items is returned</summary>
|
||||
@@ -229,7 +229,7 @@
|
||||
</key>
|
||||
</schema>
|
||||
|
||||
<schema id="org.gnucash.dialogs.transfer" path="/org/gnucash/dialogs/transfer/">
|
||||
<schema id="org.gnucash.GnuCash.dialogs.transfer" path="/org/gnucash/GnuCash/dialogs/transfer/">
|
||||
<key name="last-geometry" type="(iiii)">
|
||||
<default>(-1,-1,-1,-1)</default>
|
||||
<summary>Last window position and size</summary>
|
||||
@@ -239,7 +239,7 @@
|
||||
</key>
|
||||
</schema>
|
||||
|
||||
<schema id="org.gnucash.dialogs.business-doclink" path="/org/gnucash/dialogs/business-doclink/">
|
||||
<schema id="org.gnucash.GnuCash.dialogs.business-doclink" path="/org/gnucash/GnuCash/dialogs/business-doclink/">
|
||||
<key type="(iiii)" name="last-geometry">
|
||||
<default>(-1,-1,-1,-1)</default>
|
||||
<summary>Last window position and size</summary>
|
||||
@@ -249,7 +249,7 @@
|
||||
</key>
|
||||
</schema>
|
||||
|
||||
<schema id="org.gnucash.dialogs.trans-doclink" path="/org/gnucash/dialogs/trans-doclink/">
|
||||
<schema id="org.gnucash.GnuCash.dialogs.trans-doclink" path="/org/gnucash/GnuCash/dialogs/trans-doclink/">
|
||||
<key type="(iiii)" name="last-geometry">
|
||||
<default>(-1,-1,-1,-1)</default>
|
||||
<summary>Last window position and size</summary>
|
||||
@@ -259,7 +259,7 @@
|
||||
</key>
|
||||
</schema>
|
||||
|
||||
<schema id="org.gnucash.dialogs.style-sheet" path="/org/gnucash/dialogs/style-sheet/">
|
||||
<schema id="org.gnucash.GnuCash.dialogs.style-sheet" path="/org/gnucash/GnuCash/dialogs/style-sheet/">
|
||||
<key type="(iiii)" name="last-geometry">
|
||||
<default>(-1,-1,-1,-1)</default>
|
||||
<summary>Last window position and size</summary>
|
||||
@@ -269,7 +269,7 @@
|
||||
</key>
|
||||
</schema>
|
||||
|
||||
<schema id="org.gnucash.dialogs.options" path="/org/gnucash/dialogs/options/">
|
||||
<schema id="org.gnucash.GnuCash.dialogs.options" path="/org/gnucash/GnuCash/dialogs/options/">
|
||||
<key name="last-geometry" type="(iiii)">
|
||||
<default>(-1,-1,-1,-1)</default>
|
||||
<summary>Last window position and size</summary>
|
||||
@@ -1,5 +1,5 @@
|
||||
<schemalist gettext-domain="@PROJECT_NAME@">
|
||||
<schema id="org.gnucash.dialogs.import.csv" path="/org/gnucash/dialogs/import/csv/">
|
||||
<schema id="org.gnucash.GnuCash.dialogs.import.csv" path="/org/gnucash/GnuCash/dialogs/import/csv/">
|
||||
<key name="last-geometry" type="(iiii)">
|
||||
<default>(-1,-1,-1,-1)</default>
|
||||
<summary>Last window position and size</summary>
|
||||
@@ -1,5 +1,5 @@
|
||||
<schemalist gettext-domain="@PROJECT_NAME@">
|
||||
<schema id="org.gnucash.dialogs.import.generic" path="/org/gnucash/dialogs/import/generic/">
|
||||
<schema id="org.gnucash.GnuCash.dialogs.import.generic" path="/org/gnucash/GnuCash/dialogs/import/generic/">
|
||||
<key name="enable-skip" type="b">
|
||||
<default>true</default>
|
||||
<summary>Enable SKIP transaction action</summary>
|
||||
@@ -50,12 +50,12 @@
|
||||
<summary>Automatically create new commodities</summary>
|
||||
<description>Enables the automatic creation of new commodities if any unknown commodity is encountered during import. Otherwise the user will be asked what to do with each unknown commodity.</description>
|
||||
</key>
|
||||
<child name="match-picker" schema="org.gnucash.dialogs.import.generic.match-picker"/>
|
||||
<child name="transaction-list" schema="org.gnucash.dialogs.import.generic.transaction-list"/>
|
||||
<child name="account-picker" schema="org.gnucash.dialogs.import.generic.account-picker"/>
|
||||
<child name="match-picker" schema="org.gnucash.GnuCash.dialogs.import.generic.match-picker"/>
|
||||
<child name="transaction-list" schema="org.gnucash.GnuCash.dialogs.import.generic.transaction-list"/>
|
||||
<child name="account-picker" schema="org.gnucash.GnuCash.dialogs.import.generic.account-picker"/>
|
||||
</schema>
|
||||
|
||||
<schema id="org.gnucash.dialogs.import.generic.match-picker" path="/org/gnucash/dialogs/import/generic/match-picker/">
|
||||
<schema id="org.gnucash.GnuCash.dialogs.import.generic.match-picker" path="/org/gnucash/GnuCash/dialogs/import/generic/match-picker/">
|
||||
<key name="last-geometry" type="(iiii)">
|
||||
<default>(-1,-1,-1,-1)</default>
|
||||
<summary>Last window position and size</summary>
|
||||
@@ -70,7 +70,7 @@
|
||||
</key>
|
||||
</schema>
|
||||
|
||||
<schema id="org.gnucash.dialogs.import.generic.account-picker" path="/org/gnucash/dialogs/import/generic/account-picker/">
|
||||
<schema id="org.gnucash.GnuCash.dialogs.import.generic.account-picker" path="/org/gnucash/GnuCash/dialogs/import/generic/account-picker/">
|
||||
<key name="last-geometry" type="(iiii)">
|
||||
<default>(-1,-1,-1,-1)</default>
|
||||
<summary>Last window position and size</summary>
|
||||
@@ -80,7 +80,7 @@
|
||||
</key>
|
||||
</schema>
|
||||
|
||||
<schema id="org.gnucash.dialogs.import.generic.transaction-list" path="/org/gnucash/dialogs/import/generic/transaction-list/">
|
||||
<schema id="org.gnucash.GnuCash.dialogs.import.generic.transaction-list" path="/org/gnucash/GnuCash/dialogs/import/generic/transaction-list/">
|
||||
<key name="last-geometry" type="(iiii)">
|
||||
<default>(-1,-1,-1,-1)</default>
|
||||
<summary>Last window position and size</summary>
|
||||
@@ -1,5 +1,5 @@
|
||||
<schemalist gettext-domain="@PROJECT_NAME@">
|
||||
<schema id="org.gnucash.dialogs.import.qif" path="/org/gnucash/dialogs/import/qif/">
|
||||
<schema id="org.gnucash.GnuCash.dialogs.import.qif" path="/org/gnucash/GnuCash/dialogs/import/qif/">
|
||||
<key name="default-status-notcleared" type="b">
|
||||
<default>true</default>
|
||||
<summary>Default QIF transaction status</summary>
|
||||
@@ -32,10 +32,10 @@
|
||||
<summary>Show documentation</summary>
|
||||
<description>Show some documentation-only pages in QIF Import assistant.</description>
|
||||
</key>
|
||||
<child name="account-picker" schema="org.gnucash.dialogs.import.qif.account-picker"/>
|
||||
<child name="account-picker" schema="org.gnucash.GnuCash.dialogs.import.qif.account-picker"/>
|
||||
</schema>
|
||||
|
||||
<schema id="org.gnucash.dialogs.import.qif.account-picker" path="/org/gnucash/dialogs/import/qif/account-picker/">
|
||||
<schema id="org.gnucash.GnuCash.dialogs.import.qif.account-picker" path="/org/gnucash/GnuCash/dialogs/import/qif/account-picker/">
|
||||
<key name="last-geometry" type="(iiii)">
|
||||
<default>(-1,-1,-1,-1)</default>
|
||||
<summary>Last window position and size</summary>
|
||||
@@ -1,5 +1,5 @@
|
||||
<schemalist gettext-domain="@PROJECT_NAME@">
|
||||
<schema id="org.gnucash.dialogs.reconcile" path="/org/gnucash/dialogs/reconcile/">
|
||||
<schema id="org.gnucash.GnuCash.dialogs.reconcile" path="/org/gnucash/GnuCash/dialogs/reconcile/">
|
||||
<key name="check-cleared" type="b">
|
||||
<default>true</default>
|
||||
<summary>Pre-select cleared transactions</summary>
|
||||
@@ -1,10 +1,10 @@
|
||||
<schemalist gettext-domain="@PROJECT_NAME@">
|
||||
<schema id="org.gnucash.dialogs.sxs" path="/org/gnucash/dialogs/scheduled-trans/">
|
||||
<child name="since-last-run" schema="org.gnucash.dialogs.sxs.since-last-run"/>
|
||||
<child name="transaction-editor" schema="org.gnucash.dialogs.sxs.transaction-editor"/>
|
||||
<schema id="org.gnucash.GnuCash.dialogs.sxs" path="/org/gnucash/GnuCash/dialogs/scheduled-trans/">
|
||||
<child name="since-last-run" schema="org.gnucash.GnuCash.dialogs.sxs.since-last-run"/>
|
||||
<child name="transaction-editor" schema="org.gnucash.GnuCash.dialogs.sxs.transaction-editor"/>
|
||||
</schema>
|
||||
|
||||
<schema id="org.gnucash.dialogs.sxs.since-last-run" path="/org/gnucash/dialogs/scheduled-trans/since-last-run/">
|
||||
<schema id="org.gnucash.GnuCash.dialogs.sxs.since-last-run" path="/org/gnucash/GnuCash/dialogs/scheduled-trans/since-last-run/">
|
||||
<key name="last-geometry" type="(iiii)">
|
||||
<default>(-1,-1,-1,-1)</default>
|
||||
<summary>Last window position and size</summary>
|
||||
@@ -29,7 +29,7 @@
|
||||
</key>
|
||||
</schema>
|
||||
|
||||
<schema id="org.gnucash.dialogs.sxs.transaction-editor" path="/org/gnucash/dialogs/scheduled-trans/transaction-editor/">
|
||||
<schema id="org.gnucash.GnuCash.dialogs.sxs.transaction-editor" path="/org/gnucash/GnuCash/dialogs/scheduled-trans/transaction-editor/">
|
||||
<key name="create-auto" type="b">
|
||||
<default>false</default>
|
||||
<summary>Set the "auto create" flag by default</summary>
|
||||
@@ -1,5 +1,5 @@
|
||||
<schemalist gettext-domain="@PROJECT_NAME@">
|
||||
<schema id="org.gnucash.dialogs.totd" path="/org/gnucash/dialogs/tip-of-the-day/">
|
||||
<schema id="org.gnucash.GnuCash.dialogs.totd" path="/org/gnucash/GnuCash/dialogs/tip-of-the-day/">
|
||||
<key name="current-tip" type="i">
|
||||
<default>0</default>
|
||||
<summary>The next tip to show.</summary>
|
||||
@@ -1,5 +1,5 @@
|
||||
<schemalist gettext-domain="@PROJECT_NAME@">
|
||||
<schema id="org.gnucash.general.finance-quote" path="/org/gnucash/general/finance-quote/">
|
||||
<schema id="org.gnucash.GnuCash.general.finance-quote" path="/org/gnucash/GnuCash/general/finance-quote/">
|
||||
<key name="alphavantage-api-key" type="s">
|
||||
<default>''</default>
|
||||
<summary>Alpha Vantage API key</summary>
|
||||
@@ -1,10 +1,10 @@
|
||||
<schemalist gettext-domain="@PROJECT_NAME@">
|
||||
<schema id="org.gnucash" path="/org/gnucash/">
|
||||
<child name="general" schema="org.gnucash.general"/>
|
||||
<child name="dev" schema="org.gnucash.dev"/>
|
||||
<schema id="org.gnucash.GnuCash" path="/org/gnucash/GnuCash/">
|
||||
<child name="general" schema="org.gnucash.GnuCash.general"/>
|
||||
<child name="dev" schema="org.gnucash.GnuCash.dev"/>
|
||||
</schema>
|
||||
|
||||
<schema id="org.gnucash.general" path="/org/gnucash/general/">
|
||||
<schema id="org.gnucash.GnuCash.general" path="/org/gnucash/GnuCash/general/">
|
||||
<key name="prefs-version" type="i">
|
||||
<default>0</default>
|
||||
<summary>The version of these settings</summary>
|
||||
@@ -230,11 +230,11 @@
|
||||
<summary>Set book option on new files to use split "action" field for "Num" field on registers/reports</summary>
|
||||
<description>If selected, the default book option for new files is set so that the 'Num' cell on registers shows/updates the split 'action' field and the transaction 'num' field is shown on the second line in double line mode (and is not visible in single line mode). Otherwise, the default book option for new files is set so that the 'Num' cell on registers shows/updates the transaction 'num' field.</description>
|
||||
</key>
|
||||
<child name="register" schema="org.gnucash.general.register"/>
|
||||
<child name="report" schema="org.gnucash.general.report"/>
|
||||
<child name="register" schema="org.gnucash.GnuCash.general.register"/>
|
||||
<child name="report" schema="org.gnucash.GnuCash.general.report"/>
|
||||
</schema>
|
||||
|
||||
<schema id="org.gnucash.general.register" path="/org/gnucash/general/register/">
|
||||
<schema id="org.gnucash.GnuCash.general.register" path="/org/gnucash/GnuCash/general/register/">
|
||||
<key name="use-gnucash-color-theme" type="b">
|
||||
<default>true</default>
|
||||
<summary>Color the register using a gnucash specific color theme</summary>
|
||||
@@ -337,7 +337,7 @@
|
||||
</key>
|
||||
</schema>
|
||||
|
||||
<schema id="org.gnucash.general.report" path="/org/gnucash/general/report/">
|
||||
<schema id="org.gnucash.GnuCash.general.report" path="/org/gnucash/GnuCash/general/report/">
|
||||
<key name="use-new-window" type="b">
|
||||
<default>false</default>
|
||||
<summary>Create a new window for each new report</summary>
|
||||
@@ -365,9 +365,9 @@
|
||||
This option allows you to scale reports up by the set factor.
|
||||
For example setting this to 2.0 will display reports at twice their typical size.</description>
|
||||
</key>
|
||||
<child name="pdf-export" schema="org.gnucash.general.report.pdf-export"/>
|
||||
<child name="pdf-export" schema="org.gnucash.GnuCash.general.report.pdf-export"/>
|
||||
</schema>
|
||||
<schema id="org.gnucash.general.report.pdf-export" path="/org/gnucash/general/report/pdf-export/">
|
||||
<schema id="org.gnucash.GnuCash.general.report.pdf-export" path="/org/gnucash/GnuCash/general/report/pdf-export/">
|
||||
<key name="filename-format" type="s">
|
||||
<default>'%1$s-%2$s-%3$s'</default>
|
||||
<summary>PDF export file name format</summary>
|
||||
@@ -379,7 +379,7 @@ For example setting this to 2.0 will display reports at twice their typical size
|
||||
<description>This setting chooses the way dates are used in the filename of PDF export. Possible values for this setting are "locale" to use the system locale setting, "ce" for Continental Europe style dates, "iso" for ISO 8601 standard dates , "uk" for United Kingdom style dates, and "us" for United States style dates.</description>
|
||||
</key>
|
||||
</schema>
|
||||
<schema id="org.gnucash.dev" path="/org/gnucash/dev/">
|
||||
<schema id="org.gnucash.GnuCash.dev" path="/org/gnucash/GnuCash/dev/">
|
||||
<key name="allow-file-incompatibility" type="b">
|
||||
<default>false</default>
|
||||
<summary>Allow file incompatibility with older versions.</summary>
|
||||
@@ -1,5 +1,5 @@
|
||||
<schemalist gettext-domain="@PROJECT_NAME@">
|
||||
<schema id="org.gnucash.history" path="/org/gnucash/history/">
|
||||
<schema id="org.gnucash.GnuCash.history" path="/org/gnucash/GnuCash/history/">
|
||||
<key name="maxfiles" type="i">
|
||||
<default>4</default>
|
||||
<summary>Number of files in history</summary>
|
||||
@@ -1,9 +1,9 @@
|
||||
<schemalist gettext-domain="@PROJECT_NAME@">
|
||||
<schema id="org.gnucash.warnings" path="/org/gnucash/warnings/">
|
||||
<child name="permanent" schema="org.gnucash.warnings.permanent"/>
|
||||
<child name="temporary" schema="org.gnucash.warnings.temporary"/>
|
||||
<schema id="org.gnucash.GnuCash.warnings" path="/org/gnucash/GnuCash/warnings/">
|
||||
<child name="permanent" schema="org.gnucash.GnuCash.warnings.permanent"/>
|
||||
<child name="temporary" schema="org.gnucash.GnuCash.warnings.temporary"/>
|
||||
</schema>
|
||||
<schema id="org.gnucash.warnings.permanent" path="/org/gnucash/warnings/permanent/">
|
||||
<schema id="org.gnucash.GnuCash.warnings.permanent" path="/org/gnucash/GnuCash/warnings/permanent/">
|
||||
<key name="checkprinting-multi-acct" type="i">
|
||||
<default>0</default>
|
||||
<summary>Print checks from multiple accounts</summary>
|
||||
@@ -106,7 +106,7 @@
|
||||
</key>
|
||||
</schema>
|
||||
|
||||
<schema id="org.gnucash.warnings.temporary" path="/org/gnucash/warnings/temporary/">
|
||||
<schema id="org.gnucash.GnuCash.warnings.temporary" path="/org/gnucash/GnuCash/warnings/temporary/">
|
||||
<key name="checkprinting-multi-acct" type="i">
|
||||
<default>0</default>
|
||||
<summary>Print checks from multiple accounts</summary>
|
||||
@@ -1,5 +1,5 @@
|
||||
<schemalist gettext-domain="@PROJECT_NAME@">
|
||||
<schema id="org.gnucash.window.pages.account-tree.summary" path="/org/gnucash/window/pages/account-tree/summary/">
|
||||
<schema id="org.gnucash.GnuCash.window.pages.account-tree.summary" path="/org/gnucash/GnuCash/window/pages/account-tree/summary/">
|
||||
<key name="grand-total" type="b">
|
||||
<default>true</default>
|
||||
<summary>Show a grand total of all accounts converted to the default report currency</summary>
|
||||
@@ -1,5 +1,5 @@
|
||||
<schemalist gettext-domain="@PROJECT_NAME@">
|
||||
<schema id="org.gnucash.window.pages" path="/org/gnucash/window/pages/account-tree/">
|
||||
<schema id="org.gnucash.GnuCash.window.pages" path="/org/gnucash/GnuCash/window/pages/account-tree/">
|
||||
<key name="account-code-visible" type="b">
|
||||
<default>false</default>
|
||||
<summary>Display this column</summary>
|
||||
@@ -198,7 +198,7 @@ aai_destroy_cb(GtkWidget *object, gpointer user_data)
|
||||
|
||||
if (info->deferred_info)
|
||||
{
|
||||
g_message("Online Banking assistant is being closed but the wizard is still "
|
||||
PINFO("Online Banking assistant is being closed but the wizard is still "
|
||||
"running. Inoring.");
|
||||
|
||||
/* Tell child_exit_cb() that there is no assistant anymore */
|
||||
|
||||
@@ -141,7 +141,7 @@ gnc_ab_gettrans(GtkWidget *parent, Account *gnc_acc)
|
||||
/* Get the start and end dates for the GetTransactions job. */
|
||||
if (!gettrans_dates(parent, gnc_acc, &from_date, &to_date))
|
||||
{
|
||||
g_debug("gnc_ab_gettrans: gettrans_dates aborted");
|
||||
DEBUG("gnc_ab_gettrans: gettrans_dates aborted");
|
||||
goto cleanup;
|
||||
}
|
||||
/* Use this as a local storage for the until_time below. */
|
||||
|
||||
@@ -192,18 +192,18 @@ gnc_AB_BANKING_new(void)
|
||||
{
|
||||
if (AB_Banking_HasConf3(api) == 0)
|
||||
{
|
||||
g_message("gnc_AB_BANKING_new: importing aqbanking3 configuration\n");
|
||||
PINFO("gnc_AB_BANKING_new: importing aqbanking3 configuration\n");
|
||||
if (AB_Banking_ImportConf3(api) < 0)
|
||||
{
|
||||
g_message("gnc_AB_BANKING_new: unable to import aqbanking3 configuration\n");
|
||||
PINFO("gnc_AB_BANKING_new: unable to import aqbanking3 configuration\n");
|
||||
}
|
||||
}
|
||||
else if (AB_Banking_HasConf2(api) == 0)
|
||||
{
|
||||
g_message("gnc_AB_BANKING_new: importing aqbanking2 configuration\n");
|
||||
PINFO("gnc_AB_BANKING_new: importing aqbanking2 configuration\n");
|
||||
if (AB_Banking_ImportConf2(api) < 0)
|
||||
{
|
||||
g_message("gnc_AB_BANKING_new: unable to import aqbanking2 configuration\n");
|
||||
PINFO("gnc_AB_BANKING_new: unable to import aqbanking2 configuration\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -291,7 +291,7 @@ gnc_ab_get_ab_account(const AB_BANKING *api, Account *gnc_acc)
|
||||
/* Finding the account by code and number is suspended in AQBANKING 6 pending
|
||||
* implementation of a replacement for AB_Banking_GetAccountByCodeAndNumber.
|
||||
*/
|
||||
g_message("gnc_ab_get_ab_account: No AB_ACCOUNT found for UID %d, "
|
||||
PINFO("gnc_ab_get_ab_account: No AB_ACCOUNT found for UID %d, "
|
||||
"trying bank code\n", account_uid);
|
||||
return NULL;
|
||||
}
|
||||
@@ -301,7 +301,7 @@ gnc_ab_get_ab_account(const AB_BANKING *api, Account *gnc_acc)
|
||||
|
||||
if (!ab_account && bankcode && *bankcode && accountid && *accountid)
|
||||
{
|
||||
g_message("gnc_ab_get_ab_account: No AB_ACCOUNT found for UID %d, "
|
||||
PINFO("gnc_ab_get_ab_account: No AB_ACCOUNT found for UID %d, "
|
||||
"trying bank code\n", account_uid);
|
||||
ab_account = AB_Banking_GetAccountByCodeAndNumber(api, bankcode,
|
||||
accountid);
|
||||
@@ -1033,16 +1033,18 @@ bal_accountinfo_cb(AB_IMEXPORTER_ACCOUNTINFO *element, gpointer user_data)
|
||||
|
||||
if (!(data->awaiting & AWAIT_BALANCES))
|
||||
{
|
||||
GtkWindow *parent = data->generic_importer ?
|
||||
GTK_WINDOW(data->generic_importer) :
|
||||
GTK_WINDOW(data->parent);
|
||||
const char* balance_msg =
|
||||
_("The bank has sent balance information in its response.\n"
|
||||
"Do you want to import it?");
|
||||
/* Ignore zero balances if we don't await a balance */
|
||||
if (!booked_bal || AB_Value_IsZero(AB_Balance_GetValue(booked_bal)))
|
||||
return NULL;
|
||||
|
||||
/* Ask the user whether to import unawaited non-zero balance */
|
||||
if (gnc_verify_dialog (GTK_WINDOW (data->parent), TRUE, "%s",
|
||||
_("The bank has sent balance information "
|
||||
"in its response."
|
||||
"\n"
|
||||
"Do you want to import it?")))
|
||||
if (gnc_verify_dialog (parent, TRUE, "%s", balance_msg))
|
||||
{
|
||||
data->awaiting |= AWAIT_BALANCES;
|
||||
}
|
||||
|
||||
@@ -496,7 +496,7 @@ gnc_plugin_ab_cmd_get_balance(GtkAction *action, GncMainWindowActionData *data)
|
||||
account = main_window_to_account(data->window);
|
||||
if (account == NULL)
|
||||
{
|
||||
g_message("No AqBanking account selected");
|
||||
PINFO("No AqBanking account selected");
|
||||
LEAVE("no account");
|
||||
return;
|
||||
}
|
||||
@@ -517,7 +517,7 @@ gnc_plugin_ab_cmd_get_transactions(GtkAction *action,
|
||||
account = main_window_to_account(data->window);
|
||||
if (account == NULL)
|
||||
{
|
||||
g_message("No AqBanking account selected");
|
||||
PINFO("No AqBanking account selected");
|
||||
LEAVE("no account");
|
||||
return;
|
||||
}
|
||||
@@ -538,7 +538,7 @@ gnc_plugin_ab_cmd_issue_sepatransaction(GtkAction *action,
|
||||
account = main_window_to_account(data->window);
|
||||
if (account == NULL)
|
||||
{
|
||||
g_message("No AqBanking account selected");
|
||||
PINFO("No AqBanking account selected");
|
||||
LEAVE("no account");
|
||||
return;
|
||||
}
|
||||
@@ -559,7 +559,7 @@ gnc_plugin_ab_cmd_issue_inttransaction(GtkAction *action,
|
||||
account = main_window_to_account(data->window);
|
||||
if (account == NULL)
|
||||
{
|
||||
g_message("No AqBanking account selected");
|
||||
PINFO("No AqBanking account selected");
|
||||
LEAVE("no account");
|
||||
return;
|
||||
}
|
||||
@@ -581,7 +581,7 @@ gnc_plugin_ab_cmd_issue_sepa_direct_debit(GtkAction *action,
|
||||
account = main_window_to_account(data->window);
|
||||
if (account == NULL)
|
||||
{
|
||||
g_message("No AqBanking account selected");
|
||||
PINFO("No AqBanking account selected");
|
||||
LEAVE("no account");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1,8 +1,15 @@
|
||||
|
||||
if (WITH_AQBANKING)
|
||||
set(aqb_GSCHEMA org.gnucash.dialogs.import.hbci.gschema.xml org.gnucash.dialogs.flicker.gschema.xml)
|
||||
set(aqb_GSCHEMA org.gnucash.GnuCash.dialogs.import.hbci.gschema.xml org.gnucash.GnuCash.dialogs.flicker.gschema.xml)
|
||||
|
||||
add_gschema_targets("${aqb_GSCHEMA}")
|
||||
|
||||
file(READ migratable-prefs.xml migratable-prefs)
|
||||
file(APPEND ${DATADIR_BUILD}/${PROJECT_NAME}/migratable-prefs.xml ${migratable-prefs})
|
||||
endif()
|
||||
|
||||
set_dist_list(aqbanking_gschema_DIST CMakeLists.txt org.gnucash.dialogs.import.hbci.gschema.xml.in org.gnucash.dialogs.flicker.gschema.xml.in)
|
||||
set_dist_list(aqbanking_gschema_DIST
|
||||
CMakeLists.txt
|
||||
migratable-prefs.xml
|
||||
org.gnucash.GnuCash.dialogs.import.hbci.gschema.xml.in
|
||||
org.gnucash.GnuCash.dialogs.flicker.gschema.xml.in)
|
||||
|
||||
64
gnucash/import-export/aqb/gschemas/migratable-prefs.xml
Normal file
64
gnucash/import-export/aqb/gschemas/migratable-prefs.xml
Normal file
@@ -0,0 +1,64 @@
|
||||
|
||||
<release version="4007">
|
||||
|
||||
<migrate old-path="org.gnucash.dialogs.flicker"
|
||||
old-key="last-geometry"
|
||||
new-path="org.gnucash.GnuCash.dialogs.flicker"
|
||||
new-key="last-geometry"/>
|
||||
|
||||
<migrate old-path="org.gnucash.dialogs.ab-initial"
|
||||
old-key="last-geometry"
|
||||
new-path="org.gnucash.GnuCash.dialogs.ab-initial"
|
||||
new-key="last-geometry"/>
|
||||
|
||||
<migrate old-path="org.gnucash.dialogs.import.hbci"
|
||||
old-key="close-on-finish"
|
||||
new-path="org.gnucash.GnuCash.dialogs.import.hbci"
|
||||
new-key="close-on-finish"/>
|
||||
|
||||
<migrate old-path="org.gnucash.dialogs.import.hbci"
|
||||
old-key="remember-pin"
|
||||
new-path="org.gnucash.GnuCash.dialogs.import.hbci"
|
||||
new-key="remember-pin"/>
|
||||
|
||||
<migrate old-path="org.gnucash.dialogs.import.hbci"
|
||||
old-key="use-ns-transaction-text"
|
||||
new-path="org.gnucash.GnuCash.dialogs.import.hbci"
|
||||
new-key="use-ns-transaction-text"/>
|
||||
|
||||
<migrate old-path="org.gnucash.dialogs.import.hbci"
|
||||
old-key="verbose-debug"
|
||||
new-path="org.gnucash.GnuCash.dialogs.import.hbci"
|
||||
new-key="verbose-debug"/>
|
||||
|
||||
<migrate old-path="org.gnucash.dialogs.import.hbci"
|
||||
old-key="format-dtaus"
|
||||
new-path="org.gnucash.GnuCash.dialogs.import.hbci"
|
||||
new-key="format-dtaus"/>
|
||||
|
||||
<migrate old-path="org.gnucash.dialogs.import.hbci"
|
||||
old-key="format-csv"
|
||||
new-path="org.gnucash.GnuCash.dialogs.import.hbci"
|
||||
new-key="format-csv"/>
|
||||
|
||||
<migrate old-path="org.gnucash.dialogs.import.hbci"
|
||||
old-key="format-swift-mt940"
|
||||
new-path="org.gnucash.GnuCash.dialogs.import.hbci"
|
||||
new-key="format-swift-mt940"/>
|
||||
|
||||
<migrate old-path="org.gnucash.dialogs.import.hbci"
|
||||
old-key="format-swift-mt942"
|
||||
new-path="org.gnucash.GnuCash.dialogs.import.hbci"
|
||||
new-key="format-swift-mt942"/>
|
||||
|
||||
<migrate old-path="org.gnucash.dialogs.import.hbci"
|
||||
old-key="last-path"
|
||||
new-path="org.gnucash.GnuCash.dialogs.import.hbci"
|
||||
new-key="last-path"/>
|
||||
|
||||
<migrate old-path="org.gnucash.dialogs.import.hbci.connection-dialog"
|
||||
old-key="last-geometry"
|
||||
new-path="org.gnucash.GnuCash.dialogs.import.hbci.connection-dialog"
|
||||
new-key="last-geometry"/>
|
||||
|
||||
</release>
|
||||
@@ -1,6 +1,6 @@
|
||||
<schemalist gettext-domain="@PROJECT_NAME@">
|
||||
|
||||
<schema id="org.gnucash.dialogs.flicker" path="/org/gnucash/dialogs/flicker/">
|
||||
<schema id="org.gnucash.GnuCash.dialogs.flicker" path="/org/gnucash/GnuCash/dialogs/flicker/">
|
||||
<key name="last-geometry" type="(iiii)">
|
||||
<default>(-1,-1,-1,-1)</default>
|
||||
<summary>Last window position and size</summary>
|
||||
@@ -1,5 +1,5 @@
|
||||
<schemalist gettext-domain="@PROJECT_NAME@">
|
||||
<schema id="org.gnucash.dialogs.ab-initial" path="/org/gnucash/dialogs/ab-initial/">
|
||||
<schema id="org.gnucash.GnuCash.dialogs.ab-initial" path="/org/gnucash/GnuCash/dialogs/ab-initial/">
|
||||
<key name="last-geometry" type="(iiii)">
|
||||
<default>(-1,-1,-1,-1)</default>
|
||||
<summary>Last window position and size</summary>
|
||||
@@ -9,7 +9,7 @@
|
||||
</key>
|
||||
</schema>
|
||||
|
||||
<schema id="org.gnucash.dialogs.import.hbci" path="/org/gnucash/dialogs/import/hbci/">
|
||||
<schema id="org.gnucash.GnuCash.dialogs.import.hbci" path="/org/gnucash/GnuCash/dialogs/import/hbci/">
|
||||
<key name="close-on-finish" type="b">
|
||||
<default>true</default>
|
||||
<summary>Close window when finished</summary>
|
||||
@@ -55,10 +55,10 @@
|
||||
<summary>Last pathname used</summary>
|
||||
<description>This field contains the last pathname used by this window. It will be used as the initial filename/pathname the next time this window is opened.</description>
|
||||
</key>
|
||||
<child name="connection-dialog" schema="org.gnucash.dialogs.import.hbci.connection-dialog"/>
|
||||
<child name="connection-dialog" schema="org.gnucash.GnuCash.dialogs.import.hbci.connection-dialog"/>
|
||||
</schema>
|
||||
|
||||
<schema id="org.gnucash.dialogs.import.hbci.connection-dialog" path="/org/gnucash/dialogs/import/hbci/connection-dialog/">
|
||||
<schema id="org.gnucash.GnuCash.dialogs.import.hbci.connection-dialog" path="/org/gnucash/GnuCash/dialogs/import/hbci/connection-dialog/">
|
||||
<key name="last-geometry" type="(iiii)">
|
||||
<default>(-1,-1,-1,-1)</default>
|
||||
<summary>Last window position and size</summary>
|
||||
@@ -120,7 +120,7 @@ static void
|
||||
gnc_plugin_bi_import_cmd_test (GtkAction *action, GncMainWindowActionData *data)
|
||||
{
|
||||
ENTER ("action %p, main window data %p", action, data);
|
||||
g_message ("bi_import");
|
||||
PINFO ("bi_import");
|
||||
|
||||
gnc_plugin_bi_import_showGUI(GTK_WINDOW(data->window));
|
||||
|
||||
|
||||
@@ -1638,7 +1638,6 @@ void CsvImpPriceAssist::preview_refresh_table ()
|
||||
}
|
||||
gtk_tree_view_set_model (treeview, GTK_TREE_MODEL(store));
|
||||
gtk_tree_view_set_tooltip_column (treeview, PREV_COL_ERROR);
|
||||
g_object_unref (store);
|
||||
|
||||
/* Adjust treeview to go with the just created model. This consists of adding
|
||||
* or removing columns and resetting any parameters related to how
|
||||
|
||||
@@ -1564,7 +1564,6 @@ void CsvImpTransAssist::preview_refresh_table ()
|
||||
}
|
||||
gtk_tree_view_set_model (treeview, GTK_TREE_MODEL(store));
|
||||
gtk_tree_view_set_tooltip_column (treeview, PREV_COL_ERROR);
|
||||
g_object_unref (store);
|
||||
|
||||
/* Adjust treeview to go with the just created model. This consists of adding
|
||||
* or removing columns and resetting any parameters related to how
|
||||
|
||||
@@ -121,7 +121,7 @@ static void
|
||||
gnc_plugin_customer_import_cmd_test (GtkAction *action, GncMainWindowActionData *data)
|
||||
{
|
||||
ENTER ("action %p, main window data %p", action, data);
|
||||
g_message ("customer_import");
|
||||
PINFO ("customer_import");
|
||||
|
||||
gnc_plugin_customer_import_showGUI (GTK_WINDOW(data->window));
|
||||
|
||||
|
||||
@@ -51,8 +51,7 @@ void qof_instance_set_guid (gpointer inst, const GncGUID *guid);
|
||||
/* NW: If you want a new log_module, just define
|
||||
a unique string either in gnc-engine.h or
|
||||
locally.*/
|
||||
/*static QofLogModule log_module = GNC_MOD_IMPORT;*/
|
||||
static QofLogModule log_module = GNC_MOD_TEST;
|
||||
static QofLogModule log_module = GNC_MOD_IMPORT;
|
||||
|
||||
/* fprintf (trans_log, "mod guid time_now " \
|
||||
"date_entered date_posted " \
|
||||
|
||||
@@ -76,8 +76,12 @@ typedef struct _ofx_info
|
||||
struct OfxStatementData* statement; // Statement, if any
|
||||
gboolean run_reconcile; // If TRUE the reconcile window is opened after matching.
|
||||
GSList* file_list; // List of OFX files to import
|
||||
GList* trans_list; // We store the processed ofx transactions here
|
||||
gint response; // Response sent by the match gui
|
||||
} ofx_info ;
|
||||
|
||||
static void runMatcher(ofx_info* info, char * selected_filename, gboolean go_to_next_file);
|
||||
|
||||
/*
|
||||
int ofx_proc_status_cb(struct OfxStatusData data)
|
||||
{
|
||||
@@ -210,6 +214,10 @@ static const gchar *gnc_ofx_invttype_to_str(InvTransactionType t)
|
||||
return "SPLIT (Stock or mutial fund split)";
|
||||
case OFX_TRANSFER:
|
||||
return "TRANSFER (Transfer holdings in and out of the investment account)";
|
||||
#ifdef HAVE_LIBOFX_VERSION_0_10
|
||||
case OFX_INVBANKTRAN:
|
||||
return "Transfer cash in and out of the investment account";
|
||||
#endif
|
||||
default:
|
||||
return "ERROR, this investment transaction type is unknown. This is a bug in ofxdump";
|
||||
}
|
||||
@@ -582,7 +590,12 @@ int ofx_proc_transaction_cb(struct OfxTransactionData data, void *user_data)
|
||||
xaccTransSetCurrency(transaction, currency);
|
||||
if (data.amount_valid)
|
||||
{
|
||||
if (!data.invtransactiontype_valid)
|
||||
if (!data.invtransactiontype_valid
|
||||
#ifdef HAVE_LIBOFX_VERSION_0_10
|
||||
|| data.invtransactiontype == OFX_INVBANKTRAN)
|
||||
#else
|
||||
)
|
||||
#endif
|
||||
{
|
||||
double amount = data.amount;
|
||||
#ifdef HAVE_LIBOFX_VERSION_0_10
|
||||
@@ -899,8 +912,9 @@ int ofx_proc_transaction_cb(struct OfxTransactionData data, void *user_data)
|
||||
/* Send transaction to importer GUI. */
|
||||
if (xaccTransCountSplits(transaction) > 0)
|
||||
{
|
||||
DEBUG("%d splits sent to the importer gui", xaccTransCountSplits(transaction));
|
||||
gnc_gen_trans_list_add_trans (info->gnc_ofx_importer_gui, transaction);
|
||||
DEBUG("%d splits sent to the importer gui",
|
||||
xaccTransCountSplits(transaction));
|
||||
info->trans_list = g_list_prepend (info->trans_list, transaction);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1051,7 +1065,9 @@ double ofx_get_investment_amount(const struct OfxTransactionData* data)
|
||||
{
|
||||
double amount = data->amount;
|
||||
#ifdef HAVE_LIBOFX_VERSION_0_10
|
||||
if (data->currency_ratio_valid && data->currency_ratio != 0)
|
||||
if (data->invtransactiontype == OFX_INVBANKTRAN)
|
||||
return 0.0;
|
||||
if (data->currency_ratio_valid && data->currency_ratio != 0)
|
||||
amount *= data->currency_ratio;
|
||||
#endif
|
||||
g_assert(data);
|
||||
@@ -1088,7 +1104,7 @@ gnc_ofx_process_next_file (GtkDialog *dialog, gpointer user_data)
|
||||
info->statement = NULL;
|
||||
|
||||
// Done with the previous OFX file, process the next one if any.
|
||||
info->file_list = g_slist_delete_link(info->file_list, info->file_list);
|
||||
info->file_list = g_slist_delete_link (info->file_list, info->file_list);
|
||||
if (info->file_list)
|
||||
gnc_file_ofx_import_process_file (info);
|
||||
else
|
||||
@@ -1098,14 +1114,36 @@ gnc_ofx_process_next_file (GtkDialog *dialog, gpointer user_data)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// This callback is called when the user is done matching transactions.
|
||||
static void
|
||||
gnc_ofx_match_done (GtkDialog *dialog, gint response_id, gpointer user_data)
|
||||
gnc_ofx_on_match_click (GtkDialog *dialog, gint response_id, gpointer user_data)
|
||||
{
|
||||
// Record the response of the user. If cancel we won't go to the next file, etc.
|
||||
ofx_info* info = (ofx_info*)user_data;
|
||||
info->response = response_id;
|
||||
}
|
||||
|
||||
static void
|
||||
gnc_ofx_match_done (GtkDialog *dialog, gpointer user_data)
|
||||
{
|
||||
ofx_info* info = (ofx_info*) user_data;
|
||||
|
||||
if (response_id == GTK_RESPONSE_OK && info->run_reconcile && info->statement)
|
||||
/* The the user did not click OK, don't process the rest of the
|
||||
* transaction, don't go to the next of xfile.
|
||||
*/
|
||||
if (info->response != GTK_RESPONSE_OK) return;
|
||||
|
||||
if (info->trans_list)
|
||||
{
|
||||
/* Re-run the match dialog if there are transactions
|
||||
* remaining in our list (happens if several accounts exist
|
||||
* in the same ofx).
|
||||
*/
|
||||
info->gnc_ofx_importer_gui = gnc_gen_trans_list_new (GTK_WIDGET (info->parent), NULL, FALSE, 42, FALSE);
|
||||
runMatcher (info, NULL, true);
|
||||
return;
|
||||
}
|
||||
|
||||
if (info->run_reconcile && info->statement)
|
||||
{
|
||||
// Open a reconcile window.
|
||||
Account* account = gnc_import_select_account (gnc_gen_trans_list_widget(info->gnc_ofx_importer_gui),
|
||||
@@ -1121,17 +1159,12 @@ gnc_ofx_match_done (GtkDialog *dialog, gint response_id, gpointer user_data)
|
||||
info->statement->ledger_balance_date);
|
||||
|
||||
// Connect to destroy, at which point we'll process the next OFX file..
|
||||
g_signal_connect (G_OBJECT(gnc_ui_reconcile_window_get_window (rec_window)), "destroy",
|
||||
G_CALLBACK(gnc_ofx_process_next_file), info);
|
||||
g_signal_connect (G_OBJECT (gnc_ui_reconcile_window_get_window (rec_window)), "destroy",
|
||||
G_CALLBACK (gnc_ofx_process_next_file), info);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (response_id == GTK_RESPONSE_HELP)
|
||||
return;
|
||||
else
|
||||
{
|
||||
gtk_widget_hide (GTK_WIDGET(dialog));
|
||||
gnc_ofx_process_next_file (dialog, info);
|
||||
}
|
||||
gnc_ofx_process_next_file (NULL, info);
|
||||
}
|
||||
|
||||
// This callback is triggered when the user checks or unchecks the reconcile after match
|
||||
@@ -1142,6 +1175,70 @@ reconcile_when_close_toggled_cb (GtkToggleButton *togglebutton, ofx_info* info)
|
||||
info->run_reconcile = gtk_toggle_button_get_active (togglebutton);
|
||||
}
|
||||
|
||||
static void
|
||||
runMatcher(ofx_info* info, char * selected_filename, gboolean go_to_next_file)
|
||||
{
|
||||
GtkWindow *parent = info->parent;
|
||||
GList* trans_list_remain = NULL;
|
||||
Account* first_account = NULL;
|
||||
|
||||
/* If we have multiple accounts in the ofx file, we need to
|
||||
* process transactions one account at a time, in case there are
|
||||
* transfers between accounts.
|
||||
*/
|
||||
info->num_trans_processed = 0;
|
||||
for(GList* node = info->trans_list; node; node=node->next)
|
||||
{
|
||||
Transaction* trans = node->data;
|
||||
Split* split = xaccTransGetSplit (trans, 0);
|
||||
if (first_account == NULL) first_account = xaccSplitGetAccount (split);
|
||||
if (xaccSplitGetAccount (split) == first_account)
|
||||
{
|
||||
gnc_gen_trans_list_add_trans (info->gnc_ofx_importer_gui, trans);
|
||||
info->num_trans_processed ++;
|
||||
}
|
||||
else trans_list_remain = g_list_prepend (trans_list_remain, trans);
|
||||
}
|
||||
g_list_free (info->trans_list);
|
||||
info->trans_list = g_list_reverse (trans_list_remain);
|
||||
|
||||
// See whether the view has anything in it and warn the user if not.
|
||||
if (gnc_gen_trans_list_empty (info->gnc_ofx_importer_gui))
|
||||
{
|
||||
gnc_gen_trans_list_delete (info->gnc_ofx_importer_gui);
|
||||
if (info->num_trans_processed)
|
||||
{
|
||||
gchar* acct_name = gnc_get_account_name_for_register (first_account);
|
||||
gnc_info_dialog (parent, _("OFX file '%s', imported transactions for account '%s'\n%d transactions processed, no transactions to match"),
|
||||
selected_filename, acct_name, info->num_trans_processed);
|
||||
g_free (acct_name);
|
||||
gnc_ofx_match_done (NULL,info);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Show the match dialog and connect to the "destroy" signal so we can trigger a reconcile when
|
||||
the user clicks OK when done matching transactions if required. Connecting to response isn't enough
|
||||
because only when the matcher is destroyed do imported transactions get recorded */
|
||||
g_signal_connect (G_OBJECT (gnc_gen_trans_list_widget (info->gnc_ofx_importer_gui)), "destroy",
|
||||
G_CALLBACK (gnc_ofx_match_done), info);
|
||||
|
||||
// Connect to response so we know if the user pressed "cancel".
|
||||
g_signal_connect (G_OBJECT (gnc_gen_trans_list_widget (info->gnc_ofx_importer_gui)), "response",
|
||||
G_CALLBACK (gnc_ofx_on_match_click), info);
|
||||
|
||||
gnc_gen_trans_list_show_all (info->gnc_ofx_importer_gui);
|
||||
|
||||
// Show or hide the check box for reconciling after match, depending on whether a statement was received.
|
||||
gnc_gen_trans_list_show_reconcile_after_close_button (info->gnc_ofx_importer_gui, info->statement != NULL, info->run_reconcile);
|
||||
|
||||
// Finally connect to the reconcile after match check box so we can be notified if the user wants/does not want to reconcile.
|
||||
g_signal_connect (G_OBJECT (gnc_gen_trans_list_get_reconcile_after_close_button (info->gnc_ofx_importer_gui)), "toggled",
|
||||
G_CALLBACK (reconcile_when_close_toggled_cb), info);
|
||||
}
|
||||
}
|
||||
|
||||
// Aux function to process the OFX file in info->file_list
|
||||
static void
|
||||
gnc_file_ofx_import_process_file (ofx_info* info)
|
||||
@@ -1182,33 +1279,7 @@ gnc_file_ofx_import_process_file (ofx_info* info)
|
||||
|
||||
// Free the libofx context before recursing to process the next file
|
||||
libofx_free_context(libofx_context);
|
||||
|
||||
// See whether the view has anything in it and warn the user if not.
|
||||
if(gnc_gen_trans_list_empty (info->gnc_ofx_importer_gui))
|
||||
{
|
||||
gnc_gen_trans_list_delete (info->gnc_ofx_importer_gui);
|
||||
if(info->num_trans_processed)
|
||||
gnc_info_dialog (parent, _("OFX file '%s' imported, %d transactions processed, no transactions to match"),
|
||||
selected_filename, info->num_trans_processed);
|
||||
// Process the next OFX file if any.
|
||||
gnc_ofx_process_next_file (NULL, info);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Show the match dialog and connect to the "response" signal so we can trigger a reconcile when
|
||||
the user clicks OK when done matching transactions if required. */
|
||||
g_signal_connect (G_OBJECT(gnc_gen_trans_list_widget (info->gnc_ofx_importer_gui)), "response",
|
||||
G_CALLBACK (gnc_ofx_match_done), info);
|
||||
|
||||
gnc_gen_trans_list_show_all (info->gnc_ofx_importer_gui);
|
||||
|
||||
// Show or hide the check box for reconciling after match, depending on whether a statement was received.
|
||||
gnc_gen_trans_list_show_reconcile_after_close_button (info->gnc_ofx_importer_gui, info->statement != NULL, info->run_reconcile);
|
||||
|
||||
// Finally connect to the reconcile after match check box so we can be notified if the user wants/does not want to reconcile.
|
||||
g_signal_connect (G_OBJECT(gnc_gen_trans_list_get_reconcile_after_close_button (info->gnc_ofx_importer_gui)), "toggled",
|
||||
G_CALLBACK(reconcile_when_close_toggled_cb), info);
|
||||
}
|
||||
runMatcher(info, selected_filename,true);
|
||||
g_free(selected_filename);
|
||||
}
|
||||
|
||||
@@ -1272,6 +1343,8 @@ void gnc_file_ofx_import (GtkWindow *parent)
|
||||
info->parent = parent;
|
||||
info->run_reconcile = FALSE;
|
||||
info->file_list = selected_filenames;
|
||||
info->trans_list = NULL;
|
||||
info->response = 0;
|
||||
// Call the aux import function.
|
||||
gnc_file_ofx_import_process_file (info);
|
||||
}
|
||||
|
||||
@@ -1,8 +1,14 @@
|
||||
|
||||
if (WITH_OFX)
|
||||
set(ofx_GSCHEMA org.gnucash.dialogs.import.ofx.gschema.xml)
|
||||
set(ofx_GSCHEMA org.gnucash.GnuCash.dialogs.import.ofx.gschema.xml)
|
||||
|
||||
add_gschema_targets("${ofx_GSCHEMA}")
|
||||
|
||||
file(READ migratable-prefs.xml migratable-prefs)
|
||||
file(APPEND ${DATADIR_BUILD}/${PROJECT_NAME}/migratable-prefs.xml ${migratable-prefs})
|
||||
endif()
|
||||
|
||||
set_dist_list(ofx_gschema_DIST CMakeLists.txt org.gnucash.dialogs.import.ofx.gschema.xml.in)
|
||||
set_dist_list(ofx_gschema_DIST
|
||||
CMakeLists.txt
|
||||
migratable-prefs.xml
|
||||
org.gnucash.GnuCash.dialogs.import.ofx.gschema.xml.in)
|
||||
|
||||
8
gnucash/import-export/ofx/gschemas/migratable-prefs.xml
Normal file
8
gnucash/import-export/ofx/gschemas/migratable-prefs.xml
Normal file
@@ -0,0 +1,8 @@
|
||||
|
||||
<release version="4007">
|
||||
|
||||
<migrate old-path="org.gnucash.dialogs.import.ofx"
|
||||
old-key="last-path"
|
||||
new-path="org.gnucash.GnuCash.dialogs.import.ofx"
|
||||
new-key="last-path"/>
|
||||
</release>
|
||||
@@ -1,5 +1,5 @@
|
||||
<schemalist gettext-domain="@PROJECT_NAME@">
|
||||
<schema id="org.gnucash.dialogs.import.ofx" path="/org/gnucash/dialogs/import/ofx/">
|
||||
<schema id="org.gnucash.GnuCash.dialogs.import.ofx" path="/org/gnucash/GnuCash/dialogs/import/ofx/">
|
||||
<key name="last-path" type="s">
|
||||
<default>''</default>
|
||||
<summary>Last pathname used</summary>
|
||||
@@ -61,6 +61,13 @@ qof_log_prettify (const char *name)
|
||||
return name;
|
||||
}
|
||||
|
||||
// Fake qof_log_check suppresses logging.
|
||||
gboolean
|
||||
qof_log_check(QofLogModule log_module, QofLogLevel log_level)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// fake function from engine-helpers.c
|
||||
// this is a slightly modified version of the original function
|
||||
const char *
|
||||
|
||||
@@ -52,9 +52,6 @@ teardown (Fixture *fixture, gconstpointer pData)
|
||||
test_clear_error_list();
|
||||
}
|
||||
|
||||
/* The excluded tests all rely on g_assert_true which was only introduced
|
||||
* in glib 2.38 */
|
||||
#ifdef HAVE_GLIB_2_38
|
||||
static void
|
||||
test_pending_matches_match_types (Fixture *fixture, gconstpointer pData)
|
||||
{
|
||||
@@ -117,7 +114,6 @@ test_pending_matches_keeps_count (Fixture *fixture, gconstpointer pData)
|
||||
|
||||
gnc_import_PendingMatches_delete (matches);
|
||||
}
|
||||
#endif
|
||||
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
@@ -126,16 +122,12 @@ main (int argc, char *argv[])
|
||||
qof_init();
|
||||
g_test_init (&argc, &argv, NULL);
|
||||
|
||||
/* The excluded tests all rely on g_assert_true which was only introduced
|
||||
* in glib 2.38 */
|
||||
#ifdef HAVE_GLIB_2_38
|
||||
GNC_TEST_ADD (suitename, "match_types", Fixture, NULL, setup,
|
||||
test_pending_matches_match_types, teardown);
|
||||
GNC_TEST_ADD (suitename, "prefer_manual_match", Fixture, NULL, setup,
|
||||
test_pending_matches_prefer_manual_match, teardown);
|
||||
GNC_TEST_ADD (suitename, "keeps_count", Fixture, NULL, setup,
|
||||
test_pending_matches_keeps_count, teardown);
|
||||
#endif
|
||||
result = g_test_run();
|
||||
|
||||
qof_close();
|
||||
|
||||
@@ -111,8 +111,14 @@ gnc_checkbox_cell_get_flag (CheckboxCell *cell)
|
||||
return cell->flag;
|
||||
}
|
||||
|
||||
#define UNICODE_CHECKMARK "\xe2\x9c\x93" // U+2716
|
||||
const char *
|
||||
gnc_checkbox_cell_get_string (gboolean flag)
|
||||
{
|
||||
return (flag ? "X" : " ");
|
||||
#ifndef MAC_INTEGRATION
|
||||
const char* checked = UNICODE_CHECKMARK;
|
||||
#else
|
||||
const char* checked = "X";
|
||||
#endif
|
||||
return (flag ? checked : " ");
|
||||
}
|
||||
|
||||
@@ -30,9 +30,11 @@
|
||||
|
||||
#include "basiccell.h"
|
||||
#include "formulacell.h"
|
||||
#include <qoflog.h>
|
||||
|
||||
#undef G_LOG_DOMAIN
|
||||
#define G_LOG_DOMAIN "gnc.register.core.formulacell"
|
||||
static const QofLogModule log_module = G_LOG_DOMAIN;
|
||||
|
||||
static void gnc_formula_cell_init( FormulaCell *fc );
|
||||
|
||||
@@ -83,7 +85,7 @@ void
|
||||
gnc_formula_cell_set_value( FormulaCell *fc,
|
||||
const char *newVal )
|
||||
{
|
||||
g_debug("got value [%s]", newVal);
|
||||
DEBUG("got value [%s]", newVal);
|
||||
gnc_formula_cell_set_value_internal( &fc->cell, newVal );
|
||||
}
|
||||
|
||||
@@ -94,7 +96,7 @@ gnc_formula_cell_enter( BasicCell *_cell,
|
||||
int *start_selection,
|
||||
int *end_selection )
|
||||
{
|
||||
g_debug("%d, %d, %d", *cursor_position, *start_selection, *end_selection);
|
||||
DEBUG("%d, %d, %d", *cursor_position, *start_selection, *end_selection);
|
||||
*cursor_position = -1;
|
||||
*start_selection = 0;
|
||||
*end_selection = -1;
|
||||
@@ -139,7 +141,7 @@ gnc_formula_cell_modify_verify( BasicCell *_cell,
|
||||
const char *toks = "+-*/=()_:";
|
||||
char *validated_newval = NULL;
|
||||
|
||||
g_debug("%s, %d, %s, %d, %d, %d, %d",
|
||||
DEBUG("%s, %d, %s, %d, %d, %d, %d",
|
||||
change ? (gchar *)change : "(null)", change_len,
|
||||
newval ? (gchar *)newval : "(null)", newval_len,
|
||||
*cursor_position, *start_selection, *end_selection);
|
||||
@@ -170,6 +172,6 @@ gnc_formula_cell_set_value_internal( BasicCell *_cell,
|
||||
const char *str )
|
||||
{
|
||||
FormulaCell *fc = (FormulaCell*)_cell;
|
||||
g_debug("internal string: [%s]", str);
|
||||
DEBUG("internal string: [%s]", str);
|
||||
gnc_basic_cell_set_value_internal( &fc->cell, str );
|
||||
}
|
||||
|
||||
@@ -45,7 +45,9 @@
|
||||
|
||||
#include "basiccell.h"
|
||||
#include "pricecell.h"
|
||||
#include <qoflog.h>
|
||||
|
||||
static const QofLogModule log_module = G_LOG_DOMAIN;
|
||||
|
||||
static void gnc_price_cell_init (PriceCell *cell);
|
||||
static void gnc_price_cell_set_value_internal (BasicCell *bcell,
|
||||
@@ -80,7 +82,7 @@ gnc_price_cell_modify_verify (BasicCell *_cell,
|
||||
const char *toks = "+-*/=()_";
|
||||
char *validated_newval = NULL;
|
||||
|
||||
g_debug("%s, %d, %s, %d, %d, %d, %d",
|
||||
DEBUG("%s, %d, %s, %d, %d, %d, %d",
|
||||
change ? (gchar *)change : "(null)", change_len,
|
||||
newval ? (gchar *)newval : "(null)", newval_len,
|
||||
*cursor_position, *start_selection, *end_selection);
|
||||
|
||||
@@ -73,7 +73,7 @@ static void
|
||||
update_message(const gchar *msg)
|
||||
{
|
||||
//gnc_update_splash_screen(msg, GNC_SPLASH_PERCENTAGE_UNKNOWN);
|
||||
g_message("%s", msg);
|
||||
PINFO("%s", msg);
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
@@ -62,7 +62,7 @@ set (app_utils_SOURCES
|
||||
gnc-entry-quickfill.c
|
||||
gnc-euro.c
|
||||
gnc-exp-parser.c
|
||||
gnc-gsettings.c
|
||||
gnc-gsettings.cpp
|
||||
gnc-helpers.c
|
||||
gnc-prefs-utils.c
|
||||
gnc-sx-instance-model.c
|
||||
|
||||
@@ -13,11 +13,14 @@
|
||||
#include "gfec.h"
|
||||
#include "gnc-guile-utils.h"
|
||||
#include "platform.h"
|
||||
#include <qoflog.h>
|
||||
#include <glib.h>
|
||||
#if COMPILER(MSVC)
|
||||
# define strdup _strdup
|
||||
#endif
|
||||
|
||||
static const QofLogModule log_module = G_LOG_DOMAIN;
|
||||
|
||||
static SCM
|
||||
gfec_string_from_utf8(void *data)
|
||||
{
|
||||
@@ -164,10 +167,10 @@ error_handler(const char *msg)
|
||||
gboolean
|
||||
gfec_try_load(const gchar *fn)
|
||||
{
|
||||
g_debug("looking for %s", fn);
|
||||
DEBUG("looking for %s", fn);
|
||||
if (g_file_test(fn, G_FILE_TEST_EXISTS))
|
||||
{
|
||||
g_debug("trying to load %s", fn);
|
||||
DEBUG("trying to load %s", fn);
|
||||
error_in_scm_eval = FALSE;
|
||||
gfec_eval_file(fn, error_handler);
|
||||
return !error_in_scm_eval;
|
||||
|
||||
@@ -49,6 +49,7 @@
|
||||
#include "qof.h"
|
||||
#include "gnc-ui-util.h"
|
||||
|
||||
static const QofLogModule log_module = G_LOG_DOMAIN;
|
||||
static time64 gnc_accounting_period_start_time64 (GncAccountingPeriod which,
|
||||
const GDate *fy_end,
|
||||
const GDate *contains);
|
||||
@@ -152,7 +153,7 @@ gnc_accounting_period_start_gdate (GncAccountingPeriod which,
|
||||
switch (which)
|
||||
{
|
||||
default:
|
||||
g_message ("Undefined relative time constant %d", which);
|
||||
PINFO ("Undefined relative time constant %d", which);
|
||||
g_date_free (date);
|
||||
return NULL;
|
||||
|
||||
@@ -187,7 +188,7 @@ gnc_accounting_period_start_gdate (GncAccountingPeriod which,
|
||||
case GNC_ACCOUNTING_PERIOD_FYEAR:
|
||||
if (fy_end == NULL)
|
||||
{
|
||||
g_message ("Request for fisal year value but no fiscal year end value provided.");
|
||||
PINFO ("Request for fisal year value but no fiscal year end value provided.");
|
||||
g_date_free (date);
|
||||
return NULL;
|
||||
}
|
||||
@@ -197,7 +198,7 @@ gnc_accounting_period_start_gdate (GncAccountingPeriod which,
|
||||
case GNC_ACCOUNTING_PERIOD_FYEAR_PREV:
|
||||
if (fy_end == NULL)
|
||||
{
|
||||
g_message ("Request for fisal year value but no fiscal year end value provided.");
|
||||
PINFO ("Request for fisal year value but no fiscal year end value provided.");
|
||||
g_date_free (date);
|
||||
return NULL;
|
||||
}
|
||||
@@ -246,7 +247,7 @@ gnc_accounting_period_end_gdate (GncAccountingPeriod which,
|
||||
switch (which)
|
||||
{
|
||||
default:
|
||||
g_message ("Undefined relative time constant %d", which);
|
||||
PINFO ("Undefined relative time constant %d", which);
|
||||
g_date_free (date);
|
||||
return 0;
|
||||
|
||||
@@ -281,7 +282,7 @@ gnc_accounting_period_end_gdate (GncAccountingPeriod which,
|
||||
case GNC_ACCOUNTING_PERIOD_FYEAR:
|
||||
if (fy_end == NULL)
|
||||
{
|
||||
g_message ("Request for fisal year value but no fiscal year end value provided.");
|
||||
PINFO ("Request for fisal year value but no fiscal year end value provided.");
|
||||
g_date_free (date);
|
||||
return 0;
|
||||
}
|
||||
@@ -291,7 +292,7 @@ gnc_accounting_period_end_gdate (GncAccountingPeriod which,
|
||||
case GNC_ACCOUNTING_PERIOD_FYEAR_PREV:
|
||||
if (fy_end == NULL)
|
||||
{
|
||||
g_message ("Request for fisal year value but no fiscal year end value provided.");
|
||||
PINFO ("Request for fisal year value but no fiscal year end value provided.");
|
||||
g_date_free (date);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -24,30 +24,33 @@
|
||||
|
||||
#include <config.h>
|
||||
|
||||
|
||||
#include <gio/gio.h>
|
||||
#include <glib.h>
|
||||
|
||||
extern "C" {
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "gnc-gsettings.h"
|
||||
#include "gnc-path.h"
|
||||
#include "qof.h"
|
||||
#include "gnc-prefs-p.h"
|
||||
}
|
||||
|
||||
#include <libxml/xmlmemory.h>
|
||||
#include <libxml/debugXML.h>
|
||||
#include <libxml/HTMLtree.h>
|
||||
#include <libxml/xmlIO.h>
|
||||
#include <libxml/xinclude.h>
|
||||
#include <libxml/catalog.h>
|
||||
#include <libxslt/xslt.h>
|
||||
#include <libxslt/xsltInternals.h>
|
||||
#include <libxslt/transform.h>
|
||||
#include <libxslt/xsltutils.h>
|
||||
#include <boost/property_tree/ptree.hpp>
|
||||
#include <boost/property_tree/xml_parser.hpp>
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
|
||||
namespace bpt = boost::property_tree;
|
||||
|
||||
#define GSET_SCHEMA_PREFIX "org.gnucash.GnuCash"
|
||||
#define GSET_SCHEMA_OLD_PREFIX "org.gnucash"
|
||||
#define CLIENT_TAG "%s-%s-client"
|
||||
#define NOTIFY_TAG "%s-%s-notify_id"
|
||||
|
||||
static GHashTable *schema_hash = NULL;
|
||||
static const gchar *gsettings_prefix;
|
||||
static xmlExternalEntityLoader defaultEntityLoader = NULL;
|
||||
|
||||
static GHashTable *registered_handlers_hash = NULL;
|
||||
|
||||
@@ -62,28 +65,17 @@ static gboolean gnc_gsettings_is_valid_key(GSettings *settings, const gchar *key
|
||||
gchar **keys = NULL;
|
||||
gint i = 0;
|
||||
gboolean found = FALSE;
|
||||
#ifdef HAVE_GLIB_2_46
|
||||
GSettingsSchema *schema;
|
||||
#endif
|
||||
|
||||
// Check if the key is valid key within settings
|
||||
if (!G_IS_SETTINGS(settings))
|
||||
return FALSE;
|
||||
|
||||
#ifdef HAVE_GLIB_2_46
|
||||
g_object_get (settings, "settings-schema", &schema, NULL);
|
||||
|
||||
if (!schema)
|
||||
return FALSE;
|
||||
#endif
|
||||
|
||||
// Get list of keys
|
||||
#ifdef HAVE_GLIB_2_46
|
||||
keys = g_settings_schema_list_keys(schema);
|
||||
#else
|
||||
keys = g_settings_list_keys(settings);
|
||||
#endif
|
||||
|
||||
keys = g_settings_schema_list_keys (schema);
|
||||
while (keys && keys[i])
|
||||
{
|
||||
if (!g_strcmp0(key, keys[i]))
|
||||
@@ -93,8 +85,6 @@ static gboolean gnc_gsettings_is_valid_key(GSettings *settings, const gchar *key
|
||||
}
|
||||
i++;
|
||||
}
|
||||
|
||||
// Free keys
|
||||
g_strfreev(keys);
|
||||
|
||||
return found;
|
||||
@@ -109,7 +99,7 @@ static GSettings * gnc_gsettings_get_settings_ptr (const gchar *schema_str)
|
||||
if (!schema_hash)
|
||||
schema_hash = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
|
||||
|
||||
gset = g_hash_table_lookup (schema_hash, full_name);
|
||||
gset = static_cast<GSettings*> (g_hash_table_lookup (schema_hash, full_name));
|
||||
DEBUG ("Looking for schema %s returned gsettings %p", full_name, gset);
|
||||
if (!gset)
|
||||
{
|
||||
@@ -147,41 +137,28 @@ handlers_hash_unblock_helper (gpointer key, gpointer settings_ptr, gpointer poin
|
||||
/* GSettings Utilities */
|
||||
/************************************************************/
|
||||
|
||||
void
|
||||
gnc_gsettings_set_prefix (const gchar *prefix)
|
||||
{
|
||||
gsettings_prefix = prefix;
|
||||
}
|
||||
|
||||
const gchar *
|
||||
gnc_gsettings_get_prefix (void)
|
||||
{
|
||||
if (!gsettings_prefix)
|
||||
{
|
||||
const char *prefix = g_getenv("GNC_GSETTINGS_PREFIX");
|
||||
if (prefix)
|
||||
gsettings_prefix = prefix;
|
||||
else
|
||||
gsettings_prefix = GSET_SCHEMA_PREFIX;
|
||||
}
|
||||
return gsettings_prefix;
|
||||
return GSET_SCHEMA_PREFIX;
|
||||
}
|
||||
|
||||
gchar *
|
||||
gnc_gsettings_normalize_schema_name (const gchar *name)
|
||||
{
|
||||
if (name == NULL)
|
||||
if (!name)
|
||||
{
|
||||
/* Need to return a newly allocated string */
|
||||
return g_strdup(gnc_gsettings_get_prefix());
|
||||
return g_strdup(GSET_SCHEMA_PREFIX);
|
||||
}
|
||||
if (g_str_has_prefix (name, gnc_gsettings_get_prefix ()))
|
||||
if (g_str_has_prefix (name, GSET_SCHEMA_PREFIX) ||
|
||||
(g_str_has_prefix (name, GSET_SCHEMA_OLD_PREFIX)))
|
||||
{
|
||||
/* Need to return a newly allocated string */
|
||||
return g_strdup(name);
|
||||
}
|
||||
|
||||
return g_strjoin(".", gnc_gsettings_get_prefix(), name, NULL);
|
||||
return g_strjoin(".", GSET_SCHEMA_PREFIX, name, NULL);
|
||||
}
|
||||
|
||||
|
||||
@@ -253,11 +230,11 @@ gnc_gsettings_remove_cb_by_func (const gchar *schema,
|
||||
|
||||
handler_id = g_signal_handler_find (
|
||||
settings_ptr,
|
||||
G_SIGNAL_MATCH_DETAIL | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA,
|
||||
static_cast<GSignalMatchType> (G_SIGNAL_MATCH_DETAIL | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA),
|
||||
g_signal_lookup ("changed", G_TYPE_SETTINGS), /* signal_id */
|
||||
quark, /* signal_detail */
|
||||
NULL, /* closure */
|
||||
G_CALLBACK (func), /* callback function */
|
||||
func, /* callback function */
|
||||
user_data);
|
||||
|
||||
while (handler_id)
|
||||
@@ -267,11 +244,11 @@ gnc_gsettings_remove_cb_by_func (const gchar *schema,
|
||||
|
||||
handler_id = g_signal_handler_find (
|
||||
settings_ptr,
|
||||
G_SIGNAL_MATCH_DETAIL | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA,
|
||||
static_cast<GSignalMatchType> (G_SIGNAL_MATCH_DETAIL | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA),
|
||||
g_signal_lookup ("changed", G_TYPE_SETTINGS), /* signal_id */
|
||||
quark, /* signal_detail */
|
||||
NULL, /* closure */
|
||||
G_CALLBACK (func), /* callback function */
|
||||
func, /* callback function */
|
||||
user_data);
|
||||
}
|
||||
|
||||
@@ -333,7 +310,7 @@ void gnc_gsettings_bind (const gchar *schema,
|
||||
g_return_if_fail (G_IS_SETTINGS (settings_ptr));
|
||||
|
||||
if (gnc_gsettings_is_valid_key (settings_ptr, key))
|
||||
g_settings_bind (settings_ptr, key, object, property, 0);
|
||||
g_settings_bind (settings_ptr, key, object, property, G_SETTINGS_BIND_DEFAULT);
|
||||
else
|
||||
{
|
||||
PERR ("Invalid key %s for schema %s", key, schema);
|
||||
@@ -588,27 +565,17 @@ gnc_gsettings_reset_schema (const gchar *schema_str)
|
||||
{
|
||||
gchar **keys;
|
||||
gint counter = 0;
|
||||
|
||||
#ifdef HAVE_GLIB_2_46
|
||||
GSettingsSchema *schema;
|
||||
#endif
|
||||
GSettings *settings = gnc_gsettings_get_settings_ptr (schema_str);
|
||||
|
||||
if (!settings)
|
||||
return;
|
||||
|
||||
#ifdef HAVE_GLIB_2_46
|
||||
g_object_get (settings, "settings-schema", &schema, NULL);
|
||||
|
||||
if (!schema)
|
||||
return;
|
||||
|
||||
keys = g_settings_schema_list_keys (schema);
|
||||
#else
|
||||
keys = g_settings_list_keys (settings);
|
||||
#endif
|
||||
|
||||
|
||||
if (!keys)
|
||||
return;
|
||||
|
||||
@@ -632,8 +599,10 @@ void gnc_gsettings_load_backend (void)
|
||||
if (g_strcmp0 (g_getenv ("GNC_UNINSTALLED"), "1") == 0)
|
||||
return;
|
||||
|
||||
if (!prefsbackend)
|
||||
prefsbackend = g_new0 (PrefsBackend, 1);
|
||||
if (prefsbackend)
|
||||
g_free (prefsbackend);
|
||||
|
||||
prefsbackend = g_new0 (PrefsBackend, 1);
|
||||
|
||||
prefsbackend->register_cb = gnc_gsettings_register_cb;
|
||||
prefsbackend->remove_cb_by_func = gnc_gsettings_remove_cb_by_func;
|
||||
@@ -658,28 +627,174 @@ void gnc_gsettings_load_backend (void)
|
||||
prefsbackend->block_all = gnc_gsettings_block_all;
|
||||
prefsbackend->unblock_all = gnc_gsettings_unblock_all;
|
||||
|
||||
/* Run any data model changes for the backend before it's used
|
||||
* by anyone */
|
||||
gnc_gsettings_version_upgrade();
|
||||
|
||||
LEAVE("Prefsbackend bind = %p", prefsbackend->bind);
|
||||
}
|
||||
|
||||
|
||||
|
||||
static GVariant *
|
||||
gnc_gsettings_get_user_value (const gchar *schema,
|
||||
const gchar *key)
|
||||
{
|
||||
GSettings *settings_ptr = gnc_gsettings_get_settings_ptr (schema);
|
||||
g_return_val_if_fail (G_IS_SETTINGS (settings_ptr), NULL);
|
||||
|
||||
if (gnc_gsettings_is_valid_key (settings_ptr, key))
|
||||
return g_settings_get_user_value (settings_ptr, key);
|
||||
else
|
||||
{
|
||||
PERR ("Invalid key %s for schema %s", key, schema);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
migrate_one_key (const std::string &oldpath, const std::string &oldkey,
|
||||
const std::string &newpath, const std::string &newkey)
|
||||
{
|
||||
PINFO ("Migrating '%s:%s' to '%s:%s'", oldpath.c_str(), oldkey.c_str(),
|
||||
newpath.c_str(), newkey.c_str());
|
||||
auto user_value = gnc_gsettings_get_user_value (oldpath.data(), oldkey.data());
|
||||
if (user_value)
|
||||
gnc_gsettings_set_value (newpath.data(), newkey.data(), user_value);
|
||||
}
|
||||
|
||||
static void
|
||||
migrate_one_node (bpt::ptree &pt)
|
||||
{
|
||||
/* loop over top-level property tree */
|
||||
std::for_each (pt.begin(), pt.end(),
|
||||
[] (std::pair<bpt::ptree::key_type, bpt::ptree> node)
|
||||
{
|
||||
if (node.first == "<xmlattr>")
|
||||
return;
|
||||
if (node.first != "migrate")
|
||||
{
|
||||
DEBUG ("Skipping non-<migrate> node <%s>", node.first.c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
auto oldpath = node.second.get_optional<std::string> ("<xmlattr>.old-path");
|
||||
auto oldkey = node.second.get_optional<std::string> ("<xmlattr>.old-key");
|
||||
auto newpath = node.second.get_optional<std::string> ("<xmlattr>.new-path");
|
||||
auto newkey = node.second.get_optional<std::string> ("<xmlattr>.new-key");
|
||||
if (!oldpath || !oldkey || !newpath || !newkey)
|
||||
{
|
||||
DEBUG ("Skipping migration node - missing attribute (old-path, old-key, new-path or new-key)");
|
||||
return;
|
||||
}
|
||||
migrate_one_key (*oldpath, *oldkey, *newpath, *newkey);
|
||||
});
|
||||
}
|
||||
|
||||
static void
|
||||
migrate_settings (int old_maj_min)
|
||||
{
|
||||
bpt::ptree pt;
|
||||
|
||||
auto pkg_data_dir = gnc_path_get_pkgdatadir();
|
||||
auto migrate_file = std::string (pkg_data_dir) + "/migratable-prefs.xml";
|
||||
g_free (pkg_data_dir);
|
||||
|
||||
std::ifstream migrate_stream {migrate_file};
|
||||
if (!migrate_stream.is_open())
|
||||
{
|
||||
PWARN("Failed to load settings migration file '%s'", migrate_file.c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
bpt::read_xml (migrate_stream, pt);
|
||||
}
|
||||
catch (bpt::xml_parser_error &e) {
|
||||
PWARN ("Failed to parse GnuCash settings migration file.\n");
|
||||
PWARN ("Error message:\n");
|
||||
PWARN ("%s\n", e.what());
|
||||
return;
|
||||
}
|
||||
catch (...) {
|
||||
PWARN ("Unknown error while parsing GnuCash settings migration file.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
/* loop over top-level property tree */
|
||||
std::for_each (pt.begin(), pt.end(),
|
||||
[&old_maj_min] (std::pair<bpt::ptree::key_type, bpt::ptree> node)
|
||||
{
|
||||
if (node.first != "release")
|
||||
{
|
||||
DEBUG ("Skipping non-<release> node <%s>", node.first.c_str());
|
||||
return;
|
||||
}
|
||||
auto version = node.second.get_optional<int> ("<xmlattr>.version");
|
||||
if (!version)
|
||||
{
|
||||
DEBUG ("Skipping <release> node - no version attribute found");
|
||||
return;
|
||||
}
|
||||
if (*version <= old_maj_min)
|
||||
{
|
||||
DEBUG ("Skipping <release> node - version %i is less than current compatibility level %i", *version, old_maj_min);
|
||||
return;
|
||||
}
|
||||
DEBUG ("Retrieved version value '%i'", *version);
|
||||
|
||||
migrate_one_node (node.second);
|
||||
});
|
||||
}
|
||||
|
||||
void gnc_gsettings_version_upgrade (void)
|
||||
{
|
||||
/* Use versioning to ensure this routine will only sync once for each
|
||||
* superseded setting */
|
||||
int old_maj_min = gnc_gsettings_get_int (GNC_PREFS_GROUP_GENERAL, GNC_PREF_VERSION);
|
||||
int cur_maj_min = PROJECT_VERSION_MAJOR * 100 + PROJECT_VERSION_MINOR;
|
||||
* superseded setting
|
||||
* At first run of GnuCash 4.7 or more recent *all* settings will be migrated
|
||||
* from prefix org.gnucash to org.gnucash.GnuCash, including our GNC_PREF_VERSION setting.
|
||||
* As the logic to determine whether or not to upgrade depends on it we have to do
|
||||
* some extra tests to figure when exactly to start doing migrations.
|
||||
* - if GNC_PREF_VERSION is not set under old nor new prefix, that means
|
||||
* gnucash has never run before on this system = no migration necessary
|
||||
* - if GNC_PREF_VERSION is set under old prefix, but not new prefix
|
||||
* => full migration from old to new prefix should still be run
|
||||
* - if GNC_PREF_VERSION is set under both prefixes
|
||||
* => ignore old prefix and use new prefix result to determine which
|
||||
* migrations would still be needed.
|
||||
*/
|
||||
ENTER("Start of settings migration routine.");
|
||||
|
||||
/* Convert settings to 3.0 compatibility level */
|
||||
if (old_maj_min < 207)
|
||||
auto ogG_maj_min = gnc_gsettings_get_user_value (GNC_PREFS_GROUP_GENERAL, GNC_PREF_VERSION);
|
||||
auto og_maj_min = gnc_gsettings_get_user_value (GSET_SCHEMA_OLD_PREFIX "." GNC_PREFS_GROUP_GENERAL, GNC_PREF_VERSION);
|
||||
|
||||
if (!ogG_maj_min && !og_maj_min)
|
||||
{
|
||||
/* 'use-theme-colors' has been replaced with 'use-gnucash-color-theme'
|
||||
* which inverts the meaning of the setting */
|
||||
gboolean old_color_theme = gnc_gsettings_get_bool (GNC_PREFS_GROUP_GENERAL_REGISTER, GNC_PREF_USE_THEME_COLORS);
|
||||
gnc_gsettings_set_bool (GNC_PREFS_GROUP_GENERAL_REGISTER, GNC_PREF_USE_GNUCASH_COLOR_THEME, !old_color_theme);
|
||||
LEAVE("");
|
||||
return;
|
||||
}
|
||||
|
||||
auto old_maj_min = 0;
|
||||
if (!ogG_maj_min)
|
||||
old_maj_min = gnc_gsettings_get_int (GSET_SCHEMA_OLD_PREFIX "." GNC_PREFS_GROUP_GENERAL, GNC_PREF_VERSION);
|
||||
else
|
||||
{
|
||||
g_variant_unref (ogG_maj_min);
|
||||
old_maj_min = gnc_gsettings_get_int (GNC_PREFS_GROUP_GENERAL, GNC_PREF_VERSION);
|
||||
}
|
||||
g_variant_unref (og_maj_min);
|
||||
|
||||
PINFO ("Previous setting compatibility level: %i", old_maj_min);
|
||||
|
||||
migrate_settings (old_maj_min);
|
||||
|
||||
/* Only write current version if it's more recent than what was set */
|
||||
auto cur_maj_min = PROJECT_VERSION_MAJOR * 1000 + PROJECT_VERSION_MINOR;
|
||||
if (cur_maj_min > old_maj_min)
|
||||
gnc_gsettings_set_int (GNC_PREFS_GROUP_GENERAL, GNC_PREF_VERSION, cur_maj_min);
|
||||
|
||||
LEAVE("");
|
||||
}
|
||||
|
||||
|
||||
@@ -50,9 +50,7 @@
|
||||
#ifndef GNC_GSETTINGS_H
|
||||
#define GNC_GSETTINGS_H
|
||||
|
||||
#include <gio/gio.h>
|
||||
|
||||
#define GSET_SCHEMA_PREFIX "org.gnucash"
|
||||
#include <glib.h>
|
||||
|
||||
/** Convert a partial schema name into a complete gsettings schema name.
|
||||
*
|
||||
@@ -72,16 +70,9 @@
|
||||
*/
|
||||
gchar *gnc_gsettings_normalize_schema_name (const gchar *name);
|
||||
|
||||
|
||||
/** Set the default gsettings schema prefix. This is
|
||||
* used to generate complete schema id's if only
|
||||
* partial id's are passed.
|
||||
*/
|
||||
void gnc_gsettings_set_prefix (const gchar *prefix);
|
||||
|
||||
/** Get the default gsettings schema prefix.
|
||||
* If none was set explicitly, this defaults to
|
||||
* "org.gnucash"
|
||||
* "org.gnucash.GnuCash"
|
||||
*/
|
||||
const gchar *gnc_gsettings_get_prefix (void);
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ void gnc_prefs_init (void)
|
||||
gnc_gsettings_load_backend();
|
||||
|
||||
/* Initialize the core preferences by reading their values from the loaded backend.
|
||||
* Note: of no backend was loaded, these functions will return sane default values.
|
||||
* Note: if no backend was loaded, these functions will return sane default values.
|
||||
*/
|
||||
file_retain_changed_cb (NULL, NULL, NULL);
|
||||
file_retain_type_changed_cb (NULL, NULL, NULL);
|
||||
|
||||
@@ -274,7 +274,7 @@ var_name_from_commodities(gnc_commodity* split_c, gnc_commodity* txn_c)
|
||||
split_m ? split_m : "(null)",
|
||||
txn_m ? txn_m : "(null)");
|
||||
|
||||
g_debug("var_name is %s", var_name);
|
||||
DEBUG("var_name is %s", var_name);
|
||||
return var_name;
|
||||
}
|
||||
|
||||
@@ -831,7 +831,7 @@ _find_unreferenced_vars(gchar *key,
|
||||
if (cb_pair->hash == NULL ||
|
||||
!g_hash_table_lookup_extended(cb_pair->hash, key, NULL, NULL))
|
||||
{
|
||||
g_debug("variable [%s] not found", key);
|
||||
DEBUG("variable [%s] not found", key);
|
||||
cb_pair->list = g_list_append(cb_pair->list, key);
|
||||
}
|
||||
}
|
||||
@@ -914,7 +914,7 @@ gnc_sx_instance_model_update_sx_instances(GncSxInstanceModel *model, SchedXactio
|
||||
g_hash_table_foreach(existing->variable_names, (GHFunc)_find_unreferenced_vars, &removed_cb_data);
|
||||
removed_var_names = removed_cb_data.list;
|
||||
}
|
||||
g_debug("%d removed variables", g_list_length(removed_var_names));
|
||||
DEBUG("%d removed variables", g_list_length(removed_var_names));
|
||||
|
||||
if (new_instances->variable_names != NULL)
|
||||
{
|
||||
@@ -924,7 +924,7 @@ gnc_sx_instance_model_update_sx_instances(GncSxInstanceModel *model, SchedXactio
|
||||
g_hash_table_foreach(new_instances->variable_names, (GHFunc)_find_unreferenced_vars, &added_cb_data);
|
||||
added_var_names = added_cb_data.list;
|
||||
}
|
||||
g_debug("%d added variables", g_list_length(added_var_names));
|
||||
DEBUG("%d added variables", g_list_length(added_var_names));
|
||||
|
||||
if (existing->variable_names != NULL)
|
||||
{
|
||||
@@ -1148,7 +1148,7 @@ split_apply_exchange_rate (Split *split, GHashTable *bindings,
|
||||
if (exchange_rate_var != NULL)
|
||||
{
|
||||
exchange_rate = exchange_rate_var->value;
|
||||
g_debug("exchange_rate is %s", gnc_numeric_to_string (exchange_rate));
|
||||
DEBUG("exchange_rate is %s", gnc_numeric_to_string (exchange_rate));
|
||||
}
|
||||
g_free (exchange_rate_var_name);
|
||||
|
||||
@@ -1161,7 +1161,7 @@ split_apply_exchange_rate (Split *split, GHashTable *bindings,
|
||||
GNC_HOW_RND_ROUND_HALF_UP);
|
||||
|
||||
|
||||
g_debug("amount is %s for memo split '%s'", gnc_numeric_to_string (amt),
|
||||
DEBUG("amount is %s for memo split '%s'", gnc_numeric_to_string (amt),
|
||||
xaccSplitGetMemo (split));
|
||||
xaccSplitSetAmount(split, amt); /* marks split dirty */
|
||||
|
||||
@@ -1191,10 +1191,10 @@ get_transaction_currency(SxTxnCreationData *creation_data,
|
||||
creation_data ? creation_data->creation_errors : NULL;
|
||||
|
||||
if (txn_cmdty)
|
||||
g_debug("Template txn currency is %s.",
|
||||
DEBUG("Template txn currency is %s.",
|
||||
gnc_commodity_get_mnemonic (txn_cmdty));
|
||||
else
|
||||
g_debug("No template txn currency.");
|
||||
DEBUG("No template txn currency.");
|
||||
|
||||
for (;txn_splits; txn_splits = txn_splits->next)
|
||||
{
|
||||
@@ -1260,7 +1260,7 @@ create_each_transaction_helper(Transaction *template_txn, void *user_data)
|
||||
new_txn = xaccTransCloneNoKvp(template_txn);
|
||||
xaccTransBeginEdit(new_txn);
|
||||
|
||||
g_debug("creating template txn desc [%s] for sx [%s]",
|
||||
DEBUG("creating template txn desc [%s] for sx [%s]",
|
||||
xaccTransGetDescription(new_txn),
|
||||
xaccSchedXactionGetName(sx));
|
||||
|
||||
@@ -1320,7 +1320,7 @@ create_each_transaction_helper(Transaction *template_txn, void *user_data)
|
||||
gnc_numeric final = split_apply_formulas(template_split,
|
||||
creation_data);
|
||||
xaccSplitSetValue(copying_split, final);
|
||||
g_debug("value is %s for memo split '%s'",
|
||||
DEBUG("value is %s for memo split '%s'",
|
||||
gnc_numeric_to_string (final),
|
||||
xaccSplitGetMemo (copying_split));
|
||||
if (! gnc_commodity_equal(split_cmdty, txn_cmdty))
|
||||
@@ -1631,11 +1631,11 @@ gnc_sx_instance_model_summarize(GncSxInstanceModel *model, GncSxSummary *summary
|
||||
void
|
||||
gnc_sx_summary_print(const GncSxSummary *summary)
|
||||
{
|
||||
g_message("num_instances: %d", summary->num_instances);
|
||||
g_message("num_to_create: %d", summary->num_to_create_instances);
|
||||
g_message("num_auto_create_instances: %d", summary->num_auto_create_instances);
|
||||
g_message("num_auto_create_no_notify_instances: %d", summary->num_auto_create_no_notify_instances);
|
||||
g_message("need dialog? %s", summary->need_dialog ? "true" : "false");
|
||||
PINFO("num_instances: %d", summary->num_instances);
|
||||
PINFO("num_to_create: %d", summary->num_to_create_instances);
|
||||
PINFO("num_auto_create_instances: %d", summary->num_auto_create_instances);
|
||||
PINFO("num_auto_create_no_notify_instances: %d", summary->num_auto_create_no_notify_instances);
|
||||
PINFO("need dialog? %s", summary->need_dialog ? "true" : "false");
|
||||
}
|
||||
|
||||
static void gnc_numeric_free(gpointer data)
|
||||
@@ -1711,7 +1711,7 @@ static void add_to_hash_amount(GHashTable* hash, const GncGUID* guid, const gnc_
|
||||
}
|
||||
|
||||
/* In case anyone wants to see this in the debug log. */
|
||||
g_debug("Adding to guid [%s] the value [%s]. Value now [%s].",
|
||||
DEBUG("Adding to guid [%s] the value [%s]. Value now [%s].",
|
||||
guidstr,
|
||||
gnc_num_dbg_to_string(*amount),
|
||||
gnc_num_dbg_to_string(*elem));
|
||||
@@ -1724,7 +1724,7 @@ create_cashflow_helper(Transaction *template_txn, void *user_data)
|
||||
GList *template_splits;
|
||||
const gnc_commodity *first_cmdty = NULL;
|
||||
|
||||
g_debug("Evaluating txn desc [%s] for sx [%s]",
|
||||
DEBUG("Evaluating txn desc [%s] for sx [%s]",
|
||||
xaccTransGetDescription(template_txn),
|
||||
xaccSchedXactionGetName(creation_data->sx));
|
||||
|
||||
@@ -1748,7 +1748,7 @@ create_cashflow_helper(Transaction *template_txn, void *user_data)
|
||||
/* Get the account that should be used for this split. */
|
||||
if (!_get_template_split_account(creation_data->sx, template_split, &split_acct, creation_data->creation_errors))
|
||||
{
|
||||
g_debug("Could not find account for split");
|
||||
DEBUG("Could not find account for split");
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1828,7 +1828,7 @@ instantiate_cashflow_internal(const SchedXaction* sx,
|
||||
|
||||
if (!xaccSchedXactionGetEnabled(sx))
|
||||
{
|
||||
g_debug("Skipping non-enabled SX [%s]",
|
||||
DEBUG("Skipping non-enabled SX [%s]",
|
||||
xaccSchedXactionGetName(sx));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -47,6 +47,7 @@ extern "C"
|
||||
|
||||
#undef G_LOG_DOMAIN
|
||||
#define G_LOG_DOMAIN "gnc.backend.file.sx"
|
||||
static const QofLogModule log_module = G_LOG_DOMAIN;
|
||||
|
||||
#define SX_ID "sx:id"
|
||||
#define SX_NAME "sx:name"
|
||||
@@ -228,7 +229,7 @@ sx_name_handler (xmlNodePtr node, gpointer sx_pdata)
|
||||
struct sx_pdata* pdata = static_cast<decltype (pdata)> (sx_pdata);
|
||||
SchedXaction* sx = pdata->sx;
|
||||
gchar* tmp = dom_tree_to_text (node);
|
||||
g_debug ("sx named [%s]", tmp);
|
||||
DEBUG ("sx named [%s]", tmp);
|
||||
g_return_val_if_fail (tmp, FALSE);
|
||||
xaccSchedXactionSetName (sx, tmp);
|
||||
g_free (tmp);
|
||||
@@ -392,7 +393,7 @@ _fixup_recurrence_start_dates (const GDate* sx_start_date, GList* schedule)
|
||||
|
||||
g_date_strftime (date_str, 127, "%x", &next);
|
||||
sched_str = recurrenceToString (r);
|
||||
g_debug ("setting recurrence [%s] start date to [%s]",
|
||||
DEBUG ("setting recurrence [%s] start date to [%s]",
|
||||
sched_str, date_str);
|
||||
g_free (sched_str);
|
||||
}
|
||||
@@ -412,7 +413,7 @@ _fixup_recurrence_start_dates (const GDate* sx_start_date, GList* schedule)
|
||||
Recurrence* fixup = (Recurrence*)g_list_nth_data (schedule, 0);
|
||||
g_date_strftime (date_buf, 127, "%x", sx_start_date);
|
||||
recurrenceSet (fixup, 1, PERIOD_ONCE, sx_start_date, WEEKEND_ADJ_NONE);
|
||||
g_debug ("fixed up period=ONCE Recurrence to date [%s]", date_buf);
|
||||
DEBUG ("fixed up period=ONCE Recurrence to date [%s]", date_buf);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -429,7 +430,7 @@ sx_freqspec_handler (xmlNodePtr node, gpointer sx_pdata)
|
||||
schedule = dom_tree_freqSpec_to_recurrences (node, pdata->book);
|
||||
gnc_sx_set_schedule (sx, schedule);
|
||||
debug_str = recurrenceListToString (schedule);
|
||||
g_debug ("parsed from freqspec [%s]", debug_str);
|
||||
DEBUG ("parsed from freqspec [%s]", debug_str);
|
||||
g_free (debug_str);
|
||||
|
||||
_fixup_recurrence_start_dates (xaccSchedXactionGetStartDate (sx), schedule);
|
||||
@@ -446,7 +447,7 @@ sx_schedule_recurrence_handler (xmlNodePtr node, gpointer parsing_data)
|
||||
Recurrence* r = dom_tree_to_recurrence (node);
|
||||
g_return_val_if_fail (r, FALSE);
|
||||
sched_str = recurrenceToString (r);
|
||||
g_debug ("parsed recurrence [%s]", sched_str);
|
||||
DEBUG ("parsed recurrence [%s]", sched_str);
|
||||
g_free (sched_str);
|
||||
*schedule = g_list_append (*schedule, r);
|
||||
return TRUE;
|
||||
@@ -471,7 +472,7 @@ sx_recurrence_handler (xmlNodePtr node, gpointer _pdata)
|
||||
return FALSE;
|
||||
// g_return_val_if_fail(schedule, FALSE);
|
||||
debug_str = recurrenceListToString (schedule);
|
||||
g_debug ("setting freshly-parsed schedule: [%s]", debug_str);
|
||||
DEBUG ("setting freshly-parsed schedule: [%s]", debug_str);
|
||||
g_free (debug_str);
|
||||
gnc_sx_set_schedule (parsing_data->sx, schedule);
|
||||
parsing_data->saw_recurrence = TRUE;
|
||||
@@ -702,7 +703,7 @@ gnc_schedXaction_end_handler (gpointer data_for_children,
|
||||
for (attr = tree->properties; attr != NULL; attr = attr->next)
|
||||
{
|
||||
xmlChar* attr_value = attr->children->content;
|
||||
g_debug ("sx attribute name[%s] value[%s]", attr->name, attr_value);
|
||||
DEBUG ("sx attribute name[%s] value[%s]", attr->name, attr_value);
|
||||
if (strcmp ((const char*)attr->name, "version") != 0)
|
||||
{
|
||||
g_warning ("unknown sx attribute [%s]", attr->name);
|
||||
@@ -764,7 +765,7 @@ gnc_schedXaction_end_handler (gpointer data_for_children,
|
||||
xmlFreeNode (tree);
|
||||
return FALSE;
|
||||
}
|
||||
g_debug ("template account name [%s] for SX with GncGUID [%s]",
|
||||
DEBUG ("template account name [%s] for SX with GncGUID [%s]",
|
||||
xaccAccountGetName (acct), guidstr);
|
||||
|
||||
/* FIXME: free existing template account.
|
||||
|
||||
@@ -49,6 +49,7 @@ extern "C"
|
||||
|
||||
#include "sixtp-dom-parsers.h"
|
||||
|
||||
static const QofLogModule log_module = G_LOG_DOMAIN;
|
||||
const gchar* transaction_version_string = "2.0.0";
|
||||
|
||||
static void
|
||||
|
||||
@@ -149,14 +149,7 @@ GncXmlBackend::session_begin(QofSession* session, const char* new_uri,
|
||||
|
||||
/* Set the lock file */
|
||||
m_lockfile = m_fullpath + ".LCK";
|
||||
auto locked = get_file_lock();
|
||||
if (mode == SESSION_BREAK_LOCK && !locked)
|
||||
{
|
||||
// Don't pass on locked or readonly errors.
|
||||
QofBackendError berror = get_error();
|
||||
if (!(berror == ERR_BACKEND_LOCKED || berror == ERR_BACKEND_READONLY))
|
||||
set_error(berror);
|
||||
}
|
||||
get_file_lock(mode);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -626,50 +619,45 @@ GncXmlBackend::link_or_make_backup (const std::string& orig,
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
GncXmlBackend::get_file_lock ()
|
||||
void
|
||||
GncXmlBackend::get_file_lock (SessionOpenMode mode)
|
||||
{
|
||||
GStatBuf statbuf;
|
||||
#ifndef G_OS_WIN32
|
||||
char* pathbuf = NULL, *tmpbuf = NULL;
|
||||
size_t pathbuf_size = 0;
|
||||
#endif
|
||||
QofBackendError be_err;
|
||||
|
||||
auto rc = g_stat (m_lockfile.c_str(), &statbuf);
|
||||
if (!rc)
|
||||
{
|
||||
/* oops .. file is locked by another user .. */
|
||||
set_error(ERR_BACKEND_LOCKED);
|
||||
m_lockfile.clear();
|
||||
return false;
|
||||
}
|
||||
|
||||
m_lockfd = g_open (m_lockfile.c_str(), O_RDWR | O_CREAT | O_EXCL ,
|
||||
S_IRUSR | S_IWUSR);
|
||||
S_IRUSR | S_IWUSR);
|
||||
if (m_lockfd == -1)
|
||||
{
|
||||
QofBackendError be_err{ERR_BACKEND_NO_ERR};
|
||||
/* oops .. we can't create the lockfile .. */
|
||||
switch (errno)
|
||||
{
|
||||
case EACCES:
|
||||
case EROFS:
|
||||
case ENOSPC:
|
||||
set_message("Unable to create lockfile, make sure that you have write access to the directory.");
|
||||
be_err = ERR_BACKEND_READONLY;
|
||||
break;
|
||||
default:
|
||||
|
||||
case EROFS:
|
||||
set_message("Unable to create lockfile, data file is on a read-only filesystem.");
|
||||
be_err = ERR_BACKEND_READONLY;
|
||||
break;
|
||||
case ENOSPC:
|
||||
set_message("Unable to create lockfile, no space on filesystem.");
|
||||
be_err = ERR_BACKEND_READONLY;
|
||||
break;
|
||||
case EEXIST:
|
||||
be_err = ERR_BACKEND_LOCKED;
|
||||
break;
|
||||
}
|
||||
if (errno != EEXIST) // Can't lock, but not because the file is locked
|
||||
default:
|
||||
PWARN ("Unable to create the lockfile %s: %s",
|
||||
m_lockfile.c_str(), strerror(errno));
|
||||
set_error(be_err);
|
||||
m_lockfile.clear();
|
||||
return false;
|
||||
set_message("Lockfile creation failed. Please see the tracefile for details.");
|
||||
be_err = ERR_FILEIO_FILE_LOCKERR;
|
||||
}
|
||||
if (!(mode == SESSION_BREAK_LOCK && be_err == ERR_BACKEND_LOCKED))
|
||||
{
|
||||
set_error(be_err);
|
||||
m_lockfile.clear();
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
|
||||
@@ -49,7 +49,7 @@ public:
|
||||
|
||||
private:
|
||||
bool save_may_clobber_data();
|
||||
bool get_file_lock();
|
||||
void get_file_lock(SessionOpenMode);
|
||||
bool link_or_make_backup(const std::string& orig, const std::string& bkup);
|
||||
bool backup_file();
|
||||
bool write_to_file(bool make_backup);
|
||||
|
||||
@@ -95,7 +95,7 @@ typedef struct
|
||||
gint fd;
|
||||
gchar* filename;
|
||||
gchar* perms;
|
||||
gboolean compress;
|
||||
gboolean write;
|
||||
} gz_thread_params_t;
|
||||
|
||||
/* Callback structure */
|
||||
@@ -125,8 +125,8 @@ gnc_v2_book_version_string; /* see gnc-book-xml-v2 */
|
||||
|
||||
/* Forward declarations */
|
||||
static FILE* try_gz_open (const char* filename, const char* perms,
|
||||
gboolean use_gzip,
|
||||
gboolean compress);
|
||||
gboolean compress,
|
||||
gboolean write);
|
||||
static gboolean is_gzipped_file (const gchar* name);
|
||||
static gboolean wait_for_gzip (FILE* file);
|
||||
|
||||
@@ -1433,7 +1433,7 @@ gz_thread_func (gz_thread_params_t* params)
|
||||
goto cleanup_gz_thread_func;
|
||||
}
|
||||
|
||||
if (params->compress)
|
||||
if (params->write)
|
||||
{
|
||||
while (success)
|
||||
{
|
||||
@@ -1451,6 +1451,7 @@ gz_thread_func (gz_thread_params_t* params)
|
||||
}
|
||||
else if (bytes == 0)
|
||||
{
|
||||
printf("gz_thread_func EOF\n");
|
||||
break;
|
||||
}
|
||||
else
|
||||
@@ -1513,17 +1514,17 @@ cleanup_gz_thread_func:
|
||||
}
|
||||
|
||||
static FILE*
|
||||
try_gz_open (const char* filename, const char* perms, gboolean use_gzip,
|
||||
gboolean compress)
|
||||
try_gz_open (const char* filename, const char* perms, gboolean compress,
|
||||
gboolean write)
|
||||
{
|
||||
if (strstr (filename, ".gz.") != NULL) /* its got a temp extension */
|
||||
use_gzip = TRUE;
|
||||
compress = TRUE;
|
||||
|
||||
if (!use_gzip)
|
||||
if (!compress)
|
||||
return g_fopen (filename, perms);
|
||||
|
||||
{
|
||||
int filedes[2];
|
||||
int filedes[2]{};
|
||||
GThread* thread;
|
||||
gz_thread_params_t* params;
|
||||
FILE* file;
|
||||
@@ -1532,18 +1533,31 @@ try_gz_open (const char* filename, const char* perms, gboolean use_gzip,
|
||||
if (_pipe (filedes, 4096, _O_BINARY) < 0)
|
||||
{
|
||||
#else
|
||||
if (pipe (filedes) < 0)
|
||||
/* Set CLOEXEC on the pipe FDs so that if the user runs a
|
||||
* report while saving WebKit's fork won't get an open copy
|
||||
* and keep the pipe from closing. See
|
||||
* https://bugs.gnucash.org/show_bug.cgi?id=798250. Win32
|
||||
* doesn't fork nor does it support CLOEXEC.
|
||||
*/
|
||||
if (pipe (filedes) < 0 ||
|
||||
fcntl(filedes[0], F_SETFD, FD_CLOEXEC) == -1 ||
|
||||
fcntl(filedes[1], F_SETFD, FD_CLOEXEC) == -1)
|
||||
{
|
||||
#endif
|
||||
g_warning ("Pipe call failed. Opening uncompressed file.");
|
||||
g_warning ("Pipe setup failed with errno %d. Opening uncompressed file.", errno);
|
||||
if (filedes[0])
|
||||
{
|
||||
close(filedes[0]);
|
||||
close(filedes[1]);
|
||||
}
|
||||
return g_fopen (filename, perms);
|
||||
}
|
||||
|
||||
params = g_new (gz_thread_params_t, 1);
|
||||
params->fd = filedes[compress ? 0 : 1];
|
||||
params->fd = filedes[write ? 0 : 1];
|
||||
params->filename = g_strdup (filename);
|
||||
params->perms = g_strdup (perms);
|
||||
params->compress = compress;
|
||||
params->write = write;
|
||||
|
||||
thread = g_thread_new ("xml_thread", (GThreadFunc) gz_thread_func,
|
||||
params);
|
||||
@@ -1559,7 +1573,7 @@ try_gz_open (const char* filename, const char* perms, gboolean use_gzip,
|
||||
return g_fopen (filename, perms);
|
||||
}
|
||||
|
||||
if (compress)
|
||||
if (write)
|
||||
file = fdopen (filedes[1], "w");
|
||||
else
|
||||
file = fdopen (filedes[0], "r");
|
||||
|
||||
@@ -31,6 +31,7 @@ extern "C"
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
#include <qoflog.h>
|
||||
#ifdef _MSC_VER
|
||||
typedef int ssize_t;
|
||||
# define g_fopen fopen
|
||||
@@ -43,6 +44,7 @@ extern "C"
|
||||
|
||||
#undef G_LOG_DOMAIN
|
||||
#define G_LOG_DOMAIN "gnc.backend.file.sixtp"
|
||||
static QofLogModule log_module = "gnc.backend.file.sixtp";
|
||||
|
||||
extern const gchar* gnc_v2_xml_version_string; /* see io-gncxml-v2.c */
|
||||
|
||||
@@ -169,7 +171,7 @@ sixtp_set_any (sixtp* tochange, int cleanup, ...)
|
||||
|
||||
if (!tochange)
|
||||
{
|
||||
g_warning ("Null tochange passed");
|
||||
PWARN ("Null tochange passed");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -266,7 +268,7 @@ sixtp_destroy_child (gpointer key, gpointer value, gpointer user_data)
|
||||
gpointer lookup_key;
|
||||
gpointer lookup_value;
|
||||
|
||||
g_debug ("Killing sixtp child under key <%s>", key ? (char*) key : "(null)");
|
||||
DEBUG ("Killing sixtp child under key <%s>", key ? (char*) key : "(null)");
|
||||
|
||||
if (!corpses)
|
||||
{
|
||||
@@ -350,7 +352,7 @@ sixtp_add_some_sub_parsers (sixtp* tochange, int cleanup, ...)
|
||||
handler = va_arg (ap, sixtp*);
|
||||
if (!handler)
|
||||
{
|
||||
g_warning ("Handler for tag %s is null",
|
||||
PWARN ("Handler for tag %s is null",
|
||||
tag ? tag : "(null)");
|
||||
|
||||
if (cleanup)
|
||||
@@ -521,7 +523,7 @@ sixtp_sax_end_handler (void* user_data, const xmlChar* name)
|
||||
necessary? */
|
||||
if (g_strcmp0 (current_frame->tag, (gchar*) name) != 0)
|
||||
{
|
||||
g_warning ("bad closing tag (start <%s>, end <%s>)", current_frame->tag, name);
|
||||
PWARN ("bad closing tag (start <%s>, end <%s>)", current_frame->tag, name);
|
||||
pdata->parsing_ok = FALSE;
|
||||
|
||||
/* See if we're just off by one and try to recover */
|
||||
@@ -530,7 +532,7 @@ sixtp_sax_end_handler (void* user_data, const xmlChar* name)
|
||||
pdata->stack = sixtp_pop_and_destroy_frame (pdata->stack);
|
||||
current_frame = (sixtp_stack_frame*) pdata->stack->data;
|
||||
parent_frame = (sixtp_stack_frame*) pdata->stack->next->data;
|
||||
g_warning ("found matching start <%s> tag up one level", name);
|
||||
PWARN ("found matching start <%s> tag up one level", name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -566,7 +568,7 @@ sixtp_sax_end_handler (void* user_data, const xmlChar* name)
|
||||
/* grab it before it goes away - we own the reference */
|
||||
end_tag = current_frame->tag;
|
||||
|
||||
g_debug ("Finished with end of <%s>", end_tag ? end_tag : "(null)");
|
||||
DEBUG ("Finished with end of <%s>", end_tag ? end_tag : "(null)");
|
||||
|
||||
/*sixtp_print_frame_stack(pdata->stack, stderr);*/
|
||||
|
||||
@@ -754,7 +756,7 @@ sixtp_parse_file (sixtp* sixtp,
|
||||
gchar* conv_name = g_win32_locale_filename_from_utf8 (filename);
|
||||
if (!conv_name)
|
||||
{
|
||||
g_warning ("Could not convert '%s' to system codepage", filename);
|
||||
PWARN ("Could not convert '%s' to system codepage", filename);
|
||||
return FALSE;
|
||||
}
|
||||
context = xmlCreateFileParserCtxt (conv_name);
|
||||
@@ -776,7 +778,7 @@ sixtp_parser_read (void* context, char* buffer, int len)
|
||||
|
||||
ret = fread (&buffer[0], sizeof (char), len, (FILE*) context);
|
||||
if (ret < 0)
|
||||
g_warning ("Error reading XML file");
|
||||
PWARN ("Error reading XML file");
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -46,6 +46,9 @@ extern "C"
|
||||
#include "io-gncxml-v2.h"
|
||||
#include "test-file-stuff.h"
|
||||
#include "test-stuff.h"
|
||||
#include <qoflog.h>
|
||||
|
||||
static const QofLogModule log_module = G_LOG_DOMAIN;
|
||||
|
||||
static QofSession* session = NULL;
|
||||
static int iter;
|
||||
@@ -128,7 +131,7 @@ test_generation (void)
|
||||
{
|
||||
GNCPriceDB* db;
|
||||
auto book = qof_book_new();
|
||||
g_message ("iter=%d", iter);
|
||||
PINFO ("iter=%d", iter);
|
||||
session = qof_session_new (book);
|
||||
db = get_random_pricedb (book);
|
||||
if (!db)
|
||||
@@ -150,9 +153,6 @@ main (int argc, char** argv)
|
||||
{
|
||||
qof_init ();
|
||||
cashobjects_register ();
|
||||
//qof_log_init_filename("/tmp/gnctest.trace");
|
||||
//qof_log_set_default(QOF_LOG_DETAIL);
|
||||
//qof_log_set_level(GNC_MOD_PRICE, QOF_LOG_DETAIL);
|
||||
test_generation ();
|
||||
print_test_results ();
|
||||
qof_close ();
|
||||
|
||||
@@ -328,14 +328,6 @@ void gnc_gpid_kill(GPid pid)
|
||||
#endif /* G_OS_WIN32 */
|
||||
}
|
||||
|
||||
static inline char*
|
||||
gnc_strcat (char* dest, const char* src)
|
||||
{
|
||||
while (*dest) dest++;
|
||||
while ((*dest++ = *src++));
|
||||
return --dest;
|
||||
}
|
||||
|
||||
gchar *
|
||||
gnc_g_list_stringjoin (GList *list_of_strings, const gchar *sep)
|
||||
{
|
||||
@@ -352,9 +344,9 @@ gnc_g_list_stringjoin (GList *list_of_strings, const gchar *sep)
|
||||
p = retval = (gchar*) g_malloc0 (length * sizeof (gchar) + 1);
|
||||
for (GList *n = list_of_strings; n; n = n->next)
|
||||
{
|
||||
p = gnc_strcat (p, (gchar*)n->data);
|
||||
p = g_stpcpy (p, (gchar*)n->data);
|
||||
if (n->next && sep)
|
||||
p = gnc_strcat (p, sep);
|
||||
p = g_stpcpy (p, sep);
|
||||
}
|
||||
|
||||
return retval;
|
||||
|
||||
@@ -325,6 +325,9 @@ gnc_account_init(Account* acc)
|
||||
priv->starting_reconciled_balance = gnc_numeric_zero();
|
||||
priv->balance_dirty = FALSE;
|
||||
|
||||
priv->last_num = (char*) is_unset;
|
||||
priv->tax_us_code = (char*) is_unset;
|
||||
priv->tax_us_pns = (char*) is_unset;
|
||||
priv->color = (char*) is_unset;
|
||||
priv->sort_order = (char*) is_unset;
|
||||
priv->notes = (char*) is_unset;
|
||||
@@ -1374,6 +1377,12 @@ xaccFreeAccount (Account *acc)
|
||||
qof_string_cache_remove(priv->description);
|
||||
priv->accountName = priv->accountCode = priv->description = nullptr;
|
||||
|
||||
if (priv->last_num != is_unset)
|
||||
g_free (priv->last_num);
|
||||
if (priv->tax_us_code != is_unset)
|
||||
g_free (priv->tax_us_code);
|
||||
if (priv->tax_us_pns != is_unset)
|
||||
g_free (priv->tax_us_pns);
|
||||
if (priv->color != is_unset)
|
||||
g_free (priv->color);
|
||||
if (priv->sort_order != is_unset)
|
||||
@@ -1386,6 +1395,9 @@ xaccFreeAccount (Account *acc)
|
||||
/* zero out values, just in case stray
|
||||
* pointers are pointing here. */
|
||||
|
||||
priv->last_num = nullptr;
|
||||
priv->tax_us_code = nullptr;
|
||||
priv->tax_us_pns = nullptr;
|
||||
priv->color == nullptr;
|
||||
priv->sort_order == nullptr;
|
||||
priv->notes == nullptr;
|
||||
@@ -2486,7 +2498,8 @@ stripdup_or_null (const char *value)
|
||||
// note the *value argument is expected to be either a strstripped
|
||||
// char* or nullptr, as returned by stripdup_or_null above.
|
||||
static void
|
||||
set_kvp_string_tag (Account *acc, const char *tag, const char *value)
|
||||
set_kvp_string_path (Account *acc, std::vector<std::string> const & path,
|
||||
const char *value)
|
||||
{
|
||||
g_return_if_fail(GNC_IS_ACCOUNT(acc));
|
||||
|
||||
@@ -2496,28 +2509,40 @@ set_kvp_string_tag (Account *acc, const char *tag, const char *value)
|
||||
GValue v = G_VALUE_INIT;
|
||||
g_value_init (&v, G_TYPE_STRING);
|
||||
g_value_set_string (&v, value);
|
||||
qof_instance_set_path_kvp (QOF_INSTANCE (acc), &v, {tag});
|
||||
qof_instance_set_path_kvp (QOF_INSTANCE (acc), &v, path);
|
||||
g_value_unset (&v);
|
||||
}
|
||||
else
|
||||
{
|
||||
qof_instance_set_path_kvp (QOF_INSTANCE (acc), NULL, {tag});
|
||||
qof_instance_set_path_kvp (QOF_INSTANCE (acc), NULL, path);
|
||||
}
|
||||
mark_account (acc);
|
||||
xaccAccountCommitEdit(acc);
|
||||
}
|
||||
|
||||
static void
|
||||
set_kvp_string_tag (Account *acc, const char *tag, const char *value)
|
||||
{
|
||||
set_kvp_string_path (acc, {tag}, value);
|
||||
}
|
||||
|
||||
static char*
|
||||
get_kvp_string_tag (const Account *acc, const char *tag)
|
||||
get_kvp_string_path (const Account *acc, std::vector<std::string> const & path)
|
||||
{
|
||||
GValue v = G_VALUE_INIT;
|
||||
if (acc == NULL || tag == NULL) return NULL;
|
||||
qof_instance_get_path_kvp (QOF_INSTANCE (acc), &v, {tag});
|
||||
if (acc == NULL) return NULL; // how to check path is valid??
|
||||
qof_instance_get_path_kvp (QOF_INSTANCE (acc), &v, path);
|
||||
auto retval = G_VALUE_HOLDS_STRING (&v) ? g_value_dup_string (&v) : NULL;
|
||||
g_value_unset (&v);
|
||||
return retval;
|
||||
}
|
||||
|
||||
static char*
|
||||
get_kvp_string_tag (const Account *acc, const char *tag)
|
||||
{
|
||||
return get_kvp_string_path (acc, {tag});
|
||||
}
|
||||
|
||||
void
|
||||
xaccAccountSetColor (Account *acc, const char *str)
|
||||
{
|
||||
@@ -2708,6 +2733,7 @@ DxaccAccountSetCurrency (Account * acc, gnc_commodity * currency)
|
||||
qof_instance_set_path_kvp (QOF_INSTANCE (acc), &v, {"old-currency"});
|
||||
mark_account (acc);
|
||||
xaccAccountCommitEdit(acc);
|
||||
g_value_unset (&v);
|
||||
|
||||
table = gnc_commodity_table_get_table (qof_instance_get_book(acc));
|
||||
commodity = gnc_commodity_table_lookup_unique (table, s);
|
||||
@@ -3359,16 +3385,20 @@ DxaccAccountGetCurrency (const Account *acc)
|
||||
GValue v = G_VALUE_INIT;
|
||||
const char *s = NULL;
|
||||
gnc_commodity_table *table;
|
||||
gnc_commodity *retval = NULL;
|
||||
|
||||
if (!acc) return NULL;
|
||||
qof_instance_get_path_kvp (QOF_INSTANCE(acc), &v, {"old-currency"});
|
||||
if (G_VALUE_HOLDS_STRING (&v))
|
||||
s = g_value_get_string (&v);
|
||||
if (!s) return NULL;
|
||||
if (s)
|
||||
{
|
||||
table = gnc_commodity_table_get_table (qof_instance_get_book(acc));
|
||||
retval = gnc_commodity_table_lookup_unique (table, s);
|
||||
}
|
||||
g_value_unset (&v);
|
||||
|
||||
table = gnc_commodity_table_get_table (qof_instance_get_book(acc));
|
||||
|
||||
return gnc_commodity_table_lookup_unique (table, s);
|
||||
return retval;
|
||||
}
|
||||
|
||||
gnc_commodity *
|
||||
@@ -4064,49 +4094,39 @@ xaccAccountSetTaxRelated (Account *acc, gboolean tax_related)
|
||||
const char *
|
||||
xaccAccountGetTaxUSCode (const Account *acc)
|
||||
{
|
||||
GValue v = G_VALUE_INIT;
|
||||
g_return_val_if_fail(GNC_IS_ACCOUNT(acc), FALSE);
|
||||
qof_instance_get_path_kvp (QOF_INSTANCE(acc), &v, {"tax-US", "code"});
|
||||
return G_VALUE_HOLDS_STRING (&v) ? g_value_get_string (&v) : NULL;
|
||||
auto priv = GET_PRIVATE (acc);
|
||||
if (priv->tax_us_code == is_unset)
|
||||
priv->tax_us_code = get_kvp_string_path (acc, {"tax-US", "code"});
|
||||
return priv->tax_us_code;
|
||||
}
|
||||
|
||||
void
|
||||
xaccAccountSetTaxUSCode (Account *acc, const char *code)
|
||||
{
|
||||
GValue v = G_VALUE_INIT;
|
||||
g_return_if_fail(GNC_IS_ACCOUNT(acc));
|
||||
|
||||
g_value_init (&v, G_TYPE_STRING);
|
||||
g_value_set_string (&v, code);
|
||||
xaccAccountBeginEdit (acc);
|
||||
qof_instance_set_path_kvp (QOF_INSTANCE (acc), &v, {"tax-US", "code"});
|
||||
mark_account (acc);
|
||||
xaccAccountCommitEdit (acc);
|
||||
g_value_unset (&v);
|
||||
auto priv = GET_PRIVATE (acc);
|
||||
if (priv->tax_us_code != is_unset)
|
||||
g_free (priv->tax_us_code);
|
||||
priv->tax_us_code = g_strdup (code);
|
||||
set_kvp_string_path (acc, {"tax-US", "code"}, priv->tax_us_code);
|
||||
}
|
||||
|
||||
const char *
|
||||
xaccAccountGetTaxUSPayerNameSource (const Account *acc)
|
||||
{
|
||||
GValue v = G_VALUE_INIT;
|
||||
g_return_val_if_fail(GNC_IS_ACCOUNT(acc), FALSE);
|
||||
qof_instance_get_path_kvp (QOF_INSTANCE(acc), &v, {"tax-US", "payer-name-source"});
|
||||
return G_VALUE_HOLDS_STRING (&v) ? g_value_get_string (&v) : NULL;
|
||||
auto priv = GET_PRIVATE (acc);
|
||||
if (priv->tax_us_pns == is_unset)
|
||||
priv->tax_us_pns = get_kvp_string_path (acc, {"tax-US", "payer-name-source"});
|
||||
return priv->tax_us_pns;
|
||||
}
|
||||
|
||||
void
|
||||
xaccAccountSetTaxUSPayerNameSource (Account *acc, const char *source)
|
||||
{
|
||||
GValue v = G_VALUE_INIT;
|
||||
g_return_if_fail(GNC_IS_ACCOUNT(acc));
|
||||
|
||||
g_value_init (&v, G_TYPE_STRING);
|
||||
g_value_set_string (&v, source);
|
||||
xaccAccountBeginEdit (acc);
|
||||
qof_instance_set_path_kvp (QOF_INSTANCE (acc), &v, {"tax-US", "payer-name-source"});
|
||||
mark_account (acc);
|
||||
xaccAccountCommitEdit (acc);
|
||||
g_value_unset (&v);
|
||||
auto priv = GET_PRIVATE (acc);
|
||||
if (priv->tax_us_pns != is_unset)
|
||||
g_free (priv->tax_us_pns);
|
||||
priv->tax_us_pns = g_strdup (source);
|
||||
set_kvp_string_path (acc, {"tax-US", "payer-name-source"}, priv->tax_us_pns);
|
||||
}
|
||||
|
||||
gint64
|
||||
@@ -4837,10 +4857,10 @@ xaccAccountClearReconcilePostpone (Account *acc)
|
||||
const char *
|
||||
xaccAccountGetLastNum (const Account *acc)
|
||||
{
|
||||
GValue v = G_VALUE_INIT;
|
||||
g_return_val_if_fail(GNC_IS_ACCOUNT(acc), FALSE);
|
||||
qof_instance_get_path_kvp (QOF_INSTANCE(acc), &v, {"last-num"});
|
||||
return G_VALUE_HOLDS_STRING (&v) ? g_value_get_string (&v) : NULL;
|
||||
auto priv = GET_PRIVATE (acc);
|
||||
if (priv->last_num == is_unset)
|
||||
priv->last_num = get_kvp_string_tag (acc, "last-num");
|
||||
return priv->last_num;
|
||||
}
|
||||
|
||||
/********************************************************************\
|
||||
@@ -4849,16 +4869,11 @@ xaccAccountGetLastNum (const Account *acc)
|
||||
void
|
||||
xaccAccountSetLastNum (Account *acc, const char *num)
|
||||
{
|
||||
GValue v = G_VALUE_INIT;
|
||||
g_return_if_fail(GNC_IS_ACCOUNT(acc));
|
||||
g_value_init (&v, G_TYPE_STRING);
|
||||
|
||||
g_value_set_string (&v, num);
|
||||
xaccAccountBeginEdit (acc);
|
||||
qof_instance_set_path_kvp (QOF_INSTANCE (acc), &v, {"last-num"});
|
||||
mark_account (acc);
|
||||
xaccAccountCommitEdit (acc);
|
||||
g_value_unset (&v);
|
||||
auto priv = GET_PRIVATE (acc);
|
||||
if (priv->last_num != is_unset)
|
||||
g_free (priv->last_num);
|
||||
priv->last_num = g_strdup (num);
|
||||
set_kvp_string_tag (acc, "last-num", priv->last_num);
|
||||
}
|
||||
|
||||
static Account *
|
||||
@@ -4952,22 +4967,7 @@ dxaccAccountSetPriceSrc(Account *acc, const char *src)
|
||||
if (!acc) return;
|
||||
|
||||
if (xaccAccountIsPriced(acc))
|
||||
{
|
||||
xaccAccountBeginEdit(acc);
|
||||
if (src)
|
||||
{
|
||||
GValue v = G_VALUE_INIT;
|
||||
g_value_init (&v, G_TYPE_STRING);
|
||||
g_value_set_string (&v, src);
|
||||
qof_instance_set_path_kvp (QOF_INSTANCE(acc), &v, {"old-price-source"});
|
||||
g_value_unset (&v);
|
||||
}
|
||||
else
|
||||
qof_instance_set_path_kvp (QOF_INSTANCE(acc), nullptr, {"old-price-source"});
|
||||
|
||||
mark_account (acc);
|
||||
xaccAccountCommitEdit(acc);
|
||||
}
|
||||
set_kvp_string_tag (acc, "old-price-source", src);
|
||||
}
|
||||
|
||||
/********************************************************************\
|
||||
@@ -4976,13 +4976,14 @@ dxaccAccountSetPriceSrc(Account *acc, const char *src)
|
||||
const char*
|
||||
dxaccAccountGetPriceSrc(const Account *acc)
|
||||
{
|
||||
GValue v = G_VALUE_INIT;
|
||||
static char *source = nullptr;
|
||||
if (!acc) return NULL;
|
||||
|
||||
if (!xaccAccountIsPriced(acc)) return NULL;
|
||||
|
||||
qof_instance_get_path_kvp (QOF_INSTANCE(acc), &v, {"old-price-source"});
|
||||
return G_VALUE_HOLDS_STRING (&v) ? g_value_get_string (&v) : NULL;
|
||||
g_free (source);
|
||||
source = get_kvp_string_tag (acc, "old-price-source");
|
||||
return source;
|
||||
}
|
||||
|
||||
/********************************************************************\
|
||||
@@ -4991,15 +4992,9 @@ dxaccAccountGetPriceSrc(const Account *acc)
|
||||
void
|
||||
dxaccAccountSetQuoteTZ(Account *acc, const char *tz)
|
||||
{
|
||||
GValue v = G_VALUE_INIT;
|
||||
if (!acc) return;
|
||||
if (!xaccAccountIsPriced(acc)) return;
|
||||
xaccAccountBeginEdit(acc);
|
||||
g_value_init (&v, G_TYPE_STRING);
|
||||
g_value_set_string (&v, tz);
|
||||
qof_instance_set_path_kvp (QOF_INSTANCE (acc), &v, {"old-quote-tz"});
|
||||
mark_account (acc);
|
||||
xaccAccountCommitEdit(acc);
|
||||
set_kvp_string_tag (acc, "old-quote-tz", tz);
|
||||
}
|
||||
|
||||
/********************************************************************\
|
||||
@@ -5008,11 +5003,12 @@ dxaccAccountSetQuoteTZ(Account *acc, const char *tz)
|
||||
const char*
|
||||
dxaccAccountGetQuoteTZ(const Account *acc)
|
||||
{
|
||||
GValue v = G_VALUE_INIT;
|
||||
static char *quote_tz = nullptr;
|
||||
if (!acc) return NULL;
|
||||
if (!xaccAccountIsPriced(acc)) return NULL;
|
||||
qof_instance_get_path_kvp (QOF_INSTANCE (acc), &v, {"old-quote-tz"});
|
||||
return G_VALUE_HOLDS_STRING (&v) ? g_value_get_string (&v) : NULL;
|
||||
g_free (quote_tz);
|
||||
quote_tz = get_kvp_string_tag (acc, "old-quote-tz");
|
||||
return quote_tz;
|
||||
}
|
||||
|
||||
/********************************************************************\
|
||||
@@ -5987,23 +5983,10 @@ gnc_account_imap_get_info (Account *acc, const char *category)
|
||||
gchar *
|
||||
gnc_account_get_map_entry (Account *acc, const char *head, const char *category)
|
||||
{
|
||||
GValue v = G_VALUE_INIT;
|
||||
gchar *text = NULL;
|
||||
std::vector<std::string> path {head};
|
||||
if (category)
|
||||
path.emplace_back (category);
|
||||
if (qof_instance_has_path_slot (QOF_INSTANCE (acc), path))
|
||||
{
|
||||
qof_instance_get_path_kvp (QOF_INSTANCE (acc), &v, path);
|
||||
if (G_VALUE_HOLDS_STRING (&v))
|
||||
{
|
||||
gchar const *string;
|
||||
string = g_value_get_string (&v);
|
||||
text = g_strdup (string);
|
||||
}
|
||||
}
|
||||
g_value_unset (&v);
|
||||
return text;
|
||||
return get_kvp_string_path (acc, {head, category});
|
||||
else
|
||||
return get_kvp_string_path (acc, {head});
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -469,7 +469,7 @@ Account * xaccAccountGainsAccount (Account *acc, gnc_commodity *curr);
|
||||
void dxaccAccountSetPriceSrc (Account *account, const char *src);
|
||||
/** Get a string that identifies the Finance::Quote backend that
|
||||
* should be used to retrieve online prices. See price-quotes.scm
|
||||
* for more information.
|
||||
* for more information. This function uses a static char*.
|
||||
*
|
||||
* @deprecated Price quote information is now stored on the
|
||||
* commodity, not the account. */
|
||||
@@ -1576,7 +1576,8 @@ gnc_commodity * DxaccAccountGetCurrency (const Account *account);
|
||||
void dxaccAccountSetQuoteTZ (Account *account, const char *tz);
|
||||
/** Get the timezone to be used when interpreting the results from a
|
||||
* given Finance::Quote backend. Unfortunately, the upstream sources
|
||||
* don't label their output, so the user has to specify this bit.
|
||||
* don't label their output, so the user has to specify this
|
||||
* bit. This function uses a static char*.
|
||||
*
|
||||
* @deprecated Price quote information is now stored on the
|
||||
* commodity, not the account. */
|
||||
|
||||
@@ -133,6 +133,9 @@ typedef struct AccountPrivate
|
||||
TriState equity_type;
|
||||
char *notes;
|
||||
char *color;
|
||||
char *tax_us_code;
|
||||
char *tax_us_pns;
|
||||
char *last_num;
|
||||
char *sort_order;
|
||||
char *filter;
|
||||
|
||||
|
||||
@@ -162,18 +162,6 @@ gnc_engine_is_initialized (void)
|
||||
return (engine_is_initialized == 1) ? TRUE : FALSE;
|
||||
}
|
||||
|
||||
/* replicate old gnc-trace enum behaviour
|
||||
*
|
||||
* these are only here as a convenience, they could be
|
||||
* initialised elsewhere as appropriate.
|
||||
* */
|
||||
void gnc_log_default(void)
|
||||
{
|
||||
qof_log_set_default(QOF_LOG_WARNING);
|
||||
qof_log_set_level(GNC_MOD_ROOT, QOF_LOG_WARNING);
|
||||
qof_log_set_level(GNC_MOD_TEST, QOF_LOG_DEBUG);
|
||||
}
|
||||
|
||||
void
|
||||
gnc_engine_add_commit_error_callback( EngineCommitErrorCallback cb, gpointer data )
|
||||
{
|
||||
|
||||
@@ -72,7 +72,6 @@ extern "C" {
|
||||
#define GNC_MOD_PREFS "gnc.pref"
|
||||
#define GNC_MOD_IMPORT "gnc.import"
|
||||
#define GNC_MOD_ASSISTANT "gnc.assistant"
|
||||
#define GNC_MOD_TEST "gnc.tests"
|
||||
#define GNC_MOD_BUDGET "gnc.budget"
|
||||
//@}
|
||||
|
||||
|
||||
@@ -788,13 +788,13 @@ gncOwnerCreatePaymentLotSecs (const GncOwner *owner, Transaction **preset_txn,
|
||||
|
||||
if (xaccTransGetCurrency(txn) != gncOwnerGetCurrency (owner))
|
||||
{
|
||||
g_message("Uh oh, mismatching currency/commodity between selected transaction and owner. We fall back to manual creation of a new transaction.");
|
||||
PINFO("Uh oh, mismatching currency/commodity between selected transaction and owner. We fall back to manual creation of a new transaction.");
|
||||
xfer_split = NULL;
|
||||
}
|
||||
|
||||
if (!xfer_split)
|
||||
{
|
||||
g_message("Huh? Asset account not found anymore. Fully deleting old txn and now creating a new one.");
|
||||
PINFO("Huh? Asset account not found anymore. Fully deleting old txn and now creating a new one.");
|
||||
|
||||
xaccTransBeginEdit (txn);
|
||||
xaccTransDestroy (txn);
|
||||
|
||||
@@ -55,6 +55,7 @@ extern "C"
|
||||
#include "qof.h"
|
||||
#include "qoflog.h"
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
#include <algorithm>
|
||||
@@ -79,9 +80,11 @@ using MEVec = std::vector<ModuleEntryPtr>;
|
||||
|
||||
static constexpr int parts = 4; //Log domain parts vector preallocation size
|
||||
static constexpr QofLogLevel default_level = QOF_LOG_WARNING;
|
||||
static QofLogLevel current_max{default_level};
|
||||
|
||||
struct ModuleEntry
|
||||
{
|
||||
ModuleEntry(std::string name, QofLogLevel level) :
|
||||
ModuleEntry(const std::string& name, QofLogLevel level) :
|
||||
m_name{name}, m_level{level} {
|
||||
m_children.reserve(parts);
|
||||
}
|
||||
@@ -102,19 +105,19 @@ get_modules()
|
||||
}
|
||||
|
||||
static StrVec
|
||||
split_domain (const std::string domain)
|
||||
split_domain (const std::string_view domain)
|
||||
{
|
||||
StrVec domain_parts;
|
||||
domain_parts.reserve(parts);
|
||||
int start = 0;
|
||||
auto pos = domain.find(".");
|
||||
if (pos == std::string::npos)
|
||||
if (pos == std::string_view::npos)
|
||||
{
|
||||
domain_parts.emplace_back(domain);
|
||||
}
|
||||
else
|
||||
{
|
||||
while (pos != std::string::npos)
|
||||
while (pos != std::string_view::npos)
|
||||
{
|
||||
auto part_name{domain.substr(start, pos - start)};
|
||||
domain_parts.emplace_back(part_name);
|
||||
@@ -291,9 +294,12 @@ qof_log_shutdown (void)
|
||||
void
|
||||
qof_log_set_level(QofLogModule log_module, QofLogLevel level)
|
||||
{
|
||||
if (!log_module || level == 0)
|
||||
if (!log_module || level == QOF_LOG_FATAL)
|
||||
return;
|
||||
|
||||
if (level > current_max)
|
||||
current_max = level;
|
||||
|
||||
auto module_parts = split_domain(log_module);
|
||||
auto module = get_modules();
|
||||
for (auto part : module_parts)
|
||||
@@ -321,10 +327,14 @@ qof_log_set_level(QofLogModule log_module, QofLogLevel level)
|
||||
gboolean
|
||||
qof_log_check(QofLogModule domain, QofLogLevel level)
|
||||
{
|
||||
|
||||
// Check the global levels
|
||||
if (level > current_max)
|
||||
return FALSE;
|
||||
if (level <= default_level)
|
||||
return TRUE;
|
||||
auto module = get_modules();
|
||||
// If the level is < the default then no need to look further.
|
||||
if (level < module->m_level)
|
||||
// If the level <= the default then no need to look further.
|
||||
if (level <= module->m_level)
|
||||
return TRUE;
|
||||
|
||||
if (!domain)
|
||||
@@ -419,7 +429,7 @@ qof_log_parse_log_config(const char *filename)
|
||||
return;
|
||||
}
|
||||
|
||||
g_debug("parsing log config from [%s]", filename);
|
||||
DEBUG("parsing log config from [%s]", filename);
|
||||
if (g_key_file_has_group(conf, levels_group))
|
||||
{
|
||||
gsize num_levels;
|
||||
@@ -440,7 +450,7 @@ qof_log_parse_log_config(const char *filename)
|
||||
level_str = g_key_file_get_string(conf, levels_group, logger_name, NULL);
|
||||
level = qof_log_level_from_string(level_str);
|
||||
|
||||
g_debug("setting log [%s] to level [%s=%d]", logger_name, level_str, level);
|
||||
DEBUG("setting log [%s] to level [%s=%d]", logger_name, level_str, level);
|
||||
qof_log_set_level(logger_name, level);
|
||||
|
||||
g_free(logger_name);
|
||||
@@ -475,7 +485,7 @@ qof_log_parse_log_config(const char *filename)
|
||||
}
|
||||
|
||||
value = g_key_file_get_string(conf, output_group, key, NULL);
|
||||
g_debug("setting [output].to=[%s]", value);
|
||||
DEBUG("setting [output].to=[%s]", value);
|
||||
qof_log_init_filename_special(value);
|
||||
g_free(value);
|
||||
}
|
||||
@@ -485,14 +495,6 @@ qof_log_parse_log_config(const char *filename)
|
||||
g_key_file_free(conf);
|
||||
}
|
||||
|
||||
void
|
||||
qof_log_set_default(QofLogLevel log_level)
|
||||
{
|
||||
qof_log_set_level("", log_level);
|
||||
qof_log_set_level("qof", log_level);
|
||||
qof_log_set_level("qof.unknown", log_level);
|
||||
}
|
||||
|
||||
const gchar*
|
||||
qof_log_level_to_string(QofLogLevel log_level)
|
||||
{
|
||||
|
||||
@@ -73,10 +73,11 @@
|
||||
* @c "gnc.gui.plugin-pages.sx-list" or
|
||||
* @c "gnc.register.gnome.cell.quickfill" are
|
||||
* good examples.
|
||||
* @li Use glib-provided @c g_debug(...), @c g_message(...),
|
||||
* @c g_warning(...), @c g_critical(...) and
|
||||
* @c g_error(...) functions in preference to the historical qof/gnc @c
|
||||
* PINFO, @c PERR (&c.) macros
|
||||
* @li Prefer the macros defined here (PERR, PWARN, PINFO, etc.) to
|
||||
* the GLib-provided functions that they wrap because it allows us to
|
||||
* more easily replace the GLib logging functinos with another
|
||||
* implementation and besides our macros are able to short-circuit
|
||||
* GLib's rather slow domain and level matching.
|
||||
*
|
||||
* @see qof_log_parse_log_config(const char*)
|
||||
**/
|
||||
@@ -170,9 +171,6 @@ const gchar * qof_log_prettify (const gchar *name);
|
||||
* @a log_level. This implements the "log.path.hierarchy" logic. **/
|
||||
gboolean qof_log_check(QofLogModule log_module, QofLogLevel log_level);
|
||||
|
||||
/** Set the default level for QOF-related log paths. **/
|
||||
void qof_log_set_default(QofLogLevel log_level);
|
||||
|
||||
#define PRETTY_FUNC_NAME qof_log_prettify(G_STRFUNC)
|
||||
|
||||
#ifdef _MSC_VER
|
||||
@@ -203,36 +201,36 @@ void qof_log_set_default(QofLogLevel log_level);
|
||||
} while (0)
|
||||
|
||||
/** Print an informational note */
|
||||
#define PINFO(format, ...) do { \
|
||||
#define PINFO(format, ...) \
|
||||
if (qof_log_check(log_module, QOF_LOG_INFO) { \
|
||||
g_log (log_module, G_LOG_LEVEL_INFO, \
|
||||
"[%s] " format, PRETTY_FUNC_NAME , __VA_ARGS__); \
|
||||
} while (0)
|
||||
}
|
||||
|
||||
/** Print a debugging message */
|
||||
#define DEBUG(format, ...) do { \
|
||||
g_log (log_module, G_LOG_LEVEL_DEBUG, \
|
||||
"[%s] " format, PRETTY_FUNC_NAME , __VA_ARGS__); \
|
||||
} while (0)
|
||||
#define DEBUG(format, ...) \
|
||||
if (qof_log_check(log_module, QOF_LOG_DEBUG) { \
|
||||
g_log (log_module, G_LOG_LEVEL_DEBUG, \
|
||||
"[%s] " format, PRETTY_FUNC_NAME , __VA_ARGS__); \
|
||||
}
|
||||
|
||||
/** Print a function entry debugging message */
|
||||
#define ENTER(format, ...) do { \
|
||||
if (qof_log_check(log_module, (QofLogLevel)G_LOG_LEVEL_DEBUG)) { \
|
||||
#define ENTER(format, ...) \
|
||||
if (qof_log_check(log_module, QOFLOG_DEBUG)) { \
|
||||
g_log (log_module, G_LOG_LEVEL_DEBUG, \
|
||||
"[enter %s:%s()] " format, __FILE__, \
|
||||
PRETTY_FUNC_NAME , __VA_ARGS__); \
|
||||
qof_log_indent(); \
|
||||
} \
|
||||
} while (0)
|
||||
}
|
||||
|
||||
/** Print a function exit debugging message. **/
|
||||
#define LEAVE(format, ...) do { \
|
||||
if (qof_log_check(log_module, (QofLogLevel)G_LOG_LEVEL_DEBUG)) { \
|
||||
#define LEAVE(format, ...) \
|
||||
if (qof_log_check(log_module, QOF_LOG_DEBUG)) { \
|
||||
qof_log_dedent(); \
|
||||
g_log (log_module, G_LOG_LEVEL_DEBUG, \
|
||||
"[leave %s()] " format, \
|
||||
PRETTY_FUNC_NAME , __VA_ARGS__); \
|
||||
} \
|
||||
} while (0)
|
||||
}
|
||||
|
||||
#else /* _MSC_VER */
|
||||
|
||||
@@ -255,35 +253,39 @@ void qof_log_set_default(QofLogLevel log_level);
|
||||
} while (0)
|
||||
|
||||
/** Print an informational note */
|
||||
#define PINFO(format, args...) do { \
|
||||
g_log (log_module, G_LOG_LEVEL_INFO, \
|
||||
"[%s] " format, PRETTY_FUNC_NAME , ## args); \
|
||||
#define PINFO(format, args...) do { \
|
||||
if (qof_log_check(log_module, QOF_LOG_INFO)) { \
|
||||
g_log (log_module, G_LOG_LEVEL_INFO, \
|
||||
"[%s] " format, PRETTY_FUNC_NAME , ## args); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
/** Print a debugging message */
|
||||
#define DEBUG(format, args...) do { \
|
||||
g_log (log_module, G_LOG_LEVEL_DEBUG, \
|
||||
"[%s] " format, PRETTY_FUNC_NAME , ## args); \
|
||||
} while (0)
|
||||
#define DEBUG(format, args...) do { \
|
||||
if (qof_log_check(log_module, QOF_LOG_DEBUG)) { \
|
||||
g_log (log_module, G_LOG_LEVEL_DEBUG, \
|
||||
"[%s] " format, PRETTY_FUNC_NAME , ## args); \
|
||||
} \
|
||||
} while(0)
|
||||
|
||||
/** Print a function entry debugging message */
|
||||
#define ENTER(format, args...) do { \
|
||||
if (qof_log_check(log_module, (QofLogLevel)G_LOG_LEVEL_DEBUG)) { \
|
||||
g_log (log_module, G_LOG_LEVEL_DEBUG, \
|
||||
"[enter %s:%s()] " format, __FILE__, \
|
||||
PRETTY_FUNC_NAME , ## args); \
|
||||
qof_log_indent(); \
|
||||
#define ENTER(format, args...) do { \
|
||||
if (qof_log_check(log_module, QOF_LOG_DEBUG)) { \
|
||||
g_log (log_module, G_LOG_LEVEL_DEBUG, \
|
||||
"[enter %s:%s()] " format, __FILE__, \
|
||||
PRETTY_FUNC_NAME , ## args); \
|
||||
qof_log_indent(); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
/** Print a function exit debugging message. **/
|
||||
#define LEAVE(format, args...) do { \
|
||||
if (qof_log_check(log_module, (QofLogLevel)G_LOG_LEVEL_DEBUG)) { \
|
||||
qof_log_dedent(); \
|
||||
g_log (log_module, G_LOG_LEVEL_DEBUG, \
|
||||
"[leave %s()] " format, \
|
||||
PRETTY_FUNC_NAME , ## args); \
|
||||
} \
|
||||
#define LEAVE(format, args...) do { \
|
||||
if (qof_log_check(log_module, QOF_LOG_DEBUG)) { \
|
||||
qof_log_dedent(); \
|
||||
g_log (log_module, G_LOG_LEVEL_DEBUG, \
|
||||
"[leave %s()] " format, \
|
||||
PRETTY_FUNC_NAME , ## args); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#endif /* _MSC_VER */
|
||||
|
||||
@@ -1509,9 +1509,8 @@ static void qof_query_printValueForParam (QofQueryPredData *pd, GString * gs);
|
||||
static void qof_query_printOutput (GList * output);
|
||||
|
||||
/** \deprecated access via qof_log instead.
|
||||
The query will be logged automatically if qof_log_set_default
|
||||
or qof_log_set_level(QOF_MOD_QUERY, ...) are set to QOF_LOG_DEBUG
|
||||
or higher.
|
||||
The query will be logged automatically if
|
||||
qof_log_set_level(QOF_MOD_QUERY, ...) is set to QOF_LOG_DEBUG.
|
||||
|
||||
This function cycles through a QofQuery object, and
|
||||
prints out the values of the various members of the query
|
||||
|
||||
@@ -372,7 +372,6 @@ gboolean qof_query_equal (const QofQuery *q1, const QofQuery *q2);
|
||||
*
|
||||
* \deprecated Do not call directly, use the standard log
|
||||
* module code: ::qof_log_set_level(QOF_MOD_QUERY, QOF_LOG_DEBUG);
|
||||
* or ::qof_log_set_default(QOF_LOG_DEBUG);
|
||||
*/
|
||||
void qof_query_print (QofQuery *query);
|
||||
|
||||
|
||||
@@ -1108,6 +1108,60 @@ test_gnc_account_kvp_setters_getters (Fixture *fixture, gconstpointer pData)
|
||||
xaccAccountSetColor (account, nullptr);
|
||||
g_assert_cmpstr (xaccAccountGetColor (account), ==, nullptr);
|
||||
|
||||
// last_num getter/setter
|
||||
g_assert_cmpstr (xaccAccountGetLastNum (account), ==, nullptr);
|
||||
|
||||
xaccAccountSetLastNum (account, "red");
|
||||
g_assert_cmpstr (xaccAccountGetLastNum (account), ==, "red");
|
||||
|
||||
xaccAccountSetLastNum (account, "");
|
||||
g_assert_cmpstr (xaccAccountGetLastNum (account), ==, "");
|
||||
|
||||
xaccAccountSetLastNum (account, " ");
|
||||
g_assert_cmpstr (xaccAccountGetLastNum (account), ==, " ");
|
||||
|
||||
xaccAccountSetLastNum (account, "unset");
|
||||
g_assert_cmpstr (xaccAccountGetLastNum (account), ==, "unset");
|
||||
|
||||
xaccAccountSetLastNum (account, nullptr);
|
||||
g_assert_cmpstr (xaccAccountGetLastNum (account), ==, nullptr);
|
||||
|
||||
// tax_us_code getter/setter
|
||||
g_assert_cmpstr (xaccAccountGetTaxUSCode (account), ==, nullptr);
|
||||
|
||||
xaccAccountSetTaxUSCode (account, "red");
|
||||
g_assert_cmpstr (xaccAccountGetTaxUSCode (account), ==, "red");
|
||||
|
||||
xaccAccountSetTaxUSCode (account, "");
|
||||
g_assert_cmpstr (xaccAccountGetTaxUSCode (account), ==, "");
|
||||
|
||||
xaccAccountSetTaxUSCode (account, " ");
|
||||
g_assert_cmpstr (xaccAccountGetTaxUSCode (account), ==, " ");
|
||||
|
||||
xaccAccountSetTaxUSCode (account, "unset");
|
||||
g_assert_cmpstr (xaccAccountGetTaxUSCode (account), ==, "unset");
|
||||
|
||||
xaccAccountSetTaxUSCode (account, nullptr);
|
||||
g_assert_cmpstr (xaccAccountGetTaxUSCode (account), ==, nullptr);
|
||||
|
||||
// tax_us_pns getter/setter
|
||||
g_assert_cmpstr (xaccAccountGetTaxUSPayerNameSource (account), ==, nullptr);
|
||||
|
||||
xaccAccountSetTaxUSPayerNameSource (account, "red");
|
||||
g_assert_cmpstr (xaccAccountGetTaxUSPayerNameSource (account), ==, "red");
|
||||
|
||||
xaccAccountSetTaxUSPayerNameSource (account, "");
|
||||
g_assert_cmpstr (xaccAccountGetTaxUSPayerNameSource (account), ==, "");
|
||||
|
||||
xaccAccountSetTaxUSPayerNameSource (account, " ");
|
||||
g_assert_cmpstr (xaccAccountGetTaxUSPayerNameSource (account), ==, " ");
|
||||
|
||||
xaccAccountSetTaxUSPayerNameSource (account, "unset");
|
||||
g_assert_cmpstr (xaccAccountGetTaxUSPayerNameSource (account), ==, "unset");
|
||||
|
||||
xaccAccountSetTaxUSPayerNameSource (account, nullptr);
|
||||
g_assert_cmpstr (xaccAccountGetTaxUSPayerNameSource (account), ==, nullptr);
|
||||
|
||||
// filter getter/setter
|
||||
g_assert_cmpstr (xaccAccountGetFilter (account), ==, nullptr);
|
||||
|
||||
@@ -1162,6 +1216,79 @@ test_gnc_account_kvp_setters_getters (Fixture *fixture, gconstpointer pData)
|
||||
xaccAccountSetNotes (account, nullptr);
|
||||
g_assert_cmpstr (xaccAccountGetNotes (account), ==, nullptr);
|
||||
|
||||
// STOCK_ACCOUNT tests from now on
|
||||
xaccAccountSetType (account, ACCT_TYPE_STOCK);
|
||||
|
||||
// dxaccAccountGetPriceSrc getter/setter
|
||||
g_assert_cmpstr (dxaccAccountGetPriceSrc (account), ==, nullptr);
|
||||
|
||||
dxaccAccountSetPriceSrc (account, "boo");
|
||||
g_assert_cmpstr (dxaccAccountGetPriceSrc (account), ==, "boo");
|
||||
|
||||
dxaccAccountSetPriceSrc (account, "");
|
||||
g_assert_cmpstr (dxaccAccountGetPriceSrc (account), ==, "");
|
||||
|
||||
dxaccAccountSetPriceSrc (account, nullptr);
|
||||
g_assert_cmpstr (dxaccAccountGetPriceSrc (account), ==, nullptr);
|
||||
|
||||
// dxaccAccountGetQuoteTZ getter/setter
|
||||
g_assert_cmpstr (dxaccAccountGetQuoteTZ (account), ==, nullptr);
|
||||
|
||||
dxaccAccountSetQuoteTZ (account, "boo");
|
||||
g_assert_cmpstr (dxaccAccountGetQuoteTZ (account), ==, "boo");
|
||||
|
||||
dxaccAccountSetQuoteTZ (account, "");
|
||||
g_assert_cmpstr (dxaccAccountGetQuoteTZ (account), ==, "");
|
||||
|
||||
dxaccAccountSetQuoteTZ (account, nullptr);
|
||||
g_assert_cmpstr (dxaccAccountGetQuoteTZ (account), ==, nullptr);
|
||||
|
||||
xaccAccountBeginEdit (account);
|
||||
xaccAccountDestroy (account);
|
||||
}
|
||||
|
||||
static void
|
||||
set_kvp_string_path (Account *acc, std::vector<std::string> const & path,
|
||||
const char *value)
|
||||
{
|
||||
xaccAccountBeginEdit(acc);
|
||||
if (value)
|
||||
{
|
||||
GValue v = G_VALUE_INIT;
|
||||
g_value_init (&v, G_TYPE_STRING);
|
||||
g_value_set_string (&v, value);
|
||||
qof_instance_set_path_kvp (QOF_INSTANCE (acc), &v, path);
|
||||
g_value_unset (&v);
|
||||
}
|
||||
else
|
||||
qof_instance_set_path_kvp (QOF_INSTANCE (acc), NULL, path);
|
||||
|
||||
xaccAccountCommitEdit(acc);
|
||||
}
|
||||
|
||||
static void
|
||||
test_gnc_account_get_map_entry (Fixture *fixture, gconstpointer pData)
|
||||
{
|
||||
Account *account = xaccMallocAccount (gnc_account_get_book (fixture->acct));
|
||||
|
||||
g_assert_cmpstr (gnc_account_get_map_entry (account, "one", NULL), ==, nullptr);
|
||||
g_assert_cmpstr (gnc_account_get_map_entry (account, "one", "two"), ==, nullptr);
|
||||
|
||||
set_kvp_string_path (account, {"one"}, "uno");
|
||||
g_assert_cmpstr (gnc_account_get_map_entry (account, "one", NULL), ==, "uno");
|
||||
g_assert_cmpstr (gnc_account_get_map_entry (account, "one", "two"), ==, nullptr);
|
||||
|
||||
set_kvp_string_path (account, {"one", "two"}, "dos");
|
||||
g_assert_cmpstr (gnc_account_get_map_entry (account, "one", "tw0"), ==, nullptr);
|
||||
g_assert_cmpstr (gnc_account_get_map_entry (account, "one", "two"), ==, "dos");
|
||||
|
||||
set_kvp_string_path (account, {"one"}, nullptr);
|
||||
g_assert_cmpstr (gnc_account_get_map_entry (account, "one", NULL), ==, nullptr);
|
||||
g_assert_cmpstr (gnc_account_get_map_entry (account, "one", "two"), ==, nullptr);
|
||||
|
||||
set_kvp_string_path (account, {"one", "two"}, "dos");
|
||||
g_assert_cmpstr (gnc_account_get_map_entry (account, "one", "two"), ==, "dos");
|
||||
|
||||
xaccAccountBeginEdit (account);
|
||||
xaccAccountDestroy (account);
|
||||
}
|
||||
@@ -2649,6 +2776,7 @@ test_suite_account (void)
|
||||
// GNC_TEST_ADD (suitename, "xaccAcctChildrenEqual", Fixture, NULL, setup, test_xaccAcctChildrenEqual, teardown );
|
||||
// GNC_TEST_ADD (suitename, "xaccAccountEqual", Fixture, NULL, setup, test_xaccAccountEqual, teardown );
|
||||
GNC_TEST_ADD (suitename, "gnc account kvp getters & setters", Fixture, NULL, setup, test_gnc_account_kvp_setters_getters, teardown );
|
||||
GNC_TEST_ADD (suitename, "test_gnc_account_get_map_entry", Fixture, NULL, setup, test_gnc_account_get_map_entry, teardown );
|
||||
GNC_TEST_ADD (suitename, "gnc account insert & remove split", Fixture, NULL, setup, test_gnc_account_insert_remove_split, teardown );
|
||||
GNC_TEST_ADD (suitename, "xaccAccount Insert and Remove Lot", Fixture, &good_data, setup, test_xaccAccountInsertRemoveLot, teardown );
|
||||
GNC_TEST_ADD (suitename, "xaccAccountRecomputeBalance", Fixture, &some_data, setup, test_xaccAccountRecomputeBalance, teardown );
|
||||
|
||||
@@ -774,6 +774,7 @@ test_xaccTransEqual (Fixture *fixture, gconstpointer pData)
|
||||
auto check3 = test_error_struct_new(logdomain, loglevel, "");
|
||||
auto cleanup = test_error_struct_new (logdomain, loglevel, "");
|
||||
auto split0 = xaccTransGetSplit (txn0, 0);
|
||||
qof_log_set_level (GNC_MOD_ENGINE, QOF_LOG_INFO);
|
||||
test_add_error (check);
|
||||
test_add_error (check2);
|
||||
test_add_error (cleanup);
|
||||
@@ -1322,6 +1323,7 @@ test_xaccTransBeginEdit ()
|
||||
auto check2 = test_error_struct_new (logdomain, loglevel, msg2);
|
||||
guint hdlr = g_log_set_handler (logdomain, loglevel,
|
||||
(GLogFunc)test_list_handler, NULL);
|
||||
qof_log_set_level (logdomain, QOF_LOG_INFO);
|
||||
test_add_error (check1);
|
||||
test_add_error (check2);
|
||||
|
||||
@@ -1777,6 +1779,29 @@ test_xaccTransOrder_num_action (Fixture *fixture, gconstpointer pData)
|
||||
|
||||
fixture->func->xaccFreeTransaction (txnB);
|
||||
}
|
||||
|
||||
static void
|
||||
test_xaccTransGetReadOnly (Fixture *fixture, gconstpointer pData)
|
||||
{
|
||||
auto txn = fixture->txn;
|
||||
g_assert_cmpstr (xaccTransGetReadOnly (txn), ==, nullptr);
|
||||
|
||||
xaccTransSetReadOnly (txn, "RO");
|
||||
g_assert_cmpstr (xaccTransGetReadOnly (txn), ==, "RO");
|
||||
|
||||
xaccTransSetReadOnly (txn, nullptr); // reason being nullptr is a NOP
|
||||
g_assert_cmpstr (xaccTransGetReadOnly (txn), ==, "RO");
|
||||
|
||||
xaccTransClearReadOnly (txn);
|
||||
g_assert_cmpstr (xaccTransGetReadOnly (txn), ==, nullptr);
|
||||
|
||||
xaccTransSetReadOnly (txn, "");
|
||||
g_assert_cmpstr (xaccTransGetReadOnly (txn), ==, "");
|
||||
|
||||
xaccTransClearReadOnly (txn);
|
||||
}
|
||||
|
||||
|
||||
/* xaccTransSetDateInternal Local: 7:0:0
|
||||
* set_gains_date_dirty Local: 4:0:0
|
||||
* xaccTransSetDatePostedSecs C: 17 in 13 Local: 0:0:0
|
||||
@@ -2065,6 +2090,7 @@ test_suite_transaction (void)
|
||||
GNC_TEST_ADD (suitename, "xaccTransRollbackEdit - Backend Errors", Fixture, NULL, setup, test_xaccTransRollbackEdit_BackendErrors, teardown);
|
||||
GNC_TEST_ADD (suitename, "xaccTransOrder_num_action", Fixture, NULL, setup, test_xaccTransOrder_num_action, teardown);
|
||||
GNC_TEST_ADD (suitename, "xaccTransGetTxnType", Fixture, NULL, setup, test_xaccTransGetTxnType, teardown);
|
||||
GNC_TEST_ADD (suitename, "xaccTransGetreadOnly", Fixture, NULL, setup, test_xaccTransGetReadOnly, teardown);
|
||||
GNC_TEST_ADD (suitename, "xaccTransSetDocLink", Fixture, NULL, setup, test_xaccTransSetDocLink, teardown);
|
||||
GNC_TEST_ADD (suitename, "xaccTransVoid", Fixture, NULL, setup, test_xaccTransVoid, teardown);
|
||||
GNC_TEST_ADD (suitename, "xaccTransReverse", Fixture, NULL, setup, test_xaccTransReverse, teardown);
|
||||
|
||||
@@ -102,6 +102,6 @@ static void
|
||||
gnc_plugin_example_cmd_test (GtkAction *action, GncMainWindowActionData *data)
|
||||
{
|
||||
ENTER ("action %p, main window data %p", action, data);
|
||||
g_message ("example");
|
||||
PINFO ("example");
|
||||
LEAVE (" ");
|
||||
}
|
||||
|
||||
@@ -215,23 +215,24 @@ gnucash/gnucash-commands.cpp
|
||||
gnucash/gnucash-core-app.cpp
|
||||
gnucash/gnucash.cpp
|
||||
gnucash/gnucash-locale-windows.c
|
||||
gnucash/gschemas/org.gnucash.dialogs.business.gschema.xml.in
|
||||
gnucash/gschemas/org.gnucash.dialogs.checkprinting.gschema.xml.in
|
||||
gnucash/gschemas/org.gnucash.dialogs.commodities.gschema.xml.in
|
||||
gnucash/gschemas/org.gnucash.dialogs.export.csv.gschema.xml.in
|
||||
gnucash/gschemas/org.gnucash.dialogs.gschema.xml.in
|
||||
gnucash/gschemas/org.gnucash.dialogs.import.csv.gschema.xml.in
|
||||
gnucash/gschemas/org.gnucash.dialogs.import.generic.gschema.xml.in
|
||||
gnucash/gschemas/org.gnucash.dialogs.import.qif.gschema.xml.in
|
||||
gnucash/gschemas/org.gnucash.dialogs.reconcile.gschema.xml.in
|
||||
gnucash/gschemas/org.gnucash.dialogs.sxs.gschema.xml.in
|
||||
gnucash/gschemas/org.gnucash.dialogs.totd.gschema.xml.in
|
||||
gnucash/gschemas/org.gnucash.general.finance-quote.gschema.xml.in
|
||||
gnucash/gschemas/org.gnucash.gschema.xml.in
|
||||
gnucash/gschemas/org.gnucash.history.gschema.xml.in
|
||||
gnucash/gschemas/org.gnucash.warnings.gschema.xml.in
|
||||
gnucash/gschemas/org.gnucash.window.pages.account.tree.gschema.xml.in
|
||||
gnucash/gschemas/org.gnucash.window.pages.gschema.xml.in
|
||||
gnucash/gschemas/org.gnucash.GnuCash.deprecated.gschema.xml.in
|
||||
gnucash/gschemas/org.gnucash.GnuCash.dialogs.business.gschema.xml.in
|
||||
gnucash/gschemas/org.gnucash.GnuCash.dialogs.checkprinting.gschema.xml.in
|
||||
gnucash/gschemas/org.gnucash.GnuCash.dialogs.commodities.gschema.xml.in
|
||||
gnucash/gschemas/org.gnucash.GnuCash.dialogs.export.csv.gschema.xml.in
|
||||
gnucash/gschemas/org.gnucash.GnuCash.dialogs.gschema.xml.in
|
||||
gnucash/gschemas/org.gnucash.GnuCash.dialogs.import.csv.gschema.xml.in
|
||||
gnucash/gschemas/org.gnucash.GnuCash.dialogs.import.generic.gschema.xml.in
|
||||
gnucash/gschemas/org.gnucash.GnuCash.dialogs.import.qif.gschema.xml.in
|
||||
gnucash/gschemas/org.gnucash.GnuCash.dialogs.reconcile.gschema.xml.in
|
||||
gnucash/gschemas/org.gnucash.GnuCash.dialogs.sxs.gschema.xml.in
|
||||
gnucash/gschemas/org.gnucash.GnuCash.dialogs.totd.gschema.xml.in
|
||||
gnucash/gschemas/org.gnucash.GnuCash.general.finance-quote.gschema.xml.in
|
||||
gnucash/gschemas/org.gnucash.GnuCash.gschema.xml.in
|
||||
gnucash/gschemas/org.gnucash.GnuCash.history.gschema.xml.in
|
||||
gnucash/gschemas/org.gnucash.GnuCash.warnings.gschema.xml.in
|
||||
gnucash/gschemas/org.gnucash.GnuCash.window.pages.account.tree.gschema.xml.in
|
||||
gnucash/gschemas/org.gnucash.GnuCash.window.pages.gschema.xml.in
|
||||
gnucash/gtkbuilder/assistant-acct-period.glade
|
||||
gnucash/gtkbuilder/assistant-csv-account-import.glade
|
||||
gnucash/gtkbuilder/assistant-csv-export.glade
|
||||
@@ -317,8 +318,8 @@ gnucash/import-export/aqb/gnc-flicker-gui.c
|
||||
gnucash/import-export/aqb/gnc-gwen-gui.c
|
||||
gnucash/import-export/aqb/gncmod-aqbanking.c
|
||||
gnucash/import-export/aqb/gnc-plugin-aqbanking.c
|
||||
gnucash/import-export/aqb/gschemas/org.gnucash.dialogs.flicker.gschema.xml.in
|
||||
gnucash/import-export/aqb/gschemas/org.gnucash.dialogs.import.hbci.gschema.xml.in
|
||||
gnucash/import-export/aqb/gschemas/org.gnucash.GnuCash.dialogs.flicker.gschema.xml.in
|
||||
gnucash/import-export/aqb/gschemas/org.gnucash.GnuCash.dialogs.import.hbci.gschema.xml.in
|
||||
gnucash/import-export/bi-import/dialog-bi-import.c
|
||||
gnucash/import-export/bi-import/dialog-bi-import-gui.c
|
||||
gnucash/import-export/bi-import/dialog-bi-import-helper.c
|
||||
@@ -363,7 +364,7 @@ gnucash/import-export/log-replay/gnc-plugin-log-replay.c
|
||||
gnucash/import-export/ofx/gncmod-ofx-import.c
|
||||
gnucash/import-export/ofx/gnc-ofx-import.c
|
||||
gnucash/import-export/ofx/gnc-plugin-ofx.c
|
||||
gnucash/import-export/ofx/gschemas/org.gnucash.dialogs.import.ofx.gschema.xml.in
|
||||
gnucash/import-export/ofx/gschemas/org.gnucash.GnuCash.dialogs.import.ofx.gschema.xml.in
|
||||
gnucash/import-export/qif-imp/assistant-qif-import.c
|
||||
gnucash/import-export/qif-imp/dialog-account-picker.c
|
||||
gnucash/import-export/qif-imp/gnc-plugin-qif-import.c
|
||||
@@ -525,7 +526,7 @@ libgnucash/app-utils/gnc-addr-quickfill.c
|
||||
libgnucash/app-utils/gnc-entry-quickfill.c
|
||||
libgnucash/app-utils/gnc-euro.c
|
||||
libgnucash/app-utils/gnc-exp-parser.c
|
||||
libgnucash/app-utils/gnc-gsettings.c
|
||||
libgnucash/app-utils/gnc-gsettings.cpp
|
||||
libgnucash/app-utils/gnc-helpers.c
|
||||
libgnucash/app-utils/gnc-help-utils.c
|
||||
libgnucash/app-utils/gnc-prefs-utils.c
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user