From 80906889c2d0c7db9a69ca5d2e3a7657effd311b Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Fri, 21 Feb 2003 19:05:57 +0000 Subject: Use tables instead of vboxes, so that groups of label/entry pairs (as in * mail-account-gui.c (mail_account_gui_build_extra_conf): Use tables instead of vboxes, so that groups of label/entry pairs (as in Connector's config page) can line up nicely. * mail-config.glade: Turn extra_vbox and extra_mailcheck_vbox into tables. * mail-config-druid.c (get_fn): s/extra_vbox/extra_table/ * Makefile.am (libevolution_mail_la_LIBADD): s/libcomposer.a/libcomposer.la/ svn path=/trunk/; revision=19993 --- mail/ChangeLog | 14 +++++++ mail/Makefile.am | 2 +- mail/mail-account-gui.c | 105 +++++++++++++++++++++++++++-------------------- mail/mail-config-druid.c | 2 +- mail/mail-config.glade | 63 ++++++++++++++++------------ 5 files changed, 113 insertions(+), 73 deletions(-) (limited to 'mail') diff --git a/mail/ChangeLog b/mail/ChangeLog index 0a523f4a16..18f733a239 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,17 @@ +2003-02-21 Dan Winship + + * mail-account-gui.c (mail_account_gui_build_extra_conf): Use + tables instead of vboxes, so that groups of label/entry pairs (as + in Connector's config page) can line up nicely. + + * mail-config.glade: Turn extra_vbox and extra_mailcheck_vbox into + tables. + + * mail-config-druid.c (get_fn): s/extra_vbox/extra_table/ + + * Makefile.am (libevolution_mail_la_LIBADD): + s/libcomposer.a/libcomposer.la/ + 2003-02-20 Jeffrey Stedfast * mail-callbacks.c (mark_all_as_seen): Use diff --git a/mail/Makefile.am b/mail/Makefile.am index 422fdba2f2..c748e0557e 100644 --- a/mail/Makefile.am +++ b/mail/Makefile.am @@ -156,7 +156,7 @@ libevolution_mail_la_LIBADD = \ $(top_builddir)/camel/libcamel.la \ $(top_builddir)/e-util/libeutil.la \ $(top_builddir)/shell/libeshell.la \ - $(top_builddir)/composer/libcomposer.a \ + $(top_builddir)/composer/libcomposer.la \ $(top_builddir)/widgets/misc/libemiscwidgets.la \ $(top_builddir)/widgets/misc/libefilterbar.la \ $(top_builddir)/addressbook/backend/ebook/libebook.la \ diff --git a/mail/mail-account-gui.c b/mail/mail-account-gui.c index 3d9488faf0..a2896f6017 100644 --- a/mail/mail-account-gui.c +++ b/mail/mail-account-gui.c @@ -726,13 +726,14 @@ void mail_account_gui_build_extra_conf (MailAccountGui *gui, const char *url_string) { CamelURL *url; - GtkWidget *mailcheck_frame, *main_vbox, *cur_vbox; + GtkWidget *mailcheck_frame, *mailcheck_hbox; GtkWidget *hostname_label, *username_label, *path_label; GtkWidget *hostname, *username, *path; + GtkTable *main_table, *cur_table; CamelProviderConfEntry *entries; GList *children, *child; char *name; - int i; + int i, rows; if (url_string) url = camel_url_new (url_string, NULL); @@ -751,44 +752,41 @@ mail_account_gui_build_extra_conf (MailAccountGui *gui, const char *url_string) gtk_label_set_text_with_mnemonic (GTK_LABEL (path_label), _("_Path:")); path = glade_xml_get_widget (gui->xml, "source_path"); - main_vbox = glade_xml_get_widget (gui->xml, "extra_vbox"); - + /* Remove the contents of the extra_table except for the + * mailcheck_frame. + */ + main_table = (GtkTable *)glade_xml_get_widget (gui->xml, "extra_table"); mailcheck_frame = glade_xml_get_widget (gui->xml, "extra_mailcheck_frame"); - - /* Remove any additional mailcheck items. */ - children = gtk_container_get_children(GTK_CONTAINER (mailcheck_frame)); - if (children) { - cur_vbox = children->data; - g_list_free (children); - children = gtk_container_get_children(GTK_CONTAINER (cur_vbox)); - for (child = children; child; child = child->next) { - if (child != children) { - gtk_container_remove (GTK_CONTAINER (cur_vbox), - child->data); - } + children = gtk_container_get_children (GTK_CONTAINER (main_table)); + for (child = children; child; child = child->next) { + if (child->data != (gpointer)mailcheck_frame) { + gtk_container_remove (GTK_CONTAINER (main_table), + child->data); } - g_list_free (children); } + g_list_free (children); + gtk_table_resize (main_table, 1, 2); - /* Remove the contents of the extra_vbox except for the - * mailcheck_frame. - */ - children = gtk_container_get_children(GTK_CONTAINER (main_vbox)); + /* Remove any additional mailcheck items. */ + cur_table = (GtkTable *)glade_xml_get_widget (gui->xml, "extra_mailcheck_table"); + mailcheck_hbox = glade_xml_get_widget (gui->xml, "extra_mailcheck_hbox"); + children = gtk_container_get_children (GTK_CONTAINER (cur_table)); for (child = children; child; child = child->next) { - if (child != children) { - gtk_container_remove (GTK_CONTAINER (main_vbox), + if (child->data != (gpointer)mailcheck_hbox) { + gtk_container_remove (GTK_CONTAINER (cur_table), child->data); } } g_list_free (children); - + gtk_table_resize (cur_table, 1, 2); + if (!gui->source.provider) { - gtk_widget_set_sensitive (main_vbox, FALSE); + gtk_widget_set_sensitive (GTK_WIDGET (main_table), FALSE); if (url) camel_url_free (url); return; } else - gtk_widget_set_sensitive (main_vbox, TRUE); + gtk_widget_set_sensitive (GTK_WIDGET (main_table), TRUE); /* Set up our hash table. */ if (gui->extra_config) @@ -799,7 +797,8 @@ mail_account_gui_build_extra_conf (MailAccountGui *gui, const char *url_string) if (!entries) goto done; - cur_vbox = main_vbox; + cur_table = main_table; + rows = main_table->nrows; for (i = 0; ; i++) { switch (entries[i].type) { case CAMEL_PROVIDER_CONF_SECTION_START: @@ -807,18 +806,27 @@ mail_account_gui_build_extra_conf (MailAccountGui *gui, const char *url_string) GtkWidget *frame; if (entries[i].name && !strcmp (entries[i].name, "mailcheck")) - cur_vbox = glade_xml_get_widget (gui->xml, "extra_mailcheck_vbox"); + cur_table = (GtkTable *)glade_xml_get_widget (gui->xml, "extra_mailcheck_table"); else { frame = gtk_frame_new (entries[i].text); - gtk_box_pack_start (GTK_BOX (main_vbox), frame, FALSE, FALSE, 0); - cur_vbox = gtk_vbox_new (FALSE, 4); - gtk_container_set_border_width (GTK_CONTAINER (cur_vbox), 4); - gtk_container_add (GTK_CONTAINER (frame), cur_vbox); + gtk_container_set_border_width (GTK_CONTAINER (frame), 3); + gtk_table_attach (main_table, frame, 0, 2, + rows, rows + 1, + GTK_EXPAND | GTK_FILL, 0, 0, 0); + + cur_table = (GtkTable *)gtk_table_new (0, 2, FALSE); + rows = 0; + gtk_table_set_row_spacings (cur_table, 4); + gtk_table_set_col_spacings (cur_table, 8); + gtk_container_set_border_width (GTK_CONTAINER (cur_table), 3); + + gtk_container_add (GTK_CONTAINER (frame), GTK_WIDGET (cur_table)); } break; } case CAMEL_PROVIDER_CONF_SECTION_END: - cur_vbox = main_vbox; + cur_table = main_table; + rows = main_table->nrows; break; case CAMEL_PROVIDER_CONF_LABEL: @@ -834,7 +842,10 @@ mail_account_gui_build_extra_conf (MailAccountGui *gui, const char *url_string) } else { /* make a new label */ label = gtk_label_new (entries[i].text); - gtk_box_pack_start (GTK_BOX (cur_vbox), label, FALSE, FALSE, 0); + gtk_table_resize (cur_table, cur_table->nrows + 1, 2); + gtk_table_attach (cur_table, label, 0, 2, rows, rows + 1, + GTK_EXPAND | GTK_FILL, 0, 0, 0); + rows++; } } break; @@ -850,7 +861,10 @@ mail_account_gui_build_extra_conf (MailAccountGui *gui, const char *url_string) else active = atoi (entries[i].value); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (checkbox), active); - gtk_box_pack_start (GTK_BOX (cur_vbox), checkbox, FALSE, FALSE, 0); + + gtk_table_attach (cur_table, checkbox, 0, 2, rows, rows + 1, + GTK_EXPAND | GTK_FILL, 0, 0, 0); + rows++; g_hash_table_insert (gui->extra_config, entries[i].name, checkbox); if (entries[i].depname) setup_toggle (checkbox, entries[i].depname, gui); @@ -859,7 +873,7 @@ mail_account_gui_build_extra_conf (MailAccountGui *gui, const char *url_string) case CAMEL_PROVIDER_CONF_ENTRY: { - GtkWidget *hbox, *label, *entry; + GtkWidget *label, *entry; const char *text; if (!strcmp (entries[i].name, "username")) { @@ -876,15 +890,16 @@ mail_account_gui_build_extra_conf (MailAccountGui *gui, const char *url_string) entry = path; } else { /* make a new text entry with label */ - hbox = gtk_hbox_new (FALSE, 8); label = gtk_label_new (entries[i].text); + gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.0); entry = gtk_entry_new (); - - gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); - gtk_box_pack_end (GTK_BOX (hbox), entry, TRUE, TRUE, 0); - - gtk_box_pack_start (GTK_BOX (cur_vbox), hbox, FALSE, FALSE, 0); g_hash_table_insert (gui->extra_config, entries[i].name, entry); + + gtk_table_attach (cur_table, label, 0, 1, rows, rows + 1, + GTK_FILL, 0, 0, 0); + gtk_table_attach (cur_table, entry, 1, 2, rows, rows + 1, + GTK_EXPAND | GTK_FILL, 0, 0, 0); + rows++; } if (url) @@ -952,7 +967,9 @@ mail_account_gui_build_extra_conf (MailAccountGui *gui, const char *url_string) gtk_box_pack_start (GTK_BOX (hbox), spin, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, TRUE, 4); - gtk_box_pack_start (GTK_BOX (cur_vbox), hbox, FALSE, FALSE, 0); + gtk_table_attach (cur_table, hbox, 0, 2, rows, rows + 1, + GTK_EXPAND | GTK_FILL, 0, 0, 0); + rows++; g_hash_table_insert (gui->extra_config, entries[i].name, checkbox); name = g_strdup_printf ("%s_value", entries[i].name); g_hash_table_insert (gui->extra_config, name, spin); @@ -970,7 +987,7 @@ mail_account_gui_build_extra_conf (MailAccountGui *gui, const char *url_string) } done: - gtk_widget_show_all (main_vbox); + gtk_widget_show_all (GTK_WIDGET (main_table)); if (url) camel_url_free (url); } diff --git a/mail/mail-config-druid.c b/mail/mail-config-druid.c index 15a44b8b69..85d5b1bfb6 100644 --- a/mail/mail-config-druid.c +++ b/mail/mail-config-druid.c @@ -851,7 +851,7 @@ get_fn (EvolutionWizard *wizard, case 2: widget = create_label ("extra_html"); gtk_box_pack_start (GTK_BOX (vbox), widget, FALSE, FALSE, 0); - widget = glade_xml_get_widget (gui->gui->xml, "extra_vbox"); + widget = glade_xml_get_widget (gui->gui->xml, "extra_table"); gtk_widget_reparent (widget, vbox); break; case 3: diff --git a/mail/mail-config.glade b/mail/mail-config.glade index 5a3935884e..b8944cbcb9 100644 --- a/mail/mail-config.glade +++ b/mail/mail-config.glade @@ -38,9 +38,9 @@ Click "Forward" to begin. True Identity - #e5d0bfffe388 - #bdb00817e388 - #e7d80816532c + #0b100829e878 + #8af8081ce878 + #eac0bfffe858 mail-config-druid-identity.png @@ -62,9 +62,9 @@ Click "Forward" to begin. True Receiving Email - #e5d0bfffe388 - #bdb00817e388 - #e7d80816532c + #3f780829e878 + #8af8081ce878 + #eac0bfffe858 mail-config-druid-receive.png @@ -86,9 +86,9 @@ Click "Forward" to begin. True Receiving Email - #e5d0bfffe388 - #bdb00817e388 - #e7d80816532c + #59280829e878 + #8af8081ce878 + #eac0bfffe858 mail-config-druid-receive.png @@ -110,9 +110,9 @@ Click "Forward" to begin. True Sending Email - #e5d0bfffe388 - #bdb00817e388 - #e7d80816532c + #4f60082ce878 + #8af8081ce878 + #eac0bfffe858 mail-config-druid-send.png @@ -134,9 +134,9 @@ Click "Forward" to begin. True Account Management - #e5d0bfffe388 - #bdb00817e388 - #e7d80816532c + #6c18082ce878 + #8af8081ce878 + #eac0bfffe858 mail-config-druid-account-name.png @@ -1403,11 +1403,14 @@ For example: "Work" or "Personal" - - 4 + + 3 True + 1 + 2 False - 0 + 4 + 8 @@ -1418,14 +1421,17 @@ For example: "Work" or "Personal" GTK_SHADOW_ETCHED_IN - + 3 True + 1 + 2 False - 0 + 4 + 8 - + True False 0 @@ -1511,9 +1517,10 @@ For example: "Work" or "Personal" - 0 - False - True + 0 + 2 + 0 + 1 @@ -1539,9 +1546,11 @@ For example: "Work" or "Personal" - 0 - False - True + 0 + 2 + 0 + 1 + fill -- cgit v1.2.3