Close alerts with ESCAPE key.

Added SetFlags(B_CLOSE_ON_ESCAPE) or SetShortcut(index, B_ESCAPE) to BAlerts
depending if the result gets used later in the code, or if it's a one-button
BAlert.
This commit is contained in:
Humdinger
2012-08-05 19:32:46 +02:00
parent 4e7e3e331d
commit aed3510485
180 changed files with 761 additions and 351 deletions
@@ -195,8 +195,11 @@ LaunchCommandActuator::KeyEventAsync(const BMessage* keyMsg,
str << " Please check your Shortcuts settings."; str << " Please check your Shortcuts settings.";
} }
if (fArgc < 1 || err != B_NO_ERROR) if (fArgc < 1 || err != B_NO_ERROR) {
(new BAlert(str1.String(), str.String(), "OK"))->Go(NULL); BAlert* alert = new BAlert(str1.String(), str.String(), "OK");
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go(NULL);
}
} }
} }
@@ -1015,7 +1018,9 @@ MIMEHandlerCommandActuator::KeyEventAsync(const BMessage* keyMsg,
str << "Can't launch handler for "; str << "Can't launch handler for ";
str << ", no such MIME type exists. Please check your Shortcuts"; str << ", no such MIME type exists. Please check your Shortcuts";
str << " settings."; str << " settings.";
(new BAlert(str1.String(), str.String(), "OK"))->Go(NULL); BAlert* alert = new BAlert(str1.String(), str.String(), "OK");
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go(NULL);
} }
} }
} }
@@ -1693,7 +1698,9 @@ SendMessageCommandActuator::KeyEventAsync(const BMessage* keyMsg,
BString str1("Shortcuts SendMessage error"); BString str1("Shortcuts SendMessage error");
if (fSignature.Length() == 0) { if (fSignature.Length() == 0) {
str << "SendMessage: Target application signature not specified"; str << "SendMessage: Target application signature not specified";
(new BAlert(str1.String(), str.String(), "OK"))->Go(NULL); BAlert* alert = new BAlert(str1.String(), str.String(), "OK");
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go(NULL);
} else { } else {
status_t error = B_OK; status_t error = B_OK;
BMessenger msngr(fSignature.String(), -1, &error); BMessenger msngr(fSignature.String(), -1, &error);
@@ -178,6 +178,7 @@ CannaLooper::MessageReceived(BMessage* msg)
" Copyright 1992 NEC Corporation, Tokyo, Japan\n" " Copyright 1992 NEC Corporation, Tokyo, Japan\n"
" Special thanks to T.Murai for porting\n", " Special thanks to T.Murai for porting\n",
"OK"); "OK");
panel->SetFlags(panel->Flags() | B_CLOSE_ON_ESCAPE);
panel->Go(); panel->Go();
break; break;
} }
@@ -53,6 +53,7 @@ PenInputServerMethod::PenInputServerMethod()
//fDebugFile.SetTo("/tmp/PenInputMethodMessages.txt", B_READ_WRITE|B_CREATE_FILE); //fDebugFile.SetTo("/tmp/PenInputMethodMessages.txt", B_READ_WRITE|B_CREATE_FILE);
fDebugAlert = new BAlert("PenInput Debug", "Plip \n\n\n\n\n\n\n\n\n\n\n\n\n", "OK"); fDebugAlert = new BAlert("PenInput Debug", "Plip \n\n\n\n\n\n\n\n\n\n\n\n\n", "OK");
fDebugAlert->SetLook(B_TITLED_WINDOW_LOOK); fDebugAlert->SetLook(B_TITLED_WINDOW_LOOK);
fDebugAlert->SetFlags(fDebugAlert->Flags() | B_CLOSE_ON_ESCAPE);
fDebugAlert->TextView()->MakeSelectable(); fDebugAlert->TextView()->MakeSelectable();
fDebugAlert->TextView()->SelectAll(); fDebugAlert->TextView()->SelectAll();
fDebugAlert->TextView()->Delete(); fDebugAlert->TextView()->Delete();
@@ -178,6 +178,7 @@ void T9InputServerMethod::MessageReceived(BMessage *message)
s << " - "; s << " - ";
s << (long) fDeskbarMenu->ItemAt(v); s << (long) fDeskbarMenu->ItemAt(v);
BAlert *a = new BAlert("Plop", s.String(), "OK"); BAlert *a = new BAlert("Plop", s.String(), "OK");
a->SetFlags(a->Flags() | B_CLOSE_ON_ESCAPE);
a->Go(NULL); a->Go(NULL);
}*/ }*/
break; break;
@@ -179,6 +179,7 @@ void T9InputServerMethod::MessageReceived(BMessage *message)
s << " - "; s << " - ";
s << (long) fDeskbarMenu->ItemAt(v); s << (long) fDeskbarMenu->ItemAt(v);
BAlert *a = new BAlert("Plop", s.String(), "OK"); BAlert *a = new BAlert("Plop", s.String(), "OK");
a->SetFlags(a->Flags() | B_CLOSE_ON_ESCAPE);
a->Go(NULL); a->Go(NULL);
}*/ }*/
break; break;
@@ -79,6 +79,7 @@ NotifyFilter::MailboxSynced(status_t status)
BAlert *alert = new BAlert(B_TRANSLATE("New messages"), text.String(), BAlert *alert = new BAlert(B_TRANSLATE("New messages"), text.String(),
B_TRANSLATE("OK"), NULL, NULL, B_WIDTH_AS_USUAL); B_TRANSLATE("OK"), NULL, NULL, B_WIDTH_AS_USUAL);
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->SetFeel(B_NORMAL_WINDOW_FEEL); alert->SetFeel(B_NORMAL_WINDOW_FEEL);
alert->Go(NULL); alert->Go(NULL);
} }
@@ -421,9 +421,11 @@ AGMSBayesianSpamFilterConfig::ShowSpamServerConfigurationWindow () {
return; // Successful. return; // Successful.
ErrorExit: ErrorExit:
(new BAlert ("SpamFilterConfig Error", B_TRANSLATE("Sorry, unable to " BAlert* alert = new BAlert ("SpamFilterConfig Error", B_TRANSLATE("Sorry, "
"launch the spamdbm program to let you edit the server settings."), "unable to launch the spamdbm program to let you edit the server "
B_TRANSLATE("Close")))->Go (); "settings."), B_TRANSLATE("Close"));
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go ();
return; return;
} }
@@ -190,6 +190,7 @@ LIPS3Driver::NextBand(BBitmap* bitmap, BPoint* offset)
} else if (compressedSize > out_size) { } else if (compressedSize > out_size) {
BAlert* alert = new BAlert("memory overrun!!!", "warning", BAlert* alert = new BAlert("memory overrun!!!", "warning",
"OK"); "OK");
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go(); alert->Go();
return false; return false;
} else { } else {
@@ -224,6 +225,7 @@ LIPS3Driver::NextBand(BBitmap* bitmap, BPoint* offset)
} }
catch (TransportException& err) { catch (TransportException& err) {
BAlert* alert = new BAlert("", err.What(), "OK"); BAlert* alert = new BAlert("", err.What(), "OK");
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go(); alert->Go();
return false; return false;
} }
@@ -200,6 +200,7 @@ LIPS4Driver::NextBand(BBitmap* bitmap, BPoint* offset)
buffer = out_buffer; buffer = out_buffer;
} else if (compressed_size > out_size) { } else if (compressed_size > out_size) {
BAlert* alert = new BAlert("memory overrun!!!", "warning", "OK"); BAlert* alert = new BAlert("memory overrun!!!", "warning", "OK");
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go(); alert->Go();
return false; return false;
} else { } else {
@@ -234,6 +235,7 @@ LIPS4Driver::NextBand(BBitmap* bitmap, BPoint* offset)
} }
catch (TransportException& err) { catch (TransportException& err) {
BAlert* alert = new BAlert("", err.What(), "OK"); BAlert* alert = new BAlert("", err.What(), "OK");
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go(); alert->Go();
return false; return false;
} }
@@ -308,5 +308,6 @@ GPDriver::ShowError(const char* message)
text << "\n"; text << "\n";
text << message; text << message;
BAlert* alert = new BAlert("", text.String(), "OK"); BAlert* alert = new BAlert("", text.String(), "OK");
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go(); alert->Go();
} }
+1
View File
@@ -213,6 +213,7 @@ PCL5Driver::NextBand(BBitmap* bitmap, BPoint* offset)
} }
catch (TransportException& err) { catch (TransportException& err) {
BAlert* alert = new BAlert("", err.What(), "OK"); BAlert* alert = new BAlert("", err.What(), "OK");
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go(); alert->Go();
return false; return false;
} }
+1
View File
@@ -176,6 +176,7 @@ PCL6Driver::NextBand(BBitmap* bitmap, BPoint* offset)
} }
catch (TransportException& err) { catch (TransportException& err) {
BAlert* alert = new BAlert("", err.What(), "OK"); BAlert* alert = new BAlert("", err.What(), "OK");
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go(); alert->Go();
return false; return false;
} }
@@ -53,14 +53,18 @@ status_t MessagePrinter::Print(BMessage* msg)
// open a file to print message on the desktop // open a file to print message on the desktop
status = find_directory(B_DESKTOP_DIRECTORY, &settingsPath); status = find_directory(B_DESKTOP_DIRECTORY, &settingsPath);
if (status != B_OK) { if (status != B_OK) {
(new BAlert("","find directory error", "Doh!"))->Go(); BAlert* alert = new BAlert("","Find directory error", "Doh!");
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go();
return status; return status;
} }
settingsPath.Append(msgFileName); settingsPath.Append(msgFileName);
status = file.SetTo(settingsPath.Path(), B_WRITE_ONLY | B_CREATE_FILE); status = file.SetTo(settingsPath.Path(), B_WRITE_ONLY | B_CREATE_FILE);
if (status != B_OK) { if (status != B_OK) {
(new BAlert("","file write error", "Doh!"))->Go(); BAlert* alert = new BAlert("","File write error", "Doh!");
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go();
return status; return status;
} }
@@ -73,14 +77,18 @@ status_t MessagePrinter::Print(BMessage* msg)
// count // count
out << i; out << i;
if (file.Write(out.String(), out.Length()) < 0) { if (file.Write(out.String(), out.Length()) < 0) {
(new BAlert("","count write error", "Doh!"))->Go(); BAlert* alert = new BAlert("","Count write error", "Doh!");
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go();
return B_ERROR; return B_ERROR;
} }
// name // name
out = " "; out = " ";
out << name; out << name;
if (file.Write(out.String(), out.Length()) < 0) { if (file.Write(out.String(), out.Length()) < 0) {
(new BAlert("","name write error", "Doh!"))->Go(); BAlert* alert = new BAlert("","Name write error", "Doh!");
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go();
return B_ERROR; return B_ERROR;
} }
@@ -164,7 +172,9 @@ status_t MessagePrinter::Print(BMessage* msg)
break; break;
} }
if (file.Write(out.String(), out.Length()) < 0) { if (file.Write(out.String(), out.Length()) < 0) {
(new BAlert("","value write error", "Doh!"))->Go(); BAlert* alert = new BAlert("","Value write error", "Doh!");
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go();
return B_ERROR; return B_ERROR;
} }
} }
@@ -203,6 +203,7 @@ PrinterDriver::PrintPage(int32 pageNumber, int32 pageCount)
sprintf(text, "Faking print of page %ld/%ld...", pageNumber, pageCount); sprintf(text, "Faking print of page %ld/%ld...", pageNumber, pageCount);
BAlert *alert = new BAlert("PrinterDriver::PrintPage()", text, "Hmm?"); BAlert *alert = new BAlert("PrinterDriver::PrintPage()", text, "Hmm?");
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go(); alert->Go();
return B_OK; return B_OK;
} }
@@ -336,6 +336,7 @@ PSDriver::NextBand(BBitmap* bitmap, BPoint* offset)
} }
catch (TransportException& err) { catch (TransportException& err) {
BAlert* alert = new BAlert("", err.What(), "OK"); BAlert* alert = new BAlert("", err.What(), "OK");
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go(); alert->Go();
return false; return false;
} }
@@ -55,6 +55,7 @@ HPJetDirectPort::HPJetDirectPort(BDirectory* printer, BMessage *msg)
fEndpoint = new BNetEndpoint(SOCK_STREAM); fEndpoint = new BNetEndpoint(SOCK_STREAM);
if ((fReady = fEndpoint->InitCheck()) != B_OK) { if ((fReady = fEndpoint->InitCheck()) != B_OK) {
BAlert *alert = new BAlert("", "Fail to create the NetEndpoint!", "OK"); BAlert *alert = new BAlert("", "Fail to create the NetEndpoint!", "OK");
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go(); alert->Go();
return; return;
} }
@@ -66,6 +67,7 @@ HPJetDirectPort::HPJetDirectPort(BDirectory* printer, BMessage *msg)
} else { } else {
BAlert *alert = new BAlert("", BAlert *alert = new BAlert("",
"Can't connect to HP JetDirect printer port!", "OK"); "Can't connect to HP JetDirect printer port!", "OK");
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go(); alert->Go();
fReady = B_ERROR; fReady = B_ERROR;
} }
@@ -135,8 +135,9 @@ SetupView::CheckSetup()
if (ep->Connect(fServerAddress->Text(), port) != B_OK) { if (ep->Connect(fServerAddress->Text(), port) != B_OK) {
BString text; BString text;
text << "Fail to connect to " << fServerAddress->Text() << ":" << (int) port << "!"; text << "Failed to connect to " << fServerAddress->Text() << ":" << (int) port << "!";
BAlert* alert = new BAlert("", text.String(), "OK"); BAlert* alert = new BAlert("", text.String(), "OK");
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go(); alert->Go();
return false; return false;
}; };
@@ -149,7 +150,8 @@ SetupView::CheckSetup()
}; };
}; };
BAlert* alert = new BAlert("", "please input parameters.", "OK"); BAlert* alert = new BAlert("", "Please input parameters.", "OK");
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go(); alert->Go();
return false; return false;
} }
@@ -141,6 +141,7 @@ bool IppSetupView::UpdateViewData()
} }
BAlert *alert = new BAlert("", error_msg.c_str(), "OK"); BAlert *alert = new BAlert("", error_msg.c_str(), "OK");
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go(); alert->Go();
return false; return false;
} }
@@ -129,6 +129,7 @@ IppTransport::~IppTransport()
if (__error) { if (__error) {
BAlert *alert = new BAlert("", error_msg.c_str(), "OK"); BAlert *alert = new BAlert("", error_msg.c_str(), "OK");
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go(); alert->Go();
} }
} }
@@ -142,6 +142,7 @@ LprSetupView::UpdateViewData()
catch (LPSException &err) { catch (LPSException &err) {
BAlert *alert = new BAlert("", err.what(), "OK"); BAlert *alert = new BAlert("", err.what(), "OK");
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go(); alert->Go();
return false; return false;
} }
@@ -155,6 +156,7 @@ LprSetupView::UpdateViewData()
BAlert *alert = new BAlert("", "Please enter server address and printer" BAlert *alert = new BAlert("", "Please enter server address and printer"
"queue name.", "OK"); "queue name.", "OK");
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go(); alert->Go();
return false; return false;
} }
@@ -129,6 +129,7 @@ LprTransport::_SendFile()
catch (LPSException &err) { catch (LPSException &err) {
DBGMSG(("error: %s\n", err.what())); DBGMSG(("error: %s\n", err.what()));
BAlert *alert = new BAlert("", err.what(), "OK"); BAlert *alert = new BAlert("", err.what(), "OK");
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go(); alert->Go();
} }
} }
+5 -1
View File
@@ -18,6 +18,7 @@ static void Error(BView *view, status_t status, bool unlock=false)
view->UnlockLooper(); view->UnlockLooper();
BString s(strerror(status)); BString s(strerror(status));
alert = new BAlert("Error", s.String(), "OK"); alert = new BAlert("Error", s.String(), "OK");
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go(); alert->Go();
} }
@@ -80,7 +81,9 @@ process_refs(entry_ref dir, BMessage* refs, void* /*reserved*/)
alert = new BAlert("Error", "IconVader:\nClick on the icons to get points.\nAvoid symlinks!", "OK"); alert = new BAlert("Error", "IconVader:\nClick on the icons to get points."
"\nAvoid symlinks!", "OK");
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go(); alert->Go();
@@ -133,6 +136,7 @@ process_refs(entry_ref dir, BMessage* refs, void* /*reserved*/)
BString scoreStr("You scored "); BString scoreStr("You scored ");
scoreStr << score << " points!"; scoreStr << score << " points!";
alert = new BAlert("Error", scoreStr.String(), "Cool!"); alert = new BAlert("Error", scoreStr.String(), "Cool!");
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go(); alert->Go();
@@ -38,9 +38,11 @@ process_refs(entry_ref directoryRef, BMessage *msg, void *)
if (link.MakeLinkedPath(&directory, &path) < B_OK if (link.MakeLinkedPath(&directory, &path) < B_OK
|| targetEntry.SetTo(path.Path()) != B_OK || targetEntry.SetTo(path.Path()) != B_OK
|| targetEntry.GetParent(&targetEntry) != B_OK) { || targetEntry.GetParent(&targetEntry) != B_OK) {
(new BAlert("Open Target Folder", BAlert* alert = new BAlert("Open Target Folder",
"Cannot open target folder. Maybe this link is broken?", "Cannot open target folder. Maybe this link is broken?",
"OK", NULL, NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go(NULL); "OK", NULL, NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go(NULL);
continue; continue;
} }
@@ -59,10 +61,12 @@ process_refs(entry_ref directoryRef, BMessage *msg, void *)
} }
if (errors) { if (errors) {
(new BAlert("Open Target Folder", BAlert* alert = new BAlert("Open Target Folder",
"This add-on can only be used on symbolic links.\n" "This add-on can only be used on symbolic links.\n"
"It opens the folder of the link target in Tracker.", "It opens the folder of the link target in Tracker.",
"OK"))->Go(NULL); "OK");
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go(NULL);
} }
} }
+1
View File
@@ -51,6 +51,7 @@ main()
BAlert * err = new BAlert("Error", BAlert * err = new BAlert("Error",
B_TRANSLATE("Something is wrong with the PPMTranslator!"), B_TRANSLATE("Something is wrong with the PPMTranslator!"),
B_TRANSLATE("OK")); B_TRANSLATE("OK"));
err->SetFlags(err->Flags() | B_CLOSE_ON_ESCAPE);
err->Go(); err->Go();
return 1; return 1;
} }
@@ -88,6 +88,7 @@ LaunchTranslatorWindow(BTranslator *translator, const char *title, BRect rect)
if (translator->MakeConfigurationView(NULL, &view, &rect)) { if (translator->MakeConfigurationView(NULL, &view, &rect)) {
BAlert *err = new BAlert(B_TRANSLATE("Error"), BAlert *err = new BAlert(B_TRANSLATE("Error"),
B_TRANSLATE("Unable to create the view."), B_TRANSLATE("OK")); B_TRANSLATE("Unable to create the view."), B_TRANSLATE("OK"));
err->SetFlags(err->Flags() | B_CLOSE_ON_ESCAPE);
err->Go(); err->Go();
return B_ERROR; return B_ERROR;
} }
+1
View File
@@ -70,6 +70,7 @@ void AutoRaiseApp::ReadyToRun()
BAlert *alert = new BAlert("usage box", APP_NAME ", (c) 2002, mmu_man\nUsage: " APP_NAME " [options]\n\t--deskbar\twill not open window, will just put " APP_NAME " into tray\n\t--persist will put "APP_NAME" into tray such that it remains between bootings\n", "OK", NULL, NULL, BAlert *alert = new BAlert("usage box", APP_NAME ", (c) 2002, mmu_man\nUsage: " APP_NAME " [options]\n\t--deskbar\twill not open window, will just put " APP_NAME " into tray\n\t--persist will put "APP_NAME" into tray such that it remains between bootings\n", "OK", NULL, NULL,
B_WIDTH_AS_USUAL, B_OFFSET_SPACING, B_INFO_ALERT); B_WIDTH_AS_USUAL, B_OFFSET_SPACING, B_INFO_ALERT);
alert->SetShortcut(0, B_ENTER); alert->SetShortcut(0, B_ENTER);
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go(); alert->Go();
be_app_messenger.SendMessage(B_QUIT_REQUESTED); be_app_messenger.SendMessage(B_QUIT_REQUESTED);
} }
+1
View File
@@ -542,6 +542,7 @@ void TrayView::MessageReceived(BMessage* message)
alert = new BAlert("about box", "AutoRaise, (c) 2002, mmu_man\nEnjoy :-)", "OK", NULL, NULL, alert = new BAlert("about box", "AutoRaise, (c) 2002, mmu_man\nEnjoy :-)", "OK", NULL, NULL,
B_WIDTH_AS_USUAL, B_OFFSET_SPACING, B_INFO_ALERT); B_WIDTH_AS_USUAL, B_OFFSET_SPACING, B_INFO_ALERT);
alert->SetShortcut(0, B_ENTER); alert->SetShortcut(0, B_ENTER);
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go(NULL); // use asynchronous version alert->Go(NULL); // use asynchronous version
break; break;
case OPEN_SETTINGS: case OPEN_SETTINGS:
@@ -177,6 +177,7 @@ BootManagerController::_HasSelectedPartitions()
BAlert* alert = new BAlert("info", BAlert* alert = new BAlert("info",
B_TRANSLATE("At least one partition must be selected!"), B_TRANSLATE("At least one partition must be selected!"),
B_TRANSLATE_COMMENT("OK", "Button")); B_TRANSLATE_COMMENT("OK", "Button"));
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go(); alert->Go();
return false; return false;
+1 -1
View File
@@ -214,7 +214,7 @@ void SnowView::MessageReceived(BMessage *msg)
"Where is Santa ??"); "Where is Santa ??");
info->SetFeel(B_NORMAL_WINDOW_FEEL); info->SetFeel(B_NORMAL_WINDOW_FEEL);
info->SetLook(B_FLOATING_WINDOW_LOOK); info->SetLook(B_FLOATING_WINDOW_LOOK);
info->SetFlags(info->Flags()|B_NOT_ZOOMABLE); info->SetFlags(info->Flags()|B_NOT_ZOOMABLE|B_CLOSE_ON_ESCAPE);
info->Go(NULL); info->Go(NULL);
break; break;
default: default:
+1
View File
@@ -1121,6 +1121,7 @@ CDDBQuery::_ParseData(const BString &data)
// TODO: finish, once I find an entry which actually has a year in it // TODO: finish, once I find an entry which actually has a year in it
BAlert *alert = new BAlert("SimplyVorbis", "DYEAR entry found\n", "OK"); BAlert *alert = new BAlert("SimplyVorbis", "DYEAR entry found\n", "OK");
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go(); alert->Go();
} }
+1
View File
@@ -88,6 +88,7 @@ CDPlayer::CDPlayer(BRect frame, const char *name, uint32 resizeMask,
"It appears that there are no CD" "It appears that there are no CD"
" drives on your computer or there is no system software to " " drives on your computer or there is no system software to "
"support one. Sorry."), B_TRANSLATE("OK")); "support one. Sorry."), B_TRANSLATE("OK"));
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go(); alert->Go();
} }
+1 -1
View File
@@ -361,7 +361,7 @@ TOnscreenView::MessageReceived(BMessage *msg)
"Clock (The Replicant version)\n\n(C)2002, 2003 OpenBeOS,\n" "Clock (The Replicant version)\n\n(C)2002, 2003 OpenBeOS,\n"
"2004 - 2007, Haiku, Inc.\n\nOriginally coded by the folks " "2004 - 2007, Haiku, Inc.\n\nOriginally coded by the folks "
"at Be.\n Copyright Be Inc., 1991 - 1998", "OK"); "at Be.\n Copyright Be Inc., 1991 - 1998", "OK");
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go(); alert->Go();
} break; } break;
+1
View File
@@ -62,6 +62,7 @@ ErrorAlert(const char* message, status_t err, BWindow *window = NULL)
B_TRANSLATE("OK")); B_TRANSLATE("OK"));
if (window != NULL) if (window != NULL)
alert->CenterIn(window->Frame()); alert->CenterIn(window->Frame());
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go(); alert->Go();
printf("%s\n%s [%lx]", message, strerror(err), err); printf("%s\n%s [%lx]", message, strerror(err), err);
+5 -3
View File
@@ -170,11 +170,13 @@ main(int argc, char** argv)
{ {
App app; App app;
if (argc < 2 || strcmp(argv[1], "--addon-host") != 0) { if (argc < 2 || strcmp(argv[1], "--addon-host") != 0) {
int32 response = (new BAlert( BAlert* alert = new BAlert("Cortex AddOnHost",
"Cortex AddOnHost",
"This program runs in the background, and is started automatically " "This program runs in the background, and is started automatically "
"by Cortex when necessary. You probably don't want to start it manually.", "by Cortex when necessary. You probably don't want to start it manually.",
"Continue", "Quit"))->Go(); "Continue", "Quit");
alert->SetShortcut(1, B_ESCAPE);
int32 response = alert->Go();
if(response == 1) if(response == 1)
return 0; return 0;
} }
@@ -988,6 +988,7 @@ void MediaRoutingView::showErrorMessage(
|| (messenger.SendMessage(&message) != B_OK)) { || (messenger.SendMessage(&message) != B_OK)) {
BAlert *alert = new BAlert("Error", text.String(), "OK", 0, 0, BAlert *alert = new BAlert("Error", text.String(), "OK", 0, 0,
B_WIDTH_AS_USUAL, B_WARNING_ALERT); B_WIDTH_AS_USUAL, B_WARNING_ALERT);
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go(); alert->Go();
} }
} }
@@ -162,6 +162,7 @@ void ParameterWindow::MessageReceived(
s << " (" << strerror(error) << ")"; s << " (" << strerror(error) << ")";
BAlert *alert = new BAlert("", s.String(), "OK", 0, 0, BAlert *alert = new BAlert("", s.String(), "OK", 0, 0,
B_WIDTH_AS_USUAL, B_WARNING_ALERT); B_WIDTH_AS_USUAL, B_WARNING_ALERT);
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go(0); alert->Go(0);
} }
bool replace = false; bool replace = false;
+5 -2
View File
@@ -372,9 +372,12 @@ RouteWindow::MessageReceived(BMessage* pMsg)
// //
switch (pMsg->what) { switch (pMsg->what) {
case B_ABOUT_REQUESTED: case B_ABOUT_REQUESTED:
(new BAlert("About", g_aboutText, "OK"))->Go(); {
BAlert* alert = new BAlert("About", g_aboutText, "OK");
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go();
break; break;
}
case MediaRoutingView::M_GROUP_SELECTED: case MediaRoutingView::M_GROUP_SELECTED:
_handleGroupSelected(pMsg); _handleGroupSelected(pMsg);
break; break;
@@ -84,7 +84,9 @@ MediaNodeControlApp::MediaNodeControlApp(
sprintf(buffer, sprintf(buffer,
"MediaNodeControlApp: couldn't find node (%ld):\n%s\n", "MediaNodeControlApp: couldn't find node (%ld):\n%s\n",
nodeID, strerror(err)); nodeID, strerror(err));
(new BAlert("error", buffer, "OK"))->Go(); BAlert* alert = new BAlert("error", buffer, "OK");
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go();
return; return;
} }
@@ -96,7 +98,9 @@ MediaNodeControlApp::MediaNodeControlApp(
sprintf(buffer, sprintf(buffer,
"MediaNodeControlApp: couldn't get node info (%ld):\n%s\n", "MediaNodeControlApp: couldn't get node info (%ld):\n%s\n",
nodeID, strerror(err)); nodeID, strerror(err));
(new BAlert("error", buffer, "OK"))->Go(); BAlert* alert = new BAlert("error", buffer, "OK");
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go();
return; return;
} }
@@ -111,7 +115,9 @@ MediaNodeControlApp::MediaNodeControlApp(
sprintf(buffer, sprintf(buffer,
"MediaNodeControlApp: no parameters for node (%ld):\n%s\n", "MediaNodeControlApp: no parameters for node (%ld):\n%s\n",
nodeID, strerror(err)); nodeID, strerror(err));
(new BAlert("error", buffer, "OK"))->Go(); BAlert* alert = new BAlert("error", buffer, "OK");
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go();
return; return;
} }
+6 -2
View File
@@ -278,14 +278,18 @@ AttributeWindow::MessageReceived(BMessage *message)
case kMsgRemoveAttribute: case kMsgRemoveAttribute:
{ {
char buffer[1024]; char buffer[1024];
snprintf(buffer, sizeof(buffer), snprintf(buffer, sizeof(buffer),
B_TRANSLATE("Do you really want to remove the attribute \"%s\" from " B_TRANSLATE("Do you really want to remove the attribute \"%s\" from "
"the file \"%s\"?\n\nYou cannot undo this action."), "the file \"%s\"?\n\nYou cannot undo this action."),
fAttribute, Ref().name); fAttribute, Ref().name);
int32 chosen = (new BAlert(B_TRANSLATE("DiskProbe request"), BAlert* alert = new BAlert(B_TRANSLATE("DiskProbe request"),
buffer, B_TRANSLATE("Cancel"), B_TRANSLATE("Remove"), NULL, buffer, B_TRANSLATE("Cancel"), B_TRANSLATE("Remove"), NULL,
B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go(); B_WIDTH_AS_USUAL, B_WARNING_ALERT);
alert->SetShortcut(0, B_ESCAPE);
int32 chosen = alert->Go();
if (chosen == 1) { if (chosen == 1) {
BNode node(&Ref()); BNode node(&Ref());
if (node.InitCheck() == B_OK) if (node.InitCheck() == B_OK)
+4 -2
View File
@@ -367,9 +367,11 @@ DiskProbe::RefsReceived(BMessage *message)
"error message is shown."), "error message is shown."),
ref.name, strerror(status)); ref.name, strerror(status));
(new BAlert(B_TRANSLATE("DiskProbe request"), BAlert* alert = new BAlert(B_TRANSLATE("DiskProbe request"),
buffer, B_TRANSLATE("OK"), NULL, NULL, buffer, B_TRANSLATE("OK"), NULL, NULL,
B_WIDTH_AS_USUAL, B_STOP_ALERT))->Go(); B_WIDTH_AS_USUAL, B_STOP_ALERT);
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go();
} }
} }
} }
+14 -7
View File
@@ -1105,10 +1105,12 @@ EditorLooper::Find(off_t startAt, const uint8 *data, size_t dataSize,
if (system_time() > startTime + 8000000LL) { if (system_time() > startTime + 8000000LL) {
// If the user had to wait more than 8 seconds for the result, // If the user had to wait more than 8 seconds for the result,
// we are trying to please him with a requester... // we are trying to please him with a requester...
(new BAlert(B_TRANSLATE("DiskProbe request"), BAlert* alert = new BAlert(B_TRANSLATE("DiskProbe request"),
B_TRANSLATE("Could not find search string."), B_TRANSLATE("Could not find search string."),
B_TRANSLATE("OK"), NULL, NULL, B_WIDTH_AS_USUAL, B_TRANSLATE("OK"), NULL, NULL, B_WIDTH_AS_USUAL,
B_WARNING_ALERT))->Go(NULL); B_WARNING_ALERT);
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go(NULL);
} else } else
beep(); beep();
} }
@@ -1867,9 +1869,11 @@ ProbeView::_Save()
"All changes will be lost when you quit."), "All changes will be lost when you quit."),
strerror(status)); strerror(status));
(new BAlert(B_TRANSLATE("DiskProbe request"), BAlert* alert = new BAlert(B_TRANSLATE("DiskProbe request"),
buffer, B_TRANSLATE("OK"), NULL, NULL, buffer, B_TRANSLATE("OK"), NULL, NULL,
B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go(NULL); B_WIDTH_AS_USUAL, B_WARNING_ALERT);
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go(NULL);
return status; return status;
} }
@@ -1883,9 +1887,12 @@ ProbeView::QuitRequested()
if (!fEditor.IsModified()) if (!fEditor.IsModified())
return true; return true;
int32 chosen = (new BAlert(B_TRANSLATE("DiskProbe request"), BAlert* alert = new BAlert(B_TRANSLATE("DiskProbe request"),
B_TRANSLATE("Save changes before closing?"), B_TRANSLATE("Don't save"), B_TRANSLATE("Cancel"), B_TRANSLATE("Save changes before closing?"), B_TRANSLATE("Don't save"),
B_TRANSLATE("Save"), B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go(); B_TRANSLATE("Cancel"), B_TRANSLATE("Save"), B_WIDTH_AS_USUAL,
B_WARNING_ALERT);
alert->SetShortcut(1, B_ESCAPE);
int32 chosen = alert->Go();
if (chosen == 0) if (chosen == 0)
return true; return true;
+5
View File
@@ -657,6 +657,7 @@ MainWindow::_DisplayPartitionError(BString _message,
BAlert* alert = new BAlert("error", message, B_TRANSLATE("OK"), NULL, NULL, BAlert* alert = new BAlert("error", message, B_TRANSLATE("OK"), NULL, NULL,
B_WIDTH_FROM_WIDEST, error < B_OK ? B_STOP_ALERT : B_INFO_ALERT); B_WIDTH_FROM_WIDEST, error < B_OK ? B_STOP_ALERT : B_INFO_ALERT);
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go(NULL); alert->Go(NULL);
} }
@@ -853,6 +854,7 @@ MainWindow::_Initialize(BDiskDevice* disk, partition_id selectedPartition,
BAlert* alert = new BAlert("first notice", message, BAlert* alert = new BAlert("first notice", message,
B_TRANSLATE("Continue"), B_TRANSLATE("Cancel"), NULL, B_TRANSLATE("Continue"), B_TRANSLATE("Cancel"), NULL,
B_WIDTH_FROM_WIDEST, B_WARNING_ALERT); B_WIDTH_FROM_WIDEST, B_WARNING_ALERT);
alert->SetShortcut(1, B_ESCAPE);
int32 choice = alert->Go(); int32 choice = alert->Go();
if (choice == 1) if (choice == 1)
@@ -933,6 +935,7 @@ MainWindow::_Initialize(BDiskDevice* disk, partition_id selectedPartition,
alert = new BAlert("final notice", message, alert = new BAlert("final notice", message,
B_TRANSLATE("Write changes"), B_TRANSLATE("Cancel"), NULL, B_TRANSLATE("Write changes"), B_TRANSLATE("Cancel"), NULL,
B_WIDTH_FROM_WIDEST, B_WARNING_ALERT); B_WIDTH_FROM_WIDEST, B_WARNING_ALERT);
alert->SetShortcut(1, B_ESCAPE);
choice = alert->Go(); choice = alert->Go();
if (choice == 1) if (choice == 1)
@@ -1050,6 +1053,7 @@ MainWindow::_Create(BDiskDevice* disk, partition_id selectedPartition)
"All data on the partition will be irretrievably lost if you do " "All data on the partition will be irretrievably lost if you do "
"so!"), B_TRANSLATE("Write changes"), B_TRANSLATE("Cancel"), NULL, "so!"), B_TRANSLATE("Write changes"), B_TRANSLATE("Cancel"), NULL,
B_WIDTH_FROM_WIDEST, B_WARNING_ALERT); B_WIDTH_FROM_WIDEST, B_WARNING_ALERT);
alert->SetShortcut(1, B_ESCAPE);
int32 choice = alert->Go(); int32 choice = alert->Go();
if (choice == 1) if (choice == 1)
@@ -1130,6 +1134,7 @@ MainWindow::_Delete(BDiskDevice* disk, partition_id selectedPartition)
"All data on the partition will be irretrievably lost if you " "All data on the partition will be irretrievably lost if you "
"do so!"), B_TRANSLATE("Delete partition"), B_TRANSLATE("Cancel"), NULL, "do so!"), B_TRANSLATE("Delete partition"), B_TRANSLATE("Cancel"), NULL,
B_WIDTH_FROM_WIDEST, B_WARNING_ALERT); B_WIDTH_FROM_WIDEST, B_WARNING_ALERT);
alert->SetShortcut(1, B_ESCAPE);
int32 choice = alert->Go(); int32 choice = alert->Go();
if (choice == 1) if (choice == 1)
+15 -4
View File
@@ -153,19 +153,24 @@ ExpanderWindow::ValidateDest()
B_TRANSLATE("The destination folder does not exist."), B_TRANSLATE("The destination folder does not exist."),
B_TRANSLATE("Cancel"), NULL, NULL, B_TRANSLATE("Cancel"), NULL, NULL,
B_WIDTH_AS_USUAL, B_EVEN_SPACING, B_WARNING_ALERT); B_WIDTH_AS_USUAL, B_EVEN_SPACING, B_WARNING_ALERT);
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go(); alert->Go();
return false; return false;
} else if (!entry.IsDirectory()) { } else if (!entry.IsDirectory()) {
(new BAlert("destAlert", BAlert* alert = new BAlert("destAlert",
B_TRANSLATE("The destination is not a folder."), B_TRANSLATE("The destination is not a folder."),
B_TRANSLATE("Cancel"), NULL, NULL, B_TRANSLATE("Cancel"), NULL, NULL,
B_WIDTH_AS_USUAL, B_EVEN_SPACING, B_WARNING_ALERT))->Go(); B_WIDTH_AS_USUAL, B_EVEN_SPACING, B_WARNING_ALERT);
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go();
return false; return false;
} else if (entry.GetVolume(&volume) != B_OK || volume.IsReadOnly()) { } else if (entry.GetVolume(&volume) != B_OK || volume.IsReadOnly()) {
(new BAlert("destAlert", BAlert* alert = new BAlert("destAlert",
B_TRANSLATE("The destination is read only."), B_TRANSLATE("The destination is read only."),
B_TRANSLATE("Cancel"), NULL, NULL, B_WIDTH_AS_USUAL, B_TRANSLATE("Cancel"), NULL, NULL, B_WIDTH_AS_USUAL,
B_EVEN_SPACING, B_WARNING_ALERT))->Go(); B_EVEN_SPACING, B_WARNING_ALERT);
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go();
return false; return false;
} else { } else {
entry.GetRef(&fDestRef); entry.GetRef(&fDestRef);
@@ -246,6 +251,7 @@ ExpanderWindow::MessageReceived(BMessage* msg)
"archive? The expanded items may not be complete."), "archive? The expanded items may not be complete."),
B_TRANSLATE("Stop"), B_TRANSLATE("Continue"), NULL, B_TRANSLATE("Stop"), B_TRANSLATE("Continue"), NULL,
B_WIDTH_AS_USUAL, B_EVEN_SPACING, B_WARNING_ALERT); B_WIDTH_AS_USUAL, B_EVEN_SPACING, B_WARNING_ALERT);
alert->SetShortcut(0, B_ESCAPE);
if (alert->Go() == 0) { if (alert->Go() == 0) {
fExpandingThread->ResumeExternalExpander(); fExpandingThread->ResumeExternalExpander();
StopExpanding(); StopExpanding();
@@ -280,6 +286,7 @@ ExpanderWindow::MessageReceived(BMessage* msg)
B_TRANSLATE("The file doesn't exist"), B_TRANSLATE("The file doesn't exist"),
B_TRANSLATE("Cancel"), NULL, NULL, B_TRANSLATE("Cancel"), NULL, NULL,
B_WIDTH_AS_USUAL, B_EVEN_SPACING, B_WARNING_ALERT); B_WIDTH_AS_USUAL, B_EVEN_SPACING, B_WARNING_ALERT);
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go(); alert->Go();
break; break;
} }
@@ -303,6 +310,7 @@ ExpanderWindow::MessageReceived(BMessage* msg)
BAlert* alert = new BAlert("srcAlert", string.String(), BAlert* alert = new BAlert("srcAlert", string.String(),
B_TRANSLATE("Cancel"), B_TRANSLATE("Cancel"),
NULL, NULL, B_WIDTH_AS_USUAL, B_EVEN_SPACING, B_INFO_ALERT); NULL, NULL, B_WIDTH_AS_USUAL, B_EVEN_SPACING, B_INFO_ALERT);
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go(); alert->Go();
fShowContents->SetEnabled(false); fShowContents->SetEnabled(false);
@@ -369,6 +377,7 @@ ExpanderWindow::MessageReceived(BMessage* msg)
BAlert* alert = new BAlert("stopAlert", string, BAlert* alert = new BAlert("stopAlert", string,
B_TRANSLATE("Stop"), B_TRANSLATE("Continue"), NULL, B_TRANSLATE("Stop"), B_TRANSLATE("Continue"), NULL,
B_WIDTH_AS_USUAL, B_EVEN_SPACING, B_WARNING_ALERT); B_WIDTH_AS_USUAL, B_EVEN_SPACING, B_WARNING_ALERT);
alert->SetShortcut(0, B_ESCAPE);
if (alert->Go() == 0) { if (alert->Go() == 0) {
fExpandingThread->ResumeExternalExpander(); fExpandingThread->ResumeExternalExpander();
StopExpanding(); StopExpanding();
@@ -422,6 +431,7 @@ ExpanderWindow::CanQuit()
"archive? The expanded items may not be complete."), "archive? The expanded items may not be complete."),
B_TRANSLATE("Stop"), B_TRANSLATE("Continue"), NULL, B_TRANSLATE("Stop"), B_TRANSLATE("Continue"), NULL,
B_WIDTH_AS_USUAL, B_EVEN_SPACING, B_WARNING_ALERT); B_WIDTH_AS_USUAL, B_EVEN_SPACING, B_WARNING_ALERT);
alert->SetShortcut(0, B_ESCAPE);
if (alert->Go() == 0) { if (alert->Go() == 0) {
fExpandingThread->ResumeExternalExpander(); fExpandingThread->ResumeExternalExpander();
StopExpanding(); StopExpanding();
@@ -558,6 +568,7 @@ ExpanderWindow::StartExpanding()
B_TRANSLATE("The folder was either moved, renamed or not\nsupported."), B_TRANSLATE("The folder was either moved, renamed or not\nsupported."),
B_TRANSLATE("Cancel"), NULL, NULL, B_TRANSLATE("Cancel"), NULL, NULL,
B_WIDTH_AS_USUAL, B_EVEN_SPACING, B_WARNING_ALERT); B_WIDTH_AS_USUAL, B_EVEN_SPACING, B_WARNING_ALERT);
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go(); alert->Go();
return; return;
} }
+2
View File
@@ -177,6 +177,7 @@ ObjectView::ObjectView(BRect rect, const char *name, ulong resizingMode,
BAlert *NoResourceAlert = new BAlert(B_TRANSLATE("Error"), BAlert *NoResourceAlert = new BAlert(B_TRANSLATE("Error"),
kNoResourceError, B_TRANSLATE("OK"), NULL, NULL, kNoResourceError, B_TRANSLATE("OK"), NULL, NULL,
B_WIDTH_AS_USUAL, B_OFFSET_SPACING, B_STOP_ALERT); B_WIDTH_AS_USUAL, B_OFFSET_SPACING, B_STOP_ALERT);
NoResourceAlert->SetFlags(NoResourceAlert->Flags() | B_CLOSE_ON_ESCAPE);
NoResourceAlert->Go(); NoResourceAlert->Go();
delete Tri; delete Tri;
} }
@@ -323,6 +324,7 @@ ObjectView::MessageReceived(BMessage* msg)
BAlert *NoResourceAlert = new BAlert(B_TRANSLATE("Error"), BAlert *NoResourceAlert = new BAlert(B_TRANSLATE("Error"),
kNoResourceError, B_TRANSLATE("OK"), NULL, NULL, kNoResourceError, B_TRANSLATE("OK"), NULL, NULL,
B_WIDTH_AS_USUAL, B_OFFSET_SPACING, B_STOP_ALERT); B_WIDTH_AS_USUAL, B_OFFSET_SPACING, B_STOP_ALERT);
NoResourceAlert->SetFlags(NoResourceAlert->Flags() | B_CLOSE_ON_ESCAPE);
NoResourceAlert->Go(); NoResourceAlert->Go();
delete Tri; delete Tri;
} }
+4 -1
View File
@@ -718,6 +718,7 @@ MainWindow::Open(const entry_ref& ref, bool append)
"Cancel button - error alert"), "Cancel button - error alert"),
NULL, NULL); NULL, NULL);
// launch alert asynchronously // launch alert asynchronously
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go(NULL); alert->Go(NULL);
delete icon; delete icon;
@@ -796,6 +797,7 @@ MainWindow::Open(const BMessenger& externalObserver, const uint8* data,
"Cancel button - error alert"), "Cancel button - error alert"),
NULL, NULL); NULL, NULL);
// launch alert asynchronously // launch alert asynchronously
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go(NULL); alert->Go(NULL);
delete icon; delete icon;
@@ -1273,7 +1275,8 @@ MainWindow::_CheckSaveIcon(const BMessage* currentMessage)
BAlert* alert = new BAlert("save", BAlert* alert = new BAlert("save",
B_TRANSLATE("Save changes to current icon?"), B_TRANSLATE("Discard"), B_TRANSLATE("Save changes to current icon?"), B_TRANSLATE("Discard"),
B_TRANSLATE("Cancel"), B_TRANSLATE("Save")); B_TRANSLATE("Cancel"), B_TRANSLATE("Save"));
alert->SetShortcut(0, B_ESCAPE);
int32 choice = alert->Go(); int32 choice = alert->Go();
switch (choice) { switch (choice) {
case 0: case 0:
+1
View File
@@ -365,6 +365,7 @@ SavePanel::_ExportSettings()
// status_t err = roster->MakeConfigurationView(item->id, NULL, &view, &rect); // status_t err = roster->MakeConfigurationView(item->id, NULL, &view, &rect);
// if (err < B_OK || view == NULL) { // if (err < B_OK || view == NULL) {
// BAlert *alert = new BAlert(NULL, strerror(err), "OK"); // BAlert *alert = new BAlert(NULL, strerror(err), "OK");
// alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
// alert->Go(); // alert->Go();
// } else { // } else {
// if (fConfigWindow != NULL) { // if (fConfigWindow != NULL) {
@@ -116,6 +116,7 @@ Exporter::_ExportThread()
"Exporter - Continue in error dialog"), "Exporter - Continue in error dialog"),
NULL, NULL); NULL, NULL);
// launch alert asynchronously // launch alert asynchronously
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go(NULL); alert->Go(NULL);
} else { } else {
// success // success
@@ -164,6 +164,7 @@ SVGExporter::_DisplayWarning() const
"be lost."), "be lost."),
B_TRANSLATE("Cancel"), B_TRANSLATE("Cancel"),
B_TRANSLATE("Overwrite")); B_TRANSLATE("Overwrite"));
alert->SetShortcut(0, B_ESCAPE);
return alert->Go() == 1; return alert->Go() == 1;
} }
@@ -80,6 +80,7 @@ SVGImporter::Import(Icon* icon, const entry_ref* ref)
BAlert* alert = new BAlert(B_TRANSLATE("load error"), BAlert* alert = new BAlert(B_TRANSLATE("load error"),
error, B_TRANSLATE("OK"), NULL, NULL, error, B_TRANSLATE("OK"), NULL, NULL,
B_WIDTH_AS_USUAL, B_WARNING_ALERT); B_WIDTH_AS_USUAL, B_WARNING_ALERT);
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go(NULL); alert->Go(NULL);
ret = B_ERROR; ret = B_ERROR;
} }
+1 -1
View File
@@ -257,7 +257,7 @@ UninstallView::MessageReceived(BMessage* msg)
"been corrupted."), B_TRANSLATE("OK"), NULL, "been corrupted."), B_TRANSLATE("OK"), NULL,
NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT); NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
} }
notify->SetFlags(notify->Flags() | B_CLOSE_ON_ESCAPE);
notify->Go(); notify->Go();
} }
default: default:
+1
View File
@@ -82,6 +82,7 @@ InstallerApp::AboutRequested()
BAlert *alert = new BAlert("about", B_TRANSLATE("Installer\n" BAlert *alert = new BAlert("about", B_TRANSLATE("Installer\n"
"\twritten by Jérôme Duval and Stephan Aßmus\n" "\twritten by Jérôme Duval and Stephan Aßmus\n"
"\tCopyright 2005-2010, Haiku.\n\n"), B_TRANSLATE("OK")); "\tCopyright 2005-2010, Haiku.\n\n"), B_TRANSLATE("OK"));
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
BTextView *view = alert->TextView(); BTextView *view = alert->TextView();
BFont font; BFont font;
+45 -28
View File
@@ -346,7 +346,9 @@ InstallerWindow::MessageReceived(BMessage *msg)
B_TRANSLATE("An error was encountered and the " B_TRANSLATE("An error was encountered and the "
"installation was not completed:\n\n" "installation was not completed:\n\n"
"Error: %s"), strerror(error)); "Error: %s"), strerror(error));
(new BAlert("error", errorMessage, B_TRANSLATE("OK")))->Go(); BAlert* alert = new BAlert("error", errorMessage, B_TRANSLATE("OK"));
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go();
} }
_DisableInterface(false); _DisableInterface(false);
@@ -426,10 +428,12 @@ InstallerWindow::MessageReceived(BMessage *msg)
} }
case ENCOURAGE_DRIVESETUP: case ENCOURAGE_DRIVESETUP:
{ {
(new BAlert("use drive setup", B_TRANSLATE("No partitions have " BAlert* alert = new BAlert("use drive setup", B_TRANSLATE("No partitions have "
"been found that are suitable for installation. Please set " "been found that are suitable for installation. Please set "
"up partitions and initialize at least one partition with the " "up partitions and initialize at least one partition with the "
"Be File System."), B_TRANSLATE("OK")))->Go(); "Be File System."), B_TRANSLATE("OK"));
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go();
break; break;
} }
case MSG_STATUS_MESSAGE: case MSG_STATUS_MESSAGE:
@@ -575,39 +579,48 @@ InstallerWindow::QuitRequested()
// thing on the screen and we will reboot the machine once it quits. // thing on the screen and we will reboot the machine once it quits.
if (fDriveSetupLaunched && fBootManagerLaunched) { if (fDriveSetupLaunched && fBootManagerLaunched) {
(new BAlert(B_TRANSLATE("Quit Boot Manager and DriveSetup"), BAlert* alert = new BAlert(B_TRANSLATE("Quit Boot Manager and "
B_TRANSLATE("Please close the Boot Manager and DriveSetup " "DriveSetup"), B_TRANSLATE("Please close the Boot Manager "
"windows before closing the Installer window."), "and DriveSetup windows before closing the Installer window."),
B_TRANSLATE("OK")))->Go(); B_TRANSLATE("OK"));
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go();
return false; return false;
} }
if (fDriveSetupLaunched) { if (fDriveSetupLaunched) {
(new BAlert(B_TRANSLATE("Quit DriveSetup"), BAlert* alert = new BAlert(B_TRANSLATE("Quit DriveSetup"),
B_TRANSLATE("Please close the DriveSetup window before closing " B_TRANSLATE("Please close the DriveSetup window before "
"the Installer window."), B_TRANSLATE("OK")))->Go(); "closing the Installer window."), B_TRANSLATE("OK"));
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go();
return false; return false;
} }
if (fBootManagerLaunched) { if (fBootManagerLaunched) {
(new BAlert(B_TRANSLATE("Quit Boot Manager"), BAlert* alert = new BAlert(B_TRANSLATE("Quit Boot Manager"),
B_TRANSLATE("Please close the Boot Manager window before " B_TRANSLATE("Please close the Boot Manager window before "
"closing the Installer window."), B_TRANSLATE("OK")))->Go(); "closing the Installer window."), B_TRANSLATE("OK"));
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go();
return false; return false;
} }
if (fInstallStatus != kFinished) {
if (fInstallStatus != kFinished BAlert* alert = new BAlert(B_TRANSLATE_SYSTEM_NAME("Installer"),
&& (new BAlert(B_TRANSLATE_SYSTEM_NAME("Installer"), B_TRANSLATE("Are you sure you want to abort the "
B_TRANSLATE("Are you sure you want to abort the " "installation and restart the system?"),
"installation and restart the system?"), B_TRANSLATE("Cancel"), B_TRANSLATE("Restart system"), NULL,
B_TRANSLATE("Cancel"), B_TRANSLATE("Restart system"), NULL, B_WIDTH_AS_USUAL, B_STOP_ALERT);
B_WIDTH_AS_USUAL, B_STOP_ALERT))->Go() == 0) { alert->SetShortcut(0, B_ESCAPE);
return false; if (alert->Go() == 0)
return false;
} }
} else if (fInstallStatus == kInstalling } else if (fInstallStatus == kInstalling) {
&& (new BAlert(B_TRANSLATE_SYSTEM_NAME("Installer"), BAlert* alert = new BAlert(B_TRANSLATE_SYSTEM_NAME("Installer"),
B_TRANSLATE("Are you sure you want to abort the installation?"), B_TRANSLATE("Are you sure you want to abort the installation?"),
B_TRANSLATE("Cancel"), B_TRANSLATE("Abort"), NULL, B_TRANSLATE("Cancel"), B_TRANSLATE("Abort"), NULL,
B_WIDTH_AS_USUAL, B_STOP_ALERT))->Go() == 0) { B_WIDTH_AS_USUAL, B_STOP_ALERT);
return false; alert->SetShortcut(0, B_ESCAPE);
if (alert->Go() == 0)
return false;
} }
_QuitCopyEngine(false); _QuitCopyEngine(false);
@@ -648,6 +661,7 @@ InstallerWindow::_LaunchDriveSetup()
BAlert* alert = new BAlert("error", B_TRANSLATE("DriveSetup, the " BAlert* alert = new BAlert("error", B_TRANSLATE("DriveSetup, the "
"application to configure disk partitions, could not be " "application to configure disk partitions, could not be "
"launched."), B_TRANSLATE("OK")); "launched."), B_TRANSLATE("OK"));
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go(); alert->Go();
} }
} }
@@ -676,6 +690,7 @@ InstallerWindow::_LaunchBootManager()
BAlert* alert = new BAlert("error", B_TRANSLATE("BootManager, the " BAlert* alert = new BAlert("error", B_TRANSLATE("BootManager, the "
"application to configure the Haiku boot menu, could not be " "application to configure the Haiku boot menu, could not be "
"launched."), B_TRANSLATE("OK")); "launched."), B_TRANSLATE("OK"));
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go(); alert->Go();
} }
} }
@@ -876,11 +891,13 @@ InstallerWindow::_QuitCopyEngine(bool askUser)
bool quit = true; bool quit = true;
if (askUser) { if (askUser) {
quit = (new BAlert("cancel", BAlert* alert = new BAlert("cancel",
B_TRANSLATE("Are you sure you want to to stop the installation?"), B_TRANSLATE("Are you sure you want to to stop the installation?"),
B_TRANSLATE_COMMENT("Continue", "In alert after pressing Stop"), B_TRANSLATE_COMMENT("Continue", "In alert after pressing Stop"),
B_TRANSLATE_COMMENT("Stop", "In alert after pressing Stop"), 0, B_TRANSLATE_COMMENT("Stop", "In alert after pressing Stop"), 0,
B_WIDTH_AS_USUAL, B_STOP_ALERT))->Go() != 0; B_WIDTH_AS_USUAL, B_STOP_ALERT);
alert->SetShortcut(1, B_ESCAPE);
quit = alert->Go();
} }
if (quit) { if (quit) {
+32 -25
View File
@@ -316,13 +316,15 @@ WorkerThread::_PerformInstall(BMenu* srcMenu, BMenu* targetMenu)
goto error; // shouldn't happen goto error; // shouldn't happen
// check if target has enough space // check if target has enough space
if ((fSpaceRequired > 0 && targetVolume.FreeBytes() < fSpaceRequired) if (fSpaceRequired > 0 && targetVolume.FreeBytes() < fSpaceRequired) {
&& ((new BAlert("", B_TRANSLATE("The destination disk may not have " BAlert* alert = new BAlert("", B_TRANSLATE("The destination disk may "
"enough space. Try choosing a different disk or choose to not " "not have enough space. Try choosing a different disk or choose "
"install optional items."), B_TRANSLATE("Try installing anyway"), "to not install optional items."),
B_TRANSLATE("Cancel"), 0, B_TRANSLATE("Try installing anyway"), B_TRANSLATE("Cancel"), 0,
B_WIDTH_AS_USUAL, B_STOP_ALERT))->Go() != 0)) { B_WIDTH_AS_USUAL, B_STOP_ALERT);
goto error; alert->SetShortcut(1, B_ESCAPE);
if (alert->Go() != 0)
goto error;
} }
if (fDDRoster.GetPartitionWithID(srcItem->ID(), &device, &partition) == B_OK) { if (fDDRoster.GetPartitionWithID(srcItem->ID(), &device, &partition) == B_OK) {
@@ -346,14 +348,16 @@ WorkerThread::_PerformInstall(BMenu* srcMenu, BMenu* targetMenu)
} }
// check not installing on boot volume // check not installing on boot volume
if ((strncmp(BOOT_PATH, targetDirectory.Path(), strlen(BOOT_PATH)) == 0) if (strncmp(BOOT_PATH, targetDirectory.Path(), strlen(BOOT_PATH)) == 0) {
&& ((new BAlert("", B_TRANSLATE("Are you sure you want to install " BAlert* alert = new BAlert("", B_TRANSLATE("Are you sure you want to "
"onto the current boot disk? The Installer will have to reboot " "install onto the current boot disk? The Installer will have to "
"your machine if you proceed."), B_TRANSLATE("OK"), "reboot your machine if you proceed."), B_TRANSLATE("OK"),
B_TRANSLATE("Cancel"), 0, B_TRANSLATE("Cancel"), 0, B_WIDTH_AS_USUAL, B_STOP_ALERT);
B_WIDTH_AS_USUAL, B_STOP_ALERT))->Go() != 0)) { alert->SetShortcut(1, B_ESCAPE);
_SetStatusMessage("Installation stopped."); if (alert->Go() != 0) {
goto error; _SetStatusMessage("Installation stopped.");
goto error;
}
} }
// check if target volume's trash dir has anything in it // check if target volume's trash dir has anything in it
@@ -376,19 +380,22 @@ WorkerThread::_PerformInstall(BMenu* srcMenu, BMenu* targetMenu)
entries++; entries++;
} }
if (entries != 0 if (entries != 0) {
&& ((new BAlert("", B_TRANSLATE("The target volume is not empty. Are " BAlert* alert = new BAlert("", B_TRANSLATE("The target volume is not "
"you sure you want to install anyway?\n\nNote: The 'system' folder " "empty. Are you sure you want to install anyway?\n\nNote: The "
"will be a clean copy from the source volume, all other folders " "'system' folder will be a clean copy from the source volume, all "
"will be merged, whereas files and links that exist on both the " "other folders will be merged, whereas files and links that exist "
"source and target volume will be overwritten with the source " "on both the source and target volume will be overwritten with "
"volume version."), "the source volume version."),
B_TRANSLATE("Install anyway"), B_TRANSLATE("Cancel"), 0, B_TRANSLATE("Install anyway"), B_TRANSLATE("Cancel"), 0,
B_WIDTH_AS_USUAL, B_STOP_ALERT))->Go() != 0)) { B_WIDTH_AS_USUAL, B_STOP_ALERT);
alert->SetShortcut(1, B_ESCAPE);
if (alert->Go() != 0) {
// TODO: Would be cool to offer the option here to clean additional // TODO: Would be cool to offer the option here to clean additional
// folders at the user's choice (like /boot/common and /boot/develop). // folders at the user's choice (like /boot/common and /boot/develop).
err = B_CANCELED; err = B_CANCELED;
goto error; goto error;
}
} }
// Begin actual installation // Begin actual installation
+2
View File
@@ -98,6 +98,7 @@ MainWindow::QuitRequested()
B_TRANSLATE("Really close this pad?\n" B_TRANSLATE("Really close this pad?\n"
"(The pad will not be remembered.)"), "(The pad will not be remembered.)"),
B_TRANSLATE("Close"), B_TRANSLATE("Cancel"), NULL); B_TRANSLATE("Close"), B_TRANSLATE("Cancel"), NULL);
alert->SetShortcut(1, B_ESCAPE);
if (alert->Go() == 1) if (alert->Go() == 1)
return false; return false;
} }
@@ -172,6 +173,7 @@ MainWindow::MessageReceived(BMessage* message)
if (errorMessage.Length() > 0) { if (errorMessage.Length() > 0) {
BAlert* alert = new BAlert("error", errorMessage.String(), BAlert* alert = new BAlert("error", errorMessage.String(),
B_TRANSLATE("Bummer"), NULL, NULL, B_WIDTH_FROM_WIDEST); B_TRANSLATE("Bummer"), NULL, NULL, B_WIDTH_FROM_WIDEST);
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go(NULL); alert->Go(NULL);
} }
break; break;
+14 -5
View File
@@ -51,12 +51,14 @@ LoginApp::ReadyToRun()
BScreen screen; BScreen screen;
if (fEditShelfMode) { if (fEditShelfMode) {
(new BAlert(B_TRANSLATE("Info"), B_TRANSLATE("You can customize the " BAlert* alert = new BAlert(B_TRANSLATE("Info"), B_TRANSLATE("You can customize the "
"desktop shown behind the Login application by dropping replicants" "desktop shown behind the Login application by dropping replicants"
" onto it.\n" " onto it.\n"
"\n" "\n"
"When you are finished just quit the application (Alt-Q)."), "When you are finished just quit the application (Alt-Q)."),
B_TRANSLATE("OK")))->Go(NULL); B_TRANSLATE("OK"));
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go(NULL);
} else { } else {
BRect frame(0, 0, 450, 150); BRect frame(0, 0, 450, 150);
frame.OffsetBySelf(screen.Frame().Width()/2 - frame.Width()/2, frame.OffsetBySelf(screen.Frame().Width()/2 - frame.Width()/2,
@@ -94,14 +96,21 @@ LoginApp::MessageReceived(BMessage *message)
if (error < B_OK) { if (error < B_OK) {
BString msg(B_TRANSLATE("Error: %1")); BString msg(B_TRANSLATE("Error: %1"));
msg.ReplaceFirst("%1", strerror(error)); msg.ReplaceFirst("%1", strerror(error));
(new BAlert(("Error"), msg.String(), B_TRANSLATE("OK")))->Go(); BAlert* alert = new BAlert(("Error"), msg.String(),
B_TRANSLATE("OK"));
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go();
} }
break; break;
} }
case kSuspendAction: case kSuspendAction:
(new BAlert(B_TRANSLATE("Error"), B_TRANSLATE("Unimplemented"), {
B_TRANSLATE("OK")))->Go(); BAlert* alert = new BAlert(B_TRANSLATE("Error"),
B_TRANSLATE("Unimplemented"), B_TRANSLATE("OK"));
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go();
break; break;
}
#endif #endif
default: default:
BApplication::MessageReceived(message); BApplication::MessageReceived(message);
+20 -15
View File
@@ -755,10 +755,11 @@ TContentView::MessageReceived(BMessage *msg)
free (signature); free (signature);
} else { } else {
beep(); beep();
(new BAlert("", BAlert* alert = new BAlert("",
B_TRANSLATE("An error occurred trying to open this " B_TRANSLATE("An error occurred trying to open this "
"signature."), "signature."), B_TRANSLATE("Sorry"));
B_TRANSLATE("Sorry")))->Go(); alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go();
} }
break; break;
} }
@@ -1914,10 +1915,11 @@ TTextView::Open(hyper_text *enclosure)
status_t result = be_roster->Launch(handlerToLaunch, 1, &enclosure->name); status_t result = be_roster->Launch(handlerToLaunch, 1, &enclosure->name);
if (result != B_NO_ERROR && result != B_ALREADY_RUNNING) { if (result != B_NO_ERROR && result != B_ALREADY_RUNNING) {
beep(); beep();
(new BAlert("", BAlert* alert = new BAlert("",
B_TRANSLATE("There is no installed handler for " B_TRANSLATE("There is no installed handler for "
"URL links."), "URL links."), B_TRANSLATE("Sorry"));
"Sorry"))->Go(); alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go();
} }
break; break;
} }
@@ -2065,9 +2067,10 @@ TTextView::Save(BMessage *msg, bool makeNewFile)
if (result != B_NO_ERROR) { if (result != B_NO_ERROR) {
beep(); beep();
(new BAlert("", B_TRANSLATE("An error occurred trying to save " BAlert* alert = new BAlert("", B_TRANSLATE("An error occurred trying to save "
"the attachment."), "the attachment."), B_TRANSLATE("Sorry"));
B_TRANSLATE("Sorry")))->Go(); alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go();
} }
return result; return result;
@@ -3337,10 +3340,11 @@ TTextView::Undo(BClipboard */*clipboard*/)
Select(offset, offset + length); Select(offset, offset + length);
} else { } else {
::beep(); ::beep();
(new BAlert("", BAlert* alert = new BAlert("",
B_TRANSLATE("Inconsistency occurred in the undo/redo " B_TRANSLATE("Inconsistency occurred in the undo/redo "
"buffer."), "buffer."), B_TRANSLATE("OK"));
B_TRANSLATE("OK")))->Go(); alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go();
} }
break; break;
} }
@@ -3384,10 +3388,11 @@ TTextView::Redo()
case K_REPLACED: case K_REPLACED:
::beep(); ::beep();
(new BAlert("", BAlert* alert = new BAlert("",
B_TRANSLATE("Inconsistency occurred in the undo/redo " B_TRANSLATE("Inconsistency occurred in the undo/redo "
"buffer."), "buffer."), B_TRANSLATE("OK"));
B_TRANSLATE("OK")))->Go(); alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go();
break; break;
} }
ScrollToSelection(); ScrollToSelection();
+8 -4
View File
@@ -249,10 +249,12 @@ TEnclosuresView::MessageReceived(BMessage *msg)
if (window && window->Mail()) if (window && window->Mail())
window->Mail()->RemoveComponent(item->Component()); window->Mail()->RemoveComponent(item->Component());
(new BAlert("", B_TRANSLATE( BAlert* alert = 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."),
B_TRANSLATE("OK")))->Go(); B_TRANSLATE("OK"));
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go();
} }
else else
watch_node(item->NodeRef(), B_STOP_WATCHING, this); watch_node(item->NodeRef(), B_STOP_WATCHING, this);
@@ -302,9 +304,11 @@ TEnclosuresView::MessageReceived(BMessage *msg)
if (badType) if (badType)
{ {
beep(); beep();
(new BAlert("", BAlert* alert = new BAlert("",
B_TRANSLATE("Only files can be added as attachments."), B_TRANSLATE("Only files can be added as attachments."),
B_TRANSLATE("OK")))->Go(); B_TRANSLATE("OK"));
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go();
} }
} }
break; break;
+34 -18
View File
@@ -1177,9 +1177,11 @@ TMailWindow::MessageReceived(BMessage *msg)
msg.AddRef("refs", fRef); msg.AddRef("refs", fRef);
tracker.SendMessage(&msg); tracker.SendMessage(&msg);
} else { } else {
(new BAlert("", BAlert* alert = new BAlert("",
B_TRANSLATE("Need Tracker to move items to trash"), B_TRANSLATE("Need Tracker to move items to trash"),
B_TRANSLATE("Sorry")))->Go(); B_TRANSLATE("Sorry"));
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go();
} }
} }
} else { } else {
@@ -1344,14 +1346,14 @@ TMailWindow::MessageReceived(BMessage *msg)
1, &arg); 1, &arg);
if (result != B_NO_ERROR) { if (result != B_NO_ERROR) {
(new BAlert("", B_TRANSLATE( BAlert* alert = new BAlert("", B_TRANSLATE(
"Sorry, could not find an application that " "Sorry, could not find an application that "
"supports the 'Person' data type."), "supports the 'Person' data type."),
B_TRANSLATE("OK")))->Go(); B_TRANSLATE("OK"));
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go();
} }
} }
free(arg); free(arg);
break; break;
} }
@@ -1581,10 +1583,12 @@ TMailWindow::MessageReceived(BMessage *msg)
snooze (1500000); snooze (1500000);
if (!gDictCount) { if (!gDictCount) {
beep(); beep();
(new BAlert("", BAlert* alert = new BAlert("",
B_TRANSLATE("Mail couldn't find its dictionary."), B_TRANSLATE("Mail couldn't find its dictionary."),
B_TRANSLATE("OK"), NULL, NULL, B_WIDTH_AS_USUAL, B_TRANSLATE("OK"), NULL, NULL, B_WIDTH_AS_USUAL,
B_OFFSET_SPACING, B_STOP_ALERT))->Go(); B_OFFSET_SPACING, B_STOP_ALERT);
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go();
} else { } else {
fSpelling->SetMarked(!fSpelling->IsMarked()); fSpelling->SetMarked(!fSpelling->IsMarked());
fContentView->fTextView->EnableSpellCheck( fContentView->fTextView->EnableSpellCheck(
@@ -1626,6 +1630,7 @@ TMailWindow::MessageReceived(BMessage *msg)
B_TRANSLATE("Put your favorite e-mail queries and query " B_TRANSLATE("Put your favorite e-mail queries and query "
"templates in this folder."), B_TRANSLATE("OK"), NULL, NULL, "templates in this folder."), B_TRANSLATE("OK"), NULL, NULL,
B_WIDTH_AS_USUAL, B_IDEA_ALERT); B_WIDTH_AS_USUAL, B_IDEA_ALERT);
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go(NULL); alert->Go(NULL);
} }
@@ -2225,8 +2230,10 @@ TMailWindow::Send(bool now)
status_t status = SaveAsDraft(); status_t status = SaveAsDraft();
if (status != B_OK) { if (status != B_OK) {
beep(); beep();
(new BAlert("", B_TRANSLATE("E-mail draft could not be saved!"), BAlert* alert = new BAlert("", B_TRANSLATE("E-mail draft could "
B_TRANSLATE("OK")))->Go(); "not be saved!"), B_TRANSLATE("OK"));
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go();
} }
return status; return status;
} }
@@ -2315,11 +2322,14 @@ TMailWindow::Send(bool now)
"the unencodable ones), or choose Cancel to go back " "the unencodable ones), or choose Cancel to go back "
"and try fixing it up."); "and try fixing it up.");
messageString.ReplaceFirst("%ld", countString); messageString.ReplaceFirst("%ld", countString);
userAnswer = (new BAlert("Question", messageString.String(), BAlert* alert = new BAlert("Question", messageString.String(),
B_TRANSLATE("Send"), B_TRANSLATE("Send"),
B_TRANSLATE("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);
alert->SetShortcut(1, B_ESCAPE);
userAnswer = alert->Go();
if (userAnswer == 1) { if (userAnswer == 1) {
// Cancel was picked. // Cancel was picked.
return -1; return -1;
@@ -2450,11 +2460,13 @@ TMailWindow::Send(bool now)
close = true; close = true;
fSent = true; fSent = true;
int32 start = (new BAlert("no daemon", BAlert* alert = new BAlert("no daemon",
B_TRANSLATE("The mail_daemon is not running. The message is " B_TRANSLATE("The mail_daemon is not running. The message is "
"queued and will be sent when the mail_daemon is started."), "queued and will be sent when the mail_daemon is started."),
B_TRANSLATE("Start now"), B_TRANSLATE("OK")))->Go(); B_TRANSLATE("Start now"), B_TRANSLATE("OK"));
alert->SetShortcut(1, B_ESCAPE);
int32 start = alert->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");
if (result == B_OK) { if (result == B_OK) {
@@ -2489,7 +2501,9 @@ 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(), B_TRANSLATE("OK")))->Go(); BAlert* alert = new BAlert("", errorMessage.String(), B_TRANSLATE("OK"));
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go();
} }
if (close) { if (close) {
PostMessage(B_QUIT_REQUESTED); PostMessage(B_QUIT_REQUESTED);
@@ -2721,8 +2735,10 @@ ErrorExit:
sprintf(errorString, "Unable to train the message file \"%s\" as %s. " sprintf(errorString, "Unable to train the message file \"%s\" as %s. "
"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, BAlert* alert = new BAlert("", errorString, B_TRANSLATE("OK"));
B_TRANSLATE("OK")))->Go(); alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go();
return errorCode; return errorCode;
} }
+16 -8
View File
@@ -192,13 +192,17 @@ TSignatureWindow::MessageReceived(BMessage* msg)
Save(); Save();
break; break;
case M_DELETE: case M_DELETE: {
if (!(new BAlert("", BAlert* alert = new BAlert("",
B_TRANSLATE("Really delete this signature? This cannot " B_TRANSLATE("Really delete this signature? This cannot "
"be undone."), "be undone."),
B_TRANSLATE("Cancel"), B_TRANSLATE("Cancel"),
B_TRANSLATE("Delete"), B_TRANSLATE("Delete"),
NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go()) NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
alert->SetShortcut(0, B_ESCAPE);
int32 choice = alert->Go();
if (choice == 0)
break; break;
if (fFile) { if (fFile) {
@@ -210,7 +214,7 @@ TSignatureWindow::MessageReceived(BMessage* msg)
fSigView->fName->MakeFocus(true); fSigView->fName->MakeFocus(true);
} }
break; break;
}
case M_SIGNATURE: case M_SIGNATURE:
if (Clear()) { if (Clear()) {
msg->FindRef("ref", &ref); msg->FindRef("ref", &ref);
@@ -231,9 +235,11 @@ TSignatureWindow::MessageReceived(BMessage* msg)
else { else {
fFile = NULL; fFile = NULL;
beep(); beep();
(new BAlert("", BAlert* alert = new BAlert("",
B_TRANSLATE("Couldn't open this signature. Sorry."), B_TRANSLATE("Couldn't open this signature. Sorry."),
B_TRANSLATE("OK")))->Go(); B_TRANSLATE("OK"));
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go();
} }
} }
break; break;
@@ -385,9 +391,11 @@ TSignatureWindow::Save()
err_exit: err_exit:
beep(); beep();
(new BAlert("", BAlert* alert = new BAlert("",
B_TRANSLATE("An error occurred trying to save this signature."), B_TRANSLATE("An error occurred trying to save this signature."),
B_TRANSLATE("Sorry")))->Go(); B_TRANSLATE("Sorry"));
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go();
} }
@@ -146,7 +146,7 @@ MediaConverterApp::RefsReceived(BMessage* msg)
BAlert* alert = new BAlert((errors > 1) ? BAlert* alert = new BAlert((errors > 1) ?
B_TRANSLATE("Error loading files") : B_TRANSLATE("Error loading files") :
B_TRANSLATE("Error loading a file"), B_TRANSLATE("Error loading a file"),
alertText.String(), B_TRANSLATE("Continue") , NULL, NULL, alertText.String(), B_TRANSLATE("Continue"), NULL, NULL,
B_WIDTH_AS_USUAL, B_STOP_ALERT); B_WIDTH_AS_USUAL, B_STOP_ALERT);
alert->Go(); alert->Go();
} }
@@ -428,8 +428,10 @@ MediaConverterWindow::MessageReceived(BMessage* msg)
if (status != B_OK && status != B_ALREADY_RUNNING) { if (status != B_OK && status != B_ALREADY_RUNNING) {
BString errorString(B_TRANSLATE("Error launching: %strError%")); BString errorString(B_TRANSLATE("Error launching: %strError%"));
errorString.ReplaceFirst("%strError%", strerror(status)); errorString.ReplaceFirst("%strError%", strerror(status));
(new BAlert(B_TRANSLATE("Error"), errorString.String(), BAlert* alert = new BAlert(B_TRANSLATE("Error"),
B_TRANSLATE("OK")))->Go(); errorString.String(), B_TRANSLATE("OK"));
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go();
} }
break; break;
} }
@@ -165,6 +165,7 @@ MediaFileInfoView::Update(BMediaFile* file, entry_ref* ref)
BAlert* alert = new BAlert( BAlert* alert = new BAlert(
B_TRANSLATE("File Error"), error.String(), B_TRANSLATE("File Error"), error.String(),
B_TRANSLATE("OK")); B_TRANSLATE("OK"));
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go(NULL); alert->Go(NULL);
} }
} else { } else {
+2
View File
@@ -93,6 +93,8 @@ MainApp::MainApp()
"Would you like to start it ?"), B_TRANSLATE("Quit"), "Would you like to start it ?"), B_TRANSLATE("Quit"),
B_TRANSLATE("Start media server"), NULL, B_TRANSLATE("Start media server"), NULL,
B_WIDTH_AS_USUAL, B_WARNING_ALERT); B_WIDTH_AS_USUAL, B_WARNING_ALERT);
alert->SetShortcut(0, B_ESCAPE);
if (alert->Go() == 0) { if (alert->Go() == 0) {
PostMessage(B_QUIT_REQUESTED); PostMessage(B_QUIT_REQUESTED);
return; return;
+9 -3
View File
@@ -633,6 +633,7 @@ MainWin::MessageReceived(BMessage* msg)
BAlert* alert = new BAlert(B_TRANSLATE("Nothing to Play"), BAlert* alert = new BAlert(B_TRANSLATE("Nothing to Play"),
B_TRANSLATE("None of the files you wanted to play appear " B_TRANSLATE("None of the files you wanted to play appear "
"to be media files."), B_TRANSLATE("OK")); "to be media files."), B_TRANSLATE("OK"));
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go(); alert->Go();
fControls->SetDisabledString(kDisabledSeekMessage); fControls->SetDisabledString(kDisabledSeekMessage);
break; break;
@@ -1090,8 +1091,10 @@ MainWin::OpenPlaylistItem(const PlaylistItemRef& item)
BString message = B_TRANSLATE("%app% encountered an internal error. " BString message = B_TRANSLATE("%app% encountered an internal error. "
"The file could not be opened."); "The file could not be opened.");
message.ReplaceFirst("%app%", kApplicationName); message.ReplaceFirst("%app%", kApplicationName);
(new BAlert(kApplicationName, message.String(), BAlert* alert = new BAlert(kApplicationName, message.String(),
B_TRANSLATE("OK")))->Go(); B_TRANSLATE("OK"));
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go();
_PlaylistItemOpened(item, ret); _PlaylistItemOpened(item, ret);
} else { } else {
BString string; BString string;
@@ -1337,7 +1340,10 @@ MainWin::_PlaylistItemOpened(const PlaylistItemRef& item, status_t result)
} else { } else {
message << B_TRANSLATE("Error: ") << strerror(result); message << B_TRANSLATE("Error: ") << strerror(result);
} }
(new BAlert("error", message.String(), B_TRANSLATE("OK")))->Go(); BAlert* alert = new BAlert("error", message.String(),
B_TRANSLATE("OK"));
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go();
fControls->SetDisabledString(kDisabledSeekMessage); fControls->SetDisabledString(kDisabledSeekMessage);
} else { } else {
// Just go to the next file and don't bother user (yet) // Just go to the next file and don't bother user (yet)
@@ -57,6 +57,7 @@ display_save_alert(const char* message)
{ {
BAlert* alert = new BAlert(B_TRANSLATE("Save error"), message, BAlert* alert = new BAlert(B_TRANSLATE("Save error"), message,
B_TRANSLATE("OK"), NULL, NULL, B_WIDTH_AS_USUAL, B_STOP_ALERT); B_TRANSLATE("OK"), NULL, NULL, B_WIDTH_AS_USUAL, B_STOP_ALERT);
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go(NULL); alert->Go(NULL);
} }
@@ -118,9 +118,11 @@ RemovePLItemsCommand::Perform()
message << message <<
B_TRANSLATE("Some files could not be moved into Trash."); B_TRANSLATE("Some files could not be moved into Trash.");
message << "\n\n" << B_TRANSLATE("Error: ") << strerror(moveError); message << "\n\n" << B_TRANSLATE("Error: ") << strerror(moveError);
(new BAlert(B_TRANSLATE("Move Into Trash Error"), message.String(), BAlert* alert = new BAlert(B_TRANSLATE("Move into trash error"),
B_TRANSLATE("OK"), NULL, NULL, B_WIDTH_AS_USUAL, message.String(), B_TRANSLATE("OK"), NULL, NULL,
B_WARNING_ALERT))->Go(NULL); B_WIDTH_AS_USUAL, B_WARNING_ALERT);
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go(NULL);
} }
} }
+7 -5
View File
@@ -48,14 +48,16 @@ MidiPlayerApp::ReadyToRun()
void void
MidiPlayerApp::AboutRequested() MidiPlayerApp::AboutRequested()
{ {
(new BAlert( BAlert* alert = new BAlert(NULL,
NULL,
B_TRANSLATE_COMMENT("Haiku MIDI Player 1.0.0 beta\n\n" B_TRANSLATE_COMMENT("Haiku MIDI Player 1.0.0 beta\n\n"
"This tiny program\n" "This tiny program\n"
"Knows how to play thousands of\n" "Knows how to play thousands of\n"
"Cheesy sounding songs", "This is a haiku. First line has five syllables, second has seven and last has five again. Create your own."), "Cheesy sounding songs", "This is a haiku. First line has five "
"Okay", NULL, NULL, "syllables, second has seven and last has five again. "
B_WIDTH_AS_USUAL, B_INFO_ALERT))->Go(); "Create your own."), B_TRANSLATE("OK"), NULL, NULL,
B_WIDTH_AS_USUAL, B_INFO_ALERT);
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go();
} }
+4 -2
View File
@@ -381,9 +381,11 @@ MidiPlayerWindow::LoadFile(entry_ref* ref)
scopeView->SetPlaying(false); scopeView->SetPlaying(false);
scopeView->Invalidate(); scopeView->Invalidate();
(new BAlert(NULL, B_TRANSLATE("Could not load song"), BAlert* alert = new BAlert(NULL, B_TRANSLATE("Could not load song"),
B_TRANSLATE("OK"), NULL, NULL, B_TRANSLATE("OK"), NULL, NULL,
B_WIDTH_AS_USUAL, B_STOP_ALERT))->Go(); B_WIDTH_AS_USUAL, B_STOP_ALERT);
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go();
} }
} }
-1
View File
@@ -156,7 +156,6 @@ NetworkStatus::ReadyToRun()
"in a window or install it in the Deskbar."), "in a window or install it in the Deskbar."),
B_TRANSLATE("Run in window"), B_TRANSLATE("Install in Deskbar"), B_TRANSLATE("Run in window"), B_TRANSLATE("Install in Deskbar"),
NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT); NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
alert->SetShortcut(0, B_ESCAPE);
if (alert->Go() == 1) { if (alert->Go() == 1) {
_InstallReplicantInDeskbar(); _InstallReplicantInDeskbar();
@@ -298,6 +298,7 @@ NetworkStatusView::MessageReceived(BMessage* message)
BAlert* alert = new BAlert(name, text.String(), BAlert* alert = new BAlert(name, text.String(),
B_TRANSLATE("OK"), NULL, NULL, B_WIDTH_AS_USUAL, B_TRANSLATE("OK"), NULL, NULL, B_WIDTH_AS_USUAL,
B_STOP_ALERT); B_STOP_ALERT);
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go(NULL); alert->Go(NULL);
} }
} }
@@ -401,6 +402,7 @@ NetworkStatusView::_ShowConfiguration(BMessage* message)
} }
BAlert* alert = new BAlert(name, text.String(), B_TRANSLATE("OK")); BAlert* alert = new BAlert(name, text.String(), B_TRANSLATE("OK"));
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
BTextView* view = alert->TextView(); BTextView* view = alert->TextView();
BFont font; BFont font;
@@ -509,6 +511,7 @@ NetworkStatusView::_AboutRequested()
about.ReplaceFirst("%2", "Copyright 2007-2010"); about.ReplaceFirst("%2", "Copyright 2007-2010");
// Append a new year here // Append a new year here
BAlert* alert = new BAlert("about", about, B_TRANSLATE("OK")); BAlert* alert = new BAlert("about", about, B_TRANSLATE("OK"));
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
BTextView *view = alert->TextView(); BTextView *view = alert->TextView();
BFont font; BFont font;
@@ -602,6 +605,7 @@ NetworkStatusView::_OpenNetworksPreferences()
errorMessage << strerror(status); errorMessage << strerror(status);
BAlert* alert = new BAlert("launch error", errorMessage.String(), BAlert* alert = new BAlert("launch error", errorMessage.String(),
B_TRANSLATE("OK")); B_TRANSLATE("OK"));
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
// asynchronous alert in order to not block replicant host application // asynchronous alert in order to not block replicant host application
alert->Go(NULL); alert->Go(NULL);
+2 -3
View File
@@ -159,8 +159,7 @@ OverlayView::OverlayAboutRequested()
"originally by Seth Flaxman\n\t" "originally by Seth Flaxman\n\t"
"modified by Hartmuth Reh\n\t" "modified by Hartmuth Reh\n\t"
"further modified by Humdinger\n", "further modified by Humdinger\n",
"OK"); "OK");
BTextView *view = alert->TextView(); BTextView *view = alert->TextView();
BFont font; BFont font;
view->SetStylable(true); view->SetStylable(true);
@@ -168,6 +167,6 @@ OverlayView::OverlayAboutRequested()
font.SetSize(font.Size() + 7.0f); font.SetSize(font.Size() + 7.0f);
font.SetFace(B_BOLD_FACE); font.SetFace(B_BOLD_FACE);
view->SetFontAndColor(0, 12, &font); view->SetFontAndColor(0, 12, &font);
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go(); alert->Go();
} }
@@ -1044,6 +1044,7 @@ PackageInfo::Parse()
B_TRANSLATE("Continue"), B_TRANSLATE("Continue"),
B_TRANSLATE("Abort"), NULL, B_TRANSLATE("Abort"), NULL,
B_WIDTH_AS_USUAL, B_WARNING_ALERT); B_WIDTH_AS_USUAL, B_WARNING_ALERT);
warning->SetShortcut(1, B_ESCAPE);
selection = warning->Go(); selection = warning->Go();
if (selection == 1) { if (selection == 1) {
@@ -125,6 +125,7 @@ PackageInstall::_Install()
"and continue the installation?"), "and continue the installation?"),
B_TRANSLATE("Continue"), B_TRANSLATE("Continue"),
B_TRANSLATE("Abort")); B_TRANSLATE("Abort"));
reinstall->SetShortcut(1, B_ESCAPE);
if (reinstall->Go() == 0) { if (reinstall->Go() == 0) {
// Uninstall the package // Uninstall the package
+6 -1
View File
@@ -98,6 +98,7 @@ PackageView::AttachedToWindow()
"possible reasons for this might be that the requested file " "possible reasons for this might be that the requested file "
"is not a valid BeOS .pkg package."), B_TRANSLATE("OK"), "is not a valid BeOS .pkg package."), B_TRANSLATE("OK"),
NULL, NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT); NULL, NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
warning->SetFlags(warning->Flags() | B_CLOSE_ON_ESCAPE);
warning->Go(); warning->Go();
Window()->PostMessage(B_QUIT_REQUESTED); Window()->PostMessage(B_QUIT_REQUESTED);
@@ -195,6 +196,7 @@ PackageView::MessageReceived(BMessage *msg)
B_TRANSLATE("The package you requested has been successfully " B_TRANSLATE("The package you requested has been successfully "
"installed on your system."), "installed on your system."),
B_TRANSLATE("OK")); B_TRANSLATE("OK"));
notify->SetFlags(notify->Flags() | B_CLOSE_ON_ESCAPE);
notify->Go(); notify->Go();
fStatusWindow->Hide(); fStatusWindow->Hide();
@@ -214,6 +216,7 @@ PackageView::MessageReceived(BMessage *msg)
B_TRANSLATE( B_TRANSLATE(
"The installation of the package has been aborted."), "The installation of the package has been aborted."),
B_TRANSLATE("OK")); B_TRANSLATE("OK"));
notify->SetFlags(notify->Flags() | B_CLOSE_ON_ESCAPE);
notify->Go(); notify->Go();
fStatusWindow->Hide(); fStatusWindow->Hide();
fInstall->SetEnabled(true); fInstall->SetEnabled(true);
@@ -234,6 +237,7 @@ PackageView::MessageReceived(BMessage *msg)
NULL, NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT); NULL, NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
fprintf(stderr, fprintf(stderr,
B_TRANSLATE("Error while installing the package\n")); B_TRANSLATE("Error while installing the package\n"));
notify->SetFlags(notify->Flags() | B_CLOSE_ON_ESCAPE);
notify->Go(); notify->Go();
fStatusWindow->Hide(); fStatusWindow->Hide();
fInstall->SetEnabled(true); fInstall->SetEnabled(true);
@@ -354,7 +358,8 @@ PackageView::ItemExists(PackageItem &item, BPath &path, int32 &policy)
B_TRANSLATE("Replace"), B_TRANSLATE("Replace"),
B_TRANSLATE("Skip"), B_TRANSLATE("Skip"),
B_TRANSLATE("Abort")); B_TRANSLATE("Abort"));
alert->SetShortcut(2, B_ESCAPE);
choice = alert->Go(); choice = alert->Go();
switch (choice) { switch (choice) {
case 0: case 0:
+1 -1
View File
@@ -175,7 +175,7 @@ PairsView::_ReadRandomIcons()
BAlert* alert = new BAlert("Fatal", msgStr.String(), BAlert* alert = new BAlert("Fatal", msgStr.String(),
B_TRANSLATE("OK"), NULL, NULL, B_WIDTH_FROM_WIDEST, B_TRANSLATE("OK"), NULL, NULL, B_WIDTH_FROM_WIDEST,
B_STOP_ALERT); B_STOP_ALERT);
alert->SetShortcut(0, B_ESCAPE); alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go(); alert->Go();
exit(1); exit(1);
} }
+1
View File
@@ -247,6 +247,7 @@ TPeopleApp::MessageReceived(BMessage* message)
BAlert* alert = new BAlert(B_TRANSLATE("Error"), BAlert* alert = new BAlert(B_TRANSLATE("Error"),
errorMsg.String(), B_TRANSLATE("OK"), NULL, NULL, errorMsg.String(), B_TRANSLATE("OK"), NULL, NULL,
B_WIDTH_AS_USUAL, B_STOP_ALERT); B_WIDTH_AS_USUAL, B_STOP_ALERT);
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go(NULL); alert->Go(NULL);
} }
break; break;
+8 -3
View File
@@ -216,7 +216,9 @@ PersonWindow::MessageReceived(BMessage* msg)
} }
else { else {
sprintf(str, B_TRANSLATE("Could not create %s."), name); sprintf(str, B_TRANSLATE("Could not create %s."), name);
(new BAlert("", str, B_TRANSLATE("Sorry")))->Go(); BAlert* alert = new BAlert("", str, B_TRANSLATE("Sorry"));
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go();
} }
} }
} }
@@ -294,9 +296,12 @@ PersonWindow::QuitRequested()
status_t result; status_t result;
if (!fView->IsSaved()) { if (!fView->IsSaved()) {
result = (new BAlert("", B_TRANSLATE("Save changes before quitting?"), BAlert* alert = new BAlert("", B_TRANSLATE("Save changes before quitting?"),
B_TRANSLATE("Cancel"), B_TRANSLATE("Quit"), B_TRANSLATE("Cancel"), B_TRANSLATE("Quit"),
B_TRANSLATE("Save")))->Go(); B_TRANSLATE("Save"));
alert->SetShortcut(0, B_ESCAPE);
result = alert->Go();
if (result == 2) { if (result == 2) {
if (fRef) if (fRef)
fView->Save(); fView->Save();
+1
View File
@@ -564,6 +564,7 @@ PictureView::_HandleDrop(BMessage* msg)
text.ReplaceFirst("%name%", name); text.ReplaceFirst("%name%", name);
BAlert* alert = new BAlert(B_TRANSLATE("Error"), text.String(), BAlert* alert = new BAlert(B_TRANSLATE("Error"), text.String(),
B_TRANSLATE("OK"), NULL, NULL, B_WIDTH_AS_USUAL, B_STOP_ALERT); B_TRANSLATE("OK"), NULL, NULL, B_WIDTH_AS_USUAL, B_STOP_ALERT);
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go(); alert->Go();
} }
} }
+2
View File
@@ -545,6 +545,7 @@ PoorManWindow::DefaultSettings()
{ {
BAlert* serverAlert = new BAlert(B_TRANSLATE("Error Server"), BAlert* serverAlert = new BAlert(B_TRANSLATE("Error Server"),
STR_ERR_CANT_START, B_TRANSLATE("OK")); STR_ERR_CANT_START, B_TRANSLATE("OK"));
serverAlert->SetFlags(serverAlert->Flags() | B_CLOSE_ON_ESCAPE);
BAlert* dirAlert = new BAlert(B_TRANSLATE("Error Dir"), BAlert* dirAlert = new BAlert(B_TRANSLATE("Error Dir"),
STR_ERR_WEB_DIR, B_TRANSLATE("Cancel"), B_TRANSLATE("Select"), STR_ERR_WEB_DIR, B_TRANSLATE("Cancel"), B_TRANSLATE("Select"),
B_TRANSLATE("Default"), B_WIDTH_AS_USUAL, B_OFFSET_SPACING); B_TRANSLATE("Default"), B_WIDTH_AS_USUAL, B_OFFSET_SPACING);
@@ -576,6 +577,7 @@ PoorManWindow::DefaultSettings()
BAlert* dirCreatedAlert = BAlert* dirCreatedAlert =
new BAlert(B_TRANSLATE("Dir Created"), STR_DIR_CREATED, new BAlert(B_TRANSLATE("Dir Created"), STR_DIR_CREATED,
B_TRANSLATE("OK")); B_TRANSLATE("OK"));
dirCreatedAlert->SetFlags(dirCreatedAlert->Flags() | B_CLOSE_ON_ESCAPE);
dirCreatedAlert->Go(); dirCreatedAlert->Go();
SetWebDir(STR_DEFAULT_WEB_DIRECTORY); SetWebDir(STR_DEFAULT_WEB_DIRECTORY);
be_app->PostMessage(kStartServer); be_app->PostMessage(kStartServer);
-1
View File
@@ -90,7 +90,6 @@ PowerStatus::ReadyToRun()
"or install it in the Deskbar."), B_TRANSLATE("Run in window"), "or install it in the Deskbar."), B_TRANSLATE("Run in window"),
B_TRANSLATE("Install in Deskbar"), NULL, B_WIDTH_AS_USUAL, B_TRANSLATE("Install in Deskbar"), NULL, B_WIDTH_AS_USUAL,
B_WARNING_ALERT); B_WARNING_ALERT);
alert->SetShortcut(0, B_ESCAPE);
if (alert->Go()) { if (alert->Go()) {
image_info info; image_info info;
+1
View File
@@ -635,6 +635,7 @@ PowerStatusReplicant::_AboutRequested()
font.SetFace(B_BOLD_FACE); font.SetFace(B_BOLD_FACE);
view->SetFontAndColor(0, strlen(B_TRANSLATE("PowerStatus")), &font); view->SetFontAndColor(0, strlen(B_TRANSLATE("PowerStatus")), &font);
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go(); alert->Go();
} }
+1 -2
View File
@@ -93,7 +93,6 @@ PCApplication::ReadyToRun()
" or install it in the Deskbar."), B_TRANSLATE("Run in window"), " or install it in the Deskbar."), B_TRANSLATE("Run in window"),
B_TRANSLATE("Install in Deskbar"), B_TRANSLATE("Install in Deskbar"),
NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT); NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
alert->SetShortcut(0, B_ESCAPE);
if (alert->Go() != 0) { if (alert->Go() != 0) {
BDeskbar deskbar; BDeskbar deskbar;
@@ -107,7 +106,7 @@ PCApplication::ReadyToRun()
B_TRANSLATE("ProcessController is already installed in Deskbar."), B_TRANSLATE("ProcessController is already installed in Deskbar."),
B_TRANSLATE("OK"), NULL, B_TRANSLATE("OK"), NULL,
NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT); NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
alert->SetShortcut(0, B_ESCAPE); alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go(); alert->Go();
} }
+1 -2
View File
@@ -115,8 +115,7 @@ Preferences::~Preferences()
BAlert *alert = new BAlert(B_TRANSLATE("Error saving file"), BAlert *alert = new BAlert(B_TRANSLATE("Error saving file"),
error.String(), B_TRANSLATE("Damned!"), NULL, NULL, error.String(), B_TRANSLATE("Damned!"), NULL, NULL,
B_WIDTH_AS_USUAL, B_STOP_ALERT); B_WIDTH_AS_USUAL, B_STOP_ALERT);
alert->SetShortcut(0, B_ESCAPE); alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go(); alert->Go();
} }
} }
@@ -280,7 +280,7 @@ ProcessController::MessageReceived(BMessage *message)
B_TRANSLATE("This team is already gone"B_UTF8_ELLIPSIS), B_TRANSLATE("This team is already gone"B_UTF8_ELLIPSIS),
B_TRANSLATE("Ok!"), NULL, NULL, B_WIDTH_AS_USUAL, B_TRANSLATE("Ok!"), NULL, NULL, B_WIDTH_AS_USUAL,
B_STOP_ALERT); B_STOP_ALERT);
alert->SetShortcut(0, B_ESCAPE); alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go(); alert->Go();
} }
} }
@@ -298,6 +298,8 @@ ProcessController::MessageReceived(BMessage *message)
B_TRANSLATE("Cancel"), B_TRANSLATE("Debug this thread!"), B_TRANSLATE("Cancel"), B_TRANSLATE("Debug this thread!"),
B_TRANSLATE("Kill this thread!"), B_WIDTH_AS_USUAL, B_TRANSLATE("Kill this thread!"), B_WIDTH_AS_USUAL,
B_STOP_ALERT); B_STOP_ALERT);
alert->SetShortcut(0, B_ESCAPE);
#define KILL 2 #define KILL 2
#else #else
snprintf(question, sizeof(question), snprintf(question, sizeof(question),
@@ -306,6 +308,8 @@ ProcessController::MessageReceived(BMessage *message)
alert = new BAlert(B_TRANSLATE("Please confirm"), question, alert = new BAlert(B_TRANSLATE("Please confirm"), question,
B_TRANSLATE("Cancel"), B_TRANSLATE("Kill this thread!"), B_TRANSLATE("Cancel"), B_TRANSLATE("Kill this thread!"),
NULL, B_WIDTH_AS_USUAL, B_STOP_ALERT); NULL, B_WIDTH_AS_USUAL, B_STOP_ALERT);
alert->SetShortcut(0, B_ESCAPE);
#define KILL 1 #define KILL 1
#endif #endif
alert->SetShortcut(0, B_ESCAPE); alert->SetShortcut(0, B_ESCAPE);
@@ -330,7 +334,7 @@ ProcessController::MessageReceived(BMessage *message)
B_TRANSLATE("This thread is already gone"B_UTF8_ELLIPSIS), B_TRANSLATE("This thread is already gone"B_UTF8_ELLIPSIS),
B_TRANSLATE("Ok!"), NULL, NULL, B_TRANSLATE("Ok!"), NULL, NULL,
B_WIDTH_AS_USUAL, B_STOP_ALERT); B_WIDTH_AS_USUAL, B_STOP_ALERT);
alert->SetShortcut(0, B_ESCAPE); alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go(); alert->Go();
} }
} }
@@ -408,7 +412,7 @@ ProcessController::MessageReceived(BMessage *message)
"You can't turn it off!"), "You can't turn it off!"),
B_TRANSLATE("That's no Fun!"), NULL, NULL, B_TRANSLATE("That's no Fun!"), NULL, NULL,
B_WIDTH_AS_USUAL, B_WARNING_ALERT); B_WIDTH_AS_USUAL, B_WARNING_ALERT);
alert->SetShortcut(0, B_ESCAPE); alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go(); alert->Go();
} else } else
_kern_set_cpu_enabled(cpu, !_kern_cpu_enabled(cpu)); _kern_set_cpu_enabled(cpu, !_kern_cpu_enabled(cpu));
@@ -893,6 +897,7 @@ thread_debug_thread(void *arg)
alert = new BAlert("", "The semaphore wasn't released, " alert = new BAlert("", "The semaphore wasn't released, "
"because it wasn't necessary anymore!", "because it wasn't necessary anymore!",
"OK", NULL, NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT); "OK", NULL, NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go(); alert->Go();
} }
} }
+1 -1
View File
@@ -243,7 +243,7 @@ CPUButton::Invoke(BMessage *message)
BAlert *alert = new BAlert(B_TRANSLATE("Info"), BAlert *alert = new BAlert(B_TRANSLATE("Info"),
B_TRANSLATE("You can't disable the last active CPU."), B_TRANSLATE("You can't disable the last active CPU."),
B_TRANSLATE("OK")); B_TRANSLATE("OK"));
alert->SetShortcut(0, B_ESCAPE); alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go(NULL); alert->Go(NULL);
SetValue(!Value()); SetValue(!Value());
} }
+1 -1
View File
@@ -182,7 +182,7 @@ void DeskbarPulseView::Remove() {
str.UnlockBuffer(); str.UnlockBuffer();
BAlert *alert = new BAlert(B_TRANSLATE("Info"), str.String(), BAlert *alert = new BAlert(B_TRANSLATE("Info"), str.String(),
B_TRANSLATE("OK")); B_TRANSLATE("OK"));
alert->SetShortcut(0, B_ESCAPE); alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go(NULL); alert->Go(NULL);
} }
delete deskbar; delete deskbar;
+2 -2
View File
@@ -193,7 +193,7 @@ PulseApp::ShowAbout(bool asApplication)
font.SetSize(18); font.SetSize(18);
font.SetFace(B_BOLD_FACE); font.SetFace(B_BOLD_FACE);
view->SetFontAndColor(0, name.Length(), &font); view->SetFontAndColor(0, name.Length(), &font);
alert->SetShortcut(0, B_ESCAPE); alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
// Use the asynchronous version so we don't block the window's thread // Use the asynchronous version so we don't block the window's thread
alert->Go(NULL); alert->Go(NULL);
} }
@@ -278,7 +278,7 @@ LoadInDeskbar()
message.UnlockBuffer(); message.UnlockBuffer();
BAlert *alert = new BAlert(B_TRANSLATE("Error"), BAlert *alert = new BAlert(B_TRANSLATE("Error"),
message.String(), B_TRANSLATE("OK")); message.String(), B_TRANSLATE("OK"));
alert->SetShortcut(0, B_ESCAPE); alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go(NULL); alert->Go(NULL);
return false; return false;
} }
+1 -1
View File
@@ -130,7 +130,7 @@ void PulseView::ChangeCPUState(BMessage *message) {
BAlert *alert = new BAlert(B_TRANSLATE("Info"), BAlert *alert = new BAlert(B_TRANSLATE("Info"),
B_TRANSLATE("You can't disable the last active CPU."), B_TRANSLATE("You can't disable the last active CPU."),
B_TRANSLATE("OK")); B_TRANSLATE("OK"));
alert->SetShortcut(0, B_ESCAPE); alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go(NULL); alert->Go(NULL);
} }
} }
+3 -2
View File
@@ -250,8 +250,9 @@ BitmapView::MessageReceived(BMessage *msg)
switch (msg->what) switch (msg->what)
{ {
case M_REMOVE_IMAGE: { case M_REMOVE_IMAGE: {
BAlert *alert = new BAlert("Mr. Peeps!", "This cannot be undone. Remove the image?", BAlert *alert = new BAlert("Mr. Peeps!", "This cannot be undone. "
"Remove", "Cancel"); "Remove the image?", "Remove", "Cancel");
alert->SetShortcut(1, B_ESCAPE);
int32 value = alert->Go(); int32 value = alert->Go();
if (value == 0) { if (value == 0) {
SetBitmap(NULL); SetBitmap(NULL);
+4 -1
View File
@@ -34,7 +34,10 @@ bool
ResWindow::QuitRequested(void) ResWindow::QuitRequested(void)
{ {
if (fView->GetSaveStatus() == FILE_DIRTY) { if (fView->GetSaveStatus() == FILE_DIRTY) {
BAlert *alert = new BAlert("ResEdit","Save your changes?","Cancel","Don't Save","Save"); BAlert *alert = new BAlert("ResEdit", "Save your changes?", "Cancel",
"Don't Save", "Save");
alert->SetShortcut(0, B_ESCAPE);
switch (alert->Go()) { switch (alert->Go()) {
case 0: case 0:
return false; return false;
+1
View File
@@ -669,6 +669,7 @@ ScreenshotWindow::_ShowSettings(bool activate)
&rect); &rect);
if (err < B_OK || view == NULL) { if (err < B_OK || view == NULL) {
BAlert *alert = new BAlert(NULL, strerror(err), "OK"); BAlert *alert = new BAlert(NULL, strerror(err), "OK");
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go(); alert->Go();
} else { } else {
if (fSettingsWindow) { if (fSettingsWindow) {
+1
View File
@@ -953,6 +953,7 @@ ShowImageView::SaveToFile(BDirectory* dir, const char* name, BBitmap* bitmap,
snprintf(buffer, sizeof(buffer), B_TRANSLATE("The file '%s' could not " snprintf(buffer, sizeof(buffer), B_TRANSLATE("The file '%s' could not "
"be written."), name); "be written."), name);
BAlert* palert = new BAlert("", buffer, B_TRANSLATE("OK")); BAlert* palert = new BAlert("", buffer, B_TRANSLATE("OK"));
palert->SetFlags(palert->Flags() | B_CLOSE_ON_ESCAPE);
palert->Go(); palert->Go();
} }
+3
View File
@@ -1108,6 +1108,7 @@ ShowImageWindow::_LoadError(const entry_ref& ref)
"LoadAlerts"), "LoadAlerts"),
B_TRANSLATE_CONTEXT("OK", "Alerts"), NULL, NULL, B_TRANSLATE_CONTEXT("OK", "Alerts"), NULL, NULL,
B_WIDTH_AS_USUAL, B_INFO_ALERT); B_WIDTH_AS_USUAL, B_INFO_ALERT);
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go(); alert->Go();
} }
@@ -1216,6 +1217,8 @@ ShowImageWindow::_ClosePrompt()
BAlert* alert = new BAlert(B_TRANSLATE("Close document"), prompt.String(), BAlert* alert = new BAlert(B_TRANSLATE("Close document"), prompt.String(),
B_TRANSLATE("Cancel"), B_TRANSLATE("Close")); B_TRANSLATE("Cancel"), B_TRANSLATE("Close"));
alert->SetShortcut(0, B_ESCAPE);
if (alert->Go() == 0) { if (alert->Go() == 0) {
// Cancel // Cancel
return false; return false;
+15 -8
View File
@@ -1175,7 +1175,9 @@ RecorderWindow::ErrorAlert(const char * action, status_t err)
sprintf(msg, "%s: %s. [%lx]", action, strerror(err), (int32) err); sprintf(msg, "%s: %s. [%lx]", action, strerror(err), (int32) err);
else else
sprintf(msg, "%s.", action); sprintf(msg, "%s.", action);
(new BAlert("", msg, B_TRANSLATE("Stop")))->Go(); BAlert* alert = new BAlert("", msg, B_TRANSLATE("Stop"));
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go();
} }
@@ -1334,15 +1336,20 @@ RecorderWindow::RefsReceived(BMessage *msg)
} }
if (countBad > 0 && countGood == 0) { if (countBad > 0 && countGood == 0) {
(new BAlert(B_TRANSLATE("Nothing to play"), B_TRANSLATE("None of the " BAlert* alert = new BAlert(B_TRANSLATE("Nothing to play"),
"files appear to be audio files"), B_TRANSLATE("OK"), NULL, NULL, B_TRANSLATE("None of the files appear to be audio files"),
B_WIDTH_AS_USUAL, B_STOP_ALERT))->Go(); B_TRANSLATE("OK"), NULL, NULL, B_WIDTH_AS_USUAL, B_STOP_ALERT);
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go();
} else if (countGood > 0) { } else if (countGood > 0) {
if (countBad > 0) if (countBad > 0) {
(new BAlert(B_TRANSLATE("Invalid audio files"), B_TRANSLATE("Some " BAlert* alert = new BAlert(B_TRANSLATE("Invalid audio files"),
"of the files don't appear to be audio files"), B_TRANSLATE("Some of the files don't appear to be audio files"),
B_TRANSLATE("OK"), NULL, NULL, B_WIDTH_AS_USUAL, B_TRANSLATE("OK"), NULL, NULL, B_WIDTH_AS_USUAL,
B_WARNING_ALERT))->Go(); B_WARNING_ALERT);
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go();
}
fSoundList->Select(fSoundList->CountItems() - 1); fSoundList->Select(fSoundList->CountItems() - 1);
} }
} }
+2 -1
View File
@@ -1640,7 +1640,8 @@ StyledEditWindow::_ShowStatistics()
BAlert* alert = new BAlert("Statistics", result, B_TRANSLATE("OK"), NULL, BAlert* alert = new BAlert("Statistics", result, B_TRANSLATE("OK"), NULL,
NULL, B_WIDTH_AS_USUAL, B_EVEN_SPACING, B_INFO_ALERT); NULL, B_WIDTH_AS_USUAL, B_EVEN_SPACING, B_INFO_ALERT);
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
return alert->Go(); return alert->Go();
} }
+10 -4
View File
@@ -411,9 +411,11 @@ SudokuWindow::_MessageDropped(BMessage* message)
strerror(status)); strerror(status));
} }
(new BAlert(B_TRANSLATE("Sudoku request"), BAlert* alert = new BAlert(B_TRANSLATE("Sudoku request"),
buffer, B_TRANSLATE("OK"), NULL, NULL, buffer, B_TRANSLATE("OK"), NULL, NULL,
B_WIDTH_AS_USUAL, B_STOP_ALERT))->Go(); B_WIDTH_AS_USUAL, B_STOP_ALERT);
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go();
} }
} }
@@ -554,11 +556,15 @@ SudokuWindow::MessageReceived(BMessage* message)
} }
case kMsgSudokuSolved: case kMsgSudokuSolved:
(new BAlert(B_TRANSLATE("Sudoku request"), {
BAlert* alert = new BAlert(B_TRANSLATE("Sudoku request"),
B_TRANSLATE("Sudoku solved - congratulations!\n"), B_TRANSLATE("Sudoku solved - congratulations!\n"),
B_TRANSLATE("OK"), NULL, NULL, B_TRANSLATE("OK"), NULL, NULL,
B_WIDTH_AS_USUAL, B_IDEA_ALERT))->Go(); B_WIDTH_AS_USUAL, B_IDEA_ALERT);
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go();
break; break;
}
case B_OBSERVER_NOTICE_CHANGE: case B_OBSERVER_NOTICE_CHANGE:
{ {
+1 -1
View File
@@ -104,7 +104,7 @@ TermApp::ReadyToRun()
B_TRANSLATE("Terminal couldn't start the shell. Sorry."), B_TRANSLATE("Terminal couldn't start the shell. Sorry."),
B_TRANSLATE("OK"), NULL, NULL, B_WIDTH_FROM_LABEL, B_TRANSLATE("OK"), NULL, NULL, B_WIDTH_FROM_LABEL,
B_INFO_ALERT); B_INFO_ALERT);
alert->SetShortcut(0, B_ESCAPE); alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go(NULL); alert->Go(NULL);
PostMessage(B_QUIT_REQUESTED); PostMessage(B_QUIT_REQUESTED);
return; return;
+3 -3
View File
@@ -711,7 +711,7 @@ TermWindow::MessageReceived(BMessage *message)
BAlert* alert = new BAlert(B_TRANSLATE("Find failed"), BAlert* alert = new BAlert(B_TRANSLATE("Find failed"),
errorMsg, B_TRANSLATE("OK"), NULL, NULL, errorMsg, B_TRANSLATE("OK"), NULL, NULL,
B_WIDTH_AS_USUAL, B_WARNING_ALERT); B_WIDTH_AS_USUAL, B_WARNING_ALERT);
alert->SetShortcut(0, B_ESCAPE); alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go(); alert->Go();
fFindPreviousMenuItem->SetEnabled(false); fFindPreviousMenuItem->SetEnabled(false);
@@ -729,7 +729,7 @@ TermWindow::MessageReceived(BMessage *message)
B_TRANSLATE("Text not found."), B_TRANSLATE("Text not found."),
B_TRANSLATE("OK"), NULL, NULL, B_TRANSLATE("OK"), NULL, NULL,
B_WIDTH_AS_USUAL, B_WARNING_ALERT); B_WIDTH_AS_USUAL, B_WARNING_ALERT);
alert->SetShortcut(0, B_ESCAPE); alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go(); alert->Go();
fFindPreviousMenuItem->SetEnabled(false); fFindPreviousMenuItem->SetEnabled(false);
fFindNextMenuItem->SetEnabled(false); fFindNextMenuItem->SetEnabled(false);
@@ -751,7 +751,7 @@ TermWindow::MessageReceived(BMessage *message)
BAlert* alert = new BAlert(B_TRANSLATE("Find failed"), BAlert* alert = new BAlert(B_TRANSLATE("Find failed"),
B_TRANSLATE("Not found."), B_TRANSLATE("OK"), B_TRANSLATE("Not found."), B_TRANSLATE("OK"),
NULL, NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT); NULL, NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
alert->SetShortcut(0, B_ESCAPE); alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go(); alert->Go();
} }
break; break;
+3
View File
@@ -1290,6 +1290,7 @@ GrepWindow::_OnTrimSelection()
text << "\n"; text << "\n";
BAlert* alert = new BAlert(NULL, text.String(), B_TRANSLATE("OK"), NULL, NULL, BAlert* alert = new BAlert(NULL, text.String(), B_TRANSLATE("OK"), NULL, NULL,
B_WIDTH_AS_USUAL, B_WARNING_ALERT); B_WIDTH_AS_USUAL, B_WARNING_ALERT);
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go(NULL); alert->Go(NULL);
return; return;
} }
@@ -1382,6 +1383,7 @@ GrepWindow::_OnSelectInTracker()
B_TRANSLATE("Please select the files you wish to have selected for you in " B_TRANSLATE("Please select the files you wish to have selected for you in "
"Tracker."), "Tracker."),
B_TRANSLATE("OK"), NULL, NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT); B_TRANSLATE("OK"), NULL, NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go(NULL); alert->Go(NULL);
return; return;
} }
@@ -1446,6 +1448,7 @@ GrepWindow::_OnSelectInTracker()
str1.ReplaceFirst("%APP_NAME",APP_NAME); str1.ReplaceFirst("%APP_NAME",APP_NAME);
BAlert* alert = new BAlert(NULL, str1.String(), B_TRANSLATE("OK"), BAlert* alert = new BAlert(NULL, str1.String(), B_TRANSLATE("OK"),
NULL, NULL, B_WIDTH_AS_USUAL, B_STOP_ALERT); NULL, NULL, B_WIDTH_AS_USUAL, B_STOP_ALERT);
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go(NULL); alert->Go(NULL);
goto out; goto out;
} }
+6 -2
View File
@@ -375,7 +375,9 @@ MainWin::SelectInterface(int i)
BString s; BString s;
s << B_TRANSLATE("Error, interface is busy:\n\n"); s << B_TRANSLATE("Error, interface is busy:\n\n");
s << gDeviceRoster->DeviceName(i); s << gDeviceRoster->DeviceName(i);
(new BAlert("error", s.String(), B_TRANSLATE("OK")))->Go(); BAlert* alert = new BAlert("error", s.String(), B_TRANSLATE("OK"));
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go();
return; return;
} }
@@ -384,7 +386,9 @@ MainWin::SelectInterface(int i)
BString s; BString s;
s << B_TRANSLATE("Error, connecting to interface failed:\n\n"); s << B_TRANSLATE("Error, connecting to interface failed:\n\n");
s << gDeviceRoster->DeviceName(i); s << gDeviceRoster->DeviceName(i);
(new BAlert("error", s.String(), B_TRANSLATE("OK")))->Go(); BAlert* alert = new BAlert("error", s.String(), B_TRANSLATE("OK"));
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go();
} }
done: done:

Some files were not shown because too many files have changed in this diff Show More