diff options
author | Christopher James Lahey <clahey@helixcode.com> | 2001-01-25 00:56:26 +0800 |
---|---|---|
committer | Chris Lahey <clahey@src.gnome.org> | 2001-01-25 00:56:26 +0800 |
commit | 93e1f0e581a8f48c5a4596f3325d4dbba5e222cc (patch) | |
tree | 20daab3fe6f314ca19b0143e43ce9f43d47150ff | |
parent | b07b0ca2603b7952b7e6c395d0a68b1fe744a0ff (diff) | |
download | gsoc2013-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
-rw-r--r-- | widgets/menus/gal-define-views-dialog.c | 27 | ||||
-rw-r--r-- | widgets/menus/gal-define-views-model.c | 2 |
2 files changed, 17 insertions, 12 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: diff --git a/widgets/menus/gal-define-views-model.c b/widgets/menus/gal-define-views-model.c index 367ec65dc7..70e0638d18 100644 --- a/widgets/menus/gal-define-views-model.c +++ b/widgets/menus/gal-define-views-model.c @@ -155,7 +155,7 @@ gal_define_views_model_class_init (GtkObjectClass *object_class) gtk_object_add_arg_type ("GalDefineViewsModel::editable", GTK_TYPE_BOOL, GTK_ARG_READWRITE, ARG_EDITABLE); - gtk_object_add_arg_type ("GalDefineViewsModel::collection", GTK_TYPE_OBJECT, + gtk_object_add_arg_type ("GalDefineViewsModel::collection", GAL_VIEW_COLLECTION_TYPE, GTK_ARG_READWRITE, ARG_COLLECTION); model_class->column_count = gdvm_col_count; |