aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/table/e-table-field-chooser.c
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@ximian.com>2001-08-09 18:16:52 +0800
committerChris Lahey <clahey@src.gnome.org>2001-08-09 18:16:52 +0800
commitb2a270aa108a4ea3314621527c24531b54ec1b9f (patch)
treebc3661dd0915eeb8eb618ed33c49cdd478549367 /widgets/table/e-table-field-chooser.c
parentb56288e98688345222009d0c089afa1d590af6d9 (diff)
downloadgsoc2013-evolution-b2a270aa108a4ea3314621527c24531b54ec1b9f.tar.gz
gsoc2013-evolution-b2a270aa108a4ea3314621527c24531b54ec1b9f.tar.zst
gsoc2013-evolution-b2a270aa108a4ea3314621527c24531b54ec1b9f.zip
Added a "header" argument to these structures which just gets passed
2001-08-09 Christopher James Lahey <clahey@ximian.com> * e-table-field-chooser-dialog.c, e-table-field-chooser-dialog.h, e-table-field-chooser.c, e-table-field-chooser.h: Added a "header" argument to these structures which just gets passed downwards. * e-table-field-chooser-item.c, e-table-field-chooser-item.h: Added a "header" argument here. Made it so that only rows that aren't already in the header are shown. * e-table-header-item.c: Set the "header" argument on our e-table-field-chooser-dialog. Fixes Ximian bug #2654. svn path=/trunk/; revision=11828
Diffstat (limited to 'widgets/table/e-table-field-chooser.c')
-rw-r--r--widgets/table/e-table-field-chooser.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/widgets/table/e-table-field-chooser.c b/widgets/table/e-table-field-chooser.c
index 2f3562a8f3..4d5854b3cb 100644
--- a/widgets/table/e-table-field-chooser.c
+++ b/widgets/table/e-table-field-chooser.c
@@ -37,6 +37,7 @@ static GtkVBoxClass *parent_class = NULL;
enum {
ARG_0,
ARG_FULL_HEADER,
+ ARG_HEADER,
ARG_DND_CODE,
};
@@ -85,6 +86,8 @@ e_table_field_chooser_class_init (ETableFieldChooserClass *klass)
GTK_ARG_READWRITE, ARG_DND_CODE);
gtk_object_add_arg_type ("ETableFieldChooser::full_header", GTK_TYPE_OBJECT,
GTK_ARG_READWRITE, ARG_FULL_HEADER);
+ gtk_object_add_arg_type ("ETableFieldChooser::header", GTK_TYPE_OBJECT,
+ GTK_ARG_READWRITE, ARG_HEADER);
}
static void allocate_callback(GtkWidget *canvas, GtkAllocation *allocation, ETableFieldChooser *etfc)
@@ -155,6 +158,7 @@ e_table_field_chooser_init (ETableFieldChooser *etfc)
e_table_field_chooser_item_get_type(),
"width", (double) 100,
"full_header", etfc->full_header,
+ "header", etfc->header,
"dnd_code", etfc->dnd_code,
NULL );
@@ -184,6 +188,8 @@ e_table_field_chooser_destroy (GtkObject *object)
g_free(etfc->dnd_code);
if (etfc->full_header)
gtk_object_unref(GTK_OBJECT(etfc->full_header));
+ if (etfc->header)
+ gtk_object_unref(GTK_OBJECT(etfc->header));
if (etfc->gui)
gtk_object_unref(GTK_OBJECT(etfc->gui));
@@ -227,6 +233,20 @@ e_table_field_chooser_set_arg (GtkObject *object, GtkArg *arg, guint arg_id)
"full_header", etfc->full_header,
NULL);
break;
+ case ARG_HEADER:
+ if (etfc->header)
+ gtk_object_unref(GTK_OBJECT(etfc->header));
+ if (GTK_VALUE_OBJECT(*arg))
+ etfc->header = E_TABLE_HEADER(GTK_VALUE_OBJECT(*arg));
+ else
+ etfc->header = NULL;
+ if (etfc->header)
+ gtk_object_ref(GTK_OBJECT(etfc->header));
+ if (etfc->item)
+ gtk_object_set(GTK_OBJECT(etfc->item),
+ "header", etfc->header,
+ NULL);
+ break;
default:
break;
}
@@ -244,6 +264,9 @@ e_table_field_chooser_get_arg (GtkObject *object, GtkArg *arg, guint arg_id)
case ARG_FULL_HEADER:
GTK_VALUE_OBJECT (*arg) = GTK_OBJECT(etfc->full_header);
break;
+ case ARG_HEADER:
+ GTK_VALUE_OBJECT (*arg) = GTK_OBJECT(etfc->header);
+ break;
default:
arg->type = GTK_TYPE_INVALID;
break;