Ticket #5889: PoseView.patch
File PoseView.patch, 8.2 KB (added by , 14 years ago) |
---|
-
PoseView.cpp
43 43 44 44 #include <Alert.h> 45 45 #include <Application.h> 46 #include <Catalog.h> 46 47 #include <Clipboard.h> 47 48 #include <Debug.h> 48 49 #include <Dragger.h> … … 51 52 #include <Screen.h> 52 53 #include <Query.h> 53 54 #include <List.h> 55 #include <Locale.h> 54 56 #include <MenuItem.h> 55 57 #include <NodeMonitor.h> 56 58 #include <Path.h> … … 93 95 #include "WidthBuffer.h" 94 96 95 97 98 #undef B_TRANSLATE_CONTEXT 99 #define B_TRANSLATE_CONTEXT "libTracker" 100 96 101 using std::min; 97 102 using std::max; 98 103 … … 135 140 // maximum size of the transparent drag bitmap, use a drag rect 136 141 // if larger in any direction 137 142 138 const char *kNoCopyToTrashStr = "Sorry, you can't copy items to the Trash.";139 const char *kNoLinkToTrashStr = "Sorry, you can't create links in the Trash.";140 const char *kNoCopyToRootStr = "You must drop items on one of the disk icons "141 "in the \"Disks\" window.";142 const char *kOkToMoveStr = "Are you sure you want to move or copy the selected "143 "item(s) to this folder?";144 143 145 144 struct AddPosesResult { 146 145 ~AddPosesResult(); … … 574 573 if (fColumnList->CountItems() != 0) 575 574 return; 576 575 577 fColumnList->AddItem(new BColumn( "Name", kColumnStart, 145, B_ALIGN_LEFT,576 fColumnList->AddItem(new BColumn(B_TRANSLATE("Name"), kColumnStart, 145, B_ALIGN_LEFT, 578 577 kAttrStatName, B_STRING_TYPE, true, true)); 579 fColumnList->AddItem(new BColumn( "Size", 200, 80, B_ALIGN_RIGHT,578 fColumnList->AddItem(new BColumn(B_TRANSLATE("Size"), 200, 80, B_ALIGN_RIGHT, 580 579 kAttrStatSize, B_OFF_T_TYPE, true, false)); 581 fColumnList->AddItem(new BColumn( "Modified", 295, 150, B_ALIGN_LEFT,580 fColumnList->AddItem(new BColumn(B_TRANSLATE("Modified"), 295, 150, B_ALIGN_LEFT, 582 581 kAttrStatModified, B_TIME_TYPE, true, false)); 583 582 584 583 if (!IsWatchingDateFormatChange()) … … 2510 2509 if (CountColumns() == 1) { 2511 2510 if (runAlert) { 2512 2511 BAlert *alert = new BAlert("", 2513 "You must have at least one attribute showing.", 2514 "Cancel", 0, 0, B_WIDTH_AS_USUAL, B_WARNING_ALERT); 2512 B_TRANSLATE("You must have at least one attribute showing."), 2513 B_TRANSLATE("Cancel"), 2514 0, 0, B_WIDTH_AS_USUAL, B_WARNING_ALERT); 2515 2515 alert->SetShortcut(0, B_ESCAPE); 2516 2516 alert->Go(); 2517 2517 } … … 4083 4083 } else if (types) 4084 4084 description = embedTypeAs; 4085 4085 4086 const char *labelText; 4087 char text[1024]; 4086 BString labelText; 4088 4087 if (actionText) { 4089 4088 int32 length = 1024 - 1 - (int32)strlen(actionText); 4090 4089 if (length > 0) { 4091 4090 description.Truncate(length); 4092 sprintf(text, actionText, description.String());4093 labelText = text;4091 labelText.SetTo(actionText); 4092 labelText.ReplaceFirst("%s", description.String()); 4094 4093 } else 4095 labelText = "label too long";4094 labelText.SetTo(B_TRANSLATE("label too long")); 4096 4095 } else 4097 labelText = description .String();4096 labelText = description; 4098 4097 4099 menu->AddItem(new BMenuItem(labelText , 0));4098 menu->AddItem(new BMenuItem(labelText.String(), 0)); 4100 4099 } 4101 4100 4102 4101 menu->AddSeparatorItem(); 4103 menu->AddItem(new BMenuItem( "Cancel", 0));4102 menu->AddItem(new BMenuItem(B_TRANSLATE("Cancel"), 0)); 4104 4103 4105 4104 int32 result = -1; 4106 4105 BMenuItem *resultingItem = menu->Go(where, false, true); … … 4254 4253 if (specificActionIndex == -1) 4255 4254 return false; 4256 4255 } else if (types.CountItems() > 0) { 4257 specificTypeIndex = RunMimeTypeDestinationMenu("Create %s clipping", 4256 specificTypeIndex = RunMimeTypeDestinationMenu( 4257 B_TRANSLATE("Create %s clipping"), 4258 4258 &types, &typeNames, view->ConvertToScreen(dropPt)); 4259 4259 4260 4260 if (specificTypeIndex == -1) … … 4720 4720 bool okToMove = true; 4721 4721 4722 4722 if (destFolder->IsRoot()) { 4723 BAlert *alert = new BAlert("", kNoCopyToRootStr, "Cancel", 4723 BAlert *alert = new BAlert("", 4724 B_TRANSLATE("You must drop items on one of the disk icons " 4725 "in the \"Disks\" window."), 4726 B_TRANSLATE("Cancel"), 4724 4727 NULL, NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT); 4725 4728 alert->SetShortcut(0, B_ESCAPE); 4726 4729 alert->Go(); … … 4729 4732 4730 4733 // can't copy items into the trash 4731 4734 if (forceCopy && destIsTrash) { 4732 BAlert *alert = new BAlert("", kNoCopyToTrashStr, "Cancel", 4735 BAlert *alert = new BAlert("", 4736 B_TRANSLATE("Sorry, you can't copy items to the Trash."), 4737 B_TRANSLATE("Cancel"), 4733 4738 NULL, NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT); 4734 4739 alert->SetShortcut(0, B_ESCAPE); 4735 4740 alert->Go(); … … 4738 4743 4739 4744 // can't create symlinks into the trash 4740 4745 if (createLink && destIsTrash) { 4741 BAlert *alert = new BAlert("", kNoLinkToTrashStr, "Cancel", 4746 BAlert *alert = new BAlert("", 4747 B_TRANSLATE("Sorry, you can't create links in the Trash."), 4748 B_TRANSLATE("Cancel"), 4742 4749 NULL, NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT); 4743 4750 alert->SetShortcut(0, B_ESCAPE); 4744 4751 alert->Go(); … … 4749 4756 if (srcWindow->TargetModel()->IsQuery() 4750 4757 && !forceCopy && !destIsTrash && !createLink) { 4751 4758 srcWindow->UpdateIfNeeded(); 4752 BAlert *alert = new BAlert("", kOkToMoveStr, "Cancel", 4753 "Move", NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT); 4759 BAlert *alert = new BAlert("", 4760 B_TRANSLATE("Are you sure you want to move or copy the selected " 4761 "item(s) to this folder?"), 4762 B_TRANSLATE("Cancel"), 4763 B_TRANSLATE("Move"), 4764 NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT); 4754 4765 alert->SetShortcut(0, B_ESCAPE); 4755 4766 okToMove = alert->Go() == 1; 4756 4767 } … … 5610 5621 { 5611 5622 BVolume volume (ref->device); 5612 5623 if (volume.IsReadOnly()) { 5613 BAlert *alert = new BAlert ("", "Files cannot be moved or " 5614 "deleted from a read-only volume.", "Cancel", NULL, 5615 NULL, B_WIDTH_AS_USUAL, B_STOP_ALERT); 5624 BAlert *alert = new BAlert ("", 5625 B_TRANSLATE("Files cannot be moved or " 5626 "deleted from a read-only volume."), 5627 B_TRANSLATE("Cancel"), 5628 NULL, NULL, B_WIDTH_AS_USUAL, B_STOP_ALERT); 5616 5629 alert->SetShortcut(0, B_ESCAPE); 5617 5630 alert->Go(); 5618 5631 return false; … … 5650 5663 } 5651 5664 5652 5665 if (entriesToDeleteOnTheSpot->CountItems()) { 5653 const char *alertText;5666 BString alertText; 5654 5667 if (ref) { 5655 alertText ="The selected item cannot be moved to the Trash. "5668 alertText.SetTo(B_TRANSLATE("The selected item cannot be moved to the Trash. " 5656 5669 "Would you like to delete it instead? (This operation cannot " 5657 "be reverted.)" ;5670 "be reverted.)")); 5658 5671 } else { 5659 alertText ="Some of the selected items cannot be moved to the Trash. "5672 alertText.SetTo(B_TRANSLATE("Some of the selected items cannot be moved to the Trash. " 5660 5673 "Would you like to delete them instead? (This operation cannot " 5661 "be reverted.)" ;5674 "be reverted.)")); 5662 5675 } 5663 5676 5664 BAlert *alert = new BAlert("", alertText, "Cancel", "Delete"); 5677 BAlert *alert = new BAlert("", alertText.String(), 5678 B_TRANSLATE("Cancel"), 5679 B_TRANSLATE("Delete")); 5665 5680 alert->SetShortcut(0, B_ESCAPE); 5666 5681 if (alert->Go() == 0) 5667 5682 return; … … 5950 5965 5951 5966 if (regExpression.InitCheck() != B_OK) { 5952 5967 BString message; 5953 message << "Error in regular expression:\n\n'";5968 message << B_TRANSLATE("Error in regular expression:\n\n'"); 5954 5969 message << regExpression.ErrorString() << "'"; 5955 (new BAlert("", message.String(), "OK", NULL, NULL, B_WIDTH_AS_USUAL,5970 (new BAlert("", message.String(), B_TRANSLATE("OK"), NULL, NULL, B_WIDTH_AS_USUAL, 5956 5971 B_STOP_ALERT))->Go(); 5957 5972 return 0; 5958 5973 } … … 7869 7884 { 7870 7885 BMessenger tracker(kTrackerSignature); 7871 7886 if (!tracker.IsValid()) { 7872 BAlert *alert = new BAlert("", "The Tracker must be running " 7873 "to see Info windows.", "Cancel", NULL, NULL, 7874 B_WIDTH_AS_USUAL, B_WARNING_ALERT); 7887 BAlert *alert = new BAlert("", 7888 B_TRANSLATE("The Tracker must be running to see Info windows."), 7889 B_TRANSLATE("Cancel"), 7890 NULL, NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT); 7875 7891 alert->SetShortcut(0, B_ESCAPE); 7876 7892 alert->Go(); 7877 7893 return; … … 7885 7901 { 7886 7902 BMessenger tracker(kTrackerSignature); 7887 7903 if (!tracker.IsValid()) { 7888 BAlert *alert = new BAlert("", "The Tracker must be running " 7889 "to see set the default printer.", "Cancel", NULL, 7890 NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT); 7904 BAlert *alert = new BAlert("", 7905 B_TRANSLATE("The Tracker must be running to see set the default printer."), 7906 B_TRANSLATE("Cancel"), 7907 NULL, NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT); 7891 7908 alert->SetShortcut(0, B_ESCAPE); 7892 7909 alert->Go(); 7893 7910 return;