diff --git src/kits/tracker/FSUtils.cpp src/kits/tracker/FSUtils.cpp
index 1af1220..916dc65 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 *toConfirmAction, |
| 611 | 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 %ifYouDoAction 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? " |
648 | | "To %toDoAction the common folder anyway, hold down the " |
649 | | "Shift key and click \"Do it\".")); |
| 642 | B_TRANSLATE("If you %ifYouDoAction the common folder, Haiku " |
| 643 | "may not behave properly! Are you sure you want to do this? " |
| 644 | "To %ifYouDoAction the common folder anyway, hold down the " |
| 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? " |
654 | | "To %toDoAction the home folder anyway, hold down the " |
655 | | "Shift key and click \"Do it\".")); |
| 648 | B_TRANSLATE("If you %ifYouDoAction the home folder, Haiku " |
| 649 | "may not behave properly! Are you sure you want to do this? " |
| 650 | "To %ifYouDoAction the home folder anyway, hold down the " |
| 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 %ifYouDoAction 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 %ifYouDoAction 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 %ifYouDoAction the settings folder anyway, click " |
| 678 | "\"%toConfirmAction\".")); |
680 | 679 | requireOverride = false; |
681 | 680 | } |
682 | 681 | } |
… |
… |
ConfirmChangeIfWellKnownDirectory(const BEntry *entry, const char *ifYouDoAction
|
693 | 692 | return true; |
694 | 693 | |
695 | 694 | warning.ReplaceFirst("%ifYouDoAction", ifYouDoAction); |
696 | | warning.ReplaceFirst("%toDoAction", toDoAction); |
| 695 | warning.ReplaceFirst("%toConfirmAction", toConfirmAction); |
| 696 | warning.ReplaceLast("%toConfirmAction", |
| 697 | BString(toConfirmAction).Capitalize().String()); |
| 698 | |
| 699 | BString buttonLabel(B_TRANSLATE_COMMENT("%toConfirmAction", |
| 700 | "Action label for the button, e.g. Rename")); |
| 701 | buttonLabel.ReplaceFirst("%toConfirmAction", |
| 702 | BString(toConfirmAction).Capitalize().String()); |
697 | 703 | |
698 | 704 | OverrideAlert *alert = new OverrideAlert("", warning.String(), |
699 | | B_TRANSLATE("Do it"), (requireOverride ? B_SHIFT_KEY : 0), |
| 705 | buttonLabel.String(), (requireOverride ? B_SHIFT_KEY : 0), |
700 | 706 | B_TRANSLATE("Cancel"), 0, NULL, 0, B_WIDTH_AS_USUAL, B_WARNING_ALERT); |
701 | 707 | alert->SetShortcut(1, B_ESCAPE); |
702 | 708 | if (alert->Go() == 1) { |