From 83983af43712c94cfb6fce4a2c8511864d6b5374 Mon Sep 17 00:00:00 2001 From: Chris Toshok Date: Fri, 8 Nov 2002 11:49:43 +0000 Subject: convert to glade-2 2002-11-08 Chris Toshok * gui/contact-list-editor/contact-list-editor.glade: convert to glade-2 * gui/contact-list-editor/e-contact-list-editor.c: port work. * gui/contact-list-editor/e-contact-list-model.[ch]: port work. svn path=/trunk/; revision=18668 --- addressbook/ChangeLog | 8 + .../contact-list-editor/contact-list-editor.glade | 506 +++++++++++---------- .../contact-list-editor/e-contact-list-editor.c | 80 ++-- .../gui/contact-list-editor/e-contact-list-model.c | 2 +- .../gui/contact-list-editor/e-contact-list-model.h | 10 +- 5 files changed, 309 insertions(+), 297 deletions(-) (limited to 'addressbook') diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index 9e355b3632..80c8c5717c 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,3 +1,11 @@ +2002-11-08 Chris Toshok + + * gui/contact-list-editor/contact-list-editor.glade: convert to glade-2 + + * gui/contact-list-editor/e-contact-list-editor.c: port work. + + * gui/contact-list-editor/e-contact-list-model.[ch]: port work. + 2002-11-08 Chris Toshok * gui/contact-editor/e-contact-editor-address.[ch]: port work. diff --git a/addressbook/gui/contact-list-editor/contact-list-editor.glade b/addressbook/gui/contact-list-editor/contact-list-editor.glade index 92c6aa013f..6ba85be352 100644 --- a/addressbook/gui/contact-list-editor/contact-list-editor.glade +++ b/addressbook/gui/contact-list-editor/contact-list-editor.glade @@ -1,272 +1,278 @@ - - + + - - contact-list-editor - contact-list-editor - - src - pixmaps - C - True - True - + + + - - GnomeApp - contact list editor - contact-list-editor - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - 426 - 304 - True - True - False - True + + contact-list-editor + GTK_WINDOW_TOPLEVEL + no + 426 + 304 + yes + yes + yes + yes + GTK_WIN_POS_NONE - - GnomeDock - GnomeApp:dock - dock1 - True - - 0 - True - True - + + + yes + yes - - GtkVBox - GnomeDock:contents - vbox8 - 3 - False - 0 + + + 3 + no + 0 + yes - - GtkHBox - hbox6 - 3 - False - 3 - - 0 - False - False - + + + 3 + no + 3 + yes - - GtkLabel - label10 - - GTK_JUSTIFY_LEFT - False - 0 - 0.5 - 0 - 0 - list-name-entry - - 0 - False - False - - + + + List _name: + GTK_JUSTIFY_LEFT + no + 0 + 0.5 + 0 + 0 + list-name-entry + yes + yes + + + 0 + no + no + + - - GtkEntry - list-name-entry - True - True - True - True - 0 - - - 0 - True - True - - + + + yes + yes + yes + + 0 + yes + yes + + + 0 + yes + yes + + - - Custom - custom7 - e_create_image_widget - evolution-contacts-plain.png - 0 - 0 - Sat, 23 Jun 2001 05:59:21 GMT - - 0 - False - True - - - + + + e_create_image_widget + evolution-contacts-plain.png + 0 + 0 + Sat, 23 Jun 2001 05:59:21 GMT + yes + + + 0 + no + yes + + + + + 0 + no + no + + - - GtkFrame - frame3 - 3 - - 0 - GTK_SHADOW_ETCHED_IN - - 0 - True - True - + + + 3 + Members + 0 + GTK_SHADOW_ETCHED_IN + yes - - GtkHBox - hbox7 - False - 0 + + + no + 0 + yes - - GtkVBox - vbox9 - 3 - False - 3 - - 0 - True - True - + + + 3 + no + 3 + yes - - GtkLabel - label11 - - GTK_JUSTIFY_CENTER - False - 0 - 0.5 - 0 - 0 - - 0 - False - False - - + + + Type an email address or drag a contact into the list below: + GTK_JUSTIFY_CENTER + no + 0 + 0.5 + 0 + 0 + yes + + + 0 + no + no + + - - GtkEntry - email-entry - True - True - True - 0 - - - 0 - False - False - - + + + yes + yes + + 0 + yes + yes + + + 0 + no + no + + - - Custom - contact-list-table - e_contact_list_editor_create_table - - 0 - 0 - Sat, 23 Jun 2001 06:00:16 GMT - - 0 - True - True - - + + + e_contact_list_editor_create_table + + 0 + 0 + Sat, 23 Jun 2001 06:00:16 GMT + yes + + + 0 + yes + yes + + - - GtkCheckButton - visible-addrs-checkbutton - True - - False - True - - 0 - False - False - - - + + + yes + _Hide addresses when sending mail to this list + no + yes + yes + yes + + + 0 + no + no + + + + + 0 + yes + yes + + - - GtkVBox - vbox10 - False - 0 - - 0 - False - False - + + + no + 0 + yes - - GtkLabel - label12 - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - - 0 - False - False - - + + + + + GTK_JUSTIFY_CENTER + no + 0.5 + 0.5 + 0 + 0 + yes + + + 0 + no + no + + - - GtkVButtonBox - vbuttonbox4 - GTK_BUTTONBOX_START - 0 - 85 - 27 - 7 - 0 - - 0 - True - True - + + + GTK_BUTTONBOX_START + 0 + yes - - GtkButton - add-email-button - True - True - - GTK_RELIEF_NORMAL - + + + yes + yes + _Add + GTK_RELIEF_NORMAL + yes + yes + + - - GtkButton - remove-button - True - True - - GTK_RELIEF_NORMAL - - - - + + + yes + yes + _Remove + GTK_RELIEF_NORMAL + yes + yes + + + + + 0 + yes + yes + + + + + 0 + no + no + + + + + + + 0 + yes + yes + + + + - + + 0 + yes + yes + + - - - + diff --git a/addressbook/gui/contact-list-editor/e-contact-list-editor.c b/addressbook/gui/contact-list-editor/e-contact-list-editor.c index b689cfb5e7..9c696f9040 100644 --- a/addressbook/gui/contact-list-editor/e-contact-list-editor.c +++ b/addressbook/gui/contact-list-editor/e-contact-list-editor.c @@ -187,8 +187,8 @@ e_contact_list_editor_class_init (EContactListEditorClass *klass) contact_list_editor_signals[LIST_DELETED] = g_signal_new ("list_deleted", - G_SIGNAL_RUN_FIRST, G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, G_STRUCT_OFFSET (EContactListEditorClass, list_deleted), NULL, NULL, ecle_marshal_NONE__INT_OBJECT, @@ -225,7 +225,7 @@ e_contact_list_editor_init (EContactListEditor *editor) editor->app = glade_xml_get_widget (gui, "contact list editor"); editor->table = glade_xml_get_widget (gui, "contact-list-table"); - editor->model = gtk_object_get_data (GTK_OBJECT(editor->table), "model"); + editor->model = g_object_get_data (G_OBJECT(editor->table), "model"); editor->add_button = glade_xml_get_widget (editor->gui, "add-email-button"); editor->remove_button = glade_xml_get_widget (editor->gui, "remove-button"); @@ -257,9 +257,7 @@ e_contact_list_editor_init (EContactListEditor *editor) /* Build the menu and toolbar */ -#ifdef PENDING_PORT_WORK - container = bonobo_ui_container_new (); - bonobo_ui_container_set_win (container, BONOBO_WINDOW (editor->app)); + container = bonobo_window_get_ui_container (BONOBO_WINDOW (editor->app)); editor->uic = bonobo_ui_component_new_default (); if (!editor->uic) { @@ -269,41 +267,40 @@ e_contact_list_editor_init (EContactListEditor *editor) bonobo_ui_component_set_container (editor->uic, bonobo_object_corba_objref ( BONOBO_OBJECT (container)), NULL); -#endif create_ui (editor); /* connect signals */ - gtk_signal_connect (GTK_OBJECT(editor->add_button), - "clicked", GTK_SIGNAL_FUNC(add_email_cb), editor); - gtk_signal_connect (GTK_OBJECT(editor->email_entry), - "activate", GTK_SIGNAL_FUNC(add_email_cb), editor); - gtk_signal_connect (GTK_OBJECT(editor->remove_button), - "clicked", GTK_SIGNAL_FUNC(remove_entry_cb), editor); - gtk_signal_connect (GTK_OBJECT(editor->list_name_entry), - "changed", GTK_SIGNAL_FUNC(list_name_changed_cb), editor); - gtk_signal_connect (GTK_OBJECT(editor->visible_addrs_checkbutton), - "toggled", GTK_SIGNAL_FUNC(visible_addrs_toggled_cb), editor); + g_signal_connect (editor->add_button, + "clicked", G_CALLBACK(add_email_cb), editor); + g_signal_connect (editor->email_entry, + "activate", G_CALLBACK(add_email_cb), editor); + g_signal_connect (editor->remove_button, + "clicked", G_CALLBACK(remove_entry_cb), editor); + g_signal_connect (editor->list_name_entry, + "changed", G_CALLBACK(list_name_changed_cb), editor); + g_signal_connect (editor->visible_addrs_checkbutton, + "toggled", G_CALLBACK(visible_addrs_toggled_cb), editor); e_table_drag_dest_set (e_table_scrolled_get_table (E_TABLE_SCROLLED (editor->table)), 0, drag_types, num_drag_types, GDK_ACTION_LINK); - gtk_signal_connect (GTK_OBJECT(e_table_scrolled_get_table (E_TABLE_SCROLLED (editor->table))), - "table_drag_motion", GTK_SIGNAL_FUNC(table_drag_motion_cb), editor); - gtk_signal_connect (GTK_OBJECT(e_table_scrolled_get_table (E_TABLE_SCROLLED (editor->table))), - "table_drag_drop", GTK_SIGNAL_FUNC(table_drag_drop_cb), editor); - gtk_signal_connect (GTK_OBJECT(e_table_scrolled_get_table (E_TABLE_SCROLLED (editor->table))), - "table_drag_data_received", GTK_SIGNAL_FUNC(table_drag_data_received_cb), editor); + g_signal_connect (e_table_scrolled_get_table (E_TABLE_SCROLLED (editor->table)), + "table_drag_motion", G_CALLBACK(table_drag_motion_cb), editor); + g_signal_connect (e_table_scrolled_get_table (E_TABLE_SCROLLED (editor->table)), + "table_drag_drop", G_CALLBACK (table_drag_drop_cb), editor); + g_signal_connect (e_table_scrolled_get_table (E_TABLE_SCROLLED (editor->table)), + "table_drag_data_received", G_CALLBACK(table_drag_data_received_cb), editor); command_state_changed (editor); /* Connect to the deletion of the dialog */ - gtk_signal_connect (GTK_OBJECT (editor->app), "delete_event", - GTK_SIGNAL_FUNC (app_delete_event_cb), editor); + g_signal_connect (editor->app, "delete_event", + G_CALLBACK (app_delete_event_cb), editor); /* set the icon */ - icon_path = g_concat_dir_and_file (EVOLUTION_ICONSDIR, "contact-list-16.png"); + icon_path = g_build_filename (EVOLUTION_ICONSDIR, "contact-list-16.png"); gnome_window_icon_set_from_file (GTK_WINDOW (editor->app), icon_path); g_free (icon_path); } @@ -331,8 +328,8 @@ list_added_cb (EBook *book, EBookStatus status, const char *id, EditorCloseStruc e_card_set_id (cle->card, id); - gtk_signal_emit (GTK_OBJECT (cle), contact_list_editor_signals[LIST_ADDED], - status, cle->card); + g_signal_emit (cle, contact_list_editor_signals[LIST_ADDED], 0, + status, cle->card); if (status == E_BOOK_STATUS_SUCCESS) { cle->is_new_list = FALSE; @@ -357,8 +354,8 @@ list_modified_cb (EBook *book, EBookStatus status, EditorCloseStruct *ecs) gtk_widget_set_sensitive (cle->app, TRUE); cle->in_async_call = FALSE; - gtk_signal_emit (GTK_OBJECT (cle), contact_list_editor_signals[LIST_MODIFIED], - status, cle->card); + g_signal_emit (cle, contact_list_editor_signals[LIST_MODIFIED], 0, + status, cle->card); if (status == E_BOOK_STATUS_SUCCESS) { if (should_close) @@ -490,8 +487,8 @@ list_deleted_cb (EBook *book, EBookStatus status, EContactListEditor *cle) gtk_widget_set_sensitive (cle->app, TRUE); cle->in_async_call = FALSE; - gtk_signal_emit (GTK_OBJECT (cle), contact_list_editor_signals[LIST_DELETED], - status, cle->card); + g_signal_emit (cle, contact_list_editor_signals[LIST_DELETED], 0, + status, cle->card); /* always close the dialog after we successfully delete a list */ if (status == E_BOOK_STATUS_SUCCESS) @@ -567,7 +564,8 @@ create_ui (EContactListEditor *ce) } static void -contact_list_editor_destroy_notify (void *data) +contact_list_editor_destroy_notify (gpointer data, + GObject *where_the_object_was) { EContactListEditor *ce = E_CONTACT_LIST_EDITOR (data); @@ -583,9 +581,9 @@ e_contact_list_editor_new (EBook *book, EContactListEditor *ce = g_object_new (E_TYPE_CONTACT_LIST_EDITOR, NULL); all_contact_list_editors = g_slist_prepend (all_contact_list_editors, ce); - gtk_object_weakref (GTK_OBJECT (ce), contact_list_editor_destroy_notify, ce); + g_object_weak_ref (G_OBJECT (ce), contact_list_editor_destroy_notify, ce); - gtk_object_set (GTK_OBJECT (ce), + g_object_set (ce, "book", book, "card", list_card, "is_new_list", is_new_list, @@ -711,7 +709,7 @@ e_contact_list_editor_create_table(gchar *name, EVOLUTION_ETSPECDIR "/e-contact-list-editor.etspec", NULL); - gtk_object_set_data(GTK_OBJECT(table), "model", model); + g_object_set_data(G_OBJECT(table), "model", model); return table; } @@ -785,7 +783,7 @@ close_dialog (EContactListEditor *cle) gtk_widget_destroy (cle->app); cle->app = NULL; - gtk_signal_emit (GTK_OBJECT (cle), contact_list_editor_signals[EDITOR_CLOSED]); + g_signal_emit (cle, contact_list_editor_signals[EDITOR_CLOSED], 0); } /* Callback used when the editor is destroyed */ @@ -877,7 +875,7 @@ table_drag_data_received_cb (ETable *table, int row, int col, changed = TRUE; } } - g_list_foreach (card_list, (GFunc)gtk_object_unref, NULL); + g_list_foreach (card_list, (GFunc)g_object_unref, NULL); g_list_free (card_list); /* Skip to the end of the list */ @@ -923,7 +921,7 @@ extract_info(EContactListEditor *editor) char *string = e_utf8_gtk_editable_get_chars(GTK_EDITABLE (editor->list_name_entry), 0, -1); if (string && *string) - gtk_object_set(GTK_OBJECT(card), + g_object_set (card, "file_as", string, "full_name", string, NULL); @@ -931,13 +929,13 @@ extract_info(EContactListEditor *editor) g_free (string); - gtk_object_set (GTK_OBJECT(card), + g_object_set (card, "list", GINT_TO_POINTER (TRUE), "list_show_addresses", GINT_TO_POINTER (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(editor->visible_addrs_checkbutton))), NULL); - gtk_object_get (GTK_OBJECT(card), + g_object_get (card, "email", &email_list, NULL); @@ -971,7 +969,7 @@ fill_in_info(EContactListEditor *editor) EList *email_list; EIterator *email_iter; - gtk_object_get (GTK_OBJECT (editor->card), + g_object_get (editor->card, "file_as", &file_as, "email", &email_list, "list", &is_evolution_list, diff --git a/addressbook/gui/contact-list-editor/e-contact-list-model.c b/addressbook/gui/contact-list-editor/e-contact-list-model.c index bf6c1fb7ad..91e2965d88 100644 --- a/addressbook/gui/contact-list-editor/e-contact-list-model.c +++ b/addressbook/gui/contact-list-editor/e-contact-list-model.c @@ -158,7 +158,7 @@ e_contact_list_model_new () { EContactListModel *model; - model = gtk_type_new (e_contact_list_model_get_type ()); + model = g_object_new (E_TYPE_CONTACT_LIST_MODEL, NULL); e_contact_list_model_construct (model); diff --git a/addressbook/gui/contact-list-editor/e-contact-list-model.h b/addressbook/gui/contact-list-editor/e-contact-list-model.h index b57a785b88..bb07d83544 100644 --- a/addressbook/gui/contact-list-editor/e-contact-list-model.h +++ b/addressbook/gui/contact-list-editor/e-contact-list-model.h @@ -11,11 +11,11 @@ G_BEGIN_DECLS -#define E_CONTACT_LIST_MODEL_TYPE (e_contact_list_model_get_type ()) -#define E_CONTACT_LIST_MODEL(o) (GTK_CHECK_CAST ((o), E_CONTACT_LIST_MODEL_TYPE, EContactListModel)) -#define E_CONTACT_LIST_MODEL_CLASS(k) (GTK_CHECK_CLASS_CAST((k), E_CONTACT_LIST_MODEL_TYPE, EContactListModelClass)) -#define E_IS_CONTACT_LIST_MODEL(o) (GTK_CHECK_TYPE ((o), E_CONTACT_LIST_MODEL_TYPE)) -#define E_IS_CONTACT_LIST_MODEL_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), E_CONTACT_LIST_MODEL_TYPE)) +#define E_TYPE_CONTACT_LIST_MODEL (e_contact_list_model_get_type ()) +#define E_CONTACT_LIST_MODEL(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TYPE_CONTACT_LIST_MODEL, EContactListModel)) +#define E_CONTACT_LIST_MODEL_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TYPE_CONTACT_LIST_MODEL, EContactListModelClass)) +#define E_IS_CONTACT_LIST_MODEL(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TYPE_CONTACT_LIST_MODEL)) +#define E_IS_CONTACT_LIST_MODEL_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TYPE_CONTACT_LIST_MODEL)) typedef struct _EContactListModel EContactListModel; typedef struct _EContactListModelClass EContactListModelClass; -- cgit v1.2.3