Setting the escape key as shortcut for the Cancel options of Tracker's dialogs.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29958 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Jonas Sundström 2009-04-05 23:47:58 +00:00
parent 0f617d4476
commit 019f90e634
10 changed files with 179 additions and 80 deletions

View File

@ -232,6 +232,7 @@ AutoMounter::_SuggestMountFlags(const BPartition* partition,
BAlert* alert = new BAlert("Mount Warning", string.String(), BAlert* alert = new BAlert("Mount Warning", string.String(),
"Mount Read/Write", "Cancel", "Mount Read-only", "Mount Read/Write", "Cancel", "Mount Read-only",
B_WIDTH_FROM_WIDEST, B_WARNING_ALERT); B_WIDTH_FROM_WIDEST, B_WARNING_ALERT);
alert->SetShortcut(1, B_ESCAPE);
int32 choice = alert->Go(); int32 choice = alert->Go();
switch (choice) { switch (choice) {
case 0: case 0:
@ -284,8 +285,10 @@ AutoMounter::_SuggestForceUnmount(const char* name, status_t error)
"Note: if an application is currently writing to the volume, unmounting" "Note: if an application is currently writing to the volume, unmounting"
" it now might result in loss of data.\n"; " it now might result in loss of data.\n";
int32 choice = (new BAlert("", text.String(), "Cancel", "Force Unmount", BAlert* alert = new BAlert("", text.String(), "Cancel", "Force Unmount",
NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go(); NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
alert->SetShortcut(0, B_ESCAPE);
int32 choice = alert->Go();
return choice == 1; return choice == 1;
} }
@ -1018,8 +1021,10 @@ UnmountIfMatchingID(Partition *partition, void *castToParams)
text << "To unmount " << partition->VolumeName() << " some query " text << "To unmount " << partition->VolumeName() << " some query "
"windows have to be closed. Would you like to close the query " "windows have to be closed. Would you like to close the query "
"windows?"; "windows?";
if ((new BAlert("", text.String(), "Cancel", "Close and unmount", NULL, BAlert* alert = new BAlert("", text.String(), "Cancel",
B_WIDTH_FROM_LABEL))->Go() == 0) "Close and unmount", NULL, B_WIDTH_FROM_LABEL);
alert->SetShortcut(0, B_ESCAPE);
if (alert->Go() == 0)
return partition; return partition;
tracker->CloseActiveQueryWindows(params->device); tracker->CloseActiveQueryWindows(params->device);
} }

View File

@ -2973,8 +2973,10 @@ BContainerWindow::LoadAddOn(BMessage *message)
if (result != B_OK) { if (result != B_OK) {
char buffer[1024]; char buffer[1024];
sprintf(buffer, "Error %s loading Add-On %s.", strerror(result), addonRef.name); sprintf(buffer, "Error %s loading Add-On %s.", strerror(result), addonRef.name);
(new BAlert("", buffer, "Cancel", 0, 0, BAlert* alert = new BAlert("", buffer, "Cancel", 0, 0,
B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go(); B_WIDTH_AS_USUAL, B_WARNING_ALERT);
alert->SetShortcut(0, B_ESCAPE);
alert->Go();
return; return;
} }

View File

@ -462,8 +462,10 @@ FSClipboardPaste(Model *model, uint32 linksMode)
// can't copy/paste to root('/') directory // can't copy/paste to root('/') directory
if (model->IsRoot()) { if (model->IsRoot()) {
(new BAlert("", kNoCopyToRootStr, "Cancel", NULL, NULL, BAlert *alert = new BAlert("", kNoCopyToRootStr, "Cancel",
B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go(); NULL, NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
alert->SetShortcut(0, B_ESCAPE);
alert->Go();
okToMove = false; okToMove = false;
} }
@ -472,8 +474,10 @@ FSClipboardPaste(Model *model, uint32 linksMode)
// can't copy items into the trash // can't copy items into the trash
if (copyList->CountItems() > 0 && FSIsTrashDir(&entry)) { if (copyList->CountItems() > 0 && FSIsTrashDir(&entry)) {
(new BAlert("", kNoCopyToTrashStr, "Cancel", NULL, NULL, BAlert *alert = new BAlert("", kNoCopyToTrashStr, "Cancel",
B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go(); NULL, NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
alert->SetShortcut(0, B_ESCAPE);
alert->Go();
okToMove = false; okToMove = false;
} }

View File

@ -180,12 +180,17 @@ TrackerCopyLoopControl::FileError(const char *message, const char *name,
char buffer[512]; char buffer[512];
sprintf(buffer, message, name, strerror(error)); sprintf(buffer, message, name, strerror(error));
if (allowContinue) if (allowContinue) {
return (new BAlert("", buffer, "Cancel", "OK", 0, BAlert *alert = new BAlert("", buffer, "Cancel", "OK", 0,
B_WIDTH_AS_USUAL, B_STOP_ALERT))->Go() != 0; B_WIDTH_AS_USUAL, B_STOP_ALERT);
alert->SetShortcut(0, B_ESCAPE);
return alert->Go() != 0;
}
(new BAlert("", buffer, "Cancel", 0, 0, BAlert *alert = new BAlert("", buffer, "Cancel", 0, 0,
B_WIDTH_AS_USUAL, B_STOP_ALERT))->Go(); B_WIDTH_AS_USUAL, B_STOP_ALERT);
alert->SetShortcut(0, B_ESCAPE);
alert->Go();
return false; return false;
} }
@ -546,8 +551,11 @@ InitCopy(uint32 moveMode, BObjectList<entry_ref> *srcList, thread_id thread,
if (gStatusWindow) if (gStatusWindow)
gStatusWindow->RemoveStatusItem(thread); gStatusWindow->RemoveStatusItem(thread);
(new BAlert("", "You can't move or copy items to read-only volumes.", BAlert *alert = new BAlert("",
"Cancel", 0, 0, B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go(); "You can't move or copy items to read-only volumes.",
"Cancel", 0, 0, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
alert->SetShortcut(0, B_ESCAPE);
alert->Go();
return B_ERROR; return B_ERROR;
} }
@ -565,8 +573,10 @@ InitCopy(uint32 moveMode, BObjectList<entry_ref> *srcList, thread_id thread,
else else
errorStr = "You cannot copy or move the root directory."; errorStr = "You cannot copy or move the root directory.";
(new BAlert("", errorStr, "Cancel", 0, 0, BAlert *alert = new BAlert("", errorStr, "Cancel", 0, 0,
B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go(); B_WIDTH_AS_USUAL, B_WARNING_ALERT);
alert->SetShortcut(0, B_ESCAPE);
alert->Go();
return B_ERROR; return B_ERROR;
} }
if (moveMode == kMoveSelectionTo if (moveMode == kMoveSelectionTo
@ -604,8 +614,10 @@ InitCopy(uint32 moveMode, BObjectList<entry_ref> *srcList, thread_id thread,
// check for free space before starting copy // check for free space before starting copy
if ((totalSize + (4 * kKBSize)) >= dstVol->FreeBytes()) { if ((totalSize + (4 * kKBSize)) >= dstVol->FreeBytes()) {
(new BAlert("", kNoFreeSpace, "Cancel", 0, 0, BAlert *alert = new BAlert("", kNoFreeSpace, "Cancel",
B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go(); 0, 0, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
alert->SetShortcut(0, B_ESCAPE);
alert->Go();
return B_ERROR; return B_ERROR;
} }
} }
@ -766,8 +778,10 @@ MoveTask(BObjectList<entry_ref> *srcList, BEntry *destEntry, BList *pointList, u
if (sourceEntry.InitCheck() != B_OK) { if (sourceEntry.InitCheck() != B_OK) {
BString error; BString error;
error << "Error moving \"" << srcRef->name << "\"."; error << "Error moving \"" << srcRef->name << "\".";
(new BAlert("", error.String(), "Cancel", 0, 0, BAlert *alert = new BAlert("", error.String(), "Cancel", 0, 0,
B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go(); B_WIDTH_AS_USUAL, B_WARNING_ALERT);
alert->SetShortcut(0, B_ESCAPE);
alert->Go();
break; break;
} }
@ -781,8 +795,10 @@ MoveTask(BObjectList<entry_ref> *srcList, BEntry *destEntry, BList *pointList, u
BString error; BString error;
error << "Error moving \"" << srcRef->name << "\" to Trash. (" error << "Error moving \"" << srcRef->name << "\" to Trash. ("
<< strerror(result) << ")"; << strerror(result) << ")";
(new BAlert("", error.String(), "Cancel", 0, 0, BAlert *alert = new BAlert("", error.String(), "Cancel",
B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go(); 0, 0, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
alert->SetShortcut(0, B_ESCAPE);
alert->Go();
break; break;
} }
continue; continue;
@ -1619,8 +1635,10 @@ MoveEntryToTrash(BEntry *entry, BPoint *loc, Undo &undo)
volume.GetName(name); volume.GetName(name);
char buffer[256]; char buffer[256];
sprintf(buffer, "Cannot unmount the boot volume \"%s\".", name); sprintf(buffer, "Cannot unmount the boot volume \"%s\".", name);
(new BAlert("", buffer, "Cancel", 0, 0, BAlert *alert = new BAlert("", buffer, "Cancel", 0, 0,
B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go(); B_WIDTH_AS_USUAL, B_WARNING_ALERT);
alert->SetShortcut(0, B_ESCAPE);
alert->Go();
} else { } else {
BMessage message(kUnmountVolume); BMessage message(kUnmountVolume);
message.AddInt32("device_id", volume.Device()); message.AddInt32("device_id", volume.Device());
@ -1724,7 +1742,10 @@ PreFlightNameCheck(BObjectList<entry_ref> *srcList, const BDirectory *destDir,
char replaceMsg[256]; char replaceMsg[256];
sprintf(replaceMsg, kReplaceManyStr, verb, verb); sprintf(replaceMsg, kReplaceManyStr, verb, verb);
switch ((new BAlert("", replaceMsg, "Cancel", "Prompt", "Replace All"))->Go()) { BAlert *alert = new BAlert("", replaceMsg,
"Cancel", "Prompt", "Replace All");
alert->SetShortcut(0, B_ESCAPE);
switch (alert->Go()) {
case 0: case 0:
return kCanceled; return kCanceled;
@ -1857,11 +1878,12 @@ CheckName(uint32 moveMode, const BEntry *sourceEntry, const BDirectory *destDir,
// special case single collision (don't need Replace All shortcut) // special case single collision (don't need Replace All shortcut)
BAlert *alert; BAlert *alert;
if (multipleCollisions || sourceIsDirectory) if (multipleCollisions || sourceIsDirectory) {
alert = new BAlert("", replaceMsg, "Skip", "Replace All"); alert = new BAlert("", replaceMsg, "Skip", "Replace All");
else } else {
alert = new BAlert("", replaceMsg, "Cancel", "Replace"); alert = new BAlert("", replaceMsg, "Cancel", "Replace");
alert->SetShortcut(0, B_ESCAPE);
}
switch (alert->Go()) { switch (alert->Go()) {
case 0: // user selected "Cancel" or "Skip" case 0: // user selected "Cancel" or "Skip"
replaceAll = kCanceled; replaceAll = kCanceled;
@ -1887,8 +1909,10 @@ CheckName(uint32 moveMode, const BEntry *sourceEntry, const BDirectory *destDir,
BString error; BString error;
error << "There was a problem trying to replace \"" error << "There was a problem trying to replace \""
<< name << "\". The item might be open or busy."; << name << "\". The item might be open or busy.";
(new BAlert("", error.String(), "Cancel", 0, 0, BAlert *alert = new BAlert("", error.String(), "Cancel", 0, 0,
B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go(); B_WIDTH_AS_USUAL, B_WARNING_ALERT);
alert->SetShortcut(0, B_ESCAPE);
alert->Go();
} }
return err; return err;
@ -2769,8 +2793,10 @@ FSCreateNewFolderIn(const node_ref *dirNode, entry_ref *newRef,
} }
} }
(new BAlert("", "Sorry, could not create a new folder.", "Cancel", 0, 0, BAlert *alert = new BAlert("", "Sorry, could not create a new folder.",
B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go(); "Cancel", 0, 0, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
alert->SetShortcut(0, B_ESCAPE);
alert->Go();
return result; return result;
} }
@ -2914,12 +2940,17 @@ _TrackerLaunchAppWithDocuments(const entry_ref *appRef, const BMessage *refs, bo
alertString << "Could not open \"" << appRef->name << "\" (" << strerror(error) << "). "; alertString << "Could not open \"" << appRef->name << "\" (" << strerror(error) << "). ";
if (refs && openWithOK) { if (refs && openWithOK) {
alertString << kFindAlternativeStr; alertString << kFindAlternativeStr;
if ((new BAlert("", alertString.String(), "Cancel", "Find", 0, BAlert *alert = new BAlert("", alertString.String(),
B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go() == 1) "Cancel", "Find", 0, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
alert->SetShortcut(0, B_ESCAPE);
if (alert->Go() == 1)
error = TrackerOpenWith(refs); error = TrackerOpenWith(refs);
} else } else {
(new BAlert("", alertString.String(), "Cancel", 0, 0, BAlert *alert = new BAlert("", alertString.String(),
B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go(); "Cancel", 0, 0, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
alert->SetShortcut(0, B_ESCAPE);
alert->Go();
}
} }
} }
@ -3131,8 +3162,11 @@ _TrackerLaunchDocuments(const entry_ref */*doNotUse*/, const BMessage *refs,
// offer the possibility to change the permissions // offer the possibility to change the permissions
alertString << "\nShould this be fixed?"; alertString << "\nShould this be fixed?";
if ((new BAlert("", alertString.String(), "Cancel", "Proceed", 0, BAlert *alert = new BAlert("", alertString.String(),
B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go() == 1) { "Cancel", "Proceed", 0, B_WIDTH_AS_USUAL,
B_WARNING_ALERT);
alert->SetShortcut(0, B_ESCAPE);
if (alert->Go() == 1) {
BEntry entry(&documentRef); BEntry entry(&documentRef);
mode_t permissions; mode_t permissions;
@ -3185,12 +3219,18 @@ _TrackerLaunchDocuments(const entry_ref */*doNotUse*/, const BMessage *refs,
if (openWithOK) { if (openWithOK) {
ASSERT(alternative); ASSERT(alternative);
alertString << alternative; alertString << alternative;
if ((new BAlert("", alertString.String(), "Cancel", "Find", 0, BAlert *alert = new BAlert("", alertString.String(),
B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go() == 1) "Cancel", "Find", 0, B_WIDTH_AS_USUAL,
B_WARNING_ALERT);
alert->SetShortcut(0, B_ESCAPE);
if (alert->Go() == 1)
error = TrackerOpenWith(refs); error = TrackerOpenWith(refs);
} else } else {
(new BAlert("", alertString.String(), "Cancel", 0, 0, BAlert *alert = new BAlert("", alertString.String(),
B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go(); "Cancel", 0, 0, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
alert->SetShortcut(0, B_ESCAPE);
alert->Go();
}
} }
} }

View File

@ -2236,8 +2236,12 @@ NameItemPanel::MessageReceived(BMessage *message)
{ {
const char *text = fNameFld->Text(); const char *text = fNameFld->Text();
if (!text || text[0] == '\0'){ if (!text || text[0] == '\0'){
if ((new BAlert("", "The new name is empty, please enter a name", BAlert *alert = new BAlert("",
"Cancel", "OK", NULL, B_WIDTH_AS_USUAL))->Go() == 0) "The new name is empty, please "
"enter a name", "Cancel", "OK", NULL,
B_WIDTH_AS_USUAL);
alert->SetShortcut(0, B_ESCAPE);
if (alert->Go() == 0)
return; return;
} }
BMessage nameChangeMessage(kNameChange); BMessage nameChangeMessage(kNameChange);

View File

@ -1389,6 +1389,16 @@ TFilePanel::ShowCenteredAlert(const char *text, const char *button1,
BAlert *alert = new BAlert("", text, button1, button2, button3, BAlert *alert = new BAlert("", text, button1, button2, button3,
B_WIDTH_AS_USUAL, B_WARNING_ALERT); B_WIDTH_AS_USUAL, B_WARNING_ALERT);
alert->MoveTo(Frame().left + 10, Frame().top + 10); alert->MoveTo(Frame().left + 10, Frame().top + 10);
if (strncmp(button1, "Cancel", 7))
alert->SetShortcut(0, B_ESCAPE);
if (strncmp(button2, "Cancel", 7))
alert->SetShortcut(1, B_ESCAPE);
if (strncmp(button3, "Cancel", 7))
alert->SetShortcut(2, B_ESCAPE);
return alert->Go(); return alert->Go();
} }

View File

@ -678,8 +678,10 @@ OpenWithPoseView::OpenSelection(BPose *pose, int32 *)
"publisher of the application and ask them to update their application " "publisher of the application and ask them to update their application "
"to list the type of your document as supported."; "to list the type of your document as supported.";
if ((new BAlert("", warning.String(), "Cancel", "Open", 0, BAlert *alert = new BAlert("", warning.String(),
B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go() == 0) "Cancel", "Open", 0, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
alert->SetShortcut(0, B_ESCAPE);
if (alert->Go() == 0)
return; return;
} }
// else - once we have an extensible sniffer, tell users to ask // else - once we have an extensible sniffer, tell users to ask

View File

@ -2392,9 +2392,14 @@ BPoseView::RemoveColumn(BColumn *columnToRemove, bool runAlert)
{ {
// make sure last column is not removed // make sure last column is not removed
if (CountColumns() == 1) { if (CountColumns() == 1) {
if (runAlert) if (runAlert) {
(new BAlert("", "You must have at least one Attribute showing.", BAlert *alert = new BAlert("",
"Cancel", 0, 0, B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go(); "You must have at least one Attribute showing.",
"Cancel", 0, 0, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
alert->SetShortcut(0, B_ESCAPE);
alert->Go();
}
return false; return false;
} }
@ -4491,22 +4496,28 @@ BPoseView::MoveSelectionInto(Model *destFolder, BContainerWindow *srcWindow,
bool okToMove = true; bool okToMove = true;
if (destFolder->IsRoot()) { if (destFolder->IsRoot()) {
(new BAlert("", kNoCopyToRootStr, "Cancel", NULL, NULL, BAlert *alert = new BAlert("", kNoCopyToRootStr, "Cancel",
B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go(); NULL, NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
alert->SetShortcut(0, B_ESCAPE);
alert->Go();
okToMove = false; okToMove = false;
} }
// can't copy items into the trash // can't copy items into the trash
if (forceCopy && destIsTrash) { if (forceCopy && destIsTrash) {
(new BAlert("", kNoCopyToTrashStr, "Cancel", NULL, NULL, BAlert *alert = new BAlert("", kNoCopyToTrashStr, "Cancel",
B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go(); NULL, NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
alert->SetShortcut(0, B_ESCAPE);
alert->Go();
okToMove = false; okToMove = false;
} }
// can't create symlinks into the trash // can't create symlinks into the trash
if (createLink && destIsTrash) { if (createLink && destIsTrash) {
(new BAlert("", kNoLinkToTrashStr, "Cancel", NULL, NULL, BAlert *alert = new BAlert("", kNoLinkToTrashStr, "Cancel",
B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go(); NULL, NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
alert->SetShortcut(0, B_ESCAPE);
alert->Go();
okToMove = false; okToMove = false;
} }
@ -4514,8 +4525,10 @@ BPoseView::MoveSelectionInto(Model *destFolder, BContainerWindow *srcWindow,
if (srcWindow->TargetModel()->IsQuery() if (srcWindow->TargetModel()->IsQuery()
&& !forceCopy && !destIsTrash && !createLink) { && !forceCopy && !destIsTrash && !createLink) {
srcWindow->UpdateIfNeeded(); srcWindow->UpdateIfNeeded();
okToMove = (new BAlert("", kOkToMoveStr, "Cancel", "Move", NULL, BAlert *alert = new BAlert("", kOkToMoveStr, "Cancel",
B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go() == 1; "Move", NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
alert->SetShortcut(0, B_ESCAPE);
okToMove = alert->Go() == 1;
} }
if (okToMove) { if (okToMove) {
@ -5377,9 +5390,10 @@ CheckVolumeReadOnly(const entry_ref *ref)
{ {
BVolume volume (ref->device); BVolume volume (ref->device);
if (volume.IsReadOnly()) { if (volume.IsReadOnly()) {
BAlert *alert (new BAlert ("", "Files cannot be moved or deleted " BAlert *alert = new BAlert ("", "Files cannot be moved or "
"from a read-only volume.", "Cancel", NULL, NULL, "deleted from a read-only volume.", "Cancel", NULL,
B_WIDTH_AS_USUAL, B_STOP_ALERT)); NULL, B_WIDTH_AS_USUAL, B_STOP_ALERT);
alert->SetShortcut(0, B_ESCAPE);
alert->Go(); alert->Go();
return false; return false;
} }
@ -5427,7 +5441,9 @@ BPoseView::MoveSelectionOrEntryToTrash(const entry_ref *ref, bool selectNext)
"be reverted.)"; "be reverted.)";
} }
if ((new BAlert("", alertText, "Cancel", "Delete"))->Go() == 0) BAlert *alert = new BAlert("", alertText, "Cancel", "Delete");
alert->SetShortcut(0, B_ESCAPE);
if (alert->Go() == 0)
return; return;
} }
@ -7644,8 +7660,11 @@ BPoseView::OpenInfoWindows()
{ {
BMessenger tracker(kTrackerSignature); BMessenger tracker(kTrackerSignature);
if (!tracker.IsValid()) { if (!tracker.IsValid()) {
(new BAlert("", "The Tracker must be running to see Info windows.", BAlert *alert = new BAlert("", "The Tracker must be running "
"Cancel", NULL, NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go(); "to see Info windows.", "Cancel", NULL, NULL,
B_WIDTH_AS_USUAL, B_WARNING_ALERT);
alert->SetShortcut(0, B_ESCAPE);
alert->Go();
return; return;
} }
SendSelectionAsRefs(kGetInfo); SendSelectionAsRefs(kGetInfo);
@ -7657,8 +7676,11 @@ BPoseView::SetDefaultPrinter()
{ {
BMessenger tracker(kTrackerSignature); BMessenger tracker(kTrackerSignature);
if (!tracker.IsValid()) { if (!tracker.IsValid()) {
(new BAlert("", "The Tracker must be running to see set the default printer.", BAlert *alert = new BAlert("", "The Tracker must be running "
"Cancel", NULL, NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go(); "to see set the default printer.", "Cancel", NULL,
NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
alert->SetShortcut(0, B_ESCAPE);
alert->Go();
return; return;
} }
SendSelectionAsRefs(kMakeActivePrinter); SendSelectionAsRefs(kMakeActivePrinter);

View File

@ -680,9 +680,11 @@ TTracker::OpenRef(const entry_ref *ref, const node_ref *nodeToClose,
if (!brokenLinkWithSpecificHandler) { if (!brokenLinkWithSpecificHandler) {
delete model; delete model;
(new BAlert("", "There was an error resolving the link.", BAlert *alert = new BAlert("",
"Cancel", 0, 0, "There was an error resolving the link.",
B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go(); "Cancel", 0, 0, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
alert->SetShortcut(0, B_ESCAPE);
alert->Go();
return result; return result;
} }
} else } else

View File

@ -1602,8 +1602,10 @@ GenericAttributeText::CommitEditedTextFlavor(BTextView *textView)
&& type != B_DOUBLE_TYPE && type != B_DOUBLE_TYPE
&& type != B_CHAR_TYPE && type != B_CHAR_TYPE
&& type != B_BOOL_TYPE) { && type != B_BOOL_TYPE) {
(new BAlert("", "Sorry, you cannot edit that attribute.", BAlert *alert = new BAlert("", "Sorry, you cannot edit that attribute.",
"Cancel", 0, 0, B_WIDTH_AS_USUAL, B_STOP_ALERT))->Go(); "Cancel", 0, 0, B_WIDTH_AS_USUAL, B_STOP_ALERT);
alert->SetShortcut(0, B_ESCAPE);
alert->Go();
return false; return false;
} }
@ -1634,8 +1636,11 @@ GenericAttributeText::CommitEditedTextFlavor(BTextView *textView)
sscanf(textView->Text(), "%c", &ch); sscanf(textView->Text(), "%c", &ch);
//Check if we read the start of a multi-byte glyph: //Check if we read the start of a multi-byte glyph:
if (!isprint(ch)) { if (!isprint(ch)) {
(new BAlert("", "Sorry, The 'Character' attribute cannot store a multi-byte glyph.", BAlert *alert = new BAlert("", "Sorry, The 'Character' "
"Cancel", 0, 0, B_WIDTH_AS_USUAL, B_STOP_ALERT))->Go(); "attribute cannot store a multi-byte glyph.",
"Cancel", 0, 0, B_WIDTH_AS_USUAL, B_STOP_ALERT);
alert->SetShortcut(0, B_ESCAPE);
alert->Go();
return false; return false;
} }
@ -1732,8 +1737,11 @@ GenericAttributeText::CommitEditedTextFlavor(BTextView *textView)
} }
if (size < 0) { if (size < 0) {
(new BAlert("", "There was an error writing the attribute.", BAlert *alert = new BAlert("",
"Cancel", 0, 0, B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go(); "There was an error writing the attribute.",
"Cancel", 0, 0, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
alert->SetShortcut(0, B_CANCEL);
alert->Go();
fValueIsDefined = false; fValueIsDefined = false;
return false; return false;