mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Add CSV Price importer assistant files
These file are largely based on the csv transaction importer. They are just the start for subsequent changes.
This commit is contained in:
parent
4fe77a577a
commit
393b8a126d
@ -10,6 +10,7 @@ SET(csv_import_remote_SOURCES
|
|||||||
SET(csv_import_SOURCES
|
SET(csv_import_SOURCES
|
||||||
gncmod-csv-import.c
|
gncmod-csv-import.c
|
||||||
assistant-csv-account-import.c
|
assistant-csv-account-import.c
|
||||||
|
assistant-csv-price-import.cpp
|
||||||
assistant-csv-trans-import.cpp
|
assistant-csv-trans-import.cpp
|
||||||
gnc-plugin-csv-import.c
|
gnc-plugin-csv-import.c
|
||||||
csv-account-import.c
|
csv-account-import.c
|
||||||
@ -37,6 +38,7 @@ SET(csv_import_remote_HEADERS
|
|||||||
|
|
||||||
SET(csv_import_noinst_HEADERS
|
SET(csv_import_noinst_HEADERS
|
||||||
assistant-csv-account-import.h
|
assistant-csv-account-import.h
|
||||||
|
assistant-csv-price-import.h
|
||||||
assistant-csv-trans-import.h
|
assistant-csv-trans-import.h
|
||||||
gnc-plugin-csv-import.h
|
gnc-plugin-csv-import.h
|
||||||
csv-account-import.h
|
csv-account-import.h
|
||||||
@ -88,7 +90,7 @@ INSTALL(TARGETS gncmod-csv-import
|
|||||||
# No headers to install
|
# No headers to install
|
||||||
|
|
||||||
SET(csv_import_GLADE assistant-csv-account-import.glade
|
SET(csv_import_GLADE assistant-csv-account-import.glade
|
||||||
assistant-csv-trans-import.glade)
|
assistant-csv-price-import.glade assistant-csv-trans-import.glade)
|
||||||
|
|
||||||
INSTALL(FILES ${csv_import_GLADE} DESTINATION ${CMAKE_INSTALL_DATADIR}/gnucash/gtkbuilder)
|
INSTALL(FILES ${csv_import_GLADE} DESTINATION ${CMAKE_INSTALL_DATADIR}/gnucash/gtkbuilder)
|
||||||
|
|
||||||
|
@ -5,6 +5,7 @@ pkglib_LTLIBRARIES=libgncmod-csv-import.la
|
|||||||
libgncmod_csv_import_la_SOURCES = \
|
libgncmod_csv_import_la_SOURCES = \
|
||||||
gncmod-csv-import.c \
|
gncmod-csv-import.c \
|
||||||
assistant-csv-account-import.c \
|
assistant-csv-account-import.c \
|
||||||
|
assistant-csv-price-import.cpp \
|
||||||
assistant-csv-trans-import.cpp \
|
assistant-csv-trans-import.cpp \
|
||||||
gnc-plugin-csv-import.c \
|
gnc-plugin-csv-import.c \
|
||||||
csv-account-import.c \
|
csv-account-import.c \
|
||||||
@ -22,6 +23,7 @@ libgncmod_csv_import_la_SOURCES = \
|
|||||||
|
|
||||||
noinst_HEADERS = \
|
noinst_HEADERS = \
|
||||||
assistant-csv-account-import.h \
|
assistant-csv-account-import.h \
|
||||||
|
assistant-csv-price-import.h \
|
||||||
assistant-csv-trans-import.h \
|
assistant-csv-trans-import.h \
|
||||||
gnc-plugin-csv-import.h \
|
gnc-plugin-csv-import.h \
|
||||||
csv-account-import.h \
|
csv-account-import.h \
|
||||||
@ -79,6 +81,7 @@ ui_DATA = \
|
|||||||
gtkbuilderdir = ${GNC_GTKBUILDER_DIR}
|
gtkbuilderdir = ${GNC_GTKBUILDER_DIR}
|
||||||
gtkbuilder_DATA = \
|
gtkbuilder_DATA = \
|
||||||
assistant-csv-account-import.glade \
|
assistant-csv-account-import.glade \
|
||||||
|
assistant-csv-price-import.glade \
|
||||||
assistant-csv-trans-import.glade
|
assistant-csv-trans-import.glade
|
||||||
|
|
||||||
EXTRA_DIST = $(ui_DATA) $(gtkbuilder_DATA) CMakeLists.txt
|
EXTRA_DIST = $(ui_DATA) $(gtkbuilder_DATA) CMakeLists.txt
|
||||||
|
1621
gnucash/import-export/csv-imp/assistant-csv-price-import.cpp
Normal file
1621
gnucash/import-export/csv-imp/assistant-csv-price-import.cpp
Normal file
File diff suppressed because it is too large
Load Diff
1001
gnucash/import-export/csv-imp/assistant-csv-price-import.glade
Normal file
1001
gnucash/import-export/csv-imp/assistant-csv-price-import.glade
Normal file
File diff suppressed because it is too large
Load Diff
36
gnucash/import-export/csv-imp/assistant-csv-price-import.h
Normal file
36
gnucash/import-export/csv-imp/assistant-csv-price-import.h
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
/*******************************************************************\
|
||||||
|
* assistant-csv-price-import.h -- An assistant for importing *
|
||||||
|
* Prices from a file. *
|
||||||
|
* *
|
||||||
|
* Copyright (C) 2017 Robert Fewell *
|
||||||
|
* *
|
||||||
|
* This program is free software; you can redistribute it and/or *
|
||||||
|
* modify it under the terms of the GNU General Public License as *
|
||||||
|
* published by the Free Software Foundation; either version 2 of *
|
||||||
|
* the License, or (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
* This program is distributed in the hope that it will be useful, *
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||||
|
* GNU General Public License for more details. *
|
||||||
|
* *
|
||||||
|
* You should have received a copy of the GNU General Public License*
|
||||||
|
* along with this program; if not, contact: *
|
||||||
|
* *
|
||||||
|
* Free Software Foundation Voice: +1-617-542-5942 *
|
||||||
|
* 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
|
||||||
|
* Boston, MA 02110-1301, USA gnu@gnu.org *
|
||||||
|
\********************************************************************/
|
||||||
|
/** @file assistant-csv-price-import.h
|
||||||
|
@brief CSV Import Assistant
|
||||||
|
@author Copyright (c) 2017 Robert Fewell
|
||||||
|
*/
|
||||||
|
#ifndef GNC_ASSISTANT_CSV_IMPORT_PRICE_H
|
||||||
|
#define GNC_ASSISTANT_CSV_IMPORT_PRICE_H
|
||||||
|
|
||||||
|
|
||||||
|
/** The gnc_file_csv_price_import() will let the user import the
|
||||||
|
* commodity prices from a file.
|
||||||
|
*/
|
||||||
|
void gnc_file_csv_price_import (void);
|
||||||
|
#endif
|
@ -5,6 +5,7 @@
|
|||||||
<placeholder name="FileImportPlaceholder">
|
<placeholder name="FileImportPlaceholder">
|
||||||
<menuitem name="FileCsvImportAccounts" action="CsvImportAccountAction"/>
|
<menuitem name="FileCsvImportAccounts" action="CsvImportAccountAction"/>
|
||||||
<menuitem name="FileCsvImportTrans" action="CsvImportTransAction"/>
|
<menuitem name="FileCsvImportTrans" action="CsvImportTransAction"/>
|
||||||
|
<menuitem name="FileCsvImportPrice" action="CsvImportPriceAction"/>
|
||||||
</placeholder>
|
</placeholder>
|
||||||
</menu>
|
</menu>
|
||||||
</menu>
|
</menu>
|
||||||
|
@ -30,6 +30,7 @@
|
|||||||
|
|
||||||
#include "assistant-csv-account-import.h"
|
#include "assistant-csv-account-import.h"
|
||||||
#include "assistant-csv-trans-import.h"
|
#include "assistant-csv-trans-import.h"
|
||||||
|
#include "assistant-csv-price-import.h"
|
||||||
|
|
||||||
static void gnc_plugin_csv_import_class_init (GncPluginCsvImportClass *klass);
|
static void gnc_plugin_csv_import_class_init (GncPluginCsvImportClass *klass);
|
||||||
static void gnc_plugin_csv_import_init (GncPluginCsvImport *plugin);
|
static void gnc_plugin_csv_import_init (GncPluginCsvImport *plugin);
|
||||||
@ -38,6 +39,7 @@ static void gnc_plugin_csv_import_finalize (GObject *object);
|
|||||||
/* Command callbacks */
|
/* Command callbacks */
|
||||||
static void gnc_plugin_csv_import_tree_cmd (GtkAction *action, GncMainWindowActionData *data);
|
static void gnc_plugin_csv_import_tree_cmd (GtkAction *action, GncMainWindowActionData *data);
|
||||||
static void gnc_plugin_csv_import_trans_cmd (GtkAction *action, GncMainWindowActionData *data);
|
static void gnc_plugin_csv_import_trans_cmd (GtkAction *action, GncMainWindowActionData *data);
|
||||||
|
static void gnc_plugin_csv_import_price_cmd (GtkAction *action, GncMainWindowActionData *data);
|
||||||
|
|
||||||
#define PLUGIN_ACTIONS_NAME "gnc-plugin-csv-import-actions"
|
#define PLUGIN_ACTIONS_NAME "gnc-plugin-csv-import-actions"
|
||||||
#define PLUGIN_UI_FILENAME "gnc-plugin-csv-import-ui.xml"
|
#define PLUGIN_UI_FILENAME "gnc-plugin-csv-import-ui.xml"
|
||||||
@ -54,6 +56,11 @@ static GtkActionEntry gnc_plugin_actions [] =
|
|||||||
N_("Import Transactions from a CSV file"),
|
N_("Import Transactions from a CSV file"),
|
||||||
G_CALLBACK (gnc_plugin_csv_import_trans_cmd)
|
G_CALLBACK (gnc_plugin_csv_import_trans_cmd)
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"CsvImportPriceAction", GTK_STOCK_CONVERT, N_("Import _Prices from a CSV file..."), NULL,
|
||||||
|
N_("Import Prices from a CSV file"),
|
||||||
|
G_CALLBACK (gnc_plugin_csv_import_price_cmd)
|
||||||
|
},
|
||||||
};
|
};
|
||||||
static guint gnc_plugin_n_actions = G_N_ELEMENTS (gnc_plugin_actions);
|
static guint gnc_plugin_n_actions = G_N_ELEMENTS (gnc_plugin_actions);
|
||||||
|
|
||||||
@ -157,6 +164,13 @@ gnc_plugin_csv_import_trans_cmd (GtkAction *action,
|
|||||||
gnc_file_csv_trans_import ();
|
gnc_file_csv_trans_import ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
gnc_plugin_csv_import_price_cmd (GtkAction *action,
|
||||||
|
GncMainWindowActionData *data)
|
||||||
|
{
|
||||||
|
gnc_file_csv_price_import ();
|
||||||
|
}
|
||||||
|
|
||||||
/************************************************************
|
/************************************************************
|
||||||
* Plugin Bootstrapping *
|
* Plugin Bootstrapping *
|
||||||
************************************************************/
|
************************************************************/
|
||||||
|
Loading…
Reference in New Issue
Block a user