This repository has been archived on 2024-07-15. You can view files and clone it, but cannot push or open issues or pull requests.
hedera/glade/glade-vn-batch.c

70 lines
2.0 KiB
C
Raw Normal View History

2013-10-11 23:07:35 +00:00
/*
* Copyright (C) 2013 - Juan Ferrer Toribio
2013-10-11 23:07:35 +00:00
*
* 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)
{
2013-10-14 12:08:06 +00:00
return vn_batch_get_objects_list (group);
2013-10-11 23:07:35 +00:00
}
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;
}