G_MODULE_EXPORT void plugin_init (PlannerPlugin *plugin) { PlannerPluginPriv *priv; GtkUIManager *ui; gchar *filename; priv = g_new0 (PlannerPluginPriv, 1); plugin->priv = priv; priv->actions = gtk_action_group_new ("HTML plugin actions"); gtk_action_group_set_translation_domain (priv->actions, GETTEXT_PACKAGE); gtk_action_group_add_actions (priv->actions, action_entries, G_N_ELEMENTS (action_entries), plugin); ui = planner_window_get_ui_manager (plugin->main_window); gtk_ui_manager_insert_action_group (ui, priv->actions, 0); filename = mrp_paths_get_ui_dir ("html-plugin.ui"); gtk_ui_manager_add_ui_from_file (ui, filename, NULL); g_free (filename); gtk_ui_manager_ensure_update (ui); }
static void task_view_setup (PlannerView *view, PlannerWindow *main_window) { PlannerTaskViewPriv *priv; priv = PLANNER_TASK_VIEW (view)->priv; priv->ui_manager = planner_window_get_ui_manager (main_window); }
static void show_view_setup (PlannerView *view, PlannerWindow *main_window) { PlannerShowViewPriv *priv; priv = PLANNER_SHOW_VIEW (view)->priv; priv->ui_manager = planner_window_get_ui_manager (main_window); }
static void usage_view_setup (PlannerView *view, PlannerWindow *main_window) { PlannerUsageViewPriv *priv; priv = PLANNER_USAGE_VIEW (view)->priv; priv->ui_manager = planner_window_get_ui_manager(main_window); }
G_MODULE_EXPORT void plugin_exit (PlannerPlugin *plugin) { PlannerPluginPriv *priv; GtkUIManager *ui; priv = plugin->priv; ui = planner_window_get_ui_manager (plugin->main_window); gtk_ui_manager_remove_action_group (ui, priv->actions); g_object_unref (priv->actions); g_free (priv); }
G_MODULE_EXPORT void plugin_init (PlannerPlugin *plugin) { PlannerPluginPriv *priv; GtkUIManager *ui; gint i = -1; gchar *filename; priv = g_new0 (PlannerPluginPriv, 1); plugin->priv = priv; gda_init (PACKAGE, VERSION, 0, NULL); g_object_set_data (G_OBJECT (plugin->main_window), PROJECT_ID, GINT_TO_POINTER (i)); g_object_set_data (G_OBJECT (plugin->main_window), "sql-plugin-revision", GINT_TO_POINTER (i)); g_object_set_data (G_OBJECT (plugin->main_window), "sql-plugin", plugin); /* Create the actions, get the ui manager and merge the whole */ priv->actions = gtk_action_group_new ("SQL plugin actions"); gtk_action_group_set_translation_domain (priv->actions, GETTEXT_PACKAGE); gtk_action_group_add_actions (priv->actions, entries, G_N_ELEMENTS (entries), plugin); ui = planner_window_get_ui_manager (plugin->main_window); gtk_ui_manager_insert_action_group (ui, priv->actions, 0); filename = mrp_paths_get_ui_dir ("sql-plugin.ui"); gtk_ui_manager_add_ui_from_file (ui, filename, NULL); g_free (filename); gtk_ui_manager_ensure_update (ui); }
G_MODULE_EXPORT void plugin_exit (PlannerPlugin *plugin) { PlannerPluginPriv *priv; GtkUIManager *ui; GList *l; priv = plugin->priv; for (l = priv->queries_cancelled; l; l = l->next) { g_free (l->data); } g_list_free (priv->queries_cancelled); ui = planner_window_get_ui_manager (plugin->main_window); gtk_ui_manager_remove_action_group (ui, priv->actions); g_object_unref (priv->actions); g_free (priv); /*g_message ("Test exit");*/ }