mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-16 10:15:22 -06:00
The QIF module now creates its own menu item.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@7007 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
6450592b65
commit
cee40d8445
10
AUTHORS
10
AUTHORS
@ -66,10 +66,14 @@ Derek Atkins <derek@ihtfp.com> wrote the business-accounting package
|
||||
modularized the Book object storage, and modularized the backend
|
||||
to allow pluggable objects.
|
||||
|
||||
David Hampton <hampton@employees.org> is an all-around making-things-better guy.
|
||||
David Hampton <hampton@employees.org> is an all-around
|
||||
making-things-better guy. He is working on cleaning up the GUI and
|
||||
on fleshing out support for stocks. David has picked up Dave's
|
||||
previous tendency to hacks obsessively on GnuCash. (Something in
|
||||
the name?)
|
||||
|
||||
Chris Lyttle <chris@wilddev.net> writes documentation and administers the GnuCash
|
||||
bug list.
|
||||
Chris Lyttle <chris@wilddev.net> writes documentation and administers
|
||||
the GnuCash bug list.
|
||||
|
||||
|
||||
Other Contributors:
|
||||
|
12
ChangeLog
12
ChangeLog
@ -12,7 +12,17 @@
|
||||
* src/import-export/ofx/gnc-ofx-import.c :
|
||||
* src/import-export/ofx/gncmod-ofx-import.c :
|
||||
* src/scm/main.scm : OFX module loading tweaks.
|
||||
|
||||
|
||||
* src/gnome-utils/gnc-menu-extensions.[ch]:
|
||||
* src/gnome-utils/gw-gnome-utils-spec.scm: Add a new
|
||||
gnc_add_c_extension function. Rename the existing
|
||||
gnc_add_extension to gnc_add_scm_extension.
|
||||
|
||||
* 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
|
||||
"Import QIF" menu item from within the QIF module.
|
||||
|
||||
2002-06-21 Derek Atkins <derek@ihtfp.com>
|
||||
|
||||
* integrate the Billing Terms into the Core, GUI, and XML Backend
|
||||
|
@ -194,7 +194,11 @@ linkend="scheme"> Scheme </link>, the <link linkend="gwrap"> g-wrap
|
||||
<glossentry>
|
||||
<glossterm><email>hampton@employees.org</email> David Hampton</glossterm>
|
||||
<glossdef>
|
||||
<para>is an all-around making-things-better guy.</para>
|
||||
<para>is an all-around
|
||||
making-things-better guy. He is working on cleaning up the GUI and
|
||||
on fleshing out support for stocks. David has picked up Dave's
|
||||
previous tendency to hacks obsessively on GnuCash. (Something in
|
||||
the name?)</para>
|
||||
</glossdef>
|
||||
</glossentry>
|
||||
|
||||
|
@ -33,6 +33,7 @@ typedef struct _ExtensionInfo ExtensionInfo;
|
||||
struct _ExtensionInfo
|
||||
{
|
||||
SCM extension;
|
||||
gchar *path;
|
||||
|
||||
GnomeUIInfo info[2];
|
||||
|
||||
@ -128,7 +129,7 @@ gnc_extension_documentation(ExtensionInfo *ext_info)
|
||||
|
||||
/* returns g_malloc'd path */
|
||||
static char *
|
||||
gnc_extension_path(ExtensionInfo *ext_info)
|
||||
gnc_extension_path(SCM extension)
|
||||
{
|
||||
SCM path;
|
||||
gchar **strings;
|
||||
@ -137,7 +138,7 @@ gnc_extension_path(ExtensionInfo *ext_info)
|
||||
|
||||
initialize_getters();
|
||||
|
||||
path = gnc_guile_call1_to_list(getters.path, ext_info->extension);
|
||||
path = gnc_guile_call1_to_list(getters.path, extension);
|
||||
if (path == SCM_UNDEFINED)
|
||||
return g_strdup("");
|
||||
|
||||
@ -220,6 +221,7 @@ gnc_create_extension_info(SCM extension)
|
||||
|
||||
ext_info = g_new0(ExtensionInfo, 1);
|
||||
ext_info->extension = extension;
|
||||
ext_info->path = gnc_extension_path(extension);
|
||||
|
||||
ext_info->info[0].type = gnc_extension_type(ext_info);
|
||||
|
||||
@ -281,17 +283,19 @@ cleanup_extension_info(gpointer extension_info, gpointer not_used)
|
||||
{
|
||||
ExtensionInfo *ext_info = extension_info;
|
||||
|
||||
scm_unprotect_object(ext_info->extension);
|
||||
if (ext_info->extension)
|
||||
scm_unprotect_object(ext_info->extension);
|
||||
|
||||
g_free(ext_info->info[0].label);
|
||||
g_free(ext_info->info[0].hint);
|
||||
g_free(ext_info->extra_info);
|
||||
g_free(ext_info->path);
|
||||
g_free(ext_info);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
gnc_add_extension(SCM extension)
|
||||
gnc_add_scm_extension(SCM extension)
|
||||
{
|
||||
ExtensionInfo *ext_info;
|
||||
ext_info = gnc_create_extension_info(extension);
|
||||
@ -303,17 +307,32 @@ gnc_add_extension(SCM extension)
|
||||
}
|
||||
|
||||
void
|
||||
gnc_extensions_menu_setup(GnomeApp * app) {
|
||||
gnc_add_c_extension(GnomeUIInfo *info, gchar *path)
|
||||
{
|
||||
ExtensionInfo *ext_info;
|
||||
|
||||
ext_info = g_new0(ExtensionInfo, 1);
|
||||
ext_info->path = g_strdup(path);
|
||||
|
||||
ext_info->info[0] = *info;
|
||||
ext_info->info[0].label = g_strdup(info->label);
|
||||
ext_info->info[0].hint = g_strdup(info->hint);
|
||||
ext_info->info[1].type = GNOME_APP_UI_ENDOFINFO;
|
||||
|
||||
/* need to append so we can run them in order */
|
||||
extension_list = g_slist_append(extension_list, ext_info);
|
||||
}
|
||||
|
||||
void
|
||||
gnc_extensions_menu_setup(GnomeApp * app)
|
||||
{
|
||||
GSList * l = NULL;
|
||||
ExtensionInfo * info;
|
||||
char * path;
|
||||
|
||||
for(l=extension_list; l; l=l->next) {
|
||||
info = l->data;
|
||||
path = gnc_extension_path(info);
|
||||
gnome_app_insert_menus(app, path, info->info);
|
||||
gnome_app_insert_menus(app, info->path, info->info);
|
||||
gnome_app_install_menu_hints(app, info->info);
|
||||
g_free(path);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -26,7 +26,8 @@
|
||||
#include <guile/gh.h>
|
||||
#include <gnome.h>
|
||||
|
||||
void gnc_add_extension(SCM extension);
|
||||
void gnc_add_c_extension(GnomeUIInfo *info, gchar *path);
|
||||
void gnc_add_scm_extension(SCM extension);
|
||||
void gnc_extensions_menu_setup(GnomeApp * app);
|
||||
void gnc_extensions_shutdown(void);
|
||||
|
||||
|
@ -186,7 +186,7 @@
|
||||
ws
|
||||
'gnc:add-extension
|
||||
'<gw:void>
|
||||
"gnc_add_extension"
|
||||
"gnc_add_scm_extension"
|
||||
'((<gw:scm> extension))
|
||||
"Add a menu extension.")
|
||||
|
||||
|
@ -42,7 +42,6 @@
|
||||
#include "dialog-totd.h"
|
||||
#include "dialog-transfer.h"
|
||||
#include "dialog-utils.h"
|
||||
#include "druid-qif-import.h"
|
||||
#include "gfec.h"
|
||||
#include "global-options.h"
|
||||
#include "gnc-engine.h"
|
||||
@ -518,12 +517,6 @@ gnc_main_window_file_save_as_cb(GtkWidget * widget, gpointer data)
|
||||
gnc_refresh_main_window_info ();
|
||||
}
|
||||
|
||||
static void
|
||||
gnc_main_window_file_import_cb(GtkWidget * widget, gpointer data)
|
||||
{
|
||||
gnc_file_qif_import ();
|
||||
}
|
||||
|
||||
static void
|
||||
gnc_main_window_file_export_cb(GtkWidget * widget, gpointer data)
|
||||
{
|
||||
@ -799,14 +792,6 @@ gnc_main_window_create_menus(GNCMDIInfo * maininfo)
|
||||
|
||||
static GnomeUIInfo gnc_file_import_submenu_template[] =
|
||||
{
|
||||
{
|
||||
GNOME_APP_UI_ITEM,
|
||||
N_("Import _QIF..."),
|
||||
N_("Import a Quicken QIF file"),
|
||||
gnc_main_window_file_import_cb, NULL, NULL,
|
||||
GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_CONVERT,
|
||||
'i', GDK_CONTROL_MASK, NULL
|
||||
},
|
||||
GNOMEUIINFO_END
|
||||
};
|
||||
|
||||
|
@ -36,5 +36,6 @@ void gnc_main_window_file_save_cb(GtkWidget * widget, gpointer data);
|
||||
void gnc_main_window_file_save_as_cb(GtkWidget * widget, gpointer data);
|
||||
void gnc_main_window_totd_cb (GtkWidget *widget, gpointer data);
|
||||
void gnc_main_window_help_cb (GtkWidget *widget, gpointer data);
|
||||
void gnc_main_window_exit_cb (GtkWidget *widget, gpointer data);
|
||||
|
||||
#endif
|
||||
|
@ -43,6 +43,7 @@
|
||||
#include "gnc-engine-util.h"
|
||||
#include "gnc-file-dialog.h"
|
||||
#include "gnc-gui-query.h"
|
||||
#include "gnc-menu-extensions.h"
|
||||
#include "gnc-ui-util.h"
|
||||
#include "gnc-ui.h"
|
||||
#include "messages.h"
|
||||
@ -1942,3 +1943,19 @@ gnc_ui_qif_import_druid_make(void) {
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
void
|
||||
gnc_ui_qif_import_create_menus(void)
|
||||
{
|
||||
static GnomeUIInfo menuitem =
|
||||
{
|
||||
GNOME_APP_UI_ITEM,
|
||||
N_("Import _QIF..."),
|
||||
N_("Import a Quicken QIF file"),
|
||||
gnc_file_qif_import, NULL, NULL,
|
||||
GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_CONVERT,
|
||||
'i', GDK_CONTROL_MASK, NULL
|
||||
};
|
||||
|
||||
gnc_add_c_extension(&menuitem, "File/Import/");
|
||||
}
|
||||
|
@ -38,5 +38,6 @@ SCM gnc_ui_qif_import_druid_get_mappings(QIFImportWindow * w);
|
||||
* are merged into the existing session (if any). The current
|
||||
* session continues to remain open for editing. */
|
||||
void gnc_file_qif_import (void);
|
||||
void gnc_ui_qif_import_create_menus(void);
|
||||
|
||||
#endif
|
||||
|
@ -10,6 +10,7 @@
|
||||
|
||||
#include "gnc-module.h"
|
||||
#include "gnc-module-api.h"
|
||||
#include "druid-qif-import.h"
|
||||
|
||||
/* version of the gnc module system interface we require */
|
||||
int libgncmod_qif_import_LTX_gnc_module_system_interface = 0;
|
||||
@ -50,6 +51,7 @@ libgncmod_qif_import_LTX_gnc_module_init(int refcount)
|
||||
}
|
||||
|
||||
gh_eval_str("(use-modules (gnucash import-export qif-import))");
|
||||
gnc_ui_qif_import_create_menus();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user