From 6c2f176cb6c541672e8af5f4d32e34951b866c6c Mon Sep 17 00:00:00 2001 From: Chris Toshok Date: Wed, 13 Nov 2002 23:34:40 +0000 Subject: more porting work. 2002-11-13 Chris Toshok * gal-define-views-dialog.[ch]: more porting work. * gal-define-views-model.[ch]: same. * gal-view-etable.c: same. * gal-view-factory-etable.c: same. * gal-view-instance-save-as-dialog.[ch]: same. * gal-view-instance.c: same. * gal-view-new-dialog.[ch]: same. * gal-define-views.glade: convert to glade2. * gal-view-instance-save-as-dialog.glade: same. * gal-view-new-dialog.glade: same. svn path=/trunk/; revision=18749 --- widgets/menus/gal-define-views-dialog.c | 165 +++--- widgets/menus/gal-define-views-dialog.h | 18 +- widgets/menus/gal-define-views-model.c | 115 ++--- widgets/menus/gal-define-views-model.h | 10 +- widgets/menus/gal-define-views.glade | 556 ++++++++++----------- widgets/menus/gal-view-etable.c | 2 +- widgets/menus/gal-view-factory-etable.c | 2 +- widgets/menus/gal-view-instance-save-as-dialog.c | 126 ++--- .../menus/gal-view-instance-save-as-dialog.glade | 508 +++++++++---------- widgets/menus/gal-view-instance-save-as-dialog.h | 16 +- widgets/menus/gal-view-instance.c | 9 +- widgets/menus/gal-view-new-dialog.c | 134 +++-- widgets/menus/gal-view-new-dialog.glade | 391 +++++++-------- widgets/menus/gal-view-new-dialog.h | 17 +- 14 files changed, 971 insertions(+), 1098 deletions(-) (limited to 'widgets') diff --git a/widgets/menus/gal-define-views-dialog.c b/widgets/menus/gal-define-views-dialog.c index 5eb08aac4b..5a996726fc 100644 --- a/widgets/menus/gal-define-views-dialog.c +++ b/widgets/menus/gal-define-views-dialog.c @@ -25,27 +25,26 @@ #include "gal-define-views-dialog.h" -#include -#include #include #include "gal-define-views-model.h" #include "gal-view-new-dialog.h" #include #include +#include -static void gal_define_views_dialog_init (GalDefineViewsDialog *card); -static void gal_define_views_dialog_class_init (GalDefineViewsDialogClass *klass); -static void gal_define_views_dialog_set_arg (GtkObject *o, GtkArg *arg, guint arg_id); -static void gal_define_views_dialog_get_arg (GtkObject *object, GtkArg *arg, guint arg_id); -static void gal_define_views_dialog_destroy (GtkObject *object); +static void gal_define_views_dialog_init (GalDefineViewsDialog *card); +static void gal_define_views_dialog_class_init (GalDefineViewsDialogClass *klass); +static void gal_define_views_dialog_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); +static void gal_define_views_dialog_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); +static void gal_define_views_dialog_dispose (GObject *object); -static GnomeDialogClass *parent_class = NULL; -#define PARENT_TYPE gnome_dialog_get_type() +static GtkDialogClass *parent_class = NULL; +#define PARENT_TYPE GTK_TYPE_DIALOG -/* The arguments we take */ +/* The properties we support */ enum { - ARG_0, - ARG_COLLECTION + PROP_0, + PROP_COLLECTION }; typedef struct { @@ -54,45 +53,28 @@ typedef struct { GalDefineViewsDialog *names; } GalDefineViewsDialogChild; -GtkType -gal_define_views_dialog_get_type (void) -{ - static GtkType type = 0; - - if (!type) { - static const GtkTypeInfo info = - { - "GalDefineViewsDialog", - sizeof (GalDefineViewsDialog), - sizeof (GalDefineViewsDialogClass), - (GtkClassInitFunc) gal_define_views_dialog_class_init, - (GtkObjectInitFunc) gal_define_views_dialog_init, - /* reserved_1 */ NULL, - /* reserved_2 */ NULL, - (GtkClassInitFunc) NULL, - }; - - type = gtk_type_unique (PARENT_TYPE, &info); - } - return type; -} +E_MAKE_TYPE(gal_define_views_dialog, "GalDefineViewsDialog", GalDefineViewsDialog, gal_define_views_dialog_class_init, gal_define_views_dialog_init, PARENT_TYPE) static void gal_define_views_dialog_class_init (GalDefineViewsDialogClass *klass) { - GtkObjectClass *object_class; + GObjectClass *object_class; - object_class = (GtkObjectClass*) klass; + object_class = (GObjectClass*) klass; - parent_class = gtk_type_class (PARENT_TYPE); + parent_class = g_type_class_ref (PARENT_TYPE); - object_class->set_arg = gal_define_views_dialog_set_arg; - object_class->get_arg = gal_define_views_dialog_get_arg; - object_class->destroy = gal_define_views_dialog_destroy; + object_class->set_property = gal_define_views_dialog_set_property; + object_class->get_property = gal_define_views_dialog_get_property; + object_class->dispose = gal_define_views_dialog_dispose; - gtk_object_add_arg_type("GalDefineViewsDialog::collection", GAL_VIEW_COLLECTION_TYPE, - GTK_ARG_READWRITE, ARG_COLLECTION); + g_object_class_install_property (object_class, PROP_COLLECTION, + g_param_spec_object ("collection", + _("Collection"), + /*_( */"XXX blurb" /*)*/, + GAL_VIEW_COLLECTION_TYPE, + G_PARAM_READWRITE)); } /* ETable creation */ @@ -111,43 +93,43 @@ gal_define_views_dialog_create_etable(char *name, char *string1, char *string2, ETableModel *model; model = gal_define_views_model_new(); table = e_table_scrolled_new(model, NULL, SPEC, NULL); - gtk_object_set_data(GTK_OBJECT(table), "GalDefineViewsDialog::model", model); + g_object_set_data(G_OBJECT (table), "GalDefineViewsDialog::model", model); return table; } /* Button callbacks */ static void -gdvd_button_new_dialog_callback(GtkWidget *widget, int button, GalDefineViewsDialog *dialog) +gdvd_button_new_dialog_callback(GtkWidget *widget, int id, GalDefineViewsDialog *dialog) { gchar *name; GalView *view; GalViewFactory *factory; - switch (button) { - case 0: - gtk_object_get(GTK_OBJECT(widget), - "name", &name, - "factory", &factory, - NULL); + switch (id) { + case GTK_RESPONSE_OK: + g_object_get(widget, + "name", &name, + "factory", &factory, + NULL); if (name && factory) { view = gal_view_factory_new_view(factory, name); gal_define_views_model_append(GAL_DEFINE_VIEWS_MODEL(dialog->model), view); gal_view_edit(view); - gtk_object_unref(GTK_OBJECT(view)); + g_object_unref(view); } break; } - gnome_dialog_close(GNOME_DIALOG(widget)); + gtk_widget_destroy (widget); } static void gdvd_button_new_callback(GtkWidget *widget, GalDefineViewsDialog *dialog) { GtkWidget *view_new_dialog = gal_view_new_dialog_new(dialog->collection); - gtk_signal_connect(GTK_OBJECT(view_new_dialog), "clicked", - GTK_SIGNAL_FUNC(gdvd_button_new_dialog_callback), dialog); - gtk_widget_show(GTK_WIDGET(view_new_dialog)); + g_signal_connect(view_new_dialog, "response", + G_CALLBACK(gdvd_button_new_dialog_callback), dialog); + gtk_widget_show(view_new_dialog); } static void @@ -207,14 +189,14 @@ gdvd_button_copy_callback(GtkWidget *widget, GalDefineViewsDialog *dialog) } static void -gdvd_connect_signal(GalDefineViewsDialog *dialog, char *widget_name, char *signal, GtkSignalFunc handler) +gdvd_connect_signal(GalDefineViewsDialog *dialog, char *widget_name, char *signal, GCallback handler) { GtkWidget *widget; widget = glade_xml_get_widget(dialog->gui, widget_name); if (widget) - gtk_signal_connect(GTK_OBJECT(widget), signal, handler, dialog); + g_signal_connect(widget, signal, handler, dialog); } static void @@ -235,42 +217,42 @@ gal_define_views_dialog_init (GalDefineViewsDialog *dialog) } gtk_widget_ref(widget); gtk_widget_unparent(widget); - gtk_box_pack_start(GTK_BOX(GNOME_DIALOG(dialog)->vbox), widget, TRUE, TRUE, 0); + gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), widget, TRUE, TRUE, 0); gtk_widget_unref(widget); - gnome_dialog_append_buttons(GNOME_DIALOG(dialog), - GTK_STOCK_OK, - GTK_STOCK_CANCEL, - NULL); + gtk_dialog_add_buttons (GTK_DIALOG (dialog), + GTK_STOCK_OK, GTK_RESPONSE_OK, + GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, + NULL); - gdvd_connect_signal(dialog, "button-new", "clicked", GTK_SIGNAL_FUNC(gdvd_button_new_callback)); - gdvd_connect_signal(dialog, "button-modify", "clicked", GTK_SIGNAL_FUNC(gdvd_button_modify_callback)); - gdvd_connect_signal(dialog, "button-delete", "clicked", GTK_SIGNAL_FUNC(gdvd_button_delete_callback)); - gdvd_connect_signal(dialog, "button-copy", "clicked", GTK_SIGNAL_FUNC(gdvd_button_copy_callback)); + gdvd_connect_signal(dialog, "button-new", "clicked", G_CALLBACK(gdvd_button_new_callback)); + gdvd_connect_signal(dialog, "button-modify", "clicked", G_CALLBACK(gdvd_button_modify_callback)); + gdvd_connect_signal(dialog, "button-delete", "clicked", G_CALLBACK(gdvd_button_delete_callback)); + gdvd_connect_signal(dialog, "button-copy", "clicked", G_CALLBACK(gdvd_button_copy_callback)); dialog->model = NULL; etable = glade_xml_get_widget(dialog->gui, "custom-table"); if (etable) { - dialog->model = gtk_object_get_data(GTK_OBJECT(etable), "GalDefineViewsDialog::model"); - gtk_object_set(GTK_OBJECT(dialog->model), - "collection", dialog->collection, - NULL); + dialog->model = g_object_get_data(G_OBJECT (etable), "GalDefineViewsDialog::model"); + g_object_set(dialog->model, + "collection", dialog->collection, + NULL); } gtk_window_set_policy(GTK_WINDOW(dialog), FALSE, TRUE, FALSE); } static void -gal_define_views_dialog_destroy (GtkObject *object) +gal_define_views_dialog_dispose (GObject *object) { GalDefineViewsDialog *gal_define_views_dialog = GAL_DEFINE_VIEWS_DIALOG(object); if (gal_define_views_dialog->gui) - gtk_object_unref(GTK_OBJECT(gal_define_views_dialog->gui)); + g_object_unref(gal_define_views_dialog->gui); gal_define_views_dialog->gui = NULL; - if (GTK_OBJECT_CLASS (parent_class)->destroy) - (* GTK_OBJECT_CLASS (parent_class)->destroy) (object); + if (G_OBJECT_CLASS (parent_class)->dispose) + (* G_OBJECT_CLASS (parent_class)->dispose) (object); } static void @@ -279,9 +261,9 @@ gal_define_views_dialog_set_collection(GalDefineViewsDialog *dialog, { dialog->collection = collection; if (dialog->model) { - gtk_object_set(GTK_OBJECT(dialog->model), - "collection", collection, - NULL); + g_object_set(dialog->model, + "collection", collection, + NULL); } if (dialog->gui) { GtkWidget *widget = glade_xml_get_widget(dialog->gui, "label-views"); @@ -310,48 +292,45 @@ gal_define_views_dialog_set_collection(GalDefineViewsDialog *dialog, GtkWidget* gal_define_views_dialog_new (GalViewCollection *collection) { - GtkWidget *widget = GTK_WIDGET (gtk_type_new (gal_define_views_dialog_get_type ())); + GtkWidget *widget = g_object_new (GAL_DEFINE_VIEWS_DIALOG_TYPE, NULL); gal_define_views_dialog_set_collection(GAL_DEFINE_VIEWS_DIALOG (widget), collection); return widget; } static void -gal_define_views_dialog_set_arg (GtkObject *o, GtkArg *arg, guint arg_id) +gal_define_views_dialog_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { GalDefineViewsDialog *dialog; - dialog = GAL_DEFINE_VIEWS_DIALOG (o); + dialog = GAL_DEFINE_VIEWS_DIALOG (object); - switch (arg_id){ - case ARG_COLLECTION: - if (GTK_VALUE_OBJECT(*arg)) - gal_define_views_dialog_set_collection(dialog, GAL_VIEW_COLLECTION(GTK_VALUE_OBJECT(*arg))); + switch (prop_id){ + case PROP_COLLECTION: + if (g_value_get_object (value)) + gal_define_views_dialog_set_collection(dialog, GAL_VIEW_COLLECTION(g_value_get_object (value))); else gal_define_views_dialog_set_collection(dialog, NULL); break; default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); return; } } static void -gal_define_views_dialog_get_arg (GtkObject *object, GtkArg *arg, guint arg_id) +gal_define_views_dialog_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { GalDefineViewsDialog *dialog; dialog = GAL_DEFINE_VIEWS_DIALOG (object); - switch (arg_id) { - case ARG_COLLECTION: - if (dialog->collection) - GTK_VALUE_OBJECT(*arg) = GTK_OBJECT(dialog->collection); - else - GTK_VALUE_OBJECT(*arg) = NULL; - break; + switch (prop_id) { + case PROP_COLLECTION: + g_value_set_object (value, dialog->collection); default: - arg->type = GTK_TYPE_INVALID; + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } diff --git a/widgets/menus/gal-define-views-dialog.h b/widgets/menus/gal-define-views-dialog.h index edd40ed7c5..03a047b9fe 100644 --- a/widgets/menus/gal-define-views-dialog.h +++ b/widgets/menus/gal-define-views-dialog.h @@ -24,7 +24,7 @@ #ifndef __GAL_DEFINE_VIEWS_DIALOG_H__ #define __GAL_DEFINE_VIEWS_DIALOG_H__ -#include +#include #include #include #include @@ -42,18 +42,18 @@ extern "C" { * -------------------------------------------------------------------------------- */ -#define GAL_DEFINE_VIEWS_DIALOG_TYPE (gal_define_views_dialog_get_type ()) -#define GAL_DEFINE_VIEWS_DIALOG(obj) (GTK_CHECK_CAST ((obj), GAL_DEFINE_VIEWS_DIALOG_TYPE, GalDefineViewsDialog)) -#define GAL_DEFINE_VIEWS_DIALOG_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GAL_DEFINE_VIEWS_DIALOG_TYPE, GalDefineViewsDialogClass)) -#define GAL_IS_DEFINE_VIEWS_DIALOG(obj) (GTK_CHECK_TYPE ((obj), GAL_DEFINE_VIEWS_DIALOG_TYPE)) -#define GAL_IS_DEFINE_VIEWS_DIALOG_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), GAL_DEFINE_VIEWS_DIALOG_TYPE)) +#define GAL_DEFINE_VIEWS_DIALOG_TYPE (gal_define_views_dialog_get_type ()) +#define GAL_DEFINE_VIEWS_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAL_DEFINE_VIEWS_DIALOG_TYPE, GalDefineViewsDialog)) +#define GAL_DEFINE_VIEWS_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAL_DEFINE_VIEWS_DIALOG_TYPE, GalDefineViewsDialogClass)) +#define GAL_IS_DEFINE_VIEWS_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAL_DEFINE_VIEWS_DIALOG_TYPE)) +#define GAL_IS_DEFINE_VIEWS_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), GAL_DEFINE_VIEWS_DIALOG_TYPE)) typedef struct _GalDefineViewsDialog GalDefineViewsDialog; typedef struct _GalDefineViewsDialogClass GalDefineViewsDialogClass; struct _GalDefineViewsDialog { - GnomeDialog parent; + GtkDialog parent; /* item specific fields */ GladeXML *gui; @@ -64,11 +64,11 @@ struct _GalDefineViewsDialog struct _GalDefineViewsDialogClass { - GnomeDialogClass parent_class; + GtkDialogClass parent_class; }; GtkWidget *gal_define_views_dialog_new (GalViewCollection *collection); -GtkType gal_define_views_dialog_get_type (void); +GType gal_define_views_dialog_get_type (void); #ifdef __cplusplus } diff --git a/widgets/menus/gal-define-views-model.c b/widgets/menus/gal-define-views-model.c index eb41f3b84a..40e54a53b6 100644 --- a/widgets/menus/gal-define-views-model.c +++ b/widgets/menus/gal-define-views-model.c @@ -26,35 +26,36 @@ #include #include #include "gal-define-views-model.h" +#include +#include -#define PARENT_TYPE e_table_model_get_type() +#define PARENT_TYPE E_TABLE_MODEL_TYPE static ETableModelClass *parent_class; /* * GalDefineViewsModel callbacks * These are the callbacks that define the behavior of our custom model. */ -static void gal_define_views_model_set_arg (GtkObject *o, GtkArg *arg, guint arg_id); -static void gal_define_views_model_get_arg (GtkObject *object, GtkArg *arg, guint arg_id); - +static void gal_define_views_model_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); +static void gal_define_views_model_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); enum { - ARG_0, - ARG_EDITABLE, - ARG_COLLECTION + PROP_0, + PROP_EDITABLE, + PROP_COLLECTION }; static void -gdvm_destroy(GtkObject *object) +gdvm_dispose(GObject *object) { GalDefineViewsModel *model = GAL_DEFINE_VIEWS_MODEL(object); if (model->collection) - gtk_object_unref(GTK_OBJECT(model->collection)); + g_object_unref(model->collection); model->collection = NULL; - if (GTK_OBJECT_CLASS (parent_class)->destroy) - (* GTK_OBJECT_CLASS (parent_class)->destroy) (object); + if (G_OBJECT_CLASS (parent_class)->dispose) + (* G_OBJECT_CLASS (parent_class)->dispose) (object); } /* This function returns the number of columns in our ETableModel. */ @@ -162,20 +163,29 @@ gal_define_views_model_append (GalDefineViewsModel *model, } static void -gal_define_views_model_class_init (GtkObjectClass *object_class) +gal_define_views_model_class_init (GObjectClass *object_class) { ETableModelClass *model_class = (ETableModelClass *) object_class; - parent_class = gtk_type_class (PARENT_TYPE); + parent_class = g_type_class_ref (PARENT_TYPE); + + object_class->dispose = gdvm_dispose; + object_class->set_property = gal_define_views_model_set_property; + object_class->get_property = gal_define_views_model_get_property; - object_class->destroy = gdvm_destroy; - object_class->set_arg = gal_define_views_model_set_arg; - object_class->get_arg = gal_define_views_model_get_arg; + g_object_class_install_property (object_class, PROP_EDITABLE, + g_param_spec_boolean ("editable", + _("Editable"), + /*_( */"XXX blurb" /*)*/, + FALSE, + G_PARAM_READWRITE)); - gtk_object_add_arg_type ("GalDefineViewsModel::editable", GTK_TYPE_BOOL, - GTK_ARG_READWRITE, ARG_EDITABLE); - gtk_object_add_arg_type ("GalDefineViewsModel::collection", GAL_VIEW_COLLECTION_TYPE, - GTK_ARG_READWRITE, ARG_COLLECTION); + g_object_class_install_property (object_class, PROP_COLLECTION, + g_param_spec_object ("collection", + _("Collection"), + /*_( */"XXX blurb" /*)*/, + GAL_VIEW_COLLECTION_TYPE, + G_PARAM_READWRITE)); model_class->column_count = gdvm_col_count; model_class->row_count = gdvm_row_count; @@ -191,7 +201,7 @@ gal_define_views_model_class_init (GtkObjectClass *object_class) } static void -gal_define_views_model_init (GtkObject *object) +gal_define_views_model_init (GObject *object) { GalDefineViewsModel *model = GAL_DEFINE_VIEWS_MODEL(object); @@ -199,75 +209,50 @@ gal_define_views_model_init (GtkObject *object) } static void -gal_define_views_model_set_arg (GtkObject *o, GtkArg *arg, guint arg_id) +gal_define_views_model_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { GalDefineViewsModel *model; - model = GAL_DEFINE_VIEWS_MODEL (o); + model = GAL_DEFINE_VIEWS_MODEL (object); - switch (arg_id){ - case ARG_EDITABLE: - model->editable = GTK_VALUE_BOOL (*arg); + switch (prop_id){ + case PROP_EDITABLE: + model->editable = g_value_get_boolean (value); break; - case ARG_COLLECTION: - e_table_model_pre_change(E_TABLE_MODEL(o)); - if (GTK_VALUE_OBJECT (*arg)) - model->collection = GAL_VIEW_COLLECTION(GTK_VALUE_OBJECT (*arg)); + case PROP_COLLECTION: + e_table_model_pre_change(E_TABLE_MODEL(object)); + if (g_value_get_object (value)) + model->collection = GAL_VIEW_COLLECTION(g_value_get_object (value)); else model->collection = NULL; - e_table_model_changed(E_TABLE_MODEL(o)); + e_table_model_changed(E_TABLE_MODEL(object)); break; } } static void -gal_define_views_model_get_arg (GtkObject *object, GtkArg *arg, guint arg_id) +gal_define_views_model_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { GalDefineViewsModel *model; model = GAL_DEFINE_VIEWS_MODEL (object); - switch (arg_id) { - case ARG_EDITABLE: - GTK_VALUE_BOOL (*arg) = model->editable; + switch (prop_id) { + case PROP_EDITABLE: + g_value_set_boolean (value, model->editable); break; - case ARG_COLLECTION: - if (model->collection) - GTK_VALUE_OBJECT (*arg) = GTK_OBJECT(model->collection); - else - GTK_VALUE_OBJECT (*arg) = NULL; - break; + case PROP_COLLECTION: + g_value_set_object (value, model->collection); default: - arg->type = GTK_TYPE_INVALID; + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } -GtkType -gal_define_views_model_get_type (void) -{ - static GtkType type = 0; - - if (!type){ - GtkTypeInfo info = { - "GalDefineViewsModel", - sizeof (GalDefineViewsModel), - sizeof (GalDefineViewsModelClass), - (GtkClassInitFunc) gal_define_views_model_class_init, - (GtkObjectInitFunc) gal_define_views_model_init, - NULL, /* reserved 1 */ - NULL, /* reserved 2 */ - (GtkClassInitFunc) NULL - }; - - type = gtk_type_unique (PARENT_TYPE, &info); - } - - return type; -} +E_MAKE_TYPE(gal_define_views_model, "GalDefineViewsModel", GalDefineViewsModel, gal_define_views_model_class_init, gal_define_views_model_init, PARENT_TYPE) /** * gal_define_views_model_new @@ -282,7 +267,7 @@ gal_define_views_model_new (void) { GalDefineViewsModel *et; - et = gtk_type_new (gal_define_views_model_get_type ()); + et = g_object_new (GAL_DEFINE_VIEWS_MODEL_TYPE, NULL); return E_TABLE_MODEL(et); } diff --git a/widgets/menus/gal-define-views-model.h b/widgets/menus/gal-define-views-model.h index 2724216985..6ea2b28cbc 100644 --- a/widgets/menus/gal-define-views-model.h +++ b/widgets/menus/gal-define-views-model.h @@ -33,10 +33,10 @@ extern "C" { #endif /* __cplusplus */ #define GAL_DEFINE_VIEWS_MODEL_TYPE (gal_define_views_model_get_type ()) -#define GAL_DEFINE_VIEWS_MODEL(o) (GTK_CHECK_CAST ((o), GAL_DEFINE_VIEWS_MODEL_TYPE, GalDefineViewsModel)) -#define GAL_DEFINE_VIEWS_MODEL_CLASS(k) (GTK_CHECK_CLASS_CAST((k), GAL_DEFINE_VIEWS_MODEL_TYPE, GalDefineViewsModelClass)) -#define GAL_IS_DEFINE_VIEWS_MODEL(o) (GTK_CHECK_TYPE ((o), GAL_DEFINE_VIEWS_MODEL_TYPE)) -#define GAL_IS_DEFINE_VIEWS_MODEL_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), GAL_DEFINE_VIEWS_MODEL_TYPE)) +#define GAL_DEFINE_VIEWS_MODEL(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GAL_DEFINE_VIEWS_MODEL_TYPE, GalDefineViewsModel)) +#define GAL_DEFINE_VIEWS_MODEL_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GAL_DEFINE_VIEWS_MODEL_TYPE, GalDefineViewsModelClass)) +#define GAL_IS_DEFINE_VIEWS_MODEL(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GAL_DEFINE_VIEWS_MODEL_TYPE)) +#define GAL_IS_DEFINE_VIEWS_MODEL_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GAL_DEFINE_VIEWS_MODEL_TYPE)) typedef struct { ETableModel parent; @@ -53,7 +53,7 @@ typedef struct { } GalDefineViewsModelClass; -GtkType gal_define_views_model_get_type (void); +GType gal_define_views_model_get_type (void); ETableModel *gal_define_views_model_new (void); void gal_define_views_model_append (GalDefineViewsModel *model, diff --git a/widgets/menus/gal-define-views.glade b/widgets/menus/gal-define-views.glade index 72eac5764b..ce5ea5a928 100644 --- a/widgets/menus/gal-define-views.glade +++ b/widgets/menus/gal-define-views.glade @@ -1,311 +1,287 @@ - - + + - - gal-define-views - gal-define-views - - src - pixmaps - C - True - True - True - False - False - False - True - + + + no + Define Views for "%s" + GTK_WINDOW_TOPLEVEL + no + no + yes + GTK_WIN_POS_NONE - - GnomeDialog - dialog1 - False - Define Views for "%s" - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - False - True - False - False - False + + + no + 8 + yes - - GtkVBox - GnomeDialog:vbox - dialog-vbox1 - False - 8 - - 4 - True - True - + + + GTK_BUTTONBOX_END + 8 + yes - - GtkHButtonBox - GnomeDialog:action_area - dialog-action_area1 - GTK_BUTTONBOX_END - 8 - 85 - 27 - 7 - 0 - - 0 - False - True - GTK_PACK_END - + + + yes + yes + yes + gtk-ok + yes + yes + + - - GtkButton - button1 - True - True - GNOME_STOCK_BUTTON_OK - + + + yes + yes + yes + gtk-cancel + yes + yes + + + + + 0 + no + yes + GTK_PACK_END + + - - GtkButton - button7 - True - True - GNOME_STOCK_BUTTON_CANCEL - - + + + no + 6 + 6 + 5 + 1 + yes - - GtkTable - table-top - 5 - 1 - False - 6 - 6 - - 0 - True - True - + + + Description + 0 + GTK_SHADOW_ETCHED_IN + yes - - GtkFrame - frame1 - - 0 - GTK_SHADOW_ETCHED_IN - - 0 - 1 - 3 - 4 - 0 - 0 - False - False - False - False - True - True - - - - GtkTable - table-description - 6 - 1 - 2 - False - 6 - 6 - - + + + 6 + no + 6 + 6 + 1 + 2 + yes + + + + + 0 + 1 + 3 + 4 + 0 + 0 + fill + fill + + - - GtkHBox - hbox1 - False - 6 - - 0 - 1 - 1 - 2 - 0 - 0 - True - True - False - False - True - True - + + + no + 6 + yes - - Custom - custom-table - gal_define_views_dialog_create_etable - 0 - 0 - Fri, 10 Nov 2000 16:37:39 GMT - - 0 - True - True - - + + + gal_define_views_dialog_create_etable + 0 + 0 + Fri, 10 Nov 2000 16:37:39 GMT + yes + + + 0 + yes + yes + + - - GtkVBox - vbox1 - False - 6 - - 0 - False - False - + + + no + 6 + yes - - GtkButton - button-new - True - - GTK_RELIEF_NORMAL - - 0 - False - False - - + + + yes + _New... + GTK_RELIEF_NORMAL + yes + yes + + + 0 + no + no + + - - GtkButton - button-copy - True - - GTK_RELIEF_NORMAL - - 0 - False - False - - + + + yes + _Copy... + GTK_RELIEF_NORMAL + yes + yes + + + 0 + no + no + + - - GtkButton - button-modify - True - - GTK_RELIEF_NORMAL - - 0 - False - False - - + + + yes + _Edit... + GTK_RELIEF_NORMAL + yes + yes + + + 0 + no + no + + - - GtkButton - button-delete - True - - GTK_RELIEF_NORMAL - - 0 - False - False - - - - + + + yes + _Delete... + GTK_RELIEF_NORMAL + yes + yes + + + 0 + no + no + + + + + 0 + no + no + + + + + 0 + 1 + 1 + 2 + 0 + 0 + expand|fill + expand|fill + + - - GtkHButtonBox - hbuttonbox1 - GTK_BUTTONBOX_END - 6 - 85 - 27 - 7 - 0 - - 0 - 1 - 4 - 5 - 0 - 0 - False - False - False - False - True - True - - + + + GTK_BUTTONBOX_END + 6 + yes + + + 0 + 1 + 4 + 5 + 0 + 0 + fill + fill + + - - GtkAlignment - alignment3 - 0 - 0.5 - 0 - 1 - - 0 - 1 - 2 - 3 - 0 - 0 - False - False - False - False - True - True - + + + 0 + 0.5 + 0 + 1 + yes - - GtkButton - button-reset - True - - GTK_RELIEF_NORMAL - - + + + yes + Re_set to Factory Defaults... + GTK_RELIEF_NORMAL + yes + yes + + + + + 0 + 1 + 2 + 3 + 0 + 0 + fill + fill + + - - GtkLabel - label-views - - GTK_JUSTIFY_LEFT - False - 0 - 0.5 - 0 - 0 - - 0 - 1 - 0 - 1 - 0 - 0 - False - False - False - False - True - False - + + + Define Views for %s + GTK_JUSTIFY_LEFT + no + 0 + 0.5 + 0 + 0 + yes + + + 0 + 1 + 0 + 1 + 0 + 0 + fill + + + + + + 0 + yes + yes + + - + + 4 + yes + yes + + - - - + diff --git a/widgets/menus/gal-view-etable.c b/widgets/menus/gal-view-etable.c index f12f6d7d66..c69a624de5 100644 --- a/widgets/menus/gal-view-etable.c +++ b/widgets/menus/gal-view-etable.c @@ -25,7 +25,7 @@ #include "gal-view-etable.h" #include -#define PARENT_TYPE gal_view_get_type () +#define PARENT_TYPE GAL_VIEW_TYPE static GalViewClass *gal_view_etable_parent_class; diff --git a/widgets/menus/gal-view-factory-etable.c b/widgets/menus/gal-view-factory-etable.c index 46a7eb2e79..c0d68fe006 100644 --- a/widgets/menus/gal-view-factory-etable.c +++ b/widgets/menus/gal-view-factory-etable.c @@ -27,7 +27,7 @@ #include "gal-view-factory-etable.h" #include "gal-view-etable.h" -#define PARENT_TYPE gal_view_factory_get_type () +#define PARENT_TYPE GAL_VIEW_FACTORY_TYPE static GalViewFactoryClass *gal_view_factory_etable_parent_class; diff --git a/widgets/menus/gal-view-instance-save-as-dialog.c b/widgets/menus/gal-view-instance-save-as-dialog.c index 5ac6dde416..11099f0b1c 100644 --- a/widgets/menus/gal-view-instance-save-as-dialog.c +++ b/widgets/menus/gal-view-instance-save-as-dialog.c @@ -35,13 +35,13 @@ #include #include -static GnomeDialogClass *parent_class = NULL; -#define PARENT_TYPE gnome_dialog_get_type() +static GtkDialogClass *parent_class = NULL; +#define PARENT_TYPE GTK_TYPE_DIALOG /* The arguments we take */ enum { - ARG_0, - ARG_INSTANCE, + PROP_0, + PROP_INSTANCE, }; typedef struct { @@ -58,9 +58,9 @@ gal_view_instance_save_as_dialog_set_instance(GalViewInstanceSaveAsDialog *dialo { dialog->instance = instance; if (dialog->model) { - gtk_object_set(GTK_OBJECT(dialog->model), - "collection", instance ? instance->collection : NULL, - NULL); + g_object_set(dialog->model, + "collection", instance ? instance->collection : NULL, + NULL); } } @@ -98,28 +98,28 @@ gvisad_radio_toggled (GtkWidget *widget, GalViewInstanceSaveAsDialog *dialog) } static void -gvisad_connect_signal(GalViewInstanceSaveAsDialog *dialog, char *widget_name, char *signal, GtkSignalFunc handler) +gvisad_connect_signal(GalViewInstanceSaveAsDialog *dialog, char *widget_name, char *signal, GCallback handler) { GtkWidget *widget; widget = glade_xml_get_widget(dialog->gui, widget_name); if (widget) - g_signal_connect (G_OBJECT (widget), signal, G_CALLBACK (handler), dialog); + g_signal_connect (G_OBJECT (widget), signal, handler, dialog); } /* Method override implementations */ static void -gal_view_instance_save_as_dialog_set_arg (GtkObject *o, GtkArg *arg, guint arg_id) +gal_view_instance_save_as_dialog_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { GalViewInstanceSaveAsDialog *dialog; - dialog = GAL_VIEW_INSTANCE_SAVE_AS_DIALOG (o); + dialog = GAL_VIEW_INSTANCE_SAVE_AS_DIALOG (object); - switch (arg_id){ - case ARG_INSTANCE: - if (GTK_VALUE_OBJECT(*arg)) - gal_view_instance_save_as_dialog_set_instance(dialog, GAL_VIEW_INSTANCE(GTK_VALUE_OBJECT(*arg))); + switch (prop_id){ + case PROP_INSTANCE: + if (g_value_get_object (value)) + gal_view_instance_save_as_dialog_set_instance(dialog, GAL_VIEW_INSTANCE(g_value_get_object (value))); else gal_view_instance_save_as_dialog_set_instance(dialog, NULL); break; @@ -130,53 +130,56 @@ gal_view_instance_save_as_dialog_set_arg (GtkObject *o, GtkArg *arg, guint arg_i } static void -gal_view_instance_save_as_dialog_get_arg (GtkObject *object, GtkArg *arg, guint arg_id) +gal_view_instance_save_as_dialog_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { GalViewInstanceSaveAsDialog *dialog; dialog = GAL_VIEW_INSTANCE_SAVE_AS_DIALOG (object); - switch (arg_id) { - case ARG_INSTANCE: - if (dialog->instance) - GTK_VALUE_OBJECT(*arg) = GTK_OBJECT(dialog->instance); - else - GTK_VALUE_OBJECT(*arg) = NULL; + switch (prop_id) { + case PROP_INSTANCE: + g_value_set_object (value, dialog->instance); break; default: - arg->type = GTK_TYPE_INVALID; + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } static void -gal_view_instance_save_as_dialog_destroy (GtkObject *object) +gal_view_instance_save_as_dialog_dispose (GObject *object) { GalViewInstanceSaveAsDialog *gal_view_instance_save_as_dialog = GAL_VIEW_INSTANCE_SAVE_AS_DIALOG(object); - gtk_object_unref(GTK_OBJECT(gal_view_instance_save_as_dialog->gui)); + if (gal_view_instance_save_as_dialog->gui) + g_object_unref(gal_view_instance_save_as_dialog->gui); + gal_view_instance_save_as_dialog->gui = NULL; - if (GTK_OBJECT_CLASS (parent_class)->destroy) - (* GTK_OBJECT_CLASS (parent_class)->destroy) (object); + if (G_OBJECT_CLASS (parent_class)->dispose) + (* G_OBJECT_CLASS (parent_class)->dispose) (object); } /* Init functions */ static void gal_view_instance_save_as_dialog_class_init (GalViewInstanceSaveAsDialogClass *klass) { - GtkObjectClass *object_class; + GObjectClass *object_class; - object_class = (GtkObjectClass*) klass; + object_class = (GObjectClass*) klass; - parent_class = gtk_type_class (PARENT_TYPE); + parent_class = g_type_class_ref (PARENT_TYPE); - object_class->set_arg = gal_view_instance_save_as_dialog_set_arg; - object_class->get_arg = gal_view_instance_save_as_dialog_get_arg; - object_class->destroy = gal_view_instance_save_as_dialog_destroy; + object_class->set_property = gal_view_instance_save_as_dialog_set_property; + object_class->get_property = gal_view_instance_save_as_dialog_get_property; + object_class->dispose = gal_view_instance_save_as_dialog_dispose; - gtk_object_add_arg_type("GalViewInstanceSaveAsDialog::instance", GAL_VIEW_INSTANCE_TYPE, - GTK_ARG_READWRITE, ARG_INSTANCE); + g_object_class_install_property (object_class, PROP_INSTANCE, + g_param_spec_object ("instance", + _("Instance"), + /*_( */"XXX blurb" /*)*/, + GAL_VIEW_INSTANCE_TYPE, + G_PARAM_READWRITE)); } static void @@ -197,24 +200,24 @@ gal_view_instance_save_as_dialog_init (GalViewInstanceSaveAsDialog *dialog) } gtk_widget_ref(widget); gtk_widget_unparent(widget); - gtk_box_pack_start(GTK_BOX(GNOME_DIALOG(dialog)->vbox), widget, TRUE, TRUE, 0); + gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), widget, TRUE, TRUE, 0); gtk_widget_unref(widget); - gnome_dialog_append_buttons(GNOME_DIALOG(dialog), - GNOME_STOCK_BUTTON_OK, - GNOME_STOCK_BUTTON_CANCEL, - NULL); + gtk_dialog_add_buttons (GTK_DIALOG (dialog), + GTK_STOCK_OK, GTK_RESPONSE_OK, + GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, + NULL); - gvisad_connect_signal(dialog, "radiobutton-replace", "toggled", GTK_SIGNAL_FUNC(gvisad_radio_toggled)); - gvisad_connect_signal(dialog, "radiobutton-create", "toggled", GTK_SIGNAL_FUNC(gvisad_radio_toggled)); + gvisad_connect_signal(dialog, "radiobutton-replace", "toggled", G_CALLBACK(gvisad_radio_toggled)); + gvisad_connect_signal(dialog, "radiobutton-create", "toggled", G_CALLBACK(gvisad_radio_toggled)); dialog->model = NULL; etable = glade_xml_get_widget(dialog->gui, "custom-replace"); if (etable) { - dialog->model = gtk_object_get_data(GTK_OBJECT(etable), "GalViewInstanceSaveAsDialog::model"); - gtk_object_set(GTK_OBJECT(dialog->model), - "collection", dialog->instance ? dialog->instance->collection : NULL, - NULL); + dialog->model = g_object_get_data(etable, "GalViewInstanceSaveAsDialog::model"); + g_object_set(dialog->model, + "collection", dialog->instance ? dialog->instance->collection : NULL, + NULL); } gvisad_setup_radio_buttons (dialog); @@ -238,7 +241,7 @@ gal_view_instance_save_as_dialog_create_etable(char *name, char *string1, char * ETableModel *model; model = gal_define_views_model_new(); table = e_table_scrolled_new(model, NULL, SPEC, NULL); - gtk_object_set_data(GTK_OBJECT(table), "GalViewInstanceSaveAsDialog::model", model); + g_object_set_data(table, "GalViewInstanceSaveAsDialog::model", model); return table; } @@ -253,34 +256,15 @@ gal_view_instance_save_as_dialog_create_etable(char *name, char *string1, char * GtkWidget* gal_view_instance_save_as_dialog_new (GalViewInstance *instance) { - GtkWidget *widget = GTK_WIDGET (gtk_type_new (gal_view_instance_save_as_dialog_get_type ())); + GtkWidget *widget = g_object_new (GAL_VIEW_INSTANCE_SAVE_AS_DIALOG_TYPE, NULL); gal_view_instance_save_as_dialog_set_instance(GAL_VIEW_INSTANCE_SAVE_AS_DIALOG (widget), instance); return widget; } -GtkType -gal_view_instance_save_as_dialog_get_type (void) -{ - static GtkType type = 0; - - if (!type) { - static const GtkTypeInfo info = - { - "GalViewInstanceSaveAsDialog", - sizeof (GalViewInstanceSaveAsDialog), - sizeof (GalViewInstanceSaveAsDialogClass), - (GtkClassInitFunc) gal_view_instance_save_as_dialog_class_init, - (GtkObjectInitFunc) gal_view_instance_save_as_dialog_init, - /* reserved_1 */ NULL, - /* reserved_2 */ NULL, - (GtkClassInitFunc) NULL, - }; - - type = gtk_type_unique (PARENT_TYPE, &info); - } - - return type; -} +E_MAKE_TYPE(gal_view_instance_save_as_dialog, "GalViewInstanceSaveAsDialog", + GalViewInstanceSaveAsDialog, + gal_view_instance_save_as_dialog_class_init, + gal_view_instance_save_as_dialog_init, PARENT_TYPE) void gal_view_instance_save_as_dialog_save (GalViewInstanceSaveAsDialog *dialog) diff --git a/widgets/menus/gal-view-instance-save-as-dialog.glade b/widgets/menus/gal-view-instance-save-as-dialog.glade index bc5d99dd58..e60357e17c 100644 --- a/widgets/menus/gal-view-instance-save-as-dialog.glade +++ b/widgets/menus/gal-view-instance-save-as-dialog.glade @@ -1,269 +1,243 @@ - - - - - gal-view-instance-save-as-dialog - gal-view-instance-save-as-dialog - - src - pixmaps - C - True - True - True - False - False - False - True - - - - GnomeDialog - dialog1 - False - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - False - True - False - False - False - - - GtkVBox - GnomeDialog:vbox - dialog-vbox1 - False - 8 - - 4 - True - True - - - - GtkHButtonBox - GnomeDialog:action_area - dialog-action_area1 - GTK_BUTTONBOX_END - 8 - 85 - 27 - 7 - 0 - - 0 - False - True - GTK_PACK_END - - - - GtkButton - button1 - True - True - GNOME_STOCK_BUTTON_OK + + + + + + no + GTK_WINDOW_TOPLEVEL + no + no + yes + GTK_WIN_POS_NONE + + + + no + 8 + yes + + + + GTK_BUTTONBOX_END + 8 + yes + + + + yes + yes + yes + gtk-ok + yes + yes + + + + + + yes + yes + yes + gtk-cancel + yes + yes + + + + + 0 + no + yes + GTK_PACK_END + + + + + + no + 0 + 0 + 5 + 1 + yes + + + + no + no + GTK_POS_TOP + no + 2 + 2 + no + yes + + + + The current view will replace the given view. Any folders +set to this view wil be replaced with the current view. + GTK_JUSTIFY_CENTER + no + 0.5 + 0.5 + 0 + 0 + yes + + + + + + label4 + GTK_JUSTIFY_CENTER + no + 0.5 + 0.5 + 0 + 0 + yes + + + tab + + + + + + This will create a new View. + GTK_JUSTIFY_CENTER + no + 0.5 + 0.5 + 0 + 0 + yes + + + + + + label5 + GTK_JUSTIFY_CENTER + no + 0.5 + 0.5 + 0 + 0 + yes + + + tab + + + + + 0 + 1 + 4 + 5 + 0 + 0 + expand|fill + fill + + + + + + gal_view_instance_save_as_dialog_create_etable + 0 + 0 + Fri, 01 Feb 2002 20:18:32 GMT + yes + + + 0 + 1 + 3 + 4 + 0 + 0 + fill + expand|fill + + + + + + no + yes + yes + + 0 + yes + yes + + + 0 + 1 + 1 + 2 + 0 + 0 + expand|fill + + + + + + + yes + Replace Existing View + no + yes + yes + + + 0 + 1 + 2 + 3 + 0 + 0 + fill + + + + + + + yes + Create New View Named + yes + yes + yes + radiobutton-replace + + + 0 + 1 + 0 + 1 + 0 + 0 + fill + + + + + + 0 + yes + yes + + - - - GtkButton - button3 - True - True - GNOME_STOCK_BUTTON_CANCEL - - - - - GtkTable - table-top - 5 - 1 - False - 0 - 0 - - 0 - True - True - - - - GtkNotebook - notebook-help - False - False - GTK_POS_TOP - False - 2 - 2 - False - - 0 - 1 - 4 - 5 - 0 - 0 - True - False - False - False - True - True - - - - GtkLabel - label6 - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - - - - GtkLabel - Notebook:tab - label4 - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - - - - GtkLabel - label7 - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - - - - GtkLabel - Notebook:tab - label5 - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - - - - - Custom - custom-replace - gal_view_instance_save_as_dialog_create_etable - 0 - 0 - Fri, 01 Feb 2002 20:18:32 GMT - - 0 - 1 - 3 - 4 - 0 - 0 - False - True - False - False - True - True - - - - - GtkEntry - entry-create - False - True - True - True - 0 - - - 0 - 1 - 1 - 2 - 0 - 0 - True - False - False - False - True - False - - - - - GtkRadioButton - radiobutton-replace - True - - False - True - choice-group - - 0 - 1 - 2 - 3 - 0 - 0 - False - False - False - False - True - False - - - - - GtkRadioButton - radiobutton-create - True - - True - True - choice-group - - 0 - 1 - 0 - 1 - 0 - 0 - False - False - False - False - True - False - - - + + 4 + yes + yes + + - - - + diff --git a/widgets/menus/gal-view-instance-save-as-dialog.h b/widgets/menus/gal-view-instance-save-as-dialog.h index 567e00d7b0..53d99d0789 100644 --- a/widgets/menus/gal-view-instance-save-as-dialog.h +++ b/widgets/menus/gal-view-instance-save-as-dialog.h @@ -24,7 +24,7 @@ #ifndef __GAL_VIEW_INSTANCE_SAVE_AS_DIALOG_H__ #define __GAL_VIEW_INSTANCE_SAVE_AS_DIALOG_H__ -#include +#include #include #include #include @@ -44,10 +44,10 @@ extern "C" { */ #define GAL_VIEW_INSTANCE_SAVE_AS_DIALOG_TYPE (gal_view_instance_save_as_dialog_get_type ()) -#define GAL_VIEW_INSTANCE_SAVE_AS_DIALOG(obj) (GTK_CHECK_CAST ((obj), GAL_VIEW_INSTANCE_SAVE_AS_DIALOG_TYPE, GalViewInstanceSaveAsDialog)) -#define GAL_VIEW_INSTANCE_SAVE_AS_DIALOG_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GAL_VIEW_INSTANCE_SAVE_AS_DIALOG_TYPE, GalViewInstanceSaveAsDialogClass)) -#define GAL_IS_VIEW_INSTANCE_SAVE_AS_DIALOG(obj) (GTK_CHECK_TYPE ((obj), GAL_VIEW_INSTANCE_SAVE_AS_DIALOG_TYPE)) -#define GAL_IS_VIEW_INSTANCE_SAVE_AS_DIALOG_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), GAL_VIEW_INSTANCE_SAVE_AS_DIALOG_TYPE)) +#define GAL_VIEW_INSTANCE_SAVE_AS_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAL_VIEW_INSTANCE_SAVE_AS_DIALOG_TYPE, GalViewInstanceSaveAsDialog)) +#define GAL_VIEW_INSTANCE_SAVE_AS_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAL_VIEW_INSTANCE_SAVE_AS_DIALOG_TYPE, GalViewInstanceSaveAsDialogClass)) +#define GAL_IS_VIEW_INSTANCE_SAVE_AS_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAL_VIEW_INSTANCE_SAVE_AS_DIALOG_TYPE)) +#define GAL_IS_VIEW_INSTANCE_SAVE_AS_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), GAL_VIEW_INSTANCE_SAVE_AS_DIALOG_TYPE)) typedef struct _GalViewInstanceSaveAsDialog GalViewInstanceSaveAsDialog; typedef struct _GalViewInstanceSaveAsDialogClass GalViewInstanceSaveAsDialogClass; @@ -59,7 +59,7 @@ typedef enum { struct _GalViewInstanceSaveAsDialog { - GnomeDialog parent; + GtkDialog parent; /* item specific fields */ GladeXML *gui; @@ -73,11 +73,11 @@ struct _GalViewInstanceSaveAsDialog struct _GalViewInstanceSaveAsDialogClass { - GnomeDialogClass parent_class; + GtkDialogClass parent_class; }; GtkWidget *gal_view_instance_save_as_dialog_new (GalViewInstance *instance); -GtkType gal_view_instance_save_as_dialog_get_type (void); +GType gal_view_instance_save_as_dialog_get_type (void); void gal_view_instance_save_as_dialog_save (GalViewInstanceSaveAsDialog *dialog); diff --git a/widgets/menus/gal-view-instance.c b/widgets/menus/gal-view-instance.c index 87747931f4..94b43eada6 100644 --- a/widgets/menus/gal-view-instance.c +++ b/widgets/menus/gal-view-instance.c @@ -26,7 +26,6 @@ #include #include #include -#include #include #include #include @@ -492,7 +491,7 @@ add_popup_radio_item (EPopupMenu *menu_item, static void add_popup_menu_item (EPopupMenu *menu_item, gchar *title, - GtkSignalFunc fn, + GCallback fn, gpointer closure) { const EPopupMenu menu_item_struct = @@ -559,18 +558,18 @@ gal_view_instance_get_popup_menu (GalViewInstance *instance) value = TRUE; } - add_popup_radio_item (ret_val + i, item->title, GTK_SIGNAL_FUNC (view_item_cb), closure, value); + add_popup_radio_item (ret_val + i, item->title, G_CALLBACK (view_item_cb), closure, value); } if (!found) { e_popup_menu_copy_1 (ret_val + i++, &separator); add_popup_radio_item (ret_val + i++, N_("Custom View"), NULL, NULL, TRUE); - add_popup_menu_item (ret_val + i++, N_("Save Custom View"), GTK_SIGNAL_FUNC (save_current_view_cb), instance); + add_popup_menu_item (ret_val + i++, N_("Save Custom View"), G_CALLBACK (save_current_view_cb), instance); } e_popup_menu_copy_1 (ret_val + i++, &separator); - add_popup_menu_item (ret_val + i++, N_("Define Views"), GTK_SIGNAL_FUNC (define_views_cb), instance); + add_popup_menu_item (ret_val + i++, N_("Define Views"), G_CALLBACK (define_views_cb), instance); e_popup_menu_copy_1 (ret_val + i++, &terminator); return ret_val; diff --git a/widgets/menus/gal-view-new-dialog.c b/widgets/menus/gal-view-new-dialog.c index 6c858d141b..2677f2a415 100644 --- a/widgets/menus/gal-view-new-dialog.c +++ b/widgets/menus/gal-view-new-dialog.c @@ -28,64 +28,56 @@ #include "gal-define-views-model.h" #include #include +#include +#include static void gal_view_new_dialog_init (GalViewNewDialog *card); static void gal_view_new_dialog_class_init (GalViewNewDialogClass *klass); -static void gal_view_new_dialog_set_arg (GtkObject *o, GtkArg *arg, guint arg_id); -static void gal_view_new_dialog_get_arg (GtkObject *object, GtkArg *arg, guint arg_id); -static void gal_view_new_dialog_destroy (GtkObject *object); +static void gal_view_new_dialog_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); +static void gal_view_new_dialog_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); +static void gal_view_new_dialog_dispose (GObject *object); -static GnomeDialogClass *parent_class = NULL; -#define PARENT_TYPE gnome_dialog_get_type() +static GtkDialogClass *parent_class = NULL; +#define PARENT_TYPE GTK_TYPE_DIALOG /* The arguments we take */ enum { - ARG_0, - ARG_NAME, - ARG_FACTORY + PROP_0, + PROP_NAME, + PROP_FACTORY }; -GtkType -gal_view_new_dialog_get_type (void) -{ - static GtkType type = 0; - - if (!type) { - static const GtkTypeInfo info = - { - "GalViewNewDialog", - sizeof (GalViewNewDialog), - sizeof (GalViewNewDialogClass), - (GtkClassInitFunc) gal_view_new_dialog_class_init, - (GtkObjectInitFunc) gal_view_new_dialog_init, - /* reserved_1 */ NULL, - /* reserved_2 */ NULL, - (GtkClassInitFunc) NULL, - }; - - type = gtk_type_unique (PARENT_TYPE, &info); - } - - return type; -} +E_MAKE_TYPE(gal_view_new_dialog, "GalViewNewDialog", + GalViewNewDialog, + gal_view_new_dialog_class_init, + gal_view_new_dialog_init, PARENT_TYPE) static void gal_view_new_dialog_class_init (GalViewNewDialogClass *klass) { - GtkObjectClass *object_class; + GObjectClass *object_class; - object_class = (GtkObjectClass*) klass; + object_class = (GObjectClass*) klass; - parent_class = gtk_type_class (PARENT_TYPE); + parent_class = g_type_class_ref (PARENT_TYPE); - object_class->set_arg = gal_view_new_dialog_set_arg; - object_class->get_arg = gal_view_new_dialog_get_arg; - object_class->destroy = gal_view_new_dialog_destroy; + object_class->set_property = gal_view_new_dialog_set_property; + object_class->get_property = gal_view_new_dialog_get_property; + object_class->dispose = gal_view_new_dialog_dispose; - gtk_object_add_arg_type ("GalViewNewDialog::name", GTK_TYPE_STRING, - GTK_ARG_READWRITE, ARG_NAME); - gtk_object_add_arg_type ("GalViewNewDialog::factory", GTK_TYPE_OBJECT, - GTK_ARG_READABLE, ARG_FACTORY); + g_object_class_install_property (object_class, PROP_FACTORY, + g_param_spec_string ("name", + _("Name"), + /*_( */"XXX blurb" /*)*/, + NULL, + G_PARAM_READWRITE)); + + g_object_class_install_property (object_class, PROP_FACTORY, + g_param_spec_object ("factory", + _("Factory"), + /*_( */"XXX blurb" /*)*/, + GAL_VIEW_FACTORY_TYPE, + G_PARAM_READWRITE)); } static void @@ -103,13 +95,13 @@ gal_view_new_dialog_init (GalViewNewDialog *dialog) } gtk_widget_ref(widget); gtk_widget_unparent(widget); - gtk_box_pack_start(GTK_BOX(GNOME_DIALOG(dialog)->vbox), widget, TRUE, TRUE, 0); + gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), widget, TRUE, TRUE, 0); gtk_widget_unref(widget); - gnome_dialog_append_buttons(GNOME_DIALOG(dialog), - GTK_STOCK_OK, - GTK_STOCK_CANCEL, - NULL); + gtk_dialog_add_buttons (GTK_DIALOG (dialog), + GTK_STOCK_OK, GTK_RESPONSE_OK, + GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, + NULL); gtk_window_set_policy(GTK_WINDOW(dialog), FALSE, TRUE, FALSE); @@ -118,23 +110,23 @@ gal_view_new_dialog_init (GalViewNewDialog *dialog) } static void -gal_view_new_dialog_destroy (GtkObject *object) +gal_view_new_dialog_dispose (GObject *object) { GalViewNewDialog *gal_view_new_dialog = GAL_VIEW_NEW_DIALOG(object); if (gal_view_new_dialog->gui) - gtk_object_unref(GTK_OBJECT(gal_view_new_dialog->gui)); + g_object_unref(gal_view_new_dialog->gui); gal_view_new_dialog->gui = NULL; - if (GTK_OBJECT_CLASS (parent_class)->destroy) - (* GTK_OBJECT_CLASS (parent_class)->destroy) (object); + if (G_OBJECT_CLASS (parent_class)->dispose) + (* G_OBJECT_CLASS (parent_class)->dispose) (object); } GtkWidget* gal_view_new_dialog_new (GalViewCollection *collection) { GtkWidget *widget = - gal_view_new_dialog_construct(gtk_type_new (gal_view_new_dialog_get_type ()), + gal_view_new_dialog_construct(g_object_new (GAL_VIEW_NEW_DIALOG_TYPE, NULL), collection); return widget; } @@ -167,60 +159,62 @@ gal_view_new_dialog_construct (GalViewNewDialog *dialog, char *text[1]; int row; - gtk_object_ref(GTK_OBJECT(factory)); + g_object_ref(factory); text[0] = (char *) gal_view_factory_get_title(factory); row = gtk_clist_append(GTK_CLIST(list), text); gtk_clist_set_row_data(GTK_CLIST(list), row, factory); } - gtk_signal_connect(GTK_OBJECT (list), - "select_row", - GTK_SIGNAL_FUNC(gal_view_new_dialog_select_row_callback), - dialog); + g_signal_connect(list, + "select_row", + G_CALLBACK(gal_view_new_dialog_select_row_callback), + dialog); return GTK_WIDGET(dialog); } static void -gal_view_new_dialog_set_arg (GtkObject *o, GtkArg *arg, guint arg_id) +gal_view_new_dialog_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { GalViewNewDialog *dialog; GtkWidget *entry; - dialog = GAL_VIEW_NEW_DIALOG (o); + dialog = GAL_VIEW_NEW_DIALOG (object); - switch (arg_id){ - case ARG_NAME: + switch (prop_id){ + case PROP_NAME: entry = glade_xml_get_widget(dialog->gui, "entry-name"); - if (entry && GTK_IS_EDITABLE(entry)) { - e_utf8_gtk_editable_set_text(GTK_EDITABLE(entry), GTK_VALUE_STRING(*arg)); + if (entry && GTK_IS_ENTRY(entry)) { + gtk_entry_set_text(GTK_ENTRY(entry), g_value_get_string (value)); } break; default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); return; } } + static void -gal_view_new_dialog_get_arg (GtkObject *object, GtkArg *arg, guint arg_id) +gal_view_new_dialog_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { GalViewNewDialog *dialog; GtkWidget *entry; dialog = GAL_VIEW_NEW_DIALOG (object); - switch (arg_id) { - case ARG_NAME: + switch (prop_id) { + case PROP_NAME: entry = glade_xml_get_widget(dialog->gui, "entry-name"); - if (entry && GTK_IS_EDITABLE(entry)) { - GTK_VALUE_STRING(*arg) = e_utf8_gtk_editable_get_text(GTK_EDITABLE(entry)); + if (entry && GTK_IS_ENTRY(entry)) { + g_value_set_string (value, gtk_entry_get_text (GTK_ENTRY (entry))); } break; - case ARG_FACTORY: - GTK_VALUE_OBJECT(*arg) = dialog->selected_factory ? GTK_OBJECT(dialog->selected_factory) : NULL; + case PROP_FACTORY: + g_value_set_object (value, dialog->selected_factory); break; default: - arg->type = GTK_TYPE_INVALID; + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } diff --git a/widgets/menus/gal-view-new-dialog.glade b/widgets/menus/gal-view-new-dialog.glade index 173fa6c3af..eac107fc00 100644 --- a/widgets/menus/gal-view-new-dialog.glade +++ b/widgets/menus/gal-view-new-dialog.glade @@ -1,220 +1,201 @@ - - + + - - gal-view-new-dialog - gal-view-new-dialog - - src - pixmaps - C - True - True - True - False - False - False - True - + + + no + GTK_WINDOW_TOPLEVEL + no + no + yes + GTK_WIN_POS_NONE - - GnomeDialog - dialog1 - False - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - False - True - False - False - False + + + no + 8 + yes - - GtkVBox - GnomeDialog:vbox - dialog-vbox1 - False - 8 - - 4 - True - True - + + + GTK_BUTTONBOX_END + 8 + yes - - GtkHButtonBox - GnomeDialog:action_area - dialog-action_area1 - GTK_BUTTONBOX_END - 8 - 85 - 27 - 7 - 0 - - 0 - False - True - GTK_PACK_END - + + + yes + yes + yes + gtk-ok + yes + yes + + - - GtkButton - button1 - True - True - GNOME_STOCK_BUTTON_OK - + + + yes + yes + yes + gtk-cancel + yes + yes + + + + + 0 + no + yes + GTK_PACK_END + + - - GtkButton - button3 - True - True - GNOME_STOCK_BUTTON_CANCEL - - + + + no + 6 + 6 + 4 + 1 + yes - - GtkTable - table-top - 4 - 1 - False - 6 - 6 - - 0 - True - True - + + + Name of new view: + GTK_JUSTIFY_CENTER + no + 0 + 0.5 + 0 + 0 + entry-name + yes + + + 0 + 1 + 0 + 1 + 0 + 0 + fill + + + - - GtkLabel - label1 - - GTK_JUSTIFY_CENTER - False - 0 - 0.5 - 0 - 0 - entry-name - - 0 - 1 - 0 - 1 - 0 - 0 - False - False - False - False - True - False - - + + + yes + yes + + 0 + yes + yes + + + 0 + 1 + 1 + 2 + 0 + 0 + expand|fill + fill + + - - GtkEntry - entry-name - True - True - True - 0 - - - 0 - 1 - 1 - 2 - 0 - 0 - True - False - False - False - True - True - - + + + Type of view: + GTK_JUSTIFY_CENTER + no + 0 + 0.5 + 0 + 0 + yes + + + 0 + 1 + 2 + 3 + 0 + 0 + fill + + + - - GtkLabel - label2 - - GTK_JUSTIFY_CENTER - False - 0 - 0.5 - 0 - 0 - - 0 - 1 - 2 - 3 - 0 - 0 - False - False - False - False - True - False - - + + + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_SHADOW_IN + yes + + + + yes + no + yes - - GtkScrolledWindow - scrolledwindow1 - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - GTK_UPDATE_CONTINUOUS - GTK_UPDATE_CONTINUOUS - - 0 - 1 - 3 - 4 - 0 - 0 - False - True - False - False - True - True - + + + CList:title + label5 + GTK_JUSTIFY_CENTER + no + 0.5 + 0.5 + 0 + 0 + yes + + + + - - GtkCList - clist-type-list - True - 1 - 80 - GTK_SELECTION_SINGLE - False - GTK_SHADOW_IN + + + GTK_UPDATE_CONTINUOUS + yes + + - - GtkLabel - CList:title - label5 - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - - + + + GTK_UPDATE_CONTINUOUS + yes + + + + + 0 + 1 + 3 + 4 + 0 + 0 + fill + expand|fill + + + + + 0 + yes + yes + + - + + 4 + yes + yes + + - - - + diff --git a/widgets/menus/gal-view-new-dialog.h b/widgets/menus/gal-view-new-dialog.h index 623cb341d0..d7d7912ea2 100644 --- a/widgets/menus/gal-view-new-dialog.h +++ b/widgets/menus/gal-view-new-dialog.h @@ -24,6 +24,7 @@ #ifndef __GAL_VIEW_NEW_DIALOG_H__ #define __GAL_VIEW_NEW_DIALOG_H__ +#include #include #include @@ -40,18 +41,18 @@ extern "C" { * -------------------------------------------------------------------------------- */ -#define GAL_VIEW_NEW_DIALOG_TYPE (gal_view_new_dialog_get_type ()) -#define GAL_VIEW_NEW_DIALOG(obj) (GTK_CHECK_CAST ((obj), GAL_VIEW_NEW_DIALOG_TYPE, GalViewNewDialog)) -#define GAL_VIEW_NEW_DIALOG_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GAL_VIEW_NEW_DIALOG_TYPE, GalViewNewDialogClass)) -#define GAL_IS_VIEW_NEW_DIALOG(obj) (GTK_CHECK_TYPE ((obj), GAL_VIEW_NEW_DIALOG_TYPE)) -#define GAL_IS_VIEW_NEW_DIALOG_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), GAL_VIEW_NEW_DIALOG_TYPE)) +#define GAL_VIEW_NEW_DIALOG_TYPE (gal_view_new_dialog_get_type ()) +#define GAL_VIEW_NEW_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAL_VIEW_NEW_DIALOG_TYPE, GalViewNewDialog)) +#define GAL_VIEW_NEW_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAL_VIEW_NEW_DIALOG_TYPE, GalViewNewDialogClass)) +#define GAL_IS_VIEW_NEW_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAL_VIEW_NEW_DIALOG_TYPE)) +#define GAL_IS_VIEW_NEW_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), GAL_VIEW_NEW_DIALOG_TYPE)) typedef struct _GalViewNewDialog GalViewNewDialog; typedef struct _GalViewNewDialogClass GalViewNewDialogClass; struct _GalViewNewDialog { - GnomeDialog parent; + GtkDialog parent; /* item specific fields */ GladeXML *gui; @@ -62,11 +63,11 @@ struct _GalViewNewDialog struct _GalViewNewDialogClass { - GnomeDialogClass parent_class; + GtkDialogClass parent_class; }; GtkWidget *gal_view_new_dialog_new (GalViewCollection *collection); -GtkType gal_view_new_dialog_get_type (void); +GType gal_view_new_dialog_get_type (void); GtkWidget *gal_view_new_dialog_construct (GalViewNewDialog *dialog, GalViewCollection *collection); -- cgit