示例#1
0
/**
 * browser_perspective_uncustomize:
 * @perspective: an object implementing the #BrowserPerspective interface
 *
 * Remove any optional custom UI elements  which have been added
 * when browser_perspective_customize() was called.
 */
void
browser_perspective_uncustomize (BrowserPerspective *perspective)
{
	g_return_if_fail (IS_BROWSER_PERSPECTIVE (perspective));

	/* Current BrowserPage */
	GtkNotebook *nb;
	nb = (GtkNotebook*) browser_perspective_get_notebook (perspective);
	if (nb) {
		gint current_index;
		current_index = gtk_notebook_get_current_page (nb);
		if (current_index >= 0) {
			GtkWidget *current_page;
			current_page = gtk_notebook_get_nth_page (nb, current_index);
			if (current_page && IS_BROWSER_PAGE (current_page))
				browser_page_uncustomize (BROWSER_PAGE (current_page));
		}
	}

	if (BROWSER_PERSPECTIVE_GET_CLASS (perspective)->i_uncustomize)
		(BROWSER_PERSPECTIVE_GET_CLASS (perspective)->i_uncustomize) (perspective);
	else {
		g_print ("Default browser_perspective_uncustomize for %s\n",
			 G_OBJECT_CLASS_NAME (G_OBJECT_GET_CLASS (perspective)));
		if (customization_data_exists (G_OBJECT (perspective)))
			customization_data_release (G_OBJECT (perspective));
	}
}
static void
schema_browser_perspective_dispose (GObject *object)
{
	SchemaBrowserPerspective *perspective;

	g_return_if_fail (object != NULL);
	g_return_if_fail (IS_SCHEMA_BROWSER_PERSPECTIVE (object));

	perspective = SCHEMA_BROWSER_PERSPECTIVE (object);
	if (perspective->priv) {
		if (customization_data_exists (object))
			customization_data_release (object);

		g_free (perspective->priv);
		perspective->priv = NULL;
	}

	/* parent class */
	parent_class->dispose (object);
}