Skip to content

Commit

Permalink
Convert gncmod-qif-import into an ordinary library
Browse files Browse the repository at this point in the history
All importers have a have a gnucash plugin interface so that will be used
to add the importers.
  • Loading branch information
gjanssens committed Apr 24, 2020
1 parent 01a00af commit 468f344
Show file tree
Hide file tree
Showing 13 changed files with 54 additions and 122 deletions.
2 changes: 1 addition & 1 deletion ChangeLog.2001
Original file line number Diff line number Diff line change
Expand Up @@ -2357,7 +2357,7 @@

* src/guile/gnc-helpers.c: fix warnings

* src/import-export/qif-import/gncmod-qif-import.c: include api
* src/import-export/qif-import/gnc-qif-import.c: include api
header

* src/register/register-gnome/gncmod-register-gnome.c: include api
Expand Down
2 changes: 1 addition & 1 deletion ChangeLog.2002
Original file line number Diff line number Diff line change
Expand Up @@ -3750,7 +3750,7 @@ v fix the print_info

* src/gnome/window-main.c:
* src/import-export/qif-import/druid-qif-import.[ch]:
* src/import-export/qif-import/gncmod-qif-import.c: Create the
* src/import-export/qif-import/gnc-qif-import.c: Create the
"Import QIF" menu item from within the QIF module.

2002-06-21 Derek Atkins <[email protected]>
Expand Down
2 changes: 1 addition & 1 deletion ChangeLog.2003
Original file line number Diff line number Diff line change
Expand Up @@ -1172,7 +1172,7 @@
* src/import-export/qif-import/druid-qif-import.c:
(gnc_ui_qif_import_create_plugin):
* src/import-export/qif-import/druid-qif-import.h:
* src/import-export/qif-import/gncmod-qif-import.c:
* src/import-export/qif-import/gnc-qif-import.c:
(libgncmod_qif_import_LTX_gnc_module_init):
* src/import-export/qif-import/gnc-plugin-qif-import.[ch]:
* src/import-export/qif-import/gnc-plugin-qif-import-ui.xml:
Expand Down
40 changes: 20 additions & 20 deletions ChangeLog.2006
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@
branches/reshuffle-modules/src/import-export/hbci/gncmod-hbci.c,
branches/reshuffle-modules/src/import-export/log-replay/gncmod-log-replay.c,
branches/reshuffle-modules/src/import-export/ofx/gncmod-ofx-import.c,
branches/reshuffle-modules/src/import-export/qif-import/gncmod-qif-import.c,
branches/reshuffle-modules/src/import-export/qif-import/gnc-qif-import.c,
branches/reshuffle-modules/src/import-export/qif-io-core/gncmod-qifiocore.c,
branches/reshuffle-modules/src/network-utils/gncmod-network-utils.c,
branches/reshuffle-modules/src/register/ledger-core/gncmod-ledger-core.c,
Expand Down Expand Up @@ -8053,7 +8053,7 @@
2006-07-04 20:35 cstim

* [r14465] trunk/ChangeLog, trunk/po/de.po: Proof-read and
improved German translation by feedback from Andi K�hler.
improved German translation by feedback from Andi K�hler.

2006-07-04 16:32 jsled

Expand Down Expand Up @@ -9216,7 +9216,7 @@
2006-06-01 23:06 warlord

* [r14289] trunk/ChangeLog, trunk/po/nb.po: * po/nb.po: updated
Norwegian Bokm�l translation by Sigve Indregard
Norwegian Bokm�l translation by Sigve Indregard

2006-06-01 21:02 warlord

Expand Down Expand Up @@ -9964,7 +9964,7 @@
2006-05-21 12:59 cstim

* [r14144] trunk/po/sk.po: Updated Slovak translation by Zdenko
Podobn�
Podobn�

2006-05-21 12:58 cstim

Expand Down Expand Up @@ -11186,7 +11186,7 @@
2006-04-22 19:04 cstim

* [r13831] trunk/ChangeLog, trunk/src/gnome/gnc-split-reg.c: Mark
string for translation as pointed out by Andreas K�hler.
string for translation as pointed out by Andreas K�hler.

2006-04-22 05:14 chris

Expand Down Expand Up @@ -14348,7 +14348,7 @@
2006-03-01 03:28 hampton

* [r13428] trunk/ChangeLog, trunk/src/app-utils/options.scm:
Andreas K�hler's patch to correctly build a html color value.
Andreas K�hler's patch to correctly build a html color value.
Fixes 328933.

2006-02-28 23:13 jsled
Expand Down Expand Up @@ -14816,7 +14816,7 @@

* [r13364] trunk/ChangeLog,
trunk/src/gnome/gnc-plugin-page-register.c,
trunk/src/gtk-compat.h: Cleanup patch from Andreas K�hler.
trunk/src/gtk-compat.h: Cleanup patch from Andreas K�hler.

2006-02-22 21:52 chris

Expand Down Expand Up @@ -14901,14 +14901,14 @@

* [r13354] trunk/ChangeLog,
trunk/src/gnome/gnc-plugin-page-register.c: Fix from Andreas
K�hler to deactivate the toolbar split button in an auto-split
K�hler to deactivate the toolbar split button in an auto-split
register. Fixes 330621.

2006-02-21 23:58 hampton

* [r13353] trunk/ChangeLog,
trunk/src/gnome-utils/gnc-tree-model-account.c: Two fixes from
Andreas K�hler. One fixes 331183, the problem where editing a
Andreas K�hler. One fixes 331183, the problem where editing a
top-level account doesn't set the current parent.

2006-02-21 23:10 jsled
Expand Down Expand Up @@ -14981,7 +14981,7 @@

* [r13340] trunk/ChangeLog,
trunk/src/register/register-gnome/gnucash-date-picker.c: Andreas
K�hler's patch to prevent a crash in the register date picker
K�hler's patch to prevent a crash in the register date picker
widget when using gtk 2.8.

2006-02-21 03:44 hampton
Expand All @@ -14996,7 +14996,7 @@

* [r13338] trunk/src/gnome-utils/gtktreedatalist.c: Use glib's
slice allocator in favor of GMemChunks for glib >= 2.9. Patch by
Andreas K�hler <[email protected]>.
Andreas K�hler <[email protected]>.

2006-02-21 00:14 hampton

Expand Down Expand Up @@ -15498,7 +15498,7 @@
GncTreeModelAccountTypes - now, every accessible account-types
TreeModel is a new GtkTreeModelFilter, and their ref-counting is
always the same. Add some tweaks to
gnc-tree-model-account-types.[ch] from Andreas K�hler
gnc-tree-model-account-types.[ch] from Andreas K�hler
<[email protected]>, plus the conversion of the Account Dialog's
account-types field to use the filtered GncTreeModelAccountTypes
instead of a GtkListStore, but simplified to use the AccountType
Expand Down Expand Up @@ -15606,14 +15606,14 @@

* [r13259] trunk/ChangeLog,
trunk/src/gnome-utils/dialog-account.c,
trunk/src/gnome/glade/account.glade: Andreas K�hler's patch to
trunk/src/gnome/glade/account.glade: Andreas K�hler's patch to
convert the account types list in the account edit dialog to a
GtkTreeView/GtkListStore.

2006-02-13 23:21 hampton

* [r13258] trunk/ChangeLog,
trunk/src/gnome/gnc-plugin-page-register.c: Andreas K�hler's
trunk/src/gnome/gnc-plugin-page-register.c: Andreas K�hler's
patch to prevent crash when voiding a transaction.

2006-02-13 16:23 warlord
Expand All @@ -15625,7 +15625,7 @@
2006-02-13 15:42 hampton

* [r13256] trunk/ChangeLog, trunk/src/gnome/glade/account.glade,
trunk/src/gnome/glade/sched-xact.glade: Andreas K�hler's patch
trunk/src/gnome/glade/sched-xact.glade: Andreas K�hler's patch
to wrap label text in a couple of dialogs.

2006-02-13 14:06 codehelp
Expand Down Expand Up @@ -16530,7 +16530,7 @@
trunk/src/gnome-utils/gnc-tree-view-account.c,
trunk/src/gnome-utils/gnc-tree-view-commodity.c,
trunk/src/gnome-utils/gnc-tree-view-price.c,
trunk/src/gnome-utils/gnc-tree-view.c: Andreas K�hler's patch to
trunk/src/gnome-utils/gnc-tree-view.c: Andreas K�hler's patch to
perform the i18n on column headers before calling the generic
tree view code instead of performing it a couple steps removed.
It also introduces the translatable strings "P" (placeholder)
Expand Down Expand Up @@ -16634,7 +16634,7 @@

* [r13086] trunk/ChangeLog, trunk/src/gnome-utils/gnc-tree-view.c,
trunk/src/gnome-utils/gnc-tree-view.h,
trunk/src/gnome/glade/account.glade: Andreas K�hler's patch to
trunk/src/gnome/glade/account.glade: Andreas K�hler's patch to
allow explicit specification of which columns in a tree view
expand. Updated to automatically mark a column as expandable if
it is the only visible column.
Expand Down Expand Up @@ -16997,7 +16997,7 @@
2006-01-29 23:19 hampton

* [r13039] trunk/ChangeLog,
trunk/src/gnome-utils/gnc-main-window.c: Andreas K�hler's patch
trunk/src/gnome-utils/gnc-main-window.c: Andreas K�hler's patch
to fix a problem where switching windows repeatedly confusing
the Windows menu.

Expand All @@ -17010,7 +17010,7 @@

* [r13037] trunk/ChangeLog,
trunk/src/gnome-utils/gnc-tree-model-commodity.c: Andreas
K�hler's patch to fix commodity editor warnings/crash.
K�hler's patch to fix commodity editor warnings/crash.

2006-01-29 19:32 jsled

Expand Down Expand Up @@ -18764,7 +18764,7 @@
branches/cashutil/src/import-export/log-replay/gncmod-log-replay.c,
branches/cashutil/src/import-export/mt940/gncmod-mt940-import.c,
branches/cashutil/src/import-export/ofx/gncmod-ofx-import.c,
branches/cashutil/src/import-export/qif-import/gncmod-qif-import.c,
branches/cashutil/src/import-export/qif-import/gnc-qif-import.c,
branches/cashutil/src/register/ledger-core/gncmod-ledger-core.c,
branches/cashutil/src/register/register-core/gncmod-register-core.c,
branches/cashutil/src/report/report-system/gncmod-report-system.c:
Expand Down
4 changes: 2 additions & 2 deletions ChangeLog.2007
Original file line number Diff line number Diff line change
Expand Up @@ -6971,7 +6971,7 @@
branches/remove-group2/src/import-export/qif-import/Makefile.am,
branches/remove-group2/src/import-export/qif-import/dialog-account-picker.c,
branches/remove-group2/src/import-export/qif-import/druid-qif-import.c,
branches/remove-group2/src/import-export/qif-import/gncmod-qif-import.c,
branches/remove-group2/src/import-export/qif-import/gnc-qif-import.c,
branches/remove-group2/src/import-export/qif-import/qif-guess-map.scm,
branches/remove-group2/src/import-export/qif-import/qif-import.scm,
branches/remove-group2/src/import-export/qif-import/qif-parse.scm,
Expand Down Expand Up @@ -9017,7 +9017,7 @@
src/import-export/hbci/gncmod-hbci.c,
src/import-export/log-replay/gncmod-log-replay.c,
src/import-export/ofx/gncmod-ofx-import.c,
src/import-export/qif-import/gncmod-qif-import.c,
src/import-export/qif-import/gnc-qif-import.c,
src/import-export/qif-io-core/gncmod-qifiocore.c,
src/import-export/qif-io-core/test/Makefile.am,
src/import-export/test/Makefile.am,
Expand Down
4 changes: 2 additions & 2 deletions ChangeLog.2010
Original file line number Diff line number Diff line change
Expand Up @@ -7581,7 +7581,7 @@
src/import-export/qif-import/gnc-druid-test.h,
src/import-export/qif-import/gnc-plugin-qif-import.c,
src/import-export/qif-import/gnc-plugin-qif-import.h,
src/import-export/qif-import/gncmod-qif-import.c,
src/import-export/qif-import/gnc-qif-import.c,
src/import-export/qif-import/test/test-link.c,
src/import-export/qif-io-core/gncmod-qifiocore.c,
src/import-export/qif/qif-context.c,
Expand Down Expand Up @@ -10432,7 +10432,7 @@
src/import-export/qif-import/gnc-druid-test.c,
src/import-export/qif-import/gnc-plugin-qif-import.c,
src/import-export/qif-import/gnc-plugin-qif-import.h,
src/import-export/qif-import/gncmod-qif-import.c,
src/import-export/qif-import/gnc-qif-import.c,
src/import-export/qif-import/test/test-link.c,
src/import-export/qif-io-core/gncmod-qifiocore.c,
src/import-export/qif/qif-context.c,
Expand Down
2 changes: 1 addition & 1 deletion ChangeLog.2011
Original file line number Diff line number Diff line change
Expand Up @@ -914,7 +914,7 @@
src/import-export/qif-import/druid-qif-import.c,
src/import-export/qif-import/druid-qif-import.h,
src/import-export/qif-import/gnc-plugin-qif-import.c,
src/import-export/qif-import/gncmod-qif-import.c,
src/import-export/qif-import/gnc-qif-import.c,
src/import-export/qif-import/qif.glade: Bug #664877 - Migrate
Qif Import Druid to an Assistant Patch by Robert Fewell

Expand Down
1 change: 1 addition & 0 deletions gnucash/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ endif()
target_link_libraries (gnucash
gnc-ledger-core gnc-gnome gnc-gnome-utils gnc-app-utils
gnc-engine gnc-module gnc-core-utils gncmod-report gnucash-guile
gnc-qif-import
PkgConfig::GTK3 ${GUILE_LDFLAGS} ${GLIB2_LDFLAGS} ${GTK_MAC_LDFLAGS}
)

Expand Down
9 changes: 8 additions & 1 deletion gnucash/gnucash-bin.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
#include "gnc-splash.h"
#include "gnc-gnome-utils.h"
#include "gnc-plugin-file-history.h"
#include "gnc-plugin-qif-import.h"
#include "gnc-plugin-report-system.h"
#include "dialog-new-user.h"
#include "gnc-session.h"
Expand Down Expand Up @@ -478,6 +479,12 @@ gnc_parse_command_line(int *argc, char ***argv)
file_to_load = args_remaining[0];
}

static void
load_gnucash_plugins()
{
gnc_plugin_qif_import_create_plugin ();
}

static void
load_gnucash_modules()
{
Expand All @@ -489,7 +496,6 @@ load_gnucash_modules()
gboolean optional;
} modules[] =
{
{ "gnucash/import-export/qif-import", 0, FALSE },
{ "gnucash/import-export/ofx", 0, TRUE },
{ "gnucash/import-export/csv-import", 0, TRUE },
{ "gnucash/import-export/csv-export", 0, TRUE },
Expand Down Expand Up @@ -613,6 +619,7 @@ inner_main (void *closure, int argc, char **argv)
gnc_hook_add_dangler(HOOK_UI_SHUTDOWN, (GFunc)gnc_search_core_finalize, NULL, NULL);
gnucash_register_add_cell_types ();

load_gnucash_plugins();
load_gnucash_modules();

/* Load the config before starting up the gui. This insures that
Expand Down
18 changes: 11 additions & 7 deletions gnucash/import-export/qif-imp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ set (qif_import_SOURCES
dialog-account-picker.c
assistant-qif-import.c
gnc-plugin-qif-import.c
gncmod-qif-import.c
)

# Add dependency on config.h
Expand All @@ -18,21 +17,26 @@ set (qif_import_noinst_HEADERS
gnc-plugin-qif-import.h
)

add_library (gncmod-qif-import ${qif_import_SOURCES} ${qif_import_noinst_HEADERS})
add_library (gnc-qif-import ${qif_import_SOURCES} ${qif_import_noinst_HEADERS})

target_link_libraries(gncmod-qif-import
target_link_libraries(gnc-qif-import
gnc-app-utils
gnc-gnome-utils
gnc-gnome
gnucash-guile)

target_compile_definitions(gncmod-qif-import PRIVATE -DG_LOG_DOMAIN=\"gnc.import.qif.import\")
target_include_directories(gnc-qif-import
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}
)

target_compile_definitions(gnc-qif-import PRIVATE -DG_LOG_DOMAIN=\"gnc.import.qif.import\")

if (APPLE)
set_target_properties (gncmod-qif-import PROPERTIES INSTALL_NAME_DIR "${CMAKE_INSTALL_FULL_LIBDIR}/gnucash")
set_target_properties (gnc-qif-import PROPERTIES INSTALL_NAME_DIR "${CMAKE_INSTALL_FULL_LIBDIR}/gnucash")
endif()

install(TARGETS gncmod-qif-import
install(TARGETS gnc-qif-import
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/gnucash
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/gnucash
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
Expand Down Expand Up @@ -62,7 +66,7 @@ set(qif_import_SCHEME_2
)

set(GUILE_DEPENDS
gncmod-qif-import
gnc-qif-import
gnc-gnome
scm-core-utils
scm-gnc-module
Expand Down
6 changes: 6 additions & 0 deletions gnucash/import-export/qif-imp/gnc-plugin-qif-import.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include <gtk/gtk.h>
#include <glib/gi18n.h>

#include "dialog-new-user.h"
#include "dialog-preferences.h"
#include "assistant-qif-import.h"
#include "gnc-plugin-manager.h"
Expand Down Expand Up @@ -128,6 +129,11 @@ gnc_plugin_qif_import_create_plugin (void)
GncPlugin *plugin = gnc_plugin_qif_import_new ();
gnc_plugin_manager_add_plugin (gnc_plugin_manager_get (), plugin);

gnc_new_user_dialog_register_qif_assistant
((void (*)())gnc_file_qif_import);

scm_c_use_module("gnucash qif-import");

/* Add to preferences under Online Banking */
/* The parameters are; glade file, items to add from glade file - last being the dialog, preference tab name */
gnc_preferences_add_to_page ("dialog-account-picker.glade", "prefs_table",
Expand Down
Loading

0 comments on commit 468f344

Please sign in to comment.