Updated to use B_TRANSLATE* macros. relates to #5408.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36668 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Matt Madia
2010-05-06 21:01:54 +00:00
parent e904ecc93e
commit 8c9c8c0e1f
10 changed files with 454 additions and 391 deletions
+83 -77
View File
@@ -19,17 +19,17 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF TITLE, MERCHANTABILITY, IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF TITLE, MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
BE INCORPORATED BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN BE INCORPORATED BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF, OR IN CONNECTION AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF, OR IN
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of Be Incorporated shall not be Except as contained in this notice, the name of Be Incorporated shall not be
used in advertising or otherwise to promote the sale, use or other dealings in used in advertising or otherwise to promote the sale, use or other dealings in
this Software without prior written authorization from Be Incorporated. this Software without prior written authorization from Be Incorporated.
BeMail(TM), Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks BeMail(TM), Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or
of Be Incorporated in the United States and other countries. Other brand product registered trademarks of Be Incorporated in the United States and other
names are registered trademarks or trademarks of their respective holders. countries. Other brand product names are registered trademarks or trademarks
All rights reserved. of their respective holders. All rights reserved.
*/ */
@@ -104,7 +104,7 @@ void Unicode2UTF8(int32 c, char **out);
inline bool inline bool
IsInitialUTF8Byte(uchar b) IsInitialUTF8Byte(uchar b)
{ {
return ((b & 0xC0) != 0x80); return ((b & 0xC0) != 0x80);
} }
@@ -309,7 +309,7 @@ CheckForURL(const char *string, size_t &urlLength, BString *url = NULL)
for (const char **prefix = urlPrefixes; *prefix != 0; prefix++) { for (const char **prefix = urlPrefixes; *prefix != 0; prefix++) {
if (!cistrncmp(string, *prefix, strlen(*prefix))) { if (!cistrncmp(string, *prefix, strlen(*prefix))) {
type = TYPE_URL; type = TYPE_URL;
break; break;
} }
} }
@@ -458,7 +458,7 @@ FillInQuoteTextRuns(BTextView* view, quote_context* context, const char* line,
{ {
text_run* runs = style->runs; text_run* runs = style->runs;
int32 index = style->count; int32 index = style->count;
bool begin; bool begin;
int32 pos = 0; int32 pos = 0;
int32 diffMode = 0; int32 diffMode = 0;
bool inDiff = false; bool inDiff = false;
@@ -742,8 +742,9 @@ TContentView::MessageReceived(BMessage *msg)
} else { } else {
beep(); beep();
(new BAlert("", (new BAlert("",
TR("An error occurred trying to open this signature."), B_TRANSLATE("An error occurred trying to open this "
TR("Sorry")))->Go(); "signature."),
B_TRANSLATE("Sorry")))->Go();
} }
break; break;
} }
@@ -768,9 +769,9 @@ TContentView::FindString(const char *str)
if (str == NULL) if (str == NULL)
return; return;
// //
// Start from current selection or from the beginning of the pool // Start from current selection or from the beginning of the pool
// //
const char *text = fTextView->Text(); const char *text = fTextView->Text();
int32 count = fTextView->TextLength(); int32 count = fTextView->TextLength();
fTextView->GetSelection(&start, &finish); fTextView->GetSelection(&start, &finish);
@@ -779,7 +780,7 @@ TContentView::FindString(const char *str)
if (!count || text == NULL) if (!count || text == NULL)
return; return;
// //
// Do the find // Do the find
// //
while (pass < 2) { while (pass < 2) {
@@ -800,10 +801,10 @@ TContentView::FindString(const char *str)
} }
} }
} }
// //
// Select the text if it worked // Select the text if it worked
// //
if (found != -1) { if (found != -1) {
Window()->Activate(); Window()->Activate();
fTextView->Select(found, found + strlen(str)); fTextView->Select(found, found + strlen(str));
@@ -839,7 +840,7 @@ TContentView::FrameResized(float /* width */, float /* height */)
{ {
BRect r(fTextView->Bounds()); BRect r(fTextView->Bounds());
r.OffsetTo(0, 0); r.OffsetTo(0, 0);
r.InsetBy(5, 5); r.InsetBy(5, 5);
fTextView->SetTextRect(r); fTextView->SetTextRect(r);
} }
@@ -882,9 +883,9 @@ TTextView::TTextView(BRect frame, BRect text, bool incoming,
// //
fEnclosureMenu = new BPopUpMenu("Enclosure", false, false); fEnclosureMenu = new BPopUpMenu("Enclosure", false, false);
fEnclosureMenu->SetFont(&menuFont); fEnclosureMenu->SetFont(&menuFont);
fEnclosureMenu->AddItem(new BMenuItem(TR("Save attachment" B_UTF8_ELLIPSIS), fEnclosureMenu->AddItem(new BMenuItem(
new BMessage(M_SAVE))); B_TRANSLATE("Save attachment" B_UTF8_ELLIPSIS), new BMessage(M_SAVE)));
fEnclosureMenu->AddItem(new BMenuItem(TR("Open attachment"), fEnclosureMenu->AddItem(new BMenuItem(B_TRANSLATE("Open attachment"),
new BMessage(M_OPEN))); new BMessage(M_OPEN)));
// //
@@ -892,9 +893,9 @@ TTextView::TTextView(BRect frame, BRect text, bool incoming,
// //
fLinkMenu = new BPopUpMenu("Link", false, false); fLinkMenu = new BPopUpMenu("Link", false, false);
fLinkMenu->SetFont(&menuFont); fLinkMenu->SetFont(&menuFont);
fLinkMenu->AddItem(new BMenuItem(TR("Open this link"), fLinkMenu->AddItem(new BMenuItem(B_TRANSLATE("Open this link"),
new BMessage(M_OPEN))); new BMessage(M_OPEN)));
fLinkMenu->AddItem(new BMenuItem(TR("Copy link location"), fLinkMenu->AddItem(new BMenuItem(B_TRANSLATE("Copy link location"),
new BMessage(M_COPY))); new BMessage(M_COPY)));
SetDoesUndo(true); SetDoesUndo(true);
@@ -1060,8 +1061,8 @@ TTextView::KeyDown(const char *key, int32 count)
end = textLen; end = textLen;
break; break;
} }
} }
start = end; start = end;
} }
Select(start, start); Select(start, start);
ScrollToSelection(); ScrollToSelection();
@@ -1124,7 +1125,7 @@ TTextView::KeyDown(const char *key, int32 count)
} }
break; break;
} }
BTextView::KeyDown(key, count); BTextView::KeyDown(key, count);
break; break;
@@ -1314,10 +1315,10 @@ TTextView::MessageReceived(BMessage *msg)
break; break;
} }
// //
// Tracker has responded to a BMessage that was dragged out of // Tracker has responded to a BMessage that was dragged out of
// this email message. It has created a file for us, we just have to // this email message. It has created a file for us, we just have to
// put the stuff in it. // put the stuff in it.
// //
case B_COPY_TARGET: case B_COPY_TARGET:
{ {
@@ -1327,20 +1328,20 @@ TTextView::MessageReceived(BMessage *msg)
const char *name; const char *name;
hyper_text *enclosure; hyper_text *enclosure;
if (data.FindPointer("enclosure", (void **)&enclosure) == B_OK if (data.FindPointer("enclosure", (void **)&enclosure) == B_OK
&& msg->FindString("name", &name) == B_OK && msg->FindString("name", &name) == B_OK
&& msg->FindRef("directory", &directory) == B_OK) { && msg->FindRef("directory", &directory) == B_OK) {
switch (enclosure->type) { switch (enclosure->type) {
case TYPE_ENCLOSURE: case TYPE_ENCLOSURE:
case TYPE_BE_ENCLOSURE: case TYPE_BE_ENCLOSURE:
{ {
// //
// Enclosure. Decode the data and write it out. // Enclosure. Decode the data and write it out.
// //
BMessage saveMsg(M_SAVE); BMessage saveMsg(M_SAVE);
saveMsg.AddString("name", name); saveMsg.AddString("name", name);
saveMsg.AddRef("directory", &directory); saveMsg.AddRef("directory", &directory);
saveMsg.AddPointer("enclosure", enclosure); saveMsg.AddPointer("enclosure", enclosure);
Save(&saveMsg, false); Save(&saveMsg, false);
break; break;
} }
@@ -1352,14 +1353,14 @@ TTextView::MessageReceived(BMessage *msg)
// drag recipient didn't ask for any specific type, // drag recipient didn't ask for any specific type,
// create a bookmark file as default // create a bookmark file as default
replyType = "application/x-vnd.Be-bookmark"; replyType = "application/x-vnd.Be-bookmark";
BDirectory dir(&directory); BDirectory dir(&directory);
BFile file(&dir, name, B_READ_WRITE); BFile file(&dir, name, B_READ_WRITE);
if (file.InitCheck() == B_OK) { if (file.InitCheck() == B_OK) {
if (strcmp(replyType, "application/x-vnd.Be-bookmark") == 0) { if (strcmp(replyType, "application/x-vnd.Be-bookmark") == 0) {
// we got a request to create a bookmark, stuff // we got a request to create a bookmark, stuff
// it with the url attribute // it with the url attribute
file.WriteAttr("META:url", B_STRING_TYPE, 0, file.WriteAttr("META:url", B_STRING_TYPE, 0,
enclosure->name, strlen(enclosure->name) + 1); enclosure->name, strlen(enclosure->name) + 1);
} else if (strcasecmp(replyType, "text/plain") == 0) { } else if (strcasecmp(replyType, "text/plain") == 0) {
// create a plain text file, stuff it with // create a plain text file, stuff it with
@@ -1376,8 +1377,8 @@ TTextView::MessageReceived(BMessage *msg)
case TYPE_MAILTO: case TYPE_MAILTO:
{ {
// //
// Add some attributes to the already created // Add some attributes to the already created
// person file. Strip out the 'mailto:' if // person file. Strip out the 'mailto:' if
// possible. // possible.
// //
char *addrStart = enclosure->name; char *addrStart = enclosure->name;
@@ -1388,7 +1389,7 @@ TTextView::MessageReceived(BMessage *msg)
} }
if (*addrStart == '\0') { if (*addrStart == '\0') {
addrStart = enclosure->name; addrStart = enclosure->name;
break; break;
} }
@@ -1401,13 +1402,13 @@ TTextView::MessageReceived(BMessage *msg)
// create a bookmark file as default // create a bookmark file as default
replyType = "application/x-vnd.Be-bookmark"; replyType = "application/x-vnd.Be-bookmark";
BDirectory dir(&directory); BDirectory dir(&directory);
BFile file(&dir, name, B_READ_WRITE); BFile file(&dir, name, B_READ_WRITE);
if (file.InitCheck() == B_OK) { if (file.InitCheck() == B_OK) {
if (!strcmp(replyType, "application/x-person")) { if (!strcmp(replyType, "application/x-person")) {
// we got a request to create a bookmark, stuff // we got a request to create a bookmark, stuff
// it with the address attribute // it with the address attribute
file.WriteAttr("META:email", B_STRING_TYPE, 0, file.WriteAttr("META:email", B_STRING_TYPE, 0,
addrStart, strlen(enclosure->name) + 1); addrStart, strlen(enclosure->name) + 1);
} else if (!strcasecmp(replyType, "text/plain")) { } else if (!strcasecmp(replyType, "text/plain")) {
// create a plain text file, stuff it with the // create a plain text file, stuff it with the
@@ -1423,7 +1424,7 @@ TTextView::MessageReceived(BMessage *msg)
} }
} else { } else {
// //
// Assume this is handled by BTextView... // Assume this is handled by BTextView...
// (Probably drag clipping.) // (Probably drag clipping.)
// //
BTextView::MessageReceived(msg); BTextView::MessageReceived(msg);
@@ -1444,7 +1445,8 @@ TTextView::MessageReceived(BMessage *msg)
case B_INPUT_METHOD_STOPPED: case B_INPUT_METHOD_STOPPED:
fInputMethodUndoState.active = false; fInputMethodUndoState.active = false;
if (fInputMethodUndoBuffer.CountItems() > 0) { if (fInputMethodUndoBuffer.CountItems() > 0) {
KUndoItem *undo = fInputMethodUndoBuffer.ItemAt(fInputMethodUndoBuffer.CountItems() - 1); KUndoItem *undo = fInputMethodUndoBuffer.ItemAt(
fInputMethodUndoBuffer.CountItems() - 1);
if (undo->History == K_INSERTED){ if (undo->History == K_INSERTED){
fUndoBuffer.MakeNewUndoItem(); fUndoBuffer.MakeNewUndoItem();
fUndoBuffer.AddUndo(undo->RedoText, undo->Length, fUndoBuffer.AddUndo(undo->RedoText, undo->Length,
@@ -1548,7 +1550,7 @@ TTextView::MouseDown(BPoint where)
BMenuItem *addItem = NULL; BMenuItem *addItem = NULL;
if (!foundWord && gUserDict >= 0) { if (!foundWord && gUserDict >= 0) {
menu.AddSeparatorItem(); menu.AddSeparatorItem();
addItem = new BMenuItem(TR("Add"), NULL); addItem = new BMenuItem(B_TRANSLATE("Add"), NULL);
menu.AddItem(addItem); menu.AddItem(addItem);
} }
@@ -1606,12 +1608,12 @@ TTextView::MouseDown(BPoint where)
bool held = false; bool held = false;
uint32 buttons = 0; uint32 buttons = 0;
if (Window()->CurrentMessage()) { if (Window()->CurrentMessage()) {
Window()->CurrentMessage()->FindInt32("buttons", Window()->CurrentMessage()->FindInt32("buttons",
(int32 *) &buttons); (int32 *) &buttons);
} }
// //
// If this is the primary button, wait to see if the user is going // If this is the primary button, wait to see if the user is going
// to single click, hold, or drag. // to single click, hold, or drag.
// //
if (buttons != B_SECONDARY_MOUSE_BUTTON) { if (buttons != B_SECONDARY_MOUSE_BUTTON) {
@@ -1644,8 +1646,8 @@ TTextView::MouseDown(BPoint where)
} }
// //
// If the user has right clicked on this menu, // If the user has right clicked on this menu,
// or held the button down on it for a while, // or held the button down on it for a while,
// pop up a context menu. // pop up a context menu.
// //
if (buttons == B_SECONDARY_MOUSE_BUTTON || held) { if (buttons == B_SECONDARY_MOUSE_BUTTON || held) {
@@ -1673,7 +1675,7 @@ TTextView::MouseDown(BPoint where)
} }
} else if (msg->what == M_COPY) { } else if (msg->what == M_COPY) {
// copy link location to clipboard // copy link location to clipboard
if (be_clipboard->Lock()) { if (be_clipboard->Lock()) {
be_clipboard->Clear(); be_clipboard->Clear();
@@ -1690,7 +1692,7 @@ TTextView::MouseDown(BPoint where)
} }
} else { } else {
// //
// Left button. If the user single clicks, open this link. // Left button. If the user single clicks, open this link.
// Otherwise, initiate a drag. // Otherwise, initiate a drag.
// //
if (drag) { if (drag) {
@@ -1711,7 +1713,7 @@ TTextView::MouseDown(BPoint where)
case TYPE_URL: case TYPE_URL:
// //
// URL. The user can drag it into the tracker to // URL. The user can drag it into the tracker to
// create a bookmark file. // create a bookmark file.
// //
dragMessage.AddString("be:types", B_FILE_MIME_TYPE); dragMessage.AddString("be:types", B_FILE_MIME_TYPE);
@@ -1719,7 +1721,7 @@ TTextView::MouseDown(BPoint where)
"application/x-vnd.Be-bookmark"); "application/x-vnd.Be-bookmark");
dragMessage.AddString("be:filetypes", "text/plain"); dragMessage.AddString("be:filetypes", "text/plain");
dragMessage.AddString("be:clip_name", "Bookmark"); dragMessage.AddString("be:clip_name", "Bookmark");
dragMessage.AddString("be:url", enclosure->name); dragMessage.AddString("be:url", enclosure->name);
break; break;
@@ -1729,28 +1731,28 @@ TTextView::MouseDown(BPoint where)
// tracker to create a people file. // tracker to create a people file.
// //
dragMessage.AddString("be:types", B_FILE_MIME_TYPE); dragMessage.AddString("be:types", B_FILE_MIME_TYPE);
dragMessage.AddString("be:filetypes", dragMessage.AddString("be:filetypes",
"application/x-person"); "application/x-person");
dragMessage.AddString("be:filetypes", "text/plain"); dragMessage.AddString("be:filetypes", "text/plain");
dragMessage.AddString("be:clip_name", "Person"); dragMessage.AddString("be:clip_name", "Person");
dragMessage.AddString("be:email", enclosure->name); dragMessage.AddString("be:email", enclosure->name);
break; break;
default: default:
// //
// Otherwise it doesn't have a type that I know how // Otherwise it doesn't have a type that I know how
// to save. It won't have any types and if any // to save. It won't have any types and if any
// program wants to accept it, more power to them. // program wants to accept it, more power to them.
// (tracker won't.) // (tracker won't.)
// //
dragMessage.AddString("be:clip_name", "Hyperlink"); dragMessage.AddString("be:clip_name", "Hyperlink");
} }
BMessage data; BMessage data;
data.AddPointer("enclosure", enclosure); data.AddPointer("enclosure", enclosure);
dragMessage.AddMessage("be:originator-data", &data); dragMessage.AddMessage("be:originator-data", &data);
BRegion selectRegion; BRegion selectRegion;
GetTextRegion(start, finish, &selectRegion); GetTextRegion(start, finish, &selectRegion);
DragMessage(&dragMessage, selectRegion.Frame(), this); DragMessage(&dragMessage, selectRegion.Frame(), this);
@@ -1758,7 +1760,7 @@ TTextView::MouseDown(BPoint where)
// //
// User Single clicked on the attachment. Open it. // User Single clicked on the attachment. Open it.
// //
Open(enclosure); Open(enclosure);
} }
} }
return; return;
@@ -1890,7 +1892,8 @@ TTextView::Open(hyper_text *enclosure)
if (result != B_NO_ERROR && result != B_ALREADY_RUNNING) { if (result != B_NO_ERROR && result != B_ALREADY_RUNNING) {
beep(); beep();
(new BAlert("", (new BAlert("",
TR("There is no installed handler for URL links."), B_TRANSLATE("There is no installed handler for "
"URL links."),
"Sorry"))->Go(); "Sorry"))->Go();
} }
break; break;
@@ -1971,12 +1974,12 @@ TTextView::Save(BMessage *msg, bool makeNewFile)
BEntry entry; BEntry entry;
if (dir.FindEntry(name, &entry) == B_NO_ERROR) if (dir.FindEntry(name, &entry) == B_NO_ERROR)
entry.Remove(); entry.Remove();
if ((enclosure->have_ref) && (!enclosure->saved)) { if ((enclosure->have_ref) && (!enclosure->saved)) {
entry.SetTo(&enclosure->ref); entry.SetTo(&enclosure->ref);
// //
// Added true arg and entry_name so MoveTo clobbers as // Added true arg and entry_name so MoveTo clobbers as
// before. This may not be the correct behaviour, but // before. This may not be the correct behaviour, but
// it's the preserved behaviour. // it's the preserved behaviour.
// //
@@ -1990,7 +1993,7 @@ TTextView::Save(BMessage *msg, bool makeNewFile)
return result; return result;
} }
} }
if (result == B_NO_ERROR) { if (result == B_NO_ERROR) {
result = dir.CreateFile(name, &file); result = dir.CreateFile(name, &file);
if (result == B_NO_ERROR && enclosure->content_type) { if (result == B_NO_ERROR && enclosure->content_type) {
@@ -2009,7 +2012,7 @@ TTextView::Save(BMessage *msg, bool makeNewFile)
} }
} else { } else {
// //
// This file was dragged into the tracker or desktop. The file // This file was dragged into the tracker or desktop. The file
// already exists. // already exists.
// //
result = file.SetTo(&dir, name, B_WRITE_ONLY); result = file.SetTo(&dir, name, B_WRITE_ONLY);
@@ -2035,12 +2038,13 @@ TTextView::Save(BMessage *msg, bool makeNewFile)
!cistrcmp("application/octet-stream", enclosure->content_type ? enclosure->content_type : B_EMPTY_STRING)); !cistrcmp("application/octet-stream", enclosure->content_type ? enclosure->content_type : B_EMPTY_STRING));
entry.GetNodeRef(&enclosure->node); entry.GetNodeRef(&enclosure->node);
watch_node(&enclosure->node, B_WATCH_NAME, this); watch_node(&enclosure->node, B_WATCH_NAME, this);
} }
if (result != B_NO_ERROR) { if (result != B_NO_ERROR) {
beep(); beep();
(new BAlert("", TR("An error occurred trying to save the attachment."), (new BAlert("", B_TRANSLATE("An error occurred trying to save "
TR("Sorry")))->Go(); "the attachment."),
B_TRANSLATE("Sorry")))->Go();
} }
return result; return result;
@@ -2237,7 +2241,7 @@ TTextView::AddAsContent(BEmailMessage *mail, bool wrap, uint32 charset, mail_enc
if (vScroller != NULL) if (vScroller != NULL)
vScroller->SetTarget(this); vScroller->SetTarget(this);
if (hScroller != NULL) if (hScroller != NULL)
hScroller->SetTarget(this); hScroller->SetTarget(this);
Show(); Show();
window->EnableUpdates(); window->EnableUpdates();
@@ -2320,7 +2324,7 @@ TTextView::Reader::ParseMail(BMailContainer *container,
BPath path(fileName); BPath path(fileName);
enclosure->name = strdup(path.Leaf()); enclosure->name = strdup(path.Leaf());
BMimeType type; BMimeType type;
component->MIMEType(&type); component->MIMEType(&type);
enclosure->content_type = strdup(type.Type()); enclosure->content_type = strdup(type.Type());
@@ -2328,7 +2332,7 @@ TTextView::Reader::ParseMail(BMailContainer *container,
char typeDescription[B_MIME_TYPE_LENGTH]; char typeDescription[B_MIME_TYPE_LENGTH];
if (type.GetShortDescription(typeDescription) != B_OK) if (type.GetShortDescription(typeDescription) != B_OK)
strcpy(typeDescription, type.Type() ? type.Type() : B_EMPTY_STRING); strcpy(typeDescription, type.Type() ? type.Type() : B_EMPTY_STRING);
name = "\n<Enclosure: "; name = "\n<Enclosure: ";
name << enclosure->name << " (Type: " << typeDescription << ")>\n"; name << enclosure->name << " (Type: " << typeDescription << ")>\n";
@@ -2496,7 +2500,7 @@ TTextView::Reader::Run(void *_this)
buffer = (char *)realloc(buffer, length + 1); buffer = (char *)realloc(buffer, length + 1);
if (buffer == NULL) if (buffer == NULL)
goto done; goto done;
memcpy(buffer, header, length); memcpy(buffer, header, length);
length = rfc2047_to_utf8(&buffer, &length, length); length = rfc2047_to_utf8(&buffer, &length, length);
@@ -3077,7 +3081,7 @@ TTextView::WindowActivated(bool flag)
} }
void void
TTextView::AddQuote(int32 start, int32 finish) TTextView::AddQuote(int32 start, int32 finish)
{ {
BRect rect = Bounds(); BRect rect = Bounds();
@@ -3154,7 +3158,7 @@ TTextView::AddQuote(int32 start, int32 finish)
} }
void void
TTextView::RemoveQuote(int32 start, int32 finish) TTextView::RemoveQuote(int32 start, int32 finish)
{ {
BRect rect = Bounds(); BRect rect = Bounds();
@@ -3279,8 +3283,9 @@ TTextView::Undo(BClipboard */*clipboard*/)
} else { } else {
::beep(); ::beep();
(new BAlert("", (new BAlert("",
TR("Inconsistency occurred in the undo/redo buffer."), B_TRANSLATE("Inconsistency occurred in the undo/redo "
TR("OK")))->Go(); "buffer."),
B_TRANSLATE("OK")))->Go();
} }
break; break;
} }
@@ -3325,8 +3330,9 @@ TTextView::Redo()
case K_REPLACED: case K_REPLACED:
::beep(); ::beep();
(new BAlert("", (new BAlert("",
TR("Inconsistency occurred in the undo/redo buffer."), B_TRANSLATE("Inconsistency occurred in the undo/redo "
TR("OK")))->Go(); "buffer."),
B_TRANSLATE("OK")))->Go();
break; break;
} }
ScrollToSelection(); ScrollToSelection();
+26 -25
View File
@@ -19,24 +19,25 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF TITLE, MERCHANTABILITY, IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF TITLE, MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
BE INCORPORATED BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN BE INCORPORATED BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF, OR IN CONNECTION AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF, OR IN
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of Be Incorporated shall not be Except as contained in this notice, the name of Be Incorporated shall not be
used in advertising or otherwise to promote the sale, use or other dealings in used in advertising or otherwise to promote the sale, use or other dealings in
this Software without prior written authorization from Be Incorporated. this Software without prior written authorization from Be Incorporated.
BeMail(TM), Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks BeMail(TM), Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or
of Be Incorporated in the United States and other countries. Other brand product registered trademarks of Be Incorporated in the United States and other
names are registered trademarks or trademarks of their respective holders. countries. Other brand product names are registered trademarks or trademarks
All rights reserved. of their respective holders. All rights reserved.
*/ */
//-------------------------------------------------------------------- //--------------------------------------------------------------------
// //
// Enclosures.cpp // Enclosures.cpp
// The enclosures list view (TListView), the list items (TListItem), // The enclosures list view (TListView), the list items (TListItem),
// and the view containing the list and handling the messages (TEnclosuresView). // and the view containing the list
// and handling the messages (TEnclosuresView).
//-------------------------------------------------------------------- //--------------------------------------------------------------------
#include "Enclosures.h" #include "Enclosures.h"
@@ -68,7 +69,7 @@ All rights reserved.
static const float kPlainFontSizeScale = 0.9; static const float kPlainFontSizeScale = 0.9;
static status_t static status_t
GetTrackerIcon(BMimeType &type, BBitmap *icon, icon_size iconSize) GetTrackerIcon(BMimeType &type, BBitmap *icon, icon_size iconSize)
{ {
// set some icon size related variables // set some icon size related variables
@@ -139,14 +140,14 @@ TEnclosuresView::TEnclosuresView(BRect rect, BRect wind_rect)
BRect r; BRect r;
r.left = ENCLOSE_TEXT_H + font.StringWidth( r.left = ENCLOSE_TEXT_H + font.StringWidth(
TR("Attachments: ")) + 5; B_TRANSLATE("Attachments: ")) + 5;
r.top = ENCLOSE_FIELD_V; r.top = ENCLOSE_FIELD_V;
r.right = wind_rect.right - wind_rect.left - B_V_SCROLL_BAR_WIDTH - 9; r.right = wind_rect.right - wind_rect.left - B_V_SCROLL_BAR_WIDTH - 9;
r.bottom = Frame().Height() - 8; r.bottom = Frame().Height() - 8;
fList = new TListView(r, this); fList = new TListView(r, this);
fList->SetInvocationMessage(new BMessage(LIST_INVOKED)); fList->SetInvocationMessage(new BMessage(LIST_INVOKED));
BScrollView *scroll = new BScrollView("", fList, B_FOLLOW_LEFT_RIGHT | BScrollView *scroll = new BScrollView("", fList, B_FOLLOW_LEFT_RIGHT |
B_FOLLOW_TOP, 0, false, true); B_FOLLOW_TOP, 0, false, true);
AddChild(scroll); AddChild(scroll);
scroll->ScrollBar(B_VERTICAL)->SetRange(0, 0); scroll->ScrollBar(B_VERTICAL)->SetRange(0, 0);
@@ -224,10 +225,10 @@ TEnclosuresView::MessageReceived(BMessage *msg)
if (window && window->Mail()) if (window && window->Mail())
window->Mail()->RemoveComponent(item->Component()); window->Mail()->RemoveComponent(item->Component());
(new BAlert("", TR( (new BAlert("", B_TRANSLATE(
"Removing attachments from a forwarded mail is not yet " "Removing attachments from a forwarded mail is not yet "
"implemented!\nIt will not yet work correctly."), "implemented!\nIt will not yet work correctly."),
TR("OK")))->Go(); B_TRANSLATE("OK")))->Go();
} }
else else
watch_node(item->NodeRef(), B_STOP_WATCHING, this); watch_node(item->NodeRef(), B_STOP_WATCHING, this);
@@ -268,7 +269,7 @@ TEnclosuresView::MessageReceived(BMessage *msg)
fList->AddItem(item = new TListItem(&ref)); fList->AddItem(item = new TListItem(&ref));
fList->Select(fList->CountItems() - 1); fList->Select(fList->CountItems() - 1);
fList->ScrollToSelection(); fList->ScrollToSelection();
watch_node(item->NodeRef(), B_WATCH_NAME, this); watch_node(item->NodeRef(), B_WATCH_NAME, this);
} }
else else
@@ -278,8 +279,8 @@ TEnclosuresView::MessageReceived(BMessage *msg)
{ {
beep(); beep();
(new BAlert("", (new BAlert("",
TR("Only files can be added as attachments."), B_TRANSLATE("Only files can be added as attachments."),
TR("OK")))->Go(); B_TRANSLATE("OK")))->Go();
} }
} }
break; break;
@@ -355,15 +356,15 @@ static void recursive_attachment_search(TEnclosuresView *us,BMailContainer *mail
BMailComponent *component = mail->GetComponent(i); BMailComponent *component = mail->GetComponent(i);
if (component == body) if (component == body)
continue; continue;
if (component->ComponentType() == B_MAIL_MULTIPART_CONTAINER) if (component->ComponentType() == B_MAIL_MULTIPART_CONTAINER)
recursive_attachment_search(us,dynamic_cast<BMIMEMultipartMailContainer *>(component),body); recursive_attachment_search(us,dynamic_cast<BMIMEMultipartMailContainer *>(component),body);
us->fList->AddItem(new TListItem(component)); us->fList->AddItem(new TListItem(component));
} }
} }
void void
TEnclosuresView::AddEnclosuresFromMail(BEmailMessage *mail) TEnclosuresView::AddEnclosuresFromMail(BEmailMessage *mail)
{ {
for (int32 i = 0; i < mail->CountComponents(); i++) for (int32 i = 0; i < mail->CountComponents(); i++)
@@ -371,7 +372,7 @@ TEnclosuresView::AddEnclosuresFromMail(BEmailMessage *mail)
BMailComponent *component = mail->GetComponent(i); BMailComponent *component = mail->GetComponent(i);
if (component == mail->Body()) if (component == mail->Body())
continue; continue;
if (component->ComponentType() == B_MAIL_MULTIPART_CONTAINER) if (component->ComponentType() == B_MAIL_MULTIPART_CONTAINER)
recursive_attachment_search(this,dynamic_cast<BMIMEMultipartMailContainer *>(component),mail->Body()); recursive_attachment_search(this,dynamic_cast<BMIMEMultipartMailContainer *>(component),mail->Body());
@@ -413,7 +414,7 @@ TListView::MakeFocus(bool focus)
void void
TListView::MouseDown(BPoint point) TListView::MouseDown(BPoint point)
{ {
int32 buttons; int32 buttons;
Looper()->CurrentMessage()->FindInt32("buttons",&buttons); Looper()->CurrentMessage()->FindInt32("buttons",&buttons);
if (buttons & B_SECONDARY_MOUSE_BUTTON) if (buttons & B_SECONDARY_MOUSE_BUTTON)
@@ -423,13 +424,13 @@ TListView::MouseDown(BPoint point)
BPopUpMenu menu("enclosure", false, false); BPopUpMenu menu("enclosure", false, false);
menu.SetFont(&font); menu.SetFont(&font);
menu.AddItem(new BMenuItem(TR("Open attachment"), menu.AddItem(new BMenuItem(B_TRANSLATE("Open attachment"),
new BMessage(LIST_INVOKED))); new BMessage(LIST_INVOKED)));
menu.AddItem(new BMenuItem(TR("Remove attachment"), menu.AddItem(new BMenuItem(B_TRANSLATE("Remove attachment"),
new BMessage(M_REMOVE))); new BMessage(M_REMOVE)));
BPoint menuStart = ConvertToScreen(point); BPoint menuStart = ConvertToScreen(point);
BMenuItem *item; BMenuItem *item;
if ((item = menu.Go(menuStart)) != NULL) if ((item = menu.Go(menuStart)) != NULL)
{ {
@@ -471,7 +472,7 @@ TListItem::TListItem(entry_ref *ref)
fComponent = NULL; fComponent = NULL;
fRef = *ref; fRef = *ref;
BEntry entry(ref); BEntry entry(ref);
entry.GetNodeRef(&fNodeRef); entry.GetNodeRef(&fNodeRef);
} }
+18 -17
View File
@@ -19,17 +19,17 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF TITLE, MERCHANTABILITY, IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF TITLE, MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
BE INCORPORATED BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN BE INCORPORATED BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF, OR IN CONNECTION AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF, OR IN
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of Be Incorporated shall not be Except as contained in this notice, the name of Be Incorporated shall not be
used in advertising or otherwise to promote the sale, use or other dealings in used in advertising or otherwise to promote the sale, use or other dealings in
this Software without prior written authorization from Be Incorporated. this Software without prior written authorization from Be Incorporated.
BeMail(TM), Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks BeMail(TM), Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or
of Be Incorporated in the United States and other countries. Other brand product registered trademarks of Be Incorporated in the United States and other
names are registered trademarks or trademarks of their respective holders. countries. Other brand product names are registered trademarks or trademarks
All rights reserved. of their respective holders. All rights reserved.
*/ */
// =========================================================================== // ===========================================================================
@@ -77,14 +77,14 @@ void FindWindow::DoFind(BWindow* window, const char* text)
break; // Found a window break; // Found a window
} }
} }
/* ask that window who is in the front */ /* ask that window who is in the front */
window = dynamic_cast<TMailWindow*>(window)->FrontmostWindow(); window = dynamic_cast<TMailWindow*>(window)->FrontmostWindow();
if (window == NULL) if (window == NULL)
return; return;
// Found a window, send a find message // Found a window, send a find message
if (!window->Lock()) if (!window->Lock())
return; return;
BView* focus = window->FindView("m_content"); BView* focus = window->FindView("m_content");
@@ -112,13 +112,14 @@ FindPanel::FindPanel(BRect rect)
fTextControl->SetText(sPreviousFind.String()); fTextControl->SetText(sPreviousFind.String());
fTextControl->MakeFocus(); fTextControl->MakeFocus();
AddChild(fTextControl); AddChild(fTextControl);
fFindButton = new BButton(BRect(0, 0, 90, 20),"FINDBUTTON", TR("Find"), fFindButton = new BButton(BRect(0, 0, 90, 20),"FINDBUTTON",
B_TRANSLATE("Find"),
new BMessage(FINDBUTTON),B_FOLLOW_LEFT | B_FOLLOW_BOTTOM); new BMessage(FINDBUTTON),B_FOLLOW_LEFT | B_FOLLOW_BOTTOM);
fFindButton->ResizeToPreferred(); fFindButton->ResizeToPreferred();
AddChild(fFindButton); AddChild(fFindButton);
r = fFindButton->Bounds(); r = fFindButton->Bounds();
fFindButton->MoveTo(Bounds().right - r.Width() - 8, fFindButton->MoveTo(Bounds().right - r.Width() - 8,
Bounds().bottom - r.Height() - 8); Bounds().bottom - r.Height() - 8);
fFindButton->SetEnabled(sPreviousFind.Length()); fFindButton->SetEnabled(sPreviousFind.Length());
@@ -137,12 +138,12 @@ void FindPanel::AttachedToWindow()
SetViewColor(216, 216, 216); SetViewColor(216, 216, 216);
Window()->SetDefaultButton(fFindButton); Window()->SetDefaultButton(fFindButton);
fFindButton->SetTarget(this); fFindButton->SetTarget(this);
fTextControl->SetTarget(this); fTextControl->SetTarget(this);
fTextControl->ResizeToPreferred(); fTextControl->ResizeToPreferred();
fTextControl->ResizeTo(Bounds().Width() - 20, fTextControl->ResizeTo(Bounds().Width() - 20,
fTextControl->Frame().Height()); fTextControl->Frame().Height());
fTextControl->MakeFocus(true); fTextControl->MakeFocus(true);
fTextControl->TextView()->SelectAll(); fTextControl->TextView()->SelectAll();
} }
@@ -214,9 +215,9 @@ void FindPanel::Find()
FindWindow::FindWindow() FindWindow::FindWindow()
: BWindow(FindWindow::fLastPosition, TR("Find"), B_FLOATING_WINDOW, : BWindow(FindWindow::fLastPosition, B_TRANSLATE("Find"),
B_NOT_RESIZABLE | B_NOT_ZOOMABLE | B_WILL_ACCEPT_FIRST_CLICK B_FLOATING_WINDOW, B_NOT_RESIZABLE | B_NOT_ZOOMABLE
| B_CLOSE_ON_ESCAPE) | B_WILL_ACCEPT_FIRST_CLICK | B_CLOSE_ON_ESCAPE)
{ {
fFindPanel = new FindPanel(Bounds()); fFindPanel = new FindPanel(Bounds());
AddChild(fFindPanel); AddChild(fFindPanel);
+43 -39
View File
@@ -19,17 +19,17 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF TITLE, MERCHANTABILITY, IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF TITLE, MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
BE INCORPORATED BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN BE INCORPORATED BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF, OR IN CONNECTION AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF, OR IN
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of Be Incorporated shall not be Except as contained in this notice, the name of Be Incorporated shall not be
used in advertising or otherwise to promote the sale, use or other dealings in used in advertising or otherwise to promote the sale, use or other dealings in
this Software without prior written authorization from Be Incorporated. this Software without prior written authorization from Be Incorporated.
BeMail(TM), Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks BeMail(TM), Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or
of Be Incorporated in the United States and other countries. Other brand product registered trademarks of Be Incorporated in the United States and other
names are registered trademarks or trademarks of their respective holders. countries. Other brand product names are registered trademarks or trademarks
All rights reserved. of their respective holders. All rights reserved.
*/ */
#include "MailApp.h" #include "MailApp.h"
@@ -90,7 +90,7 @@ class QPopupMenu : public QueryMenu {
public: public:
QPopupMenu(const char *title); QPopupMenu(const char *title);
private: private:
void AddPersonItem(const entry_ref *ref, ino_t node, BString &name, void AddPersonItem(const entry_ref *ref, ino_t node, BString &name,
BString &email, const char *attr, BMenu *groupMenu, BString &email, const char *attr, BMenu *groupMenu,
BMenuItem *superItem); BMenuItem *superItem);
@@ -159,7 +159,7 @@ THeaderView::THeaderView(BRect rect, BRect windowRect, bool incoming,
BMessage* msg; BMessage* msg;
float x = StringWidth( /* The longest title string in the header area */ float x = StringWidth( /* The longest title string in the header area */
TR("Attachments: ")) + 9; B_TRANSLATE("Attachments: ")) + 9;
float y = TO_FIELD_V; float y = TO_FIELD_V;
BMenuBar* dummy = new BMenuBar(BRect(0, 0, 100, 15), "Dummy"); BMenuBar* dummy = new BMenuBar(BRect(0, 0, 100, 15), "Dummy");
@@ -248,17 +248,18 @@ THeaderView::THeaderView(BRect rect, BRect windowRect, bool incoming,
if (fIncoming && !resending) { if (fIncoming && !resending) {
// Set up the character set pop-up menu on the right of "To" box. // Set up the character set pop-up menu on the right of "To" box.
r.Set (windowRect.Width() - widestCharacterSet - r.Set (windowRect.Width() - widestCharacterSet -
StringWidth (TR("Decoding:")) - 2 * SEPARATOR_MARGIN, y - 2, StringWidth (B_TRANSLATE("Decoding:")) - 2 * SEPARATOR_MARGIN,
windowRect.Width() - SEPARATOR_MARGIN, y + menuFieldHeight); y - 2, windowRect.Width() - SEPARATOR_MARGIN,
field = new BMenuField (r, "decoding", TR("Decoding:"), fEncodingMenu, y + menuFieldHeight);
true /* fixedSize */, field = new BMenuField (r, "decoding", B_TRANSLATE("Decoding:"),
fEncodingMenu, true /* fixedSize */,
B_FOLLOW_TOP | B_FOLLOW_RIGHT, B_FOLLOW_TOP | B_FOLLOW_RIGHT,
B_WILL_DRAW | B_NAVIGABLE | B_NAVIGABLE_JUMP); B_WILL_DRAW | B_NAVIGABLE | B_NAVIGABLE_JUMP);
field->SetDivider(field->StringWidth(TR("Decoding:")) + 5); field->SetDivider(field->StringWidth(B_TRANSLATE("Decoding:")) + 5);
AddChild(field); AddChild(field);
r.Set(SEPARATOR_MARGIN, y, r.Set(SEPARATOR_MARGIN, y,
field->Frame().left - SEPARATOR_MARGIN, y + menuFieldHeight); field->Frame().left - SEPARATOR_MARGIN, y + menuFieldHeight);
sprintf(string, TR("From:")); sprintf(string, B_TRANSLATE("From:"));
} else { } else {
r.Set(x - 12, y, windowRect.Width() - SEPARATOR_MARGIN, r.Set(x - 12, y, windowRect.Width() - SEPARATOR_MARGIN,
y + menuFieldHeight); y + menuFieldHeight);
@@ -285,9 +286,10 @@ THeaderView::THeaderView(BRect rect, BRect windowRect, bool incoming,
if (!fIncoming || resending) { if (!fIncoming || resending) {
r.right = r.left - 5; r.right = r.left - 5;
r.left = r.right - ceilf(be_plain_font->StringWidth(TR("To:")) + 25); r.left = r.right - ceilf(be_plain_font->StringWidth(
B_TRANSLATE("To:")) + 25);
r.top -= 1; r.top -= 1;
fToMenu = new QPopupMenu(TR("To:")); fToMenu = new QPopupMenu(B_TRANSLATE("To:"));
field = new BMenuField(r, "", "", fToMenu, true, field = new BMenuField(r, "", "", fToMenu, true,
B_FOLLOW_LEFT | B_FOLLOW_TOP, B_WILL_DRAW); B_FOLLOW_LEFT | B_FOLLOW_TOP, B_WILL_DRAW);
field->SetDivider(0.0); field->SetDivider(0.0);
@@ -299,16 +301,16 @@ THeaderView::THeaderView(BRect rect, BRect windowRect, bool incoming,
if (!fIncoming || resending) { if (!fIncoming || resending) {
// Put the character set box on the right of the From field. // Put the character set box on the right of the From field.
r.Set(windowRect.Width() - widestCharacterSet - r.Set(windowRect.Width() - widestCharacterSet -
StringWidth(TR("Encoding:")) - 2 * SEPARATOR_MARGIN, StringWidth(B_TRANSLATE("Encoding:")) - 2 * SEPARATOR_MARGIN,
y - 2, windowRect.Width() - SEPARATOR_MARGIN, y + menuFieldHeight); y - 2, windowRect.Width() - SEPARATOR_MARGIN, y + menuFieldHeight);
BMenuField* encodingField = new BMenuField(r, "encoding", BMenuField* encodingField = new BMenuField(r, "encoding",
TR("Encoding:"), fEncodingMenu, true /* fixedSize */, B_TRANSLATE("Encoding:"), fEncodingMenu, true /* fixedSize */,
B_FOLLOW_TOP | B_FOLLOW_RIGHT, B_FOLLOW_TOP | B_FOLLOW_RIGHT,
B_WILL_DRAW | B_NAVIGABLE | B_NAVIGABLE_JUMP); B_WILL_DRAW | B_NAVIGABLE | B_NAVIGABLE_JUMP);
encodingField->SetDivider(encodingField->StringWidth(TR("Encoding:")) encodingField->SetDivider(encodingField->StringWidth(
+ 5); B_TRANSLATE("Encoding:")) + 5);
AddChild(encodingField); AddChild(encodingField);
field = encodingField; field = encodingField;
// And now the "from account" pop-up menu, on the left side, taking the // And now the "from account" pop-up menu, on the left side, taking the
@@ -358,8 +360,8 @@ THeaderView::THeaderView(BRect rect, BRect windowRect, bool incoming,
} }
r.Set(SEPARATOR_MARGIN, y - 2, r.Set(SEPARATOR_MARGIN, y - 2,
field->Frame().left - SEPARATOR_MARGIN, y + menuFieldHeight); field->Frame().left - SEPARATOR_MARGIN, y + menuFieldHeight);
field = new BMenuField(r, "account", TR("From:"), fAccountMenu, field = new BMenuField(r, "account", B_TRANSLATE("From:"),
true /* fixedSize */, fAccountMenu, true /* fixedSize */,
B_FOLLOW_TOP | B_FOLLOW_LEFT_RIGHT, B_FOLLOW_TOP | B_FOLLOW_LEFT_RIGHT,
B_WILL_DRAW | B_NAVIGABLE | B_NAVIGABLE_JUMP); B_WILL_DRAW | B_NAVIGABLE | B_NAVIGABLE_JUMP);
AddChild(field, encodingField); AddChild(field, encodingField);
@@ -374,8 +376,8 @@ THeaderView::THeaderView(BRect rect, BRect windowRect, bool incoming,
windowRect.Width() - SEPARATOR_MARGIN, y + menuFieldHeight); windowRect.Width() - SEPARATOR_MARGIN, y + menuFieldHeight);
if (account) if (account)
r.right -= SEPARATOR_MARGIN + ACCOUNT_FIELD_WIDTH; r.right -= SEPARATOR_MARGIN + ACCOUNT_FIELD_WIDTH;
fAccountTo = new TTextControl(r, TR("To:"), NULL, fIncoming, false, fAccountTo = new TTextControl(r, B_TRANSLATE("To:"), NULL, fIncoming,
B_FOLLOW_LEFT_RIGHT); false, B_FOLLOW_LEFT_RIGHT);
fAccountTo->SetEnabled(false); fAccountTo->SetEnabled(false);
fAccountTo->SetDivider(x - 12 - SEPARATOR_MARGIN); fAccountTo->SetDivider(x - 12 - SEPARATOR_MARGIN);
fAccountTo->SetAlignment(B_ALIGN_RIGHT, B_ALIGN_LEFT); fAccountTo->SetAlignment(B_ALIGN_RIGHT, B_ALIGN_LEFT);
@@ -383,8 +385,8 @@ THeaderView::THeaderView(BRect rect, BRect windowRect, bool incoming,
if (account) { if (account) {
r.left = r.right + 6; r.right = windowRect.Width() - SEPARATOR_MARGIN; r.left = r.right + 6; r.right = windowRect.Width() - SEPARATOR_MARGIN;
fAccount = new TTextControl(r, TR("Account:"), NULL, fIncoming, fAccount = new TTextControl(r, B_TRANSLATE("Account:"), NULL,
false, B_FOLLOW_RIGHT | B_FOLLOW_TOP); fIncoming, false, B_FOLLOW_RIGHT | B_FOLLOW_TOP);
fAccount->SetEnabled(false); fAccount->SetEnabled(false);
AddChild(fAccount); AddChild(fAccount);
} }
@@ -395,8 +397,8 @@ THeaderView::THeaderView(BRect rect, BRect windowRect, bool incoming,
r.Set(SEPARATOR_MARGIN, y, r.Set(SEPARATOR_MARGIN, y,
windowRect.Width() - SEPARATOR_MARGIN, y + menuFieldHeight); windowRect.Width() - SEPARATOR_MARGIN, y + menuFieldHeight);
y += controlHeight; y += controlHeight;
fSubject = new TTextControl(r, TR("Subject:"), new BMessage(SUBJECT_FIELD), fSubject = new TTextControl(r, B_TRANSLATE("Subject:"),
fIncoming, false, B_FOLLOW_LEFT_RIGHT); new BMessage(SUBJECT_FIELD),fIncoming, false, B_FOLLOW_LEFT_RIGHT);
AddChild(fSubject); AddChild(fSubject);
(msg = new BMessage(FIELD_CHANGED))->AddInt32("bitmask", FIELD_SUBJECT); (msg = new BMessage(FIELD_CHANGED))->AddInt32("bitmask", FIELD_SUBJECT);
fSubject->SetModificationMessage(msg); fSubject->SetModificationMessage(msg);
@@ -418,9 +420,10 @@ THeaderView::THeaderView(BRect rect, BRect windowRect, bool incoming,
fCc->SetModificationMessage(msg); fCc->SetModificationMessage(msg);
r.right = r.left - 5; r.right = r.left - 5;
r.left = r.right - ceilf(be_plain_font->StringWidth(TR("Cc:")) + 25); r.left = r.right - ceilf(be_plain_font->StringWidth(
B_TRANSLATE("Cc:")) + 25);
r.top -= 1; r.top -= 1;
fCcMenu = new QPopupMenu(TR("Cc:")); fCcMenu = new QPopupMenu(B_TRANSLATE("Cc:"));
field = new BMenuField(r, "", "", fCcMenu, true, field = new BMenuField(r, "", "", fCcMenu, true,
B_FOLLOW_LEFT | B_FOLLOW_TOP, B_WILL_DRAW); B_FOLLOW_LEFT | B_FOLLOW_TOP, B_WILL_DRAW);
@@ -428,7 +431,7 @@ THeaderView::THeaderView(BRect rect, BRect windowRect, bool incoming,
field->SetEnabled(true); field->SetEnabled(true);
AddChild(field); AddChild(field);
r.Set(BCC_FIELD_H + be_plain_font->StringWidth(TR("Bcc:")), y, r.Set(BCC_FIELD_H + be_plain_font->StringWidth(B_TRANSLATE("Bcc:")), y,
windowRect.Width() - SEPARATOR_MARGIN, y + menuFieldHeight); windowRect.Width() - SEPARATOR_MARGIN, y + menuFieldHeight);
y += controlHeight; y += controlHeight;
fBcc = new TTextControl(r, "", new BMessage(BCC_FIELD), fBcc = new TTextControl(r, "", new BMessage(BCC_FIELD),
@@ -441,9 +444,10 @@ THeaderView::THeaderView(BRect rect, BRect windowRect, bool incoming,
fBcc->SetModificationMessage(msg); fBcc->SetModificationMessage(msg);
r.right = r.left - 5; r.right = r.left - 5;
r.left = r.right - ceilf(be_plain_font->StringWidth(TR("Bcc:")) + 25); r.left = r.right - ceilf(be_plain_font->StringWidth(
B_TRANSLATE("Bcc:")) + 25);
r.top -= 1; r.top -= 1;
fBccMenu = new QPopupMenu(TR("Bcc:")); fBccMenu = new QPopupMenu(B_TRANSLATE("Bcc:"));
field = new BMenuField(r, "", "", fBccMenu, true, field = new BMenuField(r, "", "", fBccMenu, true,
B_FOLLOW_LEFT | B_FOLLOW_TOP, B_WILL_DRAW); B_FOLLOW_LEFT | B_FOLLOW_TOP, B_WILL_DRAW);
field->SetDivider(0.0); field->SetDivider(0.0);
@@ -600,7 +604,7 @@ THeaderView::InitGroupCompletion()
next = strchr(group, ','); next = strchr(group, ',');
} }
} }
map<BString *, BString *, CompareBStrings>::iterator iter; map<BString *, BString *, CompareBStrings>::iterator iter;
for (iter = groupMap.begin(); iter != groupMap.end();) { for (iter = groupMap.begin(); iter != groupMap.end();) {
BString *group = iter->first; BString *group = iter->first;
@@ -739,7 +743,7 @@ THeaderView::LoadMessage(BEmailMessage *mail)
// #pragma mark - TTextControl // #pragma mark - TTextControl
TTextControl::TTextControl(BRect rect, const char *label, BMessage *msg, TTextControl::TTextControl(BRect rect, const char *label, BMessage *msg,
bool incoming, bool resending, int32 resizingMode) bool incoming, bool resending, int32 resizingMode)
: BComboBox(rect, "happy", label, msg, resizingMode), : BComboBox(rect, "happy", label, msg, resizingMode),
fRefDropMenu(NULL) fRefDropMenu(NULL)
@@ -900,7 +904,7 @@ TTextControl::MessageReceived(BMessage *msg)
BString display; BString display;
BString address; BString address;
entry_ref ref; entry_ref ref;
if (msg->FindString("address", &address) != B_OK if (msg->FindString("address", &address) != B_OK
|| msg->FindRef("ref", &ref) != B_OK) || msg->FindRef("ref", &ref) != B_OK)
return; return;
@@ -960,12 +964,12 @@ QPopupMenu::AddPersonItem(const entry_ref *ref, ino_t node, BString &name,
BString sortKey; BString sortKey;
// For alphabetical order sorting, usually last name. // For alphabetical order sorting, usually last name.
// if we have no Name, just use the email address // if we have no Name, just use the email address
if (name.Length() == 0) { if (name.Length() == 0) {
label = email; label = email;
sortKey = email; sortKey = email;
} else { } else {
// otherwise, pretty-format it // otherwise, pretty-format it
label << name << " (" << email << ")"; label << name << " (" << email << ")";
// Extract the last name (last word in the name), // Extract the last name (last word in the name),
+9 -9
View File
@@ -19,17 +19,17 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF TITLE, MERCHANTABILITY, IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF TITLE, MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
BE INCORPORATED BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN BE INCORPORATED BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF, OR IN CONNECTION AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF, OR IN
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of Be Incorporated shall not be Except as contained in this notice, the name of Be Incorporated shall not be
used in advertising or otherwise to promote the sale, use or other dealings in used in advertising or otherwise to promote the sale, use or other dealings in
this Software without prior written authorization from Be Incorporated. this Software without prior written authorization from Be Incorporated.
BeMail(TM), Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks BeMail(TM), Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or
of Be Incorporated in the United States and other countries. Other brand product registered trademarks of Be Incorporated in the United States and other
names are registered trademarks or trademarks of their respective holders. countries. Other brand product names are registered trademarks or trademarks
All rights reserved. of their respective holders. All rights reserved.
*/ */
@@ -122,8 +122,8 @@ TMailApp::TMailApp()
// set default values // set default values
fContentFont.SetSize(12.0); fContentFont.SetSize(12.0);
fAutoMarkRead = true; fAutoMarkRead = true;
fSignature = (char*)malloc(strlen(TR("None")) + 1); fSignature = (char*)malloc(strlen(B_TRANSLATE("None")) + 1);
strcpy(fSignature, TR("None")); strcpy(fSignature, B_TRANSLATE("None"));
fReplyPreamble = (char*)malloc(1); fReplyPreamble = (char*)malloc(1);
fReplyPreamble[0] = '\0'; fReplyPreamble[0] = '\0';
@@ -149,7 +149,7 @@ TMailApp::~TMailApp()
void void
TMailApp::AboutRequested() TMailApp::AboutRequested()
{ {
BAlert *alert = new BAlert("about", TR("Mail\n\n" BAlert *alert = new BAlert("about", B_TRANSLATE("Mail\n\n"
"Written by Robert Polic.\n" "Written by Robert Polic.\n"
"Enhanced by the Dr. Zoidberg crew.\n\n" "Enhanced by the Dr. Zoidberg crew.\n\n"
"Copyright 1991-2001, Be Incorporated.\n" "Copyright 1991-2001, Be Incorporated.\n"
+8 -8
View File
@@ -19,17 +19,17 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF TITLE, MERCHANTABILITY, IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF TITLE, MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
BE INCORPORATED BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN BE INCORPORATED BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF, OR IN CONNECTION AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF, OR IN
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of Be Incorporated shall not be Except as contained in this notice, the name of Be Incorporated shall not be
used in advertising or otherwise to promote the sale, use or other dealings in used in advertising or otherwise to promote the sale, use or other dealings in
this Software without prior written authorization from Be Incorporated. this Software without prior written authorization from Be Incorporated.
BeMail(TM), Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks BeMail(TM), Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or
of Be Incorporated in the United States and other countries. Other brand product registered trademarks of Be Incorporated in the United States and other
names are registered trademarks or trademarks of their respective holders. countries. Other brand product names are registered trademarks or trademarks
All rights reserved. of their respective holders. All rights reserved.
*/ */
@@ -97,9 +97,9 @@ TMenu::BuildMenu()
BMessage *msg = new BMessage(M_RANDOM_SIG); BMessage *msg = new BMessage(M_RANDOM_SIG);
if (!fPopup) { if (!fPopup) {
AddItem(new BMenuItem(TR("Random"), msg, '0'), 0); AddItem(new BMenuItem(B_TRANSLATE("Random"), msg, '0'), 0);
} else { } else {
AddItem(new BMenuItem(TR("Random"), msg), 0); AddItem(new BMenuItem(B_TRANSLATE("Random"), msg), 0);
} }
} }
} }
+143 -119
View File
@@ -19,17 +19,17 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF TITLE, MERCHANTABILITY, IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF TITLE, MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
BE INCORPORATED BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN BE INCORPORATED BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF, OR IN CONNECTION AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF, OR IN
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of Be Incorporated shall not be Except as contained in this notice, the name of Be Incorporated shall not be
used in advertising or otherwise to promote the sale, use or other dealings in used in advertising or otherwise to promote the sale, use or other dealings in
this Software without prior written authorization from Be Incorporated. this Software without prior written authorization from Be Incorporated.
BeMail(TM), Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks BeMail(TM), Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or
of Be Incorporated in the United States and other countries. Other brand product registered trademarks of Be Incorporated in the United States and other
names are registered trademarks or trademarks of their respective holders. countries. Other brand product names are registered trademarks or trademarks
All rights reserved. of their respective holders. All rights reserved.
*/ */
@@ -202,11 +202,12 @@ TMailWindow::TMailWindow(BRect rect, const char* title, TMailApp* app,
// File Menu // File Menu
menu = new BMenu(TR("File")); menu = new BMenu(B_TRANSLATE("File"));
msg = new BMessage(M_NEW); msg = new BMessage(M_NEW);
msg->AddInt32("type", M_NEW); msg->AddInt32("type", M_NEW);
menu->AddItem(item = new BMenuItem(TR("New mail message"), msg, 'N')); menu->AddItem(item = new BMenuItem(B_TRANSLATE("New mail message"),
msg, 'N'));
item->SetTarget(be_app); item->SetTarget(be_app);
// Cheap hack - only show the drafts menu when composing messages. Insert // Cheap hack - only show the drafts menu when composing messages. Insert
@@ -222,7 +223,7 @@ TMailWindow::TMailWindow(BRect rect, const char* title, TMailApp* app,
if (!fIncoming) { if (!fIncoming) {
QueryMenu *queryMenu; QueryMenu *queryMenu;
queryMenu = new QueryMenu(TR("Open draft"), false); queryMenu = new QueryMenu(B_TRANSLATE("Open draft"), false);
queryMenu->SetTargetForItems(be_app); queryMenu->SetTargetForItems(be_app);
queryMenu->SetPredicate("MAIL:draft==1"); queryMenu->SetPredicate("MAIL:draft==1");
@@ -230,32 +231,32 @@ TMailWindow::TMailWindow(BRect rect, const char* title, TMailApp* app,
} }
if (!fIncoming || resending) { if (!fIncoming || resending) {
menu->AddItem(fSendLater = new BMenuItem(TR("Save as draft"), menu->AddItem(fSendLater = new BMenuItem(B_TRANSLATE("Save as draft"),
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(TR("Close and ")); subMenu = new BMenu(B_TRANSLATE("Close and "));
if (file.GetAttrInfo(B_MAIL_ATTR_STATUS, &info) == B_NO_ERROR) if (file.GetAttrInfo(B_MAIL_ATTR_STATUS, &info) == B_NO_ERROR)
file.ReadAttr(B_MAIL_ATTR_STATUS, B_STRING_TYPE, 0, str, info.size); file.ReadAttr(B_MAIL_ATTR_STATUS, B_STRING_TYPE, 0, str, info.size);
else else
str[0] = 0; str[0] = 0;
if (!strcmp(str, "New")) { if (!strcmp(str, "New")) {
subMenu->AddItem(item = new BMenuItem(TR("Leave as New"), subMenu->AddItem(item = new BMenuItem(B_TRANSLATE("Leave as New"),
new BMessage(M_CLOSE_SAME), 'W', B_SHIFT_KEY)); new BMessage(M_CLOSE_SAME), 'W', B_SHIFT_KEY));
#if 0 #if 0
subMenu->AddItem(item = new BMenuItem(TR("Set to Read"), subMenu->AddItem(item = new BMenuItem(B_TRANSLATE("Set to Read"),
new BMessage(M_CLOSE_READ), 'W')); new BMessage(M_CLOSE_READ), 'W'));
#endif #endif
message = M_CLOSE_READ; message = M_CLOSE_READ;
} else { } else {
if (strlen(str)) if (strlen(str))
sprintf(status, TR("Leave as '%s'"), str); sprintf(status, B_TRANSLATE("Leave as '%s'"), str);
else else
sprintf(status, TR("Leave same")); sprintf(status, B_TRANSLATE("Leave same"));
subMenu->AddItem(item = new BMenuItem(status, subMenu->AddItem(item = new BMenuItem(status,
new BMessage(M_CLOSE_SAME), 'W')); new BMessage(M_CLOSE_SAME), 'W'));
message = M_CLOSE_SAME; message = M_CLOSE_SAME;
@@ -263,87 +264,93 @@ TMailWindow::TMailWindow(BRect rect, const char* title, TMailApp* app,
new BMessage(M_CLOSE_SAME)); new BMessage(M_CLOSE_SAME));
} }
subMenu->AddItem(new BMenuItem(TR("Move to trash"), subMenu->AddItem(new BMenuItem(B_TRANSLATE("Move to trash"),
new BMessage(M_DELETE), 'T', B_CONTROL_KEY)); new BMessage(M_DELETE), 'T', B_CONTROL_KEY));
AddShortcut('T', B_SHIFT_KEY | B_COMMAND_KEY, AddShortcut('T', B_SHIFT_KEY | B_COMMAND_KEY,
new BMessage(M_DELETE_NEXT)); new BMessage(M_DELETE_NEXT));
subMenu->AddSeparatorItem(); subMenu->AddSeparatorItem();
subMenu->AddItem(new BMenuItem(TR("Set to Saved"), subMenu->AddItem(new BMenuItem(B_TRANSLATE("Set to Saved"),
new BMessage(M_CLOSE_SAVED), 'W', B_CONTROL_KEY)); new BMessage(M_CLOSE_SAVED), 'W', B_CONTROL_KEY));
if (add_query_menu_items(subMenu, INDEX_STATUS, M_STATUS, if (add_query_menu_items(subMenu, INDEX_STATUS, M_STATUS,
TR("Set to %s")) > 0) B_TRANSLATE("Set to %s")) > 0)
subMenu->AddSeparatorItem(); subMenu->AddSeparatorItem();
subMenu->AddItem(new BMenuItem(TR("Set to" B_UTF8_ELLIPSIS), subMenu->AddItem(new BMenuItem(B_TRANSLATE("Set to" B_UTF8_ELLIPSIS),
new BMessage(M_CLOSE_CUSTOM))); new BMessage(M_CLOSE_CUSTOM)));
#if 0 #if 0
subMenu->AddItem(new BMenuItem(new TMenu( subMenu->AddItem(new BMenuItem(new TMenu(
TR("Set to" B_UTF8_ELLIPSIS), INDEX_STATUS, M_STATUS, false, false), B_TRANSLATE("Set to" B_UTF8_ELLIPSIS), INDEX_STATUS, M_STATUS,
false, false),
new BMessage(M_CLOSE_CUSTOM))); new BMessage(M_CLOSE_CUSTOM)));
#endif #endif
menu->AddItem(subMenu); menu->AddItem(subMenu);
} else { } else {
menu->AddSeparatorItem(); menu->AddSeparatorItem();
menu->AddItem(new BMenuItem(TR("Close"), menu->AddItem(new BMenuItem(B_TRANSLATE("Close"),
new BMessage(B_CLOSE_REQUESTED), 'W')); new BMessage(B_CLOSE_REQUESTED), 'W'));
} }
menu->AddSeparatorItem(); menu->AddSeparatorItem();
menu->AddItem(fPrint = new BMenuItem(TR("Page setup" B_UTF8_ELLIPSIS), menu->AddItem(fPrint = new BMenuItem(
B_TRANSLATE("Page setup" B_UTF8_ELLIPSIS),
new BMessage(M_PRINT_SETUP))); new BMessage(M_PRINT_SETUP)));
menu->AddItem(fPrint = new BMenuItem(TR("Print" B_UTF8_ELLIPSIS), menu->AddItem(fPrint = new BMenuItem(
B_TRANSLATE("Print" B_UTF8_ELLIPSIS),
new BMessage(M_PRINT), 'P')); new BMessage(M_PRINT), 'P'));
fMenuBar->AddItem(menu); fMenuBar->AddItem(menu);
menu->AddSeparatorItem(); menu->AddSeparatorItem();
menu->AddItem(item = new BMenuItem( menu->AddItem(item = new BMenuItem(
TR("About Mail" B_UTF8_ELLIPSIS), B_TRANSLATE("About Mail" B_UTF8_ELLIPSIS),
new BMessage(B_ABOUT_REQUESTED))); new BMessage(B_ABOUT_REQUESTED)));
item->SetTarget(be_app); item->SetTarget(be_app);
menu->AddSeparatorItem(); menu->AddSeparatorItem();
menu->AddItem(item = new BMenuItem(TR("Quit"), menu->AddItem(item = new BMenuItem(B_TRANSLATE("Quit"),
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(TR("Edit")); menu = new BMenu(B_TRANSLATE("Edit"));
menu->AddItem(fUndo = new BMenuItem(TR("Undo"), new BMessage(B_UNDO), menu->AddItem(fUndo = new BMenuItem(B_TRANSLATE("Undo"),
'Z', 0)); new BMessage(B_UNDO), 'Z', 0));
fUndo->SetTarget(NULL, this); fUndo->SetTarget(NULL, this);
menu->AddItem(fRedo = new BMenuItem(TR("Redo"), new BMessage(M_REDO), menu->AddItem(fRedo = new BMenuItem(B_TRANSLATE("Redo"),
'Z', B_SHIFT_KEY)); new BMessage(M_REDO), 'Z', B_SHIFT_KEY));
fRedo->SetTarget(NULL, this); fRedo->SetTarget(NULL, this);
menu->AddSeparatorItem(); menu->AddSeparatorItem();
menu->AddItem(fCut = new BMenuItem(TR("Cut"), new BMessage(B_CUT), 'X')); menu->AddItem(fCut = new BMenuItem(B_TRANSLATE("Cut"),
new BMessage(B_CUT), 'X'));
fCut->SetTarget(NULL, this); fCut->SetTarget(NULL, this);
menu->AddItem(fCopy = new BMenuItem(TR("Copy"), new BMessage(B_COPY), 'C')); menu->AddItem(fCopy = new BMenuItem(B_TRANSLATE("Copy"),
new BMessage(B_COPY), 'C'));
fCopy->SetTarget(NULL, this); fCopy->SetTarget(NULL, this);
menu->AddItem(fPaste = new BMenuItem(TR("Paste"), new BMessage(B_PASTE), menu->AddItem(fPaste = new BMenuItem(B_TRANSLATE("Paste"),
new BMessage(B_PASTE),
'V')); 'V'));
fPaste->SetTarget(NULL, this); fPaste->SetTarget(NULL, this);
menu->AddSeparatorItem(); menu->AddSeparatorItem();
menu->AddItem(item = new BMenuItem(TR("Select all"), new BMessage(M_SELECT), menu->AddItem(item = new BMenuItem(B_TRANSLATE("Select all"),
'A')); new BMessage(M_SELECT), 'A'));
menu->AddSeparatorItem(); menu->AddSeparatorItem();
item->SetTarget(NULL, this); item->SetTarget(NULL, this);
menu->AddItem(new BMenuItem(TR("Find" B_UTF8_ELLIPSIS), menu->AddItem(new BMenuItem(B_TRANSLATE("Find" B_UTF8_ELLIPSIS),
new BMessage(M_FIND), 'F')); new BMessage(M_FIND), 'F'));
menu->AddItem(new BMenuItem(TR("Find again"), new BMessage(M_FIND_AGAIN), menu->AddItem(new BMenuItem(B_TRANSLATE("Find again"),
'G')); new BMessage(M_FIND_AGAIN), 'G'));
if (!fIncoming) { if (!fIncoming) {
menu->AddSeparatorItem(); menu->AddSeparatorItem();
menu->AddItem(fQuote =new BMenuItem(TR("Quote"), menu->AddItem(fQuote =new BMenuItem(B_TRANSLATE("Quote"),
new BMessage(M_QUOTE), B_RIGHT_ARROW)); new BMessage(M_QUOTE), B_RIGHT_ARROW));
menu->AddItem(fRemoveQuote = new BMenuItem(TR("Remove quote"), menu->AddItem(fRemoveQuote = new BMenuItem(B_TRANSLATE("Remove quote"),
new BMessage(M_REMOVE_QUOTE), B_LEFT_ARROW)); new BMessage(M_REMOVE_QUOTE), B_LEFT_ARROW));
menu->AddSeparatorItem(); menu->AddSeparatorItem();
fSpelling = new BMenuItem(TR("Check spelling"), fSpelling = new BMenuItem(B_TRANSLATE("Check spelling"),
new BMessage(M_CHECK_SPELLING), ';'); new BMessage(M_CHECK_SPELLING), ';');
menu->AddItem(fSpelling); menu->AddItem(fSpelling);
if (fApp->StartWithSpellCheckOn()) if (fApp->StartWithSpellCheckOn())
@@ -351,63 +358,64 @@ TMailWindow::TMailWindow(BRect rect, const char* title, TMailApp* app,
} }
menu->AddSeparatorItem(); menu->AddSeparatorItem();
menu->AddItem(item = new BMenuItem( menu->AddItem(item = new BMenuItem(
TR("Preferences" B_UTF8_ELLIPSIS), B_TRANSLATE("Preferences" B_UTF8_ELLIPSIS),
new BMessage(M_PREFS),',')); new BMessage(M_PREFS),','));
item->SetTarget(be_app); item->SetTarget(be_app);
fMenuBar->AddItem(menu); fMenuBar->AddItem(menu);
menu->AddItem(item = new BMenuItem( menu->AddItem(item = new BMenuItem(
TR("Accounts" B_UTF8_ELLIPSIS), B_TRANSLATE("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(TR("View")); menu = new BMenu(B_TRANSLATE("View"));
menu->AddItem(fHeader = new BMenuItem(TR("Show header"), menu->AddItem(fHeader = new BMenuItem(B_TRANSLATE("Show header"),
new BMessage(M_HEADER), 'H')); new BMessage(M_HEADER), 'H'));
menu->AddItem(fRaw = new BMenuItem(TR("Show raw message"), menu->AddItem(fRaw = new BMenuItem(B_TRANSLATE("Show raw message"),
new BMessage(M_RAW))); new BMessage(M_RAW)));
fMenuBar->AddItem(menu); fMenuBar->AddItem(menu);
} }
// Message Menu // Message Menu
menu = new BMenu(TR("Message")); menu = new BMenu(B_TRANSLATE("Message"));
if (!resending && fIncoming) { if (!resending && fIncoming) {
BMenuItem *menuItem; BMenuItem *menuItem;
menu->AddItem(new BMenuItem(TR("Reply"), new BMessage(M_REPLY),'R')); menu->AddItem(new BMenuItem(B_TRANSLATE("Reply"),
menu->AddItem(new BMenuItem(TR("Reply to sender"), new BMessage(M_REPLY),'R'));
menu->AddItem(new BMenuItem(B_TRANSLATE("Reply to sender"),
new BMessage(M_REPLY_TO_SENDER),'R',B_OPTION_KEY)); new BMessage(M_REPLY_TO_SENDER),'R',B_OPTION_KEY));
menu->AddItem(new BMenuItem(TR("Reply to all"), menu->AddItem(new BMenuItem(B_TRANSLATE("Reply to all"),
new BMessage(M_REPLY_ALL), 'R', B_SHIFT_KEY)); new BMessage(M_REPLY_ALL), 'R', B_SHIFT_KEY));
menu->AddSeparatorItem(); menu->AddSeparatorItem();
menu->AddItem(new BMenuItem(TR("Forward"), new BMessage(M_FORWARD), menu->AddItem(new BMenuItem(B_TRANSLATE("Forward"),
'J')); new BMessage(M_FORWARD), 'J'));
menu->AddItem(new BMenuItem(TR("Forward without attachments"), menu->AddItem(new BMenuItem(B_TRANSLATE("Forward without attachments"),
new BMessage(M_FORWARD_WITHOUT_ATTACHMENTS))); new BMessage(M_FORWARD_WITHOUT_ATTACHMENTS)));
menu->AddItem(menuItem = new BMenuItem(TR("Resend"), menu->AddItem(menuItem = new BMenuItem(B_TRANSLATE("Resend"),
new BMessage(M_RESEND))); new BMessage(M_RESEND)));
menu->AddItem(menuItem = new BMenuItem(TR("Copy to new"), menu->AddItem(menuItem = new BMenuItem(B_TRANSLATE("Copy to new"),
new BMessage(M_COPY_TO_NEW), 'D')); new BMessage(M_COPY_TO_NEW), 'D'));
menu->AddSeparatorItem(); menu->AddSeparatorItem();
fDeleteNext = new BMenuItem(TR("Move to trash"), fDeleteNext = new BMenuItem(B_TRANSLATE("Move to trash"),
new BMessage(M_DELETE_NEXT), 'T'); new BMessage(M_DELETE_NEXT), 'T');
menu->AddItem(fDeleteNext); menu->AddItem(fDeleteNext);
menu->AddSeparatorItem(); menu->AddSeparatorItem();
fPrevMsg = new BMenuItem(TR("Previous message"), fPrevMsg = new BMenuItem(B_TRANSLATE("Previous message"),
new BMessage(M_PREVMSG), B_UP_ARROW); new BMessage(M_PREVMSG), B_UP_ARROW);
menu->AddItem(fPrevMsg); menu->AddItem(fPrevMsg);
fNextMsg = new BMenuItem(TR("Next message"), new BMessage(M_NEXTMSG), fNextMsg = new BMenuItem(B_TRANSLATE("Next message"),
B_DOWN_ARROW); new BMessage(M_NEXTMSG), B_DOWN_ARROW);
menu->AddItem(fNextMsg); menu->AddItem(fNextMsg);
menu->AddSeparatorItem(); menu->AddSeparatorItem();
fSaveAddrMenu = subMenu = new BMenu(TR("Save address")); fSaveAddrMenu = subMenu = new BMenu(B_TRANSLATE("Save address"));
// create the list of addresses // create the list of addresses
@@ -462,23 +470,24 @@ TMailWindow::TMailWindow(BRect rect, const char* title, TMailApp* app,
fMenuBar->AddItem(menu); fMenuBar->AddItem(menu);
} }
} else { } else {
menu->AddItem(fSendNow = new BMenuItem(TR("Send message"), menu->AddItem(fSendNow = new BMenuItem(B_TRANSLATE("Send message"),
new BMessage(M_SEND_NOW), 'M')); new BMessage(M_SEND_NOW), 'M'));
if (!fIncoming) { if (!fIncoming) {
menu->AddSeparatorItem(); menu->AddSeparatorItem();
fSignature = new TMenu(TR("Add signature"), INDEX_SIGNATURE, fSignature = new TMenu(B_TRANSLATE("Add signature"),
M_SIGNATURE); INDEX_SIGNATURE, M_SIGNATURE);
menu->AddItem(new BMenuItem(fSignature)); menu->AddItem(new BMenuItem(fSignature));
menu->AddItem(item = new BMenuItem( menu->AddItem(item = new BMenuItem(
TR("Edit signatures" B_UTF8_ELLIPSIS), B_TRANSLATE("Edit signatures" B_UTF8_ELLIPSIS),
new BMessage(M_EDIT_SIGNATURE))); new BMessage(M_EDIT_SIGNATURE)));
item->SetTarget(be_app); item->SetTarget(be_app);
menu->AddSeparatorItem(); menu->AddSeparatorItem();
menu->AddItem(fAdd = new BMenuItem(TR( menu->AddItem(fAdd = new BMenuItem(
"Add enclosure" B_UTF8_ELLIPSIS), B_TRANSLATE("Add enclosure" B_UTF8_ELLIPSIS),
new BMessage(M_ADD), 'E')); new BMessage(M_ADD), 'E'));
menu->AddItem(fRemove = new BMenuItem(TR("Remove enclosure"), menu->AddItem(fRemove = new BMenuItem(
B_TRANSLATE("Remove enclosure"),
new BMessage(M_REMOVE), 'T')); new BMessage(M_REMOVE), 'T'));
} }
fMenuBar->AddItem(menu); fMenuBar->AddItem(menu);
@@ -486,7 +495,7 @@ TMailWindow::TMailWindow(BRect rect, const char* title, TMailApp* app,
// Queries Menu // Queries Menu
fQueryMenu = new BMenu(TR("Queries")); fQueryMenu = new BMenu(B_TRANSLATE("Queries"));
fMenuBar->AddItem(fQueryMenu); fMenuBar->AddItem(fQueryMenu);
_RebuildQueryMenu(true); _RebuildQueryMenu(true);
@@ -543,8 +552,8 @@ TMailWindow::TMailWindow(BRect rect, const char* title, TMailApp* app,
BString signature = fApp->Signature(); BString signature = fApp->Signature();
if (!fIncoming && strcmp(signature.String(), TR("None")) != 0) { if (!fIncoming && strcmp(signature.String(), B_TRANSLATE("None")) != 0) {
if (strcmp(signature.String(), TR("Random")) == 0) if (strcmp(signature.String(), B_TRANSLATE("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
@@ -602,41 +611,47 @@ TMailWindow::BuildButtonBar()
bbar = new ButtonBar(BRect(0, 0, 100, 100), "ButtonBar", 2, 3, 0, 1, 10, bbar = new ButtonBar(BRect(0, 0, 100, 100), "ButtonBar", 2, 3, 0, 1, 10,
2); 2);
bbar->AddButton(TR("New"), 28, new BMessage(M_NEW)); bbar->AddButton(B_TRANSLATE("New"), 28, new BMessage(M_NEW));
bbar->AddDivider(5); bbar->AddDivider(5);
fButtonBar = bbar; fButtonBar = bbar;
if (fResending) { if (fResending) {
fSendButton = bbar->AddButton(TR("Send"), 8, new BMessage(M_SEND_NOW)); fSendButton = bbar->AddButton(B_TRANSLATE("Send"), 8,
new BMessage(M_SEND_NOW));
bbar->AddDivider(5); bbar->AddDivider(5);
} else if (!fIncoming) { } else if (!fIncoming) {
fSendButton = bbar->AddButton(TR("Send"), 8, new BMessage(M_SEND_NOW)); fSendButton = bbar->AddButton(B_TRANSLATE("Send"), 8,
new BMessage(M_SEND_NOW));
fSendButton->SetEnabled(false); fSendButton->SetEnabled(false);
fSigButton = bbar->AddButton(TR("Signature"), 4, fSigButton = bbar->AddButton(B_TRANSLATE("Signature"), 4,
new BMessage(M_SIG_MENU)); new BMessage(M_SIG_MENU));
fSigButton->InvokeOnButton(B_SECONDARY_MOUSE_BUTTON); fSigButton->InvokeOnButton(B_SECONDARY_MOUSE_BUTTON);
fSaveButton = bbar->AddButton(TR("Save"), 44, fSaveButton = bbar->AddButton(B_TRANSLATE("Save"), 44,
new BMessage(M_SAVE_AS_DRAFT)); new BMessage(M_SAVE_AS_DRAFT));
fSaveButton->SetEnabled(false); fSaveButton->SetEnabled(false);
fPrintButton = bbar->AddButton(TR("Print"), 16, new BMessage(M_PRINT)); fPrintButton = bbar->AddButton(B_TRANSLATE("Print"), 16,
new BMessage(M_PRINT));
fPrintButton->SetEnabled(false); fPrintButton->SetEnabled(false);
bbar->AddButton(TR("Trash"), 0, new BMessage(M_DELETE)); bbar->AddButton(B_TRANSLATE("Trash"), 0, new BMessage(M_DELETE));
bbar->AddDivider(5); bbar->AddDivider(5);
} else { } else {
BmapButton *button = bbar->AddButton(TR("Reply"), 12, BmapButton *button = bbar->AddButton(B_TRANSLATE("Reply"), 12,
new BMessage(M_REPLY)); new BMessage(M_REPLY));
button->InvokeOnButton(B_SECONDARY_MOUSE_BUTTON); button->InvokeOnButton(B_SECONDARY_MOUSE_BUTTON);
button = bbar->AddButton(TR("Forward"), 40, new BMessage(M_FORWARD)); button = bbar->AddButton(B_TRANSLATE("Forward"), 40,
new BMessage(M_FORWARD));
button->InvokeOnButton(B_SECONDARY_MOUSE_BUTTON); button->InvokeOnButton(B_SECONDARY_MOUSE_BUTTON);
fPrintButton = bbar->AddButton(TR("Print"), 16, new BMessage(M_PRINT)); fPrintButton = bbar->AddButton(B_TRANSLATE("Print"), 16,
bbar->AddButton(TR("Trash"), 0, new BMessage(M_DELETE_NEXT)); new BMessage(M_PRINT));
bbar->AddButton(B_TRANSLATE("Trash"), 0, new BMessage(M_DELETE_NEXT));
if (fApp->ShowSpamGUI()) { if (fApp->ShowSpamGUI()) {
button = bbar->AddButton("Spam", 48, new BMessage(M_SPAM_BUTTON)); button = bbar->AddButton("Spam", 48, new BMessage(M_SPAM_BUTTON));
button->InvokeOnButton(B_SECONDARY_MOUSE_BUTTON); button->InvokeOnButton(B_SECONDARY_MOUSE_BUTTON);
} }
bbar->AddDivider(5); bbar->AddDivider(5);
fNextButton = bbar->AddButton(TR("Next"), 24, new BMessage(M_NEXTMSG)); fNextButton = bbar->AddButton(B_TRANSLATE("Next"), 24,
bbar->AddButton(TR("Previous"), 20, new BMessage(M_PREVMSG)); new BMessage(M_NEXTMSG));
bbar->AddButton(B_TRANSLATE("Previous"), 20, new BMessage(M_PREVMSG));
if (!fAutoMarkRead) { if (!fAutoMarkRead) {
_AddReadButton(); _AddReadButton();
} }
@@ -1004,7 +1019,7 @@ TMailWindow::MessageReceived(BMessage *msg)
A popup from a button is good only when the behavior has some A popup from a button is good only when the behavior has some
consistency and there is some visual indication that a menu consistency and there is some visual indication that a menu
will be shown when clicked. A workable implementation would will be shown when clicked. A workable implementation would
have an extra button attached to the main one which has a have an extra button attached to the main one which has a
downward-pointing arrow. Mozilla Thunderbird's 'Get Mail' downward-pointing arrow. Mozilla Thunderbird's 'Get Mail'
button is a good example of this. button is a good example of this.
@@ -1053,10 +1068,11 @@ TMailWindow::MessageReceived(BMessage *msg)
if (msg->FindInt32("buttons", (int32 *)&buttons) == B_OK if (msg->FindInt32("buttons", (int32 *)&buttons) == B_OK
&& buttons == B_SECONDARY_MOUSE_BUTTON) { && buttons == B_SECONDARY_MOUSE_BUTTON) {
BPopUpMenu menu("Reply To", false, false); BPopUpMenu menu("Reply To", false, false);
menu.AddItem(new BMenuItem(TR("Reply"),new BMessage(M_REPLY))); menu.AddItem(new BMenuItem(B_TRANSLATE("Reply"),
menu.AddItem(new BMenuItem(TR("Reply to sender"), new BMessage(M_REPLY)));
menu.AddItem(new BMenuItem(B_TRANSLATE("Reply to sender"),
new BMessage(M_REPLY_TO_SENDER))); new BMessage(M_REPLY_TO_SENDER)));
menu.AddItem(new BMenuItem(TR("Reply to all"), menu.AddItem(new BMenuItem(B_TRANSLATE("Reply to all"),
new BMessage(M_REPLY_ALL))); new BMessage(M_REPLY_ALL)));
BPoint where; BPoint where;
@@ -1079,9 +1095,10 @@ TMailWindow::MessageReceived(BMessage *msg)
if (msg->FindInt32("buttons", (int32 *)&buttons) == B_OK if (msg->FindInt32("buttons", (int32 *)&buttons) == B_OK
&& buttons == B_SECONDARY_MOUSE_BUTTON) { && buttons == B_SECONDARY_MOUSE_BUTTON) {
BPopUpMenu menu("Forward", false, false); BPopUpMenu menu("Forward", false, false);
menu.AddItem(new BMenuItem(TR("Forward"), menu.AddItem(new BMenuItem(B_TRANSLATE("Forward"),
new BMessage(M_FORWARD))); new BMessage(M_FORWARD)));
menu.AddItem(new BMenuItem(TR("Forward without attachments"), menu.AddItem(new BMenuItem(
B_TRANSLATE("Forward without attachments"),
new BMessage(M_FORWARD_WITHOUT_ATTACHMENTS))); new BMessage(M_FORWARD_WITHOUT_ATTACHMENTS)));
BPoint where; BPoint where;
@@ -1140,8 +1157,8 @@ TMailWindow::MessageReceived(BMessage *msg)
tracker.SendMessage(&msg); tracker.SendMessage(&msg);
} else { } else {
(new BAlert("", (new BAlert("",
TR("Need Tracker to move items to trash"), B_TRANSLATE("Need Tracker to move items to trash"),
TR("Sorry")))->Go(); B_TRANSLATE("Sorry")))->Go();
} }
} }
} else { } else {
@@ -1297,9 +1314,10 @@ TMailWindow::MessageReceived(BMessage *msg)
1, &arg); 1, &arg);
if (result != B_NO_ERROR) if (result != B_NO_ERROR)
(new BAlert("", TR( (new BAlert("", B_TRANSLATE(
"Sorry, could not find an application that supports" "Sorry, could not find an application that "
" the 'Person' data type."), TR("OK")))->Go(); "supports the 'Person' data type."),
B_TRANSLATE("OK")))->Go();
} }
free(arg); free(arg);
} }
@@ -1512,9 +1530,9 @@ TMailWindow::MessageReceived(BMessage *msg)
if (!gDictCount) { if (!gDictCount) {
beep(); beep();
(new BAlert("", (new BAlert("",
TR("Mail couldn't find its dictionary."), B_TRANSLATE("Mail couldn't find its dictionary."),
TR("OK"), NULL, NULL, B_WIDTH_AS_USUAL, B_OFFSET_SPACING, B_TRANSLATE("OK"), NULL, NULL, B_WIDTH_AS_USUAL,
B_STOP_ALERT))->Go(); B_OFFSET_SPACING, B_STOP_ALERT))->Go();
} else { } else {
fSpelling->SetMarked(!fSpelling->IsMarked()); fSpelling->SetMarked(!fSpelling->IsMarked());
fContentView->fTextView->EnableSpellCheck( fContentView->fTextView->EnableSpellCheck(
@@ -1616,15 +1634,17 @@ TMailWindow::QuitRequested()
|| strlen(fHeaderView->fSubject->Text()) || strlen(fHeaderView->fSubject->Text())
|| (fHeaderView->fCc && strlen(fHeaderView->fCc->Text())) || (fHeaderView->fCc && strlen(fHeaderView->fCc->Text()))
|| (fHeaderView->fBcc && strlen(fHeaderView->fBcc->Text())) || (fHeaderView->fBcc && strlen(fHeaderView->fBcc->Text()))
|| (strlen(fContentView->fTextView->Text()) && (!fStartingText || (strlen(fContentView->fTextView->Text()) && (!fStartingText
|| (fStartingText || (fStartingText
&& strcmp(fContentView->fTextView->Text(), fStartingText)))) && strcmp(fContentView->fTextView->Text(), fStartingText))))
|| (fEnclosuresView != NULL || (fEnclosuresView != NULL
&& fEnclosuresView->fList->CountItems()))) { && fEnclosuresView->fList->CountItems()))) {
if (fResending) { if (fResending) {
BAlert *alert = new BAlert("", BAlert *alert = new BAlert("", B_TRANSLATE(
TR("Do you wish to send this message before closing?"), "Do you wish to send this message before closing?"),
TR("Discard"), TR("Cancel"), TR("Send"), B_TRANSLATE("Discard"),
B_TRANSLATE("Cancel"),
B_TRANSLATE("Send"),
B_WIDTH_AS_USUAL, B_OFFSET_SPACING, B_WARNING_ALERT); B_WIDTH_AS_USUAL, B_OFFSET_SPACING, B_WARNING_ALERT);
alert->SetShortcut(0, 'd'); alert->SetShortcut(0, 'd');
alert->SetShortcut(1, B_ESCAPE); alert->SetShortcut(1, B_ESCAPE);
@@ -1641,9 +1661,11 @@ TMailWindow::QuitRequested()
} }
} else { } else {
BAlert *alert = new BAlert("", BAlert *alert = new BAlert("",
TR("Do you wish to save this message as a draft before closing?" B_TRANSLATE("Do you wish to save this message as a draft "
), "before closing?"),
TR("Don't save"), TR("Cancel"), TR("Save"), B_TRANSLATE("Don't save"),
B_TRANSLATE("Cancel"),
B_TRANSLATE("Save"),
B_WIDTH_AS_USUAL, B_OFFSET_SPACING, B_WARNING_ALERT); B_WIDTH_AS_USUAL, B_OFFSET_SPACING, B_WARNING_ALERT);
alert->SetShortcut(0, 'd'); alert->SetShortcut(0, 'd');
alert->SetShortcut(1, B_ESCAPE); alert->SetShortcut(1, B_ESCAPE);
@@ -2201,8 +2223,8 @@ TMailWindow::Send(bool now)
status_t status = SaveAsDraft(); status_t status = SaveAsDraft();
if (status != B_OK) { if (status != B_OK) {
beep(); beep();
(new BAlert("", TR("E-mail draft could not be saved!"), (new BAlert("", B_TRANSLATE("E-mail draft could not be saved!"),
TR("OK")))->Go(); B_TRANSLATE("OK")))->Go();
} }
return status; return status;
} }
@@ -2283,7 +2305,7 @@ TMailWindow::Send(bool now)
BString messageString; BString messageString;
BString countString; BString countString;
countString << count; countString << count;
messageString << TR("Your main text contains %ld" messageString << B_TRANSLATE("Your main text contains %ld"
" unencodable characters. Perhaps a different " " unencodable characters. Perhaps a different "
"character set would work better? Hit Send to send it " "character set would work better? Hit Send to send it "
"anyway " "anyway "
@@ -2292,8 +2314,8 @@ TMailWindow::Send(bool now)
"and try fixing it up."); "and try fixing it up.");
messageString.ReplaceFirst("%ld", countString); messageString.ReplaceFirst("%ld", countString);
userAnswer = (new BAlert("Question", messageString.String(), userAnswer = (new BAlert("Question", messageString.String(),
TR("Send"), B_TRANSLATE("Send"),
TR("Cancel"), B_TRANSLATE("Cancel"),
NULL, B_WIDTH_AS_USUAL, B_OFFSET_SPACING, NULL, B_WIDTH_AS_USUAL, B_OFFSET_SPACING,
B_WARNING_ALERT))->Go(); B_WARNING_ALERT))->Go();
if (userAnswer == 1) { if (userAnswer == 1) {
@@ -2427,9 +2449,9 @@ TMailWindow::Send(bool now)
fSent = true; fSent = true;
int32 start = (new BAlert("no daemon", int32 start = (new BAlert("no daemon",
TR("The mail_daemon is not running. The message is queued and " B_TRANSLATE("The mail_daemon is not running. The message is "
"will be sent when the mail_daemon is started."), "queued and will be sent when the mail_daemon is started."),
TR("Start now"), TR("OK")))->Go(); B_TRANSLATE("Start now"), B_TRANSLATE("OK")))->Go();
if (start == 0) { if (start == 0) {
result = be_roster->Launch("application/x-vnd.Be-POST"); result = be_roster->Launch("application/x-vnd.Be-POST");
@@ -2437,7 +2459,8 @@ TMailWindow::Send(bool now)
BMailDaemon::SendQueuedMail(); BMailDaemon::SendQueuedMail();
} else { } else {
errorMessage errorMessage
<< TR("The mail_daemon could not be started:\n\t") << B_TRANSLATE("The mail_daemon could not be "
"started:\n\t")
<< strerror(result); << strerror(result);
} }
} }
@@ -2464,7 +2487,7 @@ TMailWindow::Send(bool now)
if (result != B_NO_ERROR && result != B_MAIL_NO_DAEMON) { if (result != B_NO_ERROR && result != B_MAIL_NO_DAEMON) {
beep(); beep();
(new BAlert("", errorMessage.String(), TR("OK")))->Go(); (new BAlert("", errorMessage.String(), B_TRANSLATE("OK")))->Go();
} }
if (close) { if (close) {
PostMessage(B_QUIT_REQUESTED); PostMessage(B_QUIT_REQUESTED);
@@ -2687,7 +2710,7 @@ ErrorExit:
"Possibly useful error code: %s (%ld).", "Possibly useful error code: %s (%ld).",
filePath.Path(), CommandWord, strerror (errorCode), errorCode); filePath.Path(), CommandWord, strerror (errorCode), errorCode);
(new BAlert("", errorString, (new BAlert("", errorString,
TR("OK")))->Go(); B_TRANSLATE("OK")))->Go();
return errorCode; return errorCode;
} }
@@ -2973,7 +2996,8 @@ TMailWindow::_RebuildQueryMenu(bool firstTime)
delete item; delete item;
} }
fQueryMenu->AddItem(new BMenuItem(TR("Edit queries" B_UTF8_ELLIPSIS), fQueryMenu->AddItem(new BMenuItem(B_TRANSLATE("Edit queries"
B_UTF8_ELLIPSIS),
new BMessage(M_EDIT_QUERIES), 'E', B_SHIFT_KEY)); new BMessage(M_EDIT_QUERIES), 'E', B_SHIFT_KEY));
bool queryItemsAdded = false; bool queryItemsAdded = false;
@@ -3138,10 +3162,10 @@ TMailWindow::_AddReadButton()
int32 buttonIndex = fButtonBar->IndexOf(fNextButton); int32 buttonIndex = fButtonBar->IndexOf(fNextButton);
if (newMail) if (newMail)
fReadButton = fButtonBar->AddButton( fReadButton = fButtonBar->AddButton(
TR(" Read "), 24, new BMessage(M_READ), buttonIndex); B_TRANSLATE(" Read "), 24, new BMessage(M_READ), buttonIndex);
else else
fReadButton = fButtonBar->AddButton( fReadButton = fButtonBar->AddButton(
TR("Unread"), 28, new BMessage(M_UNREAD), buttonIndex); B_TRANSLATE("Unread"), 28, new BMessage(M_UNREAD), buttonIndex);
} }
+70 -56
View File
@@ -19,17 +19,17 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF TITLE, MERCHANTABILITY, IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF TITLE, MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
BE INCORPORATED BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN BE INCORPORATED BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF, OR IN CONNECTION AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF, OR IN
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of Be Incorporated shall not be Except as contained in this notice, the name of Be Incorporated shall not be
used in advertising or otherwise to promote the sale, use or other dealings in used in advertising or otherwise to promote the sale, use or other dealings in
this Software without prior written authorization from Be Incorporated. this Software without prior written authorization from Be Incorporated.
BeMail(TM), Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks BeMail(TM), Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or
of Be Incorporated in the United States and other countries. Other brand product registered trademarks of Be Incorporated in the United States and other
names are registered trademarks or trademarks of their respective holders. countries. Other brand product names are registered trademarks or trademarks
All rights reserved. of their respective holders. All rights reserved.
*/ */
@@ -101,7 +101,7 @@ TPrefsWindow::TPrefsWindow(BRect rect, BFont* font, int32* level, bool* wrap,
char** preamble, char** sig, uint32* encoding, bool* warnUnencodable, char** preamble, char** sig, uint32* encoding, bool* warnUnencodable,
bool* spellCheckStartOn, bool* autoMarkRead, uint8* buttonBar) bool* spellCheckStartOn, bool* autoMarkRead, uint8* buttonBar)
: :
BWindow(rect, TR("Mail preferences"), BWindow(rect, B_TRANSLATE("Mail preferences"),
B_TITLED_WINDOW, B_NOT_RESIZABLE | B_NOT_ZOOMABLE B_TITLED_WINDOW, B_NOT_RESIZABLE | B_NOT_ZOOMABLE
| B_AUTO_UPDATE_SIZE_LIMITS), | B_AUTO_UPDATE_SIZE_LIMITS),
@@ -139,7 +139,7 @@ TPrefsWindow::TPrefsWindow(BRect rect, BFont* font, int32* level, bool* wrap,
fNewSpellCheckStartOn(spellCheckStartOn), fNewSpellCheckStartOn(spellCheckStartOn),
fSpellCheckStartOn(*fNewSpellCheckStartOn), fSpellCheckStartOn(*fNewSpellCheckStartOn),
fNewAutoMarkRead(autoMarkRead), fNewAutoMarkRead(autoMarkRead),
fAutoMarkRead(*fNewAutoMarkRead) fAutoMarkRead(*fNewAutoMarkRead)
{ {
@@ -161,19 +161,20 @@ TPrefsWindow::TPrefsWindow(BRect rect, BFont* font, int32* level, bool* wrap,
interfaceLayout->AlignLayoutWith(mailLayout, B_HORIZONTAL); interfaceLayout->AlignLayoutWith(mailLayout, B_HORIZONTAL);
BBox* interfaceBox = new BBox(B_FANCY_BORDER, interfaceView); BBox* interfaceBox = new BBox(B_FANCY_BORDER, interfaceView);
interfaceBox->SetLabel(TR("User interface")); interfaceBox->SetLabel(B_TRANSLATE("User interface"));
BBox* mailBox = new BBox(B_FANCY_BORDER, mailView); BBox* mailBox = new BBox(B_FANCY_BORDER, mailView);
mailBox->SetLabel(TR("Mailing")); mailBox->SetLabel(B_TRANSLATE("Mailing"));
// revert, ok & cancel // revert, ok & cancel
BButton* okButton = new BButton("ok", TR("OK"), new BMessage(P_OK)); BButton* okButton = new BButton("ok", B_TRANSLATE("OK"),
new BMessage(P_OK));
okButton->MakeDefault(true); okButton->MakeDefault(true);
BButton* cancelButton = new BButton("cancel", TR("Cancel"), BButton* cancelButton = new BButton("cancel", B_TRANSLATE("Cancel"),
new BMessage(P_CANCEL)); new BMessage(P_CANCEL));
fRevert = new BButton("revert", TR("Revert"), fRevert = new BButton("revert", B_TRANSLATE("Revert"),
new BMessage(P_REVERT)); new BMessage(P_REVERT));
fRevert->SetEnabled(false); fRevert->SetEnabled(false);
@@ -181,47 +182,53 @@ TPrefsWindow::TPrefsWindow(BRect rect, BFont* font, int32* level, bool* wrap,
int32 layoutRow = 0; int32 layoutRow = 0;
fButtonBarMenu = _BuildButtonBarMenu(*buttonBar); fButtonBarMenu = _BuildButtonBarMenu(*buttonBar);
menu = new BMenuField("bar", TR("Button bar:"), fButtonBarMenu, NULL); menu = new BMenuField("bar", B_TRANSLATE("Button bar:"),
fButtonBarMenu, NULL);
add_menu_to_layout(menu, interfaceLayout, layoutRow); add_menu_to_layout(menu, interfaceLayout, layoutRow);
fFontMenu = _BuildFontMenu(font); fFontMenu = _BuildFontMenu(font);
menu = new BMenuField("font", TR("Font:"), fFontMenu, NULL); menu = new BMenuField("font", B_TRANSLATE("Font:"),
fFontMenu, NULL);
add_menu_to_layout(menu, interfaceLayout, layoutRow); add_menu_to_layout(menu, interfaceLayout, layoutRow);
fSizeMenu = _BuildSizeMenu(font); fSizeMenu = _BuildSizeMenu(font);
menu = new BMenuField("size", TR("Size:"), fSizeMenu, NULL); menu = new BMenuField("size", B_TRANSLATE("Size:"), fSizeMenu, NULL);
add_menu_to_layout(menu, interfaceLayout, layoutRow); add_menu_to_layout(menu, interfaceLayout, layoutRow);
fColoredQuotesMenu = _BuildColoredQuotesMenu(fColoredQuotes); fColoredQuotesMenu = _BuildColoredQuotesMenu(fColoredQuotes);
menu = new BMenuField("cquotes", TR("Colored quotes:"), fColoredQuotesMenu, menu = new BMenuField("cquotes", B_TRANSLATE("Colored quotes:"),
NULL); fColoredQuotesMenu, NULL);
add_menu_to_layout(menu, interfaceLayout, layoutRow); add_menu_to_layout(menu, interfaceLayout, layoutRow);
fSpellCheckStartOnMenu = _BuildSpellCheckStartOnMenu(fSpellCheckStartOn); fSpellCheckStartOnMenu = _BuildSpellCheckStartOnMenu(fSpellCheckStartOn);
menu = new BMenuField("spellCheckStartOn", TR("Initial spell check mode:"), menu = new BMenuField("spellCheckStartOn",
B_TRANSLATE("Initial spell check mode:"),
fSpellCheckStartOnMenu, NULL); fSpellCheckStartOnMenu, NULL);
add_menu_to_layout(menu, interfaceLayout, layoutRow); add_menu_to_layout(menu, interfaceLayout, layoutRow);
fAutoMarkReadMenu = _BuildAutoMarkReadMenu(fAutoMarkRead); fAutoMarkReadMenu = _BuildAutoMarkReadMenu(fAutoMarkRead);
menu = new BMenuField("autoMarkRead", menu = new BMenuField("autoMarkRead",
TR("Automatically mark mail as read:"), fAutoMarkReadMenu, NULL); B_TRANSLATE("Automatically mark mail as read:"),
fAutoMarkReadMenu, NULL);
add_menu_to_layout(menu, interfaceLayout, layoutRow); add_menu_to_layout(menu, interfaceLayout, layoutRow);
// Mail Accounts // Mail Accounts
layoutRow = 0; layoutRow = 0;
fAccountMenu = _BuildAccountMenu(fAccount); fAccountMenu = _BuildAccountMenu(fAccount);
menu = new BMenuField("account", TR("Default account:"), fAccountMenu, menu = new BMenuField("account", B_TRANSLATE("Default account:"),
NULL); fAccountMenu, NULL);
add_menu_to_layout(menu, mailLayout, layoutRow); add_menu_to_layout(menu, mailLayout, layoutRow);
fReplyToMenu = _BuildReplyToMenu(fReplyTo); fReplyToMenu = _BuildReplyToMenu(fReplyTo);
menu = new BMenuField("replyTo", TR("Reply account:"), fReplyToMenu, NULL); menu = new BMenuField("replyTo", B_TRANSLATE("Reply account:"),
fReplyToMenu, NULL);
add_menu_to_layout(menu, mailLayout, layoutRow); add_menu_to_layout(menu, mailLayout, layoutRow);
// Mail Contents // Mail Contents
fReplyPreamble = new BTextControl("replytext", TR("Reply preamble:"), fReplyPreamble = new BTextControl("replytext",
B_TRANSLATE("Reply preamble:"),
*preamble, new BMessage(P_REPLY_PREAMBLE)); *preamble, new BMessage(P_REPLY_PREAMBLE));
fReplyPreamble->SetAlignment(B_ALIGN_RIGHT, B_ALIGN_LEFT); fReplyPreamble->SetAlignment(B_ALIGN_RIGHT, B_ALIGN_LEFT);
@@ -236,24 +243,28 @@ TPrefsWindow::TPrefsWindow(BRect rect, BFont* font, int32* level, bool* wrap,
layoutRow++; layoutRow++;
fSignatureMenu = _BuildSignatureMenu(*sig); fSignatureMenu = _BuildSignatureMenu(*sig);
menu = new BMenuField("sig", TR("Auto signature:"), fSignatureMenu, NULL); menu = new BMenuField("sig", B_TRANSLATE("Auto signature:"),
fSignatureMenu, NULL);
add_menu_to_layout(menu, mailLayout, layoutRow); add_menu_to_layout(menu, mailLayout, layoutRow);
fEncodingMenu = _BuildEncodingMenu(fEncoding); fEncodingMenu = _BuildEncodingMenu(fEncoding);
menu = new BMenuField("enc", TR("Encoding:"), fEncodingMenu, NULL); menu = new BMenuField("enc", B_TRANSLATE("Encoding:"),
fEncodingMenu, NULL);
add_menu_to_layout(menu, mailLayout, layoutRow); add_menu_to_layout(menu, mailLayout, layoutRow);
fWarnUnencodableMenu = _BuildWarnUnencodableMenu(fWarnUnencodable); fWarnUnencodableMenu = _BuildWarnUnencodableMenu(fWarnUnencodable);
menu = new BMenuField("warnUnencodable", TR("Warn unencodable:"), menu = new BMenuField("warnUnencodable", B_TRANSLATE("Warn unencodable:"),
fWarnUnencodableMenu, NULL); fWarnUnencodableMenu, NULL);
add_menu_to_layout(menu, mailLayout, layoutRow); add_menu_to_layout(menu, mailLayout, layoutRow);
fWrapMenu = _BuildWrapMenu(*wrap); fWrapMenu = _BuildWrapMenu(*wrap);
menu = new BMenuField("wrap", TR("Text wrapping:"), fWrapMenu, NULL); menu = new BMenuField("wrap", B_TRANSLATE("Text wrapping:"),
fWrapMenu, NULL);
add_menu_to_layout(menu, mailLayout, layoutRow); add_menu_to_layout(menu, mailLayout, layoutRow);
fAttachAttributesMenu = _BuildAttachAttributesMenu(*attachAttributes); fAttachAttributesMenu = _BuildAttachAttributesMenu(*attachAttributes);
menu = new BMenuField("attachAttributes", TR("Attach attributes:"), menu = new BMenuField("attachAttributes",
B_TRANSLATE("Attach attributes:"),
fAttachAttributesMenu, NULL); fAttachAttributesMenu, NULL);
add_menu_to_layout(menu, mailLayout, layoutRow); add_menu_to_layout(menu, mailLayout, layoutRow);
@@ -370,7 +381,8 @@ TPrefsWindow::MessageReceived(BMessage* msg)
} }
strcpy(label,fReplyTo == ACCOUNT_USE_DEFAULT strcpy(label,fReplyTo == ACCOUNT_USE_DEFAULT
? TR("Use default account") : TR("Account from mail")); ? B_TRANSLATE("Use default account")
: B_TRANSLATE("Account from mail"));
if ((item = fReplyToMenu->FindItem(label)) != NULL) if ((item = fReplyToMenu->FindItem(label)) != NULL)
item->SetMarked(true); item->SetMarked(true);
@@ -379,8 +391,8 @@ TPrefsWindow::MessageReceived(BMessage* msg)
item->SetMarked(true); item->SetMarked(true);
strcpy(label, fAttachAttributes strcpy(label, fAttachAttributes
? TR("Include file attributes in attachments") ? B_TRANSLATE("Include file attributes in attachments")
: TR("No file attributes, just plain data")); : B_TRANSLATE("No file attributes, just plain data"));
if ((item = fAttachAttributesMenu->FindItem(label)) != NULL) if ((item = fAttachAttributesMenu->FindItem(label)) != NULL)
item->SetMarked(true); item->SetMarked(true);
@@ -482,8 +494,9 @@ TPrefsWindow::MessageReceived(BMessage* msg)
*fNewSignature = (char*)malloc(strlen(signature) + 1); *fNewSignature = (char*)malloc(strlen(signature) + 1);
strcpy(*fNewSignature, signature); strcpy(*fNewSignature, signature);
} else { } else {
*fNewSignature = (char*)malloc(strlen(TR("None")) + 1); *fNewSignature = (char*)malloc(
strcpy(*fNewSignature, TR("None")); strlen(B_TRANSLATE("None")) + 1);
strcpy(*fNewSignature, B_TRANSLATE("None"));
} }
break; break;
case P_ENC: case P_ENC:
@@ -503,7 +516,7 @@ TPrefsWindow::MessageReceived(BMessage* msg)
msg->FindInt8("bar", (int8*)fNewButtonBar); msg->FindInt8("bar", (int8*)fNewButtonBar);
be_app->PostMessage(PREFS_CHANGED); be_app->PostMessage(PREFS_CHANGED);
break; break;
default: default:
BWindow::MessageReceived(msg); BWindow::MessageReceived(msg);
} }
@@ -595,13 +608,13 @@ TPrefsWindow::_BuildLevelMenu(int32 level)
menu = new BPopUpMenu(""); menu = new BPopUpMenu("");
msg = new BMessage(P_LEVEL); msg = new BMessage(P_LEVEL);
msg->AddInt32("level", L_BEGINNER); msg->AddInt32("level", L_BEGINNER);
menu->AddItem(item = new BMenuItem(TR("Beginner"), msg)); menu->AddItem(item = new BMenuItem(B_TRANSLATE("Beginner"), msg));
if (level == L_BEGINNER) if (level == L_BEGINNER)
item->SetMarked(true); item->SetMarked(true);
msg = new BMessage(P_LEVEL); msg = new BMessage(P_LEVEL);
msg->AddInt32("level", L_EXPERT); msg->AddInt32("level", L_EXPERT);
menu->AddItem(item = new BMenuItem(TR("Expert"), msg)); menu->AddItem(item = new BMenuItem(B_TRANSLATE("Expert"), msg));
if (level == L_EXPERT) if (level == L_EXPERT)
item->SetMarked(true); item->SetMarked(true);
@@ -647,13 +660,13 @@ TPrefsWindow::_BuildReplyToMenu(int32 account)
BMenuItem* item; BMenuItem* item;
BMessage* msg; BMessage* msg;
menu->AddItem(item = new BMenuItem(TR("Use default account"), menu->AddItem(item = new BMenuItem(B_TRANSLATE("Use default account"),
msg = new BMessage(P_REPLYTO))); msg = new BMessage(P_REPLYTO)));
msg->AddInt32("replyTo", ACCOUNT_USE_DEFAULT); msg->AddInt32("replyTo", ACCOUNT_USE_DEFAULT);
if (account == ACCOUNT_USE_DEFAULT) if (account == ACCOUNT_USE_DEFAULT)
item->SetMarked(true); item->SetMarked(true);
menu->AddItem(item = new BMenuItem(TR("Account from mail"), menu->AddItem(item = new BMenuItem(B_TRANSLATE("Account from mail"),
msg = new BMessage(P_REPLYTO))); msg = new BMessage(P_REPLYTO)));
msg->AddInt32("replyTo", ACCOUNT_FROM_MAIL); msg->AddInt32("replyTo", ACCOUNT_FROM_MAIL);
if (account == ACCOUNT_FROM_MAIL) if (account == ACCOUNT_FROM_MAIL)
@@ -671,11 +684,11 @@ TPrefsWindow::_BuildReplyPreambleMenu()
"%f - First name", "%f - First name",
"%l - Last name", "%l - Last name",
*/ */
TR("%n - Full name"), B_TRANSLATE("%n - Full name"),
TR("%e - E-mail address"), B_TRANSLATE("%e - E-mail address"),
TR("%d - Date"), B_TRANSLATE("%d - Date"),
"", "",
TR("\\n - Newline"), B_TRANSLATE("\\n - Newline"),
NULL NULL
}; };
@@ -709,15 +722,15 @@ TPrefsWindow::_BuildSignatureMenu(char* sig)
BPopUpMenu* menu = new BPopUpMenu(""); BPopUpMenu* menu = new BPopUpMenu("");
msg = new BMessage(P_SIG); msg = new BMessage(P_SIG);
msg->AddString("signature", TR("None")); msg->AddString("signature", B_TRANSLATE("None"));
menu->AddItem(item = new BMenuItem(TR("None"), msg)); menu->AddItem(item = new BMenuItem(B_TRANSLATE("None"), msg));
if (!strcmp(sig, TR("None"))) if (!strcmp(sig, B_TRANSLATE("None")))
item->SetMarked(true); item->SetMarked(true);
msg = new BMessage(P_SIG); msg = new BMessage(P_SIG);
msg->AddString("signature", TR("Random")); msg->AddString("signature", B_TRANSLATE("Random"));
menu->AddItem(item = new BMenuItem(TR("Random"), msg)); menu->AddItem(item = new BMenuItem(B_TRANSLATE("Random"), msg));
if (!strcmp(sig, TR("Random"))) if (!strcmp(sig, B_TRANSLATE("Random")))
item->SetMarked(true); item->SetMarked(true);
menu->AddSeparatorItem(); menu->AddSeparatorItem();
@@ -808,14 +821,14 @@ TPrefsWindow::_BuildAttachAttributesMenu(bool attachAttributes)
msg = new BMessage(P_ATTACH_ATTRIBUTES); msg = new BMessage(P_ATTACH_ATTRIBUTES);
msg->AddBool("attachAttributes", true); msg->AddBool("attachAttributes", true);
menu->AddItem(item = new BMenuItem( menu->AddItem(item = new BMenuItem(
TR("Include file attributes in attachments"), msg)); B_TRANSLATE("Include file attributes in attachments"), msg));
if (attachAttributes) if (attachAttributes)
item->SetMarked(true); item->SetMarked(true);
msg = new BMessage(P_ATTACH_ATTRIBUTES); msg = new BMessage(P_ATTACH_ATTRIBUTES);
msg->AddInt32("attachAttributes", false); msg->AddInt32("attachAttributes", false);
menu->AddItem(item = new BMenuItem( menu->AddItem(item = new BMenuItem(
TR("No file attributes, just plain data"), msg)); B_TRANSLATE("No file attributes, just plain data"), msg));
if (!attachAttributes) if (!attachAttributes)
item->SetMarked(true); item->SetMarked(true);
@@ -901,19 +914,20 @@ TPrefsWindow::_BuildButtonBarMenu(uint8 show)
msg = new BMessage(P_BUTTON_BAR); msg = new BMessage(P_BUTTON_BAR);
msg->AddInt8("bar", 1); msg->AddInt8("bar", 1);
menu->AddItem(item = new BMenuItem(TR("Show icons & labels"), msg)); menu->AddItem(item = new BMenuItem(
B_TRANSLATE("Show icons & labels"), msg));
if (show & 1) if (show & 1)
item->SetMarked(true); item->SetMarked(true);
msg = new BMessage(P_BUTTON_BAR); msg = new BMessage(P_BUTTON_BAR);
msg->AddInt8("bar", 2); msg->AddInt8("bar", 2);
menu->AddItem(item = new BMenuItem(TR("Show icons only"), msg)); menu->AddItem(item = new BMenuItem(B_TRANSLATE("Show icons only"), msg));
if (show & 2) if (show & 2)
item->SetMarked(true); item->SetMarked(true);
msg = new BMessage(P_BUTTON_BAR); msg = new BMessage(P_BUTTON_BAR);
msg->AddInt8("bar", 0); msg->AddInt8("bar", 0);
menu->AddItem(item = new BMenuItem(TR("Hide"), msg)); menu->AddItem(item = new BMenuItem(B_TRANSLATE("Hide"), msg));
if (!show) if (!show)
item->SetMarked(true); item->SetMarked(true);
+7 -7
View File
@@ -19,17 +19,17 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF TITLE, MERCHANTABILITY, IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF TITLE, MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
BE INCORPORATED BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN BE INCORPORATED BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF, OR IN CONNECTION AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF, OR IN
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of Be Incorporated shall not be Except as contained in this notice, the name of Be Incorporated shall not be
used in advertising or otherwise to promote the sale, use or other dealings in used in advertising or otherwise to promote the sale, use or other dealings in
this Software without prior written authorization from Be Incorporated. this Software without prior written authorization from Be Incorporated.
BeMail(TM), Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks BeMail(TM), Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or
of Be Incorporated in the United States and other countries. Other brand product registered trademarks of Be Incorporated in the United States and other
names are registered trademarks or trademarks of their respective holders. countries. Other brand product names are registered trademarks or trademarks
All rights reserved. of their respective holders. All rights reserved.
*/ */
@@ -80,7 +80,7 @@ Settings::Settings()
fContentFont(be_fixed_font) fContentFont(be_fixed_font)
{ {
fContentFont.SetSize(12.0); fContentFont.SetSize(12.0);
fSignature = TR("None"); fSignature = B_TRANSLATE("None");
LoadSettings(); LoadSettings();
+47 -34
View File
@@ -19,17 +19,17 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF TITLE, MERCHANTABILITY, IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF TITLE, MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
BE INCORPORATED BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN BE INCORPORATED BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF, OR IN CONNECTION AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF, OR IN
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of Be Incorporated shall not be Except as contained in this notice, the name of Be Incorporated shall not be
used in advertising or otherwise to promote the sale, use or other dealings in used in advertising or otherwise to promote the sale, use or other dealings in
this Software without prior written authorization from Be Incorporated. this Software without prior written authorization from Be Incorporated.
BeMail(TM), Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks BeMail(TM), Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or
of Be Incorporated in the United States and other countries. Other brand product registered trademarks of Be Incorporated in the United States and other
names are registered trademarks or trademarks of their respective holders. countries. Other brand product names are registered trademarks or trademarks
All rights reserved. of their respective holders. All rights reserved.
*/ */
#include "Signature.h" #include "Signature.h"
@@ -60,7 +60,7 @@ extern const char *kRedoStrings[];
TSignatureWindow::TSignatureWindow(BRect rect) TSignatureWindow::TSignatureWindow(BRect rect)
: :
BWindow (rect, TR("Signatures"), B_TITLED_WINDOW, 0), BWindow (rect, B_TRANSLATE("Signatures"), B_TITLED_WINDOW, 0),
fFile(NULL) fFile(NULL)
{ {
BMenu *menu; BMenu *menu;
@@ -70,30 +70,35 @@ TSignatureWindow::TSignatureWindow(BRect rect)
BRect r = Bounds(); BRect r = Bounds();
/*** Set up the menus ****/ /*** Set up the menus ****/
menu_bar = new BMenuBar(r, "MenuBar"); menu_bar = new BMenuBar(r, "MenuBar");
menu = new BMenu(TR("Signature")); menu = new BMenu(B_TRANSLATE("Signature"));
menu->AddItem(fNew = new BMenuItem(TR("New"), new BMessage(M_NEW), 'N')); menu->AddItem(fNew = new BMenuItem(B_TRANSLATE("New"),
fSignature = new TMenu(TR("Open"), INDEX_SIGNATURE, M_SIGNATURE); new BMessage(M_NEW), 'N'));
fSignature = new TMenu(B_TRANSLATE("Open"), INDEX_SIGNATURE, M_SIGNATURE);
menu->AddItem(new BMenuItem(fSignature)); menu->AddItem(new BMenuItem(fSignature));
menu->AddSeparatorItem(); menu->AddSeparatorItem();
menu->AddItem(fSave = new BMenuItem(TR("Save"), new BMessage(M_SAVE), 'S')); menu->AddItem(fSave = new BMenuItem(B_TRANSLATE("Save"),
menu->AddItem(fDelete = new BMenuItem(TR("Delete"), new BMessage(M_DELETE), new BMessage(M_SAVE), 'S'));
'T')); menu->AddItem(fDelete = new BMenuItem(B_TRANSLATE("Delete"),
new BMessage(M_DELETE), 'T'));
menu_bar->AddItem(menu); menu_bar->AddItem(menu);
menu = new BMenu(TR("Edit")); menu = new BMenu(B_TRANSLATE("Edit"));
menu->AddItem(fUndo = new BMenuItem(TR("Undo"), new BMessage(B_UNDO), 'Z')); menu->AddItem(fUndo = new BMenuItem(B_TRANSLATE("Undo"),
new BMessage(B_UNDO), 'Z'));
fUndo->SetTarget(NULL, this); fUndo->SetTarget(NULL, this);
menu->AddSeparatorItem(); menu->AddSeparatorItem();
menu->AddItem(fCut = new BMenuItem(TR("Cut"), new BMessage(B_CUT), 'X')); menu->AddItem(fCut = new BMenuItem(B_TRANSLATE("Cut"),
new BMessage(B_CUT), 'X'));
fCut->SetTarget(NULL, this); fCut->SetTarget(NULL, this);
menu->AddItem(fCopy = new BMenuItem(TR("Copy"), new BMessage(B_COPY), 'C')); menu->AddItem(fCopy = new BMenuItem(B_TRANSLATE("Copy"),
new BMessage(B_COPY), 'C'));
fCopy->SetTarget(NULL, this); fCopy->SetTarget(NULL, this);
menu->AddItem(fPaste = new BMenuItem(TR("Paste"), new BMessage(B_PASTE), menu->AddItem(fPaste = new BMenuItem(B_TRANSLATE("Paste"),
'V')); new BMessage(B_PASTE), 'V'));
fPaste->SetTarget(NULL, this); fPaste->SetTarget(NULL, this);
menu->AddSeparatorItem(); menu->AddSeparatorItem();
menu->AddItem(item = new BMenuItem(TR("Select all"), new BMessage(M_SELECT), menu->AddItem(item = new BMenuItem(B_TRANSLATE("Select all"),
'A')); new BMessage(M_SELECT), 'A'));
item->SetTarget(NULL, this); item->SetTarget(NULL, this);
menu_bar->AddItem(menu); menu_bar->AddItem(menu);
@@ -189,9 +194,11 @@ TSignatureWindow::MessageReceived(BMessage* msg)
case M_DELETE: case M_DELETE:
if (!(new BAlert("", if (!(new BAlert("",
TR("Really delete this signature? This cannot be undone."), B_TRANSLATE("Really delete this signature? This cannot "
TR("Cancel"), TR("Delete"), NULL, B_WIDTH_AS_USUAL, "be undone."),
B_WARNING_ALERT))->Go()) B_TRANSLATE("Cancel"),
B_TRANSLATE("Delete"),
NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go())
break; break;
if (fFile) { if (fFile) {
@@ -224,8 +231,9 @@ TSignatureWindow::MessageReceived(BMessage* msg)
else { else {
fFile = NULL; fFile = NULL;
beep(); beep();
(new BAlert("", TR("Couldn't open this signature. Sorry."), (new BAlert("",
TR("OK")))->Go(); B_TRANSLATE("Couldn't open this signature. Sorry."),
B_TRANSLATE("OK")))->Go();
} }
} }
break; break;
@@ -280,8 +288,11 @@ TSignatureWindow::Clear()
if (IsDirty()) { if (IsDirty()) {
beep(); beep();
BAlert *alert = new BAlert("", TR("Save changes to this signature?"), BAlert *alert = new BAlert("",
TR("Don't save"), TR("Cancel"), TR("Save"), B_TRANSLATE("Save changes to this signature?"),
B_TRANSLATE("Don't save"),
B_TRANSLATE("Cancel"),
B_TRANSLATE("Save"),
B_WIDTH_AS_USUAL, B_WARNING_ALERT); B_WIDTH_AS_USUAL, B_WARNING_ALERT);
alert->SetShortcut(0, 'd'); alert->SetShortcut(0, 'd');
alert->SetShortcut(1, B_ESCAPE); alert->SetShortcut(1, B_ESCAPE);
@@ -374,8 +385,9 @@ TSignatureWindow::Save()
err_exit: err_exit:
beep(); beep();
(new BAlert("", TR("An error occurred trying to save this signature."), (new BAlert("",
TR("Sorry")))->Go(); B_TRANSLATE("An error occurred trying to save this signature."),
B_TRANSLATE("Sorry")))->Go();
} }
@@ -393,8 +405,8 @@ void
TSignatureView::AttachedToWindow() TSignatureView::AttachedToWindow()
{ {
BRect rect = Bounds(); BRect rect = Bounds();
float name_text_length = StringWidth(TR("Title:")); float name_text_length = StringWidth(B_TRANSLATE("Title:"));
float sig_text_length = StringWidth(TR("Signature:")); float sig_text_length = StringWidth(B_TRANSLATE("Signature:"));
float divide_length; float divide_length;
if (name_text_length > sig_text_length) if (name_text_length > sig_text_length)
@@ -405,7 +417,8 @@ TSignatureView::AttachedToWindow()
rect.InsetBy(8,0); rect.InsetBy(8,0);
rect.top+= 8; rect.top+= 8;
fName = new TNameControl(rect, TR("Title:"), new BMessage(NAME_FIELD)); fName = new TNameControl(rect, B_TRANSLATE("Title:"),
new BMessage(NAME_FIELD));
AddChild(fName); AddChild(fName);
fName->SetDivider(divide_length + 10); fName->SetDivider(divide_length + 10);
@@ -427,7 +440,7 @@ TSignatureView::AttachedToWindow()
rect = scroller->Frame(); rect = scroller->Frame();
BStringView *stringView = new BStringView(rect, "SigLabel", BStringView *stringView = new BStringView(rect, "SigLabel",
TR("Signature:")); B_TRANSLATE("Signature:"));
AddChild(stringView); AddChild(stringView);
float tWidth, tHeight; float tWidth, tHeight;