-
Notifications
You must be signed in to change notification settings - Fork 762
/
gnc-plugin-customer-import.c
138 lines (110 loc) · 4.49 KB
/
gnc-plugin-customer-import.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
/*
* gnc-plugin-customer-import.c --
*
* 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
*/
/**
* @internal
* @file gnc-plugin-customer-import.c
* @brief Plugin registration of the customer_import plugin
* @author Copyright (C) 2009 Sebastian Held <sebastian.held@gmx.de>
*/
#include <config.h>
//#include <glade/glade.h>
//#include <glade/glade-xml.h>
#include <glib/gi18n.h>
#include "dialog-utils.h"
#include "gnc-plugin-customer-import.h"
#include "dialog-customer-import-gui.h"
#include "gnc-plugin-manager.h"
/* This static indicates the debugging module that this .o belongs to. */
static QofLogModule log_module = G_LOG_DOMAIN;
static void gnc_plugin_customer_import_class_init (GncPlugincustomer_importClass *klass);
static void gnc_plugin_customer_import_init (GncPlugincustomer_import *plugin);
static void gnc_plugin_customer_import_finalize (GObject *object);
/* Command callbacks */
static void gnc_plugin_customer_import_cmd_test (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
#define PLUGIN_ACTIONS_NAME "gnc-plugin-customer-import-actions"
#define PLUGIN_UI_FILENAME "gnc-plugin-customer-import.ui"
static GActionEntry gnc_plugin_actions [] =
{
{ "customer_importAction", gnc_plugin_customer_import_cmd_test, NULL, NULL, NULL },
};
/** The number of actions provided by this plugin. */
static guint gnc_plugin_n_actions = G_N_ELEMENTS(gnc_plugin_actions);
/** The default menu items that need to be add to the menu */
static const gchar *gnc_plugin_load_ui_items [] =
{
"FilePlaceholder1",
NULL,
};
/************************************************************
* Object Implementation *
************************************************************/
G_DEFINE_TYPE(GncPlugincustomer_import, gnc_plugin_customer_import, GNC_TYPE_PLUGIN)
GncPlugin *
gnc_plugin_customer_import_new (void)
{
return GNC_PLUGIN (g_object_new (GNC_TYPE_PLUGIN_customer_import, (gchar*) NULL));
}
static void
gnc_plugin_customer_import_class_init (GncPlugincustomer_importClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GncPluginClass *plugin_class = GNC_PLUGIN_CLASS(klass);
object_class->finalize = gnc_plugin_customer_import_finalize;
/* plugin info */
plugin_class->plugin_name = GNC_PLUGIN_customer_import_NAME;
/* widget addition/removal */
plugin_class->actions_name = PLUGIN_ACTIONS_NAME;
plugin_class->actions = gnc_plugin_actions;
plugin_class->n_actions = gnc_plugin_n_actions;
plugin_class->ui_filename = PLUGIN_UI_FILENAME;
plugin_class->ui_updates = gnc_plugin_load_ui_items;
}
static void
gnc_plugin_customer_import_init (GncPlugincustomer_import *plugin)
{
}
static void
gnc_plugin_customer_import_finalize (GObject *object)
{
}
/************************************************************
* Plugin Bootstrapping *
************************************************************/
void
gnc_plugin_customer_import_create_plugin (void)
{
GncPlugin *plugin = gnc_plugin_customer_import_new ();
gnc_plugin_manager_add_plugin (gnc_plugin_manager_get (), plugin);
}
/************************************************************
* Command Callbacks *
************************************************************/
static void
gnc_plugin_customer_import_cmd_test (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
GncMainWindowActionData *data = user_data;
ENTER ("action %p, main window data %p", simple, data);
PINFO ("customer_import");
gnc_plugin_customer_import_showGUI (GTK_WINDOW(data->window));
LEAVE (" ");
}