Am 08.03.2011 00:01, schrieb stpere@xxxxxxxxx:
Author: stpere Date: 2011-03-08 00:01:45 +0100 (Tue, 08 Mar 2011) New Revision: 40862 Changeset: http://dev.haiku-os.org/changeset/40862 Ticket: http://dev.haiku-os.org/ticket/6902 Modified: haiku/trunk/src/bin/dstcheck.cpp Log: dstcheck: * Make alerts closeable using escape fixes ticket #6902. Modified: haiku/trunk/src/bin/dstcheck.cpp =================================================================== --- haiku/trunk/src/bin/dstcheck.cpp 2011-03-07 20:03:00 UTC (rev 40861) +++ haiku/trunk/src/bin/dstcheck.cpp 2011-03-07 23:01:45 UTC (rev 40862) @@ -46,6 +46,7 @@ : BAlert(title, text, button1, button2, button3, width, type), fRunner(NULL) { + SetShortcut(0, B_ESCAPE); } @@ -143,9 +144,11 @@ exit(0); if (index == 2) { - index = (new BAlert("dstcheck", + BAlert *alert = new BAlert("dstcheck", B_TRANSLATE("Would you like to set the clock?"), - B_TRANSLATE("No"), B_TRANSLATE("Yes")))->Go(); + B_TRANSLATE("No"), B_TRANSLATE("Yes")); + alert->SetShortcut(0, B_ESCAPE); + index = alert->Go();
When encountering such lame Windows-like button labels, please always adjust them to be verbs. In this case perhaps "No"/"Cancel" and "Set clock". The point being that reading the alert text body should not be strictly required to anticipate what each button will do. This is actually a very important aspect of the user experience.
Best regards, -Stephan