The "Show Header" option is no longer persistent, and will only affect the
currently shown mail when checked. It just didn't make any sense the way it was before, and was inconsistent, too, as it only affected mails opened after the current one. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26112 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
40bbe4ecf9
commit
8f0dc0c0d8
@ -119,7 +119,6 @@ TMailApp::TMailApp()
|
|||||||
fPrintHelpAndExit(false),
|
fPrintHelpAndExit(false),
|
||||||
|
|
||||||
fWrapMode(true),
|
fWrapMode(true),
|
||||||
fShowHeader(false),
|
|
||||||
fAttachAttributes(true),
|
fAttachAttributes(true),
|
||||||
fColoredQuotes(true),
|
fColoredQuotes(true),
|
||||||
fShowButtonBar(true),
|
fShowButtonBar(true),
|
||||||
@ -693,13 +692,13 @@ TMailApp::_CheckForSpamFilterExistence()
|
|||||||
// Looks at the filter settings to see if the user is using a spam filter.
|
// Looks at the filter settings to see if the user is using a spam filter.
|
||||||
// If there is one there, set fShowSpamGUI to TRUE, otherwise to FALSE.
|
// If there is one there, set fShowSpamGUI to TRUE, otherwise to FALSE.
|
||||||
|
|
||||||
int32 addonNameIndex;
|
int32 addonNameIndex;
|
||||||
const char *addonNamePntr;
|
const char *addonNamePntr;
|
||||||
BDirectory inChainDir;
|
BDirectory inChainDir;
|
||||||
BPath path;
|
BPath path;
|
||||||
BEntry settingsEntry;
|
BEntry settingsEntry;
|
||||||
BFile settingsFile;
|
BFile settingsFile;
|
||||||
BMessage settingsMessage;
|
BMessage settingsMessage;
|
||||||
|
|
||||||
fShowSpamGUI = false;
|
fShowSpamGUI = false;
|
||||||
|
|
||||||
@ -819,7 +818,7 @@ TMailApp::LoadOldSettings()
|
|||||||
fContentFont.SetFamilyAndStyle(fontFamily, fontStyle);
|
fContentFont.SetFamilyAndStyle(fontFamily, fontStyle);
|
||||||
|
|
||||||
file.Read(&fSignatureWindowFrame, sizeof(BRect));
|
file.Read(&fSignatureWindowFrame, sizeof(BRect));
|
||||||
file.Read(&fShowHeader, sizeof(bool));
|
file.Seek(1, SEEK_CUR); // ignore (bool) show header
|
||||||
file.Read(&fWrapMode, sizeof(bool));
|
file.Read(&fWrapMode, sizeof(bool));
|
||||||
file.Read(&fPrefsWindowPos, sizeof(BPoint));
|
file.Read(&fPrefsWindowPos, sizeof(BPoint));
|
||||||
|
|
||||||
@ -915,7 +914,6 @@ TMailApp::SaveSettings()
|
|||||||
settings.AddFloat("FontSize", fContentFont.Size());
|
settings.AddFloat("FontSize", fContentFont.Size());
|
||||||
|
|
||||||
settings.AddRect("SignatureWindowSize", fSignatureWindowFrame);
|
settings.AddRect("SignatureWindowSize", fSignatureWindowFrame);
|
||||||
settings.AddBool("ShowHeadersMode", fShowHeader);
|
|
||||||
settings.AddBool("WordWrapMode", fWrapMode);
|
settings.AddBool("WordWrapMode", fWrapMode);
|
||||||
settings.AddPoint("PreferencesWindowLocation", fPrefsWindowPos);
|
settings.AddPoint("PreferencesWindowLocation", fPrefsWindowPos);
|
||||||
settings.AddString("SignatureText", fSignature);
|
settings.AddString("SignatureText", fSignature);
|
||||||
@ -999,9 +997,6 @@ TMailApp::LoadSettings()
|
|||||||
fSignatureWindowFrame = rect;
|
fSignatureWindowFrame = rect;
|
||||||
|
|
||||||
bool boolValue;
|
bool boolValue;
|
||||||
if (settings.FindBool("ShowHeadersMode", &boolValue) == B_OK)
|
|
||||||
fShowHeader = boolValue;
|
|
||||||
|
|
||||||
if (settings.FindBool("WordWrapMode", &boolValue) == B_OK)
|
if (settings.FindBool("WordWrapMode", &boolValue) == B_OK)
|
||||||
fWrapMode = boolValue;
|
fWrapMode = boolValue;
|
||||||
|
|
||||||
@ -1157,22 +1152,6 @@ TMailApp::WrapMode()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
TMailApp::SetShowHeader(bool show)
|
|
||||||
{
|
|
||||||
BAutolock _(this);
|
|
||||||
fShowHeader = show;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool
|
|
||||||
TMailApp::ShowHeader()
|
|
||||||
{
|
|
||||||
BAutolock _(this);
|
|
||||||
return fShowHeader;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
TMailApp::AttachAttributes()
|
TMailApp::AttachAttributes()
|
||||||
{
|
{
|
||||||
|
@ -76,8 +76,6 @@ class TMailApp : public BApplication {
|
|||||||
BString Signature();
|
BString Signature();
|
||||||
BString ReplyPreamble();
|
BString ReplyPreamble();
|
||||||
bool WrapMode();
|
bool WrapMode();
|
||||||
void SetShowHeader(bool show);
|
|
||||||
bool ShowHeader();
|
|
||||||
bool AttachAttributes();
|
bool AttachAttributes();
|
||||||
bool ColoredQuotes();
|
bool ColoredQuotes();
|
||||||
uint8 ShowButtonBar();
|
uint8 ShowButtonBar();
|
||||||
@ -120,7 +118,6 @@ class TMailApp : public BApplication {
|
|||||||
char* fSignature;
|
char* fSignature;
|
||||||
char* fReplyPreamble;
|
char* fReplyPreamble;
|
||||||
bool fWrapMode;
|
bool fWrapMode;
|
||||||
bool fShowHeader;
|
|
||||||
bool fAttachAttributes;
|
bool fAttachAttributes;
|
||||||
bool fColoredQuotes;
|
bool fColoredQuotes;
|
||||||
uint8 fShowButtonBar;
|
uint8 fShowButtonBar;
|
||||||
|
@ -167,16 +167,15 @@ TMailWindow::TMailWindow(BRect rect, const char* title, TMailApp* app,
|
|||||||
if (messenger != NULL)
|
if (messenger != NULL)
|
||||||
fTrackerMessenger = *messenger;
|
fTrackerMessenger = *messenger;
|
||||||
|
|
||||||
char str[256];
|
char str[256];
|
||||||
char status[272];
|
char status[272];
|
||||||
uint32 message;
|
uint32 message;
|
||||||
float height;
|
float height;
|
||||||
BMenu *menu;
|
BMenu* menu;
|
||||||
BMenu *subMenu;
|
BMenu* subMenu;
|
||||||
BMenuBar *menu_bar;
|
BMenuItem* item;
|
||||||
BMenuItem *item;
|
BMessage* msg;
|
||||||
BMessage *msg;
|
attr_info info;
|
||||||
attr_info info;
|
|
||||||
BFile file(ref, B_READ_ONLY);
|
BFile file(ref, B_READ_ONLY);
|
||||||
|
|
||||||
if (ref) {
|
if (ref) {
|
||||||
@ -190,13 +189,10 @@ TMailWindow::TMailWindow(BRect rect, const char* title, TMailApp* app,
|
|||||||
}
|
}
|
||||||
|
|
||||||
BRect r(0, 0, RIGHT_BOUNDARY, 15);
|
BRect r(0, 0, RIGHT_BOUNDARY, 15);
|
||||||
|
fMenuBar = new BMenuBar(r, "");
|
||||||
|
|
||||||
// Create real menu bar
|
// File Menu
|
||||||
fMenuBar = menu_bar = new BMenuBar(r, "");
|
|
||||||
|
|
||||||
//
|
|
||||||
// File Menu
|
|
||||||
//
|
|
||||||
menu = new BMenu(MDR_DIALECT_CHOICE ("File","F) ファイル"));
|
menu = new BMenu(MDR_DIALECT_CHOICE ("File","F) ファイル"));
|
||||||
|
|
||||||
msg = new BMessage(M_NEW);
|
msg = new BMessage(M_NEW);
|
||||||
@ -225,13 +221,13 @@ TMailWindow::TMailWindow(BRect rect, const char* title, TMailApp* app,
|
|||||||
menu->AddItem(queryMenu);
|
menu->AddItem(queryMenu);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!fIncoming || resending) {
|
if (!fIncoming || resending) {
|
||||||
menu->AddItem(fSendLater = new BMenuItem(
|
menu->AddItem(fSendLater = new BMenuItem(
|
||||||
MDR_DIALECT_CHOICE ("Save as Draft", "S)ドラフトとして保存"),
|
MDR_DIALECT_CHOICE ("Save as Draft", "S)ドラフトとして保存"),
|
||||||
new BMessage(M_SAVE_AS_DRAFT), 'S'));
|
new BMessage(M_SAVE_AS_DRAFT), 'S'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!resending && fIncoming) {
|
if (!resending && fIncoming) {
|
||||||
menu->AddSeparatorItem();
|
menu->AddSeparatorItem();
|
||||||
|
|
||||||
subMenu = new BMenu(MDR_DIALECT_CHOICE ("Close and ","C) 閉じる"));
|
subMenu = new BMenu(MDR_DIALECT_CHOICE ("Close and ","C) 閉じる"));
|
||||||
@ -297,7 +293,7 @@ TMailWindow::TMailWindow(BRect rect, const char* title, TMailApp* app,
|
|||||||
menu->AddItem(fPrint = new BMenuItem(
|
menu->AddItem(fPrint = new BMenuItem(
|
||||||
MDR_DIALECT_CHOICE ("Print", "P) 印刷") B_UTF8_ELLIPSIS,
|
MDR_DIALECT_CHOICE ("Print", "P) 印刷") B_UTF8_ELLIPSIS,
|
||||||
new BMessage(M_PRINT), 'P'));
|
new BMessage(M_PRINT), 'P'));
|
||||||
menu_bar->AddItem(menu);
|
fMenuBar->AddItem(menu);
|
||||||
|
|
||||||
menu->AddSeparatorItem();
|
menu->AddSeparatorItem();
|
||||||
menu->AddItem(item = new BMenuItem(
|
menu->AddItem(item = new BMenuItem(
|
||||||
@ -311,9 +307,8 @@ TMailWindow::TMailWindow(BRect rect, const char* title, TMailApp* app,
|
|||||||
new BMessage(B_QUIT_REQUESTED), 'Q'));
|
new BMessage(B_QUIT_REQUESTED), 'Q'));
|
||||||
item->SetTarget(be_app);
|
item->SetTarget(be_app);
|
||||||
|
|
||||||
//
|
// Edit Menu
|
||||||
// Edit Menu
|
|
||||||
//
|
|
||||||
menu = new BMenu(MDR_DIALECT_CHOICE ("Edit","E) 編集"));
|
menu = new BMenu(MDR_DIALECT_CHOICE ("Edit","E) 編集"));
|
||||||
menu->AddItem(fUndo = new BMenuItem(MDR_DIALECT_CHOICE ("Undo","Z) 元に戻す"), new BMessage(B_UNDO), 'Z', 0));
|
menu->AddItem(fUndo = new BMenuItem(MDR_DIALECT_CHOICE ("Undo","Z) 元に戻す"), new BMessage(B_UNDO), 'Z', 0));
|
||||||
fUndo->SetTarget(NULL, this);
|
fUndo->SetTarget(NULL, this);
|
||||||
@ -353,28 +348,23 @@ TMailWindow::TMailWindow(BRect rect, const char* title, TMailApp* app,
|
|||||||
MDR_DIALECT_CHOICE ("Preferences","P) Mailの設定") B_UTF8_ELLIPSIS,
|
MDR_DIALECT_CHOICE ("Preferences","P) Mailの設定") B_UTF8_ELLIPSIS,
|
||||||
new BMessage(M_PREFS),','));
|
new BMessage(M_PREFS),','));
|
||||||
item->SetTarget(be_app);
|
item->SetTarget(be_app);
|
||||||
menu_bar->AddItem(menu);
|
fMenuBar->AddItem(menu);
|
||||||
menu->AddItem(item = new BMenuItem(
|
menu->AddItem(item = new BMenuItem(
|
||||||
MDR_DIALECT_CHOICE ("Accounts","Accounts") B_UTF8_ELLIPSIS,
|
MDR_DIALECT_CHOICE ("Accounts","Accounts") B_UTF8_ELLIPSIS,
|
||||||
new BMessage(M_ACCOUNTS),'-'));
|
new BMessage(M_ACCOUNTS),'-'));
|
||||||
item->SetTarget(be_app);
|
item->SetTarget(be_app);
|
||||||
|
|
||||||
//
|
|
||||||
// View Menu
|
// View Menu
|
||||||
//
|
|
||||||
|
|
||||||
if (!resending && fIncoming) {
|
if (!resending && fIncoming) {
|
||||||
menu = new BMenu("View");
|
menu = new BMenu("View");
|
||||||
menu->AddItem(fHeader = new BMenuItem(MDR_DIALECT_CHOICE ("Show Header","H) ヘッダーを表示"), new BMessage(M_HEADER), 'H'));
|
menu->AddItem(fHeader = new BMenuItem(MDR_DIALECT_CHOICE ("Show Header","H) ヘッダーを表示"), new BMessage(M_HEADER), 'H'));
|
||||||
if (fApp->ShowHeader())
|
|
||||||
fHeader->SetMarked(true);
|
|
||||||
menu->AddItem(fRaw = new BMenuItem(MDR_DIALECT_CHOICE ("Show Raw Message"," メッセージを生で表示"), new BMessage(M_RAW)));
|
menu->AddItem(fRaw = new BMenuItem(MDR_DIALECT_CHOICE ("Show Raw Message"," メッセージを生で表示"), new BMessage(M_RAW)));
|
||||||
menu_bar->AddItem(menu);
|
fMenuBar->AddItem(menu);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
// Message Menu
|
||||||
// Message Menu
|
|
||||||
//
|
|
||||||
menu = new BMenu(MDR_DIALECT_CHOICE ("Message", "M) メッセージ"));
|
menu = new BMenu(MDR_DIALECT_CHOICE ("Message", "M) メッセージ"));
|
||||||
|
|
||||||
if (!resending && fIncoming) {
|
if (!resending && fIncoming) {
|
||||||
@ -438,30 +428,30 @@ TMailWindow::TMailWindow(BRect rect, const char* title, TMailApp* app,
|
|||||||
}
|
}
|
||||||
|
|
||||||
menu->AddItem(subMenu);
|
menu->AddItem(subMenu);
|
||||||
menu_bar->AddItem(menu);
|
fMenuBar->AddItem(menu);
|
||||||
|
|
||||||
// Spam Menu
|
// Spam Menu
|
||||||
|
|
||||||
if (fApp->ShowSpamGUI()) {
|
if (fApp->ShowSpamGUI()) {
|
||||||
menu = new BMenu("Spam Filtering");
|
menu = new BMenu("Spam Filtering");
|
||||||
menu->AddItem(new BMenuItem("Mark as Spam and Move to Trash",
|
menu->AddItem(new BMenuItem("Mark as Spam and Move to Trash",
|
||||||
new BMessage(M_TRAIN_SPAM_AND_DELETE), 'K'));
|
new BMessage(M_TRAIN_SPAM_AND_DELETE), 'K'));
|
||||||
menu->AddItem(new BMenuItem("Mark as Spam",
|
menu->AddItem(new BMenuItem("Mark as Spam",
|
||||||
new BMessage(M_TRAIN_SPAM), 'K', B_OPTION_KEY));
|
new BMessage(M_TRAIN_SPAM), 'K', B_OPTION_KEY));
|
||||||
menu->AddSeparatorItem();
|
menu->AddSeparatorItem();
|
||||||
menu->AddItem(new BMenuItem("Unmark this Message",
|
menu->AddItem(new BMenuItem("Unmark this Message",
|
||||||
new BMessage(M_UNTRAIN)));
|
new BMessage(M_UNTRAIN)));
|
||||||
menu->AddSeparatorItem();
|
menu->AddSeparatorItem();
|
||||||
menu->AddItem(new BMenuItem("Mark as Genuine",
|
menu->AddItem(new BMenuItem("Mark as Genuine",
|
||||||
new BMessage(M_TRAIN_GENUINE), 'K', B_SHIFT_KEY));
|
new BMessage(M_TRAIN_GENUINE), 'K', B_SHIFT_KEY));
|
||||||
menu_bar->AddItem(menu);
|
fMenuBar->AddItem(menu);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
menu->AddItem(fSendNow = new BMenuItem(
|
menu->AddItem(fSendNow = new BMenuItem(
|
||||||
MDR_DIALECT_CHOICE ("Send Message", "M) メッセージを送信"),
|
MDR_DIALECT_CHOICE ("Send Message", "M) メッセージを送信"),
|
||||||
new BMessage(M_SEND_NOW), 'M'));
|
new BMessage(M_SEND_NOW), 'M'));
|
||||||
|
|
||||||
if(!fIncoming) {
|
if (!fIncoming) {
|
||||||
menu->AddSeparatorItem();
|
menu->AddSeparatorItem();
|
||||||
fSignature = new TMenu(
|
fSignature = new TMenu(
|
||||||
MDR_DIALECT_CHOICE ("Add Signature", "D) 署名を追加"),
|
MDR_DIALECT_CHOICE ("Add Signature", "D) 署名を追加"),
|
||||||
@ -475,26 +465,23 @@ TMailWindow::TMailWindow(BRect rect, const char* title, TMailApp* app,
|
|||||||
menu->AddItem(fAdd = new BMenuItem(MDR_DIALECT_CHOICE ("Add Enclosure","E) 追加")B_UTF8_ELLIPSIS, new BMessage(M_ADD), 'E'));
|
menu->AddItem(fAdd = new BMenuItem(MDR_DIALECT_CHOICE ("Add Enclosure","E) 追加")B_UTF8_ELLIPSIS, new BMessage(M_ADD), 'E'));
|
||||||
menu->AddItem(fRemove = new BMenuItem(MDR_DIALECT_CHOICE ("Remove Enclosure","T) 削除"), new BMessage(M_REMOVE), 'T'));
|
menu->AddItem(fRemove = new BMenuItem(MDR_DIALECT_CHOICE ("Remove Enclosure","T) 削除"), new BMessage(M_REMOVE), 'T'));
|
||||||
}
|
}
|
||||||
menu_bar->AddItem(menu);
|
fMenuBar->AddItem(menu);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
|
||||||
// Queries Menu
|
// Queries Menu
|
||||||
//
|
|
||||||
fQueryMenu = new BMenu(MDR_DIALECT_CHOICE("Queries","???"));
|
fQueryMenu = new BMenu(MDR_DIALECT_CHOICE("Queries","???"));
|
||||||
menu_bar->AddItem(fQueryMenu);
|
fMenuBar->AddItem(fQueryMenu);
|
||||||
|
|
||||||
_RebuildQueryMenu(true);
|
_RebuildQueryMenu(true);
|
||||||
|
|
||||||
//
|
|
||||||
// Menu Bar
|
// Menu Bar
|
||||||
//
|
|
||||||
AddChild(menu_bar);
|
|
||||||
height = menu_bar->Bounds().bottom + 1;
|
|
||||||
|
|
||||||
//
|
AddChild(fMenuBar);
|
||||||
|
height = fMenuBar->Bounds().bottom + 1;
|
||||||
|
|
||||||
// Button Bar
|
// Button Bar
|
||||||
//
|
|
||||||
float bbwidth = 0, bbheight = 0;
|
float bbwidth = 0, bbheight = 0;
|
||||||
|
|
||||||
bool showButtonBar = fApp->ShowButtonBar();
|
bool showButtonBar = fApp->ShowButtonBar();
|
||||||
@ -522,7 +509,7 @@ TMailWindow::TMailWindow(BRect rect, const char* title, TMailApp* app,
|
|||||||
r.OffsetTo(0, 0);
|
r.OffsetTo(0, 0);
|
||||||
r.top = fHeaderView->Frame().bottom - 1;
|
r.top = fHeaderView->Frame().bottom - 1;
|
||||||
fContentView = new TContentView(r, fIncoming, fMail,
|
fContentView = new TContentView(r, fIncoming, fMail,
|
||||||
const_cast<BFont *>(font), fApp->ShowHeader(), fApp->ColoredQuotes());
|
const_cast<BFont *>(font), false, fApp->ColoredQuotes());
|
||||||
// TContentView needs to be properly const, for now cast away constness
|
// TContentView needs to be properly const, for now cast away constness
|
||||||
|
|
||||||
AddChild(fHeaderView);
|
AddChild(fHeaderView);
|
||||||
@ -530,15 +517,12 @@ TMailWindow::TMailWindow(BRect rect, const char* title, TMailApp* app,
|
|||||||
AddChild(fEnclosuresView);
|
AddChild(fEnclosuresView);
|
||||||
AddChild(fContentView);
|
AddChild(fContentView);
|
||||||
|
|
||||||
if (to) {
|
if (to)
|
||||||
fHeaderView->fTo->SetText(to);
|
fHeaderView->fTo->SetText(to);
|
||||||
}
|
|
||||||
|
|
||||||
AddShortcut('n', B_COMMAND_KEY, new BMessage(M_NEW));
|
AddShortcut('n', B_COMMAND_KEY, new BMessage(M_NEW));
|
||||||
|
|
||||||
//
|
// If auto-signature, add signature to the text here.
|
||||||
// If auto-signature, add signature to the text here.
|
|
||||||
//
|
|
||||||
|
|
||||||
BString signature = fApp->Signature();
|
BString signature = fApp->Signature();
|
||||||
|
|
||||||
@ -546,9 +530,7 @@ TMailWindow::TMailWindow(BRect rect, const char* title, TMailApp* app,
|
|||||||
if (strcmp(signature.String(), SIG_RANDOM) == 0)
|
if (strcmp(signature.String(), SIG_RANDOM) == 0)
|
||||||
PostMessage(M_RANDOM_SIG);
|
PostMessage(M_RANDOM_SIG);
|
||||||
else {
|
else {
|
||||||
//
|
// Create a query to find this signature
|
||||||
// Create a query to find this signature
|
|
||||||
//
|
|
||||||
BVolume volume;
|
BVolume volume;
|
||||||
BVolumeRoster().GetBootVolume(&volume);
|
BVolumeRoster().GetBootVolume(&volume);
|
||||||
|
|
||||||
@ -559,9 +541,7 @@ TMailWindow::TMailWindow(BRect rect, const char* title, TMailApp* app,
|
|||||||
query.PushOp(B_EQ);
|
query.PushOp(B_EQ);
|
||||||
query.Fetch();
|
query.Fetch();
|
||||||
|
|
||||||
//
|
// If we find the named query, add it to the text.
|
||||||
// If we find the named query, add it to the text.
|
|
||||||
//
|
|
||||||
BEntry entry;
|
BEntry entry;
|
||||||
if (query.GetNextEntry(&entry) == B_NO_ERROR) {
|
if (query.GetNextEntry(&entry) == B_NO_ERROR) {
|
||||||
off_t size;
|
off_t size;
|
||||||
@ -713,13 +693,11 @@ bool
|
|||||||
TMailWindow::GetTrackerWindowFile(entry_ref *ref, bool next) const
|
TMailWindow::GetTrackerWindowFile(entry_ref *ref, bool next) const
|
||||||
{
|
{
|
||||||
// Position was already saved
|
// Position was already saved
|
||||||
if (next && fNextTrackerPositionSaved)
|
if (next && fNextTrackerPositionSaved) {
|
||||||
{
|
|
||||||
*ref = fNextRef;
|
*ref = fNextRef;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!next && fPrevTrackerPositionSaved)
|
if (!next && fPrevTrackerPositionSaved) {
|
||||||
{
|
|
||||||
*ref = fPrevRef;
|
*ref = fPrevRef;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -727,15 +705,12 @@ TMailWindow::GetTrackerWindowFile(entry_ref *ref, bool next) const
|
|||||||
if (!fTrackerMessenger.IsValid())
|
if (!fTrackerMessenger.IsValid())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
//
|
// Ask the tracker what the next/prev file in the window is.
|
||||||
// Ask the tracker what the next/prev file in the window is.
|
// Continue asking for the next reference until a valid
|
||||||
// Continue asking for the next reference until a valid
|
// email file is found (ignoring other types).
|
||||||
// email file is found (ignoring other types).
|
|
||||||
//
|
|
||||||
entry_ref nextRef = *ref;
|
entry_ref nextRef = *ref;
|
||||||
bool foundRef = false;
|
bool foundRef = false;
|
||||||
while (!foundRef)
|
while (!foundRef) {
|
||||||
{
|
|
||||||
BMessage request(B_GET_PROPERTY);
|
BMessage request(B_GET_PROPERTY);
|
||||||
BMessage spc;
|
BMessage spc;
|
||||||
if (next)
|
if (next)
|
||||||
@ -808,12 +783,10 @@ void
|
|||||||
TMailWindow::SetCurrentMessageRead()
|
TMailWindow::SetCurrentMessageRead()
|
||||||
{
|
{
|
||||||
BNode node(fRef);
|
BNode node(fRef);
|
||||||
if (node.InitCheck() == B_NO_ERROR)
|
if (node.InitCheck() == B_NO_ERROR) {
|
||||||
{
|
|
||||||
BString status;
|
BString status;
|
||||||
if (ReadAttrString(&node, B_MAIL_ATTR_STATUS, &status) == B_NO_ERROR
|
if (ReadAttrString(&node, B_MAIL_ATTR_STATUS, &status) == B_NO_ERROR
|
||||||
&& !status.ICompare("New"))
|
&& !status.ICompare("New")) {
|
||||||
{
|
|
||||||
node.RemoveAttr(B_MAIL_ATTR_STATUS);
|
node.RemoveAttr(B_MAIL_ATTR_STATUS);
|
||||||
WriteAttrString(&node, B_MAIL_ATTR_STATUS, "Read");
|
WriteAttrString(&node, B_MAIL_ATTR_STATUS, "Read");
|
||||||
}
|
}
|
||||||
@ -831,10 +804,10 @@ TMailWindow::FrameResized(float width, float height)
|
|||||||
void
|
void
|
||||||
TMailWindow::MenusBeginning()
|
TMailWindow::MenusBeginning()
|
||||||
{
|
{
|
||||||
bool enable;
|
bool enable;
|
||||||
int32 finish = 0;
|
int32 finish = 0;
|
||||||
int32 start = 0;
|
int32 start = 0;
|
||||||
BTextView *textView;
|
BTextView *textView;
|
||||||
|
|
||||||
if (!fIncoming) {
|
if (!fIncoming) {
|
||||||
bool gotToField = fHeaderView->fTo->Text()[0] != 0;
|
bool gotToField = fHeaderView->fTo->Text()[0] != 0;
|
||||||
@ -1217,7 +1190,6 @@ TMailWindow::MessageReceived(BMessage *msg)
|
|||||||
case M_HEADER:
|
case M_HEADER:
|
||||||
{
|
{
|
||||||
bool showHeader = !fHeader->IsMarked();
|
bool showHeader = !fHeader->IsMarked();
|
||||||
fApp->SetShowHeader(showHeader);
|
|
||||||
fHeader->SetMarked(showHeader);
|
fHeader->SetMarked(showHeader);
|
||||||
|
|
||||||
BMessage message(M_HEADER);
|
BMessage message(M_HEADER);
|
||||||
@ -1573,8 +1545,7 @@ TMailWindow::MessageReceived(BMessage *msg)
|
|||||||
void
|
void
|
||||||
TMailWindow::AddEnclosure(BMessage *msg)
|
TMailWindow::AddEnclosure(BMessage *msg)
|
||||||
{
|
{
|
||||||
if (fEnclosuresView == NULL && !fIncoming)
|
if (fEnclosuresView == NULL && !fIncoming) {
|
||||||
{
|
|
||||||
BRect r;
|
BRect r;
|
||||||
r.left = 0;
|
r.left = 0;
|
||||||
r.top = fHeaderView->Frame().bottom - 1;
|
r.top = fHeaderView->Frame().bottom - 1;
|
||||||
@ -2975,10 +2946,9 @@ TMailWindow::_RebuildQueryMenu(bool firstTime)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we find the named query, add it to the menu.
|
// If we find the named query, add it to the menu.
|
||||||
BEntry entry;
|
BEntry entry;
|
||||||
while (queryDir.GetNextEntry(&entry) == B_OK) {
|
while (queryDir.GetNextEntry(&entry) == B_OK) {
|
||||||
|
|
||||||
char name[B_FILE_NAME_LENGTH + 1];
|
char name[B_FILE_NAME_LENGTH + 1];
|
||||||
entry.GetName(name);
|
entry.GetName(name);
|
||||||
|
|
||||||
@ -3015,7 +2985,7 @@ TMailWindow::_BuildQueryString(BEntry* entry) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
BString queryString;
|
BString queryString;
|
||||||
switch(mode) {
|
switch (mode) {
|
||||||
case kByForumlaItem:
|
case kByForumlaItem:
|
||||||
{
|
{
|
||||||
BString buffer;
|
BString buffer;
|
||||||
@ -3036,7 +3006,7 @@ TMailWindow::_BuildQueryString(BEntry* entry) const
|
|||||||
{
|
{
|
||||||
int32 count = 1;
|
int32 count = 1;
|
||||||
if (node.ReadAttr(kAttrQueryInitialNumAttrs, B_INT32_TYPE, 0,
|
if (node.ReadAttr(kAttrQueryInitialNumAttrs, B_INT32_TYPE, 0,
|
||||||
(int32 *)&mode, sizeof(int32)) <= 0) {
|
(int32 *)&mode, sizeof(int32)) <= 0) {
|
||||||
count = 1;
|
count = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3049,17 +3019,16 @@ TMailWindow::_BuildQueryString(BEntry* entry) const
|
|||||||
|
|
||||||
char *buffer = new char[info.size];
|
char *buffer = new char[info.size];
|
||||||
if (node.ReadAttr(kAttrQueryInitialAttrs, B_MESSAGE_TYPE, 0,
|
if (node.ReadAttr(kAttrQueryInitialAttrs, B_MESSAGE_TYPE, 0,
|
||||||
buffer, (size_t)info.size) == info.size) {
|
buffer, (size_t)info.size) == info.size) {
|
||||||
BMessage message;
|
BMessage message;
|
||||||
if (message.Unflatten(buffer) == B_OK) {
|
if (message.Unflatten(buffer) == B_OK) {
|
||||||
for (int32 index = 0; /*index < count*/; index++) {
|
for (int32 index = 0; /*index < count*/; index++) {
|
||||||
|
|
||||||
const char *field;
|
const char *field;
|
||||||
const char *value;
|
const char *value;
|
||||||
if (message.FindString("menuSelection",
|
if (message.FindString("menuSelection", index, &field)
|
||||||
index, &field) != B_OK
|
!= B_OK
|
||||||
|| message.FindString("attrViewText",
|
|| message.FindString("attrViewText", index, &value)
|
||||||
index, &value) != B_OK) {
|
!= B_OK) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user