Ticket #4592: 0001-Close-alerts-with-ESCAPE-key.patch

File 0001-Close-alerts-with-ESCAPE-key.patch, 177.1 KB (added by humdinger, 9 years ago)

Patch to close BAlerts with ESC key.

  • src/add-ons/input_server/filters/shortcut_catcher/CommandActuators.cpp

    From 1e3cb62030bb102a5f1c3b779fea157806f66b1f Mon Sep 17 00:00:00 2001
    From: Humdinger <humdingerb@gmail.com>
    Date: Sun, 5 Aug 2012 16:01:51 +0200
    Subject: 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.
    ---
     .../filters/shortcut_catcher/CommandActuators.cpp  |   15 +++-
     .../input_server/methods/canna/CannaLooper.cpp     |    1 +
     .../methods/pen/PenInputServerMethod.cpp           |    1 +
     .../methods/t9/DictionaryInputServerMethod.cpp     |    1 +
     .../methods/t9/T9InputServerMethod.cpp             |    1 +
     .../inbound_filters/notifier/filter.cpp            |    1 +
     .../spam_filter/SpamFilterConfig.cpp               |    8 +-
     .../print/drivers/canon_lips/lips3/Lips3.cpp       |    2 +
     .../print/drivers/canon_lips/lips4/Lips4.cpp       |    2 +
     src/add-ons/print/drivers/gutenprint/GPDriver.cpp  |    1 +
     src/add-ons/print/drivers/pcl5/PCL5.cpp            |    1 +
     src/add-ons/print/drivers/pcl6/PCL6.cpp            |    1 +
     .../print/drivers/pdf/source/MessagePrinter.cpp    |   20 +++--
     .../print/drivers/pdf/source/PrinterDriver.cpp     |    1 +
     src/add-ons/print/drivers/postscript/PS.cpp        |    1 +
     .../hp_jetdirect/HPJetDirectTransport.cpp          |    2 +
     .../print/transports/hp_jetdirect/SetupWindow.cpp  |    6 +-
     src/add-ons/print/transports/ipp/IppSetupDlg.cpp   |    1 +
     src/add-ons/print/transports/ipp/IppTransport.cpp  |    1 +
     src/add-ons/print/transports/lpr/LprSetupDlg.cpp   |    2 +
     src/add-ons/print/transports/lpr/LprTransport.cpp  |    1 +
     src/add-ons/tracker/iconvader/IconVader.cpp        |    6 +-
     .../tracker/opentargetfolder/opentargetfolder.cpp  |   12 ++-
     src/add-ons/translators/ppm/PPMMain.cpp            |    1 +
     .../translators/shared/TranslatorWindow.cpp        |    1 +
     src/apps/autoraise/AutoRaiseApp.cpp                |    1 +
     src/apps/autoraise/AutoRaiseIcon.cpp               |    1 +
     src/apps/bootmanager/BootManagerController.cpp     |    1 +
     src/apps/bsnow/SnowView.cpp                        |    2 +-
     src/apps/cdplayer/CDDBSupport.cpp                  |    1 +
     src/apps/cdplayer/CDPlayer.cpp                     |    1 +
     src/apps/clock/cl_view.cpp                         |    2 +-
     src/apps/codycam/CodyCam.cpp                       |    1 +
     src/apps/cortex/AddOnHost/AddOnHostApp.cpp         |    8 +-
     .../cortex/MediaRoutingView/MediaRoutingView.cpp   |    1 +
     src/apps/cortex/ParameterView/ParameterWindow.cpp  |    1 +
     src/apps/cortex/RouteApp/RouteWindow.cpp           |    7 +-
     .../cortex/addons/common/MediaNodeControlApp.cpp   |   12 ++-
     src/apps/diskprobe/AttributeWindow.cpp             |    8 +-
     src/apps/diskprobe/DiskProbe.cpp                   |    6 +-
     src/apps/diskprobe/ProbeView.cpp                   |   21 +++--
     src/apps/drivesetup/MainWindow.cpp                 |    5 ++
     src/apps/expander/ExpanderWindow.cpp               |   19 ++++-
     src/apps/glteapot/ObjectView.cpp                   |    2 +
     src/apps/icon-o-matic/MainWindow.cpp               |    5 +-
     src/apps/icon-o-matic/gui/SavePanel.cpp            |    1 +
     src/apps/icon-o-matic/import_export/Exporter.cpp   |    1 +
     .../icon-o-matic/import_export/svg/SVGExporter.cpp |    1 +
     .../icon-o-matic/import_export/svg/SVGImporter.cpp |    1 +
     src/apps/installedpackages/UninstallView.cpp       |    2 +-
     src/apps/installer/InstallerApp.cpp                |    1 +
     src/apps/installer/InstallerWindow.cpp             |   73 ++++++++++-------
     src/apps/installer/WorkerThread.cpp                |   57 ++++++++------
     src/apps/launchbox/MainWindow.cpp                  |    2 +
     src/apps/login/LoginApp.cpp                        |   19 +++--
     src/apps/mail/Content.cpp                          |   35 +++++----
     src/apps/mail/Enclosures.cpp                       |   12 ++-
     src/apps/mail/MailWindow.cpp                       |   52 ++++++++-----
     src/apps/mail/Signature.cpp                        |   24 ++++--
     src/apps/mediaconverter/MediaConverterApp.cpp      |    2 +-
     src/apps/mediaconverter/MediaConverterWindow.cpp   |    6 +-
     src/apps/mediaconverter/MediaFileInfoView.cpp      |    1 +
     src/apps/mediaplayer/MainApp.cpp                   |    2 +
     src/apps/mediaplayer/MainWin.cpp                   |   12 ++-
     src/apps/mediaplayer/playlist/PlaylistWindow.cpp   |    1 +
     .../mediaplayer/playlist/RemovePLItemsCommand.cpp  |    8 +-
     src/apps/midiplayer/MidiPlayerApp.cpp              |   12 +--
     src/apps/midiplayer/MidiPlayerWindow.cpp           |    6 +-
     src/apps/networkstatus/NetworkStatus.cpp           |    1 -
     src/apps/networkstatus/NetworkStatusView.cpp       |    4 +
     src/apps/overlayimage/OverlayView.cpp              |    5 +-
     src/apps/packageinstaller/PackageInfo.cpp          |    1 +
     src/apps/packageinstaller/PackageInstall.cpp       |    1 +
     src/apps/packageinstaller/PackageView.cpp          |    7 +-
     src/apps/pairs/PairsView.cpp                       |    2 +-
     src/apps/people/PeopleApp.cpp                      |    1 +
     src/apps/people/PersonWindow.cpp                   |   11 ++-
     src/apps/people/PictureView.cpp                    |    1 +
     src/apps/poorman/PoorManWindow.cpp                 |    2 +
     src/apps/powerstatus/PowerStatus.cpp               |    1 -
     src/apps/powerstatus/PowerStatusView.cpp           |    1 +
     src/apps/processcontroller/PCWorld.cpp             |    3 +-
     src/apps/processcontroller/Preferences.cpp         |    3 +-
     src/apps/processcontroller/ProcessController.cpp   |   11 ++-
     src/apps/pulse/CPUButton.cpp                       |    2 +-
     src/apps/pulse/DeskbarPulseView.cpp                |    2 +-
     src/apps/pulse/PulseApp.cpp                        |    4 +-
     src/apps/pulse/PulseView.cpp                       |    2 +-
     src/apps/resedit/BitmapView.cpp                    |    5 +-
     src/apps/resedit/ResWindow.cpp                     |    5 +-
     src/apps/screenshot/ScreenshotWindow.cpp           |    1 +
     src/apps/showimage/ShowImageView.cpp               |    1 +
     src/apps/showimage/ShowImageWindow.cpp             |    3 +
     src/apps/soundrecorder/RecorderWindow.cpp          |   23 ++++--
     src/apps/stylededit/StyledEditWindow.cpp           |    3 +-
     src/apps/sudoku/SudokuWindow.cpp                   |   14 +++-
     src/apps/terminal/TermApp.cpp                      |    2 +-
     src/apps/terminal/TermWindow.cpp                   |    6 +-
     src/apps/text_search/GrepWindow.cpp                |    3 +
     src/apps/tv/MainWin.cpp                            |    8 +-
     src/apps/webpositive/BrowserApp.cpp                |    1 +
     src/apps/webpositive/BrowserWindow.cpp             |    8 ++
     src/apps/webpositive/DownloadProgressView.cpp      |    1 +
     src/apps/webpositive/DownloadWindow.cpp            |    1 +
     src/apps/webwatch/WatchView.cpp                    |    4 +-
     src/apps/workspaces/Workspaces.cpp                 |    1 +
     src/bin/checkitout.cpp                             |    1 +
     src/bin/desklink/MediaReplicant.cpp                |    6 +-
     src/bin/mail_utils/spamdbm.cpp                     |   10 ++-
     src/bin/screenmode/screenmode.cpp                  |    1 +
     src/bin/urlwrapper.cpp                             |    1 +
     src/kits/app/Application.cpp                       |    1 +
     src/kits/interface/Dragger.cpp                     |    6 +-
     src/kits/interface/PrintJob.cpp                    |    2 +
     src/kits/interface/ZombieReplicantView.cpp         |    1 +
     src/kits/shared/AboutWindow.cpp                    |    1 +
     src/kits/tracker/AutoMounterSettings.cpp           |    6 +-
     src/kits/tracker/ContainerWindow.cpp               |    4 +-
     src/kits/tracker/FSClipboard.cpp                   |    4 +-
     src/kits/tracker/FSUtils.cpp                       |   82 ++++++++++++--------
     src/kits/tracker/InfoWindow.cpp                    |   15 ++--
     src/kits/tracker/OpenWithWindow.cpp                |    6 +-
     src/kits/tracker/PoseView.cpp                      |   20 ++---
     src/kits/tracker/Tracker.cpp                       |    2 +-
     src/kits/tracker/TrackerInitialState.cpp           |    6 +-
     src/kits/tracker/WidgetAttributeText.cpp           |    6 +-
     src/libs/print/libprint/BlockingWindow.cpp         |    1 +
     src/libs/print/libprint/GraphicsDriver.cpp         |    1 +
     src/preferences/appearance/CurView.cpp             |    3 +
     src/preferences/appearance/DecorSettingsView.cpp   |    2 +-
     src/preferences/bluetooth/BluetoothMain.cpp        |   16 ++--
     src/preferences/cpufrequency/StatusView.cpp        |    6 +-
     .../datatranslations/DataTranslations.cpp          |    5 +-
     .../datatranslations/DataTranslationsWindow.cpp    |    1 +
     src/preferences/dun/DUNWindow.cpp                  |    8 +-
     .../filetypes/ApplicationTypeWindow.cpp            |    2 +
     src/preferences/filetypes/FileTypes.cpp            |   12 ++-
     src/preferences/filetypes/FileTypesWindow.cpp      |    2 +
     src/preferences/filetypes/PreferredAppMenu.cpp     |    3 +-
     src/preferences/fonts/main.cpp                     |    3 +-
     src/preferences/joysticks/JoyWin.cpp               |    6 +-
     src/preferences/keyboard/Keyboard.cpp              |    7 +-
     src/preferences/locale/LocaleWindow.cpp            |    1 +
     src/preferences/mail/AutoConfigWindow.cpp          |    1 +
     src/preferences/mail/ConfigWindow.cpp              |    6 +-
     src/preferences/mail/FilterConfigView.cpp          |    7 +-
     src/preferences/media/MediaWindow.cpp              |    4 +-
     src/preferences/mouse/Mouse.cpp                    |    6 +-
     src/preferences/network/EthernetSettingsView.cpp   |   10 ++-
     src/preferences/network_old/BackupWindow.cpp       |    1 +
     src/preferences/network_old/LoginInfo.cpp          |    6 +-
     src/preferences/network_old/NetworkWindow.cpp      |   10 ++-
     src/preferences/notifications/DisplayView.cpp      |    2 +
     src/preferences/notifications/GeneralView.cpp      |    8 ++
     .../notifications/NotificationsView.cpp            |    1 +
     src/preferences/screen/ScreenApplication.cpp       |    2 +-
     src/preferences/screen/ScreenWindow.cpp            |    8 +-
     src/preferences/screensaver/PasswordWindow.cpp     |    1 +
     src/preferences/shortcuts/ShortcutsWindow.cpp      |   26 ++++---
     src/preferences/sounds/HApp.cpp                    |    1 +
     src/preferences/sounds/HEventList.cpp              |    1 +
     src/preferences/sounds/HWindow.cpp                 |    1 +
     src/preferences/time/NetworkTimeView.cpp           |    6 +-
     src/preferences/time/Time.cpp                      |    1 +
     src/preferences/touchpad/TouchpadPrefView.cpp      |    1 +
     src/preferences/virtualmemory/SettingsWindow.cpp   |   12 ++-
     src/preferences/virtualmemory/VirtualMemory.cpp    |    1 +
     src/servers/bluetooth/DeskbarReplicant.cpp         |    1 +
     src/servers/debug/DebugServer.cpp                  |    1 +
     src/servers/input/MethodReplicant.cpp              |    8 +-
     src/servers/mail/MailDaemon.cpp                    |    1 +
     src/servers/media/media_server.cpp                 |    6 +-
     src/servers/midi/MidiServerApp.cpp                 |    8 +-
     src/servers/mount/AutoMounter.cpp                  |   12 ++-
     src/servers/net/NetServer.cpp                      |    1 +
     src/servers/notification/NotificationWindow.cpp    |    3 +
     src/servers/print/ConfigWindow.cpp                 |    1 +
     src/servers/print/PrintServerApp.R5.cpp            |    2 +
     src/servers/registrar/ShutdownProcess.cpp          |    3 +-
     src/servers/syslog_daemon/SyslogDaemon.cpp         |    1 +
     180 files changed, 761 insertions(+), 351 deletions(-)
    
    diff --git a/src/add-ons/input_server/filters/shortcut_catcher/CommandActuators.cpp b/src/add-ons/input_server/filters/shortcut_catcher/CommandActuators.cpp
    index 6f72dfc..b265790 100644
    a b LaunchCommandActuator::KeyEventAsync(const BMessage* keyMsg,  
    195195            str << " Please check your Shortcuts settings.";
    196196        }
    197197
    198         if (fArgc < 1 || err != B_NO_ERROR)
    199             (new BAlert(str1.String(), str.String(), "OK"))->Go(NULL);
     198        if (fArgc < 1 || err != B_NO_ERROR) {
     199            BAlert* alert = new BAlert(str1.String(), str.String(), "OK");
     200            alert->SetFlags(B_CLOSE_ON_ESCAPE);
     201            alert->Go(NULL);
     202        }
    200203    }
    201204}
    202205
    MIMEHandlerCommandActuator::KeyEventAsync(const BMessage* keyMsg,  
    10151018            str << "Can't launch handler for ";
    10161019            str << ", no such MIME type exists. Please check your Shortcuts";
    10171020            str << " settings.";
    1018             (new BAlert(str1.String(), str.String(), "OK"))->Go(NULL);
     1021            BAlert* alert = new BAlert(str1.String(), str.String(), "OK");
     1022            alert->SetFlags(B_CLOSE_ON_ESCAPE);
     1023            alert->Go(NULL);
    10191024        }
    10201025    }
    10211026}
    SendMessageCommandActuator::KeyEventAsync(const BMessage* keyMsg,  
    16931698        BString str1("Shortcuts SendMessage error");
    16941699        if (fSignature.Length() == 0) {
    16951700            str << "SendMessage: Target application signature not specified";
    1696             (new BAlert(str1.String(), str.String(), "OK"))->Go(NULL);
     1701            BAlert* alert = new BAlert(str1.String(), str.String(), "OK");
     1702            alert->SetFlags(B_CLOSE_ON_ESCAPE);
     1703            alert->Go(NULL);
    16971704        } else {
    16981705            status_t error = B_OK;
    16991706            BMessenger msngr(fSignature.String(), -1, &error);
  • src/add-ons/input_server/methods/canna/CannaLooper.cpp

    diff --git a/src/add-ons/input_server/methods/canna/CannaLooper.cpp b/src/add-ons/input_server/methods/canna/CannaLooper.cpp
    index db7fc80..8b5226a 100644
    a b CannaLooper::MessageReceived(BMessage* msg)  
    178178                "  Copyright 1992 NEC Corporation, Tokyo, Japan\n"
    179179                "  Special thanks to T.Murai for porting\n",
    180180                "OK");
     181            panel->SetFlags(B_CLOSE_ON_ESCAPE);
    181182            panel->Go();
    182183            break;
    183184        }
  • src/add-ons/input_server/methods/pen/PenInputServerMethod.cpp

    diff --git a/src/add-ons/input_server/methods/pen/PenInputServerMethod.cpp b/src/add-ons/input_server/methods/pen/PenInputServerMethod.cpp
    index d47b21c..656cc97 100644
    a b PenInputServerMethod::PenInputServerMethod()  
    5353    //fDebugFile.SetTo("/tmp/PenInputMethodMessages.txt", B_READ_WRITE|B_CREATE_FILE);
    5454    fDebugAlert = new BAlert("PenInput Debug", "Plip                                   \n\n\n\n\n\n\n\n\n\n\n\n\n", "OK");
    5555    fDebugAlert->SetLook(B_TITLED_WINDOW_LOOK);
     56    fDebugAlert->SetFlags(B_CLOSE_ON_ESCAPE);
    5657    fDebugAlert->TextView()->MakeSelectable();
    5758    fDebugAlert->TextView()->SelectAll();
    5859    fDebugAlert->TextView()->Delete();
  • src/add-ons/input_server/methods/t9/DictionaryInputServerMethod.cpp

    diff --git a/src/add-ons/input_server/methods/t9/DictionaryInputServerMethod.cpp b/src/add-ons/input_server/methods/t9/DictionaryInputServerMethod.cpp
    index f6a75ee..bfc3fd2 100644
    a b void T9InputServerMethod::MessageReceived(BMessage *message)  
    178178      s << " - ";
    179179      s << (long) fDeskbarMenu->ItemAt(v);
    180180      BAlert *a = new BAlert("Plop", s.String(), "OK");
     181      a->SetFlags(B_CLOSE_ON_ESCAPE);
    181182      a->Go(NULL);
    182183      }*/
    183184    break;
  • src/add-ons/input_server/methods/t9/T9InputServerMethod.cpp

    diff --git a/src/add-ons/input_server/methods/t9/T9InputServerMethod.cpp b/src/add-ons/input_server/methods/t9/T9InputServerMethod.cpp
    index 0b10292..a402bb1 100644
    a b void T9InputServerMethod::MessageReceived(BMessage *message)  
    179179      s << " - ";
    180180      s << (long) fDeskbarMenu->ItemAt(v);
    181181      BAlert *a = new BAlert("Plop", s.String(), "OK");
     182      a->SetFlags(B_CLOSE_ON_ESCAPE);
    182183      a->Go(NULL);
    183184      }*/
    184185    break;
  • src/add-ons/mail_daemon/inbound_filters/notifier/filter.cpp

    diff --git a/src/add-ons/mail_daemon/inbound_filters/notifier/filter.cpp b/src/add-ons/mail_daemon/inbound_filters/notifier/filter.cpp
    index 4e33116..9f83e6d 100644
    a b NotifyFilter::MailboxSynced(status_t status)  
    7979
    8080        BAlert *alert = new BAlert(B_TRANSLATE("New messages"), text.String(),
    8181            B_TRANSLATE("OK"), NULL, NULL, B_WIDTH_AS_USUAL);
     82        alert->SetFlags(B_CLOSE_ON_ESCAPE);
    8283        alert->SetFeel(B_NORMAL_WINDOW_FEEL);
    8384        alert->Go(NULL);
    8485    }
  • src/add-ons/mail_daemon/inbound_filters/spam_filter/SpamFilterConfig.cpp

    diff --git a/src/add-ons/mail_daemon/inbound_filters/spam_filter/SpamFilterConfig.cpp b/src/add-ons/mail_daemon/inbound_filters/spam_filter/SpamFilterConfig.cpp
    index 253134d..2c71d91 100644
    a b AGMSBayesianSpamFilterConfig::ShowSpamServerConfigurationWindow () {  
    421421    return; // Successful.
    422422
    423423ErrorExit:
    424     (new BAlert ("SpamFilterConfig Error", B_TRANSLATE("Sorry, unable to "
    425         "launch the spamdbm program to let you edit the server settings."),
    426         B_TRANSLATE("Close")))->Go ();
     424    BAlert* alert = new BAlert ("SpamFilterConfig Error", B_TRANSLATE("Sorry, "
     425        "unable to launch the spamdbm program to let you edit the server "
     426        "settings."), B_TRANSLATE("Close"));
     427    alert->SetFlags(B_CLOSE_ON_ESCAPE);
     428    alert->Go ();
    427429    return;
    428430}
    429431
  • src/add-ons/print/drivers/canon_lips/lips3/Lips3.cpp

    diff --git a/src/add-ons/print/drivers/canon_lips/lips3/Lips3.cpp b/src/add-ons/print/drivers/canon_lips/lips3/Lips3.cpp
    index 5195c53..cf73c7b 100644
    a b LIPS3Driver::NextBand(BBitmap* bitmap, BPoint* offset)  
    190190            } else if (compressedSize > out_size) {
    191191                BAlert* alert = new BAlert("memory overrun!!!", "warning",
    192192                    "OK");
     193                alert->SetFlags(B_CLOSE_ON_ESCAPE);
    193194                alert->Go();
    194195                return false;
    195196            } else {
    LIPS3Driver::NextBand(BBitmap* bitmap, BPoint* offset)  
    224225    }
    225226    catch (TransportException& err) {
    226227        BAlert* alert = new BAlert("", err.What(), "OK");
     228        alert->SetFlags(B_CLOSE_ON_ESCAPE);
    227229        alert->Go();
    228230        return false;
    229231    }
  • src/add-ons/print/drivers/canon_lips/lips4/Lips4.cpp

    diff --git a/src/add-ons/print/drivers/canon_lips/lips4/Lips4.cpp b/src/add-ons/print/drivers/canon_lips/lips4/Lips4.cpp
    index faa1d54..5fe36c7 100644
    a b LIPS4Driver::NextBand(BBitmap* bitmap, BPoint* offset)  
    200200                buffer = out_buffer;
    201201            } else if (compressed_size > out_size) {
    202202                BAlert* alert = new BAlert("memory overrun!!!", "warning", "OK");
     203                alert->SetFlags(B_CLOSE_ON_ESCAPE);
    203204                alert->Go();
    204205                return false;
    205206            } else {
    LIPS4Driver::NextBand(BBitmap* bitmap, BPoint* offset)  
    234235    }
    235236    catch (TransportException& err) {
    236237        BAlert* alert = new BAlert("", err.What(), "OK");
     238        alert->SetFlags(B_CLOSE_ON_ESCAPE);
    237239        alert->Go();
    238240        return false;
    239241    }
  • src/add-ons/print/drivers/gutenprint/GPDriver.cpp

    diff --git a/src/add-ons/print/drivers/gutenprint/GPDriver.cpp b/src/add-ons/print/drivers/gutenprint/GPDriver.cpp
    index 434467a..a89f89e 100644
    a b GPDriver::ShowError(const char* message)  
    308308    text << "\n";
    309309    text << message;
    310310    BAlert* alert = new BAlert("", text.String(), "OK");
     311    alert->SetFlags(B_CLOSE_ON_ESCAPE);
    311312    alert->Go();
    312313}
  • src/add-ons/print/drivers/pcl5/PCL5.cpp

    diff --git a/src/add-ons/print/drivers/pcl5/PCL5.cpp b/src/add-ons/print/drivers/pcl5/PCL5.cpp
    index e009476..7bcd14c 100644
    a b PCL5Driver::NextBand(BBitmap* bitmap, BPoint* offset)  
    213213    }
    214214    catch (TransportException& err) {
    215215        BAlert* alert = new BAlert("", err.What(), "OK");
     216        alert->SetFlags(B_CLOSE_ON_ESCAPE);
    216217        alert->Go();
    217218        return false;
    218219    }
  • src/add-ons/print/drivers/pcl6/PCL6.cpp

    diff --git a/src/add-ons/print/drivers/pcl6/PCL6.cpp b/src/add-ons/print/drivers/pcl6/PCL6.cpp
    index ec951ec..b1727a5 100644
    a b PCL6Driver::NextBand(BBitmap* bitmap, BPoint* offset)  
    176176    }
    177177    catch (TransportException& err) {
    178178        BAlert* alert = new BAlert("", err.What(), "OK");
     179        alert->SetFlags(B_CLOSE_ON_ESCAPE);
    179180        alert->Go();
    180181        return false;
    181182    }
  • src/add-ons/print/drivers/pdf/source/MessagePrinter.cpp

    diff --git a/src/add-ons/print/drivers/pdf/source/MessagePrinter.cpp b/src/add-ons/print/drivers/pdf/source/MessagePrinter.cpp
    index 2e9e69a..b45055b 100644
    a b status_t MessagePrinter::Print(BMessage* msg)  
    5353    // open a file to print message on the desktop
    5454    status = find_directory(B_DESKTOP_DIRECTORY, &settingsPath);
    5555    if (status != B_OK) {
    56         (new BAlert("","find directory error", "Doh!"))->Go();
     56        BAlert* alert = new BAlert("","Find directory error", "Doh!");
     57        alert->SetFlags(B_CLOSE_ON_ESCAPE);
     58        alert->Go();
    5759        return status;
    5860    }
    5961
    6062    settingsPath.Append(msgFileName);
    6163    status = file.SetTo(settingsPath.Path(), B_WRITE_ONLY | B_CREATE_FILE);
    6264    if (status != B_OK) {
    63         (new BAlert("","file write error", "Doh!"))->Go();
     65        BAlert* alert = new BAlert("","File write error", "Doh!");
     66        alert->SetFlags(B_CLOSE_ON_ESCAPE);
     67        alert->Go();
    6468        return status;
    6569    }   
    6670   
    status_t MessagePrinter::Print(BMessage* msg)  
    7377        // count
    7478        out << i;
    7579        if (file.Write(out.String(), out.Length()) < 0) {
    76             (new BAlert("","count write error", "Doh!"))->Go();
     80            BAlert* alert = new BAlert("","Count write error", "Doh!");
     81            alert->SetFlags(B_CLOSE_ON_ESCAPE);
     82            alert->Go();
    7783            return B_ERROR;
    7884        }   
    7985        // name
    8086        out = " ";
    8187        out << name;
    8288        if (file.Write(out.String(), out.Length()) < 0) {
    83             (new BAlert("","name write error", "Doh!"))->Go();
     89            BAlert* alert = new BAlert("","Name write error", "Doh!");
     90            alert->SetFlags(B_CLOSE_ON_ESCAPE);
     91            alert->Go();
    8492            return B_ERROR;
    8593        }   
    8694       
    status_t MessagePrinter::Print(BMessage* msg)  
    164172                break;
    165173        }
    166174        if (file.Write(out.String(), out.Length()) < 0) {
    167             (new BAlert("","value write error", "Doh!"))->Go();
     175            BAlert* alert = new BAlert("","Value write error", "Doh!");
     176            alert->SetFlags(B_CLOSE_ON_ESCAPE);
     177            alert->Go();
    168178            return B_ERROR;
    169179        }   
    170180    }
  • src/add-ons/print/drivers/pdf/source/PrinterDriver.cpp

    diff --git a/src/add-ons/print/drivers/pdf/source/PrinterDriver.cpp b/src/add-ons/print/drivers/pdf/source/PrinterDriver.cpp
    index d00d207..ee7c476 100644
    a b PrinterDriver::PrintPage(int32 pageNumber, int32 pageCount)  
    203203
    204204    sprintf(text, "Faking print of page %ld/%ld...", pageNumber, pageCount);
    205205    BAlert *alert = new BAlert("PrinterDriver::PrintPage()", text, "Hmm?");
     206    alert->SetFlags(B_CLOSE_ON_ESCAPE);
    206207    alert->Go();
    207208    return B_OK;
    208209}
  • src/add-ons/print/drivers/postscript/PS.cpp

    diff --git a/src/add-ons/print/drivers/postscript/PS.cpp b/src/add-ons/print/drivers/postscript/PS.cpp
    index fd518e7..f6ac112 100644
    a b PSDriver::NextBand(BBitmap* bitmap, BPoint* offset)  
    336336    }
    337337    catch (TransportException& err) {
    338338        BAlert* alert = new BAlert("", err.What(), "OK");
     339        alert->SetFlags(B_CLOSE_ON_ESCAPE);
    339340        alert->Go();
    340341        return false;
    341342    }
  • src/add-ons/print/transports/hp_jetdirect/HPJetDirectTransport.cpp

    diff --git a/src/add-ons/print/transports/hp_jetdirect/HPJetDirectTransport.cpp b/src/add-ons/print/transports/hp_jetdirect/HPJetDirectTransport.cpp
    index 42b4a35..e15cedd 100644
    a b HPJetDirectPort::HPJetDirectPort(BDirectory* printer, BMessage *msg)  
    5555    fEndpoint = new BNetEndpoint(SOCK_STREAM);
    5656    if ((fReady = fEndpoint->InitCheck()) != B_OK) {
    5757        BAlert *alert = new BAlert("", "Fail to create the NetEndpoint!", "OK");
     58        alert->SetFlags(B_CLOSE_ON_ESCAPE);
    5859        alert->Go();
    5960        return;
    6061    }
    HPJetDirectPort::HPJetDirectPort(BDirectory* printer, BMessage *msg)  
    6667    } else {
    6768        BAlert *alert = new BAlert("",
    6869            "Can't connect to HP JetDirect printer port!", "OK");
     70        alert->SetFlags(B_CLOSE_ON_ESCAPE);
    6971        alert->Go();
    7072        fReady = B_ERROR;
    7173    }
  • src/add-ons/print/transports/hp_jetdirect/SetupWindow.cpp

    diff --git a/src/add-ons/print/transports/hp_jetdirect/SetupWindow.cpp b/src/add-ons/print/transports/hp_jetdirect/SetupWindow.cpp
    index 099f37d..5f7bfda 100644
    a b SetupView::CheckSetup()  
    135135
    136136            if (ep->Connect(fServerAddress->Text(), port) != B_OK) {
    137137                BString text;
    138                 text << "Fail to connect to " << fServerAddress->Text() << ":" << (int) port << "!";
     138                text << "Failed to connect to " << fServerAddress->Text() << ":" << (int) port << "!";
    139139                BAlert* alert = new BAlert("", text.String(), "OK");
     140                alert->SetFlags(B_CLOSE_ON_ESCAPE);
    140141                alert->Go();
    141142                return false;
    142143            };
    SetupView::CheckSetup()  
    149150        };
    150151    };
    151152
    152     BAlert* alert = new BAlert("", "please input parameters.", "OK");
     153    BAlert* alert = new BAlert("", "Please input parameters.", "OK");
     154    alert->SetFlags(B_CLOSE_ON_ESCAPE);
    153155    alert->Go();
    154156    return false;
    155157}
  • src/add-ons/print/transports/ipp/IppSetupDlg.cpp

    diff --git a/src/add-ons/print/transports/ipp/IppSetupDlg.cpp b/src/add-ons/print/transports/ipp/IppSetupDlg.cpp
    index ad2cfd5..152ae32 100644
    a b bool IppSetupView::UpdateViewData()  
    141141    }
    142142
    143143    BAlert *alert = new BAlert("", error_msg.c_str(), "OK");
     144    alert->SetFlags(B_CLOSE_ON_ESCAPE);
    144145    alert->Go();
    145146    return false;
    146147}
  • src/add-ons/print/transports/ipp/IppTransport.cpp

    diff --git a/src/add-ons/print/transports/ipp/IppTransport.cpp b/src/add-ons/print/transports/ipp/IppTransport.cpp
    index 1c4f6a9..0c35895 100644
    a b IppTransport::~IppTransport()  
    129129
    130130    if (__error) {
    131131        BAlert *alert = new BAlert("", error_msg.c_str(), "OK");
     132        alert->SetFlags(B_CLOSE_ON_ESCAPE);
    132133        alert->Go();
    133134    }
    134135}
  • src/add-ons/print/transports/lpr/LprSetupDlg.cpp

    diff --git a/src/add-ons/print/transports/lpr/LprSetupDlg.cpp b/src/add-ons/print/transports/lpr/LprSetupDlg.cpp
    index 5d82f58..040066d 100644
    a b LprSetupView::UpdateViewData()  
    142142
    143143        catch (LPSException &err) {
    144144            BAlert *alert = new BAlert("", err.what(), "OK");
     145            alert->SetFlags(B_CLOSE_ON_ESCAPE);
    145146            alert->Go();
    146147            return false;
    147148        }
    LprSetupView::UpdateViewData()  
    155156
    156157    BAlert *alert = new BAlert("", "Please enter server address and printer"
    157158        "queue name.", "OK");
     159    alert->SetFlags(B_CLOSE_ON_ESCAPE);
    158160    alert->Go();
    159161    return false;
    160162}
  • src/add-ons/print/transports/lpr/LprTransport.cpp

    diff --git a/src/add-ons/print/transports/lpr/LprTransport.cpp b/src/add-ons/print/transports/lpr/LprTransport.cpp
    index 7f0b89a..a70cf73 100644
    a b LprTransport::_SendFile()  
    129129    catch (LPSException &err) {
    130130        DBGMSG(("error: %s\n", err.what()));
    131131        BAlert *alert = new BAlert("", err.what(), "OK");
     132        alert->SetFlags(B_CLOSE_ON_ESCAPE);
    132133        alert->Go();
    133134    }
    134135}
  • src/add-ons/tracker/iconvader/IconVader.cpp

    diff --git a/src/add-ons/tracker/iconvader/IconVader.cpp b/src/add-ons/tracker/iconvader/IconVader.cpp
    index 42226a9..18d2b39 100644
    a b static void Error(BView *view, status_t status, bool unlock=false)  
    1818        view->UnlockLooper();
    1919    BString s(strerror(status));
    2020    alert = new BAlert("Error", s.String(), "OK");
     21    alert->SetFlags(B_CLOSE_ON_ESCAPE);
    2122    alert->Go();
    2223}
    2324
    process_refs(entry_ref dir, BMessage* refs, void* /*reserved*/)  
    8081
    8182
    8283
    83     alert = new BAlert("Error", "IconVader:\nClick on the icons to get points.\nAvoid symlinks!", "OK");
     84    alert = new BAlert("Error", "IconVader:\nClick on the icons to get points."
     85        "\nAvoid symlinks!", "OK");
     86    alert->SetFlags(B_CLOSE_ON_ESCAPE);
    8487    alert->Go();
    8588
    8689
    process_refs(entry_ref dir, BMessage* refs, void* /*reserved*/)  
    133136    BString scoreStr("You scored ");
    134137    scoreStr << score << " points!";
    135138    alert = new BAlert("Error", scoreStr.String(), "Cool!");
     139    alert->SetFlags(B_CLOSE_ON_ESCAPE);
    136140    alert->Go();
    137141
    138142
  • src/add-ons/tracker/opentargetfolder/opentargetfolder.cpp

    diff --git a/src/add-ons/tracker/opentargetfolder/opentargetfolder.cpp b/src/add-ons/tracker/opentargetfolder/opentargetfolder.cpp
    index 9e65ae3..29a1ef1 100644
    a b process_refs(entry_ref directoryRef, BMessage *msg, void *)  
    3838        if (link.MakeLinkedPath(&directory, &path) < B_OK
    3939            || targetEntry.SetTo(path.Path()) != B_OK
    4040            || targetEntry.GetParent(&targetEntry) != B_OK) {
    41             (new BAlert("Open Target Folder",
     41            BAlert* alert = new BAlert("Open Target Folder",
    4242                "Cannot open target folder. Maybe this link is broken?",
    43                 "OK", NULL, NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go(NULL);
     43                "OK", NULL, NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
     44            alert->SetFlags(B_CLOSE_ON_ESCAPE);
     45            alert->Go(NULL);
    4446            continue;
    4547        }
    4648
    process_refs(entry_ref directoryRef, BMessage *msg, void *)  
    5961    }
    6062
    6163    if (errors) {
    62         (new BAlert("Open Target Folder",
     64        BAlert* alert = new BAlert("Open Target Folder",
    6365            "This add-on can only be used on symbolic links.\n"
    6466            "It opens the folder of the link target in Tracker.",
    65             "OK"))->Go(NULL);
     67            "OK");
     68        alert->SetFlags(B_CLOSE_ON_ESCAPE);
     69        alert->Go(NULL);
    6670    }
    6771}
    6872
  • src/add-ons/translators/ppm/PPMMain.cpp

    diff --git a/src/add-ons/translators/ppm/PPMMain.cpp b/src/add-ons/translators/ppm/PPMMain.cpp
    index 6b4da65..f0164e1 100644
    a b main()  
    5151        BAlert * err = new BAlert("Error",
    5252            B_TRANSLATE("Something is wrong with the PPMTranslator!"),
    5353            B_TRANSLATE("OK"));
     54        err->SetFlags(B_CLOSE_ON_ESCAPE);
    5455        err->Go();
    5556        return 1;
    5657    }
  • src/add-ons/translators/shared/TranslatorWindow.cpp

    diff --git a/src/add-ons/translators/shared/TranslatorWindow.cpp b/src/add-ons/translators/shared/TranslatorWindow.cpp
    index 8e075d4..b97fac1 100644
    a b LaunchTranslatorWindow(BTranslator *translator, const char *title, BRect rect)  
    8888    if (translator->MakeConfigurationView(NULL, &view, &rect)) {
    8989        BAlert *err = new BAlert(B_TRANSLATE("Error"),
    9090            B_TRANSLATE("Unable to create the view."), B_TRANSLATE("OK"));
     91        err->SetFlags(B_CLOSE_ON_ESCAPE);
    9192        err->Go();
    9293        return B_ERROR;
    9394    }
  • src/apps/autoraise/AutoRaiseApp.cpp

    diff --git a/src/apps/autoraise/AutoRaiseApp.cpp b/src/apps/autoraise/AutoRaiseApp.cpp
    index 8bcd92e..b2a0f7e 100644
    a b void AutoRaiseApp::ReadyToRun()  
    7070        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,
    7171            B_WIDTH_AS_USUAL, B_OFFSET_SPACING, B_INFO_ALERT);
    7272        alert->SetShortcut(0, B_ENTER);
     73        alert->SetFlags(B_CLOSE_ON_ESCAPE);
    7374        alert->Go();
    7475        be_app_messenger.SendMessage(B_QUIT_REQUESTED);
    7576    }
  • src/apps/autoraise/AutoRaiseIcon.cpp

    diff --git a/src/apps/autoraise/AutoRaiseIcon.cpp b/src/apps/autoraise/AutoRaiseIcon.cpp
    index 2755a0d..72413d9 100644
    a b void TrayView::MessageReceived(BMessage* message)  
    542542            alert = new BAlert("about box", "AutoRaise, (c) 2002, mmu_man\nEnjoy :-)", "OK", NULL, NULL,
    543543                B_WIDTH_AS_USUAL, B_OFFSET_SPACING, B_INFO_ALERT);
    544544            alert->SetShortcut(0, B_ENTER);
     545            alert->SetFlags(B_CLOSE_ON_ESCAPE);
    545546            alert->Go(NULL); // use asynchronous version
    546547            break;
    547548        case OPEN_SETTINGS:
  • src/apps/bootmanager/BootManagerController.cpp

    diff --git a/src/apps/bootmanager/BootManagerController.cpp b/src/apps/bootmanager/BootManagerController.cpp
    index f8b1bdb..1f7f16d 100644
    a b BootManagerController::_HasSelectedPartitions()  
    177177    BAlert* alert = new BAlert("info",
    178178        B_TRANSLATE("At least one partition must be selected!"),
    179179        B_TRANSLATE_COMMENT("OK", "Button"));
     180    alert->SetFlags(B_CLOSE_ON_ESCAPE);
    180181    alert->Go();
    181182
    182183    return false;
  • src/apps/bsnow/SnowView.cpp

    diff --git a/src/apps/bsnow/SnowView.cpp b/src/apps/bsnow/SnowView.cpp
    index 8625d15..a203ded 100644
    a b void SnowView::MessageReceived(BMessage *msg)  
    214214            "Where is Santa ??");
    215215        info->SetFeel(B_NORMAL_WINDOW_FEEL);
    216216        info->SetLook(B_FLOATING_WINDOW_LOOK);
    217         info->SetFlags(info->Flags()|B_NOT_ZOOMABLE);
     217        info->SetFlags(info->Flags()|B_NOT_ZOOMABLE|B_CLOSE_ON_ESCAPE);
    218218        info->Go(NULL);
    219219        break;
    220220    default:
  • src/apps/cdplayer/CDDBSupport.cpp

    diff --git a/src/apps/cdplayer/CDDBSupport.cpp b/src/apps/cdplayer/CDDBSupport.cpp
    index e595223..052b2be 100644
    a b CDDBQuery::_ParseData(const BString &data)  
    11211121
    11221122        // TODO: finish, once I find an entry which actually has a year in it
    11231123        BAlert *alert = new BAlert("SimplyVorbis", "DYEAR entry found\n", "OK");
     1124        alert->SetFlags(B_CLOSE_ON_ESCAPE);
    11241125        alert->Go();
    11251126       
    11261127    }
  • src/apps/cdplayer/CDPlayer.cpp

    diff --git a/src/apps/cdplayer/CDPlayer.cpp b/src/apps/cdplayer/CDPlayer.cpp
    index 5117b1f..2e4626c 100644
    a b CDPlayer::CDPlayer(BRect frame, const char *name, uint32 resizeMask,  
    8888            "It appears that there are no CD"
    8989            " drives on your computer or there is no system software to "
    9090            "support one. Sorry."), B_TRANSLATE("OK"));
     91        alert->SetFlags(B_CLOSE_ON_ESCAPE);
    9192        alert->Go();
    9293    }
    9394
  • src/apps/clock/cl_view.cpp

    diff --git a/src/apps/clock/cl_view.cpp b/src/apps/clock/cl_view.cpp
    index ea702a1..ae05b71 100644
    a b TOnscreenView::MessageReceived(BMessage *msg)  
    361361                "Clock (The Replicant version)\n\n(C)2002, 2003 OpenBeOS,\n"
    362362                "2004 - 2007, Haiku, Inc.\n\nOriginally coded  by the folks "
    363363                "at Be.\n  Copyright Be Inc., 1991 - 1998", "OK");
    364            
     364            alert->SetFlags(B_CLOSE_ON_ESCAPE);
    365365            alert->Go();
    366366        }   break;
    367367
  • src/apps/codycam/CodyCam.cpp

    diff --git a/src/apps/codycam/CodyCam.cpp b/src/apps/codycam/CodyCam.cpp
    index a00dfd8..dcfe687 100644
    a b ErrorAlert(const char* message, status_t err, BWindow *window = NULL)  
    6262        B_TRANSLATE("OK"));
    6363    if (window != NULL)
    6464        alert->CenterIn(window->Frame());
     65    alert->SetFlags(B_CLOSE_ON_ESCAPE);
    6566    alert->Go();
    6667
    6768    printf("%s\n%s [%lx]", message, strerror(err), err);
  • src/apps/cortex/AddOnHost/AddOnHostApp.cpp

    diff --git a/src/apps/cortex/AddOnHost/AddOnHostApp.cpp b/src/apps/cortex/AddOnHost/AddOnHostApp.cpp
    index 5d3251b..e481c4a 100644
    a b main(int argc, char** argv)  
    170170{
    171171    App app;
    172172    if (argc < 2 || strcmp(argv[1], "--addon-host") != 0) {
    173         int32 response = (new BAlert(
    174             "Cortex AddOnHost",
     173        BAlert* alert = new BAlert("Cortex AddOnHost",
    175174            "This program runs in the background, and is started automatically "
    176175            "by Cortex when necessary.  You probably don't want to start it manually.",
    177             "Continue", "Quit"))->Go();
     176            "Continue", "Quit");
     177        alert->SetShortcut(1, B_ESCAPE);
     178        int32 response = alert->Go();
     179
    178180        if(response == 1)
    179181            return 0;
    180182    }
  • src/apps/cortex/MediaRoutingView/MediaRoutingView.cpp

    diff --git a/src/apps/cortex/MediaRoutingView/MediaRoutingView.cpp b/src/apps/cortex/MediaRoutingView/MediaRoutingView.cpp
    index 3e4b2ca..0c5adbd 100644
    a b void MediaRoutingView::showErrorMessage(  
    988988     || (messenger.SendMessage(&message) != B_OK)) {
    989989        BAlert *alert = new BAlert("Error", text.String(), "OK", 0, 0,
    990990                                   B_WIDTH_AS_USUAL, B_WARNING_ALERT);
     991        alert->SetFlags(B_CLOSE_ON_ESCAPE);
    991992        alert->Go();
    992993    }
    993994}
  • src/apps/cortex/ParameterView/ParameterWindow.cpp

    diff --git a/src/apps/cortex/ParameterView/ParameterWindow.cpp b/src/apps/cortex/ParameterView/ParameterWindow.cpp
    index 3f82c1c..c09dded 100644
    a b void ParameterWindow::MessageReceived(  
    162162                s << " (" << strerror(error) << ")";
    163163                BAlert *alert = new BAlert("", s.String(), "OK", 0, 0,
    164164                                           B_WIDTH_AS_USUAL, B_WARNING_ALERT);
     165                alert->SetFlags(B_CLOSE_ON_ESCAPE);
    165166                alert->Go(0);
    166167            }
    167168            bool replace = false;
  • src/apps/cortex/RouteApp/RouteWindow.cpp

    diff --git a/src/apps/cortex/RouteApp/RouteWindow.cpp b/src/apps/cortex/RouteApp/RouteWindow.cpp
    index eb6c164..fb697f1 100644
    a b RouteWindow::MessageReceived(BMessage* pMsg)  
    372372//
    373373    switch (pMsg->what) {
    374374        case B_ABOUT_REQUESTED:
    375             (new BAlert("About", g_aboutText, "OK"))->Go();
     375        {
     376            BAlert* alert = new BAlert("About", g_aboutText, "OK");
     377            alert->SetFlags(B_CLOSE_ON_ESCAPE);
     378            alert->Go();
    376379            break;
    377 
     380        }
    378381        case MediaRoutingView::M_GROUP_SELECTED:
    379382            _handleGroupSelected(pMsg);
    380383            break;
  • src/apps/cortex/addons/common/MediaNodeControlApp.cpp

    diff --git a/src/apps/cortex/addons/common/MediaNodeControlApp.cpp b/src/apps/cortex/addons/common/MediaNodeControlApp.cpp
    index d90db03..42e3a6c 100644
    a b MediaNodeControlApp::MediaNodeControlApp(  
    8484        sprintf(buffer,
    8585            "MediaNodeControlApp: couldn't find node (%ld):\n%s\n",
    8686            nodeID, strerror(err));
    87         (new BAlert("error", buffer, "OK"))->Go();
     87        BAlert* alert = new BAlert("error", buffer, "OK");
     88        alert->SetFlags(B_CLOSE_ON_ESCAPE);
     89        alert->Go();
    8890        return;
    8991    }
    9092   
    MediaNodeControlApp::MediaNodeControlApp(  
    9698        sprintf(buffer,
    9799            "MediaNodeControlApp: couldn't get node info (%ld):\n%s\n",
    98100            nodeID, strerror(err));
    99         (new BAlert("error", buffer, "OK"))->Go();
     101        BAlert* alert = new BAlert("error", buffer, "OK");
     102        alert->SetFlags(B_CLOSE_ON_ESCAPE);
     103        alert->Go();
    100104        return;
    101105    }
    102106   
    MediaNodeControlApp::MediaNodeControlApp(  
    111115        sprintf(buffer,
    112116            "MediaNodeControlApp: no parameters for node (%ld):\n%s\n",
    113117            nodeID, strerror(err));
    114         (new BAlert("error", buffer, "OK"))->Go();
     118        BAlert* alert = new BAlert("error", buffer, "OK");
     119        alert->SetFlags(B_CLOSE_ON_ESCAPE);
     120        alert->Go();
    115121        return;
    116122    }
    117123   
  • src/apps/diskprobe/AttributeWindow.cpp

    diff --git a/src/apps/diskprobe/AttributeWindow.cpp b/src/apps/diskprobe/AttributeWindow.cpp
    index 595d6ca..04d844f 100644
    a b AttributeWindow::MessageReceived(BMessage *message)  
    278278        case kMsgRemoveAttribute:
    279279        {
    280280            char buffer[1024];
     281
    281282            snprintf(buffer, sizeof(buffer),
    282283                B_TRANSLATE("Do you really want to remove the attribute \"%s\" from "
    283284                "the file \"%s\"?\n\nYou cannot undo this action."),
    284285                fAttribute, Ref().name);
    285286
    286             int32 chosen = (new BAlert(B_TRANSLATE("DiskProbe request"),
     287            BAlert* alert = new BAlert(B_TRANSLATE("DiskProbe request"),
    287288                buffer, B_TRANSLATE("Cancel"), B_TRANSLATE("Remove"), NULL,
    288                 B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go();
     289                B_WIDTH_AS_USUAL, B_WARNING_ALERT);
     290            alert->SetShortcut(0, B_ESCAPE);
     291            int32 chosen = alert->Go();
     292
    289293            if (chosen == 1) {
    290294                BNode node(&Ref());
    291295                if (node.InitCheck() == B_OK)
  • src/apps/diskprobe/DiskProbe.cpp

    diff --git a/src/apps/diskprobe/DiskProbe.cpp b/src/apps/diskprobe/DiskProbe.cpp
    index 600a8b9..aa06202 100644
    a b DiskProbe::RefsReceived(BMessage *message)  
    367367                "error message is shown."),
    368368                ref.name, strerror(status));
    369369
    370             (new BAlert(B_TRANSLATE("DiskProbe request"),
     370            BAlert* alert = new BAlert(B_TRANSLATE("DiskProbe request"),
    371371                buffer, B_TRANSLATE("OK"), NULL, NULL,
    372                 B_WIDTH_AS_USUAL, B_STOP_ALERT))->Go();
     372                B_WIDTH_AS_USUAL, B_STOP_ALERT);
     373            alert->SetFlags(B_CLOSE_ON_ESCAPE);
     374            alert->Go();
    373375        }
    374376    }
    375377}
  • src/apps/diskprobe/ProbeView.cpp

    diff --git a/src/apps/diskprobe/ProbeView.cpp b/src/apps/diskprobe/ProbeView.cpp
    index 2fcaea4..c03af32 100644
    a b EditorLooper::Find(off_t startAt, const uint8 *data, size_t dataSize,  
    11051105        if (system_time() > startTime + 8000000LL) {
    11061106            // If the user had to wait more than 8 seconds for the result,
    11071107            // we are trying to please him with a requester...
    1108             (new BAlert(B_TRANSLATE("DiskProbe request"),
     1108            BAlert* alert = new BAlert(B_TRANSLATE("DiskProbe request"),
    11091109                B_TRANSLATE("Could not find search string."),
    11101110                B_TRANSLATE("OK"), NULL, NULL, B_WIDTH_AS_USUAL,
    1111                 B_WARNING_ALERT))->Go(NULL);
     1111                B_WARNING_ALERT);
     1112            alert->SetFlags(B_CLOSE_ON_ESCAPE);
     1113            alert->Go(NULL);
    11121114        } else
    11131115            beep();
    11141116    }
    ProbeView::_Save()  
    18671869        "All changes will be lost when you quit."),
    18681870        strerror(status));
    18691871
    1870     (new BAlert(B_TRANSLATE("DiskProbe request"),
     1872    BAlert* alert = new BAlert(B_TRANSLATE("DiskProbe request"),
    18711873        buffer, B_TRANSLATE("OK"), NULL, NULL,
    1872         B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go(NULL);
     1874        B_WIDTH_AS_USUAL, B_WARNING_ALERT);
     1875    alert->SetFlags(B_CLOSE_ON_ESCAPE);
     1876    alert->Go(NULL);
    18731877
    18741878    return status;
    18751879}
    ProbeView::QuitRequested()  
    18831887    if (!fEditor.IsModified())
    18841888        return true;
    18851889
    1886     int32 chosen = (new BAlert(B_TRANSLATE("DiskProbe request"),
    1887         B_TRANSLATE("Save changes before closing?"), B_TRANSLATE("Don't save"), B_TRANSLATE("Cancel"),
    1888         B_TRANSLATE("Save"),    B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go();
     1890    BAlert* alert = new BAlert(B_TRANSLATE("DiskProbe request"),
     1891        B_TRANSLATE("Save changes before closing?"), B_TRANSLATE("Don't save"),
     1892        B_TRANSLATE("Cancel"), B_TRANSLATE("Save"), B_WIDTH_AS_USUAL,
     1893        B_WARNING_ALERT);
     1894    alert->SetShortcut(1, B_ESCAPE);
     1895    int32 chosen = alert->Go();
    18891896
    18901897    if (chosen == 0)
    18911898        return true;
  • src/apps/drivesetup/MainWindow.cpp

    diff --git a/src/apps/drivesetup/MainWindow.cpp b/src/apps/drivesetup/MainWindow.cpp
    index dd50a58..9d41226 100644
    a b MainWindow::_DisplayPartitionError(BString _message,  
    657657
    658658    BAlert* alert = new BAlert("error", message, B_TRANSLATE("OK"), NULL, NULL,
    659659        B_WIDTH_FROM_WIDEST, error < B_OK ? B_STOP_ALERT : B_INFO_ALERT);
     660    alert->SetFlags(B_CLOSE_ON_ESCAPE);
    660661    alert->Go(NULL);
    661662}
    662663
    MainWindow::_Initialize(BDiskDevice* disk, partition_id selectedPartition,  
    820821    BAlert* alert = new BAlert("first notice", message,
    821822        B_TRANSLATE("Continue"), B_TRANSLATE("Cancel"), NULL,
    822823        B_WIDTH_FROM_WIDEST, B_WARNING_ALERT);
     824    alert->SetShortcut(1, B_ESCAPE);
    823825    int32 choice = alert->Go();
    824826
    825827    if (choice == 1)
    MainWindow::_Initialize(BDiskDevice* disk, partition_id selectedPartition,  
    917919    alert = new BAlert("final notice", message,
    918920        B_TRANSLATE("Write changes"), B_TRANSLATE("Cancel"), NULL,
    919921        B_WIDTH_FROM_WIDEST, B_WARNING_ALERT);
     922    alert->SetShortcut(1, B_ESCAPE);
    920923    choice = alert->Go();
    921924
    922925    if (choice == 1)
    MainWindow::_Create(BDiskDevice* disk, partition_id selectedPartition)  
    10241027        "All data on the partition will be irretrievably lost if you do "
    10251028        "so!"), B_TRANSLATE("Write changes"), B_TRANSLATE("Cancel"), NULL,
    10261029        B_WIDTH_FROM_WIDEST, B_WARNING_ALERT);
     1030    alert->SetShortcut(1, B_ESCAPE);
    10271031    int32 choice = alert->Go();
    10281032
    10291033    if (choice == 1)
    MainWindow::_Delete(BDiskDevice* disk, partition_id selectedPartition)  
    11031107        "All data on the partition will be irretrievably lost if you "
    11041108        "do so!"), B_TRANSLATE("Delete partition"), B_TRANSLATE("Cancel"), NULL,
    11051109        B_WIDTH_FROM_WIDEST, B_WARNING_ALERT);
     1110    alert->SetShortcut(1, B_ESCAPE);
    11061111    int32 choice = alert->Go();
    11071112
    11081113    if (choice == 1)
  • src/apps/expander/ExpanderWindow.cpp

    diff --git a/src/apps/expander/ExpanderWindow.cpp b/src/apps/expander/ExpanderWindow.cpp
    index 7355ce5..199f651 100644
    a b ExpanderWindow::ValidateDest()  
    153153            B_TRANSLATE("The destination folder does not exist."),
    154154            B_TRANSLATE("Cancel"), NULL, NULL,
    155155            B_WIDTH_AS_USUAL, B_EVEN_SPACING, B_WARNING_ALERT);
     156        alert->SetFlags(B_CLOSE_ON_ESCAPE);
    156157        alert->Go();
    157158        return false;
    158159    } else if (!entry.IsDirectory()) {
    159         (new BAlert("destAlert",
     160        BAlert* alert = new BAlert("destAlert",
    160161            B_TRANSLATE("The destination is not a folder."),
    161162            B_TRANSLATE("Cancel"), NULL, NULL,
    162             B_WIDTH_AS_USUAL, B_EVEN_SPACING, B_WARNING_ALERT))->Go();
     163            B_WIDTH_AS_USUAL, B_EVEN_SPACING, B_WARNING_ALERT);
     164        alert->SetFlags(B_CLOSE_ON_ESCAPE);
     165        alert->Go();   
    163166        return false;
    164167    } else if (entry.GetVolume(&volume) != B_OK || volume.IsReadOnly()) {
    165         (new BAlert("destAlert",
     168        BAlert* alert = new BAlert("destAlert",
    166169            B_TRANSLATE("The destination is read only."),
    167170            B_TRANSLATE("Cancel"), NULL, NULL, B_WIDTH_AS_USUAL,
    168             B_EVEN_SPACING, B_WARNING_ALERT))->Go();
     171            B_EVEN_SPACING, B_WARNING_ALERT);
     172        alert->SetFlags(B_CLOSE_ON_ESCAPE);
     173        alert->Go();
    169174        return false;
    170175    } else {
    171176        entry.GetRef(&fDestRef);
    ExpanderWindow::MessageReceived(BMessage* msg)  
    246251                        "archive? The expanded items may not be complete."),
    247252                    B_TRANSLATE("Stop"), B_TRANSLATE("Continue"), NULL,
    248253                    B_WIDTH_AS_USUAL, B_EVEN_SPACING, B_WARNING_ALERT);
     254                alert->SetShortcut(0, B_ESCAPE);
    249255                if (alert->Go() == 0) {
    250256                    fExpandingThread->ResumeExternalExpander();
    251257                    StopExpanding();
    ExpanderWindow::MessageReceived(BMessage* msg)  
    280286                    B_TRANSLATE("The file doesn't exist"),
    281287                    B_TRANSLATE("Cancel"), NULL, NULL,
    282288                    B_WIDTH_AS_USUAL, B_EVEN_SPACING, B_WARNING_ALERT);
     289                alert->SetFlags(B_CLOSE_ON_ESCAPE);
    283290                alert->Go();
    284291                break;
    285292            }
    ExpanderWindow::MessageReceived(BMessage* msg)  
    303310            BAlert* alert = new BAlert("srcAlert", string.String(),
    304311                B_TRANSLATE("Cancel"),
    305312                NULL, NULL, B_WIDTH_AS_USUAL, B_EVEN_SPACING, B_INFO_ALERT);
     313            alert->SetFlags(B_CLOSE_ON_ESCAPE);
    306314            alert->Go();
    307315
    308316            fShowContents->SetEnabled(false);
    ExpanderWindow::MessageReceived(BMessage* msg)  
    369377                    BAlert* alert = new BAlert("stopAlert", string,
    370378                        B_TRANSLATE("Stop"), B_TRANSLATE("Continue"), NULL,
    371379                        B_WIDTH_AS_USUAL, B_EVEN_SPACING, B_WARNING_ALERT);
     380                    alert->SetShortcut(0, B_ESCAPE);
    372381                    if (alert->Go() == 0) {
    373382                        fExpandingThread->ResumeExternalExpander();
    374383                        StopExpanding();
    ExpanderWindow::CanQuit()  
    422431                "archive? The expanded items may not be complete."),
    423432            B_TRANSLATE("Stop"), B_TRANSLATE("Continue"), NULL,
    424433            B_WIDTH_AS_USUAL, B_EVEN_SPACING, B_WARNING_ALERT);
     434            alert->SetShortcut(0, B_ESCAPE);
    425435        if (alert->Go() == 0) {
    426436            fExpandingThread->ResumeExternalExpander();
    427437            StopExpanding();
    ExpanderWindow::StartExpanding()  
    558568        B_TRANSLATE("The folder was either moved, renamed or not\nsupported."),
    559569        B_TRANSLATE("Cancel"), NULL, NULL,
    560570            B_WIDTH_AS_USUAL, B_EVEN_SPACING, B_WARNING_ALERT);
     571        alert->SetFlags(B_CLOSE_ON_ESCAPE);
    561572        alert->Go();
    562573        return;
    563574    }
  • src/apps/glteapot/ObjectView.cpp

    diff --git a/src/apps/glteapot/ObjectView.cpp b/src/apps/glteapot/ObjectView.cpp
    index bf14e13..4059b18 100644
    a b ObjectView::ObjectView(BRect rect, const char *name, ulong resizingMode,  
    177177        BAlert *NoResourceAlert = new BAlert(B_TRANSLATE("Error"),
    178178                        kNoResourceError, B_TRANSLATE("OK"), NULL, NULL,
    179179                        B_WIDTH_AS_USUAL, B_OFFSET_SPACING, B_STOP_ALERT);
     180        NoResourceAlert->SetFlags(B_CLOSE_ON_ESCAPE);
    180181        NoResourceAlert->Go();
    181182        delete Tri;
    182183    }
    ObjectView::MessageReceived(BMessage* msg)  
    323324                BAlert *NoResourceAlert = new BAlert(B_TRANSLATE("Error"),
    324325                        kNoResourceError, B_TRANSLATE("OK"), NULL, NULL,
    325326                        B_WIDTH_AS_USUAL, B_OFFSET_SPACING, B_STOP_ALERT);
     327                NoResourceAlert->SetFlags(B_CLOSE_ON_ESCAPE);
    326328                NoResourceAlert->Go();
    327329                delete Tri;
    328330            }
  • src/apps/icon-o-matic/MainWindow.cpp

    diff --git a/src/apps/icon-o-matic/MainWindow.cpp b/src/apps/icon-o-matic/MainWindow.cpp
    index 51692f5..e91e1e5 100644
    a b MainWindow::Open(const entry_ref& ref, bool append)  
    718718                "Cancel button - error alert"),
    719719            NULL, NULL);
    720720        // launch alert asynchronously
     721        alert->SetFlags(B_CLOSE_ON_ESCAPE);
    721722        alert->Go(NULL);
    722723
    723724        delete icon;
    MainWindow::Open(const BMessenger& externalObserver, const uint8* data,  
    796797                    "Cancel button - error alert"),
    797798                NULL, NULL);
    798799            // launch alert asynchronously
     800            alert->SetFlags(B_CLOSE_ON_ESCAPE);
    799801            alert->Go(NULL);
    800802
    801803            delete icon;
    MainWindow::_CheckSaveIcon(const BMessage* currentMessage)  
    12731275
    12741276    BAlert* alert = new BAlert("save",
    12751277        B_TRANSLATE("Save changes to current icon?"), B_TRANSLATE("Discard"),
    1276          B_TRANSLATE("Cancel"), B_TRANSLATE("Save"));
     1278            B_TRANSLATE("Cancel"), B_TRANSLATE("Save"));
     1279    alert->SetShortcut(0, B_ESCAPE);
    12771280    int32 choice = alert->Go();
    12781281    switch (choice) {
    12791282        case 0:
  • src/apps/icon-o-matic/gui/SavePanel.cpp

    diff --git a/src/apps/icon-o-matic/gui/SavePanel.cpp b/src/apps/icon-o-matic/gui/SavePanel.cpp
    index a131378..6598e47 100644
    a b SavePanel::_ExportSettings()  
    365365//  status_t err = roster->MakeConfigurationView(item->id, NULL, &view, &rect);
    366366//  if (err < B_OK || view == NULL) {
    367367//      BAlert *alert = new BAlert(NULL, strerror(err), "OK");
     368//      alert->SetFlags(B_CLOSE_ON_ESCAPE);
    368369//      alert->Go();
    369370//  } else {
    370371//      if (fConfigWindow != NULL) {
  • src/apps/icon-o-matic/import_export/Exporter.cpp

    diff --git a/src/apps/icon-o-matic/import_export/Exporter.cpp b/src/apps/icon-o-matic/import_export/Exporter.cpp
    index 725148b..cc8bb83 100644
    a b Exporter::_ExportThread()  
    116116                "Exporter - Continue in error dialog"),
    117117            NULL, NULL);
    118118        // launch alert asynchronously
     119        alert->SetFlags(B_CLOSE_ON_ESCAPE);
    119120        alert->Go(NULL);
    120121    } else {
    121122        // success
  • src/apps/icon-o-matic/import_export/svg/SVGExporter.cpp

    diff --git a/src/apps/icon-o-matic/import_export/svg/SVGExporter.cpp b/src/apps/icon-o-matic/import_export/svg/SVGExporter.cpp
    index 029b6b7..0b57dc7 100644
    a b SVGExporter::_DisplayWarning() const  
    164164                               "be lost."),
    165165                               B_TRANSLATE("Cancel"),
    166166                               B_TRANSLATE("Overwrite"));
     167    alert->SetShortcut(0, B_ESCAPE);
    167168    return alert->Go() == 1;
    168169}
    169170
  • src/apps/icon-o-matic/import_export/svg/SVGImporter.cpp

    diff --git a/src/apps/icon-o-matic/import_export/svg/SVGImporter.cpp b/src/apps/icon-o-matic/import_export/svg/SVGImporter.cpp
    index 1faf39b..1ae8338 100644
    a b SVGImporter::Import(Icon* icon, const entry_ref* ref)  
    8080        BAlert* alert = new BAlert(B_TRANSLATE("load error"),
    8181                                   error, B_TRANSLATE("OK"), NULL, NULL,
    8282                                   B_WIDTH_AS_USUAL, B_WARNING_ALERT);
     83        alert->SetFlags(B_CLOSE_ON_ESCAPE);
    8384        alert->Go(NULL);
    8485        ret = B_ERROR;
    8586    }
  • src/apps/installedpackages/UninstallView.cpp

    diff --git a/src/apps/installedpackages/UninstallView.cpp b/src/apps/installedpackages/UninstallView.cpp
    index 794440b..bd28f25 100644
    a b UninstallView::MessageReceived(BMessage* msg)  
    257257                    "been corrupted."), B_TRANSLATE("OK"), NULL,
    258258                    NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
    259259            }
    260 
     260            notify->SetFlags(B_CLOSE_ON_ESCAPE);
    261261            notify->Go();
    262262        }
    263263        default:
  • src/apps/installer/InstallerApp.cpp

    diff --git a/src/apps/installer/InstallerApp.cpp b/src/apps/installer/InstallerApp.cpp
    index 431ea25..728583e 100644
    a b InstallerApp::AboutRequested()  
    8282    BAlert *alert = new BAlert("about", B_TRANSLATE("Installer\n"
    8383        "\twritten by Jérôme Duval and Stephan Aßmus\n"
    8484        "\tCopyright 2005-2010, Haiku.\n\n"), B_TRANSLATE("OK"));
     85    alert->SetFlags(B_CLOSE_ON_ESCAPE);
    8586    BTextView *view = alert->TextView();
    8687    BFont font;
    8788
  • src/apps/installer/InstallerWindow.cpp

    diff --git a/src/apps/installer/InstallerWindow.cpp b/src/apps/installer/InstallerWindow.cpp
    index 707e03d..9bdda85 100644
    a b InstallerWindow::MessageReceived(BMessage *msg)  
    346346                    B_TRANSLATE("An error was encountered and the "
    347347                    "installation was not completed:\n\n"
    348348                    "Error:  %s"), strerror(error));
    349                 (new BAlert("error", errorMessage, B_TRANSLATE("OK")))->Go();
     349                BAlert* alert = new BAlert("error", errorMessage, B_TRANSLATE("OK"));
     350                alert->SetFlags(B_CLOSE_ON_ESCAPE);
     351                alert->Go();
    350352            }
    351353
    352354            _DisableInterface(false);
    InstallerWindow::MessageReceived(BMessage *msg)  
    426428        }
    427429        case ENCOURAGE_DRIVESETUP:
    428430        {
    429             (new BAlert("use drive setup", B_TRANSLATE("No partitions have "
     431            BAlert* alert = new BAlert("use drive setup", B_TRANSLATE("No partitions have "
    430432                "been found that are suitable for installation. Please set "
    431433                "up partitions and initialize at least one partition with the "
    432                 "Be File System."), B_TRANSLATE("OK")))->Go();
     434                "Be File System."), B_TRANSLATE("OK"));
     435            alert->SetFlags(B_CLOSE_ON_ESCAPE);
     436            alert->Go();
    433437            break;
    434438        }
    435439        case MSG_STATUS_MESSAGE:
    InstallerWindow::QuitRequested()  
    575579        // thing on the screen and we will reboot the machine once it quits.
    576580
    577581        if (fDriveSetupLaunched && fBootManagerLaunched) {
    578             (new BAlert(B_TRANSLATE("Quit Boot Manager and DriveSetup"),
    579                 B_TRANSLATE("Please close the Boot Manager and DriveSetup "
    580                     "windows before closing the Installer window."),
    581                 B_TRANSLATE("OK")))->Go();
     582            BAlert* alert = new BAlert(B_TRANSLATE("Quit Boot Manager and "
     583                "DriveSetup"),  B_TRANSLATE("Please close the Boot Manager "
     584                "and DriveSetup windows before closing the Installer window."),
     585                B_TRANSLATE("OK"));
     586            alert->SetFlags(B_CLOSE_ON_ESCAPE);
     587            alert->Go();
    582588            return false;
    583589        }
    584590        if (fDriveSetupLaunched) {
    585             (new BAlert(B_TRANSLATE("Quit DriveSetup"),
    586                 B_TRANSLATE("Please close the DriveSetup window before closing "
    587                     "the Installer window."), B_TRANSLATE("OK")))->Go();
     591            BAlert* alert = new BAlert(B_TRANSLATE("Quit DriveSetup"),
     592                B_TRANSLATE("Please close the DriveSetup window before "
     593                "closing the Installer window."), B_TRANSLATE("OK"));
     594            alert->SetFlags(B_CLOSE_ON_ESCAPE);
     595            alert->Go();
    588596            return false;
    589597        }
    590598        if (fBootManagerLaunched) {
    591             (new BAlert(B_TRANSLATE("Quit Boot Manager"),
     599            BAlert* alert = new BAlert(B_TRANSLATE("Quit Boot Manager"),
    592600                B_TRANSLATE("Please close the Boot Manager window before "
    593                     "closing the Installer window."), B_TRANSLATE("OK")))->Go();
     601                "closing the Installer window."), B_TRANSLATE("OK"));
     602            alert->SetFlags(B_CLOSE_ON_ESCAPE);
     603            alert->Go();
    594604            return false;
    595605        }
    596 
    597         if (fInstallStatus != kFinished
    598             && (new BAlert(B_TRANSLATE_SYSTEM_NAME("Installer"),
    599                     B_TRANSLATE("Are you sure you want to abort the "
    600                         "installation and restart the system?"),
    601                     B_TRANSLATE("Cancel"), B_TRANSLATE("Restart system"), NULL,
    602                     B_WIDTH_AS_USUAL, B_STOP_ALERT))->Go() == 0) {
    603             return false;
     606        if (fInstallStatus != kFinished) {
     607            BAlert* alert = new BAlert(B_TRANSLATE_SYSTEM_NAME("Installer"),
     608                B_TRANSLATE("Are you sure you want to abort the "
     609                    "installation and restart the system?"),
     610                B_TRANSLATE("Cancel"), B_TRANSLATE("Restart system"), NULL,
     611                B_WIDTH_AS_USUAL, B_STOP_ALERT);
     612            alert->SetShortcut(0, B_ESCAPE);
     613            if (alert->Go() == 0)
     614                return false;
    604615        }
    605     } else if (fInstallStatus == kInstalling
    606         && (new BAlert(B_TRANSLATE_SYSTEM_NAME("Installer"),
    607             B_TRANSLATE("Are you sure you want to abort the installation?"),
    608             B_TRANSLATE("Cancel"), B_TRANSLATE("Abort"), NULL,
    609             B_WIDTH_AS_USUAL, B_STOP_ALERT))->Go() == 0) {
    610         return false;
     616    } else if (fInstallStatus == kInstalling) {
     617            BAlert* alert = new BAlert(B_TRANSLATE_SYSTEM_NAME("Installer"),
     618                B_TRANSLATE("Are you sure you want to abort the installation?"),
     619                B_TRANSLATE("Cancel"), B_TRANSLATE("Abort"), NULL,
     620                B_WIDTH_AS_USUAL, B_STOP_ALERT);
     621            alert->SetShortcut(0, B_ESCAPE);
     622            if (alert->Go() == 0)
     623                return false;
    611624    }
    612625
    613626    _QuitCopyEngine(false);
    InstallerWindow::_LaunchDriveSetup()  
    648661            BAlert* alert = new BAlert("error", B_TRANSLATE("DriveSetup, the "
    649662                "application to configure disk partitions, could not be "
    650663                "launched."), B_TRANSLATE("OK"));
     664            alert->SetFlags(B_CLOSE_ON_ESCAPE);
    651665            alert->Go();
    652666        }
    653667    }
    InstallerWindow::_LaunchBootManager()  
    676690            BAlert* alert = new BAlert("error", B_TRANSLATE("BootManager, the "
    677691                "application to configure the Haiku boot menu, could not be "
    678692                "launched."), B_TRANSLATE("OK"));
     693            alert->SetFlags(B_CLOSE_ON_ESCAPE);
    679694            alert->Go();
    680695        }
    681696    }
    InstallerWindow::_QuitCopyEngine(bool askUser)  
    876891
    877892    bool quit = true;
    878893    if (askUser) {
    879         quit = (new BAlert("cancel",
     894        BAlert* alert = new BAlert("cancel",
    880895            B_TRANSLATE("Are you sure you want to to stop the installation?"),
    881896            B_TRANSLATE_COMMENT("Continue", "In alert after pressing Stop"),
    882897            B_TRANSLATE_COMMENT("Stop", "In alert after pressing Stop"), 0,
    883             B_WIDTH_AS_USUAL, B_STOP_ALERT))->Go() != 0;
     898            B_WIDTH_AS_USUAL, B_STOP_ALERT);
     899        alert->SetShortcut(1, B_ESCAPE);
     900        quit = alert->Go();
    884901    }
    885902
    886903    if (quit) {
  • src/apps/installer/WorkerThread.cpp

    diff --git a/src/apps/installer/WorkerThread.cpp b/src/apps/installer/WorkerThread.cpp
    index 73abd11..fbb4727 100644
    a b WorkerThread::_PerformInstall(BMenu* srcMenu, BMenu* targetMenu)  
    316316        goto error; // shouldn't happen
    317317
    318318    // check if target has enough space
    319     if ((fSpaceRequired > 0 && targetVolume.FreeBytes() < fSpaceRequired)
    320         && ((new BAlert("", B_TRANSLATE("The destination disk may not have "
    321             "enough space. Try choosing a different disk or choose to not "
    322             "install optional items."), B_TRANSLATE("Try installing anyway"),
    323             B_TRANSLATE("Cancel"), 0,
    324             B_WIDTH_AS_USUAL, B_STOP_ALERT))->Go() != 0)) {
    325         goto error;
     319    if (fSpaceRequired > 0 && targetVolume.FreeBytes() < fSpaceRequired) {
     320        BAlert* alert = new BAlert("", B_TRANSLATE("The destination disk may "
     321            "not have enough space. Try choosing a different disk or choose "
     322            "to not install optional items."),
     323            B_TRANSLATE("Try installing anyway"), B_TRANSLATE("Cancel"), 0,
     324            B_WIDTH_AS_USUAL, B_STOP_ALERT);
     325        alert->SetShortcut(1, B_ESCAPE);
     326        if (alert->Go() != 0)
     327                goto error;
    326328    }
    327329
    328330    if (fDDRoster.GetPartitionWithID(srcItem->ID(), &device, &partition) == B_OK) {
    WorkerThread::_PerformInstall(BMenu* srcMenu, BMenu* targetMenu)  
    346348    }
    347349
    348350    // check not installing on boot volume
    349     if ((strncmp(BOOT_PATH, targetDirectory.Path(), strlen(BOOT_PATH)) == 0)
    350         && ((new BAlert("", B_TRANSLATE("Are you sure you want to install "
    351             "onto the current boot disk? The Installer will have to reboot "
    352             "your machine if you proceed."), B_TRANSLATE("OK"),
    353             B_TRANSLATE("Cancel"), 0,
    354             B_WIDTH_AS_USUAL, B_STOP_ALERT))->Go() != 0)) {
    355         _SetStatusMessage("Installation stopped.");
    356         goto error;
     351    if (strncmp(BOOT_PATH, targetDirectory.Path(), strlen(BOOT_PATH)) == 0) {
     352        BAlert* alert = new BAlert("", B_TRANSLATE("Are you sure you want to "
     353            "install onto the current boot disk? The Installer will have to "
     354            "reboot your machine if you proceed."), B_TRANSLATE("OK"),
     355            B_TRANSLATE("Cancel"), 0, B_WIDTH_AS_USUAL, B_STOP_ALERT);
     356        alert->SetShortcut(1, B_ESCAPE);
     357        if (alert->Go() != 0) {
     358            _SetStatusMessage("Installation stopped.");
     359            goto error;
     360        }
    357361    }
    358362
    359363    // check if target volume's trash dir has anything in it
    WorkerThread::_PerformInstall(BMenu* srcMenu, BMenu* targetMenu)  
    376380            entries++;
    377381    }
    378382
    379     if (entries != 0
    380         && ((new BAlert("", B_TRANSLATE("The target volume is not empty. Are "
    381             "you sure you want to install anyway?\n\nNote: The 'system' folder "
    382             "will be a clean copy from the source volume, all other folders "
    383             "will be merged, whereas files and links that exist on both the "
    384             "source and target volume will be overwritten with the source "
    385             "volume version."),
     383    if (entries != 0) {
     384        BAlert* alert = new BAlert("", B_TRANSLATE("The target volume is not "
     385            "empty. Are you sure you want to install anyway?\n\nNote: The "
     386            "'system' folder will be a clean copy from the source volume, all "
     387            "other folders will be merged, whereas files and links that exist "
     388            "on both the source and target volume will be overwritten with "
     389            "the source volume version."),
    386390            B_TRANSLATE("Install anyway"), B_TRANSLATE("Cancel"), 0,
    387             B_WIDTH_AS_USUAL, B_STOP_ALERT))->Go() != 0)) {
     391            B_WIDTH_AS_USUAL, B_STOP_ALERT);
     392        alert->SetShortcut(1, B_ESCAPE);
     393        if (alert->Go() != 0) {
    388394        // TODO: Would be cool to offer the option here to clean additional
    389395        // folders at the user's choice (like /boot/common and /boot/develop).
    390         err = B_CANCELED;
    391         goto error;
     396            err = B_CANCELED;
     397            goto error;
     398        }
    392399    }
    393400
    394401    // Begin actual installation
  • src/apps/launchbox/MainWindow.cpp

    diff --git a/src/apps/launchbox/MainWindow.cpp b/src/apps/launchbox/MainWindow.cpp
    index 448a99e..b71fdde 100644
    a b MainWindow::QuitRequested()  
    9898            B_TRANSLATE("Really close this pad?\n"
    9999                        "(The pad will not be remembered.)"),
    100100            B_TRANSLATE("Close"), B_TRANSLATE("Cancel"), NULL);
     101        alert->SetShortcut(1, B_ESCAPE);
    101102        if (alert->Go() == 1)
    102103            return false;
    103104    }
    MainWindow::MessageReceived(BMessage* message)  
    172173            if (errorMessage.Length() > 0) {
    173174                BAlert* alert = new BAlert("error", errorMessage.String(),
    174175                    B_TRANSLATE("Bummer"), NULL, NULL, B_WIDTH_FROM_WIDEST);
     176                alert->SetFlags(B_CLOSE_ON_ESCAPE);
    175177                alert->Go(NULL);
    176178            }
    177179            break;
  • src/apps/login/LoginApp.cpp

    diff --git a/src/apps/login/LoginApp.cpp b/src/apps/login/LoginApp.cpp
    index a8771b1..6fcb32b 100644
    a b LoginApp::ReadyToRun()  
    5151    BScreen screen;
    5252
    5353    if (fEditShelfMode) {
    54         (new BAlert(B_TRANSLATE("Info"), B_TRANSLATE("You can customize the "
     54        BAlert* alert = new BAlert(B_TRANSLATE("Info"), B_TRANSLATE("You can customize the "
    5555            "desktop shown behind the Login application by dropping replicants"
    5656            " onto it.\n"
    5757            "\n"
    5858            "When you are finished just quit the application (Alt-Q)."),
    59             B_TRANSLATE("OK")))->Go(NULL);
     59            B_TRANSLATE("OK"));
     60        alert->SetFlags(B_CLOSE_ON_ESCAPE);
     61        alert->Go(NULL);
    6062    } else {
    6163        BRect frame(0, 0, 450, 150);
    6264        frame.OffsetBySelf(screen.Frame().Width()/2 - frame.Width()/2,
    LoginApp::MessageReceived(BMessage *message)  
    9496            if (error < B_OK) {
    9597                BString msg(B_TRANSLATE("Error: %1"));
    9698                msg.ReplaceFirst("%1", strerror(error));
    97                 (new BAlert(("Error"), msg.String(), B_TRANSLATE("OK")))->Go();
     99                BAlert* alert = new BAlert(("Error"), msg.String(),
     100                    B_TRANSLATE("OK"));
     101                alert->SetFlags(B_CLOSE_ON_ESCAPE);
     102                alert->Go();
    98103            }
    99104            break;
    100105        }
    101106        case kSuspendAction:
    102             (new BAlert(B_TRANSLATE("Error"), B_TRANSLATE("Unimplemented"),
    103                 B_TRANSLATE("OK")))->Go();
     107        {
     108            BAlert* alert = new BAlert(B_TRANSLATE("Error"),
     109                B_TRANSLATE("Unimplemented"), B_TRANSLATE("OK"));
     110            alert->SetFlags(B_CLOSE_ON_ESCAPE);
     111            alert->Go();
    104112            break;
     113        }
    105114#endif
    106115    default:
    107116        BApplication::MessageReceived(message);
  • src/apps/mail/Content.cpp

    diff --git a/src/apps/mail/Content.cpp b/src/apps/mail/Content.cpp
    index e3390d2..b089ca0 100644
    a b TContentView::MessageReceived(BMessage *msg)  
    755755                free (signature);
    756756            } else {
    757757                beep();
    758                 (new BAlert("",
     758                BAlert* alert = new BAlert("",
    759759                    B_TRANSLATE("An error occurred trying to open this "
    760                         "signature."),
    761                     B_TRANSLATE("Sorry")))->Go();
     760                        "signature."), B_TRANSLATE("Sorry"));
     761                alert->SetFlags(B_CLOSE_ON_ESCAPE);
     762                alert->Go();
    762763            }
    763764            break;
    764765        }
    TTextView::Open(hyper_text *enclosure)  
    19141915            status_t result = be_roster->Launch(handlerToLaunch, 1, &enclosure->name);
    19151916            if (result != B_NO_ERROR && result != B_ALREADY_RUNNING) {
    19161917                beep();
    1917                 (new BAlert("",
     1918                BAlert* alert = new BAlert("",
    19181919                    B_TRANSLATE("There is no installed handler for "
    1919                         "URL links."),
    1920                     "Sorry"))->Go();
     1920                        "URL links."), B_TRANSLATE("Sorry"));
     1921                alert->SetFlags(B_CLOSE_ON_ESCAPE);
     1922                alert->Go();
    19211923            }
    19221924            break;
    19231925        }
    TTextView::Save(BMessage *msg, bool makeNewFile)  
    20652067
    20662068    if (result != B_NO_ERROR) {
    20672069        beep();
    2068         (new BAlert("", B_TRANSLATE("An error occurred trying to save "
    2069                 "the attachment."),
    2070             B_TRANSLATE("Sorry")))->Go();
     2070        BAlert* alert = new BAlert("", B_TRANSLATE("An error occurred trying to save "
     2071                "the attachment."), B_TRANSLATE("Sorry"));
     2072        alert->SetFlags(B_CLOSE_ON_ESCAPE);
     2073        alert->Go();
    20712074    }
    20722075
    20732076    return result;
    TTextView::Undo(BClipboard */*clipboard*/)  
    33373340                    Select(offset, offset + length);
    33383341                } else {
    33393342                    ::beep();
    3340                     (new BAlert("",
     3343                    BAlert* alert = new BAlert("",
    33413344                        B_TRANSLATE("Inconsistency occurred in the undo/redo "
    3342                             "buffer."),
    3343                         B_TRANSLATE("OK")))->Go();
     3345                            "buffer."), B_TRANSLATE("OK"));
     3346                    alert->SetFlags(B_CLOSE_ON_ESCAPE);
     3347                    alert->Go();
    33443348                }
    33453349                break;
    33463350        }
    TTextView::Redo()  
    33843388
    33853389            case K_REPLACED:
    33863390                ::beep();
    3387                 (new BAlert("",
     3391                BAlert* alert = new BAlert("",
    33883392                    B_TRANSLATE("Inconsistency occurred in the undo/redo "
    3389                         "buffer."),
    3390                     B_TRANSLATE("OK")))->Go();
     3393                        "buffer."), B_TRANSLATE("OK"));
     3394                alert->SetFlags(B_CLOSE_ON_ESCAPE);
     3395                alert->Go();
    33913396                break;
    33923397        }
    33933398        ScrollToSelection();
  • src/apps/mail/Enclosures.cpp

    diff --git a/src/apps/mail/Enclosures.cpp b/src/apps/mail/Enclosures.cpp
    index 469fa1d..372b095 100644
    a b TEnclosuresView::MessageReceived(BMessage *msg)  
    249249                    if (window && window->Mail())
    250250                        window->Mail()->RemoveComponent(item->Component());
    251251
    252                     (new BAlert("", B_TRANSLATE(
     252                    BAlert* alert = new BAlert("", B_TRANSLATE(
    253253                        "Removing attachments from a forwarded mail is not yet "
    254254                        "implemented!\nIt will not yet work correctly."),
    255                         B_TRANSLATE("OK")))->Go();
     255                        B_TRANSLATE("OK"));
     256                    alert->SetFlags(B_CLOSE_ON_ESCAPE);
     257                    alert->Go();
    256258                }
    257259                else
    258260                    watch_node(item->NodeRef(), B_STOP_WATCHING, this);
    TEnclosuresView::MessageReceived(BMessage *msg)  
    302304                if (badType)
    303305                {
    304306                    beep();
    305                     (new BAlert("",
     307                    BAlert* alert = new BAlert("",
    306308                        B_TRANSLATE("Only files can be added as attachments."),
    307                         B_TRANSLATE("OK")))->Go();
     309                        B_TRANSLATE("OK"));
     310                    alert->SetFlags(B_CLOSE_ON_ESCAPE);
     311                    alert->Go();
    308312                }
    309313            }
    310314            break;
  • src/apps/mail/MailWindow.cpp

    diff --git a/src/apps/mail/MailWindow.cpp b/src/apps/mail/MailWindow.cpp
    index d06867f..2ff0552 100644
    a b TMailWindow::MessageReceived(BMessage *msg)  
    11771177                        msg.AddRef("refs", fRef);
    11781178                        tracker.SendMessage(&msg);
    11791179                    } else {
    1180                         (new BAlert("",
     1180                        BAlert* alert = new BAlert("",
    11811181                            B_TRANSLATE("Need Tracker to move items to trash"),
    1182                             B_TRANSLATE("Sorry")))->Go();
     1182                            B_TRANSLATE("Sorry"));
     1183                        alert->SetFlags(B_CLOSE_ON_ESCAPE);
     1184                        alert->Go();
    11831185                    }
    11841186                }
    11851187            } else {
    TMailWindow::MessageReceived(BMessage *msg)  
    13441346                    1, &arg);
    13451347
    13461348                if (result != B_NO_ERROR) {
    1347                     (new BAlert("", B_TRANSLATE(
     1349                    BAlert* alert = new BAlert("", B_TRANSLATE(
    13481350                        "Sorry, could not find an application that "
    13491351                        "supports the 'Person' data type."),
    1350                         B_TRANSLATE("OK")))->Go();
     1352                        B_TRANSLATE("OK"));
     1353                    alert->SetFlags(B_CLOSE_ON_ESCAPE);
     1354                    alert->Go();
    13511355                }
    1352 
    13531356            }
    1354 
    13551357            free(arg);
    13561358            break;
    13571359        }
    TMailWindow::MessageReceived(BMessage *msg)  
    15811583                snooze (1500000);
    15821584            if (!gDictCount) {
    15831585                beep();
    1584                 (new BAlert("",
     1586                BAlert* alert = new BAlert("",
    15851587                    B_TRANSLATE("Mail couldn't find its dictionary."),
    15861588                    B_TRANSLATE("OK"), NULL, NULL, B_WIDTH_AS_USUAL,
    1587                     B_OFFSET_SPACING, B_STOP_ALERT))->Go();
     1589                    B_OFFSET_SPACING, B_STOP_ALERT);
     1590                alert->SetFlags(B_CLOSE_ON_ESCAPE);
     1591                alert->Go();
    15881592            } else {
    15891593                fSpelling->SetMarked(!fSpelling->IsMarked());
    15901594                fContentView->fTextView->EnableSpellCheck(
    TMailWindow::MessageReceived(BMessage *msg)  
    16261630                    B_TRANSLATE("Put your favorite e-mail queries and query "
    16271631                    "templates in this folder."), B_TRANSLATE("OK"), NULL, NULL,
    16281632                    B_WIDTH_AS_USUAL, B_IDEA_ALERT);
     1633                alert->SetFlags(B_CLOSE_ON_ESCAPE);
    16291634                alert->Go(NULL);
    16301635            }
    16311636
    TMailWindow::Send(bool now)  
    22252230        status_t status = SaveAsDraft();
    22262231        if (status != B_OK) {
    22272232            beep();
    2228             (new BAlert("", B_TRANSLATE("E-mail draft could not be saved!"),
    2229                 B_TRANSLATE("OK")))->Go();
     2233            BAlert* alert = new BAlert("", B_TRANSLATE("E-mail draft could "
     2234                "not be saved!"), B_TRANSLATE("OK"));
     2235            alert->SetFlags(B_CLOSE_ON_ESCAPE);
     2236            alert->Go();
    22302237        }
    22312238        return status;
    22322239    }
    TMailWindow::Send(bool now)  
    23152322                        "the unencodable ones), or choose Cancel to go back "
    23162323                        "and try fixing it up.");
    23172324                    messageString.ReplaceFirst("%ld", countString);
    2318                     userAnswer = (new BAlert("Question", messageString.String(),
     2325                    BAlert* alert = new BAlert("Question", messageString.String(),
    23192326                        B_TRANSLATE("Send"),
    23202327                        B_TRANSLATE("Cancel"),
    23212328                        NULL, B_WIDTH_AS_USUAL, B_OFFSET_SPACING,
    2322                         B_WARNING_ALERT))->Go();
     2329                        B_WARNING_ALERT);
     2330                    alert->SetShortcut(1, B_ESCAPE);
     2331                    userAnswer = alert->Go();
     2332                   
    23232333                    if (userAnswer == 1) {
    23242334                        // Cancel was picked.
    23252335                        return -1;
    TMailWindow::Send(bool now)  
    24502460            close = true;
    24512461            fSent = true;
    24522462
    2453             int32 start = (new BAlert("no daemon",
     2463            BAlert* alert = new BAlert("no daemon",
    24542464                B_TRANSLATE("The mail_daemon is not running. The message is "
    24552465                "queued and will be sent when the mail_daemon is started."),
    2456                 B_TRANSLATE("Start now"), B_TRANSLATE("OK")))->Go();
    2457 
     2466                B_TRANSLATE("Start now"), B_TRANSLATE("OK"));
     2467            alert->SetShortcut(1, B_ESCAPE);
     2468            int32 start = alert->Go();
     2469           
    24582470            if (start == 0) {
    24592471                result = be_roster->Launch("application/x-vnd.Be-POST");
    24602472                if (result == B_OK) {
    TMailWindow::Send(bool now)  
    24892501
    24902502    if (result != B_NO_ERROR && result != B_MAIL_NO_DAEMON) {
    24912503        beep();
    2492         (new BAlert("", errorMessage.String(), B_TRANSLATE("OK")))->Go();
     2504        BAlert* alert = new BAlert("", errorMessage.String(), B_TRANSLATE("OK"));
     2505        alert->SetFlags(B_CLOSE_ON_ESCAPE);
     2506        alert->Go();
    24932507    }
    24942508    if (close) {
    24952509        PostMessage(B_QUIT_REQUESTED);
    ErrorExit:  
    27212735    sprintf(errorString, "Unable to train the message file \"%s\" as %s.  "
    27222736        "Possibly useful error code: %s (%ld).",
    27232737        filePath.Path(), CommandWord, strerror (errorCode), errorCode);
    2724     (new BAlert("", errorString,
    2725         B_TRANSLATE("OK")))->Go();
     2738    BAlert* alert = new BAlert("", errorString, B_TRANSLATE("OK"));
     2739    alert->SetFlags(B_CLOSE_ON_ESCAPE);
     2740    alert->Go();
     2741
    27262742    return errorCode;
    27272743}
    27282744
  • src/apps/mail/Signature.cpp

    diff --git a/src/apps/mail/Signature.cpp b/src/apps/mail/Signature.cpp
    index 405bb69..065b958 100644
    a b TSignatureWindow::MessageReceived(BMessage* msg)  
    192192            Save();
    193193            break;
    194194
    195         case M_DELETE:
    196             if (!(new BAlert("",
     195        case M_DELETE: {
     196            BAlert* alert = new BAlert("",
    197197                    B_TRANSLATE("Really delete this signature? This cannot "
    198198                        "be undone."),
    199199                    B_TRANSLATE("Cancel"),
    200200                    B_TRANSLATE("Delete"),
    201                     NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go())
     201                    NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
     202            alert->SetShortcut(0, B_ESCAPE);
     203            int32 choice = alert->Go();
     204           
     205            if (choice == 0)
    202206                break;
    203207
    204208            if (fFile) {
    TSignatureWindow::MessageReceived(BMessage* msg)  
    210214                fSigView->fName->MakeFocus(true);
    211215            }
    212216            break;
    213 
     217        }
    214218        case M_SIGNATURE:
    215219            if (Clear()) {
    216220                msg->FindRef("ref", &ref);
    TSignatureWindow::MessageReceived(BMessage* msg)  
    231235                else {
    232236                    fFile = NULL;
    233237                    beep();
    234                     (new BAlert("",
     238                    BAlert* alert = new BAlert("",
    235239                        B_TRANSLATE("Couldn't open this signature. Sorry."),
    236                         B_TRANSLATE("OK")))->Go();
     240                        B_TRANSLATE("OK"));
     241                    alert->SetFlags(B_CLOSE_ON_ESCAPE);
     242                    alert->Go();
    237243                }
    238244            }
    239245            break;
    TSignatureWindow::Save()  
    385391
    386392err_exit:
    387393    beep();
    388     (new BAlert("",
     394    BAlert* alert = new BAlert("",
    389395        B_TRANSLATE("An error occurred trying to save this signature."),
    390         B_TRANSLATE("Sorry")))->Go();
     396        B_TRANSLATE("Sorry"));
     397    alert->SetFlags(B_CLOSE_ON_ESCAPE);
     398    alert->Go();
    391399}
    392400
    393401
  • src/apps/mediaconverter/MediaConverterApp.cpp

    diff --git a/src/apps/mediaconverter/MediaConverterApp.cpp b/src/apps/mediaconverter/MediaConverterApp.cpp
    index f9397d5..67af425 100644
    a b MediaConverterApp::RefsReceived(BMessage* msg)  
    146146        BAlert* alert = new BAlert((errors > 1) ?
    147147            B_TRANSLATE("Error loading files") :
    148148            B_TRANSLATE("Error loading a file"),
    149             alertText.String(), B_TRANSLATE("Continue") , NULL, NULL,
     149            alertText.String(), B_TRANSLATE("Continue"), NULL, NULL,
    150150            B_WIDTH_AS_USUAL, B_STOP_ALERT);
    151151        alert->Go();
    152152    }
  • src/apps/mediaconverter/MediaConverterWindow.cpp

    diff --git a/src/apps/mediaconverter/MediaConverterWindow.cpp b/src/apps/mediaconverter/MediaConverterWindow.cpp
    index c628866..74b3991 100644
    a b MediaConverterWindow::MessageReceived(BMessage* msg)  
    428428            if (status != B_OK && status != B_ALREADY_RUNNING) {
    429429                BString errorString(B_TRANSLATE("Error launching: %strError%"));
    430430                errorString.ReplaceFirst("%strError%", strerror(status));
    431                 (new BAlert(B_TRANSLATE("Error"), errorString.String(),
    432                     B_TRANSLATE("OK")))->Go();
     431                BAlert* alert = new BAlert(B_TRANSLATE("Error"),
     432                    errorString.String(), B_TRANSLATE("OK"));
     433                alert->SetFlags(B_CLOSE_ON_ESCAPE);
     434                alert->Go();
    433435            }
    434436            break;
    435437        }
  • src/apps/mediaconverter/MediaFileInfoView.cpp

    diff --git a/src/apps/mediaconverter/MediaFileInfoView.cpp b/src/apps/mediaconverter/MediaFileInfoView.cpp
    index 6cd20e5..8dc8ed6 100644
    a b MediaFileInfoView::Update(BMediaFile* file, entry_ref* ref)  
    165165            BAlert* alert = new BAlert(
    166166                B_TRANSLATE("File Error"), error.String(),
    167167                B_TRANSLATE("OK"));
     168            alert->SetFlags(B_CLOSE_ON_ESCAPE);
    168169            alert->Go(NULL);
    169170        }
    170171    } else {
  • src/apps/mediaplayer/MainApp.cpp

    diff --git a/src/apps/mediaplayer/MainApp.cpp b/src/apps/mediaplayer/MainApp.cpp
    index 427de76..4b435d7 100644
    a b MainApp::MainApp()  
    9393            "Would you like to start it ?"), B_TRANSLATE("Quit"),
    9494            B_TRANSLATE("Start media server"), NULL,
    9595            B_WIDTH_AS_USUAL, B_WARNING_ALERT);
     96        alert->SetShortcut(0, B_ESCAPE);
     97       
    9698        if (alert->Go() == 0) {
    9799            PostMessage(B_QUIT_REQUESTED);
    98100            return;
  • src/apps/mediaplayer/MainWin.cpp

    diff --git a/src/apps/mediaplayer/MainWin.cpp b/src/apps/mediaplayer/MainWin.cpp
    index e9ebd34..15ac18b 100644
    a b MainWin::MessageReceived(BMessage* msg)  
    633633            BAlert* alert = new BAlert(B_TRANSLATE("Nothing to Play"),
    634634                B_TRANSLATE("None of the files you wanted to play appear "
    635635                "to be media files."), B_TRANSLATE("OK"));
     636            alert->SetFlags(B_CLOSE_ON_ESCAPE);
    636637            alert->Go();
    637638            fControls->SetDisabledString(kDisabledSeekMessage);
    638639            break;
    MainWin::OpenPlaylistItem(const PlaylistItemRef& item)  
    10901091        BString message = B_TRANSLATE("%app% encountered an internal error. "
    10911092            "The file could not be opened.");
    10921093        message.ReplaceFirst("%app%", kApplicationName);
    1093         (new BAlert(kApplicationName, message.String(),
    1094             B_TRANSLATE("OK")))->Go();
     1094        BAlert* alert = new BAlert(kApplicationName, message.String(),
     1095            B_TRANSLATE("OK"));
     1096        alert->SetFlags(B_CLOSE_ON_ESCAPE);
     1097        alert->Go();
    10951098        _PlaylistItemOpened(item, ret);
    10961099    } else {
    10971100        BString string;
    MainWin::_PlaylistItemOpened(const PlaylistItemRef& item, status_t result)  
    13371340            } else {
    13381341                message << B_TRANSLATE("Error: ") << strerror(result);
    13391342            }
    1340             (new BAlert("error", message.String(), B_TRANSLATE("OK")))->Go();
     1343            BAlert* alert = new BAlert("error", message.String(),
     1344                B_TRANSLATE("OK"));
     1345            alert->SetFlags(B_CLOSE_ON_ESCAPE);
     1346            alert->Go();
    13411347            fControls->SetDisabledString(kDisabledSeekMessage);
    13421348        } else {
    13431349            // Just go to the next file and don't bother user (yet)
  • src/apps/mediaplayer/playlist/PlaylistWindow.cpp

    diff --git a/src/apps/mediaplayer/playlist/PlaylistWindow.cpp b/src/apps/mediaplayer/playlist/PlaylistWindow.cpp
    index 8e4d9f1..5dfbc0f 100644
    a b display_save_alert(const char* message)  
    5757{
    5858    BAlert* alert = new BAlert(B_TRANSLATE("Save error"), message,
    5959        B_TRANSLATE("OK"), NULL, NULL, B_WIDTH_AS_USUAL, B_STOP_ALERT);
     60    alert->SetFlags(B_CLOSE_ON_ESCAPE);
    6061    alert->Go(NULL);
    6162}
    6263
  • src/apps/mediaplayer/playlist/RemovePLItemsCommand.cpp

    diff --git a/src/apps/mediaplayer/playlist/RemovePLItemsCommand.cpp b/src/apps/mediaplayer/playlist/RemovePLItemsCommand.cpp
    index a872bc3..e4b9e28 100644
    a b RemovePLItemsCommand::Perform()  
    118118                message <<
    119119                    B_TRANSLATE("Some files could not be moved into Trash.");
    120120            message << "\n\n" << B_TRANSLATE("Error: ") << strerror(moveError);
    121             (new BAlert(B_TRANSLATE("Move Into Trash Error"), message.String(),
    122                 B_TRANSLATE("OK"), NULL, NULL, B_WIDTH_AS_USUAL,
    123                 B_WARNING_ALERT))->Go(NULL);
     121            BAlert* alert = new BAlert(B_TRANSLATE("Move into trash error"),
     122                message.String(), B_TRANSLATE("OK"), NULL, NULL,
     123                B_WIDTH_AS_USUAL, B_WARNING_ALERT);
     124            alert->SetFlags(B_CLOSE_ON_ESCAPE);
     125            alert->Go(NULL);
    124126        }
    125127    }
    126128
  • src/apps/midiplayer/MidiPlayerApp.cpp

    diff --git a/src/apps/midiplayer/MidiPlayerApp.cpp b/src/apps/midiplayer/MidiPlayerApp.cpp
    index 0450d27..e1d45a0 100644
    a b MidiPlayerApp::ReadyToRun()  
    4848void
    4949MidiPlayerApp::AboutRequested()
    5050{
    51     (new BAlert(
    52         NULL,
     51    BAlert* alert = new BAlert(NULL,
    5352        B_TRANSLATE_COMMENT("Haiku MIDI Player 1.0.0 beta\n\n"
    5453        "This tiny program\n"
    5554        "Knows how to play thousands of\n"
    56         "Cheesy sounding songs", "This is a haiku. First line has five syllables, second has seven and last has five again. Create your own."),
    57         "Okay", NULL, NULL,
    58         B_WIDTH_AS_USUAL, B_INFO_ALERT))->Go();
     55        "Cheesy sounding songs", "This is a haiku. First line has five "
     56        "syllables, second has seven and last has five again. "
     57        "Create your own."), B_TRANSLATE("OK"), NULL, NULL,
     58        B_WIDTH_AS_USUAL, B_INFO_ALERT);
     59        alert->SetFlags(B_CLOSE_ON_ESCAPE);
     60        alert->Go();
    5961}
    6062
    6163
  • src/apps/midiplayer/MidiPlayerWindow.cpp

    diff --git a/src/apps/midiplayer/MidiPlayerWindow.cpp b/src/apps/midiplayer/MidiPlayerWindow.cpp
    index 3479e8f..cd8794b 100644
    a b MidiPlayerWindow::LoadFile(entry_ref* ref)  
    381381        scopeView->SetPlaying(false);
    382382        scopeView->Invalidate();
    383383
    384         (new BAlert(NULL, B_TRANSLATE("Could not load song"),
     384        BAlert* alert = new BAlert(NULL, B_TRANSLATE("Could not load song"),
    385385            B_TRANSLATE("OK"), NULL, NULL,
    386             B_WIDTH_AS_USUAL, B_STOP_ALERT))->Go();
     386            B_WIDTH_AS_USUAL, B_STOP_ALERT);
     387        alert->SetFlags(B_CLOSE_ON_ESCAPE);
     388        alert->Go();
    387389    }
    388390}
    389391
  • src/apps/networkstatus/NetworkStatus.cpp

    diff --git a/src/apps/networkstatus/NetworkStatus.cpp b/src/apps/networkstatus/NetworkStatus.cpp
    index b7a9897..557523b 100644
    a b NetworkStatus::ReadyToRun()  
    156156            "in a window or install it in the Deskbar."),
    157157            B_TRANSLATE("Run in window"), B_TRANSLATE("Install in Deskbar"),
    158158            NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
    159         alert->SetShortcut(0, B_ESCAPE);
    160159
    161160        if (alert->Go() == 1) {
    162161            _InstallReplicantInDeskbar();
  • src/apps/networkstatus/NetworkStatusView.cpp

    diff --git a/src/apps/networkstatus/NetworkStatusView.cpp b/src/apps/networkstatus/NetworkStatusView.cpp
    index f3490d9..758f069 100644
    a b NetworkStatusView::MessageReceived(BMessage* message)  
    298298                    BAlert* alert = new BAlert(name, text.String(),
    299299                        B_TRANSLATE("OK"), NULL, NULL, B_WIDTH_AS_USUAL,
    300300                        B_STOP_ALERT);
     301                    alert->SetFlags(B_CLOSE_ON_ESCAPE);
    301302                    alert->Go(NULL);
    302303                }
    303304            }
    NetworkStatusView::_ShowConfiguration(BMessage* message)  
    401402    }
    402403
    403404    BAlert* alert = new BAlert(name, text.String(), B_TRANSLATE("OK"));
     405    alert->SetFlags(B_CLOSE_ON_ESCAPE);
    404406    BTextView* view = alert->TextView();
    405407    BFont font;
    406408
    NetworkStatusView::_AboutRequested()  
    509511    about.ReplaceFirst("%2", "Copyright 2007-2010");
    510512        // Append a new year here
    511513    BAlert* alert = new BAlert("about", about, B_TRANSLATE("OK"));
     514    alert->SetFlags(B_CLOSE_ON_ESCAPE);
    512515    BTextView *view = alert->TextView();
    513516    BFont font;
    514517
    NetworkStatusView::_OpenNetworksPreferences()  
    602605        errorMessage << strerror(status);
    603606        BAlert* alert = new BAlert("launch error", errorMessage.String(),
    604607            B_TRANSLATE("OK"));
     608        alert->SetFlags(B_CLOSE_ON_ESCAPE);
    605609
    606610        // asynchronous alert in order to not block replicant host application
    607611        alert->Go(NULL);
  • src/apps/overlayimage/OverlayView.cpp

    diff --git a/src/apps/overlayimage/OverlayView.cpp b/src/apps/overlayimage/OverlayView.cpp
    index 9efac70..f133534 100644
    a b OverlayView::OverlayAboutRequested()  
    159159        "originally by Seth Flaxman\n\t"
    160160        "modified by Hartmuth Reh\n\t"
    161161        "further modified by Humdinger\n",
    162         "OK");
    163 
     162        "OK"); 
    164163    BTextView *view = alert->TextView();
    165164    BFont font;
    166165    view->SetStylable(true);
    OverlayView::OverlayAboutRequested()  
    168167    font.SetSize(font.Size() + 7.0f);
    169168    font.SetFace(B_BOLD_FACE);
    170169    view->SetFontAndColor(0, 12, &font);
    171    
     170    alert->SetFlags(B_CLOSE_ON_ESCAPE);
    172171    alert->Go();
    173172}
  • src/apps/packageinstaller/PackageInfo.cpp

    diff --git a/src/apps/packageinstaller/PackageInfo.cpp b/src/apps/packageinstaller/PackageInfo.cpp
    index d8bfdd0..22cfe55 100644
    a b PackageInfo::Parse()  
    10441044                B_TRANSLATE("Continue"),
    10451045                B_TRANSLATE("Abort"), NULL,
    10461046            B_WIDTH_AS_USUAL, B_WARNING_ALERT);
     1047        warning->SetShortcut(1, B_ESCAPE);
    10471048        selection = warning->Go();
    10481049
    10491050        if (selection == 1) {
  • src/apps/packageinstaller/PackageInstall.cpp

    diff --git a/src/apps/packageinstaller/PackageInstall.cpp b/src/apps/packageinstaller/PackageInstall.cpp
    index a779e1b..c4b4b2f 100644
    a b PackageInstall::_Install()  
    125125                "and continue the installation?"),
    126126            B_TRANSLATE("Continue"),
    127127            B_TRANSLATE("Abort"));
     128        reinstall->SetShortcut(1, B_ESCAPE);
    128129
    129130        if (reinstall->Go() == 0) {
    130131            // Uninstall the package
  • src/apps/packageinstaller/PackageView.cpp

    diff --git a/src/apps/packageinstaller/PackageView.cpp b/src/apps/packageinstaller/PackageView.cpp
    index 8575454..ae80fcc 100644
    a b PackageView::AttachedToWindow()  
    9898                "possible reasons for this might be that the requested file "
    9999                "is not a valid BeOS .pkg package."), B_TRANSLATE("OK"),
    100100                NULL, NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
     101        warning->SetFlags(B_CLOSE_ON_ESCAPE);
    101102        warning->Go();
    102103
    103104        Window()->PostMessage(B_QUIT_REQUESTED);
    PackageView::MessageReceived(BMessage *msg)  
    195196                B_TRANSLATE("The package you requested has been successfully "
    196197                    "installed on your system."),
    197198                B_TRANSLATE("OK"));
     199            notify->SetFlags(B_CLOSE_ON_ESCAPE);
    198200
    199201            notify->Go();
    200202            fStatusWindow->Hide();
    PackageView::MessageReceived(BMessage *msg)  
    214216                B_TRANSLATE(
    215217                    "The installation of the package has been aborted."),
    216218                B_TRANSLATE("OK"));
     219            notify->SetFlags(B_CLOSE_ON_ESCAPE);
    217220            notify->Go();
    218221            fStatusWindow->Hide();
    219222            fInstall->SetEnabled(true);
    PackageView::MessageReceived(BMessage *msg)  
    234237                NULL, NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
    235238            fprintf(stderr,
    236239                B_TRANSLATE("Error while installing the package\n"));
     240            notify->SetFlags(B_CLOSE_ON_ESCAPE);
    237241            notify->Go();
    238242            fStatusWindow->Hide();
    239243            fInstall->SetEnabled(true);
    PackageView::ItemExists(PackageItem &item, BPath &path, int32 &policy)  
    354358                B_TRANSLATE("Replace"),
    355359                B_TRANSLATE("Skip"),
    356360                B_TRANSLATE("Abort"));
    357 
     361            alert->SetShortcut(2, B_ESCAPE);
     362           
    358363            choice = alert->Go();
    359364            switch (choice) {
    360365                case 0:
  • src/apps/pairs/PairsView.cpp

    diff --git a/src/apps/pairs/PairsView.cpp b/src/apps/pairs/PairsView.cpp
    index 5a68a38..1069a8f 100644
    a b PairsView::_ReadRandomIcons()  
    175175            BAlert* alert = new BAlert("Fatal", msgStr.String(),
    176176                B_TRANSLATE("OK"),  NULL, NULL, B_WIDTH_FROM_WIDEST,
    177177                B_STOP_ALERT);
    178             alert->SetShortcut(0, B_ESCAPE);
     178            alert->SetFlags(B_CLOSE_ON_ESCAPE);
    179179            alert->Go();
    180180            exit(1);
    181181        }
  • src/apps/people/PeopleApp.cpp

    diff --git a/src/apps/people/PeopleApp.cpp b/src/apps/people/PeopleApp.cpp
    index 41a3a36..5f954d5 100644
    a b TPeopleApp::MessageReceived(BMessage* message)  
    247247                BAlert* alert = new BAlert(B_TRANSLATE("Error"),
    248248                    errorMsg.String(), B_TRANSLATE("OK"), NULL, NULL,
    249249                    B_WIDTH_AS_USUAL, B_STOP_ALERT);
     250                alert->SetFlags(B_CLOSE_ON_ESCAPE);
    250251                alert->Go(NULL);
    251252            }
    252253            break;
  • src/apps/people/PersonWindow.cpp

    diff --git a/src/apps/people/PersonWindow.cpp b/src/apps/people/PersonWindow.cpp
    index 291b1df..b9532ed 100644
    a b PersonWindow::MessageReceived(BMessage* msg)  
    216216                    }
    217217                    else {
    218218                        sprintf(str, B_TRANSLATE("Could not create %s."), name);
    219                         (new BAlert("", str, B_TRANSLATE("Sorry")))->Go();
     219                        BAlert* alert = new BAlert("", str, B_TRANSLATE("Sorry"));
     220                        alert->SetFlags(B_CLOSE_ON_ESCAPE);
     221                        alert->Go();
    220222                    }
    221223                }
    222224            }
    PersonWindow::QuitRequested()  
    294296    status_t result;
    295297
    296298    if (!fView->IsSaved()) {
    297         result = (new BAlert("", B_TRANSLATE("Save changes before quitting?"),
     299        BAlert* alert = new BAlert("", B_TRANSLATE("Save changes before quitting?"),
    298300                            B_TRANSLATE("Cancel"), B_TRANSLATE("Quit"),
    299                             B_TRANSLATE("Save")))->Go();
     301                            B_TRANSLATE("Save"));
     302        alert->SetShortcut(0, B_ESCAPE);
     303        result = alert->Go();
     304
    300305        if (result == 2) {
    301306            if (fRef)
    302307                fView->Save();
  • src/apps/people/PictureView.cpp

    diff --git a/src/apps/people/PictureView.cpp b/src/apps/people/PictureView.cpp
    index 90b97b5..6b75146 100644
    a b PictureView::_HandleDrop(BMessage* msg)  
    564564            text.ReplaceFirst("%name%", name);
    565565            BAlert* alert = new BAlert(B_TRANSLATE("Error"), text.String(),
    566566                B_TRANSLATE("OK"), NULL, NULL, B_WIDTH_AS_USUAL, B_STOP_ALERT);
     567            alert->SetFlags(B_CLOSE_ON_ESCAPE);
    567568            alert->Go();
    568569        }
    569570    }
  • src/apps/poorman/PoorManWindow.cpp

    diff --git a/src/apps/poorman/PoorManWindow.cpp b/src/apps/poorman/PoorManWindow.cpp
    index 019ecc1..4652952 100644
    a b PoorManWindow::DefaultSettings()  
    545545{
    546546    BAlert* serverAlert = new BAlert(B_TRANSLATE("Error Server"),
    547547        STR_ERR_CANT_START, B_TRANSLATE("OK"));
     548    serverAlert->SetFlags(B_CLOSE_ON_ESCAPE);
    548549    BAlert* dirAlert = new BAlert(B_TRANSLATE("Error Dir"),
    549550        STR_ERR_WEB_DIR, B_TRANSLATE("Cancel"), B_TRANSLATE("Select"),
    550551        B_TRANSLATE("Default"), B_WIDTH_AS_USUAL, B_OFFSET_SPACING);
    PoorManWindow::DefaultSettings()  
    576577            BAlert* dirCreatedAlert =
    577578                new BAlert(B_TRANSLATE("Dir Created"), STR_DIR_CREATED,
    578579                    B_TRANSLATE("OK"));
     580            dirCreatedAlert->SetFlags(B_CLOSE_ON_ESCAPE);
    579581            dirCreatedAlert->Go();
    580582            SetWebDir(STR_DEFAULT_WEB_DIRECTORY);   
    581583            be_app->PostMessage(kStartServer);
  • src/apps/powerstatus/PowerStatus.cpp

    diff --git a/src/apps/powerstatus/PowerStatus.cpp b/src/apps/powerstatus/PowerStatus.cpp
    index ebaefb7..06b9355 100644
    a b PowerStatus::ReadyToRun()  
    9090            "or install it in the Deskbar."), B_TRANSLATE("Run in window"),
    9191            B_TRANSLATE("Install in Deskbar"), NULL, B_WIDTH_AS_USUAL,
    9292            B_WARNING_ALERT);
    93         alert->SetShortcut(0, B_ESCAPE);
    9493
    9594        if (alert->Go()) {
    9695            image_info info;
  • src/apps/powerstatus/PowerStatusView.cpp

    diff --git a/src/apps/powerstatus/PowerStatusView.cpp b/src/apps/powerstatus/PowerStatusView.cpp
    index 647dae5..83dd1bd 100644
    a b PowerStatusReplicant::_AboutRequested()  
    635635    font.SetFace(B_BOLD_FACE);
    636636    view->SetFontAndColor(0, strlen(B_TRANSLATE("PowerStatus")), &font);
    637637
     638    alert->SetFlags(B_CLOSE_ON_ESCAPE);
    638639    alert->Go();
    639640}
    640641
  • src/apps/processcontroller/PCWorld.cpp

    diff --git a/src/apps/processcontroller/PCWorld.cpp b/src/apps/processcontroller/PCWorld.cpp
    index d4b8c7d..b456d15 100644
    a b PCApplication::ReadyToRun()  
    9393            " or install it in the Deskbar."), B_TRANSLATE("Run in window"),
    9494            B_TRANSLATE("Install in Deskbar"),
    9595            NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
    96         alert->SetShortcut(0, B_ESCAPE);
    9796
    9897        if (alert->Go() != 0) {
    9998            BDeskbar deskbar;
    PCApplication::ReadyToRun()  
    107106            B_TRANSLATE("ProcessController is already installed in Deskbar."),
    108107            B_TRANSLATE("OK"), NULL,
    109108            NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
    110         alert->SetShortcut(0, B_ESCAPE);
     109        alert->SetFlags(B_CLOSE_ON_ESCAPE);
    111110        alert->Go();
    112111    }
    113112
  • src/apps/processcontroller/Preferences.cpp

    diff --git a/src/apps/processcontroller/Preferences.cpp b/src/apps/processcontroller/Preferences.cpp
    index 8b4ca9b..0f22437 100644
    a b Preferences::~Preferences()  
    115115            BAlert *alert = new BAlert(B_TRANSLATE("Error saving file"),
    116116                error.String(), B_TRANSLATE("Damned!"), NULL, NULL,
    117117                B_WIDTH_AS_USUAL, B_STOP_ALERT);
    118             alert->SetShortcut(0, B_ESCAPE);
    119 
     118            alert->SetFlags(B_CLOSE_ON_ESCAPE);
    120119            alert->Go();
    121120        }
    122121    }
  • src/apps/processcontroller/ProcessController.cpp

    diff --git a/src/apps/processcontroller/ProcessController.cpp b/src/apps/processcontroller/ProcessController.cpp
    index 168a4ef..8146fff 100644
    a b ProcessController::MessageReceived(BMessage *message)  
    280280                        B_TRANSLATE("This team is already gone"B_UTF8_ELLIPSIS),
    281281                        B_TRANSLATE("Ok!"), NULL, NULL, B_WIDTH_AS_USUAL,
    282282                        B_STOP_ALERT);
    283                     alert->SetShortcut(0, B_ESCAPE);
     283                    alert->SetFlags(B_CLOSE_ON_ESCAPE);
    284284                    alert->Go();
    285285                }
    286286            }
    ProcessController::MessageReceived(BMessage *message)  
    298298                        B_TRANSLATE("Cancel"), B_TRANSLATE("Debug this thread!"),
    299299                        B_TRANSLATE("Kill this thread!"), B_WIDTH_AS_USUAL,
    300300                        B_STOP_ALERT);
     301                    alert->SetShortcut(0, B_ESCAPE);
     302
    301303                    #define KILL 2
    302304                    #else
    303305                    snprintf(question, sizeof(question),
    ProcessController::MessageReceived(BMessage *message)  
    306308                    alert = new BAlert(B_TRANSLATE("Please confirm"), question,
    307309                        B_TRANSLATE("Cancel"), B_TRANSLATE("Kill this thread!"),
    308310                        NULL, B_WIDTH_AS_USUAL, B_STOP_ALERT);
     311                    alert->SetShortcut(0, B_ESCAPE);
     312                   
    309313                    #define KILL 1
    310314                    #endif
    311315                    alert->SetShortcut(0, B_ESCAPE);
    ProcessController::MessageReceived(BMessage *message)  
    330334                        B_TRANSLATE("This thread is already gone"B_UTF8_ELLIPSIS),
    331335                        B_TRANSLATE("Ok!"), NULL, NULL,
    332336                        B_WIDTH_AS_USUAL, B_STOP_ALERT);
    333                     alert->SetShortcut(0, B_ESCAPE);
     337                    alert->SetFlags(B_CLOSE_ON_ESCAPE);
    334338                    alert->Go();
    335339                }
    336340            }
    ProcessController::MessageReceived(BMessage *message)  
    408412                        "You can't turn it off!"),
    409413                        B_TRANSLATE("That's no Fun!"), NULL, NULL,
    410414                        B_WIDTH_AS_USUAL, B_WARNING_ALERT);
    411                     alert->SetShortcut(0, B_ESCAPE);
     415                    alert->SetFlags(B_CLOSE_ON_ESCAPE);
    412416                    alert->Go();
    413417                } else
    414418                    _kern_set_cpu_enabled(cpu, !_kern_cpu_enabled(cpu));
    thread_debug_thread(void *arg)  
    893897                        alert = new BAlert("", "The semaphore wasn't released, "
    894898                            "because it wasn't necessary anymore!",
    895899                            "OK", NULL, NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
     900                        alert->SetFlags(B_CLOSE_ON_ESCAPE);
    896901                        alert->Go();
    897902                    }
    898903                }
  • src/apps/pulse/CPUButton.cpp

    diff --git a/src/apps/pulse/CPUButton.cpp b/src/apps/pulse/CPUButton.cpp
    index 2d18eed..4d1e142 100644
    a b CPUButton::Invoke(BMessage *message)  
    243243        BAlert *alert = new BAlert(B_TRANSLATE("Info"),
    244244            B_TRANSLATE("You can't disable the last active CPU."),
    245245            B_TRANSLATE("OK"));
    246         alert->SetShortcut(0, B_ESCAPE);
     246        alert->SetFlags(B_CLOSE_ON_ESCAPE);
    247247        alert->Go(NULL);
    248248        SetValue(!Value());
    249249    }
  • src/apps/pulse/DeskbarPulseView.cpp

    diff --git a/src/apps/pulse/DeskbarPulseView.cpp b/src/apps/pulse/DeskbarPulseView.cpp
    index 802f7bb..6594d70 100644
    a b void DeskbarPulseView::Remove() {  
    182182        str.UnlockBuffer();
    183183        BAlert *alert = new BAlert(B_TRANSLATE("Info"), str.String(),
    184184            B_TRANSLATE("OK"));
    185         alert->SetShortcut(0, B_ESCAPE);
     185        alert->SetFlags(B_CLOSE_ON_ESCAPE);
    186186        alert->Go(NULL);
    187187    }
    188188    delete deskbar;
  • src/apps/pulse/PulseApp.cpp

    diff --git a/src/apps/pulse/PulseApp.cpp b/src/apps/pulse/PulseApp.cpp
    index 9006f2f..06c3f02 100644
    a b PulseApp::ShowAbout(bool asApplication)  
    193193    font.SetSize(18);
    194194    font.SetFace(B_BOLD_FACE);
    195195    view->SetFontAndColor(0, name.Length(), &font);
    196     alert->SetShortcut(0, B_ESCAPE);
     196    alert->SetFlags(B_CLOSE_ON_ESCAPE);
    197197    // Use the asynchronous version so we don't block the window's thread
    198198    alert->Go(NULL);
    199199}
    LoadInDeskbar()  
    278278        message.UnlockBuffer();
    279279        BAlert *alert = new BAlert(B_TRANSLATE("Error"),
    280280            message.String(), B_TRANSLATE("OK"));
    281         alert->SetShortcut(0, B_ESCAPE);
     281        alert->SetFlags(B_CLOSE_ON_ESCAPE);
    282282        alert->Go(NULL);
    283283        return false;
    284284    }
  • src/apps/pulse/PulseView.cpp

    diff --git a/src/apps/pulse/PulseView.cpp b/src/apps/pulse/PulseView.cpp
    index d14037a..b5d233b 100644
    a b void PulseView::ChangeCPUState(BMessage *message) {  
    130130        BAlert *alert = new BAlert(B_TRANSLATE("Info"),
    131131            B_TRANSLATE("You can't disable the last active CPU."),
    132132            B_TRANSLATE("OK"));
    133         alert->SetShortcut(0, B_ESCAPE);
     133        alert->SetFlags(B_CLOSE_ON_ESCAPE);
    134134        alert->Go(NULL);
    135135    }
    136136}
  • src/apps/resedit/BitmapView.cpp

    diff --git a/src/apps/resedit/BitmapView.cpp b/src/apps/resedit/BitmapView.cpp
    index 57e928b..007fc60 100644
    a b BitmapView::MessageReceived(BMessage *msg)  
    250250    switch (msg->what)
    251251    {
    252252        case M_REMOVE_IMAGE: {
    253             BAlert *alert = new BAlert("Mr. Peeps!", "This cannot be undone. Remove the image?",
    254                                         "Remove", "Cancel");
     253            BAlert *alert = new BAlert("Mr. Peeps!", "This cannot be undone. "
     254                "Remove the image?", "Remove", "Cancel");
     255            alert->SetShortcut(1, B_ESCAPE);
    255256            int32 value = alert->Go();
    256257            if (value == 0) {
    257258                SetBitmap(NULL);
  • src/apps/resedit/ResWindow.cpp

    diff --git a/src/apps/resedit/ResWindow.cpp b/src/apps/resedit/ResWindow.cpp
    index f306837..4f5fea5 100644
    a b bool  
    3434ResWindow::QuitRequested(void)
    3535{
    3636    if (fView->GetSaveStatus() == FILE_DIRTY) {
    37         BAlert *alert = new BAlert("ResEdit","Save your changes?","Cancel","Don't Save","Save");
     37        BAlert *alert = new BAlert("ResEdit", "Save your changes?", "Cancel",
     38            "Don't Save", "Save");
     39        alert->SetShortcut(0, B_ESCAPE);
     40       
    3841        switch (alert->Go()) {
    3942            case 0:
    4043                return false;
  • src/apps/screenshot/ScreenshotWindow.cpp

    diff --git a/src/apps/screenshot/ScreenshotWindow.cpp b/src/apps/screenshot/ScreenshotWindow.cpp
    index f3bee39..ca40af5 100644
    a b ScreenshotWindow::_ShowSettings(bool activate)  
    669669        &rect);
    670670    if (err < B_OK || view == NULL) {
    671671        BAlert *alert = new BAlert(NULL, strerror(err), "OK");
     672        alert->SetFlags(B_CLOSE_ON_ESCAPE);
    672673        alert->Go();
    673674    } else {
    674675        if (fSettingsWindow) {
  • src/apps/showimage/ShowImageView.cpp

    diff --git a/src/apps/showimage/ShowImageView.cpp b/src/apps/showimage/ShowImageView.cpp
    index 86b3ee4..628fc7f 100644
    a b ShowImageView::SaveToFile(BDirectory* dir, const char* name, BBitmap* bitmap,  
    953953        snprintf(buffer, sizeof(buffer), B_TRANSLATE("The file '%s' could not "
    954954            "be written."), name);
    955955        BAlert* palert = new BAlert("", buffer, B_TRANSLATE("OK"));
     956        palert->SetFlags(B_CLOSE_ON_ESCAPE);
    956957        palert->Go();
    957958    }
    958959
  • src/apps/showimage/ShowImageWindow.cpp

    diff --git a/src/apps/showimage/ShowImageWindow.cpp b/src/apps/showimage/ShowImageWindow.cpp
    index 6aa6e9f..6705680 100644
    a b ShowImageWindow::_LoadError(const entry_ref& ref)  
    11081108            "LoadAlerts"),
    11091109        B_TRANSLATE_CONTEXT("OK", "Alerts"), NULL, NULL,
    11101110        B_WIDTH_AS_USUAL, B_INFO_ALERT);
     1111    alert->SetFlags(B_CLOSE_ON_ESCAPE);
    11111112    alert->Go();
    11121113}
    11131114
    ShowImageWindow::_ClosePrompt()  
    12161217
    12171218    BAlert* alert = new BAlert(B_TRANSLATE("Close document"), prompt.String(),
    12181219        B_TRANSLATE("Cancel"), B_TRANSLATE("Close"));
     1220    alert->SetShortcut(0, B_ESCAPE);
     1221   
    12191222    if (alert->Go() == 0) {
    12201223        // Cancel
    12211224        return false;
  • src/apps/soundrecorder/RecorderWindow.cpp

    diff --git a/src/apps/soundrecorder/RecorderWindow.cpp b/src/apps/soundrecorder/RecorderWindow.cpp
    index 11b5a92..50430f5 100644
    a b RecorderWindow::ErrorAlert(const char * action, status_t err)  
    11751175        sprintf(msg, "%s: %s. [%lx]", action, strerror(err), (int32) err);
    11761176    else
    11771177        sprintf(msg, "%s.", action);
    1178     (new BAlert("", msg, B_TRANSLATE("Stop")))->Go();
     1178    BAlert* alert = new BAlert("", msg, B_TRANSLATE("Stop"));
     1179    alert->SetFlags(B_CLOSE_ON_ESCAPE);
     1180    alert->Go();
    11791181}
    11801182
    11811183
    RecorderWindow::RefsReceived(BMessage *msg)  
    13341336    }
    13351337
    13361338    if (countBad > 0 && countGood == 0) {
    1337         (new BAlert(B_TRANSLATE("Nothing to play"), B_TRANSLATE("None of the "
    1338             "files appear to be audio files"), B_TRANSLATE("OK"), NULL, NULL,
    1339             B_WIDTH_AS_USUAL, B_STOP_ALERT))->Go();
     1339        BAlert* alert = new BAlert(B_TRANSLATE("Nothing to play"),
     1340            B_TRANSLATE("None of the files appear to be audio files"),
     1341            B_TRANSLATE("OK"), NULL, NULL, B_WIDTH_AS_USUAL, B_STOP_ALERT);
     1342        alert->SetFlags(B_CLOSE_ON_ESCAPE);
     1343        alert->Go();
    13401344    } else if (countGood > 0) {
    1341         if (countBad > 0)
    1342             (new BAlert(B_TRANSLATE("Invalid audio files"), B_TRANSLATE("Some "
    1343                 "of the files don't appear to be audio files"),
     1345        if (countBad > 0) {
     1346            BAlert* alert = new BAlert(B_TRANSLATE("Invalid audio files"),
     1347            B_TRANSLATE("Some of the files don't appear to be audio files"),
    13441348                B_TRANSLATE("OK"), NULL, NULL, B_WIDTH_AS_USUAL,
    1345                 B_WARNING_ALERT))->Go();
     1349                B_WARNING_ALERT);
     1350            alert->SetFlags(B_CLOSE_ON_ESCAPE);
     1351            alert->Go();
     1352        }
    13461353        fSoundList->Select(fSoundList->CountItems() - 1);
    13471354    }
    13481355}
  • src/apps/stylededit/StyledEditWindow.cpp

    diff --git a/src/apps/stylededit/StyledEditWindow.cpp b/src/apps/stylededit/StyledEditWindow.cpp
    index 0601b0b..de4e56d 100644
    a b StyledEditWindow::_ShowStatistics()  
    16401640
    16411641    BAlert* alert = new BAlert("Statistics", result, B_TRANSLATE("OK"), NULL,
    16421642        NULL, B_WIDTH_AS_USUAL, B_EVEN_SPACING, B_INFO_ALERT);
    1643 
     1643    alert->SetFlags(B_CLOSE_ON_ESCAPE);
     1644   
    16441645    return alert->Go();
    16451646}
    16461647
  • src/apps/sudoku/SudokuWindow.cpp

    diff --git a/src/apps/sudoku/SudokuWindow.cpp b/src/apps/sudoku/SudokuWindow.cpp
    index 9a7f9a7..600019d 100644
    a b SudokuWindow::_MessageDropped(BMessage* message)  
    411411                strerror(status));
    412412        }
    413413
    414         (new BAlert(B_TRANSLATE("Sudoku request"),
     414        BAlert* alert = new BAlert(B_TRANSLATE("Sudoku request"),
    415415            buffer, B_TRANSLATE("OK"), NULL, NULL,
    416             B_WIDTH_AS_USUAL, B_STOP_ALERT))->Go();
     416            B_WIDTH_AS_USUAL, B_STOP_ALERT);
     417        alert->SetFlags(B_CLOSE_ON_ESCAPE);
     418        alert->Go();
    417419    }
    418420}
    419421
    SudokuWindow::MessageReceived(BMessage* message)  
    554556        }
    555557
    556558        case kMsgSudokuSolved:
    557             (new BAlert(B_TRANSLATE("Sudoku request"),
     559        {
     560            BAlert* alert = new BAlert(B_TRANSLATE("Sudoku request"),
    558561                B_TRANSLATE("Sudoku solved - congratulations!\n"),
    559562                B_TRANSLATE("OK"), NULL, NULL,
    560                 B_WIDTH_AS_USUAL, B_IDEA_ALERT))->Go();
     563                B_WIDTH_AS_USUAL, B_IDEA_ALERT);
     564            alert->SetFlags(B_CLOSE_ON_ESCAPE);
     565            alert->Go();
    561566            break;
     567        }
    562568
    563569        case B_OBSERVER_NOTICE_CHANGE:
    564570        {
  • src/apps/terminal/TermApp.cpp

    diff --git a/src/apps/terminal/TermApp.cpp b/src/apps/terminal/TermApp.cpp
    index 20436f2..4b59fa5 100644
    a b TermApp::ReadyToRun()  
    104104            B_TRANSLATE("Terminal couldn't start the shell. Sorry."),
    105105            B_TRANSLATE("OK"), NULL, NULL, B_WIDTH_FROM_LABEL,
    106106            B_INFO_ALERT);
    107         alert->SetShortcut(0, B_ESCAPE);
     107        alert->SetFlags(B_CLOSE_ON_ESCAPE);
    108108        alert->Go(NULL);
    109109        PostMessage(B_QUIT_REQUESTED);
    110110        return;
  • src/apps/terminal/TermWindow.cpp

    diff --git a/src/apps/terminal/TermWindow.cpp b/src/apps/terminal/TermWindow.cpp
    index be789f1..17476e4 100644
    a b TermWindow::MessageReceived(BMessage *message)  
    711711                BAlert* alert = new BAlert(B_TRANSLATE("Find failed"),
    712712                    errorMsg, B_TRANSLATE("OK"), NULL, NULL,
    713713                    B_WIDTH_AS_USUAL, B_WARNING_ALERT);
    714                 alert->SetShortcut(0, B_ESCAPE);
     714                alert->SetFlags(B_CLOSE_ON_ESCAPE);
    715715
    716716                alert->Go();
    717717                fFindPreviousMenuItem->SetEnabled(false);
    TermWindow::MessageReceived(BMessage *message)  
    729729                    B_TRANSLATE("Text not found."),
    730730                    B_TRANSLATE("OK"), NULL, NULL,
    731731                    B_WIDTH_AS_USUAL, B_WARNING_ALERT);
    732                 alert->SetShortcut(0, B_ESCAPE);
     732                alert->SetFlags(B_CLOSE_ON_ESCAPE);
    733733                alert->Go();
    734734                fFindPreviousMenuItem->SetEnabled(false);
    735735                fFindNextMenuItem->SetEnabled(false);
    TermWindow::MessageReceived(BMessage *message)  
    751751                BAlert* alert = new BAlert(B_TRANSLATE("Find failed"),
    752752                    B_TRANSLATE("Not found."), B_TRANSLATE("OK"),
    753753                    NULL, NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
    754                 alert->SetShortcut(0, B_ESCAPE);
     754                alert->SetFlags(B_CLOSE_ON_ESCAPE);
    755755                alert->Go();
    756756            }
    757757            break;
  • src/apps/text_search/GrepWindow.cpp

    diff --git a/src/apps/text_search/GrepWindow.cpp b/src/apps/text_search/GrepWindow.cpp
    index 928bd69..bd7e37d 100644
    a b GrepWindow::_OnTrimSelection()  
    12901290        text << "\n";
    12911291        BAlert* alert = new BAlert(NULL, text.String(), B_TRANSLATE("OK"), NULL, NULL,
    12921292            B_WIDTH_AS_USUAL, B_WARNING_ALERT);
     1293        alert->SetFlags(B_CLOSE_ON_ESCAPE);
    12931294        alert->Go(NULL);
    12941295        return;
    12951296    }
    GrepWindow::_OnSelectInTracker()  
    13821383            B_TRANSLATE("Please select the files you wish to have selected for you in "
    13831384                "Tracker."),
    13841385            B_TRANSLATE("OK"), NULL, NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
     1386        alert->SetFlags(B_CLOSE_ON_ESCAPE);
    13851387        alert->Go(NULL);
    13861388        return;
    13871389    }
    GrepWindow::_OnSelectInTracker()  
    14461448        str1.ReplaceFirst("%APP_NAME",APP_NAME);
    14471449        BAlert* alert = new BAlert(NULL, str1.String(), B_TRANSLATE("OK"),
    14481450            NULL, NULL, B_WIDTH_AS_USUAL, B_STOP_ALERT);
     1451        alert->SetFlags(B_CLOSE_ON_ESCAPE);
    14491452        alert->Go(NULL);
    14501453        goto out;
    14511454    }
  • src/apps/tv/MainWin.cpp

    diff --git a/src/apps/tv/MainWin.cpp b/src/apps/tv/MainWin.cpp
    index 63db99e..6cc3ab1 100644
    a b MainWin::SelectInterface(int i)  
    375375        BString s;
    376376        s << B_TRANSLATE("Error, interface is busy:\n\n");
    377377        s << gDeviceRoster->DeviceName(i);
    378         (new BAlert("error", s.String(), B_TRANSLATE("OK")))->Go();
     378        BAlert* alert = new BAlert("error", s.String(), B_TRANSLATE("OK"));
     379        alert->SetFlags(B_CLOSE_ON_ESCAPE);
     380        alert->Go();
    379381        return;
    380382    }
    381383
    MainWin::SelectInterface(int i)  
    384386        BString s;
    385387        s << B_TRANSLATE("Error, connecting to interface failed:\n\n");
    386388        s << gDeviceRoster->DeviceName(i);
    387         (new BAlert("error", s.String(), B_TRANSLATE("OK")))->Go();
     389        BAlert* alert = new BAlert("error", s.String(), B_TRANSLATE("OK"));
     390        alert->SetFlags(B_CLOSE_ON_ESCAPE);
     391        alert->Go();
    388392    }
    389393
    390394done:
  • src/apps/webpositive/BrowserApp.cpp

    diff --git a/src/apps/webpositive/BrowserApp.cpp b/src/apps/webpositive/BrowserApp.cpp
    index c429167..9bfa632 100644
    a b BrowserApp::AboutRequested()  
    103103
    104104    BAlert* alert = new BAlert("About WebPositive", aboutText.String(),
    105105        "Sweet!");
     106    alert->SetFlags(B_CLOSE_ON_ESCAPE);
    106107    alert->Go(NULL);
    107108}
    108109
  • src/apps/webpositive/BrowserWindow.cpp

    diff --git a/src/apps/webpositive/BrowserWindow.cpp b/src/apps/webpositive/BrowserWindow.cpp
    index 92bd86b..4258bdd 100644
    a b BrowserWindow::MessageReceived(BMessage* message)  
    680680                B_TRANSLATE("Do you really want to "
    681681                "clear the browsing history?"), B_TRANSLATE("Clear"),
    682682                B_TRANSLATE("Cancel"));
     683            alert->SetShortcut(1, B_ESCAPE);
     684
    683685            if (alert->Go() == 0)
    684686                history->Clear();
    685687            break;
    BrowserWindow::MessageReceived(BMessage* message)  
    732734
    733735                BAlert* alert = new BAlert(B_TRANSLATE("Open bookmarks confirmation"),
    734736                    string.String(), B_TRANSLATE("Cancel"), B_TRANSLATE("Open all"));
     737                alert->SetShortcut(0, B_ESCAPE);
    735738                if (alert->Go() == 0)
    736739                    break;
    737740            }
    BrowserWindow::_CreateBookmark()  
    15861589        BAlert* alert = new BAlert(B_TRANSLATE("Bookmark error"),
    15871590            message.String(), B_TRANSLATE("OK"), NULL, NULL,
    15881591            B_WIDTH_AS_USUAL, B_STOP_ALERT);
     1592        alert->SetFlags(B_CLOSE_ON_ESCAPE);
    15891593        alert->Go();
    15901594        return;
    15911595    }
    BrowserWindow::_CreateBookmark()  
    16151619        message.ReplaceFirst("%bookmarkName", bookmarkName);
    16161620        BAlert* alert = new BAlert(B_TRANSLATE("Bookmark info"),
    16171621            message.String(), B_TRANSLATE("OK"));
     1622        alert->SetFlags(B_CLOSE_ON_ESCAPE);
    16181623        alert->Go();
    16191624        return;
    16201625    }
    BrowserWindow::_CreateBookmark()  
    17091714        BAlert* alert = new BAlert(B_TRANSLATE("Bookmark error"),
    17101715            message.String(), B_TRANSLATE("OK"), NULL, NULL,
    17111716            B_WIDTH_AS_USUAL, B_STOP_ALERT);
     1717        alert->SetFlags(B_CLOSE_ON_ESCAPE);
    17121718        alert->Go();
    17131719        return;
    17141720    }
    BrowserWindow::_ShowBookmarks()  
    17341740        BAlert* alert = new BAlert(B_TRANSLATE("Bookmark error"),
    17351741            message.String(), B_TRANSLATE("OK"), NULL, NULL,
    17361742            B_WIDTH_AS_USUAL, B_STOP_ALERT);
     1743        alert->SetFlags(B_CLOSE_ON_ESCAPE);
    17371744        alert->Go();
    17381745        return;
    17391746    }
    BrowserWindow::_HandlePageSourceResult(const BMessage* message)  
    22262233            "page source: %s\n", strerror(ret));
    22272234        BAlert* alert = new BAlert(B_TRANSLATE("Page source error"), buffer,
    22282235            B_TRANSLATE("OK"));
     2236        alert->SetFlags(B_CLOSE_ON_ESCAPE);
    22292237        alert->Go(NULL);
    22302238    }
    22312239}
  • src/apps/webpositive/DownloadProgressView.cpp

    diff --git a/src/apps/webpositive/DownloadProgressView.cpp b/src/apps/webpositive/DownloadProgressView.cpp
    index 16c0ff1..dab2608 100644
    a b DownloadProgressView::MessageReceived(BMessage* message)  
    412412                BAlert* alert = new BAlert(B_TRANSLATE("Open download error"),
    413413                    B_TRANSLATE("The download could not be opened."),
    414414                    B_TRANSLATE("OK"));
     415                alert->SetFlags(B_CLOSE_ON_ESCAPE);
    415416                alert->Go(NULL);
    416417            }
    417418            break;
  • src/apps/webpositive/DownloadWindow.cpp

    diff --git a/src/apps/webpositive/DownloadWindow.cpp b/src/apps/webpositive/DownloadWindow.cpp
    index 72c7663..89fa04c 100644
    a b DownloadWindow::MessageReceived(BMessage* message)  
    286286                errorString.ReplaceFirst("%error", strerror(status));
    287287                BAlert* alert = new BAlert(B_TRANSLATE("Error opening downloads "
    288288                    "folder"), errorString.String(), B_TRANSLATE("OK"));
     289                alert->SetFlags(B_CLOSE_ON_ESCAPE);
    289290                alert->Go(NULL);
    290291            }
    291292            break;
  • src/apps/webwatch/WatchView.cpp

    diff --git a/src/apps/webwatch/WatchView.cpp b/src/apps/webwatch/WatchView.cpp
    index 99d889c..4d9a707 100644
    a b void WatchView::OnAboutRequested()  
    159159        "mahlzeit@users.sourceforge.net\n\n"
    160160        "Thanks to Jason Parks for his help.\n");
    161161    text.ReplaceFirst("%1", VERSION);
    162     (new BAlert(NULL, text.String(), B_TRANSLATE("OK")))->Go(NULL);
     162    BAlert* alert = new BAlert(NULL, text.String(), B_TRANSLATE("OK"));
     163    alert->SetFlags(B_CLOSE_ON_ESCAPE);
     164    alert->Go(NULL);
    163165}
    164166
    165167///////////////////////////////////////////////////////////////////////////////
  • src/apps/workspaces/Workspaces.cpp

    diff --git a/src/apps/workspaces/Workspaces.cpp b/src/apps/workspaces/Workspaces.cpp
    index 9ca9071..6c7970c 100644
    a b WorkspacesView::_AboutRequested()  
    420420    font.SetFace(B_BOLD_FACE);
    421421    view->SetFontAndColor(0, 10, &font);
    422422
     423    alert->SetFlags(B_CLOSE_ON_ESCAPE);
    423424    alert->Go();
    424425}
    425426
  • src/bin/checkitout.cpp

    diff --git a/src/bin/checkitout.cpp b/src/bin/checkitout.cpp
    index 9de9bb7..c068706 100644
    a b CheckItOut::_Warn(const char* url)  
    5757    message << "Proceed anyway?";
    5858    BAlert* alert = new BAlert("Warning", message.String(), "Proceed", "Stop", NULL,
    5959        B_WIDTH_AS_USUAL, B_WARNING_ALERT);
     60    alert->SetShortcut(1, B_ESCAPE);
    6061    int32 button;
    6162    button = alert->Go();
    6263    if (button == 0)
  • src/bin/desklink/MediaReplicant.cpp

    diff --git a/src/bin/desklink/MediaReplicant.cpp b/src/bin/desklink/MediaReplicant.cpp
    index f9a379a..79fcc9f 100644
    a b MediaReplicant::_Launch(const char* prettyName, const char* signature,  
    390390        BString message = B_TRANSLATE("Couldn't launch ");
    391391        message << prettyName;
    392392
    393         (new BAlert(B_TRANSLATE("desklink"), message.String(),
    394             B_TRANSLATE("OK")))->Go();
     393        BAlert* alert = new BAlert(B_TRANSLATE("desklink"), message.String(),
     394            B_TRANSLATE("OK"));
     395        alert->SetFlags(B_CLOSE_ON_ESCAPE);
     396        alert->Go();
    395397    }
    396398}
    397399
  • src/bin/mail_utils/spamdbm.cpp

    diff --git a/src/bin/mail_utils/spamdbm.cpp b/src/bin/mail_utils/spamdbm.cpp
    index ebe549b..b8dadc0 100644
    a b DisplayErrorMessage (  
    15031503  {
    15041504    AlertPntr = new BAlert (TitleString, MessageString,
    15051505      "Acknowledge", NULL, NULL, B_WIDTH_AS_USUAL, B_STOP_ALERT);
    1506     if (AlertPntr != NULL)
     1506    if (AlertPntr != NULL) {
     1507      AlertPntr->SetFlags(B_CLOSE_ON_ESCAPE);
    15071508      AlertPntr->Go ();
     1509    }
    15081510  }
    15091511}
    15101512
    EstimateRefFilesAndDisplay (BMessage *MessagePntr)  
    18391841        g_MaxInterestingWords - j);
    18401842
    18411843    AlertPntr = new BAlert ("Estimate", TempString, "OK");
    1842     if (AlertPntr != NULL)
     1844    if (AlertPntr != NULL) {
     1845      AlertPntr->SetFlags(B_CLOSE_ON_ESCAPE);
    18431846      AlertPntr->Go ();
     1847    }
    18441848  }
    18451849}
    18461850
    uses to extract words from messages. In particular, HTML is now handled.\n\n"  
    25332537"Compiled on " __DATE__ " at " __TIME__ ".", "Done");
    25342538  if (AboutAlertPntr != NULL)
    25352539  {
    2536     AboutAlertPntr->SetShortcut (0, B_ESCAPE);
     2540    AboutAlertPntr->SetFlags(B_CLOSE_ON_ESCAPE);
    25372541    AboutAlertPntr->Go ();
    25382542  }
    25392543}
  • src/bin/screenmode/screenmode.cpp

    diff --git a/src/bin/screenmode/screenmode.cpp b/src/bin/screenmode/screenmode.cpp
    index 512ac32..f3127a1 100644
    a b main(int argc, char** argv)  
    335335        BAlert* alert = new BAlert("screenmode",
    336336            "You have used the shortcut <Command><Ctrl><Escape> to reset the "
    337337            "screen mode to a safe fallback.", "Keep", "Revert");
     338        alert->SetShortcut(1, B_ESCAPE);
    338339        if (alert->Go() == 1)
    339340            screenMode.Revert();
    340341    }
  • src/bin/urlwrapper.cpp

    diff --git a/src/bin/urlwrapper.cpp b/src/bin/urlwrapper.cpp
    index 6c610e9..57f9806 100644
    a b UrlWrapper::_Warn(const char* url)  
    5858    message << "Proceed anyway?";
    5959    BAlert* alert = new BAlert("Warning", message.String(), "Proceed", "Stop", NULL,
    6060        B_WIDTH_AS_USUAL, B_WARNING_ALERT);
     61    alert->SetShortcut(1, B_ESCAPE);
    6162    int32 button;
    6263    button = alert->Go();
    6364    if (button == 0)
  • src/kits/app/Application.cpp

    diff --git a/src/kits/app/Application.cpp b/src/kits/app/Application.cpp
    index 4d68d63..77981d3 100644
    a b BApplication::AboutRequested()  
    649649    thread_info info;
    650650    if (get_thread_info(Thread(), &info) == B_OK) {
    651651        BAlert *alert = new BAlert("_about_", info.name, "OK");
     652        alert->SetFlags(B_CLOSE_ON_ESCAPE);
    652653        alert->Go(NULL);
    653654    }
    654655}
  • src/kits/interface/Dragger.cpp

    diff --git a/src/kits/interface/Dragger.cpp b/src/kits/interface/Dragger.cpp
    index 37f92d6..d35f330 100644
    a b BDragger::MessageReceived(BMessage* msg)  
    303303            if (fShelf != NULL)
    304304                Window()->PostMessage(kDeleteReplicant, fTarget, NULL);
    305305            else {
    306                 (new BAlert(B_TRANSLATE("Warning"),
     306                BAlert* alert = new BAlert(B_TRANSLATE("Warning"),
    307307                    B_TRANSLATE("Can't delete this replicant from its original "
    308308                    "application. Life goes on."),
    309309                    B_TRANSLATE("OK"), NULL, NULL, B_WIDTH_FROM_WIDEST,
    310                     B_WARNING_ALERT))->Go(NULL);
     310                    B_WARNING_ALERT);
     311                alert->SetFlags(B_CLOSE_ON_ESCAPE);
     312                alert->Go(NULL);
    311313            }
    312314            break;
    313315
  • src/kits/interface/PrintJob.cpp

    diff --git a/src/kits/interface/PrintJob.cpp b/src/kits/interface/PrintJob.cpp
    index d21f27f..6df2f5c 100644
    a b static void  
    103103ShowError(const char* message)
    104104{
    105105    BAlert* alert = new BAlert(B_TRANSLATE("Error"), message, B_TRANSLATE("OK"));
     106    alert->SetFlags(B_CLOSE_ON_ESCAPE);
    106107    alert->Go();
    107108}
    108109
    PrintServerMessenger::RejectUserInput()  
    748749    fHiddenApplicationModalWindow = new BAlert("bogus", "app_modal", "OK");
    749750    fHiddenApplicationModalWindow->DefaultButton()->SetEnabled(false);
    750751    fHiddenApplicationModalWindow->SetDefaultButton(NULL);
     752    fHiddenApplicationModalWindow->SetFlags(B_CLOSE_ON_ESCAPE);
    751753    fHiddenApplicationModalWindow->MoveTo(-65000, -65000);
    752754    fHiddenApplicationModalWindow->Go(NULL);
    753755}
  • src/kits/interface/ZombieReplicantView.cpp

    diff --git a/src/kits/interface/ZombieReplicantView.cpp b/src/kits/interface/ZombieReplicantView.cpp
    index 400a2db..45f8656 100644
    a b _BZombieReplicantView_::MessageReceived(BMessage* msg)  
    7070            BAlert* alert = new (std::nothrow) BAlert(B_TRANSLATE("Error"),
    7171                error.String(), B_TRANSLATE("OK"), NULL, NULL,
    7272                B_WIDTH_AS_USUAL, B_STOP_ALERT);
     73            alert->SetFlags(B_CLOSE_ON_ESCAPE);
    7374            if (alert != NULL)
    7475                alert->Go();
    7576
  • src/kits/shared/AboutWindow.cpp

    diff --git a/src/kits/shared/AboutWindow.cpp b/src/kits/shared/AboutWindow.cpp
    index c5dd255..14daf45 100644
    a b BAboutWindow::Show()  
    8888    font.SetFace(B_BOLD_FACE);
    8989    font.SetSize(font.Size() * 1.7);
    9090    view->SetFontAndColor(0, fAppName->Length(), &font);
     91    alert->SetFlags(B_CLOSE_ON_ESCAPE);
    9192    alert->Go();
    9293}
    9394
  • src/kits/tracker/AutoMounterSettings.cpp

    diff --git a/src/kits/tracker/AutoMounterSettings.cpp b/src/kits/tracker/AutoMounterSettings.cpp
    index da9fed6..36cb499 100644
    a b AutomountSettingsDialog::RunAutomountSettings(const BMessenger& target)  
    335335    BMessage reply;
    336336    status_t ret = target.SendMessage(&message, &reply, 2500000);
    337337    if (ret != B_OK) {
    338         (new BAlert(B_TRANSLATE("Mount server error"),
     338        BAlert* alert = new BAlert(B_TRANSLATE("Mount server error"),
    339339            B_TRANSLATE("The mount server could not be contacted."),
    340340            B_TRANSLATE("OK"),
    341             NULL, NULL, B_WIDTH_AS_USUAL, B_STOP_ALERT))->Go();
     341            NULL, NULL, B_WIDTH_AS_USUAL, B_STOP_ALERT);
     342        alert->SetFlags(B_CLOSE_ON_ESCAPE);
     343        alert->Go();
    342344        return;
    343345    }
    344346
  • src/kits/tracker/ContainerWindow.cpp

    diff --git a/src/kits/tracker/ContainerWindow.cpp b/src/kits/tracker/ContainerWindow.cpp
    index 33ec873..8045c94 100644
    a b AddOnThread(BMessage* refsMessage, entry_ref addonRef, entry_ref dirRef)  
    286286
    287287    BAlert* alert = new BAlert("", buffer.String(), B_TRANSLATE("Cancel"),
    288288        0, 0, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
    289     alert->SetShortcut(0, B_ESCAPE);
     289    alert->SetFlags(B_CLOSE_ON_ESCAPE);
    290290    alert->Go();
    291291
    292292    return result;
    BContainerWindow::LoadAddOn(BMessage* message)  
    32133213
    32143214        BAlert* alert = new BAlert("", buffer.String(), B_TRANSLATE("Cancel"),
    32153215            0, 0, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
    3216         alert->SetShortcut(0, B_ESCAPE);
     3216        alert->SetFlags(B_CLOSE_ON_ESCAPE);
    32173217        alert->Go();
    32183218        return;
    32193219    }
  • src/kits/tracker/FSClipboard.cpp

    diff --git a/src/kits/tracker/FSClipboard.cpp b/src/kits/tracker/FSClipboard.cpp
    index f250aa8..c2d3328 100644
    a b FSClipboardPaste(Model* model, uint32 linksMode)  
    479479            B_TRANSLATE("You must drop items on one of the disk icons "
    480480            "in the \"Disks\" window."), B_TRANSLATE("Cancel"), NULL, NULL,
    481481            B_WIDTH_AS_USUAL, B_WARNING_ALERT);
    482         alert->SetShortcut(0, B_ESCAPE);
     482        alert->SetFlags(B_CLOSE_ON_ESCAPE);
    483483        alert->Go();
    484484        okToMove = false;
    485485    }
    FSClipboardPaste(Model* model, uint32 linksMode)  
    493493            B_TRANSLATE("Sorry, you can't copy items to the Trash."),
    494494            B_TRANSLATE("Cancel"), NULL, NULL, B_WIDTH_AS_USUAL,
    495495            B_WARNING_ALERT);
    496         alert->SetShortcut(0, B_ESCAPE);
     496        alert->SetFlags(B_CLOSE_ON_ESCAPE);
    497497        alert->Go();
    498498        okToMove = false;
    499499    }
  • src/kits/tracker/FSUtils.cpp

    diff --git a/src/kits/tracker/FSUtils.cpp b/src/kits/tracker/FSUtils.cpp
    index 2e462e1..315c795 100644
    a b TrackerCopyLoopControl::FileError(const char* message, const char* name,  
    357357
    358358    BAlert* alert = new BAlert("", buffer.String(), B_TRANSLATE("Cancel"), 0, 0,
    359359        B_WIDTH_AS_USUAL, B_STOP_ALERT);
    360     alert->SetShortcut(0, B_ESCAPE);
     360    alert->SetFlags(B_CLOSE_ON_ESCAPE);
    361361    alert->Go();
    362362    return false;
    363363}
    InitCopy(CopyLoopControl* loopControl, uint32 moveMode,  
    736736        BAlert* alert = new BAlert("",
    737737            B_TRANSLATE("You can't move or copy items to read-only volumes."),
    738738            B_TRANSLATE("Cancel"), 0, 0, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
    739         alert->SetShortcut(0, B_ESCAPE);
     739        alert->SetFlags(B_CLOSE_ON_ESCAPE);
    740740        alert->Go();
    741741        return B_ERROR;
    742742    }
    InitCopy(CopyLoopControl* loopControl, uint32 moveMode,  
    762762            BAlert* alert = new BAlert("", errorStr.String(),
    763763                B_TRANSLATE("Cancel"), 0, 0, B_WIDTH_AS_USUAL,
    764764                B_WARNING_ALERT);
    765             alert->SetShortcut(0, B_ESCAPE);
     765            alert->SetFlags(B_CLOSE_ON_ESCAPE);
    766766            alert->Go();
    767767            return B_ERROR;
    768768        }
    InitCopy(CopyLoopControl* loopControl, uint32 moveMode,  
    820820                            B_TRANSLATE_NOCOLLECT(kNoFreeSpace),
    821821                            B_TRANSLATE("Cancel"),
    822822                            0, 0, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
    823                         alert->SetShortcut(0, B_ESCAPE);
     823                        alert->SetFlags(B_CLOSE_ON_ESCAPE);
    824824                        alert->Go();
    825825                        return B_ERROR;
    826826                    }
    MoveTask(BObjectList<entry_ref>* srcList, BEntry* destEntry, BList* pointList,  
    993993                BAlert* alert = new BAlert("", error.String(),
    994994                    B_TRANSLATE("Cancel"), 0, 0, B_WIDTH_AS_USUAL,
    995995                    B_WARNING_ALERT);
    996                 alert->SetShortcut(0, B_ESCAPE);
     996                alert->SetFlags(B_CLOSE_ON_ESCAPE);
    997997                alert->Go();
    998998                break;
    999999            }
    MoveTask(BObjectList<entry_ref>* srcList, BEntry* destEntry, BList* pointList,  
    10121012                    BAlert* alert = new BAlert("", error.String(),
    10131013                        B_TRANSLATE("Cancel"), 0, 0, B_WIDTH_AS_USUAL,
    10141014                        B_WARNING_ALERT);
    1015                     alert->SetShortcut(0, B_ESCAPE);
     1015                    alert->SetFlags(B_CLOSE_ON_ESCAPE);
    10161016                    alert->Go();
    10171017                    break;
    10181018                }
    MoveItem(BEntry* entry, BDirectory* destDir, BPoint* loc, uint32 moveMode,  
    17421742    } catch (MoveError error) {
    17431743        BString errorString(B_TRANSLATE("Error moving \"%name\""));
    17441744        errorString.ReplaceFirst("%name", ref.name);
    1745         (new BAlert("", errorString.String(), B_TRANSLATE("OK"), 0, 0,
    1746             B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go();
     1745        BAlert* alert = new BAlert("", errorString.String(), B_TRANSLATE("OK"),
     1746            0, 0, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
     1747        alert->SetFlags(B_CLOSE_ON_ESCAPE);
     1748        alert->Go();
    17471749        return error.fError;
    17481750    } catch (FailWithAlert error) {
    17491751        BString buffer(error.fString);
    MoveItem(BEntry* entry, BDirectory* destDir, BPoint* loc, uint32 moveMode,  
    17511753            buffer.ReplaceFirst("%name", error.fName);
    17521754        else
    17531755            buffer <<  error.fString;
    1754         (new BAlert("", buffer.String(), B_TRANSLATE("OK"), 0, 0,
    1755             B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go();
     1756        BAlert* alert = new BAlert("", buffer.String(), B_TRANSLATE("OK"),
     1757            0, 0, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
     1758        alert->SetFlags(B_CLOSE_ON_ESCAPE);
     1759        alert->Go();
    17561760
    17571761        return error.fError;
    17581762    }
    MoveEntryToTrash(BEntry* entry, BPoint* loc, Undo &undo)  
    18901894                BAlert* alert = new BAlert("", buffer.String(),
    18911895                    B_TRANSLATE("Cancel"), 0, 0, B_WIDTH_AS_USUAL,
    18921896                    B_WARNING_ALERT);
    1893                 alert->SetShortcut(0, B_ESCAPE);
     1897                alert->SetFlags(B_CLOSE_ON_ESCAPE);
    18941898                alert->Go();
    18951899            } else {
    18961900                BMessage message(kUnmountVolume);
    MoveEntryToTrash(BEntry* entry, BPoint* loc, Undo &undo)  
    19101914        trash_dir.GetEntry(&trashEntry);
    19111915
    19121916        if (dir == trash_dir || dir.Contains(&trashEntry)) {
    1913             (new BAlert("",
     1917            BAlert* alert = new BAlert("",
    19141918                B_TRANSLATE("You cannot put the Trash, home or Desktop "
    19151919                    "directory into the trash."),
    19161920                B_TRANSLATE("OK"),
    1917                 0, 0, B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go();
     1921                0, 0, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
     1922            alert->SetFlags(B_CLOSE_ON_ESCAPE);
     1923            alert->Go();
    19181924
    19191925            // return no error so we don't get two dialogs
    19201926            return B_OK;
    CheckName(uint32 moveMode, const BEntry* sourceEntry,  
    20622068            && moveMode != kCreateRelativeLink
    20632069            && (srcDirectory == *destDir
    20642070                || srcDirectory.Contains(&destEntry))) {
    2065             (new BAlert("",
     2071            BAlert* alert = new BAlert("",
    20662072                B_TRANSLATE("You can't move a folder into itself "
    20672073                "or any of its own sub-folders."), B_TRANSLATE("OK"),
    2068                 0, 0, B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go();
     2074                0, 0, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
     2075            alert->SetFlags(B_CLOSE_ON_ESCAPE);
     2076            alert->Go();
    20692077            return B_ERROR;
    20702078        }
    20712079    }
    20722080
    20732081    if (FSIsTrashDir(sourceEntry) && moveMode != kCreateLink
    20742082        && moveMode != kCreateRelativeLink) {
    2075         (new BAlert("",
     2083        BAlert* alert = new BAlert("",
    20762084            B_TRANSLATE("You can't move or copy the trash."),
    20772085            B_TRANSLATE("OK"), 0, 0, B_WIDTH_AS_USUAL,
    2078                 B_WARNING_ALERT))->Go();
     2086            B_WARNING_ALERT);
     2087        alert->SetFlags(B_CLOSE_ON_ESCAPE);
     2088        alert->Go();
    20792089        return B_ERROR;
    20802090    }
    20812091
    CheckName(uint32 moveMode, const BEntry* sourceEntry,  
    20982108    if (destIsDir) {
    20992109        BDirectory test_dir(&entry);
    21002110        if (test_dir.Contains(sourceEntry)) {
    2101             (new BAlert("",
     2111            BAlert* alert = new BAlert("",
    21022112                B_TRANSLATE("You can't replace a folder "
    21032113                "with one of its sub-folders."),
    2104                 B_TRANSLATE("OK"),
    2105                 0, 0, B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go();
     2114                B_TRANSLATE("OK"), 0, 0, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
     2115            alert->SetFlags(B_CLOSE_ON_ESCAPE);
     2116            alert->Go();
    21062117            return B_ERROR;
    21072118        }
    21082119    }
    CheckName(uint32 moveMode, const BEntry* sourceEntry,  
    21122123    if (moveMode != kCreateLink
    21132124        && moveMode != kCreateRelativeLink
    21142125        && destIsDir != sourceIsDirectory) {
    2115             (new BAlert("", sourceIsDirectory
     2126            BAlert* alert = new BAlert("", sourceIsDirectory
    21162127                ? B_TRANSLATE("You cannot replace a file with a folder or a "
    21172128                "symbolic link.")
    21182129                : B_TRANSLATE("You cannot replace a folder or a symbolic link "
    21192130                "with a file."), B_TRANSLATE("OK"), 0, 0, B_WIDTH_AS_USUAL,
    2120                 B_WARNING_ALERT))->Go();
     2131                B_WARNING_ALERT);
     2132            alert->SetFlags(B_CLOSE_ON_ESCAPE);
     2133            alert->Go();
    21212134            return B_ERROR;
    21222135        }
    21232136
    CheckName(uint32 moveMode, const BEntry* sourceEntry,  
    21962209        error.ReplaceFirst("%name", name);;
    21972210        BAlert* alert = new BAlert("", error.String(),
    21982211            B_TRANSLATE("Cancel"), 0, 0, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
    2199         alert->SetShortcut(0, B_ESCAPE);
     2212        alert->SetFlags(B_CLOSE_ON_ESCAPE);
    22002213        alert->Go();
    22012214    }
    22022215
    empty_trash(void*)  
    28152828    }
    28162829
    28172830    if (err != B_OK && err != kTrashCanceled && err != kUserCanceled) {
    2818         (new BAlert("", B_TRANSLATE("Error emptying Trash"),
    2819             B_TRANSLATE("OK"), NULL, NULL, B_WIDTH_AS_USUAL,
    2820             B_WARNING_ALERT))->Go();
     2831        BAlert* alert = new BAlert("", B_TRANSLATE("Error emptying Trash"),
     2832            B_TRANSLATE("OK"), NULL, NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
     2833            alert->SetFlags(B_CLOSE_ON_ESCAPE);
     2834            alert->Go();
    28212835    }
    28222836
    28232837    return B_OK;
    _DeleteTask(BObjectList<entry_ref>* list, bool confirm)  
    28872901                err = entry.Remove();
    28882902        }
    28892903
    2890         if (err != kTrashCanceled && err != kUserCanceled && err != B_OK)
    2891             (new BAlert("", B_TRANSLATE("Error deleting items"),
    2892                 B_TRANSLATE("OK"), NULL, NULL, B_WIDTH_AS_USUAL,
    2893                 B_WARNING_ALERT))->Go();
     2904        if (err != kTrashCanceled && err != kUserCanceled && err != B_OK) {
     2905            BAlert* alert = new BAlert("", B_TRANSLATE("Error deleting items"),
     2906                B_TRANSLATE("OK"), NULL, NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
     2907            alert->SetFlags(B_CLOSE_ON_ESCAPE);
     2908            alert->Go();
     2909        }
    28942910    }
    28952911
    28962912    delete list;
    FSCreateNewFolderIn(const node_ref* dirNode, entry_ref* newRef,  
    30813097    BAlert* alert = new BAlert("",
    30823098        B_TRANSLATE("Sorry, could not create a new folder."),
    30833099        B_TRANSLATE("Cancel"), 0, 0, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
    3084     alert->SetShortcut(0, B_ESCAPE);
     3100    alert->SetFlags(B_CLOSE_ON_ESCAPE);
    30853101    alert->Go();
    30863102    return result;
    30873103}
    _TrackerLaunchAppWithDocuments(const entry_ref* appRef, const BMessage* refs,  
    32543270            BAlert* alert = new BAlert("", alertString.String(),
    32553271                B_TRANSLATE("Cancel"), 0, 0, B_WIDTH_AS_USUAL,
    32563272                B_WARNING_ALERT);
    3257             alert->SetShortcut(0, B_ESCAPE);
     3273            alert->SetFlags(B_CLOSE_ON_ESCAPE);
    32583274            alert->Go();
    32593275        }
    32603276    }
    _TrackerLaunchDocuments(const entry_ref* /*doNotUse*/, const BMessage* refs,  
    35573573            BAlert* alert = new BAlert("", alertString.String(),
    35583574                B_TRANSLATE("Cancel"), 0, 0, B_WIDTH_AS_USUAL,
    35593575                B_WARNING_ALERT);
    3560             alert->SetShortcut(0, B_ESCAPE);
     3576            alert->SetFlags(B_CLOSE_ON_ESCAPE);
    35613577            alert->Go();
    35623578        }
    35633579    }
  • src/kits/tracker/InfoWindow.cpp

    diff --git a/src/kits/tracker/InfoWindow.cpp b/src/kits/tracker/InfoWindow.cpp
    index 1513841..d4d1440 100644
    a b AttributeView::FinishEditingTitle(bool commit)  
    19851985        if (entry.InitCheck() == B_OK
    19861986            && entry.GetParent(&parent) == B_OK) {
    19871987            if (parent.Contains(text)) {
    1988                 (new BAlert("",
     1988                BAlert* alert = new BAlert("",
    19891989                    B_TRANSLATE("That name is already taken. "
    19901990                    "Please type another one."),
    19911991                    B_TRANSLATE("OK"),
    1992                     0, 0, B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go();
     1992                    0, 0, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
     1993                alert->SetFlags(B_CLOSE_ON_ESCAPE);
     1994                alert->Go();
    19931995                reopen = true;
    19941996            } else {
    19951997                if (fModel->IsVolume()) {
    AttributeView::FinishEditingTitle(bool commit)  
    20092011            }
    20102012        }
    20112013    } else if (length >= B_FILE_NAME_LENGTH) {
    2012         (new BAlert("",
    2013             B_TRANSLATE("That name is too long. "
    2014             "Please type another one."),
     2014        BAlert* alert = new BAlert("",
     2015            B_TRANSLATE("That name is too long. Please type another one."),
    20152016            B_TRANSLATE("OK"),
    2016             0, 0, B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go();
     2017            0, 0, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
     2018        alert->SetFlags(B_CLOSE_ON_ESCAPE);
     2019        alert->Go();
    20172020        reopen = true;
    20182021    }
    20192022
  • src/kits/tracker/OpenWithWindow.cpp

    diff --git a/src/kits/tracker/OpenWithWindow.cpp b/src/kits/tracker/OpenWithWindow.cpp
    index 7d5456d..9156ab8 100644
    a b OpenWithPoseView::OpenSelection(BPose* pose, int32*)  
    672672            B_TRANSLATE("Could not find application \"%appname\""));
    673673        errorString.ReplaceFirst("%appname", pose->TargetModel()->Name());
    674674
    675         (new BAlert("", errorString.String(), B_TRANSLATE("OK"), 0, 0,
    676             B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go();
     675        BAlert* alert = new BAlert("", errorString.String(), B_TRANSLATE("OK"),
     676            0, 0, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
     677        alert->SetFlags(B_CLOSE_ON_ESCAPE);
     678        alert->Go();
    677679        return;
    678680    }
    679681
  • src/kits/tracker/PoseView.cpp

    diff --git a/src/kits/tracker/PoseView.cpp b/src/kits/tracker/PoseView.cpp
    index 7430bff..1e6c2c7 100644
    a b BPoseView::RemoveColumn(BColumn* columnToRemove, bool runAlert)  
    26092609            BAlert* alert = new BAlert("",
    26102610                B_TRANSLATE("You must have at least one attribute showing."),
    26112611                B_TRANSLATE("Cancel"), 0, 0, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
    2612             alert->SetShortcut(0, B_ESCAPE);
     2612            alert->SetFlags(B_CLOSE_ON_ESCAPE);
    26132613            alert->Go();
    26142614        }
    26152615
    BPoseView::MoveSelectionInto(Model* destFolder, BContainerWindow* srcWindow,  
    48324832            B_TRANSLATE("You must drop items on one of the disk icons "
    48334833            "in the \"Disks\" window."), B_TRANSLATE("Cancel"), NULL, NULL,
    48344834            B_WIDTH_AS_USUAL, B_WARNING_ALERT);
    4835         alert->SetShortcut(0, B_ESCAPE);
     4835        alert->SetFlags(B_CLOSE_ON_ESCAPE);
    48364836        alert->Go();
    48374837        okToMove = false;
    48384838    }
    BPoseView::MoveSelectionInto(Model* destFolder, BContainerWindow* srcWindow,  
    48434843            B_TRANSLATE("Sorry, you can't copy items to the Trash."),
    48444844            B_TRANSLATE("Cancel"), NULL, NULL, B_WIDTH_AS_USUAL,
    48454845            B_WARNING_ALERT);
    4846         alert->SetShortcut(0, B_ESCAPE);
     4846        alert->SetFlags(B_CLOSE_ON_ESCAPE);
    48474847        alert->Go();
    48484848        okToMove = false;
    48494849    }
    BPoseView::MoveSelectionInto(Model* destFolder, BContainerWindow* srcWindow,  
    48544854            B_TRANSLATE("Sorry, you can't create links in the Trash."),
    48554855            B_TRANSLATE("Cancel"), NULL, NULL, B_WIDTH_AS_USUAL,
    48564856            B_WARNING_ALERT);
    4857         alert->SetShortcut(0, B_ESCAPE);
     4857        alert->SetFlags(B_CLOSE_ON_ESCAPE);
    48584858        alert->Go();
    48594859        okToMove = false;
    48604860    }
    CheckVolumeReadOnly(const entry_ref* ref)  
    57445744            B_TRANSLATE("Files cannot be moved or deleted from a read-only "
    57455745            "volume."), B_TRANSLATE("Cancel"), NULL, NULL, B_WIDTH_AS_USUAL,
    57465746            B_STOP_ALERT);
    5747         alert->SetShortcut(0, B_ESCAPE);
     5747        alert->SetFlags(B_CLOSE_ON_ESCAPE);
    57485748        alert->Go();
    57495749        return false;
    57505750    }
    BPoseView::SelectMatchingEntries(const BMessage* message)  
    60846084            BString message(
    60856085                B_TRANSLATE("Error in regular expression:\n\n'%errstring'"));
    60866086            message.ReplaceFirst("%errstring", regExpression.ErrorString());
    6087             (new BAlert("", message.String(), B_TRANSLATE("OK"), NULL, NULL,
    6088                 B_WIDTH_AS_USUAL, B_STOP_ALERT))->Go();
     6087            BAlert* alert = new BAlert("", message.String(), B_TRANSLATE("OK"),
     6088                NULL, NULL, B_WIDTH_AS_USUAL, B_STOP_ALERT);
     6089            alert->SetFlags(B_CLOSE_ON_ESCAPE);
     6090            alert->Go();
    60896091            return 0;
    60906092        }
    60916093    }
    BPoseView::OpenInfoWindows()  
    80768078            B_TRANSLATE("The Tracker must be running to see Info windows."),
    80778079            B_TRANSLATE("Cancel"), NULL, NULL, B_WIDTH_AS_USUAL,
    80788080            B_WARNING_ALERT);
    8079         alert->SetShortcut(0, B_ESCAPE);
     8081        alert->SetFlags(B_CLOSE_ON_ESCAPE);
    80808082        alert->Go();
    80818083        return;
    80828084    }
    BPoseView::SetDefaultPrinter()  
    80938095            B_TRANSLATE("The Tracker must be running to see set the default "
    80948096            "printer."), B_TRANSLATE("Cancel"), NULL, NULL, B_WIDTH_AS_USUAL,
    80958097            B_WARNING_ALERT);
    8096         alert->SetShortcut(0, B_ESCAPE);
     8098        alert->SetFlags(B_CLOSE_ON_ESCAPE);
    80978099        alert->Go();
    80988100        return;
    80998101    }
  • src/kits/tracker/Tracker.cpp

    diff --git a/src/kits/tracker/Tracker.cpp b/src/kits/tracker/Tracker.cpp
    index bf44a53..8e48e29 100644
    a b TTracker::OpenRef(const entry_ref* ref, const node_ref* nodeToClose,  
    704704                B_TRANSLATE("There was an error resolving the link."),
    705705                B_TRANSLATE("Cancel"), 0, 0, B_WIDTH_AS_USUAL,
    706706                    B_WARNING_ALERT);
    707             alert->SetShortcut(0, B_ESCAPE);
     707            alert->SetFlags(B_CLOSE_ON_ESCAPE);
    708708            alert->Go();
    709709            return result;
    710710        }
  • src/kits/tracker/TrackerInitialState.cpp

    diff --git a/src/kits/tracker/TrackerInitialState.cpp b/src/kits/tracker/TrackerInitialState.cpp
    index 7bc3c89..4c867bf 100644
    a b TTracker::InstallTemporaryBackgroundImages()  
    641641            "failed. \nReason: %error"));
    642642        errorMessage.ReplaceFirst("%func", __PRETTY_FUNCTION__);
    643643        errorMessage.ReplaceFirst("%error", strerror(status));
    644         (new BAlert("AlertError", errorMessage.String(), B_TRANSLATE("OK"),
    645             NULL, NULL, B_WIDTH_AS_USUAL, B_STOP_ALERT))->Go();
     644        BAlert* alert = new BAlert("AlertError", errorMessage.String(),
     645            B_TRANSLATE("OK"), NULL, NULL, B_WIDTH_AS_USUAL, B_STOP_ALERT);
     646        alert->SetFlags(B_CLOSE_ON_ESCAPE);
     647        alert->Go();
    646648        return;
    647649    }
    648650    path.Append("artwork");
  • src/kits/tracker/WidgetAttributeText.cpp

    diff --git a/src/kits/tracker/WidgetAttributeText.cpp b/src/kits/tracker/WidgetAttributeText.cpp
    index 3e6c25d..0456fba 100644
    a b GenericAttributeText::CommitEditedTextFlavor(BTextView* textView)  
    16611661            B_TRANSLATE("Sorry, you cannot edit that attribute."),
    16621662            B_TRANSLATE("Cancel"),
    16631663            0, 0, B_WIDTH_AS_USUAL, B_STOP_ALERT);
    1664         alert->SetShortcut(0, B_ESCAPE);
     1664        alert->SetFlags(B_CLOSE_ON_ESCAPE);
    16651665        alert->Go();
    16661666        return false;
    16671667    }
    GenericAttributeText::CommitEditedTextFlavor(BTextView* textView)  
    16981698                    "attribute cannot store a multi-byte glyph."),
    16991699                    B_TRANSLATE("Cancel"),
    17001700                    0, 0, B_WIDTH_AS_USUAL, B_STOP_ALERT);
    1701                 alert->SetShortcut(0, B_ESCAPE);
     1701                alert->SetFlags(B_CLOSE_ON_ESCAPE);
    17021702                alert->Go();
    17031703                return false;
    17041704            }
    GenericAttributeText::CommitEditedTextFlavor(BTextView* textView)  
    18061806            B_TRANSLATE("There was an error writing the attribute."),
    18071807            B_TRANSLATE("Cancel"),
    18081808            0, 0, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
    1809         alert->SetShortcut(0, B_ESCAPE);
     1809        alert->SetFlags(B_CLOSE_ON_ESCAPE);
    18101810        alert->Go();
    18111811
    18121812        fValueIsDefined = false;
  • src/libs/print/libprint/BlockingWindow.cpp

    diff --git a/src/libs/print/libprint/BlockingWindow.cpp b/src/libs/print/libprint/BlockingWindow.cpp
    index 82cb546..ab658cb 100644
    a b HWindow::AboutRequested()  
    131131        font.SetSize(12); // font.SetFace(B_OUTLINED_FACE);
    132132        v->SetFontAndColor(0, s-text+1, &font, B_FONT_SIZE);
    133133    };
     134    about->SetFlags(B_CLOSE_ON_ESCAPE);
    134135    about->Go();
    135136}
    136137
  • src/libs/print/libprint/GraphicsDriver.cpp

    diff --git a/src/libs/print/libprint/GraphicsDriver.cpp b/src/libs/print/libprint/GraphicsDriver.cpp
    index 8340b8a..0aa8a4e 100644
    a b GraphicsDriver::_PrintJob(BFile* spoolFile)  
    702702            alert = new BAlert("", fTransport->LastError().c_str(), "OK");
    703703        else
    704704            alert = new BAlert("", "Printer not responding.", "OK");
     705        alert->SetFlags(B_CLOSE_ON_ESCAPE);
    705706        alert->Go();
    706707    }
    707708
  • src/preferences/appearance/CurView.cpp

    diff --git a/src/preferences/appearance/CurView.cpp b/src/preferences/appearance/CurView.cpp
    index f034006..0e227b1 100644
    a b printf("Loading cursor sets from disk\n");  
    238238                    "Please contact OpenBeOS about Appearance Preferences::CurView::"
    239239                    "LoadCursorSets::B_NAME_TOO_LONG for a bugfix", "OK",
    240240                     NULL, NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
     241                a->SetFlags(B_CLOSE_ON_ESCAPE);
    241242                a->Go();
    242243                break;
    243244            }
    printf("Loading cursor sets from disk\n");  
    267268                    "because of a file error. Perhaps there is a file (instead of a folder) at " COLOR_SET_DIR
    268269                    "? You will be able to change system cursors, but be unable to save them to a cursor set. ",
    269270                    "OK", NULL, NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
     271                a->SetFlags(B_CLOSE_ON_ESCAPE);
    270272                a->Go();
    271273                break;
    272274            }
    printf("Loading cursor sets from disk\n");  
    276278                    "because there are too many open files. Please close some files and restart "
    277279                    " this application.", "OK",
    278280                     NULL, NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
     281                a->SetFlags(B_CLOSE_ON_ESCAPE);
    279282                a->Go();
    280283                if(Window())
    281284                    Window()->PostMessage(B_QUIT_REQUESTED);
  • src/preferences/appearance/DecorSettingsView.cpp

    diff --git a/src/preferences/appearance/DecorSettingsView.cpp b/src/preferences/appearance/DecorSettingsView.cpp
    index 86882be..237d20d 100644
    a b DecorSettingsView::MessageReceived(BMessage *msg)  
    120120
    121121            BAlert *infoAlert = new BAlert(B_TRANSLATE("About Decorator"),
    122122                infoText.String(), B_TRANSLATE("OK"));
    123             infoAlert->SetShortcut(0, B_ESCAPE);
     123            infoAlert->SetFlags(B_CLOSE_ON_ESCAPE);
    124124            infoAlert->Go();
    125125
    126126            break;
  • src/preferences/bluetooth/BluetoothMain.cpp

    diff --git a/src/preferences/bluetooth/BluetoothMain.cpp b/src/preferences/bluetooth/BluetoothMain.cpp
    index c76142f..2d6c402 100644
    a b void  
    2727BluetoothApplication::ReadyToRun()
    2828{
    2929    if (!be_roster->IsRunning(BLUETOOTH_SIGNATURE)) {
    30 
    31         int32 choice = (new BAlert("bluetooth_server not running",
     30        BAlert* alert = new BAlert("bluetooth_server not running",
    3231            B_TRANSLATE("bluetooth_server has not been found running on the "
    3332            "system. Should be started, or stay offline"),
    3433            B_TRANSLATE("Work offline"), B_TRANSLATE("Quit"),
    3534            B_TRANSLATE("Start please"), B_WIDTH_AS_USUAL,
    36             B_WARNING_ALERT))->Go();
     35            B_WARNING_ALERT);
     36        alert->SetShortcut(2, B_ESCAPE);
     37        int32 choice = alert->Go();
    3738
    3839
    3940        switch (choice) {
    BluetoothApplication::MessageReceived(BMessage* message)  
    9091void
    9192BluetoothApplication::AboutRequested()
    9293{
    93 
    94     (new BAlert("about", B_TRANSLATE("Haiku Bluetooth system, (ARCE)\n\n"
     94    BAlert* alert = new BAlert("about", B_TRANSLATE(
     95                            "Haiku Bluetooth system, (ARCE)\n\n"
    9596                            "Created by Oliver Ruiz Dorantes\n\n"
    9697                            "With support of:\n"
    9798                            "   - Mika Lindqvist\n"
    BluetoothApplication::AboutRequested()  
    121122                            "   - Petter H. Juliussen\n"
    122123                            "Who gave me all the knowledge:\n"
    123124                            "   - the yellowTAB team"),
    124                         B_TRANSLATE("OK")))->Go();
    125 
     125                        B_TRANSLATE("OK"));
     126    alert->SetFlags(B_CLOSE_ON_ESCAPE);
     127    alert->Go();
    126128}
    127129
    128130
  • src/preferences/cpufrequency/StatusView.cpp

    diff --git a/src/preferences/cpufrequency/StatusView.cpp b/src/preferences/cpufrequency/StatusView.cpp
    index 3d7a651..c235ac8 100644
    a b StatusView::_AboutRequested()  
    429429    BAlert *alert = new BAlert("about", B_TRANSLATE("CPUFrequency\n"
    430430            "\twritten by Clemens Zeidler\n"
    431431            "\tCopyright 2009, Haiku, Inc.\n"),
    432         B_TRANSLATE("Ok"));
     432        B_TRANSLATE("OK"));
    433433    BTextView *view = alert->TextView();
    434434    BFont font;
    435435
    StatusView::_AboutRequested()  
    440440    font.SetFace(B_BOLD_FACE);
    441441    view->SetFontAndColor(0, 13, &font);
    442442
     443    alert->SetFlags(B_CLOSE_ON_ESCAPE);
    443444    alert->Go();
    444445}
    445446
    StatusView::_OpenPreferences()  
    689690            "Launching the CPU frequency preflet failed.\n\nError: "));
    690691        errorMessage << strerror(ret);
    691692        BAlert* alert = new BAlert("launch error", errorMessage.String(),
    692             "Ok");
     693            "OK");
    693694        // asynchronous alert in order to not block replicant host
    694695        // application
     696        alert->SetFlags(B_CLOSE_ON_ESCAPE);
    695697        alert->Go(NULL);
    696698    }
    697699}
  • src/preferences/datatranslations/DataTranslations.cpp

    diff --git a/src/preferences/datatranslations/DataTranslations.cpp b/src/preferences/datatranslations/DataTranslations.cpp
    index 2c9ff01..9aeeb84 100644
    a b DataTranslationsApplication::_InstallError(const char* name, status_t status)  
    5353    text.UnlockBuffer();
    5454    BAlert* alert = new BAlert(B_TRANSLATE("DataTranslations - Error"),
    5555        text.String(), B_TRANSLATE("OK"));
     56    alert->SetFlags(B_CLOSE_ON_ESCAPE);
    5657    alert->Go();
    5758}
    5859
    DataTranslationsApplication::_NoTranslatorError(const char* name)  
    8384        B_TRANSLATE("The item '%name' does not appear to be a Translator and "
    8485        "will not be installed."));
    8586    text.ReplaceAll("%name", name);
    86     BAlert* alert = new BAlert("", text.String(), B_TRANSLATE("Ok"));
     87    BAlert* alert = new BAlert("", text.String(), B_TRANSLATE("OK"));
     88    alert->SetFlags(B_CLOSE_ON_ESCAPE);
    8789    alert->Go();
    8890}
    8991
    DataTranslationsApplication::RefsReceived(BMessage* message)  
    152154            BAlert* alert = new BAlert(B_TRANSLATE("DataTranslations - Note"),
    153155                B_TRANSLATE("The new translator has been installed "
    154156                    "successfully."), B_TRANSLATE("OK"));
     157            alert->SetFlags(B_CLOSE_ON_ESCAPE);
    155158            alert->Go(NULL);
    156159        } else
    157160            _InstallError(ref.name, status);
  • src/preferences/datatranslations/DataTranslationsWindow.cpp

    diff --git a/src/preferences/datatranslations/DataTranslationsWindow.cpp b/src/preferences/datatranslations/DataTranslationsWindow.cpp
    index 41e8bb3..0c834c3 100644
    a b DataTranslationsWindow::_ShowInfoAlert(int32 id)  
    282282        view->SetFontAndColor(index, index + strlen(labels[i]), &font);
    283283    }
    284284
     285    alert->SetFlags(B_CLOSE_ON_ESCAPE);
    285286    alert->Go();
    286287}
    287288
  • src/preferences/dun/DUNWindow.cpp

    diff --git a/src/preferences/dun/DUNWindow.cpp b/src/preferences/dun/DUNWindow.cpp
    index f8d8f6c81..40c1571 100644
    a b void DUNWindow::MessageReceived (BMessage *message)  
    357357            connectbutton->SetEnabled(false);
    358358            //debug
    359359            BAlert *errormsg = new BAlert("errormsg", "The hidden wispy bush\nOver the green flower\nThe sea and connection have stopped.", "   Haiku Error ;)   " , NULL, NULL, B_WIDTH_FROM_WIDEST, B_IDEA_ALERT);
    360             errormsg->SetShortcut(0, B_ESCAPE);
     360            errormsg->SetFlags(B_CLOSE_ON_ESCAPE);
    361361            errormsg->Go();
    362362        }   
    363363            break;
    void DUNWindow::MessageReceived (BMessage *message)  
    367367            disconnectbutton->SetEnabled(false);
    368368            connectbutton->SetEnabled(true);
    369369            BAlert *errormsg = new BAlert("errormsg", "A late long rain\nOver an icy meadow\nBroken connection and dreams.", "   Haiku Error ;)   ", NULL , NULL, B_WIDTH_FROM_WIDEST, B_IDEA_ALERT);               
    370             errormsg->SetShortcut(0, B_ESCAPE);
     370            errormsg->SetFlags(B_CLOSE_ON_ESCAPE);
    371371            errormsg->Go();
    372372        }   
    373373            break;
    void DUNWindow::MessageReceived (BMessage *message)  
    376376        {
    377377            // debug
    378378            BAlert *errormsg = new BAlert("errormsg", "Hark! Something is wrong.\nFor this is not what I asked.\n\nMy life is somewhat ... Incomplete.\n", "   Haiku Error ;)   " , NULL, NULL, B_WIDTH_FROM_WIDEST, B_IDEA_ALERT);
    379             errormsg->SetShortcut(0, B_ESCAPE);
     379            errormsg->SetFlags(B_CLOSE_ON_ESCAPE);
    380380            errormsg->Go();
    381381        }
    382382            break;
    void DUNWindow::MessageReceived (BMessage *message)  
    385385        {
    386386            // debug
    387387            BAlert *errormsg = new BAlert("errormsg", "Lost Clouds.\nDisappear behind the mountains.\n\nFor an eternity must I wait ?\n", "   Haiku Error ;)   " , NULL, NULL, B_WIDTH_FROM_WIDEST, B_IDEA_ALERT);
    388             errormsg->SetShortcut(0, B_ESCAPE);
     388            errormsg->SetFlags(B_CLOSE_ON_ESCAPE);
    389389            errormsg->Go();
    390390        }
    391391            break;
  • src/preferences/filetypes/ApplicationTypeWindow.cpp

    diff --git a/src/preferences/filetypes/ApplicationTypeWindow.cpp b/src/preferences/filetypes/ApplicationTypeWindow.cpp
    index 5ceaaed..77fc74f 100644
    a b ApplicationTypeWindow::QuitRequested()  
    10251025            B_TRANSLATE("Do you want to save the changes?"),
    10261026            B_TRANSLATE("Quit, don't save"), B_TRANSLATE("Cancel"),
    10271027            B_TRANSLATE("Save"), B_WIDTH_AS_USUAL, B_WARNING_ALERT);
     1028        alert->SetShortcut(1, B_ESCAPE);
     1029
    10281030        int32 choice = alert->Go();
    10291031        switch (choice) {
    10301032            case 0:
  • src/preferences/filetypes/FileTypes.cpp

    diff --git a/src/preferences/filetypes/FileTypes.cpp b/src/preferences/filetypes/FileTypes.cpp
    index 91ec41b..17fcda6 100644
    a b FileTypes::RefsReceived(BMessage* message)  
    227227                "%s"),
    228228                ref.name, strerror(status));
    229229
    230             (new BAlert(B_TRANSLATE("FileTypes request"),
     230            BAlert* alert = new BAlert(B_TRANSLATE("FileTypes request"),
    231231                buffer, B_TRANSLATE("OK"), NULL, NULL,
    232                 B_WIDTH_AS_USUAL, B_STOP_ALERT))->Go();
     232                B_WIDTH_AS_USUAL, B_STOP_ALERT);
     233            alert->SetFlags(B_CLOSE_ON_ESCAPE);
     234            alert->Go();
    233235
    234236            message->RemoveData("refs", --index);
    235237            continue;
    error_alert(const char* message, status_t status, alert_type type)  
    475477            strerror(status));
    476478    }
    477479
    478     (new BAlert(B_TRANSLATE("FileTypes request"),
     480    BAlert* alert = new BAlert(B_TRANSLATE("FileTypes request"),
    479481        status == B_OK ? message : warning,
    480         B_TRANSLATE("OK"), NULL, NULL, B_WIDTH_AS_USUAL, type))->Go();
     482        B_TRANSLATE("OK"), NULL, NULL, B_WIDTH_AS_USUAL, type);
     483        alert->SetFlags(B_CLOSE_ON_ESCAPE);
     484        alert->Go();
    481485}
    482486
    483487
  • src/preferences/filetypes/FileTypesWindow.cpp

    diff --git a/src/preferences/filetypes/FileTypesWindow.cpp b/src/preferences/filetypes/FileTypesWindow.cpp
    index 6d8d9de..ed2b153 100644
    a b FileTypesWindow::MessageReceived(BMessage* message)  
    679679                    "group, hold down the Shift key and press \"Remove\"."),
    680680                    B_TRANSLATE("Remove"), B_SHIFT_KEY, B_TRANSLATE("Cancel"),
    681681                    0, NULL, 0, B_WIDTH_AS_USUAL, B_STOP_ALERT);
     682                alert->SetShortcut(1, B_ESCAPE);
    682683            } else {
    683684                alert = new BAlert(B_TRANSLATE("FileTypes request"),
    684685                    B_TRANSLATE("Removing a file type cannot be reverted.\n"
    685686                    "Are you sure you want to remove it?"),
    686687                    B_TRANSLATE("Remove"), B_TRANSLATE("Cancel"),
    687688                    NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
     689                alert->SetShortcut(1, B_ESCAPE);
    688690            }
    689691            if (alert->Go())
    690692                break;
  • src/preferences/filetypes/PreferredAppMenu.cpp

    diff --git a/src/preferences/filetypes/PreferredAppMenu.cpp b/src/preferences/filetypes/PreferredAppMenu.cpp
    index 55933b3..2ff8154 100644
    a b retrieve_preferred_app(BMessage* message, bool sameAs, const char* forType,  
    291291            description[0] ? description : preferred);
    292292
    293293        BAlert* alert = new BAlert(B_TRANSLATE("FileTypes request"), warning,
    294             B_TRANSLATE("Set Preferred Application"), B_TRANSLATE("Cancel"),
     294            B_TRANSLATE("Set preferred application"), B_TRANSLATE("Cancel"),
    295295            NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
     296        alert->SetShortcut(1, B_ESCAPE);
    296297        if (alert->Go() == 1)
    297298            return B_ERROR;
    298299    }
  • src/preferences/fonts/main.cpp

    diff --git a/src/preferences/fonts/main.cpp b/src/preferences/fonts/main.cpp
    index c46fa4a..34cddfd 100644
    a b FontsApp::AboutRequested()  
    5050    font.SetSize(18);
    5151    font.SetFace(B_BOLD_FACE);
    5252    view->SetFontAndColor(0, 5, &font);
    53 
     53   
     54    alert->SetFlags(B_CLOSE_ON_ESCAPE);
    5455    alert->Go();
    5556}
    5657
  • src/preferences/joysticks/JoyWin.cpp

    diff --git a/src/preferences/joysticks/JoyWin.cpp b/src/preferences/joysticks/JoyWin.cpp
    index fb03fea..2423eb4 100644
    a b static int  
    4949ShowMessage(char* string)
    5050{
    5151    BAlert *alert = new BAlert("Message", string, "OK");
    52     alert->SetShortcut(1, B_ESCAPE);
     52    alert->SetFlags(B_CLOSE_ON_ESCAPE);
    5353    return alert->Go();
    5454}
    5555
    JoyWin::_ShowNoCompatibleJoystickMessage()  
    437437    str << " for a driver designed for Haiku or BeOS.";
    438438
    439439    BAlert *alert = new BAlert("test1", str.String(), "OK");
    440     alert->SetShortcut(0, B_ENTER);
     440    alert->SetFlags(B_CLOSE_ON_ESCAPE);
    441441    alert->Go();
    442442}
    443443
    JoyWin::_ShowNoDeviceConnectedMessage(const char* joy, const char* port)  
    448448    str << joy << " device connected to the port '" << port << "'.";
    449449
    450450    BAlert *alert = new BAlert("test1", str.String(), "Stop");
    451     alert->SetShortcut(0, B_ENTER);
     451    alert->SetFlags(B_CLOSE_ON_ESCAPE);
    452452    alert->Go();
    453453}
    454454
  • src/preferences/keyboard/Keyboard.cpp

    diff --git a/src/preferences/keyboard/Keyboard.cpp b/src/preferences/keyboard/Keyboard.cpp
    index 91c8d74..1774fac 100644
    a b KeyboardApplication::MessageReceived(BMessage* message)  
    3535                B_TRANSLATE("Something has gone wrong!"),
    3636                B_TRANSLATE("OK"), NULL, NULL,
    3737                B_WIDTH_AS_USUAL, B_OFFSET_SPACING, B_WARNING_ALERT);
     38            errorAlert->SetFlags(B_CLOSE_ON_ESCAPE);
    3839            errorAlert->Go();
    3940            be_app->PostMessage(B_QUIT_REQUESTED);
    4041            break;
    KeyboardApplication::MessageReceived(BMessage* message)  
    4950void
    5051KeyboardApplication::AboutRequested()
    5152{
    52     (new BAlert("about", B_TRANSLATE("Written by Andrew Edward McCall"),
    53         B_TRANSLATE("OK")))->Go();
     53    BAlert* alert = new BAlert("about",
     54        B_TRANSLATE("Written by Andrew Edward McCall"), B_TRANSLATE("OK"));
     55    alert->SetFlags(B_CLOSE_ON_ESCAPE);
     56    alert->Go();
    5457}
    5558
    5659
  • src/preferences/locale/LocaleWindow.cpp

    diff --git a/src/preferences/locale/LocaleWindow.cpp b/src/preferences/locale/LocaleWindow.cpp
    index a112a9c..4adfb85 100644
    a b LocaleWindow::LocaleWindow()  
    147147                "use this preflet!"),
    148148            B_TRANSLATE("OK"), NULL, NULL,
    149149            B_WIDTH_AS_USUAL, B_OFFSET_SPACING, B_STOP_ALERT);
     150        alert->SetFlags(B_CLOSE_ON_ESCAPE);
    150151        alert->Go();
    151152    }
    152153
  • src/preferences/mail/AutoConfigWindow.cpp

    diff --git a/src/preferences/mail/AutoConfigWindow.cpp b/src/preferences/mail/AutoConfigWindow.cpp
    index 2ffeb8d..36dd4dc 100644
    a b AutoConfigWindow::MessageReceived(BMessage* msg)  
    9595                    invalidMailAlert = new BAlert("invalidMailAlert",
    9696                        B_TRANSLATE("Enter a valid e-mail address."),
    9797                        B_TRANSLATE("OK"));
     98                    invalidMailAlert->SetFlags(B_CLOSE_ON_ESCAPE);
    9899                    invalidMailAlert->Go();
    99100                    return;
    100101                }
  • src/preferences/mail/ConfigWindow.cpp

    diff --git a/src/preferences/mail/ConfigWindow.cpp b/src/preferences/mail/ConfigWindow.cpp
    index e3b4ce3..256f51f 100644
    a b ConfigWindow::_RevertToLastSettings()  
    866866                "\nThe general settings couldn't be reverted.\n\n"
    867867                "Error retrieving general settings:\n%s\n"),
    868868            strerror(status));
    869         (new BAlert(B_TRANSLATE("Error"), text, B_TRANSLATE("OK"), NULL, NULL,
    870             B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go();
     869        BAlert* alert = new BAlert(B_TRANSLATE("Error"), text,
     870            B_TRANSLATE("OK"), NULL, NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
     871        alert->SetFlags(B_CLOSE_ON_ESCAPE);
     872        alert->Go();
    871873    }
    872874
    873875    // revert account data
  • src/preferences/mail/FilterConfigView.cpp

    diff --git a/src/preferences/mail/FilterConfigView.cpp b/src/preferences/mail/FilterConfigView.cpp
    index ce330b8..b2f9d1e 100644
    a b FiltersConfigView::MessageReceived(BMessage *msg)  
    460460
    461461            MailAddonSettings* mailSettings = _GetCurrentMailSettings();
    462462            if (!mailSettings->MoveFilterSettings(from, to)) {
    463                 (new BAlert("E-mail", B_TRANSLATE("The filter could not be "
    464                     "moved. Deleting filter."), B_TRANSLATE("OK")))->Go();
     463                BAlert* alert = new BAlert("E-mail",
     464                    B_TRANSLATE("The filter could not be moved. Deleting "
     465                    "filter."), B_TRANSLATE("OK"));
     466                alert->SetFlags(B_CLOSE_ON_ESCAPE);
     467                alert->Go();
    465468                fListView->RemoveItem(to);
    466469                break;
    467470            }   
  • src/preferences/media/MediaWindow.cpp

    diff --git a/src/preferences/media/MediaWindow.cpp b/src/preferences/media/MediaWindow.cpp
    index a9efbc1..0fc2de3 100644
    a b MediaWindow::InitMedia(bool first)  
    436436            B_TRANSLATE("Quit"),
    437437            B_TRANSLATE("Start media server"), NULL,
    438438            B_WIDTH_AS_USUAL, B_WARNING_ALERT);
    439         if (alert->Go()==0)
     439        alert->SetShortcut(0, B_ESCAPE);
     440        if (alert->Go() == 0)
    440441            return B_ERROR;
    441442
    442443        fAlert = new MediaAlert(BRect(0, 0, 300, 60),
    ErrorAlert(char* errorMessage) {  
    565566    printf("%s\n", errorMessage);
    566567    BAlert* alert = new BAlert("BAlert", errorMessage, B_TRANSLATE("OK"),
    567568        NULL, NULL, B_WIDTH_AS_USUAL, B_STOP_ALERT);
     569    alert->SetFlags(B_CLOSE_ON_ESCAPE);
    568570    alert->Go();
    569571    exit(1);
    570572}
  • src/preferences/mouse/Mouse.cpp

    diff --git a/src/preferences/mouse/Mouse.cpp b/src/preferences/mouse/Mouse.cpp
    index e6a20e7..ba34407 100644
    a b MouseApplication::MouseApplication()  
    3434void
    3535MouseApplication::AboutRequested()
    3636{
    37     (new BAlert("about", B_TRANSLATE("...by Andrew Edward McCall"),
    38         B_TRANSLATE("Dig Deal")))->Go();
     37    BAlert* alert = new BAlert("about",
     38        B_TRANSLATE("...by Andrew Edward McCall"), B_TRANSLATE("Dig Deal"));
     39    alert->SetFlags(B_CLOSE_ON_ESCAPE);
     40    alert->Go();
    3941}
    4042
    4143
  • src/preferences/network/EthernetSettingsView.cpp

    diff --git a/src/preferences/network/EthernetSettingsView.cpp b/src/preferences/network/EthernetSettingsView.cpp
    index 8a23893..89c28b1 100644
    a b EthernetSettingsView::_TriggerAutoConfig(const char* device)  
    589589    status_t status = interface.AutoConfigure(AF_INET);
    590590
    591591    if (status == B_BAD_PORT_ID) {
    592         (new BAlert("error", B_TRANSLATE("The net_server needs to run for "
    593             "the auto configuration!"), B_TRANSLATE("OK")))->Go();
     592        BAlert* alert = new BAlert("error", B_TRANSLATE("The net_server needs to run for "
     593            "the auto configuration!"), B_TRANSLATE("OK"));
     594        alert->SetFlags(B_CLOSE_ON_ESCAPE);
     595        alert->Go();
    594596    } else if (status != B_OK) {
    595597        BString errorMessage(B_TRANSLATE("Auto-configuring failed: "));
    596598        errorMessage << strerror(status);
    597         (new BAlert("error", errorMessage.String(), "OK"))->Go();
     599        BAlert* alert = new BAlert("error", errorMessage.String(), "OK");
     600        alert->SetFlags(B_CLOSE_ON_ESCAPE);
     601        alert->Go();
    598602    }
    599603
    600604    return status;
  • src/preferences/network_old/BackupWindow.cpp

    diff --git a/src/preferences/network_old/BackupWindow.cpp b/src/preferences/network_old/BackupWindow.cpp
    index c494f67..faf60fe 100644
    a b BackupWin::MessageReceived(BMessage *message)  
    6363            }
    6464            else {
    6565                BAlert *alert = new BAlert("Backup Info Alert","You must specify a name.","OK");
     66                alert->SetFlags(B_CLOSE_ON_ESCAPE);
    6667                alert->Go();
    6768            }   
    6869            break;
  • src/preferences/network_old/LoginInfo.cpp

    diff --git a/src/preferences/network_old/LoginInfo.cpp b/src/preferences/network_old/LoginInfo.cpp
    index 36d7d6f..a39a613 100644
    a b void LoginInfo::MessageReceived(BMessage *message)  
    6363                    else {
    6464                        BAlert *alert = new BAlert("Login Info Alert",
    6565                            "Passwords don't match. Please try again","OK");
     66                        alert->SetFlags(B_CLOSE_ON_ESCAPE);
    6667                        alert->Go();
    6768                    }   
    6869                   
    6970            }
    7071            else {
    7172           
    72                 BAlert *alert = new BAlert("Login Info Alert","You didn't fill all the fields","Oups...",NULL,NULL,B_WIDTH_FROM_WIDEST,B_INFO_ALERT);
     73                BAlert *alert = new BAlert("Login Info Alert",
     74                    "You didn't fill in all the fields","Oops...", NULL, NULL,
     75                    B_WIDTH_FROM_WIDEST,B_INFO_ALERT);
     76                alert->SetFlags(B_CLOSE_ON_ESCAPE);
    7377                alert->Go();
    7478            }   
    7579            break;
  • src/preferences/network_old/NetworkWindow.cpp

    diff --git a/src/preferences/network_old/NetworkWindow.cpp b/src/preferences/network_old/NetworkWindow.cpp
    index da8e5f3..c7dd8c6 100644
    a b bool  
    457457NetworkWindow::QuitRequested(void)
    458458{
    459459    if (fSave->IsEnabled() == true) {
    460         BAlert *alert = new BAlert("Save Info Alert","Save changes before quitting?",
    461                                     "Don't Save","Cancel","Save");
     460        BAlert *alert = new BAlert("Save Info Alert", "Save changes before "
     461            quitting?", "Don't Save", "Cancel", "Save");
     462        alert->SetShortcut(1, B_ESCAPE);
    462463        int32 result = alert->Go();
    463464       
    464465        switch (result) {
    NetworkWindow::QuitRequested(void)  
    486487
    487488void NetworkWindow::DeleteConfigFile()
    488489{
    489     BAlert *alert = new BAlert("Alert","Really delete networking configuration?",
    490                                 "Delete","Cancel");
     490    BAlert *alert = new BAlert("Alert", "Really delete networking configuration?",
     491                                "Delete", "Cancel");
     492    alert->SetShortcut(1, B_ESCAPE);
    491493    int32 result = alert->Go();
    492494   
    493495    if (result == 0) {
  • src/preferences/notifications/DisplayView.cpp

    diff --git a/src/preferences/notifications/DisplayView.cpp b/src/preferences/notifications/DisplayView.cpp
    index cde5bcf..66744f5 100644
    a b DisplayView::Load()  
    107107                "It's possible you don't have write access to the "
    108108                "settings directory."), B_TRANSLATE("OK"), NULL, NULL,
    109109            B_WIDTH_AS_USUAL, B_STOP_ALERT);
     110        alert->SetFlags(B_CLOSE_ON_ESCAPE);
    110111        (void)alert->Go();
    111112    }
    112113
    DisplayView::Save()  
    176177            B_TRANSLATE("Can't save preferenes, you probably don't have "
    177178                "write access to the settings directory or the disk is full."),
    178179                B_TRANSLATE("OK"), NULL, NULL, B_WIDTH_AS_USUAL, B_STOP_ALERT);
     180        alert->SetFlags(B_CLOSE_ON_ESCAPE);
    179181        (void)alert->Go();
    180182        return ret;
    181183    }
  • src/preferences/notifications/GeneralView.cpp

    diff --git a/src/preferences/notifications/GeneralView.cpp b/src/preferences/notifications/GeneralView.cpp
    index 7d1eb8d..8b749d8 100644
    a b GeneralView::MessageReceived(BMessage* msg)  
    136136                        " found, this means your InfoPopper installation was"
    137137                        " not successfully completed."), B_TRANSLATE("OK"),
    138138                        NULL, NULL, B_WIDTH_AS_USUAL, B_STOP_ALERT);
     139                    alert->SetFlags(B_CLOSE_ON_ESCAPE);
    139140                    (void)alert->Go();
    140141                    return;
    141142                }
    GeneralView::MessageReceived(BMessage* msg)  
    153154                            "cannot be stopped, because the server can't be"
    154155                            " reached."), B_TRANSLATE("OK"), NULL, NULL,
    155156                            B_WIDTH_AS_USUAL, B_STOP_ALERT);
     157                        alert->SetFlags(B_CLOSE_ON_ESCAPE);
    156158                        (void)alert->Go();
    157159                        return;
    158160                    }
    GeneralView::MessageReceived(BMessage* msg)  
    164166                            " notifications because the server can't be "
    165167                            "reached."), B_TRANSLATE("OK"),
    166168                            NULL, NULL, B_WIDTH_AS_USUAL, B_STOP_ALERT);
     169                        alert->SetFlags(B_CLOSE_ON_ESCAPE);
    167170                        (void)alert->Go();
    168171                        return;
    169172                    }
    GeneralView::MessageReceived(BMessage* msg)  
    181184                            " was not successfully completed."),
    182185                            B_TRANSLATE("OK"), NULL, NULL, B_WIDTH_AS_USUAL,
    183186                            B_STOP_ALERT);
     187                        alert->SetFlags(B_CLOSE_ON_ESCAPE);
    184188                        (void)alert->Go();
    185189                        return;
    186190                    }
    GeneralView::Load()  
    215219                "It's possible you don't have write access to the "
    216220                "settings directory."), B_TRANSLATE("OK"), NULL, NULL,
    217221            B_WIDTH_AS_USUAL, B_STOP_ALERT);
     222        alert->SetFlags(B_CLOSE_ON_ESCAPE);
    218223        (void)alert->Go();
    219224    }
    220225
    GeneralView::Save()  
    270275            B_TRANSLATE("An error occurred saving the preferences.\n"
    271276                "It's possible you are running out of disk space."),
    272277            B_TRANSLATE("OK"), NULL, NULL, B_WIDTH_AS_USUAL, B_STOP_ALERT);
     278        alert->SetFlags(B_CLOSE_ON_ESCAPE);
    273279        (void)alert->Go();
    274280        return ret;
    275281    }
    GeneralView::Save()  
    296302            "write access to the boot settings directory."), B_TRANSLATE("OK"),
    297303            NULL, NULL,
    298304            B_WIDTH_AS_USUAL, B_STOP_ALERT);
     305        alert->SetFlags(B_CLOSE_ON_ESCAPE);
    299306        (void)alert->Go();
    300307        return ret;
    301308    }
    GeneralView::Save()  
    316323                "you probably don't have write permission to the boot settings"
    317324                " directory."), B_TRANSLATE("OK"), NULL, NULL,
    318325                B_WIDTH_AS_USUAL, B_STOP_ALERT);
     326            alert->SetFlags(B_CLOSE_ON_ESCAPE);
    319327            (void)alert->Go();
    320328            return ret;
    321329        }
  • src/preferences/notifications/NotificationsView.cpp

    diff --git a/src/preferences/notifications/NotificationsView.cpp b/src/preferences/notifications/NotificationsView.cpp
    index b032666..d9dc381 100644
    a b NotificationsView::_LoadAppUsage()  
    184184                "It's possible you don't have write access to the "
    185185                "settings directory."), B_TRANSLATE("OK"), NULL, NULL,
    186186            B_WIDTH_AS_USUAL, B_STOP_ALERT);
     187        alert->SetFlags(B_CLOSE_ON_ESCAPE);
    187188        (void)alert->Go();
    188189        return B_ERROR;
    189190    }
  • src/preferences/screen/ScreenApplication.cpp

    diff --git a/src/preferences/screen/ScreenApplication.cpp b/src/preferences/screen/ScreenApplication.cpp
    index fc87e7a..a35aa35 100644
    a b ScreenApplication::AboutRequested()  
    4040    BAlert *aboutAlert = new BAlert(B_TRANSLATE("About"),
    4141        B_TRANSLATE("Screen preferences by the Haiku team"), B_TRANSLATE("OK"),
    4242        NULL, NULL, B_WIDTH_AS_USUAL, B_OFFSET_SPACING, B_INFO_ALERT);
    43     aboutAlert->SetShortcut(0, B_OK);
     43    aboutAlert->SetFlags(B_CLOSE_ON_ESCAPE);
    4444    aboutAlert->Go();
    4545}
    4646
  • src/preferences/screen/ScreenWindow.cpp

    diff --git a/src/preferences/screen/ScreenWindow.cpp b/src/preferences/screen/ScreenWindow.cpp
    index f2199d9..bce4e57 100644
    a b ScreenWindow::QuitRequested()  
    520520            BString warning = B_TRANSLATE("Could not write VESA mode settings"
    521521                " file:\n\t");
    522522            warning << strerror(status);
    523             (new BAlert(B_TRANSLATE("Warning"), warning.String(), B_TRANSLATE("OK"), NULL,
    524                 NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go();
     523            BAlert* alert = new BAlert(B_TRANSLATE("Warning"),
     524                warning.String(), B_TRANSLATE("OK"), NULL,
     525                NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
     526            alert->SetFlags(B_CLOSE_ON_ESCAPE);
     527            alert->Go();
    525528        }
    526529    }
    527530
    ScreenWindow::_Apply()  
    13031306        BAlert* alert = new BAlert(B_TRANSLATE("Warning"), message,
    13041307            B_TRANSLATE("OK"), NULL, NULL,
    13051308            B_WIDTH_AS_USUAL, B_WARNING_ALERT);
     1309        alert->SetFlags(B_CLOSE_ON_ESCAPE);
    13061310        alert->Go();
    13071311    }
    13081312}
  • src/preferences/screensaver/PasswordWindow.cpp

    diff --git a/src/preferences/screensaver/PasswordWindow.cpp b/src/preferences/screensaver/PasswordWindow.cpp
    index 661ff4d..aaaf4ff 100644
    a b PasswordWindow::MessageReceived(BMessage *message)  
    184184                    BAlert *alert = new BAlert("noMatch",
    185185                        B_TRANSLATE("Passwords don't match. Please try again."),
    186186                        B_TRANSLATE("OK"));
     187                    alert->SetFlags(B_CLOSE_ON_ESCAPE);
    187188                    alert->Go();
    188189                    break;
    189190                }
  • src/preferences/shortcuts/ShortcutsWindow.cpp

    diff --git a/src/preferences/shortcuts/ShortcutsWindow.cpp b/src/preferences/shortcuts/ShortcutsWindow.cpp
    index 6632f2e..1a7373d 100644
    a b ShortcutsWindow::QuitRequested()  
    286286            B_TRANSLATE("Really quit without saving your changes?"),
    287287            B_TRANSLATE("Don't save"), B_TRANSLATE("Cancel"),
    288288            B_TRANSLATE("Save"));
     289        alert->SetShortcut(1, B_ESCAPE);
    289290        switch(alert->Go()) {
    290291            case 1:
    291292                ret = false;
    ShortcutsWindow::QuitRequested()  
    296297                // up the file requester
    297298                if (fLastSaved.InitCheck() == B_OK) {
    298299                    if (_SaveKeySet(fLastSaved) == false) {
    299                         (new BAlert(ERROR,
     300                        BAlert* alert = new BAlert(ERROR,
    300301                            B_TRANSLATE("Shortcuts was unable to save your "
    301302                                "KeySet file!"),
    302                             B_TRANSLATE("Oh no")))->Go();
     303                            B_TRANSLATE("Oh no"));
     304                        alert->SetFlags(B_CLOSE_ON_ESCAPE);
     305                        alert->Go();
    303306                        ret = true; //quit anyway
    304307                    }
    305308                } else {
    ShortcutsWindow::MessageReceived(BMessage* msg)  
    550553                            fLastSaved = BEntry(&ref);
    551554                            break;
    552555                        } else {
    553                             (new BAlert(ERROR,
     556                            BAlert* alert = new BAlert(ERROR,
    554557                                B_TRANSLATE("Shortcuts was couldn't open your "
    555                                 "KeySet file!"), B_TRANSLATE("OK")))->Go(NULL);
     558                                "KeySet file!"), B_TRANSLATE("OK"));
     559                            alert->SetFlags(B_CLOSE_ON_ESCAPE);
     560                            alert->Go(NULL);
    556561                            break;
    557562                        }
    558563                    }
    ShortcutsWindow::MessageReceived(BMessage* msg)  
    576581                    _GetSettingsFile(&eref);
    577582                    if (ref == eref) fKeySetModified = false;
    578583                } else {
    579                     (new BAlert(ERROR,
     584                    BAlert* alert = new BAlert(ERROR,
    580585                        B_TRANSLATE("Shortcuts was unable to parse your "
    581                         "KeySet file!"),
    582                         B_TRANSLATE("OK")))->Go(NULL);
     586                        "KeySet file!"), B_TRANSLATE("OK"));
     587                    alert->SetFlags(B_CLOSE_ON_ESCAPE);
     588                    alert->Go(NULL);
    583589                    break;
    584590                }
    585591            }
    ShortcutsWindow::MessageReceived(BMessage* msg)  
    629635            } else PostMessage(SAVE_KEYSET_AS); // open the save requester...
    630636
    631637            if (showSaveError) {
    632                 (new BAlert(ERROR,
     638                BAlert* alert = new BAlert(ERROR,
    633639                    B_TRANSLATE("Shortcuts wasn't able to save your keyset."),
    634                     B_TRANSLATE("OK")))->Go(NULL);
     640                    B_TRANSLATE("OK"));
     641                alert->SetFlags(B_CLOSE_ON_ESCAPE);
     642                alert->Go(NULL);
    635643            }
    636644            break;
    637645        }
  • src/preferences/sounds/HApp.cpp

    diff --git a/src/preferences/sounds/HApp.cpp b/src/preferences/sounds/HApp.cpp
    index bdc2409..7c23673 100644
    a b HApp::AboutRequested()  
    4949            "  Original work from Atsushi Takamatsu.\n"
    5050            "Copyright ©2003-2006 Haiku"),
    5151        B_TRANSLATE("OK"));
     52    alert->SetFlags(B_CLOSE_ON_ESCAPE);
    5253    alert->Go();
    5354}
    5455
  • src/preferences/sounds/HEventList.cpp

    diff --git a/src/preferences/sounds/HEventList.cpp b/src/preferences/sounds/HEventList.cpp
    index afb04ed..f2bde82 100644
    a b HEventList::SelectionChanged()  
    127127            BMediaFiles().RemoveRefFor(fType, row->Name(), ref);
    128128            BAlert* alert = new BAlert("alert",
    129129                B_TRANSLATE("No such file or directory"), B_TRANSLATE("OK"));
     130            alert->SetFlags(B_CLOSE_ON_ESCAPE);
    130131            alert->Go();
    131132            return;
    132133        }
  • src/preferences/sounds/HWindow.cpp

    diff --git a/src/preferences/sounds/HWindow.cpp b/src/preferences/sounds/HWindow.cpp
    index 06efd30..40f2b0c 100644
    a b HWindow::MessageReceived(BMessage* message)  
    212212                        B_TRANSLATE("This is not an audio file."),
    213213                        B_TRANSLATE("OK"), NULL, NULL,
    214214                        B_WIDTH_AS_USUAL, B_STOP_ALERT);
     215                    alert->SetFlags(B_CLOSE_ON_ESCAPE);
    215216                    alert->Go();
    216217                    break;
    217218                }
  • src/preferences/time/NetworkTimeView.cpp

    diff --git a/src/preferences/time/NetworkTimeView.cpp b/src/preferences/time/NetworkTimeView.cpp
    index 49a34dd..d463ddb 100644
    a b NetworkTimeView::MessageReceived(BMessage* message)  
    377377                        "while synchronizing:\r\n%s"),
    378378                        errorString);
    379379
    380                 (new BAlert(B_TRANSLATE("Time"), buffer,
    381                     B_TRANSLATE("OK")))->Go();
     380                BAlert* alert = new BAlert(B_TRANSLATE("Time"), buffer,
     381                    B_TRANSLATE("OK"));
     382                alert->SetFlags(B_CLOSE_ON_ESCAPE);
     383                alert->Go();
    382384            }
    383385            break;
    384386        }
  • src/preferences/time/Time.cpp

    diff --git a/src/preferences/time/Time.cpp b/src/preferences/time/Time.cpp
    index 6fb1805..4f9fd37 100644
    a b TimeApplication::AboutRequested()  
    5959        "Time & Date, written by:\n\n\tAndrew Edward McCall\n\tMike Berg\n\t"
    6060        "Julun\n\tPhilippe Saint-Pierre\n\nCopyright 2004-2012, Haiku."),
    6161        B_TRANSLATE("OK"));
     62    alert->SetFlags(B_CLOSE_ON_ESCAPE);
    6263    alert->Go();
    6364}
    6465
  • src/preferences/touchpad/TouchpadPrefView.cpp

    diff --git a/src/preferences/touchpad/TouchpadPrefView.cpp b/src/preferences/touchpad/TouchpadPrefView.cpp
    index 713d92b..b53ce2d 100644
    a b TouchpadView::MouseUp(BPoint point)  
    106106            "normal mouse operation. Do you really want to change it?"),
    107107            B_TRANSLATE("OK"), B_TRANSLATE("Cancel"),
    108108            NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
     109        alert->SetShortcut(1, B_ESCAPE);
    109110        result = alert->Go();
    110111    }
    111112    if (result == 0) {
  • src/preferences/virtualmemory/SettingsWindow.cpp

    diff --git a/src/preferences/virtualmemory/SettingsWindow.cpp b/src/preferences/virtualmemory/SettingsWindow.cpp
    index 7328806..3443d9a 100644
    a b SettingsWindow::SettingsWindow()  
    237237    status_t result = fSettings.SwapVolume().InitCheck();
    238238
    239239    if (result != B_OK) {
    240         int32 choice = (new BAlert("VirtualMemory", B_TRANSLATE(
     240        BAlert* alert = new BAlert("VirtualMemory", B_TRANSLATE(
    241241            "The swap volume specified in the settings file is invalid.\n"
    242242            "You can keep the current setting or switch to the "
    243243            "default swap volume."),
    244244            B_TRANSLATE("Keep"), B_TRANSLATE("Switch"), NULL,
    245             B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go();
     245            B_WIDTH_AS_USUAL, B_WARNING_ALERT);
     246        alert->SetShortcut(0, B_ESCAPE);
     247        int32 choice = alert->Go();
    246248        if (choice == 1) {
    247249            BVolumeRoster volumeRoster;
    248250            BVolume bootVolume;
    SettingsWindow::MessageReceived(BMessage* message)  
    293295                // ToDo: maybe we want to remove this possibility in the GUI
    294296                // as Be did, but I thought a proper warning could be helpful
    295297                // (for those that want to change that anyway)
    296                 int32 choice = (new BAlert("VirtualMemory",
     298                BAlert* alert = new BAlert("VirtualMemory",
    297299                    B_TRANSLATE(
    298300                    "Disabling virtual memory will have unwanted effects on "
    299301                    "system stability once the memory is used up.\n"
    SettingsWindow::MessageReceived(BMessage* message)  
    301303                    "until this point is reached.\n\n"
    302304                    "Are you really sure you want to turn it off?"),
    303305                    B_TRANSLATE("Turn off"), B_TRANSLATE("Keep enabled"), NULL,
    304                     B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go();
     306                    B_WIDTH_AS_USUAL, B_WARNING_ALERT);
     307                alert->SetShortcut(1, B_ESCAPE);
     308                int32 choice = alert->Go();
    305309                if (choice == 1) {
    306310                    fSwapEnabledCheckBox->SetValue(1);
    307311                    break;
  • src/preferences/virtualmemory/VirtualMemory.cpp

    diff --git a/src/preferences/virtualmemory/VirtualMemory.cpp b/src/preferences/virtualmemory/VirtualMemory.cpp
    index 60fdfda..51d7560 100644
    a b VirtualMemory::AboutRequested()  
    5050    font.SetFace(B_BOLD_FACE);
    5151    view->SetFontAndColor(0, 13, &font);
    5252
     53    alert->SetFlags(B_CLOSE_ON_ESCAPE);
    5354    alert->Go();
    5455}
    5556
  • src/servers/bluetooth/DeskbarReplicant.cpp

    diff --git a/src/servers/bluetooth/DeskbarReplicant.cpp b/src/servers/bluetooth/DeskbarReplicant.cpp
    index 67f999d..8265b69 100644
    a b DeskbarReplicant::_ShowErrorAlert(BString msg, status_t status)  
    242242{
    243243    msg << "\n\nError: " << strerror(status);
    244244    BAlert* alert = new BAlert("Bluetooth error", msg.String(), "OK");
     245    alert->SetFlags(B_CLOSE_ON_ESCAPE);
    245246    alert->Go(NULL);
    246247}
    247248
  • src/servers/debug/DebugServer.cpp

    diff --git a/src/servers/debug/DebugServer.cpp b/src/servers/debug/DebugServer.cpp
    index 83e4970..837ca26 100644
    a b TeamDebugHandler::_HandleMessage(DebugMessage *message)  
    689689        BAlert *alert = new BAlert(NULL, buffer.String(),
    690690            B_TRANSLATE("Debug"), B_TRANSLATE("OK"), NULL,
    691691            B_WIDTH_AS_USUAL, B_WARNING_ALERT);
     692        alert->SetFlags(B_CLOSE_ON_ESCAPE);
    692693        int32 result = alert->Go();
    693694        kill = (result == 1);
    694695        _NotifyRegistrar(fTeam, false, !kill);
  • src/servers/input/MethodReplicant.cpp

    diff --git a/src/servers/input/MethodReplicant.cpp b/src/servers/input/MethodReplicant.cpp
    index 2a6c9df..a0e3c43 100644
    a b MethodReplicant::MessageReceived(BMessage* message)  
    137137
    138138    switch (message->what) {
    139139        case B_ABOUT_REQUESTED:
    140             (new BAlert("About Method Replicant",
     140        {
     141            BAlert* alert = new BAlert("About Method Replicant",
    141142                "Method Replicant (Replicant)\n"
    142143                "  Brought to you by Jérôme DUVAL.\n\n"
    143                 "Haiku, 2004-2009", "OK"))->Go();
     144                "Haiku, 2004-2009", "OK");
     145            alert->SetFlags(B_CLOSE_ON_ESCAPE);
     146            alert->Go();
    144147            break;
     148        }
    145149        case IS_UPDATE_NAME:
    146150            UpdateMethodName(message);
    147151            break;
  • src/servers/mail/MailDaemon.cpp

    diff --git a/src/servers/mail/MailDaemon.cpp b/src/servers/mail/MailDaemon.cpp
    index b12bcbe..6d53cb8 100644
    a b MailDaemonApp::MessageReceived(BMessage* msg)  
    306306                BAlert* alert = new BAlert(B_TRANSLATE("New Messages"),
    307307                    fAlertString.String(), "OK", NULL, NULL, B_WIDTH_AS_USUAL);
    308308                alert->SetFeel(B_NORMAL_WINDOW_FEEL);
     309                alert->SetFlags(B_CLOSE_ON_ESCAPE);
    309310                alert->Go(NULL);
    310311                fAlertString = B_EMPTY_STRING;
    311312            }
  • src/servers/media/media_server.cpp

    diff --git a/src/servers/media/media_server.cpp b/src/servers/media/media_server.cpp
    index fd51cf77..e0494c1 100644
    a b ServerApp::_LaunchAddOnServer()  
    219219    if (err == B_OK)
    220220        return;
    221221
    222     (new BAlert("media_server", "Launching media_addon_server failed.\n\n"
    223         "media_server will terminate", "OK"))->Go();
     222    BAlert* alert = new BAlert("media_server", "Launching media_addon_server "
     223        "failed.\n\nmedia_server will terminate", "OK");
     224        alert->SetFlags(B_CLOSE_ON_ESCAPE);
     225        alert->Go();
    224226    fprintf(stderr, "Launching media_addon_server (%s) failed: %s\n",
    225227        B_MEDIA_ADDON_SERVER_SIGNATURE, strerror(err));
    226228    exit(1);
  • src/servers/midi/MidiServerApp.cpp

    diff --git a/src/servers/midi/MidiServerApp.cpp b/src/servers/midi/MidiServerApp.cpp
    index 28fa74a..184ed88 100644
    a b MidiServerApp::~MidiServerApp()  
    6262void
    6363MidiServerApp::AboutRequested()
    6464{
    65     (new BAlert(0,
     65    BAlert* alert = new BAlert(0,
    6666        "Haiku midi_server 1.0.0 alpha\n\n"
    6767        "notes disguised as bytes\n"
    6868        "propagating to endpoints,\n"
    6969        "an aural delight",
    70         "Okay", 0, 0, B_WIDTH_AS_USUAL,
    71         B_INFO_ALERT))->Go();
     70        "OK", 0, 0, B_WIDTH_AS_USUAL,
     71        B_INFO_ALERT);
     72    alert->SetFlags(B_CLOSE_ON_ESCAPE);
     73    alert->Go();
    7274}
    7375
    7476
  • src/servers/mount/AutoMounter.cpp

    diff --git a/src/servers/mount/AutoMounter.cpp b/src/servers/mount/AutoMounter.cpp
    index 65afd90..cf60d1d 100644
    a b AutoMounter::_MountVolume(const BMessage* message)  
    569569        char text[512];
    570570        snprintf(text, sizeof(text),
    571571            B_TRANSLATE("Error mounting volume:\n\n%s"), strerror(status));
    572         (new BAlert(B_TRANSLATE("Mount error"), text,
    573             B_TRANSLATE("OK")))->Go(NULL);
     572        BAlert* alert = new BAlert(B_TRANSLATE("Mount error"), text,
     573            B_TRANSLATE("OK"));
     574        alert->SetFlags(B_CLOSE_ON_ESCAPE);
     575        alert->Go(NULL);
    574576    }
    575577}
    576578
    AutoMounter::_ReportUnmountError(const char* name, status_t error)  
    603605    snprintf(text, sizeof(text), B_TRANSLATE("Could not unmount disk "
    604606        "\"%s\":\n\t%s"), name, strerror(error));
    605607
    606     (new BAlert(B_TRANSLATE("Unmount error"), text, B_TRANSLATE("OK"),
    607         NULL, NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go(NULL);
     608    BAlert* alert = new BAlert(B_TRANSLATE("Unmount error"), text,
     609        B_TRANSLATE("OK"), NULL, NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
     610    alert->SetFlags(B_CLOSE_ON_ESCAPE);
     611    alert->Go(NULL);
    608612}
    609613
    610614
  • src/servers/net/NetServer.cpp

    diff --git a/src/servers/net/NetServer.cpp b/src/servers/net/NetServer.cpp
    index e30db4a..fdf9b46 100644
    a b NetServer::AboutRequested()  
    238238    font.SetFace(B_BOLD_FACE);
    239239    view->SetFontAndColor(0, 17, &font);
    240240
     241    alert->SetFlags(B_CLOSE_ON_ESCAPE);
    241242    alert->Go(NULL);
    242243}
    243244
  • src/servers/notification/NotificationWindow.cpp

    diff --git a/src/servers/notification/NotificationWindow.cpp b/src/servers/notification/NotificationWindow.cpp
    index 39bdf1e..f7e8321 100644
    a b NotificationWindow::_LoadAppFilters(bool startMonitor)  
    440440            BAlert* alert = new BAlert(B_TRANSLATE("Warning"),
    441441                    B_TRANSLATE("Couldn't start filter monitor."
    442442                        " Live filter changes disabled."), B_TRANSLATE("Darn."));
     443            alert->SetFlags(B_CLOSE_ON_ESCAPE);
    443444            alert->Go();
    444445        }
    445446    }
    NotificationWindow::_LoadGeneralSettings(bool startMonitor)  
    504505            BAlert* alert = new BAlert(B_TRANSLATE("Warning"),
    505506                        B_TRANSLATE("Couldn't start general settings monitor.\n"
    506507                        "Live filter changes disabled."), B_TRANSLATE("OK"));
     508            alert->SetFlags(B_CLOSE_ON_ESCAPE);
    507509            alert->Go();
    508510        }
    509511    }
    NotificationWindow::_LoadDisplaySettings(bool startMonitor)  
    555557            BAlert* alert = new BAlert(B_TRANSLATE("Warning"),
    556558                B_TRANSLATE("Couldn't start display settings monitor.\n"
    557559                    "Live filter changes disabled."), B_TRANSLATE("OK"));
     560            alert->SetFlags(B_CLOSE_ON_ESCAPE);
    558561            alert->Go();
    559562        }
    560563    }
  • src/servers/print/ConfigWindow.cpp

    diff --git a/src/servers/print/ConfigWindow.cpp b/src/servers/print/ConfigWindow.cpp
    index a88ea61..30ea250 100644
    a b ConfigWindow::AboutRequested()  
    309309
    310310    BAlert *about = new BAlert("About printer server", text.String(),
    311311        B_TRANSLATE("OK"));
     312    about->SetFlags(B_CLOSE_ON_ESCAPE);
    312313    about->Go();
    313314}
    314315
  • src/servers/print/PrintServerApp.R5.cpp

    diff --git a/src/servers/print/PrintServerApp.R5.cpp b/src/servers/print/PrintServerApp.R5.cpp
    index c89948f..bf466ae 100644
    a b PrintServerApp::async_thread(void* data)  
    9797                        B_TRANSLATE("Would you like to set one up now?"));
    9898                    BAlert* alert = new BAlert("Info", alertText.String(),
    9999                        B_TRANSLATE("No"), B_TRANSLATE("Yes"));
     100                    alert->SetShortcut(0, B_ESCAPE);
    100101                    if (alert->Go() == 1) {
    101102                        if (count == 0)
    102103                            run_add_printer_panel();
    PrintServerApp::async_thread(void* data)  
    143144                        text.ReplaceFirst("@", printerName.String());
    144145                        BAlert* alert = new BAlert("", text.String(),
    145146                            B_TRANSLATE("No"), B_TRANSLATE("Yes"));
     147                        alert->SetShortcut(0, B_ESCAPE);
    146148                        if (alert->Go() == 1)
    147149                            p->app->SelectPrinter(printerName.String());
    148150                    }
  • src/servers/registrar/ShutdownProcess.cpp

    diff --git a/src/servers/registrar/ShutdownProcess.cpp b/src/servers/registrar/ShutdownProcess.cpp
    index 02a2a71..e3d2ea2 100644
    a b ShutdownProcess::_WorkerDoShutdown()  
    12561256        BAlert* alert = new BAlert(title.String(), text,
    12571257            B_TRANSLATE("Cancel"), otherText, defaultText,
    12581258            B_WIDTH_AS_USUAL, B_WARNING_ALERT);
    1259         alert->SetShortcut(0, B_ESCAPE);
    12601259        // We want the alert to behave more like a regular window...
    12611260        alert->SetFeel(B_NORMAL_WINDOW_FEEL);
    12621261        // ...but not quit. Minimizing the alert would prevent the user from
    12631262        // finding it again, since registrar does not have an entry in the
    12641263        // Deskbar.
    1265         alert->SetFlags(alert->Flags() | B_NOT_MINIMIZABLE);
     1264        alert->SetFlags(alert->Flags() | B_NOT_MINIMIZABLE | B_CLOSE_ON_ESCAPE);
    12661265        alert->SetWorkspaces(B_ALL_WORKSPACES);
    12671266        int32 result = alert->Go();
    12681267
  • src/servers/syslog_daemon/SyslogDaemon.cpp

    diff --git a/src/servers/syslog_daemon/SyslogDaemon.cpp b/src/servers/syslog_daemon/SyslogDaemon.cpp
    index 993638d..5808469 100644
    a b SyslogDaemon::AboutRequested()  
    7373    font.SetFace(B_BOLD_FACE);         
    7474    view->SetFontAndColor(0, name.Length(), &font);
    7575
     76    alert->SetFlags(B_CLOSE_ON_ESCAPE);
    7677    alert->Go(NULL);
    7778}
    7879