73 lines
1.8 KiB
C
73 lines
1.8 KiB
C
/*
|
|
* Copyright (C) 2012 - Juan Ferrer Toribio
|
|
*
|
|
* This program is free software: you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
|
|
#include "glade-vn.h"
|
|
|
|
GObject * glade_vn_field_get_internal_child (GladeWidgetAdaptor * adaptor,
|
|
GObject * parent, const gchar * name)
|
|
{
|
|
return G_OBJECT (vn_field_get_widget (VN_FIELD (parent)));
|
|
}
|
|
|
|
GObject * glade_vn_column_get_internal_child (GladeWidgetAdaptor * adaptor,
|
|
GObject * parent, const gchar * name)
|
|
{
|
|
return G_OBJECT (vn_column_get_cell_renderer (VN_COLUMN (parent)));
|
|
}
|
|
|
|
gboolean glade_vn_set_first_catalog (gpointer catalog_name)
|
|
{
|
|
GList * l, * catalogs = glade_app_get_catalogs (),
|
|
* clone = NULL;
|
|
GladeCatalog * catalog = NULL;
|
|
|
|
for (l = catalogs; l; l = l->next)
|
|
if (!g_strcmp0 (catalog_name, glade_catalog_get_name (l->data)))
|
|
catalog = l->data;
|
|
else
|
|
clone = g_list_prepend (clone, l->data);
|
|
|
|
if (catalog)
|
|
{
|
|
GList * trash = catalogs->next;
|
|
catalogs->data = catalog;
|
|
clone = g_list_reverse (clone);
|
|
catalogs->next = clone;
|
|
|
|
if (clone)
|
|
clone->prev = catalogs;
|
|
|
|
if (trash)
|
|
{
|
|
trash->prev = NULL;
|
|
g_list_free (trash);
|
|
}
|
|
|
|
return G_SOURCE_REMOVE;
|
|
}
|
|
|
|
g_list_free (clone);
|
|
return G_SOURCE_CONTINUE;
|
|
}
|
|
|
|
void glade_vn_init ()
|
|
{
|
|
g_message ("Hedera objects loaded!");
|
|
|
|
g_idle_add (glade_vn_set_first_catalog, "vn");
|
|
}
|