Ticket #7689: mail_daemon-addons.patch
File mail_daemon-addons.patch, 32.2 KB (added by , 13 years ago) |
---|
-
src/add-ons/mail_daemon/inbound_protocols/pop3/ConfigView.cpp
7 7 */ 8 8 9 9 10 #include <Catalog.h> 10 11 #include <FileConfigView.h> 11 12 #include <MailAddon.h> 12 13 #include <MailPrivate.h> 13 14 #include <ProtocolConfigView.h> 14 15 15 16 17 #undef B_TRANSLATE_CONTEXT 18 #define B_TRANSLATE_CONTEXT "ConfigView" 19 20 16 21 class POP3ConfigView : public BMailProtocolConfigView { 17 22 public: 18 23 POP3ConfigView(MailAddonSettings& settings, … … 47 52 48 53 SetTo(settings); 49 54 50 fFileView = new BMailFileConfigView( "Destination:", "destination",51 false, BPrivate::default_mail_in_directory().Path());55 fFileView = new BMailFileConfigView(B_TRANSLATE("Destination:"), 56 "destination", false, BPrivate::default_mail_in_directory().Path()); 52 57 fFileView->SetTo(&settings.Settings(), NULL); 53 58 AddChild(fFileView); 54 59 float w, h; -
src/add-ons/mail_daemon/inbound_protocols/pop3/pop3.cpp
31 31 32 32 #include <Alert.h> 33 33 #include <fs_attr.h> 34 #include <Catalog.h> 34 35 #include <Debug.h> 35 36 #include <Directory.h> 36 37 #include <Path.h> … … 42 43 #include "MailSettings.h" 43 44 #include "MessageIO.h" 44 45 45 #include <MDRLanguage.h>46 46 47 #undef B_TRANSLATE_CONTEXT 48 #define B_TRANSLATE_CONTEXT "pop3" 49 50 47 51 #define POP3_RETRIEVAL_TIMEOUT 60000000 48 52 #define CRLF "\r\n" 49 53 … … 140 144 _ReadManifest(); 141 145 142 146 SetTotalItems(2); 143 ReportProgress(0, 1, "Connect to server...");147 ReportProgress(0, 1, B_TRANSLATE("Connect to server" B_UTF8_ELLIPSIS)); 144 148 status_t error = Connect(); 145 149 if (error < B_OK) { 146 150 ResetProgress(); 147 151 return error; 148 152 } 149 153 150 ReportProgress(0, 1, MDR_DIALECT_CHOICE("Getting UniqueIDs...", 151 "固有のIDを取得中...")); 154 ReportProgress(0, 1, B_TRANSLATE("Getting UniqueIDs" B_UTF8_ELLIPSIS)); 152 155 error = _UniqueIDs(); 153 156 if (error < B_OK) { 154 157 ResetProgress(); … … 326 329 status_t 327 330 POP3Protocol::Open(const char *server, int port, int) 328 331 { 329 ReportProgress(0, 0, MDR_DIALECT_CHOICE("Connecting to POP3 server...",330 "POP3サーバに接続しています..."));332 ReportProgress(0, 0, B_TRANSLATE("Connecting to POP3 server" 333 B_UTF8_ELLIPSIS)); 331 334 332 335 if (port <= 0) { 333 336 #ifdef USE_SSL … … 341 344 342 345 // Prime the error message 343 346 BString error_msg; 344 error_msg << MDR_DIALECT_CHOICE("Error while connecting to server ", 345 "サーバに接続中にエラーが発生しました ") << server; 347 error_msg << B_TRANSLATE("Error while connecting to server ") << server; 346 348 if (port != 110) 347 349 error_msg << ":" << port; 348 350 … … 354 356 } 355 357 356 358 if (hostIP == 0) { 357 error_msg << MDR_DIALECT_CHOICE(": Connection refused or host not found", 358 ": :接続が拒否されたかサーバーが見つかりません"); 359 error_msg << B_TRANSLATE(": Connection refused or host not found"); 359 360 ShowError(error_msg.String()); 360 361 361 362 return B_NAME_NOT_FOUND; … … 368 369 saAddr.sin_family = AF_INET; 369 370 saAddr.sin_port = htons(port); 370 371 saAddr.sin_addr.s_addr = hostIP; 371 int result = connect(fSocket, (struct sockaddr *) &saAddr, sizeof(saAddr)); 372 int result = connect(fSocket, (struct sockaddr *) &saAddr, 373 sizeof(saAddr)); 372 374 if (result < 0) { 373 375 close(fSocket); 374 376 fSocket = -1; … … 377 379 return errno; 378 380 } 379 381 } else { 380 error_msg << ": Could not allocate socket.";382 error_msg << B_TRANSLATE(": Could not allocate socket."); 381 383 ShowError(error_msg.String()); 382 384 return B_ERROR; 383 385 } … … 424 426 425 427 if (strncmp(line.String(), "+OK", 3) != 0) { 426 428 if (line.Length() > 0) { 427 error_msg << MDR_DIALECT_CHOICE(". The server said:\n",428 "サーバのメッセージです\n")<< line.String();429 error_msg << B_TRANSLATE(". The server said:\n") 430 << line.String(); 429 431 } else 430 error_msg << ": No reply.\n";432 error_msg << B_TRANSLATE(": No reply.\n"); 431 433 432 434 ShowError(error_msg.String()); 433 435 return B_ERROR; … … 444 446 status_t err; 445 447 446 448 BString error_msg; 447 error_msg << MDR_DIALECT_CHOICE("Error while authenticating user ", 448 "ユーザー認証中にエラーが発生しました ") << uid; 449 error_msg << B_TRANSLATE("Error while authenticating user ") << uid; 449 450 450 451 if (method == 1) { //APOP 451 452 int32 index = fLog.FindFirst("<"); 452 453 if(index != B_ERROR) { 453 ReportProgress(0, 0, MDR_DIALECT_CHOICE(454 "Sending APOP authentication...", "APOP認証情報を送信中..."));454 ReportProgress(0, 0, B_TRANSLATE("Sending APOP authentication" 455 B_UTF8_ELLIPSIS)); 455 456 int32 end = fLog.FindFirst(">",index); 456 457 BString timestamp(""); 457 458 fLog.CopyInto(timestamp, index, end - index + 1); … … 466 467 467 468 err = SendCommand(cmd.String()); 468 469 if (err != B_OK) { 469 error_msg << MDR_DIALECT_CHOICE(". The server said:\n", 470 "サーバのメッセージです\n") << fLog; 470 error_msg << B_TRANSLATE(". The server said:\n") << fLog; 471 471 ShowError(error_msg.String()); 472 472 return err; 473 473 } 474 474 475 475 return B_OK; 476 476 } else { 477 error_msg << MDR_DIALECT_CHOICE(": The server does not support APOP.", 478 "サーバはAPOPをサポートしていません"); 477 error_msg << B_TRANSLATE(": The server does not support APOP."); 479 478 ShowError(error_msg.String()); 480 479 return B_NOT_ALLOWED; 481 480 } 482 481 } 483 ReportProgress(0, 0, MDR_DIALECT_CHOICE("Sending username...", 484 "ユーザーID送信中...")); 482 ReportProgress(0, 0, B_TRANSLATE("Sending username" B_UTF8_ELLIPSIS)); 485 483 486 484 BString cmd = "USER "; 487 485 cmd += uid; … … 489 487 490 488 err = SendCommand(cmd.String()); 491 489 if (err != B_OK) { 492 error_msg << MDR_DIALECT_CHOICE(". The server said:\n", 493 "サーバのメッセージです\n") << fLog; 490 error_msg << B_TRANSLATE(". The server said:\n") << fLog; 494 491 ShowError(error_msg.String()); 495 492 return err; 496 493 } 497 494 498 ReportProgress(0, 0, MDR_DIALECT_CHOICE("Sending password...", 499 "パスワード送信中...")); 495 ReportProgress(0, 0, B_TRANSLATE("Sending password" B_UTF8_ELLIPSIS)); 500 496 cmd = "PASS "; 501 497 cmd += password; 502 498 cmd += CRLF; 503 499 504 500 err = SendCommand(cmd.String()); 505 501 if (err != B_OK) { 506 error_msg << MDR_DIALECT_CHOICE(". The server said:\n", 507 "サーバのメッセージです\n") << fLog; 502 error_msg << B_TRANSLATE(". The server said:\n") << fLog; 508 503 ShowError(error_msg.String()); 509 504 return err; 510 505 } … … 516 511 status_t 517 512 POP3Protocol::Stat() 518 513 { 519 ReportProgress(0, 0, MDR_DIALECT_CHOICE("Getting mailbox size...", 520 "メールボックスのサイズを取得しています...")); 514 ReportProgress(0, 0, B_TRANSLATE("Getting mailbox size" B_UTF8_ELLIPSIS)); 521 515 522 516 if (SendCommand("STAT" CRLF) < B_OK) 523 517 return B_ERROR; -
src/add-ons/mail_daemon/inbound_protocols/pop3/Jamfile
30 30 31 31 Addon POP3 32 32 : $(sources) 33 : be libmail.so $( TARGET_NETWORK_LIBS) $(HAIKU_OPENSSL_LIBS)34 $(TARGET_LIBSUPC++) 33 : be libmail.so $(HAIKU_LOCALE_LIBS) $(HAIKU_OPENSSL_LIBS) 34 $(TARGET_LIBSUPC++) $(TARGET_NETWORK_LIBS) 35 35 ; 36 36 37 37 Package haiku-maildaemon-cvs : 38 38 POP3 : 39 39 boot home config add-ons mail_daemon inbound_protocols 40 40 ; 41 42 DoCatalogs POP3 : 43 x-vnd.Haiku-POP3 44 : 45 ConfigView.cpp 46 pop3.cpp 47 ; -
src/add-ons/mail_daemon/inbound_protocols/imap/Jamfile
33 33 : 34 34 $(sources) 35 35 : 36 be libmail.so $( TARGET_NETWORK_LIBS) libalm.so36 be libmail.so $(HAIKU_LOCALE_LIBS) $(TARGET_NETWORK_LIBS) libalm.so 37 37 libshared.a $(TARGET_LIBSUPC++) $(TARGET_LIBSTDC++) 38 38 ; 39 39 … … 46 46 IMAP : 47 47 boot home config add-ons mail_daemon inbound_protocols 48 48 ; 49 50 DoCatalogs IMAP : 51 x-vnd.Haiku-IMAP 52 : 53 imap_config.cpp 54 IMAPFolderConfig.cpp 55 ; -
src/add-ons/mail_daemon/inbound_protocols/imap/IMAPFolderConfig.cpp
7 7 8 8 #include "IMAPFolderConfig.h" 9 9 10 #include <Catalog.h> 10 11 #include <ControlLook.h> 11 12 #include <ListItem.h> 12 13 #include <SpaceLayoutItem.h> … … 18 19 #include <crypt.h> 19 20 20 21 22 #undef B_TRANSLATE_CONTEXT 23 #define B_TRANSLATE_CONTEXT "IMAPFolderConfig" 24 25 21 26 class EditableListItem { 22 27 public: 23 28 EditableListItem(); … … 90 95 BRect boxRect(0.0f, 2.0f, ceilf(3.0f + fontHeight.ascent), 91 96 ceilf(5.0f + fontHeight.ascent)); 92 97 93 98 94 99 fBoxRect.left = itemRect.right - boxRect.Width(); 95 100 fBoxRect.top = itemRect.top + (itemRect.Height() - boxRect.Height()) / 2; 96 101 fBoxRect.right = itemRect.right; … … 152 157 BListView(name, type, flags), 153 158 fLastMouseDown(NULL) 154 159 { 155 160 156 161 } 157 162 158 163 … … 201 206 public: 202 207 StatusWindow(const char* text) 203 208 : 204 BWindow(BRect(0, 0, 10, 10), "status", B_MODAL_WINDOW_LOOK,209 BWindow(BRect(0, 0, 10, 10), B_TRANSLATE("status"), B_MODAL_WINDOW_LOOK, 205 210 B_MODAL_APP_WINDOW_FEEL, B_NO_WORKSPACE_ACTIVATION | B_NOT_ZOOMABLE 206 211 | B_AVOID_FRONT | B_NOT_RESIZABLE) 207 212 { … … 230 235 231 236 FolderConfigWindow::FolderConfigWindow(BRect parent, const BMessage& settings) 232 237 : 233 BWindow(BRect(0, 0, 300, 300), "IMAP Folders", B_TITLED_WINDOW_LOOK,234 B_ MODAL_APP_WINDOW_FEEL, B_NO_WORKSPACE_ACTIVATION | B_NOT_ZOOMABLE235 238 BWindow(BRect(0, 0, 300, 300), B_TRANSLATE("IMAP Folders"), 239 B_TITLED_WINDOW_LOOK, B_MODAL_APP_WINDOW_FEEL, B_NO_WORKSPACE_ACTIVATION 240 | B_NOT_ZOOMABLE | B_AVOID_FRONT), 236 241 fSettings(settings) 237 242 { 238 243 BView* rootView = new BView(Bounds(), "root", B_FOLLOW_ALL, B_WILL_DRAW); … … 244 249 rootView->SetLayout(layout); 245 250 layout->SetInset(spacing); 246 251 247 fFolderListView = new EditListView( "IMAP Folders");252 fFolderListView = new EditListView(B_TRANSLATE("IMAP Folders")); 248 253 fFolderListView->SetExplicitPreferredSize(BSize(B_SIZE_UNLIMITED, 249 254 B_SIZE_UNLIMITED)); 250 fApplyButton = new BButton("Apply", "Apply", new BMessage(kMsgApplyButton)); 255 fApplyButton = new BButton("Apply", B_TRANSLATE("Apply"), 256 new BMessage(kMsgApplyButton)); 251 257 252 258 fQuotaView = new BStringView("quota view", 253 "Failed to fetch available storage.");259 B_TRANSLATE("Failed to fetch available storage.")); 254 260 fQuotaView->SetExplicitAlignment(BAlignment(B_ALIGN_LEFT, 255 261 B_ALIGN_VERTICAL_CENTER)); 256 262 … … 294 300 void 295 301 FolderConfigWindow::_LoadFolders() 296 302 { 297 StatusWindow* status = new StatusWindow( "Fetching IMAP folders, have"298 " patience...");303 StatusWindow* status = new StatusWindow(B_TRANSLATE("Fetching IMAP " 304 "folders, have patience" B_UTF8_ELLIPSIS)); 299 305 status->Show(); 300 306 301 307 BString server; … … 356 362 if (!haveChanges) 357 363 return; 358 364 359 StatusWindow* status = new StatusWindow( "Subcribe / Unsuscribe IMAP"360 " folders, have patience...");365 StatusWindow* status = new StatusWindow(B_TRANSLATE("Subcribe / Unsuscribe " 366 "IMAP folders, have patience" B_UTF8_ELLIPSIS)); 361 367 status->Show(); 362 368 363 369 for (unsigned int i = 0; i < fFolderList.size(); i++) { -
src/add-ons/mail_daemon/inbound_protocols/imap/imap_config.cpp
8 8 9 9 10 10 #include <Button.h> 11 #include <Catalog.h> 11 12 #include <TextControl.h> 12 13 13 14 #include <MailAddon.h> … … 16 17 #include <FileConfigView.h> 17 18 #include <ProtocolConfigView.h> 18 19 #include <MailPrivate.h> 19 #include <MDRLanguage.h>20 20 21 21 #include "IMAPFolderConfig.h" 22 22 23 23 24 #undef B_TRANSLATE_CONTEXT 25 #define B_TRANSLATE_CONTEXT "imap_config" 26 27 24 28 const uint32 kMsgOpenIMAPFolder = '&OIF'; 25 29 26 30 … … 70 74 ((BControl *)(FindView("delete_remote_when_local")))->SetEnabled(true); 71 75 ((BControl *)(FindView("delete_remote_when_local")))->MoveBy(0, -25); 72 76 73 fIMAPFolderButton = new BButton(frame, "IMAP Folders", "IMAP Folders",74 new BMessage(kMsgOpenIMAPFolder));77 fIMAPFolderButton = new BButton(frame, "IMAP Folders", B_TRANSLATE( 78 "IMAP Folders"), new BMessage(kMsgOpenIMAPFolder)); 75 79 AddChild(fIMAPFolderButton); 76 80 77 81 frame.right -= 10; … … 79 83 BPath defaultFolder = BPrivate::default_mail_directory(); 80 84 defaultFolder.Append(accountSettings.Name()); 81 85 82 fFileView = new BMailFileConfigView( "Destination:", "destination",83 false, defaultFolder.Path());86 fFileView = new BMailFileConfigView(B_TRANSLATE("Destination:"), 87 "destination", false, defaultFolder.Path()); 84 88 fFileView->SetTo(&settings.Settings(), NULL); 85 89 AddChild(fFileView); 86 90 fFileView->MoveBy(0, frame.bottom + 5); -
src/add-ons/mail_daemon/outbound_protocols/smtp/ConfigView.cpp
9 9 10 10 #include <TextControl.h> 11 11 12 #include <Catalog.h> 12 13 #include <FileConfigView.h> 13 14 #include <MailAddon.h> 14 #include <MDRLanguage.h>15 15 #include <MenuField.h> 16 16 #include <MailPrivate.h> 17 17 #include <ProtocolConfigView.h> 18 18 19 19 20 #undef B_TRANSLATE_CONTEXT 21 #define B_TRANSLATE_CONTEXT "ConfigView" 22 23 20 24 class SMTPConfigView : public BMailProtocolConfigView { 21 25 public: 22 26 SMTPConfigView(MailAddonSettings& settings, … … 45 49 AddFlavor("STARTTLS"); 46 50 #endif 47 51 48 AddAuthMethod( MDR_DIALECT_CHOICE("None","無し"), false);49 AddAuthMethod( MDR_DIALECT_CHOICE("ESMTP","ESMTP"));50 AddAuthMethod( MDR_DIALECT_CHOICE("POP3 before SMTP","送信前に受信する"), false);52 AddAuthMethod(B_TRANSLATE("None"), false); 53 AddAuthMethod(B_TRANSLATE("ESMTP")); 54 AddAuthMethod(B_TRANSLATE("POP3 before SMTP"), false); 51 55 52 56 BTextControl *control = (BTextControl *)(FindView("host")); 53 control->SetLabel( MDR_DIALECT_CHOICE("SMTP server: ","SMTPサーバ: "));57 control->SetLabel(B_TRANSLATE("SMTP server: ")); 54 58 55 59 // Reset the dividers after changing one 56 60 float widestLabel = 0; … … 68 72 69 73 SetTo(settings); 70 74 71 fFileView = new BMailFileConfigView( "Destination:", "path", false,72 BPrivate::default_mail_out_directory().Path());75 fFileView = new BMailFileConfigView(B_TRANSLATE("Destination:"), "path", 76 false, BPrivate::default_mail_out_directory().Path()); 73 77 fFileView->SetTo(&settings.Settings(), NULL); 74 78 AddChild(fFileView); 75 79 float w, h; -
src/add-ons/mail_daemon/outbound_protocols/smtp/smtp.cpp
26 26 #include <unistd.h> 27 27 28 28 #include <Alert.h> 29 #include <Catalog.h> 29 30 #include <DataIO.h> 30 31 #include <Entry.h> 31 32 #include <File.h> … … 46 47 # include "md5.h" 47 48 #endif 48 49 49 #include <MDRLanguage.h>50 50 51 #undef B_TRANSLATE_CONTEXT 52 #define B_TRANSLATE_CONTEXT "smtp" 51 53 54 52 55 #define CRLF "\r\n" 53 56 #define SMTP_RESPONSE_SIZE 8192 54 57 … … 268 271 // to the SMTP server first... 269 272 status_t status = _POP3Authentication(); 270 273 if (status < B_OK) { 271 error_msg << MDR_DIALECT_CHOICE ("POP3 authentication failed. The server said:\n","POP3認証に失敗しました\n") << fLog; 274 error_msg << B_TRANSLATE("POP3 authentication failed. The server " 275 "said:\n") << fLog; 272 276 ShowError(error_msg.String()); 273 277 return status; 274 278 } … … 277 281 status = Open(fSettingsMessage.FindString("server"), 278 282 fSettingsMessage.FindInt32("port"), authMethod == 1); 279 283 if (status < B_OK) { 280 error_msg << MDR_DIALECT_CHOICE ("Error while opening connection to ","接続中にエラーが発生しました") << fSettingsMessage.FindString("server"); 284 error_msg << B_TRANSLATE("Error while opening connection to ") 285 << fSettingsMessage.FindString("server"); 281 286 282 287 if (fSettingsMessage.FindInt32("port") > 0) 283 288 error_msg << ":" << fSettingsMessage.FindInt32("port"); 284 289 285 290 // << strerror(err) - BNetEndpoint sucks, we can't use this; 286 291 if (fLog.Length() > 0) 287 error_msg << ". The server says:\n"<< fLog;292 error_msg << B_TRANSLATE(". The server says:\n") << fLog; 288 293 else 289 error_msg << MDR_DIALECT_CHOICE (": Connection refused or host not found.",";接続が拒否されたかサーバーが見つかりません");294 error_msg << B_TRANSLATE(": Connection refused or host not found."); 290 295 291 296 ShowError(error_msg.String()); 292 297 … … 299 304 300 305 if (status != B_OK) { 301 306 //-----This is a really cool kind of error message. How can we make it work for POP3? 302 error_msg << MDR_DIALECT_CHOICE ("Error while logging in to ","ログイン中にエラーが発生しました\n") << fSettingsMessage.FindString("server") 303 << MDR_DIALECT_CHOICE (". The server said:\n","サーバーエラー\n") << fLog; 307 error_msg << B_TRANSLATE("Error while logging in to ") 308 << fSettingsMessage.FindString("server") 309 << B_TRANSLATE(". The server said:\n") << fLog; 304 310 ShowError(error_msg.String()); 305 311 } 306 312 return B_OK; … … 350 356 status_t 351 357 SMTPProtocol::Open(const char *address, int port, bool esmtp) 352 358 { 353 ReportProgress(0, 0, MDR_DIALECT_CHOICE ("Connecting to server...","接続中..."));359 ReportProgress(0, 0, B_TRANSLATE("Connecting to server" B_UTF8_ELLIPSIS)); 354 360 355 361 #ifdef USE_SSL 356 362 use_ssl = (fSettingsMessage.FindInt32("flavor") == 1); … … 408 414 409 415 if (SSL_connect(ssl) <= 0) { 410 416 BString error; 411 error << "Could not connect to SMTP server " << fSettingsMessage.FindString("server"); 417 error << "Could not connect to SMTP server " 418 << fSettingsMessage.FindString("server"); 412 419 if (port != 465) 413 420 error << ":" << port; 414 421 error << ". (SSL connection error)"; -
src/add-ons/mail_daemon/outbound_protocols/smtp/Jamfile
27 27 Addon SMTP 28 28 : $(sources) 29 29 : be libmail.so $(TARGET_NETWORK_LIBS) $(TARGET_LIBSTDC++) 30 $(HAIKU_ OPENSSL_LIBS)30 $(HAIKU_LOCALE_LIBS) $(HAIKU_OPENSSL_LIBS) 31 31 ; 32 33 DoCatalogs SMTP : 34 x-vnd.Haiku-SMTP 35 : 36 ConfigView.cpp 37 smtp.cpp 38 ; -
src/add-ons/mail_daemon/inbound_filters/notifier/ConfigView.cpp
6 6 7 7 #include "ConfigView.h" 8 8 9 #include <Catalog.h> 9 10 #include <CheckBox.h> 10 11 #include <PopUpMenu.h> 11 12 #include <MenuItem.h> … … 13 14 #include <String.h> 14 15 #include <Message.h> 15 16 16 #include <MDRLanguage.h>17 18 17 #include <MailAddon.h> 19 18 #include <MailSettings.h> 20 19 20 21 #undef B_TRANSLATE_CONTEXT 22 #define B_TRANSLATE_CONTEXT "ConfigView" 23 24 21 25 const uint32 kMsgNotifyMethod = 'nomt'; 22 26 23 27 … … 29 33 // determine font height 30 34 font_height fontHeight; 31 35 GetFontHeight(&fontHeight); 32 float itemHeight = (int32)(fontHeight.ascent + fontHeight.descent + fontHeight.leading) + 6; 33 36 float itemHeight = (int32)(fontHeight.ascent + fontHeight.descent 37 + fontHeight.leading) + 6; 38 34 39 BRect frame(5,2,250,itemHeight + 2); 35 40 BPopUpMenu *menu = new BPopUpMenu(B_EMPTY_STRING,false,false); 36 41 37 42 const char *notifyMethods[] = { 38 MDR_DIALECT_CHOICE ("Beep","音"), 39 MDR_DIALECT_CHOICE ("Alert","窓(メール毎)"), 40 MDR_DIALECT_CHOICE ("Keyboard LEDs","キーボードLED"), 41 MDR_DIALECT_CHOICE ("Central alert","窓(一括)"), 42 "Central beep","Log window"}; 43 for (int32 i = 0,j = 1;i < 6;i++,j *= 2) 44 menu->AddItem(new BMenuItem(notifyMethods[i],new BMessage(kMsgNotifyMethod))); 43 B_TRANSLATE("Beep"), 44 B_TRANSLATE("Alert"), 45 B_TRANSLATE("Keyboard LEDs"), 46 B_TRANSLATE("Central alert"), 47 B_TRANSLATE("Central beep"), 48 B_TRANSLATE("Log window")}; 49 for (int32 i = 0,j = 1; i < 6; i++, j *= 2) 50 menu->AddItem(new BMenuItem(notifyMethods[i], 51 new BMessage(kMsgNotifyMethod))); 45 52 46 BMenuField *field = new BMenuField(frame,"notify", 47 MDR_DIALECT_CHOICE ("Method:","方法:"),menu);53 BMenuField *field = new BMenuField(frame,"notify", B_TRANSLATE("Method:"), 54 menu); 48 55 field->ResizeToPreferred(); 49 field->SetDivider(field->StringWidth( 50 MDR_DIALECT_CHOICE ("Method:","方法:")) + 6); 56 field->SetDivider(field->StringWidth(B_TRANSLATE("Method:")) + 6); 51 57 AddChild(field); 52 58 53 59 ResizeToPreferred(); 54 } 60 } 55 61 56 62 57 63 void ConfigView::AttachedToWindow() … … 112 118 BMenuItem *item; 113 119 if (msg->FindPointer("source",(void **)&item) < B_OK) 114 120 break; 115 121 116 122 item->SetMarked(!item->IsMarked()); 117 123 UpdateNotifyText(); 118 124 break; … … 144 150 return B_OK; 145 151 } 146 152 147 153 148 154 void ConfigView::GetPreferredSize(float *width, float *height) 149 155 { 150 156 *width = 258; -
src/add-ons/mail_daemon/inbound_filters/notifier/filter.cpp
5 5 */ 6 6 7 7 8 #include <Message.h>9 #include <String.h>10 8 #include <Alert.h> 9 #include <Application.h> 11 10 #include <Beep.h> 11 #include <Catalog.h> 12 #include <Message.h> 12 13 #include <Path.h> 13 #include < Application.h>14 #include <String.h> 14 15 15 16 #include <MailAddon.h> 16 #include <MDRLanguage.h>17 17 18 18 #include "ConfigView.h" 19 19 20 20 21 #undef B_TRANSLATE_CONTEXT 22 #define B_TRANSLATE_CONTEXT "filter" 23 24 21 25 class NotifyFilter : public MailFilter 22 26 { 23 27 public: … … 64 68 65 69 if (fStrategy & alert) { 66 70 BString text; 67 MDR_DIALECT_CHOICE ( 68 text << "You have " << fNNewMessages << " new message" << ((fNNewMessages != 1) ? "s" : "") 69 << " for " << fMailProtocol.AccountSettings().Name() << ".", 71 if (fNNewMessages != 1) 72 text << B_TRANSLATE("You have ") << fNNewMessages << B_TRANSLATE( 73 " new messages") << B_TRANSLATE(" for ") 74 << fMailProtocol.AccountSettings().Name() << "."; 75 else 76 text << B_TRANSLATE("You have ") << fNNewMessages << B_TRANSLATE( 77 " new message") << B_TRANSLATE(" for ") 78 << fMailProtocol.AccountSettings().Name() << "."; 70 79 71 text << fMailProtocol.AccountSettings().Name() << "より\n" << fNNewMessages << " 通のメッセージが届きました"); 72 73 BAlert *alert = new BAlert(MDR_DIALECT_CHOICE ("New messages","新着メッセージ"), text.String(), "OK", NULL, NULL, B_WIDTH_AS_USUAL); 80 BAlert *alert = new BAlert(B_TRANSLATE("New messages"), text.String(), 81 "OK", NULL, NULL, B_WIDTH_AS_USUAL); 74 82 alert->SetFeel(B_NORMAL_WINDOW_FEEL); 75 83 alert->Go(NULL); 76 84 } … … 91 99 92 100 if (fStrategy & log_window) { 93 101 BString message; 94 message << fNNewMessages << " new message" << ((fNNewMessages != 1) ? "s" : ""); 102 if (fNNewMessages != 1) 103 message << fNNewMessages << B_TRANSLATE(" new messages"); 104 else 105 message << fNNewMessages << B_TRANSLATE(" new message"); 95 106 fMailProtocol.ShowMessage(message.String()); 96 107 } 97 108 -
src/add-ons/mail_daemon/inbound_filters/notifier/Jamfile
9 9 filter.cpp 10 10 ConfigView.cpp 11 11 : 12 be libmail.so $( TARGET_LIBSUPC++)12 be libmail.so $(HAIKU_LOCALE_LIBS) $(TARGET_LIBSUPC++) 13 13 ; 14 15 DoCatalogs NewMailNotification : 16 x-vnd.Haiku-NewMailNotification 17 : 18 ConfigView.cpp 19 filter.cpp 20 ; -
src/add-ons/mail_daemon/inbound_filters/match_header/ConfigView.cpp
4 4 */ 5 5 6 6 7 #include <stdio.h> 8 9 #include <Catalog.h> 7 10 #include <MenuField.h> 8 11 #include <PopUpMenu.h> 9 12 #include <Message.h> … … 14 17 #include <FileConfigView.h> 15 18 #include <MailSettings.h> 16 19 17 #include <MDRLanguage.h>18 20 21 #undef B_TRANSLATE_CONTEXT 22 #define B_TRANSLATE_CONTEXT "ConfigView" 23 24 19 25 const uint32 kMsgActionMoveTo = 'argm'; 20 26 const uint32 kMsgActionDelete = 'argd'; 21 27 const uint32 kMsgActionSetTo = 'args'; … … 40 46 int32 chain; 41 47 }; 42 48 43 #include <stdio.h>44 49 45 50 RuleFilterConfig::RuleFilterConfig(const BMessage *settings) 46 51 : … … 48 53 0), menu(NULL) 49 54 { 50 55 SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); 51 attr = new BTextControl(BRect(5,5,100,20),"attr",MDR_DIALECT_CHOICE ("If","条件:"),MDR_DIALECT_CHOICE ("header (e.g. Subject)","ヘッダ(例えばSubject)"),NULL); 52 attr->SetDivider(be_plain_font->StringWidth(MDR_DIALECT_CHOICE ("If ","条件: "))+ 4); 56 attr = new BTextControl(BRect(5,5,100,20),"attr", B_TRANSLATE("If"), 57 B_TRANSLATE("header (e.g. Subject)"),NULL); 58 attr->SetDivider(be_plain_font->StringWidth(B_TRANSLATE("If "))+ 4); 53 59 if (settings->HasString("attribute")) 54 60 attr->SetText(settings->FindString("attribute")); 55 61 AddChild(attr); 56 62 57 regex = new BTextControl(BRect(104,5,255,20),"attr",MDR_DIALECT_CHOICE (" has "," が "),MDR_DIALECT_CHOICE ("value (use REGEX: in from of regular expressions like *spam*)","値(正規表現対応)"),NULL); 58 regex->SetDivider(be_plain_font->StringWidth(MDR_DIALECT_CHOICE (" has "," が ")) + 4); 63 regex = new BTextControl(BRect(104,5,255,20),"attr", B_TRANSLATE(" has "), 64 B_TRANSLATE("value (use REGEX: in from of regular expressions like " 65 "*spam*)"), NULL); 66 regex->SetDivider(be_plain_font->StringWidth(B_TRANSLATE(" has ")) + 4); 59 67 if (settings->HasString("regex")) 60 68 regex->SetText(settings->FindString("regex")); 61 69 AddChild(regex); 62 70 63 arg = new BFileControl(BRect(5,55,255,80),"arg",NULL,MDR_DIALECT_CHOICE ("this field is based on the action","ここは動作によって意味が変わります")); 71 arg = new BFileControl(BRect(5,55,255,80),"arg", NULL, 72 B_TRANSLATE("this field is based on the action")); 64 73 if (BControl *control = (BControl *)arg->FindView("select_file")) 65 74 control->SetEnabled(false); 66 75 if (settings->HasString("argument")) 67 76 arg->SetText(settings->FindString("argument")); 68 77 69 outbound = new BPopUpMenu( MDR_DIALECT_CHOICE ("<Choose account>","<アカウントを選択>"));78 outbound = new BPopUpMenu(B_TRANSLATE("<Choose account>")); 70 79 71 80 if (settings->HasInt32("do_what")) 72 81 staging = settings->FindInt32("do_what"); … … 96 105 if (menu != NULL) 97 106 return; // We switched back from another tab 98 107 99 menu = new BPopUpMenu(MDR_DIALECT_CHOICE ("<Choose action>","<動作を選択>")); 100 menu->AddItem(new BMenuItem(MDR_DIALECT_CHOICE ("Move to","移動する"), new BMessage(kMsgActionMoveTo))); 101 menu->AddItem(new BMenuItem(MDR_DIALECT_CHOICE ("Set flags to","フラグを指定する"), new BMessage(kMsgActionSetTo))); 102 menu->AddItem(new BMenuItem(MDR_DIALECT_CHOICE ("Delete message","削除する"), new BMessage(kMsgActionDelete))); 103 menu->AddItem(new BMenuItem(MDR_DIALECT_CHOICE ("Reply with","返事を書く"), new BMessage(kMsgActionReplyWith))); 104 menu->AddItem(new BMenuItem(MDR_DIALECT_CHOICE ("Set as read","既読にする"), new BMessage(kMsgActionSetRead))); 108 menu = new BPopUpMenu(B_TRANSLATE("<Choose action>")); 109 menu->AddItem(new BMenuItem(B_TRANSLATE("Move to"), 110 new BMessage(kMsgActionMoveTo))); 111 menu->AddItem(new BMenuItem(B_TRANSLATE("Set flags to"), 112 new BMessage(kMsgActionSetTo))); 113 menu->AddItem(new BMenuItem(B_TRANSLATE("Delete message"), 114 new BMessage(kMsgActionDelete))); 115 menu->AddItem(new BMenuItem(B_TRANSLATE("Reply with"), 116 new BMessage(kMsgActionReplyWith))); 117 menu->AddItem(new BMenuItem(B_TRANSLATE("Set as read"), 118 new BMessage(kMsgActionSetRead))); 105 119 menu->SetTargetForItems(this); 106 120 107 BMenuField *field = new BMenuField(BRect(5,30,210,50),"do_what",MDR_DIALECT_CHOICE ("Then","ならば"),menu); 121 BMenuField *field = new BMenuField(BRect(5,30,210,50),"do_what", 122 B_TRANSLATE("Then"), menu); 108 123 field->ResizeToPreferred(); 109 field->SetDivider(be_plain_font->StringWidth( MDR_DIALECT_CHOICE ("Then","ならば")) + 8);124 field->SetDivider(be_plain_font->StringWidth(B_TRANSLATE("Then")) + 8); 110 125 AddChild(field); 111 126 112 127 outbound_field = new BMenuField(BRect(5,55,255,80),"reply","Foo",outbound); -
src/add-ons/mail_daemon/inbound_filters/match_header/Jamfile
5 5 6 6 SubDirHdrs [ FDirName $(HAIKU_TOP) headers os add-ons mail_daemon ] ; 7 7 8 Addon MatchHeader : 8 Addon MatchHeader : 9 9 ConfigView.cpp 10 10 RuleFilter.cpp 11 11 StringMatcher.cpp ; 12 12 13 13 LinkAgainst MatchHeader : 14 be libmail.so $(TARGET_LIBSUPC++) ; 14 be libmail.so $(HAIKU_LOCALE_LIBS) $(TARGET_LIBSUPC++) ; 15 16 DoCatalogs MatchHeader : 17 x-vnd.Haiku-MatchHeader 18 : 19 ConfigView.cpp 20 ; -
src/add-ons/mail_daemon/outbound_filters/fortune/ConfigView.cpp
6 6 7 7 #include "ConfigView.h" 8 8 9 #include <Catalog.h> 9 10 #include <TextControl.h> 10 11 #include <String.h> 11 12 #include <Message.h> 12 13 13 14 #include <FileConfigView.h> 14 15 15 #include <MDRLanguage.h>16 16 17 #undef B_TRANSLATE_CONTEXT 18 #define B_TRANSLATE_CONTEXT "ConfigView" 17 19 20 18 21 ConfigView::ConfigView() 19 : BView(BRect(0,0,20,20),"fortune_filter",B_FOLLOW_LEFT | B_FOLLOW_TOP,0) 22 : BView(BRect(0,0,20,20),"fortune_filter", B_FOLLOW_LEFT | B_FOLLOW_TOP 23 , 0) 20 24 { 21 25 SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); 22 26 23 27 // determine font height 24 28 font_height fontHeight; 25 29 GetFontHeight(&fontHeight); 26 float itemHeight = (int32)(fontHeight.ascent + fontHeight.descent + fontHeight.leading) + 13; 30 float itemHeight = (int32)(fontHeight.ascent + fontHeight.descent 31 + fontHeight.leading) + 13; 27 32 28 33 BRect rect(5,4,250,25); 29 34 rect.bottom = rect.top - 2 + itemHeight; 30 BMailFileConfigView *fview = new BMailFileConfigView(MDR_DIALECT_CHOICE ("Fortune file:","予言ファイル:"),"fortune_file",false,"",B_FILE_NODE); 35 BMailFileConfigView *fview = new BMailFileConfigView(B_TRANSLATE( 36 "Fortune file:"), "fortune_file", false, "", B_FILE_NODE); 31 37 AddChild(fview); 32 38 33 39 rect.top = rect.bottom + 8; 34 40 rect.bottom = rect.top - 2 + itemHeight; 35 BTextControl * control = new BTextControl(rect,"tag_line",MDR_DIALECT_CHOICE ("Tag line:","見出し:"),NULL,NULL); 41 BTextControl * control = new BTextControl(rect, "tag_line", 42 B_TRANSLATE("Tag line:"), NULL, NULL); 36 43 control->SetDivider(control->StringWidth(control->Label()) + 6); 37 44 AddChild(control); 38 45 … … 42 49 43 50 void ConfigView::SetTo(const BMessage *archive) 44 51 { 45 if (BMailFileConfigView *control = (BMailFileConfigView *)FindView("fortune_file")) 46 control->SetTo(archive,NULL); 52 if (BMailFileConfigView *control = (BMailFileConfigView 53 *)FindView("fortune_file")) 54 control->SetTo(archive, NULL); 47 55 48 56 BString path = archive->FindString("tag_line"); 49 57 if (!archive->HasString("tag_line")) … … 57 65 58 66 status_t ConfigView::Archive(BMessage *into,bool) const 59 67 { 60 if (BMailFileConfigView *control = (BMailFileConfigView *)FindView("fortune_file")) 68 if (BMailFileConfigView *control = (BMailFileConfigView 69 *)FindView("fortune_file")) 61 70 { 62 71 control->Archive(into); 63 72 } … … 67 76 BString line = control->Text(); 68 77 if (line != B_EMPTY_STRING) 69 78 line << "\n\n"; 70 if (into->ReplaceString("tag_line", line.String()) != B_OK)71 into->AddString("tag_line", line.String());79 if (into->ReplaceString("tag_line", line.String()) != B_OK) 80 into->AddString("tag_line", line.String()); 72 81 } 73 82 return B_OK; 74 83 } -
src/add-ons/mail_daemon/outbound_filters/fortune/Jamfile
8 8 9 9 Addon Fortune : 10 10 ConfigView.cpp 11 filter.cpp ; 11 filter.cpp 12 : 13 be libmail.so $(HAIKU_LOCALE_LIBS) $(TARGET_LIBSUPC++) 14 ; 12 15 13 LinkAgainst Fortune : 14 be libmail.so $(TARGET_LIBSUPC++) ; 16 DoCatalogs Fortune : 17 x-vnd.Haiku-Fortune 18 : 19 ConfigView.cpp 20 ;