70 lines
2.0 KiB
C
70 lines
2.0 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"
|
|
|
|
void glade_vn_batch_add_child (GladeWidgetAdaptor * adaptor,
|
|
VnBatch * group, GObject * child)
|
|
{
|
|
if (G_IS_OBJECT (child))
|
|
vn_batch_add (group, child);
|
|
}
|
|
|
|
void glade_vn_batch_remove_child (GladeWidgetAdaptor * adaptor,
|
|
VnBatch * group, GObject * child)
|
|
{
|
|
if (G_IS_OBJECT (child))
|
|
vn_batch_remove (group, child);
|
|
}
|
|
|
|
void glade_vn_batch_replace_child (GladeWidgetAdaptor * adaptor,
|
|
GObject * container, GObject * current, GObject * new)
|
|
{
|
|
VnBatch * group = VN_BATCH (container);
|
|
glade_vn_batch_remove_child (adaptor, group, current);
|
|
glade_vn_batch_add_child (adaptor, group, new);
|
|
}
|
|
|
|
GList * glade_vn_batch_get_children (GladeWidgetAdaptor * adaptor,
|
|
VnBatch * group)
|
|
{
|
|
return vn_batch_get_objects_list (group);
|
|
}
|
|
|
|
gboolean glade_vn_batch_add_verify (GladeWidgetAdaptor * adaptor,
|
|
VnBatch * container, GObject * child, gboolean user_feedback)
|
|
{
|
|
if (G_IS_OBJECT (child))
|
|
return TRUE;
|
|
|
|
if (user_feedback)
|
|
{
|
|
GladeWidgetAdaptor * object_adaptor =
|
|
glade_widget_adaptor_get_by_type (G_TYPE_OBJECT);
|
|
|
|
glade_util_ui_message (glade_app_get_window ()
|
|
,GLADE_UI_INFO
|
|
,NULL
|
|
,"Only objects of type %s can be added to objects of type %s."
|
|
,glade_widget_adaptor_get_name (object_adaptor)
|
|
,glade_widget_adaptor_get_name (adaptor)
|
|
);
|
|
}
|
|
|
|
return FALSE;
|
|
}
|