28 #include <glib/gi18n.h> 31 #include "gnc-component-manager.h" 32 #include "gnc-plugin-register.h" 37 static void gnc_plugin_register_finalize (GObject *
object);
39 static void gnc_plugin_register_add_to_window (GncPlugin *plugin, GncMainWindow *window, GQuark type);
40 static void gnc_plugin_register_remove_from_window (GncPlugin *plugin, GncMainWindow *window, GQuark type);
43 static void gnc_plugin_register_cmd_general_ledger (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
45 #define PLUGIN_ACTIONS_NAME "gnc-plugin-register-actions" 46 #define PLUGIN_UI_FILENAME "gnc-plugin-register.ui" 48 static GActionEntry gnc_plugin_actions [] =
50 {
"ToolsGeneralJournalAction", gnc_plugin_register_cmd_general_ledger, NULL, NULL, NULL },
53 static guint gnc_plugin_n_actions = G_N_ELEMENTS(gnc_plugin_actions);
56 static const gchar *gnc_plugin_load_ui_items [] =
67 G_DEFINE_TYPE(GncPluginRegister, gnc_plugin_register, GNC_TYPE_PLUGIN)
69 static QofLogModule log_module = GNC_MOD_GUI;
88 gnc_plugin_register_pref_changed (gpointer prefs, gchar *pref,
92 gnc_gui_refresh_all ();
101 gnc_plugin_register_new (
void)
103 GncPluginRegister *plugin;
107 GNC_TYPE_PLUGIN_PAGE_REGISTER;
109 plugin = g_object_new (GNC_TYPE_PLUGIN_REGISTER,
112 return GNC_PLUGIN (plugin);
116 gnc_plugin_register_class_init (GncPluginRegisterClass *klass)
118 GObjectClass *object_class = G_OBJECT_CLASS (klass);
119 GncPluginClass *plugin_class = GNC_PLUGIN_CLASS (klass);
121 object_class->finalize = gnc_plugin_register_finalize;
124 plugin_class->plugin_name = GNC_PLUGIN_REGISTER_NAME;
127 plugin_class->add_to_window = gnc_plugin_register_add_to_window;
128 plugin_class->remove_from_window =
129 gnc_plugin_register_remove_from_window;
133 plugin_class->actions = gnc_plugin_actions;
134 plugin_class->n_actions = gnc_plugin_n_actions;
136 plugin_class->ui_updates = gnc_plugin_load_ui_items;
140 gnc_plugin_register_init (GncPluginRegister *plugin)
145 gnc_plugin_register_finalize (GObject *
object)
147 g_return_if_fail (GNC_IS_PLUGIN_REGISTER (
object));
149 G_OBJECT_CLASS (gnc_plugin_register_parent_class)->finalize (
object);
171 gnc_plugin_register_add_to_window (GncPlugin *plugin,
172 GncMainWindow *window,
176 gnc_plugin_register_pref_changed, window);
192 gnc_plugin_register_remove_from_window (GncPlugin *plugin,
193 GncMainWindow *window,
197 gnc_plugin_register_pref_changed, window);
206 gnc_plugin_register_cmd_general_ledger (GSimpleAction *simple,
213 g_return_if_fail (data != NULL);
The instance data structure for a content plugin.
gulong gnc_prefs_register_cb(const char *group, const gchar *pref_name, gpointer func, gpointer user_data)
Register a callback that gets triggered when the given preference changes.
#define ENTER(format, args...)
Print a function entry debugging message.
void gnc_main_window_open_page(GncMainWindow *window, GncPluginPage *page)
Display a data plugin page in a window.
Functions providing a register page for the GnuCash UI.
Generic api to store and retrieve preferences.
GncPluginPage * gnc_plugin_page_register_new_gl(void)
Create a new "register" plugin page containing a general journal.
#define PLUGIN_ACTIONS_NAME
The label given to the main window for this plugin.
#define LEAVE(format, args...)
Print a function exit debugging message.
#define PLUGIN_UI_FILENAME
The name of the UI description file for this plugin.
void gnc_prefs_remove_cb_by_func(const gchar *group, const gchar *pref_name, gpointer func, gpointer user_data)
Remove a function that was registered for a callback when the given preference changed.