aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/menus/gal-define-views-dialog.c
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@helixcode.com>2001-01-25 00:56:26 +0800
committerChris Lahey <clahey@src.gnome.org>2001-01-25 00:56:26 +0800
commit93e1f0e581a8f48c5a4596f3325d4dbba5e222cc (patch)
tree20daab3fe6f314ca19b0143e43ce9f43d47150ff /widgets/menus/gal-define-views-dialog.c
parentb07b0ca2603b7952b7e6c395d0a68b1fe744a0ff (diff)
downloadgsoc2013-evolution-93e1f0e581a8f48c5a4596f3325d4dbba5e222cc.tar
gsoc2013-evolution-93e1f0e581a8f48c5a4596f3325d4dbba5e222cc.tar.gz
gsoc2013-evolution-93e1f0e581a8f48c5a4596f3325d4dbba5e222cc.tar.bz2
gsoc2013-evolution-93e1f0e581a8f48c5a4596f3325d4dbba5e222cc.tar.lz
gsoc2013-evolution-93e1f0e581a8f48c5a4596f3325d4dbba5e222cc.tar.xz
gsoc2013-evolution-93e1f0e581a8f48c5a4596f3325d4dbba5e222cc.tar.zst
gsoc2013-evolution-93e1f0e581a8f48c5a4596f3325d4dbba5e222cc.zip
Have the argument system do type checking on our "collection" argument.
2001-01-24 Christopher James Lahey <clahey@helixcode.com> * gal-define-views-dialog.c (gal_define_views_dialog_class_init): Have the argument system do type checking on our "collection" argument. Refactored the setting of the "collection" argument into a set_argument function. * gal-define-views-model.c (gal_define_views_model_class_init): Have the argument system do type checking on our "collection" argument. svn path=/trunk/; revision=7783
Diffstat (limited to 'widgets/menus/gal-define-views-dialog.c')
-rw-r--r--widgets/menus/gal-define-views-dialog.c27
1 files changed, 16 insertions, 11 deletions
diff --git a/widgets/menus/gal-define-views-dialog.c b/widgets/menus/gal-define-views-dialog.c
index 2c45b25a57..427eaa7d76 100644
--- a/widgets/menus/gal-define-views-dialog.c
+++ b/widgets/menus/gal-define-views-dialog.c
@@ -84,7 +84,7 @@ gal_define_views_dialog_class_init (GalDefineViewsDialogClass *klass)
object_class->get_arg = gal_define_views_dialog_get_arg;
object_class->destroy = gal_define_views_dialog_destroy;
- gtk_object_add_arg_type("GalDefineViewsDialog::collection", GTK_TYPE_OBJECT,
+ gtk_object_add_arg_type("GalDefineViewsDialog::collection", GAL_VIEW_COLLECTION_TYPE,
GTK_ARG_READWRITE, ARG_COLLECTION);
}
@@ -259,6 +259,18 @@ gal_define_views_dialog_destroy (GtkObject *object) {
gtk_object_unref(GTK_OBJECT(gal_define_views_dialog->gui));
}
+static void
+gal_define_views_dialog_set_collection(GalDefineViewsDialog *dialog,
+ GalViewCollection *collection)
+{
+ dialog->collection = collection;
+ if (dialog->model) {
+ gtk_object_set(GTK_OBJECT(dialog->model),
+ "collection", collection,
+ NULL);
+ }
+}
+
/**
* gal_define_views_dialog_new
*
@@ -270,9 +282,7 @@ GtkWidget*
gal_define_views_dialog_new (GalViewCollection *collection)
{
GtkWidget *widget = GTK_WIDGET (gtk_type_new (gal_define_views_dialog_get_type ()));
- gtk_object_set(GTK_OBJECT(widget),
- "collection", collection,
- NULL);
+ gal_define_views_dialog_set_collection(GAL_DEFINE_VIEWS_DIALOG (widget), collection);
return widget;
}
@@ -286,14 +296,9 @@ gal_define_views_dialog_set_arg (GtkObject *o, GtkArg *arg, guint arg_id)
switch (arg_id){
case ARG_COLLECTION:
if (GTK_VALUE_OBJECT(*arg))
- dialog->collection = GAL_VIEW_COLLECTION(GTK_VALUE_OBJECT(*arg));
+ gal_define_views_dialog_set_collection(dialog, GAL_VIEW_COLLECTION(GTK_VALUE_OBJECT(*arg)));
else
- dialog->collection = NULL;
- if (dialog->model) {
- gtk_object_set(GTK_OBJECT(dialog->model),
- "collection", GTK_VALUE_OBJECT(*arg),
- NULL);
- }
+ gal_define_views_dialog_set_collection(dialog, NULL);
break;
default: