28 #include <glib/gi18n.h>
31 #include "gnc-component-manager.h"
32 #include "gnc-plugin-register2.h"
33 #include "gnc-plugin-page-register2.h"
38 static void gnc_plugin_register2_finalize (GObject *
object);
41 static void gnc_plugin_register2_remove_from_window (
GncPlugin *plugin,
GncMainWindow *window, GQuark type);
46 #define PLUGIN_ACTIONS_NAME "gnc-plugin-register2-actions"
48 #ifdef REGISTER2_ENABLED
49 #define PLUGIN_UI_FILENAME "gnc-plugin-register2-ui.xml"
51 #define PLUGIN_UI_FILENAME "gnc-plugin-register22-ui.xml"
53 static GtkActionEntry gnc_plugin_actions [] =
55 #ifdef REGISTER2_ENABLED
57 "ToolsGeneralLedger2Action", NULL, N_(
"_General Ledger"), NULL,
58 N_(
"Open a general ledger window"),
59 G_CALLBACK (gnc_plugin_register2_cmd_general_ledger)
64 {
"Register2TestAction", NULL, N_(
"_Register2"), NULL, NULL, NULL },
66 "Register2TestGLAction", NULL, N_(
"Register2 Open GL Account"), NULL,
67 N_(
"Register2 Open GL Account"),
68 G_CALLBACK (gnc_plugin_register2_cmd_general_ledger)
71 static guint gnc_plugin_n_actions = G_N_ELEMENTS (gnc_plugin_actions);
78 #define GNC_PLUGIN_REGISTER2_GET_PRIVATE(o) \
79 (G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_PLUGIN_REGISTER2, GncPluginRegister2Private))
81 static GObjectClass *parent_class = NULL;
101 gnc_plugin_register2_pref_changed (gpointer prefs, gchar *pref,
105 gnc_gui_refresh_all ();
114 gnc_plugin_register2_get_type (
void)
116 static GType gnc_plugin_register2_type = 0;
118 if (gnc_plugin_register2_type == 0)
120 static const GTypeInfo our_info =
125 (GClassInitFunc) gnc_plugin_register2_class_init,
130 (GInstanceInitFunc) gnc_plugin_register2_init
133 gnc_plugin_register2_type = g_type_register_static (GNC_TYPE_PLUGIN,
134 "GncPluginRegister2",
138 return gnc_plugin_register2_type;
142 gnc_plugin_register2_new (
void)
148 GNC_TYPE_PLUGIN_PAGE_REGISTER2;
150 plugin = g_object_new (GNC_TYPE_PLUGIN_REGISTER2,
153 return GNC_PLUGIN (plugin);
159 GObjectClass *object_class = G_OBJECT_CLASS (klass);
162 parent_class = g_type_class_peek_parent (klass);
164 object_class->finalize = gnc_plugin_register2_finalize;
167 plugin_class->
plugin_name = GNC_PLUGIN_REGISTER2_NAME;
170 plugin_class->
add_to_window = gnc_plugin_register2_add_to_window;
172 gnc_plugin_register2_remove_from_window;
176 plugin_class->
actions = gnc_plugin_actions;
177 plugin_class->
n_actions = gnc_plugin_n_actions;
189 gnc_plugin_register2_finalize (GObject *
object)
194 g_return_if_fail (GNC_IS_PLUGIN_REGISTER2 (
object));
196 plugin = GNC_PLUGIN_REGISTER2 (
object);
197 priv = GNC_PLUGIN_REGISTER2_GET_PRIVATE(plugin);
199 G_OBJECT_CLASS (parent_class)->finalize (
object);
221 gnc_plugin_register2_add_to_window (
GncPlugin *plugin,
226 gnc_plugin_register2_pref_changed, window);
242 gnc_plugin_register2_remove_from_window (
GncPlugin *plugin,
247 gnc_plugin_register2_pref_changed, window);
255 gnc_plugin_register2_cmd_general_ledger (GtkAction *action,
260 g_return_if_fail (data != NULL);
gulong gnc_prefs_register_cb(const char *group, const gchar *pref_name, gpointer func, gpointer user_data)
GncPluginPage * gnc_plugin_page_register2_new_gl(void)
#define ENTER(format, args...)
const gchar * ui_filename
void gnc_main_window_open_page(GncMainWindow *window, GncPluginPage *page)
void(* remove_from_window)(GncPlugin *plugin, GncMainWindow *window, GQuark type)
const gchar * actions_name
Generic api to store and retrieve preferences.
const gchar * plugin_name
#define PLUGIN_ACTIONS_NAME
#define LEAVE(format, args...)
void(* add_to_window)(GncPlugin *plugin, GncMainWindow *window, GQuark type)
#define PLUGIN_UI_FILENAME
const gchar * QofLogModule
void gnc_prefs_remove_cb_by_func(const gchar *group, const gchar *pref_name, gpointer func, gpointer user_data)