예제 #1
0
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);
}
예제 #2
0
static void
usage_view_activate (PlannerView *view)
{
	PlannerUsageViewPriv *priv;
	gchar		     *filename;

	priv = PLANNER_USAGE_VIEW (view)->priv;

	priv->actions = gtk_action_group_new ("TimeTableView");
	gtk_action_group_set_translation_domain (priv->actions, GETTEXT_PACKAGE);

	gtk_action_group_add_actions (priv->actions, entries, G_N_ELEMENTS (entries), view);

	gtk_ui_manager_insert_action_group (priv->ui_manager, priv->actions, 0);
	filename = mrp_paths_get_ui_dir ("time-table-view.ui");
	priv->merged_id = gtk_ui_manager_add_ui_from_file (priv->ui_manager,
							   filename,
							   NULL);
	g_free (filename);
	gtk_ui_manager_ensure_update (priv->ui_manager);

        usage_view_update_zoom_sensitivity (view);

	gtk_widget_grab_focus (priv->tree);
}
예제 #3
0
static void
task_view_activate (PlannerView *view)
{
    PlannerTaskViewPriv *priv;
    gboolean             show_critical;
    gboolean             show_nostd_days;
    gchar               *filename;

    priv = PLANNER_TASK_VIEW (view)->priv;

    priv->actions = gtk_action_group_new ("TaskView");
    gtk_action_group_set_translation_domain (priv->actions, GETTEXT_PACKAGE);

    gtk_action_group_add_actions (priv->actions, entries,
                                  G_N_ELEMENTS (entries),
                                  view);
    gtk_action_group_add_toggle_actions (priv->actions, toggle_entries,
                                         G_N_ELEMENTS (toggle_entries),
                                         view);

    gtk_ui_manager_insert_action_group (priv->ui_manager, priv->actions, 0);
    filename = mrp_paths_get_ui_dir ("task-view.ui");
    priv->merged_id = gtk_ui_manager_add_ui_from_file (priv->ui_manager,
                      filename,
                      NULL);
    g_free (filename);
    gtk_ui_manager_ensure_update (priv->ui_manager);

    /* Set the initial UI state. */
    show_critical =   planner_conf_get_bool (CRITICAL_PATH_KEY, NULL);
    show_nostd_days = planner_conf_get_bool (NOSTDDAYS_PATH_KEY, NULL);
    planner_task_tree_set_highlight_critical (PLANNER_TASK_TREE (priv->tree),
            show_critical);
    planner_task_tree_set_nonstandard_days (PLANNER_TASK_TREE (priv->tree),
                                            show_nostd_days);

    gtk_toggle_action_set_active (
        GTK_TOGGLE_ACTION (gtk_action_group_get_action (priv->actions, "HighlightCriticalTasks")),
        show_critical);

    gtk_toggle_action_set_active (
        GTK_TOGGLE_ACTION (gtk_action_group_get_action (priv->actions, "NonstandardDays")),
        show_nostd_days);

    task_view_selection_changed_cb (PLANNER_TASK_TREE (priv->tree), view);

    gtk_widget_grab_focus (priv->tree);
}
예제 #4
0
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);
}
예제 #5
0
static void
show_view_activate (PlannerView *view)
{
	PlannerShowViewPriv *priv;
	gboolean              show_critical, show_nostd_days, show_guidelines;
	gchar                *filename;

	priv = PLANNER_SHOW_VIEW (view)->priv;

	priv->actions = gtk_action_group_new ("ShowView");
	gtk_action_group_set_translation_domain (priv->actions, GETTEXT_PACKAGE);

	gtk_action_group_add_actions (priv->actions,
				      entries,
				      G_N_ELEMENTS (entries),
				      view);
	gtk_action_group_add_toggle_actions (priv->actions,
					     toggle_entries,
					     G_N_ELEMENTS (toggle_entries),
					     view);

	gtk_ui_manager_insert_action_group (priv->ui_manager, priv->actions, 0);
	filename = mrp_paths_get_ui_dir ("show-view.ui");
	priv->merged_id = gtk_ui_manager_add_ui_from_file (priv->ui_manager,
							   filename,
							   NULL);
	g_free (filename);
	gtk_ui_manager_ensure_update (priv->ui_manager);

	/* Set the initial UI state. */
	show_critical = planner_gantt_chart_get_highlight_critical_tasks (
		PLANNER_GANTT_CHART (priv->gantt));

	show_nostd_days = planner_gantt_chart_get_nonstandard_days (
		PLANNER_GANTT_CHART (priv->gantt));

	show_guidelines = planner_gantt_chart_get_show_guidelines (
			PLANNER_GANTT_CHART (priv->gantt));

	planner_task_tree_set_highlight_critical (PLANNER_TASK_TREE (priv->tree),
						  show_critical);

	planner_task_tree_set_nonstandard_days (PLANNER_TASK_TREE (priv->tree),
						  show_nostd_days);

	gtk_toggle_action_set_active (
		GTK_TOGGLE_ACTION (gtk_action_group_get_action (priv->actions, "HighlightCriticalTasks")),
		show_critical);

	gtk_toggle_action_set_active (
		GTK_TOGGLE_ACTION (gtk_action_group_get_action (priv->actions, "NonstandardDays")),
		show_nostd_days);

	gtk_toggle_action_set_active (
		GTK_TOGGLE_ACTION (gtk_action_group_get_action (priv->actions, "ShowGuideLines")),
		show_guidelines);

	show_view_selection_changed_cb (PLANNER_TASK_TREE (priv->tree),
					 PLANNER_SHOW_VIEW (view));
	show_view_update_zoom_sensitivity (PLANNER_SHOW_VIEW (view));

	gtk_widget_grab_focus (priv->gantt);
}