2006-03-23 [wwp] 2.0.0cvs166
authorTristan Chabredier <wwp@claws-mail.org>
Thu, 23 Mar 2006 13:59:30 +0000 (13:59 +0000)
committerTristan Chabredier <wwp@claws-mail.org>
Thu, 23 Mar 2006 13:59:30 +0000 (13:59 +0000)
* src/summaryview.c
* src/gtk/description_window.c
fix display of From/To column title when in appropriate folders (queue/sent/drafts)
and headers are translated; adjust description windows' width to fit their
contents. Patches by Pawel Pekala <c0rn@o2.pl>.

ChangeLog
PATCHSETS
configure.ac
src/gtk/description_window.c
src/summaryview.c

index 3726427a4132bf57d13ffd579f5e8ca3fb2bfd44..2a56b8594e0cc7975957dbdf3472e895879c043e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2006-03-23 [wwp]       2.0.0cvs166
+
+       * src/summaryview.c
+       * src/gtk/description_window.c
+               fix display of From/To column title when in appropriate folders (queue/sent/drafts)
+               and headers are translated; adjust description windows' width to fit their
+               contents. Patches by Pawel Pekala <c0rn@o2.pl>.
+
 2006-03-23 [paul]      2.0.0cvs165
 
        * src/common/utils.c
index a13a27f7c49e2d806c598f058b989193ad22d396..8f9b95b187cdad6defb883265de74cc71ad74c6b 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.654.2.1392 -r 1.654.2.1393 configure.ac;  ) > 2.0.0cvs163.patchset
 ( cvs diff -u -r 1.36.2.58 -r 1.36.2.59 src/common/utils.c;  ) > 2.0.0cvs164.patchset
 ( cvs diff -u -r 1.36.2.59 -r 1.36.2.60 src/common/utils.c;  ) > 2.0.0cvs165.patchset
+( cvs diff -u -r 1.395.2.185 -r 1.395.2.186 src/summaryview.c;  cvs diff -u -r 1.5.2.17 -r 1.5.2.18 src/gtk/description_window.c;  ) > 2.0.0cvs166.patchset
index 87f7083a0bc91e4cf882e7206ab7f02147e01cb0..c49a4fe162dd36b93682e08d187f7fa9d38f6495 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=0
 MICRO_VERSION=0
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=165
+EXTRA_VERSION=166
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index c6d82b987205ac4fffcc7f2a3636e16d294e2bb5..8b15ecf28e76a6ad670ae6d372e7887fa9e67458 100644 (file)
@@ -79,9 +79,10 @@ static void description_create(DescriptionWindow * dwindow)
        int sz;
        int line;
        int j;
-
+       int max_width = 0;
+       GtkRequisition req;
+       
        dwindow->window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
-       gtk_widget_set_size_request(dwindow->window,400,450);
        
        gtk_window_set_title(GTK_WINDOW(dwindow->window),
                             gettext(dwindow->title));
@@ -128,6 +129,10 @@ static void description_create(DescriptionWindow * dwindow)
                                                 col, colend, line, line+1,
                                                 (GtkAttachOptions) (GTK_FILL),
                                                 (GtkAttachOptions) (0), 0, 2);
+
+                               gtk_widget_size_request(label, &req);
+                               if(req.width > max_width)
+                                       max_width = req.width;
                        }
                } else {
                        GtkWidget *separator;
@@ -141,6 +146,8 @@ static void description_create(DescriptionWindow * dwindow)
                line++;
        }
 
+       max_width += 150;
+
        gtkut_stock_button_set_create(&hbbox, &close_btn, GTK_STOCK_CLOSE,
                                      NULL, NULL, NULL, NULL);
        gtk_widget_show(hbbox);
@@ -157,6 +164,9 @@ static void description_create(DescriptionWindow * dwindow)
        gtk_widget_show(label);
        gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT);
        gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);
+       gtk_widget_size_request(label, &req);
+       if(req.width > max_width)
+               max_width = req.width + 20;
        gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
 
        gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(scrolledwin),
@@ -178,6 +188,8 @@ static void description_create(DescriptionWindow * dwindow)
                         G_CALLBACK(gtk_main_quit), NULL);
 
        gtk_widget_show_all(table);
+       gtk_widget_set_size_request(dwindow->window,
+                               (max_width < 400) ? 400 : max_width, 450);      
 }
 
 static gboolean description_window_key_pressed(GtkWidget *widget,
index 0e509cb31743f0209a001cc3c68f43bbe14e3fa8..21207d457a3198d7219a862476899629fa5dcb68 100644 (file)
@@ -759,6 +759,11 @@ void summary_init(SummaryView *summaryview)
 ( (m->msgnum == displayed_msgnum) \
   && (!g_ascii_strcasecmp(m->folder->name,item->name)) )
 
+#define FOLDER_SHOWS_TO_HDR(i) \
+( folder_has_parent_of_type(i, F_OUTBOX) \
+  ||  folder_has_parent_of_type(i, F_DRAFT) \
+  ||  folder_has_parent_of_type(i, F_QUEUE) )
+  
 static void summary_switch_from_to(SummaryView *summaryview, FolderItem *item)
 {
        gboolean show_from = FALSE, show_to = FALSE;
@@ -769,9 +774,7 @@ static void summary_switch_from_to(SummaryView *summaryview, FolderItem *item)
        
        if (!item)
                return;
-       if (folder_has_parent_of_type(item, F_OUTBOX)
-       ||  folder_has_parent_of_type(item, F_DRAFT)
-       ||  folder_has_parent_of_type(item, F_QUEUE))
+       if(FOLDER_SHOWS_TO_HDR(item))
                show_to = TRUE;
        else
                show_from = TRUE;
@@ -2050,6 +2053,7 @@ static void summary_status_show(SummaryView *summaryview)
 static void summary_set_column_titles(SummaryView *summaryview)
 {
        GtkCList *clist = GTK_CLIST(summaryview->ctree);
+       FolderItem *item = summaryview->folder_item;
        GtkWidget *hbox;
        GtkWidget *label;
        GtkWidget *arrow;
@@ -2085,6 +2089,9 @@ static void summary_set_column_titles(SummaryView *summaryview)
                case S_COL_TO:
                case S_COL_DATE:
                case S_COL_NUMBER:
+                       if(type == S_COL_FROM && item != NULL &&
+                                       FOLDER_SHOWS_TO_HDR(item))
+                               type = S_COL_TO;
                        if (prefs_common.trans_hdr)
                                title = gettext(col_label[type]);
                        else
@@ -2784,9 +2791,7 @@ void summary_reedit(SummaryView *summaryview)
 
        if (!summaryview->selected) return;
        if (!summaryview->folder_item) return;
-       if (!folder_has_parent_of_type(summaryview->folder_item, F_OUTBOX)
-       &&  !folder_has_parent_of_type(summaryview->folder_item, F_DRAFT)
-       &&  !folder_has_parent_of_type(summaryview->folder_item, F_QUEUE))
+       if (!FOLDER_SHOWS_TO_HDR(summaryview->folder_item))
                return;
 
        msginfo = gtk_ctree_node_get_row_data(GTK_CTREE(summaryview->ctree),
@@ -4946,9 +4951,7 @@ void summaryview_activate_quicksearch(SummaryView *summaryview)
 
 static void summary_open_row(GtkSCTree *sctree, SummaryView *summaryview)
 {
-       if (folder_has_parent_of_type(summaryview->folder_item, F_OUTBOX)
-       ||  folder_has_parent_of_type(summaryview->folder_item, F_DRAFT)
-       ||  folder_has_parent_of_type(summaryview->folder_item, F_QUEUE))
+       if (FOLDER_SHOWS_TO_HDR(summaryview->folder_item))
                summary_reedit(summaryview);
        else
                summary_open_msg(summaryview);