GnuCash c935c2f+
Loading...
Searching...
No Matches
gnc-plugin-customer-import.c
1/*
2 * gnc-plugin-customer-import.c --
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation; either version 2 of
7 * the License, or (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, contact:
16 *
17 * Free Software Foundation Voice: +1-617-542-5942
18 * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652
19 * Boston, MA 02110-1301, USA gnu@gnu.org
20 */
21
29#include <config.h>
30
31#include <glib/gi18n.h>
32
33#include "dialog-utils.h"
34
37#include "gnc-plugin-manager.h"
38
39/* This static indicates the debugging module that this .o belongs to. */
40static QofLogModule log_module = G_LOG_DOMAIN;
41
42static void gnc_plugin_customer_import_finalize (GObject *object);
43
44/* Command callbacks */
45static void gnc_plugin_customer_import_cmd_test (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
46
47#define PLUGIN_ACTIONS_NAME "gnc-plugin-customer-import-actions"
48#define PLUGIN_UI_FILENAME "gnc-plugin-customer-import.ui"
49
50static GActionEntry gnc_plugin_actions [] =
51{
52 // should be "CustomerImportAction", but "customer_importAction"
53 // is already used externally in accelerator maps
54 { "customer_importAction", gnc_plugin_customer_import_cmd_test, NULL, NULL, NULL },
55};
57static guint gnc_plugin_n_actions = G_N_ELEMENTS(gnc_plugin_actions);
58
60static const gchar *gnc_plugin_load_ui_items [] =
61{
62 "FilePlaceholder1",
63 NULL,
64};
65
66/************************************************************
67 * Object Implementation *
68 ************************************************************/
69
71{
72 GncPlugin gnc_plugin;
73};
74
75G_DEFINE_TYPE(GncPluginCustomerImport, gnc_plugin_customer_import, GNC_TYPE_PLUGIN)
76
77GncPlugin *
79{
80 return GNC_PLUGIN (g_object_new (GNC_TYPE_PLUGIN_CUSTOMER_IMPORT, (gchar*) NULL));
81}
82
83static void
84gnc_plugin_customer_import_class_init (GncPluginCustomerImportClass *klass)
85{
86 GObjectClass *object_class = G_OBJECT_CLASS (klass);
87 GncPluginClass *plugin_class = GNC_PLUGIN_CLASS(klass);
88
89 object_class->finalize = gnc_plugin_customer_import_finalize;
90
91 /* plugin info */
92 plugin_class->plugin_name = GNC_PLUGIN_CUSTOMER_IMPORT_NAME;
93
94 /* widget addition/removal */
95 plugin_class->actions_name = PLUGIN_ACTIONS_NAME;
96 plugin_class->actions = gnc_plugin_actions;
97 plugin_class->n_actions = gnc_plugin_n_actions;
98 plugin_class->ui_filename = PLUGIN_UI_FILENAME;
99 plugin_class->ui_updates = gnc_plugin_load_ui_items;
100}
101
102static void
103gnc_plugin_customer_import_init (GncPluginCustomerImport *plugin)
104{
105}
106
107static void
108gnc_plugin_customer_import_finalize (GObject *object)
109{
110 G_OBJECT_CLASS (gnc_plugin_customer_import_parent_class)->finalize (object);
111}
112
113/************************************************************
114 * Plugin Bootstrapping *
115 ************************************************************/
116
117void
124
125/************************************************************
126 * Command Callbacks *
127 ************************************************************/
128
129static void
130gnc_plugin_customer_import_cmd_test (GSimpleAction *simple,
131 GVariant *parameter,
132 gpointer user_data)
133{
134 GncMainWindowActionData *data = user_data;
135
136 ENTER ("action %p, main window data %p", simple, data);
137 PINFO ("customer_import");
138
139 gnc_plugin_customer_import_showGUI (GTK_WINDOW(data->window));
140
141 LEAVE (" ");
142}
GUI handling for customer import plugin.
Plugin registration of the customer_import module.
Plugin management functions for the GnuCash UI.
#define PINFO(format, args...)
Print an informational note.
Definition qoflog.h:256
#define LEAVE(format, args...)
Print a function exit debugging message.
Definition qoflog.h:282
#define ENTER(format, args...)
Print a function entry debugging message.
Definition qoflog.h:272
void gnc_plugin_manager_add_plugin(GncPluginManager *manager, GncPlugin *plugin)
Add a plugin to the list maintained by the plugin manager.
GncPluginManager * gnc_plugin_manager_get(void)
Retrieve a pointer to the plugin manager.
GncPlugin * gnc_plugin_customer_import_new(void)
CustomerImportGui * gnc_plugin_customer_import_showGUI(GtkWindow *parent)
File chooser.
void gnc_plugin_customer_import_create_plugin(void)
Create a new GncPlugincustomer_import object and register it.