GnuCash  5.6-150-g038405b370+
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. */
40 static QofLogModule log_module = G_LOG_DOMAIN;
41 
42 static void gnc_plugin_customer_import_finalize (GObject *object);
43 
44 /* Command callbacks */
45 static 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 
50 static 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 };
57 static guint gnc_plugin_n_actions = G_N_ELEMENTS(gnc_plugin_actions);
58 
60 static 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 
75 G_DEFINE_TYPE(GncPluginCustomerImport, gnc_plugin_customer_import, GNC_TYPE_PLUGIN)
76 
77 GncPlugin *
79 {
80  return GNC_PLUGIN (g_object_new (GNC_TYPE_PLUGIN_CUSTOMER_IMPORT, (gchar*) NULL));
81 }
82 
83 static void
84 gnc_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 
102 static void
103 gnc_plugin_customer_import_init (GncPluginCustomerImport *plugin)
104 {
105 }
106 
107 static void
108 gnc_plugin_customer_import_finalize (GObject *object)
109 {
110 }
111 
112 /************************************************************
113  * Plugin Bootstrapping *
114  ************************************************************/
115 
116 void
118 {
119  GncPlugin *plugin = gnc_plugin_customer_import_new ();
120 
122 }
123 
124 /************************************************************
125  * Command Callbacks *
126  ************************************************************/
127 
128 static void
129 gnc_plugin_customer_import_cmd_test (GSimpleAction *simple,
130  GVariant *parameter,
131  gpointer user_data)
132 {
133  GncMainWindowActionData *data = user_data;
134 
135  ENTER ("action %p, main window data %p", simple, data);
136  PINFO ("customer_import");
137 
138  gnc_plugin_customer_import_showGUI (GTK_WINDOW(data->window));
139 
140  LEAVE (" ");
141 }
GncPlugin * gnc_plugin_customer_import_new(void)
CustomerImportGui * gnc_plugin_customer_import_showGUI(GtkWindow *parent)
File chooser.
#define G_LOG_DOMAIN
Functions providing the SX List as a plugin page.
#define PINFO(format, args...)
Print an informational note.
Definition: qoflog.h:256
Plugin management functions for the GnuCash UI.
void gnc_plugin_manager_add_plugin(GncPluginManager *manager, GncPlugin *plugin)
Add a plugin to the list maintained by the plugin manager.
#define ENTER(format, args...)
Print a function entry debugging message.
Definition: qoflog.h:272
GUI handling for customer import plugin.
GncPluginManager * gnc_plugin_manager_get(void)
Retrieve a pointer to the plugin manager.
void gnc_plugin_customer_import_create_plugin(void)
Create a new GncPlugincustomer_import object and register it.
#define PLUGIN_ACTIONS_NAME
The label given to the main window for this plugin.
#define LEAVE(format, args...)
Print a function exit debugging message.
Definition: qoflog.h:282
Plugin registration of the customer_import module.
#define PLUGIN_UI_FILENAME
The name of the UI description file for this plugin.