Esempio n. 1
0
static void
control_activate (BonoboControl *control,
		  BonoboUIComponent *ui_component,
		  EYank *yank)
{
	Bonobo_UIContainer container;
	gchar *filename;

	container = bonobo_control_get_remote_ui_container (control);
	bonobo_ui_component_set_container (ui_component, container);
	bonobo_object_release_unref (container, NULL);

	bonobo_ui_component_add_verb_list_with_data (ui_component, verbs, yank);
	bonobo_ui_component_freeze (ui_component, NULL);

	bonobo_ui_util_set_ui (ui_component, EVOLUTION_DATADIR,
			       "evolution-yank.xml", "evolution-yank");
   	e_pixmaps_update (ui_component, pixmaps);  

	bonobo_ui_component_thaw (ui_component, NULL);
  filename = g_concat_dir_and_file (yank->priv->uri + 7, YANK_FILENAME);
	sp = &(yank->priv->sp);
	printf("control_activate : sp %x\n", sp);
	load_file(filename);
	g_free(filename);

}
Esempio n. 2
0
static void
peacock_file_control_construct (BonoboControl *control, GtkWidget *widget)
{
	PeacockFileControlData *cd;

	cd = peacock_file_control_data_new ();
	cd->control = control;
	cd->uiContainer = bonobo_control_get_remote_ui_container (cd->control,
								  NULL);

	/* Create the PeacockFile. */
	cd->file = peacock_file_new ();

	/* ...then the PeacockFileView */
	cd->view = PEACOCK_FILE_VIEW (peacock_file_view_new (cd->file, cd->uiContainer));
	gtk_box_pack_start_defaults (GTK_BOX (widget), GTK_WIDGET (cd->view));
	gtk_widget_show (GTK_WIDGET (cd->view));

	/* Add the Bonobo::PersistFile interface. */
	cd->persistFile = peacock_file_persist_file_new (cd->file);
	bonobo_object_add_interface (BONOBO_OBJECT (cd->control),
				     cd->persistFile);
	
	/* Load the menus and toolbars. */
	peacock_file_control_load_ui (control, cd);
	
	/* 
	 * Expose the GObject properties through the
	 * BonoboPropertyBag interface.
	 */
	peacock_file_control_add_property_bag (control, widget);

	return;
}
Esempio n. 3
0
static void
view_control_activate_cb (BonoboControl *control, gboolean activate, EMFolderView *view)
{
	BonoboUIComponent *uic;
	static int recover = 0;

	uic = bonobo_control_get_ui_component (control);
	g_return_if_fail (uic != NULL);

	if (activate) {
		Bonobo_UIContainer container;

		container = bonobo_control_get_remote_ui_container (control, NULL);
		bonobo_ui_component_set_container (uic, container, NULL);
		bonobo_object_release_unref (container, NULL);

		g_return_if_fail (container == bonobo_ui_component_get_container(uic));
		g_return_if_fail (container != CORBA_OBJECT_NIL);

		em_folder_view_activate (view, uic, activate);
		e_user_creatable_items_handler_activate(g_object_get_data((GObject *)view, "e-creatable-items-handler"), uic);
	} else {
		em_folder_view_activate (view, uic, activate);
		bonobo_ui_component_unset_container (uic, NULL);
	}

	/* This is a weird place to put it, but createControls does it too early.
	   I also think we should wait to do it until we actually visit the mailer.
	   The delay is arbitrary - without it it shows up before the main window */
	if (!recover) {
		recover = 1;
		g_timeout_add(1000, check_autosave, NULL);
	}
}
Esempio n. 4
0
void
calendar_control_activate (BonoboControl *control,
			   GnomeCalendar *gcal)
{
	Bonobo_UIContainer remote_uih;
	BonoboUIComponent *uic;
	FocusData *focus;
	gchar *xmlfile;

	uic = bonobo_control_get_ui_component (control);
	g_return_if_fail (uic != NULL);

	remote_uih = bonobo_control_get_remote_ui_container (control, NULL);
	bonobo_ui_component_set_container (uic, remote_uih, NULL);
	bonobo_object_release_unref (remote_uih, NULL);

	gnome_calendar_set_ui_component (gcal, uic);

	bonobo_ui_component_add_verb_list_with_data (uic, verbs, gcal);

	bonobo_ui_component_freeze (uic, NULL);

	xmlfile = g_build_filename (EVOLUTION_UIDIR,
				    "evolution-calendar.xml",
				    NULL);
	bonobo_ui_util_set_ui (uic, PREFIX,
			       xmlfile,
			       "evolution-calendar",
			       NULL);
	g_free (xmlfile);

	e_pixmaps_update (uic, pixmaps);

	gnome_calendar_setup_view_menus (gcal, uic);

	g_signal_connect (gcal, "calendar_focus_change",
			  G_CALLBACK (gcal_calendar_focus_change_cb), control);
	g_signal_connect (gcal, "taskpad_focus_change",
			  G_CALLBACK (gcal_taskpad_focus_change_cb), control);

	e_menu_activate((EMenu *)gnome_calendar_get_calendar_menu (gcal), uic, 1);
	e_menu_activate((EMenu *)gnome_calendar_get_taskpad_menu (gcal), uic, 1);

	calendar_control_sensitize_calendar_commands (control, gcal, TRUE);
	sensitize_taskpad_commands (gcal, control, TRUE);

	bonobo_ui_component_thaw (uic, NULL);

	focus = g_new (FocusData, 1);
	focus->calendar_focused = FALSE;
	focus->taskpad_focused = FALSE;

	g_object_set_data (G_OBJECT (control), "focus_data", focus);
}