28 #include <glib/gi18n.h>
31 #include "gnc-component-manager.h"
32 #include "gnc-plugin-register.h"
39 static void gnc_plugin_register_finalize (GObject *
object);
42 static void gnc_plugin_register_remove_from_window (
GncPlugin *plugin,
GncMainWindow *window, GQuark type);
47 #define PLUGIN_ACTIONS_NAME "gnc-plugin-register-actions"
48 #define PLUGIN_UI_FILENAME "gnc-plugin-register-ui.xml"
50 static GtkActionEntry gnc_plugin_actions [] =
53 #ifdef REGISTER2_ENABLED
54 "ToolsGeneralLedgerAction", NULL, N_(
"Old St_yle General Ledger"), NULL,
55 N_(
"Open an old style general ledger window"),
56 G_CALLBACK (gnc_plugin_register_cmd_general_ledger)
58 "ToolsGeneralLedgerAction", NULL, N_(
"_General Ledger"), NULL,
59 N_(
"Open general ledger window"),
60 G_CALLBACK (gnc_plugin_register_cmd_general_ledger)
64 static guint gnc_plugin_n_actions = G_N_ELEMENTS (gnc_plugin_actions);
71 #define GNC_PLUGIN_REGISTER_GET_PRIVATE(o) \
72 (G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_PLUGIN_REGISTER, GncPluginRegisterPrivate))
74 static GObjectClass *parent_class = NULL;
94 gnc_plugin_register_pref_changed (gpointer prefs, gchar *pref,
98 gnc_gui_refresh_all ();
107 gnc_plugin_register_get_type (
void)
109 static GType gnc_plugin_register_type = 0;
111 if (gnc_plugin_register_type == 0)
113 static const GTypeInfo our_info =
118 (GClassInitFunc) gnc_plugin_register_class_init,
123 (GInstanceInitFunc) gnc_plugin_register_init
126 gnc_plugin_register_type = g_type_register_static (GNC_TYPE_PLUGIN,
131 return gnc_plugin_register_type;
135 gnc_plugin_register_new (
void)
141 GNC_TYPE_PLUGIN_PAGE_REGISTER;
143 plugin = g_object_new (GNC_TYPE_PLUGIN_REGISTER,
146 return GNC_PLUGIN (plugin);
152 GObjectClass *object_class = G_OBJECT_CLASS (klass);
155 parent_class = g_type_class_peek_parent (klass);
157 object_class->finalize = gnc_plugin_register_finalize;
160 plugin_class->
plugin_name = GNC_PLUGIN_REGISTER_NAME;
163 plugin_class->
add_to_window = gnc_plugin_register_add_to_window;
165 gnc_plugin_register_remove_from_window;
169 plugin_class->
actions = gnc_plugin_actions;
170 plugin_class->
n_actions = gnc_plugin_n_actions;
182 gnc_plugin_register_finalize (GObject *
object)
184 g_return_if_fail (GNC_IS_PLUGIN_REGISTER (
object));
186 G_OBJECT_CLASS (parent_class)->finalize (
object);
208 gnc_plugin_register_add_to_window (
GncPlugin *plugin,
213 gnc_plugin_register_pref_changed, window);
229 gnc_plugin_register_remove_from_window (
GncPlugin *plugin,
234 gnc_plugin_register_pref_changed, window);
243 gnc_plugin_register_cmd_general_ledger (GtkAction *action,
248 g_return_if_fail (data != NULL);
gulong gnc_prefs_register_cb(const char *group, const gchar *pref_name, gpointer func, gpointer user_data)
#define ENTER(format, args...)
const gchar * ui_filename
void gnc_main_window_open_page(GncMainWindow *window, GncPluginPage *page)
Functions providing a register page for the GnuCash UI.
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
GncPluginPage * gnc_plugin_page_register_new_gl(void)
#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)