From 5f751d21a4eceace423ab945fbe0703c1b721d22 Mon Sep 17 00:00:00 2001 From: Sankar P Date: Mon, 9 Jul 2007 05:32:40 +0000 Subject: Committed on behalf of Gilles Dartiguelongue 2007-07-09 Sankar P * Committed on behalf of Gilles Dartiguelongue * imap-headers.c: (add_header_clicked), (remove_header_clicked), (org_gnome_imap_headers): * imap-headers.glade: HIGify. Disable the Delete button when there are no headers. See bug #437892 svn path=/trunk/; revision=33778 --- plugins/imap-features/ChangeLog | 10 + plugins/imap-features/imap-headers.c | 20 +- plugins/imap-features/imap-headers.glade | 464 ++++++++++++++++++------------- 3 files changed, 290 insertions(+), 204 deletions(-) (limited to 'plugins') diff --git a/plugins/imap-features/ChangeLog b/plugins/imap-features/ChangeLog index 9d0bf7c650..de7e9ec02a 100644 --- a/plugins/imap-features/ChangeLog +++ b/plugins/imap-features/ChangeLog @@ -1,3 +1,13 @@ +2007-07-09 Sankar P + + * Committed on behalf of Gilles Dartiguelongue + + * imap-headers.c: (add_header_clicked), (remove_header_clicked), + (org_gnome_imap_headers): + * imap-headers.glade: + HIGify. Disable the Delete button when there are no headers. + See bug #437892 + 2007-05-14 Sankar P ** Committed on behalf of Xiurong Simon Zheng diff --git a/plugins/imap-features/imap-headers.c b/plugins/imap-features/imap-headers.c index 54d400fed2..2c190297a2 100644 --- a/plugins/imap-features/imap-headers.c +++ b/plugins/imap-features/imap-headers.c @@ -30,6 +30,7 @@ #include #include +#include #include #include @@ -127,7 +128,7 @@ add_header_clicked (GtkButton *button) GtkDialog *dialog; GtkEntry *header; GtkTreeModel *model; - GtkTreeIter iter; + GtkTreeIter iter, first; gint result; dialog = GTK_DIALOG (gtk_dialog_new_with_buttons (_("Custom Header"), @@ -143,15 +144,20 @@ add_header_clicked (GtkButton *button) gtk_dialog_set_default_response (dialog, GTK_RESPONSE_ACCEPT); gtk_widget_show_all (GTK_WIDGET(dialog)); result = gtk_dialog_run (GTK_DIALOG (dialog)); + model = gtk_tree_view_get_model (custom_headers_tree); + switch (result) { case GTK_RESPONSE_ACCEPT: - model = gtk_tree_view_get_model (custom_headers_tree); gtk_tree_store_append (GTK_TREE_STORE(model), &iter, NULL); gtk_tree_store_set (GTK_TREE_STORE(model), &iter, 0, gtk_entry_get_text (header), -1); break; } + gtk_widget_destroy (GTK_WIDGET(dialog)); + + if (gtk_tree_model_get_iter_first (model, &first)==FALSE) + gtk_widget_set_sensitive (GTK_WIDGET (button), TRUE); } static void @@ -159,7 +165,7 @@ remove_header_clicked (GtkButton *button) { GtkTreeSelection *select; GtkTreeModel *model; - GtkTreeIter iter; + GtkTreeIter iter, first; select = gtk_tree_view_get_selection (custom_headers_tree); @@ -167,6 +173,10 @@ remove_header_clicked (GtkButton *button) { gtk_tree_store_remove(GTK_TREE_STORE(model), &iter); } + + + if (gtk_tree_model_get_iter_first (model, &first)==FALSE) + gtk_widget_set_sensitive (GTK_WIDGET (button), FALSE); } static void @@ -191,6 +201,7 @@ org_gnome_imap_headers (EPlugin *epl, EConfigHookItemFactoryData *data) GladeXML *gladexml; GtkCellRenderer *renderer; GtkTreeViewColumn *column; + GtkTreeIter first; target_account = (EMConfigTargetAccount *)data->config->target; account = target_account->account; @@ -245,6 +256,9 @@ org_gnome_imap_headers (EPlugin *epl, EConfigHookItemFactoryData *data) column = gtk_tree_view_column_new_with_attributes (_("Custom Headers"), renderer, "text", 0, NULL); gtk_tree_view_append_column (custom_headers_tree , column); + if (gtk_tree_model_get_iter_first (gtk_tree_view_get_model (custom_headers_tree), &first)==FALSE) + gtk_widget_set_sensitive (GTK_WIDGET (remove_header), FALSE); + g_signal_connect (all_headers, "toggled", G_CALLBACK(fetch_all_headers_toggled), NULL); g_signal_connect (add_header, "clicked", G_CALLBACK(add_header_clicked), NULL); g_signal_connect (remove_header, "clicked", G_CALLBACK(remove_header_clicked), NULL); diff --git a/plugins/imap-features/imap-headers.glade b/plugins/imap-features/imap-headers.glade index 38c57cc495..986337e69d 100644 --- a/plugins/imap-features/imap-headers.glade +++ b/plugins/imap-features/imap-headers.glade @@ -20,144 +20,139 @@ False - + + 6 True - 0.5 - 0.5 - 1 - 1 - 0 - 0 - 2 - 0 + False + 6 - + + 6 True - False - 8 + 0 + 0 + GTK_SHADOW_NONE - + + 6 True - <b>IMAP Headers </b> - False - True - GTK_JUSTIFY_LEFT - False - False 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - + 0 + 1 + 1 + 0 + 0 + 12 + 0 - - - True - Select your IMAP Header Preferences. + + + True + False + 6 + + + + True + Select your IMAP Header Preferences. The more headers you have the more time it will take to download. - False - False - GTK_JUSTIFY_LEFT - False - False - 0.070000000298 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + - - - True - True - Fetch A_ll Headers - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - - + + + True + True + Fetch A_ll Headers + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + - - - True - True - _Basic Headers - (Fastest) + + + True + True + _Basic Headers - (Fastest) Use this if you do not have filters based on mailing lists - True - GTK_RELIEF_NORMAL - True - False - False - True - allHeaders - - - 0 - False - False - - + True + GTK_RELIEF_NORMAL + True + False + False + True + allHeaders + + + 0 + False + False + + - - - True - True - Basic and _Mailing List Headers (Default) - True - GTK_RELIEF_NORMAL - True - False - False - True - allHeaders + + + True + True + Basic and _Mailing List Headers (Default) + True + GTK_RELIEF_NORMAL + True + False + False + True + allHeaders + + + 0 + False + False + + + + - - 0 - False - False - - + True - <b>Custom Headers</b> + <b>IMAP Headers</b> False True GTK_JUSTIFY_LEFT False False - 0 + 0.5 0.5 0 0 @@ -167,127 +162,194 @@ Use this if you do not have filters based on mailing lists 0 - 0 - False - False + label_item + + + 0 + False + True + + - - - True - True - Give the extra headers that you need to fetch in addition to the above standard headers. -You can ignore this if you choose "All Headers". - False - False - GTK_JUSTIFY_LEFT - True - True - 0.0799999982119 - 0 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - + + + 6 + True + 0 + 0 + GTK_SHADOW_NONE - + + 6 True - False - 5 - - - - True - True - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - GTK_SHADOW_IN - GTK_CORNER_TOP_LEFT - - - - True - True - True - False - False - True - False - False - False - - - - - 0 - True - True - - + 0 + 0 + 1 + 1 + 0 + 0 + 12 + 0 - + True False - 0 + 6 - + True True - gtk-add - True - GTK_RELIEF_NORMAL - True + Give the extra headers that you need to fetch in addition to the above standard headers. +You can ignore this if you choose "All Headers". + False + False + GTK_JUSTIFY_LEFT + False + True + 0 + 0 + 0 + 0 + PANGO_ELLIPSIZE_NONE + 1 + False + 0 - 4 + 0 False - False + True - + True - True - gtk-remove - True - GTK_RELIEF_NORMAL - True + False + 5 + + + + True + True + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_SHADOW_IN + GTK_CORNER_TOP_LEFT + + + + True + True + False + False + False + True + False + False + False + + + + + 0 + True + True + + + + + + True + False + 0 + + + + True + GTK_BUTTONBOX_DEFAULT_STYLE + 6 + + + + True + True + gtk-add + True + GTK_RELIEF_NORMAL + True + + + + + + True + True + gtk-remove + True + GTK_RELIEF_NORMAL + True + + + + + 4 + False + False + + + + + 0 + False + True + + 0 - False - False + True + True - - 0 - False - True - + + + + + True + <b>Custom Headers</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + - 0 - True - True + label_item + + 0 + True + True + -- cgit v1.2.3