[haiku-commits] Re: r41266 - haiku/trunk/src/apps/mail

  • From: Stephan Aßmus <superstippi@xxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Tue, 19 Apr 2011 12:35:23 +0200

Am 19.04.2011 11:38, schrieb philippe.houdoin@xxxxxxxxx:
Author: phoudoin
Date: 2011-04-19 11:38:37 +0200 (Tue, 19 Apr 2011)
New Revision: 41266
Changeset: https://dev.haiku-os.org/changeset/41266
Ticket: https://dev.haiku-os.org/ticket/4789

Modified:
    haiku/trunk/src/apps/mail/Header.cpp
    haiku/trunk/src/apps/mail/MailWindow.cpp
Log:
Patch by Sean "jalopeura" Healy: save and restore account and encoding of draft 
mails.
This fix #4789. Thanks.


Modified: haiku/trunk/src/apps/mail/Header.cpp
===================================================================
--- haiku/trunk/src/apps/mail/Header.cpp        2011-04-18 23:44:20 UTC (rev 
41265)
+++ haiku/trunk/src/apps/mail/Header.cpp        2011-04-19 09:38:37 UTC (rev 
41266)
@@ -640,6 +640,13 @@
                        int32 account;
                        if (msg->FindInt32("id",(int32 *)&account)>= B_OK)
                                fAccountID = account;
+                       
+                       BMessage message(FIELD_CHANGED);
+                       // field doesn't matter; no special processing for this 
field
+                       // it's just to turn on the save button
+                       message.AddInt32("bitmask", 0);
+                       Window()->PostMessage(&message, Window());
+                       
                        break;
                }

@@ -654,6 +661,13 @@
                        message.what = CHARSET_CHOICE_MADE;
                        message.AddInt32 ("charset", fCharacterSetUserSees);
                        Window()->PostMessage (&message, Window());
+                       
+                       BMessage message2(FIELD_CHANGED);
+                       // field doesn't matter; no special processing for this 
field
+                       // it's just to turn on the save button
+                       message2.AddInt32("bitmask", 0);
+                       Window()->PostMessage(&message2, Window());
+                       
                        break;
                }
        }

It is really unfortunate that there is no actual data model in Mail, but all the information is actually stored in the UI. Otherwise such hacks as above would be utterly unnecessary.

Best regards,
-Stephan

Other related posts: