Set B_ESCAPE as shortcut for all BAlerts. Fixes #6850 and #6858.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39563 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2010-11-21 19:52:16 +00:00
parent 105093fddb
commit dd2cdb3a75
3 changed files with 12 additions and 5 deletions

View File

@ -101,10 +101,12 @@ TermApp::ReadyToRun()
// failed spawn, print stdout and open alert panel
// TODO: This alert does never show up.
if (status < B_OK) {
(new BAlert("alert",
BAlert* alert = new BAlert("alert",
B_TRANSLATE("Terminal couldn't start the shell. Sorry."),
B_TRANSLATE("OK"), NULL, NULL, B_WIDTH_FROM_LABEL,
B_INFO_ALERT))->Go(NULL);
B_INFO_ALERT);
alert->SetShortcut(0, B_ESCAPE);
alert->Go(NULL);
PostMessage(B_QUIT_REQUESTED);
return;
}

View File

@ -3052,6 +3052,7 @@ TermView::AboutRequested()
"updated by Kian Duffy and others\n\n"
"Copyright " B_UTF8_COPYRIGHT "2003-2009, Haiku.\n"),
B_TRANSLATE("OK"));
alert->SetShortcut(0, B_ESCAPE);
if (alert != NULL)
alert->Go();
}

View File

@ -314,6 +314,7 @@ TermWindow::_CanClose(int32 index)
BAlert* alert = new BAlert(B_TRANSLATE("Really close?"),
alertMessage, B_TRANSLATE("Close"), B_TRANSLATE("Cancel"), NULL,
B_WIDTH_AS_USUAL, B_WARNING_ALERT);
alert->SetShortcut(1, B_ESCAPE);
int32 result = alert->Go();
if (result == 1)
return false;
@ -656,6 +657,7 @@ TermWindow::MessageReceived(BMessage *message)
BAlert* alert = new BAlert(B_TRANSLATE("Find failed"),
errorMsg, B_TRANSLATE("OK"), NULL, NULL,
B_WIDTH_AS_USUAL, B_WARNING_ALERT);
alert->SetShortcut(0, B_ESCAPE);
alert->Go();
fFindPreviousMenuItem->SetEnabled(false);
@ -981,9 +983,11 @@ TermWindow::_DoPageSetup()
void
TermWindow::_DoPrint()
{
if (!fPrintSettings || (_DoPageSetup() != B_OK)) {
(new BAlert(B_TRANSLATE("Cancel"), B_TRANSLATE("Print cancelled."),
B_TRANSLATE("OK")))->Go();
if (!fPrintSettings || _DoPageSetup() != B_OK) {
BAlert* alert = new BAlert(B_TRANSLATE("Cancel"),
B_TRANSLATE("Print cancelled."), B_TRANSLATE("OK"));
alert->SetShortcut(0, B_ESCAPE);
alert->Go();
return;
}