From 72797decc12602b181f69dba7c54df7a0d1b9326 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sat, 30 Jan 2010 14:03:19 -0500 Subject: Giant leap towards GSEAL compliance. --- .../gui/contact-editor/e-contact-editor-fullname.c | 39 +++++++++++++--------- addressbook/gui/contact-editor/e-contact-editor.c | 31 ++++++----------- .../gui/contact-editor/e-contact-quick-add.c | 34 ++++++++++--------- 3 files changed, 52 insertions(+), 52 deletions(-) (limited to 'addressbook/gui/contact-editor') diff --git a/addressbook/gui/contact-editor/e-contact-editor-fullname.c b/addressbook/gui/contact-editor/e-contact-editor-fullname.c index 3f80ec9f4b..a872afb7d9 100644 --- a/addressbook/gui/contact-editor/e-contact-editor-fullname.c +++ b/addressbook/gui/contact-editor/e-contact-editor-fullname.c @@ -101,20 +101,28 @@ static void e_contact_editor_fullname_init (EContactEditorFullname *e_contact_editor_fullname) { GtkBuilder *builder; + GtkDialog *dialog; + GtkWidget *parent; GtkWidget *widget; + GtkWidget *action_area; + GtkWidget *content_area; + const gchar *title; + + dialog = GTK_DIALOG (e_contact_editor_fullname); + action_area = gtk_dialog_get_action_area (dialog); + content_area = gtk_dialog_get_content_area (dialog); gtk_widget_realize (GTK_WIDGET (e_contact_editor_fullname)); - gtk_dialog_set_has_separator (GTK_DIALOG (e_contact_editor_fullname), - FALSE); - gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (e_contact_editor_fullname)->vbox), 0); - gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (e_contact_editor_fullname)->action_area), 12); + gtk_dialog_set_has_separator (dialog, FALSE); + gtk_container_set_border_width (GTK_CONTAINER (action_area), 12); + gtk_container_set_border_width (GTK_CONTAINER (content_area), 0); - gtk_dialog_add_buttons (GTK_DIALOG (e_contact_editor_fullname), - GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, - GTK_STOCK_OK, GTK_RESPONSE_OK, - NULL); + gtk_dialog_add_buttons ( + dialog, + GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, + GTK_STOCK_OK, GTK_RESPONSE_OK, NULL); - gtk_window_set_resizable(GTK_WINDOW(e_contact_editor_fullname), TRUE); + gtk_window_set_resizable (GTK_WINDOW (dialog), TRUE); e_contact_editor_fullname->name = NULL; @@ -124,14 +132,15 @@ e_contact_editor_fullname_init (EContactEditorFullname *e_contact_editor_fullnam e_contact_editor_fullname->builder = builder; widget = e_builder_get_widget(builder, "dialog-checkfullname"); - gtk_window_set_title (GTK_WINDOW (e_contact_editor_fullname), - GTK_WINDOW (widget)->title); + title = gtk_window_get_title (GTK_WINDOW (widget)); + gtk_window_set_title (GTK_WINDOW (e_contact_editor_fullname), title); widget = e_builder_get_widget(builder, "table-checkfullname"); - g_object_ref(widget); - gtk_container_remove(GTK_CONTAINER(widget->parent), widget); - gtk_box_pack_start (GTK_BOX (GTK_DIALOG (e_contact_editor_fullname)->vbox), widget, TRUE, TRUE, 0); - g_object_unref(widget); + parent = gtk_widget_get_parent (widget); + g_object_ref (widget); + gtk_container_remove (GTK_CONTAINER (parent), widget); + gtk_box_pack_start (GTK_BOX (content_area), widget, TRUE, TRUE, 0); + g_object_unref (widget); gtk_window_set_icon_name ( GTK_WINDOW (e_contact_editor_fullname), "contact-new"); diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c index 95e9c34481..38490aee72 100644 --- a/addressbook/gui/contact-editor/e-contact-editor.c +++ b/addressbook/gui/contact-editor/e-contact-editor.c @@ -3457,24 +3457,7 @@ expand_phone_toggle (EContactEditor *ce) GtkWidget *phone_ext_table; phone_ext_table = e_builder_get_widget (ce->builder, "table-phone-extended"); -#if GTK_CHECK_VERSION(2,19,7) expand_phone (ce, !gtk_widget_get_visible (phone_ext_table)); -#else - expand_phone (ce, !GTK_WIDGET_VISIBLE (phone_ext_table)); -#endif -} - -static void -expand_mail_toggle (EContactEditor *ce) -{ - GtkWidget *mail; - - mail = e_builder_get_widget (ce->builder, "entry-email-4"); -#if GTK_CHECK_VERSION(2,19,7) - expand_mail (ce, !gtk_widget_get_visible (mail)); -#else - expand_mail (ce, !GTK_WIDGET_VISIBLE (mail)); -#endif } static void @@ -3482,6 +3465,7 @@ e_contact_editor_init (EContactEditor *e_contact_editor) { GtkBuilder *builder; EShell *shell; + GtkWidget *container; GtkWidget *widget, *label; GtkEntryCompletion *completion; @@ -3512,8 +3496,10 @@ e_contact_editor_init (EContactEditor *e_contact_editor) gtk_widget_ensure_style (widget); gtk_window_set_type_hint (GTK_WINDOW (widget), GDK_WINDOW_TYPE_HINT_NORMAL); - gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (widget)->vbox), 0); - gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (widget)->action_area), 12); + container = gtk_dialog_get_action_area (GTK_DIALOG (widget)); + gtk_container_set_border_width (GTK_CONTAINER (container), 12); + container = gtk_dialog_get_content_area (GTK_DIALOG (widget)); + gtk_container_set_border_width (GTK_CONTAINER (container), 0); init_all (e_contact_editor); @@ -3909,9 +3895,12 @@ static void e_contact_editor_raise (EABEditor *editor) { EContactEditor *ce = E_CONTACT_EDITOR (editor); + GdkWindow *window; + + window = gtk_widget_get_window (ce->app); - if (GTK_WIDGET (ce->app)->window) - gdk_window_raise (GTK_WIDGET (ce->app)->window); + if (window != NULL) + gdk_window_raise (window); } /** diff --git a/addressbook/gui/contact-editor/e-contact-quick-add.c b/addressbook/gui/contact-editor/e-contact-quick-add.c index d10ceeac6f..0242d20c02 100644 --- a/addressbook/gui/contact-editor/e-contact-quick-add.c +++ b/addressbook/gui/contact-editor/e-contact-quick-add.c @@ -342,6 +342,7 @@ build_quick_add_dialog (QuickAdd *qa) { ESourceList *source_list; GConfClient *gconf_client; + GtkWidget *container; GtkWidget *dialog; GtkWidget *label; GtkTable *table; @@ -350,19 +351,21 @@ build_quick_add_dialog (QuickAdd *qa) g_return_val_if_fail (qa != NULL, NULL); - dialog = gtk_dialog_new_with_buttons (_("Contact Quick-Add"), - e_shell_get_active_window (NULL), - GTK_DIALOG_NO_SEPARATOR, - _("_Edit Full"), QUICK_ADD_RESPONSE_EDIT_FULL, - GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, - GTK_STOCK_OK, GTK_RESPONSE_OK, - NULL); + dialog = gtk_dialog_new_with_buttons ( + _("Contact Quick-Add"), + e_shell_get_active_window (NULL), + GTK_DIALOG_NO_SEPARATOR, + _("_Edit Full"), QUICK_ADD_RESPONSE_EDIT_FULL, + GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, + GTK_STOCK_OK, GTK_RESPONSE_OK, + NULL); gtk_widget_ensure_style (dialog); - gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), - 0); - gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (dialog)->action_area), - 12); + + container = gtk_dialog_get_action_area (GTK_DIALOG (dialog)); + gtk_container_set_border_width (GTK_CONTAINER (container), 12); + container = gtk_dialog_get_content_area (GTK_DIALOG (dialog)); + gtk_container_set_border_width (GTK_CONTAINER (container), 0); g_signal_connect (dialog, "response", G_CALLBACK (clicked_cb), qa); @@ -460,11 +463,10 @@ build_quick_add_dialog (QuickAdd *qa) 1, 2, 2, 3, GTK_EXPAND | GTK_FILL, 0, xpad, ypad); - gtk_container_set_border_width (GTK_CONTAINER (table), - 12); - gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), - GTK_WIDGET (table), - FALSE, FALSE, 0); + gtk_container_set_border_width (GTK_CONTAINER (table), 12); + container = gtk_dialog_get_content_area (GTK_DIALOG (dialog)); + gtk_box_pack_start ( + GTK_BOX (container), GTK_WIDGET (table), FALSE, FALSE, 0); gtk_widget_show_all (GTK_WIDGET (table)); return dialog; -- cgit v1.2.3