diff --git src/kits/tracker/FSUtils.cpp src/kits/tracker/FSUtils.cpp
index 1af1220..9058c7e 100644
|
|
bool DirectoryMatches(const BEntry *, const char *additionalPath,
|
135 | 135 | |
136 | 136 | status_t empty_trash(void *); |
137 | 137 | |
138 | | #ifdef __HAIKU__ |
139 | | #define OS_NAME "Haiku" |
140 | | #else |
141 | | #define OS_NAME "BeOS" |
142 | | #endif |
143 | | |
144 | 138 | |
145 | 139 | static const char* kDeleteConfirmationStr = |
146 | 140 | B_TRANSLATE_MARK("Are you sure you want to delete the " |
… |
… |
enum {
|
612 | 606 | |
613 | 607 | |
614 | 608 | bool |
615 | | ConfirmChangeIfWellKnownDirectory(const BEntry *entry, const char *ifYouDoAction, |
616 | | const char *toDoAction, bool dontAsk, int32 *confirmedAlready) |
| 609 | ConfirmChangeIfWellKnownDirectory(const BEntry *entry, |
| 610 | const char *ifYouDoAction, const char *toDoAction, |
| 611 | const char *toConfirmAction, bool dontAsk, int32 *confirmedAlready) |
617 | 612 | { |
618 | 613 | // Don't let the user casually move/change important files/folders |
619 | 614 | // |
… |
… |
ConfirmChangeIfWellKnownDirectory(const BEntry *entry, const char *ifYouDoAction
|
638 | 633 | if (DirectoryMatchesOrContains(entry, B_SYSTEM_DIRECTORY)) { |
639 | 634 | warning.SetTo( |
640 | 635 | B_TRANSLATE("If you %ifYouDoAction the system folder or its " |
641 | | "contents, you won't be able to boot " OS_NAME "! Are you sure you " |
642 | | "want to do this? To %toDoAction the system folder or its contents " |
643 | | "anyway, hold down the Shift key and click \"Do it\".")); |
| 636 | "contents, you won't be able to boot Haiku! Are you sure you " |
| 637 | "want to do this? To %toDoAction the system folder or its " |
| 638 | "contents anyway, hold down the Shift key and click " |
| 639 | "\"%toConfirmAction\".")); |
644 | 640 | } else if (DirectoryMatches(entry, B_COMMON_DIRECTORY)) { |
645 | 641 | warning.SetTo( |
646 | | B_TRANSLATE("If you %ifYouDoAction the common folder, " OS_NAME |
647 | | " may not behave properly! Are you sure you want to do this? " |
| 642 | B_TRANSLATE("If you %ifYouDoAction the common folder, Haiku " |
| 643 | "may not behave properly! Are you sure you want to do this? " |
648 | 644 | "To %toDoAction the common folder anyway, hold down the " |
649 | | "Shift key and click \"Do it\".")); |
| 645 | "Shift key and click \"%toConfirmAction\".")); |
650 | 646 | } else if (DirectoryMatches(entry, B_USER_DIRECTORY)) { |
651 | 647 | warning .SetTo( |
652 | | B_TRANSLATE("If you %ifYouDoAction the home folder, " OS_NAME |
653 | | " may not behave properly! Are you sure you want to do this? " |
| 648 | B_TRANSLATE("If you %ifYouDoAction the home folder, Haiku " |
| 649 | "may not behave properly! Are you sure you want to do this? " |
654 | 650 | "To %toDoAction the home folder anyway, hold down the " |
655 | | "Shift key and click \"Do it\".")); |
| 651 | "Shift key and click \"%toConfirmAction\".")); |
656 | 652 | } else if (DirectoryMatchesOrContains(entry, B_USER_CONFIG_DIRECTORY) |
657 | 653 | || DirectoryMatchesOrContains(entry, B_COMMON_SETTINGS_DIRECTORY)) { |
658 | 654 | |
… |
… |
ConfirmChangeIfWellKnownDirectory(const BEntry *entry, const char *ifYouDoAction
|
661 | 657 | || DirectoryMatchesOrContains(entry, "beos_mime", |
662 | 658 | B_COMMON_SETTINGS_DIRECTORY)) { |
663 | 659 | warning.SetTo( |
664 | | B_TRANSLATE("If you %ifYouDoAction the mime settings, " OS_NAME |
665 | | " may not behave properly! Are you sure you want to do this? " |
666 | | "To %toDoAction the mime settings anyway, click \"Do it\".")); |
| 660 | B_TRANSLATE("If you %ifYouDoAction the mime settings, Haiku " |
| 661 | "may not behave properly! Are you sure you want to do this? " |
| 662 | "To %toDoAction the mime settings anyway, click " |
| 663 | "\"%toConfirmAction\".")); |
667 | 664 | requireOverride = false; |
668 | 665 | } else if (DirectoryMatches(entry, B_USER_CONFIG_DIRECTORY)) { |
669 | 666 | warning.SetTo( |
670 | | B_TRANSLATE("If you %ifYouDoAction the config folder, " OS_NAME |
671 | | " may not behave properly! Are you sure you want to do this? " |
672 | | "To %toDoAction the config folder anyway, click \"Do it\".")); |
| 667 | B_TRANSLATE("If you %ifYouDoAction the config folder, Haiku " |
| 668 | "may not behave properly! Are you sure you want to do this? " |
| 669 | "To %toDoAction the config folder anyway, click " |
| 670 | "\"%toConfirmAction\".")); |
673 | 671 | requireOverride = false; |
674 | 672 | } else if (DirectoryMatches(entry, B_USER_SETTINGS_DIRECTORY) |
675 | 673 | || DirectoryMatches(entry, B_COMMON_SETTINGS_DIRECTORY)) { |
676 | 674 | warning.SetTo( |
677 | | B_TRANSLATE("If you %ifYouDoAction the settings folder, " OS_NAME |
678 | | " may not behave properly! Are you sure you want to do this? " |
679 | | "To %toDoAction the settings folder anyway, click \"Do it\".")); |
| 675 | B_TRANSLATE("If you %ifYouDoAction the settings folder, Haiku " |
| 676 | "may not behave properly! Are you sure you want to do this? " |
| 677 | "To %toDoAction the settings folder anyway, click " |
| 678 | "\"%toConfirmAction\".")); |
680 | 679 | requireOverride = false; |
681 | 680 | } |
682 | 681 | } |
… |
… |
ConfirmChangeIfWellKnownDirectory(const BEntry *entry, const char *ifYouDoAction
|
694 | 693 | |
695 | 694 | warning.ReplaceFirst("%ifYouDoAction", ifYouDoAction); |
696 | 695 | warning.ReplaceFirst("%toDoAction", toDoAction); |
| 696 | warning.ReplaceFirst("%toConfirmAction", toConfirmAction); |
| 697 | warning.ReplaceLast("%toConfirmAction", |
| 698 | BString(toConfirmAction).Capitalize().String()); |
| 699 | |
| 700 | BString buttonLabel(B_TRANSLATE_COMMENT("%toConfirmAction", |
| 701 | "Action label for the button, e.g. Rename")); |
| 702 | buttonLabel.ReplaceFirst("%toConfirmAction", |
| 703 | BString(toConfirmAction).Capitalize().String()); |
697 | 704 | |
698 | 705 | OverrideAlert *alert = new OverrideAlert("", warning.String(), |
699 | | B_TRANSLATE("Do it"), (requireOverride ? B_SHIFT_KEY : 0), |
| 706 | buttonLabel.String(), (requireOverride ? B_SHIFT_KEY : 0), |
700 | 707 | B_TRANSLATE("Cancel"), 0, NULL, 0, B_WIDTH_AS_USUAL, B_WARNING_ALERT); |
701 | 708 | alert->SetShortcut(1, B_ESCAPE); |
702 | 709 | if (alert->Go() == 1) { |
… |
… |
InitCopy(CopyLoopControl* loopControl, uint32 moveMode,
|
756 | 763 | } |
757 | 764 | if (moveMode == kMoveSelectionTo |
758 | 765 | && !ConfirmChangeIfWellKnownDirectory(&entry, |
759 | | B_TRANSLATE_COMMENT("move", "As in 'If you move ...'"), |
760 | | B_TRANSLATE_COMMENT("move", "As in 'To move ...'"), |
| 766 | B_TRANSLATE_COMMENT("move", |
| 767 | "As in 'if you move this folder...' (en) \ |
| 768 | 'Wenn Sie dieses Ordner verschieben...' (de)"), |
| 769 | B_TRANSLATE_COMMENT("move", |
| 770 | "As in 'to move this folder...' (en) \ |
| 771 | 'in diesen Ordner verschieben...' (de)"), |
| 772 | B_TRANSLATE_COMMENT("move", |
| 773 | "Button label, 'Move' (en) 'Verschieben' (de)"), |
761 | 774 | false, &askOnceOnly)) { |
762 | 775 | return B_ERROR; |
763 | 776 | } |
diff --git src/kits/tracker/FSUtils.h src/kits/tracker/FSUtils.h
index eb35902..d033e0b 100644
|
|
bool FSIsDeskDir(const BEntry *);
|
247 | 247 | // the second one in the "To do action" sentence. |
248 | 248 | bool ConfirmChangeIfWellKnownDirectory(const BEntry *entry, |
249 | 249 | const char *ifYouDoAction, const char *toDoAction, |
250 | | bool dontAsk = false, int32 *confirmedAlready = NULL); |
| 250 | const char *toConfirmAction, bool dontAsk = false, |
| 251 | int32 *confirmedAlready = NULL); |
251 | 252 | |
252 | 253 | bool CheckDevicesEqual(const entry_ref *entry, const Model *targetModel); |
253 | 254 | |
diff --git src/kits/tracker/InfoWindow.cpp src/kits/tracker/InfoWindow.cpp
index ade064c..063a00e 100644
|
|
BInfoWindow::MessageReceived(BMessage *message)
|
433 | 433 | BEntry entry(fModel->EntryRef()); |
434 | 434 | if (!fModel->HasLocalizedName() |
435 | 435 | && ConfirmChangeIfWellKnownDirectory(&entry, |
436 | | B_TRANSLATE_COMMENT("rename", "As in 'If you rename ...'"), |
437 | | B_TRANSLATE_COMMENT("rename", "As in 'To rename ...'"))) |
| 436 | B_TRANSLATE_COMMENT("rename", |
| 437 | "As in 'if you rename this folder...' (en) \ |
| 438 | 'Wenn Sie dieses Ordner umbenannt...' (de)"), |
| 439 | B_TRANSLATE_COMMENT("rename", |
| 440 | "As in 'to rename this folder...' (en) \ |
| 441 | 'in diesen Ordner umzubenennen...' (de)"), |
| 442 | B_TRANSLATE_COMMENT("rename", |
| 443 | "Button label, 'Rename' (en) 'Umbenennen' (de)"))); |
438 | 444 | fAttributeView->BeginEditingTitle(); |
439 | 445 | break; |
440 | 446 | } |
… |
… |
AttributeView::MouseDown(BPoint point)
|
1223 | 1229 | } else if (fTitleRect.Contains(point)) { |
1224 | 1230 | if (!fModel->HasLocalizedName() |
1225 | 1231 | && ConfirmChangeIfWellKnownDirectory(&entry, |
1226 | | B_TRANSLATE_COMMENT("rename", "As in 'If you rename ...'"), |
1227 | | B_TRANSLATE_COMMENT("rename", "As in 'To rename ...'"), true) |
1228 | | && fTitleEditView == 0) |
| 1232 | B_TRANSLATE_COMMENT("rename", |
| 1233 | "As in 'if you rename this folder...' (en) \ |
| 1234 | 'Wenn Sie dieses Ordner umbenannt...' (de)"), |
| 1235 | B_TRANSLATE_COMMENT("rename", |
| 1236 | "As in 'to rename this folder...' (en) \ |
| 1237 | 'in diesen Ordner umzubenennen...' (de)"), |
| 1238 | B_TRANSLATE_COMMENT("rename", |
| 1239 | "Button label, 'Rename' (en) 'Umbenennen' (de)"), true) |
| 1240 | && fTitleEditView == 0); |
1229 | 1241 | BeginEditingTitle(); |
1230 | 1242 | } else if (fTitleEditView) { |
1231 | 1243 | FinishEditingTitle(true); |
diff --git src/kits/tracker/TextWidget.cpp src/kits/tracker/TextWidget.cpp
index 8a47fcf..6a9309a 100644
|
|
BTextWidget::StartEdit(BRect bounds, BPoseView *view, BPose *pose)
|
324 | 324 | BEntry entry(pose->TargetModel()->EntryRef()); |
325 | 325 | if (entry.InitCheck() == B_OK |
326 | 326 | && !ConfirmChangeIfWellKnownDirectory(&entry, |
327 | | B_TRANSLATE_COMMENT("rename", "As in 'If you rename ...'"), |
328 | | B_TRANSLATE_COMMENT("rename", "As in 'To rename ...'"))) |
| 327 | B_TRANSLATE_COMMENT("rename", |
| 328 | "As in 'if you rename this folder...' (en) \ |
| 329 | 'Wenn Sie dieses Ordner umbenannt...' (de)"), |
| 330 | B_TRANSLATE_COMMENT("rename", |
| 331 | "As in 'to rename this folder...' (en) \ |
| 332 | 'in diesen Ordner umzubenennen...' (de)"), |
| 333 | B_TRANSLATE_COMMENT("rename", |
| 334 | "Button label, 'Rename' (en) 'Umbenennen' (de)"))) |
329 | 335 | return; |
330 | 336 | |
331 | 337 | // get bounds with full text length |