* Applied libtracker localization patch from T.Murai (a.k.a mt) with some modifications (see below).
* Functional modifications:
Reworked InfoWindow file size localization, the patch removed number formating (size in bytes) and was too complicated to my taste.
Replaced the uses of sprintf with the safer snprintf.
Changed signature to x-vnd.Haiku-libtracker instead of x-vnd.Haiku-libTracker (to be consistent with the binary name)
* Style modifications:
Reworked lots of 80 char indenting (probably due to the now shorter line lengths since your previous patch that wasn't using the macros)
Lots of missing brackets when "if's" becomes multiline.
Other minor fixes.
Noticed a few uses of FindItem on translated names that might become problematic someday. Added some TODO's regarding localization of file sizes. Localization might still be
optimized a bit regarding the produced en.catkeys
Note to translators: .catkeys files should be placed in haikusource/data/catalogs/kits/tracker though beware as the base en.catkeys might change
slightly in the next days.
Note to users: As with any other app you need to restart Tracker (or any aother app using libtracker's filepanels) for it to pick the locale setting. E.g: use 'quit an
application' and 'restart Tracker' from process controller.
Thanks a lot T.Murai
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37492 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -37,10 +37,12 @@ All rights reserved.
|
|||||||
#include <Alert.h>
|
#include <Alert.h>
|
||||||
#include <Box.h>
|
#include <Box.h>
|
||||||
#include <Button.h>
|
#include <Button.h>
|
||||||
|
#include <Catalog.h>
|
||||||
#include <CheckBox.h>
|
#include <CheckBox.h>
|
||||||
#include <Debug.h>
|
#include <Debug.h>
|
||||||
#include <GridLayoutBuilder.h>
|
#include <GridLayoutBuilder.h>
|
||||||
#include <GroupLayoutBuilder.h>
|
#include <GroupLayoutBuilder.h>
|
||||||
|
#include <Locale.h>
|
||||||
#include <SpaceLayoutItem.h>
|
#include <SpaceLayoutItem.h>
|
||||||
#include <SeparatorView.h>
|
#include <SeparatorView.h>
|
||||||
#include <Message.h>
|
#include <Message.h>
|
||||||
@@ -54,6 +56,8 @@ const uint32 kAutomountSettingsChanged = 'achg';
|
|||||||
const uint32 kBootMountSettingsChanged = 'bchg';
|
const uint32 kBootMountSettingsChanged = 'bchg';
|
||||||
const uint32 kEjectWhenUnmountingChanged = 'ejct';
|
const uint32 kEjectWhenUnmountingChanged = 'ejct';
|
||||||
|
|
||||||
|
#undef B_TRANSLATE_CONTEXT
|
||||||
|
#define B_TRANSLATE_CONTEXT "libtracker"
|
||||||
|
|
||||||
class AutomountSettingsPanel : public BBox {
|
class AutomountSettingsPanel : public BBox {
|
||||||
public:
|
public:
|
||||||
@@ -103,51 +107,56 @@ AutomountSettingsPanel::AutomountSettingsPanel(BMessage* settings,
|
|||||||
|
|
||||||
BBox* autoMountBox = new BBox("autoMountBox", B_WILL_DRAW | B_FRAME_EVENTS
|
BBox* autoMountBox = new BBox("autoMountBox", B_WILL_DRAW | B_FRAME_EVENTS
|
||||||
| B_PULSE_NEEDED | B_NAVIGABLE_JUMP);
|
| B_PULSE_NEEDED | B_NAVIGABLE_JUMP);
|
||||||
autoMountBox->SetLabel("Automatic disk mounting");
|
autoMountBox->SetLabel(B_TRANSLATE("Automatic disk mounting"));
|
||||||
BGroupLayout* autoMountLayout = new BGroupLayout(B_VERTICAL, spacing);
|
BGroupLayout* autoMountLayout = new BGroupLayout(B_VERTICAL, spacing);
|
||||||
autoMountBox->SetLayout(autoMountLayout);
|
autoMountBox->SetLayout(autoMountLayout);
|
||||||
autoMountLayout->SetInsets(spacing,
|
autoMountLayout->SetInsets(spacing,
|
||||||
autoMountBox->InnerFrame().top + spacing, spacing, spacing);
|
autoMountBox->InnerFrame().top + spacing, spacing, spacing);
|
||||||
|
|
||||||
fScanningDisabledCheck = new BRadioButton("scanningOff", "Don't automount",
|
fScanningDisabledCheck = new BRadioButton("scanningOff",
|
||||||
|
B_TRANSLATE("Don't automount"),
|
||||||
new BMessage(kAutomountSettingsChanged));
|
new BMessage(kAutomountSettingsChanged));
|
||||||
|
|
||||||
fAutoMountAllBFSCheck = new BRadioButton("autoBFS", "All BeOS disks",
|
fAutoMountAllBFSCheck = new BRadioButton("autoBFS",
|
||||||
new BMessage(kAutomountSettingsChanged));
|
B_TRANSLATE("All BeOS disks"), new BMessage(kAutomountSettingsChanged));
|
||||||
|
|
||||||
fAutoMountAllCheck = new BRadioButton("autoAll", "All disks",
|
fAutoMountAllCheck = new BRadioButton("autoAll",
|
||||||
new BMessage(kAutomountSettingsChanged));
|
B_TRANSLATE("All disks"), new BMessage(kAutomountSettingsChanged));
|
||||||
|
|
||||||
// "Disk Mounting During Boot" group
|
// "Disk Mounting During Boot" group
|
||||||
|
|
||||||
BBox* bootMountBox = new BBox("", B_WILL_DRAW | B_FRAME_EVENTS
|
BBox* bootMountBox = new BBox("", B_WILL_DRAW | B_FRAME_EVENTS
|
||||||
| B_PULSE_NEEDED | B_NAVIGABLE_JUMP);
|
| B_PULSE_NEEDED | B_NAVIGABLE_JUMP);
|
||||||
bootMountBox->SetLabel("Disk mounting during boot");
|
bootMountBox->SetLabel(B_TRANSLATE("Disk mounting during boot"));
|
||||||
BGroupLayout* bootMountLayout = new BGroupLayout(B_VERTICAL, spacing);
|
BGroupLayout* bootMountLayout = new BGroupLayout(B_VERTICAL, spacing);
|
||||||
bootMountBox->SetLayout(bootMountLayout);
|
bootMountBox->SetLayout(bootMountLayout);
|
||||||
bootMountLayout->SetInsets(spacing,
|
bootMountLayout->SetInsets(spacing,
|
||||||
bootMountBox->InnerFrame().top + spacing, spacing, spacing);
|
bootMountBox->InnerFrame().top + spacing, spacing, spacing);
|
||||||
|
|
||||||
fInitialDontMountCheck = new BRadioButton("initialNone",
|
fInitialDontMountCheck = new BRadioButton("initialNone",
|
||||||
"Only the boot disk", new BMessage(kBootMountSettingsChanged));
|
B_TRANSLATE("Only the boot disk"),
|
||||||
|
new BMessage(kBootMountSettingsChanged));
|
||||||
|
|
||||||
fInitialMountRestoreCheck = new BRadioButton("initialRestore",
|
fInitialMountRestoreCheck = new BRadioButton("initialRestore",
|
||||||
"Previously mounted disks", new BMessage(kBootMountSettingsChanged));
|
B_TRANSLATE("Previously mounted disks"),
|
||||||
|
new BMessage(kBootMountSettingsChanged));
|
||||||
|
|
||||||
fInitialMountAllBFSCheck = new BRadioButton("initialBFS",
|
fInitialMountAllBFSCheck = new BRadioButton("initialBFS",
|
||||||
"All BeOS disks", new BMessage(kBootMountSettingsChanged));
|
B_TRANSLATE("All BeOS disks"),
|
||||||
|
new BMessage(kBootMountSettingsChanged));
|
||||||
|
|
||||||
fInitialMountAllCheck = new BRadioButton("initialAll",
|
fInitialMountAllCheck = new BRadioButton("initialAll",
|
||||||
"All disks", new BMessage(kBootMountSettingsChanged));
|
B_TRANSLATE("All disks"), new BMessage(kBootMountSettingsChanged));
|
||||||
|
|
||||||
fEjectWhenUnmountingCheckBox = new BCheckBox("ejectWhenUnmounting",
|
fEjectWhenUnmountingCheckBox = new BCheckBox("ejectWhenUnmounting",
|
||||||
"Eject when unmounting", new BMessage(kEjectWhenUnmountingChanged));
|
B_TRANSLATE("Eject when unmounting"),
|
||||||
|
new BMessage(kEjectWhenUnmountingChanged));
|
||||||
|
|
||||||
// Buttons
|
// Buttons
|
||||||
|
|
||||||
fDone = new BButton("Done", new BMessage(B_QUIT_REQUESTED));
|
fDone = new BButton(B_TRANSLATE("Done"), new BMessage(B_QUIT_REQUESTED));
|
||||||
|
|
||||||
fMountAllNow = new BButton("mountAll", "Mount all disks now",
|
fMountAllNow = new BButton("mountAll", B_TRANSLATE("Mount all disks now"),
|
||||||
new BMessage(kMountAllNow));
|
new BMessage(kMountAllNow));
|
||||||
|
|
||||||
fDone->MakeDefault(true);
|
fDone->MakeDefault(true);
|
||||||
@@ -292,7 +301,7 @@ AutomountSettingsPanel::_SendSettings(bool rescan)
|
|||||||
AutomountSettingsDialog::AutomountSettingsDialog(BMessage* settings,
|
AutomountSettingsDialog::AutomountSettingsDialog(BMessage* settings,
|
||||||
const BMessenger& target)
|
const BMessenger& target)
|
||||||
:
|
:
|
||||||
BWindow(BRect(100, 100, 320, 370), "Disk mount settings",
|
BWindow(BRect(100, 100, 320, 370), B_TRANSLATE("Disk mount settings"),
|
||||||
B_TITLED_WINDOW, B_NOT_RESIZABLE | B_NOT_ZOOMABLE
|
B_TITLED_WINDOW, B_NOT_RESIZABLE | B_NOT_ZOOMABLE
|
||||||
| B_AUTO_UPDATE_SIZE_LIMITS)
|
| B_AUTO_UPDATE_SIZE_LIMITS)
|
||||||
{
|
{
|
||||||
@@ -325,9 +334,10 @@ AutomountSettingsDialog::RunAutomountSettings(const BMessenger& target)
|
|||||||
BMessage reply;
|
BMessage reply;
|
||||||
status_t ret = target.SendMessage(&message, &reply, 2500000);
|
status_t ret = target.SendMessage(&message, &reply, 2500000);
|
||||||
if (ret != B_OK) {
|
if (ret != B_OK) {
|
||||||
(new BAlert("Mount server error", "The mount server could not be "
|
(new BAlert(B_TRANSLATE("Mount server error"),
|
||||||
"contacted.", "OK", NULL, NULL, B_WIDTH_AS_USUAL,
|
B_TRANSLATE("The mount server could not be contacted."),
|
||||||
B_STOP_ALERT))->Go();
|
B_TRANSLATE("OK"),
|
||||||
|
NULL, NULL, B_WIDTH_AS_USUAL, B_STOP_ALERT))->Go();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -39,12 +39,14 @@ All rights reserved.
|
|||||||
#include <Alert.h>
|
#include <Alert.h>
|
||||||
#include <Application.h>
|
#include <Application.h>
|
||||||
#include <AppFileInfo.h>
|
#include <AppFileInfo.h>
|
||||||
|
#include <Catalog.h>
|
||||||
#include <ControlLook.h>
|
#include <ControlLook.h>
|
||||||
#include <Debug.h>
|
#include <Debug.h>
|
||||||
#include <Directory.h>
|
#include <Directory.h>
|
||||||
#include <Entry.h>
|
#include <Entry.h>
|
||||||
#include <FindDirectory.h>
|
#include <FindDirectory.h>
|
||||||
#include <InterfaceDefs.h>
|
#include <InterfaceDefs.h>
|
||||||
|
#include <Locale.h>
|
||||||
#include <MenuItem.h>
|
#include <MenuItem.h>
|
||||||
#include <MenuBar.h>
|
#include <MenuBar.h>
|
||||||
#include <NodeMonitor.h>
|
#include <NodeMonitor.h>
|
||||||
@@ -89,6 +91,9 @@ All rights reserved.
|
|||||||
#include "TemplatesMenu.h"
|
#include "TemplatesMenu.h"
|
||||||
|
|
||||||
|
|
||||||
|
#undef B_TRANSLATE_CONTEXT
|
||||||
|
#define B_TRANSLATE_CONTEXT "libtracker"
|
||||||
|
|
||||||
const uint32 kRedo = 'REDO';
|
const uint32 kRedo = 'REDO';
|
||||||
// this is the same as B_REDO in Dano/Zeta/Haiku
|
// this is the same as B_REDO in Dano/Zeta/Haiku
|
||||||
|
|
||||||
@@ -103,8 +108,6 @@ const float kDragSlop = 3.0f;
|
|||||||
|
|
||||||
namespace BPrivate {
|
namespace BPrivate {
|
||||||
|
|
||||||
const char *kAddOnsMenuName = "Add-ons";
|
|
||||||
|
|
||||||
class DraggableContainerIcon : public BView {
|
class DraggableContainerIcon : public BView {
|
||||||
public:
|
public:
|
||||||
DraggableContainerIcon(BRect rect, const char *name, uint32 resizeMask);
|
DraggableContainerIcon(BRect rect, const char *name, uint32 resizeMask);
|
||||||
@@ -261,10 +264,11 @@ AddOnThread(BMessage *refsMessage, entry_ref addonRef, entry_ref dirRef)
|
|||||||
result = addonImage;
|
result = addonImage;
|
||||||
}
|
}
|
||||||
|
|
||||||
char buffer[1024];
|
BString buffer(B_TRANSLATE("Error %error loading Add-On %name."));
|
||||||
sprintf(buffer, "Error %s loading Add-On %s.", strerror(result), addonRef.name);
|
buffer.ReplaceFirst("%error", strerror(result));
|
||||||
|
buffer.ReplaceFirst("%name", addonRef.name);
|
||||||
|
|
||||||
BAlert *alert = new BAlert("", buffer, "Cancel", 0, 0,
|
BAlert* alert = new BAlert("", buffer.String(), B_TRANSLATE("Cancel"), 0, 0,
|
||||||
B_WIDTH_AS_USUAL, B_WARNING_ALERT);
|
B_WIDTH_AS_USUAL, B_WARNING_ALERT);
|
||||||
alert->SetShortcut(0, B_ESCAPE);
|
alert->SetShortcut(0, B_ESCAPE);
|
||||||
alert->Go();
|
alert->Go();
|
||||||
@@ -853,20 +857,20 @@ BContainerWindow::RepopulateMenus()
|
|||||||
|
|
||||||
fMenuBar->RemoveItem(fFileMenu);
|
fMenuBar->RemoveItem(fFileMenu);
|
||||||
delete fFileMenu;
|
delete fFileMenu;
|
||||||
fFileMenu = new BMenu("File");
|
fFileMenu = new BMenu(B_TRANSLATE("File"));
|
||||||
AddFileMenu(fFileMenu);
|
AddFileMenu(fFileMenu);
|
||||||
fMenuBar->AddItem(fFileMenu);
|
fMenuBar->AddItem(fFileMenu);
|
||||||
|
|
||||||
fMenuBar->RemoveItem(fWindowMenu);
|
fMenuBar->RemoveItem(fWindowMenu);
|
||||||
delete fWindowMenu;
|
delete fWindowMenu;
|
||||||
fWindowMenu = new BMenu("Window");
|
fWindowMenu = new BMenu(B_TRANSLATE("Window"));
|
||||||
fMenuBar->AddItem(fWindowMenu);
|
fMenuBar->AddItem(fWindowMenu);
|
||||||
AddWindowMenu(fWindowMenu);
|
AddWindowMenu(fWindowMenu);
|
||||||
|
|
||||||
// just create the attribute, decide to add it later
|
// just create the attribute, decide to add it later
|
||||||
fMenuBar->RemoveItem(fAttrMenu);
|
fMenuBar->RemoveItem(fAttrMenu);
|
||||||
delete fAttrMenu;
|
delete fAttrMenu;
|
||||||
fAttrMenu = new BMenu("Attributes");
|
fAttrMenu = new BMenu(B_TRANSLATE("Attributes"));
|
||||||
NewAttributeMenu(fAttrMenu);
|
NewAttributeMenu(fAttrMenu);
|
||||||
if (PoseView()->ViewMode() == kListMode)
|
if (PoseView()->ViewMode() == kListMode)
|
||||||
ShowAttributeMenu();
|
ShowAttributeMenu();
|
||||||
@@ -897,10 +901,12 @@ BContainerWindow::Init(const BMessage *message)
|
|||||||
if (ShouldAddScrollBars())
|
if (ShouldAddScrollBars())
|
||||||
fPoseView->AddScrollBars();
|
fPoseView->AddScrollBars();
|
||||||
|
|
||||||
fMoveToItem = new BMenuItem(new BNavMenu("Move to", kMoveSelectionTo, this));
|
fMoveToItem = new BMenuItem(new BNavMenu(B_TRANSLATE("Move to"),
|
||||||
fCopyToItem = new BMenuItem(new BNavMenu("Copy to", kCopySelectionTo, this));
|
kMoveSelectionTo, this));
|
||||||
fCreateLinkItem = new BMenuItem(new BNavMenu("Create link", kCreateLink, this),
|
fCopyToItem = new BMenuItem(new BNavMenu(B_TRANSLATE("Copy to"),
|
||||||
new BMessage(kCreateLink));
|
kCopySelectionTo, this));
|
||||||
|
fCreateLinkItem = new BMenuItem(new BNavMenu(B_TRANSLATE("Create link"),
|
||||||
|
kCreateLink, this), new BMessage(kCreateLink));
|
||||||
|
|
||||||
TrackerSettings settings;
|
TrackerSettings settings;
|
||||||
|
|
||||||
@@ -1634,14 +1640,19 @@ BContainerWindow::MessageReceived(BMessage *message)
|
|||||||
bool dontMoveToTrash = settings.DontMoveFilesToTrash();
|
bool dontMoveToTrash = settings.DontMoveFilesToTrash();
|
||||||
|
|
||||||
BMenuItem *item = fFileContextMenu->FindItem(kMoveToTrash);
|
BMenuItem *item = fFileContextMenu->FindItem(kMoveToTrash);
|
||||||
if (item)
|
if (item) {
|
||||||
item->SetLabel(dontMoveToTrash ? "Delete" : "Move to Trash");
|
item->SetLabel(dontMoveToTrash
|
||||||
|
? B_TRANSLATE("Delete")
|
||||||
|
: B_TRANSLATE("Move to Trash"));
|
||||||
|
}
|
||||||
// Deskbar doesn't have a menu bar, so check if there is fMenuBar
|
// Deskbar doesn't have a menu bar, so check if there is fMenuBar
|
||||||
if (fMenuBar && fFileMenu) {
|
if (fMenuBar && fFileMenu) {
|
||||||
item = fFileMenu->FindItem(kMoveToTrash);
|
item = fFileMenu->FindItem(kMoveToTrash);
|
||||||
if (item)
|
if (item) {
|
||||||
item->SetLabel(dontMoveToTrash ? "Delete" : "Move to Trash");
|
item->SetLabel(dontMoveToTrash
|
||||||
|
? B_TRANSLATE("Delete")
|
||||||
|
: B_TRANSLATE("Move to Trash"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
UpdateIfNeeded();
|
UpdateIfNeeded();
|
||||||
}
|
}
|
||||||
@@ -1685,11 +1696,11 @@ BContainerWindow::SetCutItem(BMenu *menu)
|
|||||||
|| PoseView() != CurrentFocus());
|
|| PoseView() != CurrentFocus());
|
||||||
|
|
||||||
if (modifiers() & B_SHIFT_KEY) {
|
if (modifiers() & B_SHIFT_KEY) {
|
||||||
item->SetLabel("Cut more");
|
item->SetLabel(B_TRANSLATE("Cut more"));
|
||||||
item->SetShortcut('X', B_COMMAND_KEY | B_SHIFT_KEY);
|
item->SetShortcut('X', B_COMMAND_KEY | B_SHIFT_KEY);
|
||||||
item->SetMessage(new BMessage(kCutMoreSelectionToClipboard));
|
item->SetMessage(new BMessage(kCutMoreSelectionToClipboard));
|
||||||
} else {
|
} else {
|
||||||
item->SetLabel("Cut");
|
item->SetLabel(B_TRANSLATE("Cut"));
|
||||||
item->SetShortcut('X', B_COMMAND_KEY);
|
item->SetShortcut('X', B_COMMAND_KEY);
|
||||||
item->SetMessage(new BMessage(B_CUT));
|
item->SetMessage(new BMessage(B_CUT));
|
||||||
}
|
}
|
||||||
@@ -1708,11 +1719,11 @@ BContainerWindow::SetCopyItem(BMenu *menu)
|
|||||||
|| PoseView() != CurrentFocus());
|
|| PoseView() != CurrentFocus());
|
||||||
|
|
||||||
if (modifiers() & B_SHIFT_KEY) {
|
if (modifiers() & B_SHIFT_KEY) {
|
||||||
item->SetLabel("Copy more");
|
item->SetLabel(B_TRANSLATE("Copy more"));
|
||||||
item->SetShortcut('C', B_COMMAND_KEY | B_SHIFT_KEY);
|
item->SetShortcut('C', B_COMMAND_KEY | B_SHIFT_KEY);
|
||||||
item->SetMessage(new BMessage(kCopyMoreSelectionToClipboard));
|
item->SetMessage(new BMessage(kCopyMoreSelectionToClipboard));
|
||||||
} else {
|
} else {
|
||||||
item->SetLabel("Copy");
|
item->SetLabel(B_TRANSLATE("Copy"));
|
||||||
item->SetShortcut('C', B_COMMAND_KEY);
|
item->SetShortcut('C', B_COMMAND_KEY);
|
||||||
item->SetMessage(new BMessage(B_COPY));
|
item->SetMessage(new BMessage(B_COPY));
|
||||||
}
|
}
|
||||||
@@ -1730,11 +1741,11 @@ BContainerWindow::SetPasteItem(BMenu *menu)
|
|||||||
item->SetEnabled(FSClipboardHasRefs() || PoseView() != CurrentFocus());
|
item->SetEnabled(FSClipboardHasRefs() || PoseView() != CurrentFocus());
|
||||||
|
|
||||||
if (modifiers() & B_SHIFT_KEY) {
|
if (modifiers() & B_SHIFT_KEY) {
|
||||||
item->SetLabel("Paste links");
|
item->SetLabel(B_TRANSLATE("Paste links"));
|
||||||
item->SetShortcut('V', B_COMMAND_KEY | B_SHIFT_KEY);
|
item->SetShortcut('V', B_COMMAND_KEY | B_SHIFT_KEY);
|
||||||
item->SetMessage(new BMessage(kPasteLinksFromClipboard));
|
item->SetMessage(new BMessage(kPasteLinksFromClipboard));
|
||||||
} else {
|
} else {
|
||||||
item->SetLabel("Paste");
|
item->SetLabel(B_TRANSLATE("Paste"));
|
||||||
item->SetShortcut('V', B_COMMAND_KEY);
|
item->SetShortcut('V', B_COMMAND_KEY);
|
||||||
item->SetMessage(new BMessage(B_PASTE));
|
item->SetMessage(new BMessage(B_PASTE));
|
||||||
}
|
}
|
||||||
@@ -1753,11 +1764,11 @@ BContainerWindow::SetCleanUpItem(BMenu *menu)
|
|||||||
&& (PoseView()->ViewMode() != kListMode));
|
&& (PoseView()->ViewMode() != kListMode));
|
||||||
|
|
||||||
if (modifiers() & B_SHIFT_KEY) {
|
if (modifiers() & B_SHIFT_KEY) {
|
||||||
item->SetLabel("Clean up all");
|
item->SetLabel(B_TRANSLATE("Clean up all"));
|
||||||
item->SetShortcut('K', B_COMMAND_KEY | B_SHIFT_KEY);
|
item->SetShortcut('K', B_COMMAND_KEY | B_SHIFT_KEY);
|
||||||
item->SetMessage(new BMessage(kCleanupAll));
|
item->SetMessage(new BMessage(kCleanupAll));
|
||||||
} else {
|
} else {
|
||||||
item->SetLabel("Clean up");
|
item->SetLabel(B_TRANSLATE("Clean up"));
|
||||||
item->SetShortcut('K', B_COMMAND_KEY);
|
item->SetShortcut('K', B_COMMAND_KEY);
|
||||||
item->SetMessage(new BMessage(kCleanup));
|
item->SetMessage(new BMessage(kCleanup));
|
||||||
}
|
}
|
||||||
@@ -1773,12 +1784,12 @@ BContainerWindow::SetCloseItem(BMenu *menu)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (modifiers() & B_SHIFT_KEY) {
|
if (modifiers() & B_SHIFT_KEY) {
|
||||||
item->SetLabel("Close all");
|
item->SetLabel(B_TRANSLATE("Close all"));
|
||||||
item->SetShortcut('W', B_COMMAND_KEY | B_SHIFT_KEY);
|
item->SetShortcut('W', B_COMMAND_KEY | B_SHIFT_KEY);
|
||||||
item->SetTarget(be_app);
|
item->SetTarget(be_app);
|
||||||
item->SetMessage(new BMessage(kCloseAllWindows));
|
item->SetMessage(new BMessage(kCloseAllWindows));
|
||||||
} else {
|
} else {
|
||||||
item->SetLabel("Close");
|
item->SetLabel(B_TRANSLATE("Close"));
|
||||||
item->SetShortcut('W', B_COMMAND_KEY);
|
item->SetShortcut('W', B_COMMAND_KEY);
|
||||||
item->SetTarget(this);
|
item->SetTarget(this);
|
||||||
item->SetMessage(new BMessage(B_QUIT_REQUESTED));
|
item->SetMessage(new BMessage(B_QUIT_REQUESTED));
|
||||||
@@ -1803,14 +1814,14 @@ BContainerWindow::IsShowing(const entry_ref *entry) const
|
|||||||
void
|
void
|
||||||
BContainerWindow::AddMenus()
|
BContainerWindow::AddMenus()
|
||||||
{
|
{
|
||||||
fFileMenu = new BMenu("File");
|
fFileMenu = new BMenu(B_TRANSLATE("File"));
|
||||||
AddFileMenu(fFileMenu);
|
AddFileMenu(fFileMenu);
|
||||||
fMenuBar->AddItem(fFileMenu);
|
fMenuBar->AddItem(fFileMenu);
|
||||||
fWindowMenu = new BMenu("Window");
|
fWindowMenu = new BMenu(B_TRANSLATE("Window"));
|
||||||
fMenuBar->AddItem(fWindowMenu);
|
fMenuBar->AddItem(fWindowMenu);
|
||||||
AddWindowMenu(fWindowMenu);
|
AddWindowMenu(fWindowMenu);
|
||||||
// just create the attribute, decide to add it later
|
// just create the attribute, decide to add it later
|
||||||
fAttrMenu = new BMenu("Attributes");
|
fAttrMenu = new BMenu(B_TRANSLATE("Attributes"));
|
||||||
NewAttributeMenu(fAttrMenu);
|
NewAttributeMenu(fAttrMenu);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1818,42 +1829,52 @@ BContainerWindow::AddMenus()
|
|||||||
void
|
void
|
||||||
BContainerWindow::AddFileMenu(BMenu *menu)
|
BContainerWindow::AddFileMenu(BMenu *menu)
|
||||||
{
|
{
|
||||||
if (!PoseView()->IsFilePanel())
|
if (!PoseView()->IsFilePanel()) {
|
||||||
menu->AddItem(new BMenuItem("Find"B_UTF8_ELLIPSIS,
|
menu->AddItem(new BMenuItem(B_TRANSLATE("Find" B_UTF8_ELLIPSIS),
|
||||||
new BMessage(kFindButton), 'F'));
|
new BMessage(kFindButton), 'F'));
|
||||||
|
}
|
||||||
|
|
||||||
if (!TargetModel()->IsQuery() && !IsTrash() && !IsPrintersDir()) {
|
if (!TargetModel()->IsQuery() && !IsTrash() && !IsPrintersDir()) {
|
||||||
if (!PoseView()->IsFilePanel()) {
|
if (!PoseView()->IsFilePanel()) {
|
||||||
TemplatesMenu *templateMenu = new TemplatesMenu(PoseView());
|
TemplatesMenu* templateMenu = new TemplatesMenu(PoseView(),
|
||||||
|
B_TRANSLATE("New"));
|
||||||
menu->AddItem(templateMenu);
|
menu->AddItem(templateMenu);
|
||||||
templateMenu->SetTargetForItems(PoseView());
|
templateMenu->SetTargetForItems(PoseView());
|
||||||
} else
|
} else {
|
||||||
menu->AddItem(new BMenuItem("New folder", new BMessage(kNewFolder), 'N'));
|
menu->AddItem(new BMenuItem(B_TRANSLATE("New folder"),
|
||||||
|
new BMessage(kNewFolder), 'N'));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
menu->AddSeparatorItem();
|
menu->AddSeparatorItem();
|
||||||
|
|
||||||
menu->AddItem(new BMenuItem("Open", new BMessage(kOpenSelection), 'O'));
|
menu->AddItem(new BMenuItem(B_TRANSLATE("Open"),
|
||||||
menu->AddItem(new BMenuItem("Get info", new BMessage(kGetInfo), 'I'));
|
new BMessage(kOpenSelection), 'O'));
|
||||||
menu->AddItem(new BMenuItem("Edit name", new BMessage(kEditItem), 'E'));
|
menu->AddItem(new BMenuItem(B_TRANSLATE("Get info"),
|
||||||
|
new BMessage(kGetInfo), 'I'));
|
||||||
|
menu->AddItem(new BMenuItem(B_TRANSLATE("Edit name"),
|
||||||
|
new BMessage(kEditItem), 'E'));
|
||||||
|
|
||||||
if (IsTrash() || InTrash()) {
|
if (IsTrash() || InTrash()) {
|
||||||
menu->AddItem(new BMenuItem("Restore", new BMessage(kRestoreFromTrash)));
|
menu->AddItem(new BMenuItem(B_TRANSLATE("Restore"),
|
||||||
|
new BMessage(kRestoreFromTrash)));
|
||||||
if (IsTrash()) {
|
if (IsTrash()) {
|
||||||
// add as first item in menu
|
// add as first item in menu
|
||||||
menu->AddItem(new BMenuItem("Empty Trash", new BMessage(kEmptyTrash)), 0);
|
menu->AddItem(new BMenuItem(B_TRANSLATE("Empty Trash"),
|
||||||
|
new BMessage(kEmptyTrash)), 0);
|
||||||
menu->AddItem(new BSeparatorItem(), 1);
|
menu->AddItem(new BSeparatorItem(), 1);
|
||||||
}
|
}
|
||||||
} else if (IsPrintersDir()) {
|
} else if (IsPrintersDir()) {
|
||||||
menu->AddItem(new BMenuItem("Add printer"B_UTF8_ELLIPSIS,
|
menu->AddItem(new BMenuItem(B_TRANSLATE("Add printer"B_UTF8_ELLIPSIS),
|
||||||
new BMessage(kAddPrinter), 'N'), 0);
|
new BMessage(kAddPrinter), 'N'), 0);
|
||||||
menu->AddItem(new BSeparatorItem(), 1);
|
menu->AddItem(new BSeparatorItem(), 1);
|
||||||
menu->AddItem(new BMenuItem("Make active printer",
|
menu->AddItem(new BMenuItem(B_TRANSLATE("Make active printer"),
|
||||||
new BMessage(kMakeActivePrinter)));
|
new BMessage(kMakeActivePrinter)));
|
||||||
} else {
|
} else {
|
||||||
menu->AddItem(new BMenuItem("Duplicate",new BMessage(kDuplicateSelection), 'D'));
|
menu->AddItem(new BMenuItem(B_TRANSLATE("Duplicate"),
|
||||||
|
new BMessage(kDuplicateSelection), 'D'));
|
||||||
|
|
||||||
menu->AddItem(new BMenuItem(TrackerSettings().DontMoveFilesToTrash() ?
|
menu->AddItem(new BMenuItem(TrackerSettings().DontMoveFilesToTrash()
|
||||||
"Delete" : "Move to Trash",
|
? B_TRANSLATE("Delete") : B_TRANSLATE("Move to Trash"),
|
||||||
new BMessage(kMoveToTrash), 'T'));
|
new BMessage(kMoveToTrash), 'T'));
|
||||||
|
|
||||||
menu->AddSeparatorItem();
|
menu->AddSeparatorItem();
|
||||||
@@ -1867,14 +1888,18 @@ BContainerWindow::AddFileMenu(BMenu *menu)
|
|||||||
if (!IsPrintersDir()) {
|
if (!IsPrintersDir()) {
|
||||||
menu->AddSeparatorItem();
|
menu->AddSeparatorItem();
|
||||||
|
|
||||||
menu->AddItem(cutItem = new BMenuItem("Cut", new BMessage(B_CUT), 'X'));
|
menu->AddItem(cutItem = new BMenuItem(B_TRANSLATE("Cut"),
|
||||||
menu->AddItem(copyItem = new BMenuItem("Copy", new BMessage(B_COPY), 'C'));
|
new BMessage(B_CUT), 'X'));
|
||||||
menu->AddItem(pasteItem = new BMenuItem("Paste", new BMessage(B_PASTE), 'V'));
|
menu->AddItem(copyItem = new BMenuItem(B_TRANSLATE("Copy"),
|
||||||
|
new BMessage(B_COPY), 'C'));
|
||||||
|
menu->AddItem(pasteItem = new BMenuItem(B_TRANSLATE("Paste"),
|
||||||
|
new BMessage(B_PASTE), 'V'));
|
||||||
|
|
||||||
menu->AddSeparatorItem();
|
menu->AddSeparatorItem();
|
||||||
|
|
||||||
menu->AddItem(new BMenuItem("Identify", new BMessage(kIdentifyEntry)));
|
menu->AddItem(new BMenuItem(B_TRANSLATE("Identify"),
|
||||||
BMenu *addOnMenuItem = new BMenu(kAddOnsMenuName);
|
new BMessage(kIdentifyEntry)));
|
||||||
|
BMenu* addOnMenuItem = new BMenu(B_TRANSLATE("Add-ons"));
|
||||||
addOnMenuItem->SetFont(be_plain_font);
|
addOnMenuItem->SetFont(be_plain_font);
|
||||||
menu->AddItem(addOnMenuItem);
|
menu->AddItem(addOnMenuItem);
|
||||||
}
|
}
|
||||||
@@ -1894,29 +1919,29 @@ BContainerWindow::AddWindowMenu(BMenu *menu)
|
|||||||
{
|
{
|
||||||
BMenuItem *item;
|
BMenuItem *item;
|
||||||
|
|
||||||
BMenu* iconSizeMenu = new BMenu("Icon view");
|
BMenu* iconSizeMenu = new BMenu(B_TRANSLATE("Icon view"));
|
||||||
|
|
||||||
BMessage* message = new BMessage(kIconMode);
|
BMessage* message = new BMessage(kIconMode);
|
||||||
message->AddInt32("size", 32);
|
message->AddInt32("size", 32);
|
||||||
item = new BMenuItem("32 x 32", message);
|
item = new BMenuItem(B_TRANSLATE("32 x 32"), message);
|
||||||
item->SetTarget(PoseView());
|
item->SetTarget(PoseView());
|
||||||
iconSizeMenu->AddItem(item);
|
iconSizeMenu->AddItem(item);
|
||||||
|
|
||||||
message = new BMessage(kIconMode);
|
message = new BMessage(kIconMode);
|
||||||
message->AddInt32("size", 40);
|
message->AddInt32("size", 40);
|
||||||
item = new BMenuItem("40 x 40", message);
|
item = new BMenuItem(B_TRANSLATE("40 x 40"), message);
|
||||||
item->SetTarget(PoseView());
|
item->SetTarget(PoseView());
|
||||||
iconSizeMenu->AddItem(item);
|
iconSizeMenu->AddItem(item);
|
||||||
|
|
||||||
message = new BMessage(kIconMode);
|
message = new BMessage(kIconMode);
|
||||||
message->AddInt32("size", 48);
|
message->AddInt32("size", 48);
|
||||||
item = new BMenuItem("48 x 48", message);
|
item = new BMenuItem(B_TRANSLATE("48 x 48"), message);
|
||||||
item->SetTarget(PoseView());
|
item->SetTarget(PoseView());
|
||||||
iconSizeMenu->AddItem(item);
|
iconSizeMenu->AddItem(item);
|
||||||
|
|
||||||
message = new BMessage(kIconMode);
|
message = new BMessage(kIconMode);
|
||||||
message->AddInt32("size", 64);
|
message->AddInt32("size", 64);
|
||||||
item = new BMenuItem("64 x 64", message);
|
item = new BMenuItem(B_TRANSLATE("64 x 64"), message);
|
||||||
item->SetTarget(PoseView());
|
item->SetTarget(PoseView());
|
||||||
iconSizeMenu->AddItem(item);
|
iconSizeMenu->AddItem(item);
|
||||||
|
|
||||||
@@ -1924,13 +1949,13 @@ BContainerWindow::AddWindowMenu(BMenu *menu)
|
|||||||
|
|
||||||
message = new BMessage(kIconMode);
|
message = new BMessage(kIconMode);
|
||||||
message->AddInt32("scale", 0);
|
message->AddInt32("scale", 0);
|
||||||
item = new BMenuItem("Decrease size", message, '-');
|
item = new BMenuItem(B_TRANSLATE("Decrease size"), message, '-');
|
||||||
item->SetTarget(PoseView());
|
item->SetTarget(PoseView());
|
||||||
iconSizeMenu->AddItem(item);
|
iconSizeMenu->AddItem(item);
|
||||||
|
|
||||||
message = new BMessage(kIconMode);
|
message = new BMessage(kIconMode);
|
||||||
message->AddInt32("scale", 1);
|
message->AddInt32("scale", 1);
|
||||||
item = new BMenuItem("Increase size", message, '+');
|
item = new BMenuItem(B_TRANSLATE("Increase size"), message, '+');
|
||||||
item->SetTarget(PoseView());
|
item->SetTarget(PoseView());
|
||||||
iconSizeMenu->AddItem(item);
|
iconSizeMenu->AddItem(item);
|
||||||
|
|
||||||
@@ -1940,57 +1965,62 @@ BContainerWindow::AddWindowMenu(BMenu *menu)
|
|||||||
iconSizeMenu->Superitem()->SetMessage(new BMessage(kIconMode));
|
iconSizeMenu->Superitem()->SetMessage(new BMessage(kIconMode));
|
||||||
iconSizeMenu->Superitem()->SetTarget(PoseView());
|
iconSizeMenu->Superitem()->SetTarget(PoseView());
|
||||||
|
|
||||||
item = new BMenuItem("Mini icon view", new BMessage(kMiniIconMode), '2');
|
item = new BMenuItem(B_TRANSLATE("Mini icon view"),
|
||||||
|
new BMessage(kMiniIconMode), '2');
|
||||||
item->SetTarget(PoseView());
|
item->SetTarget(PoseView());
|
||||||
menu->AddItem(item);
|
menu->AddItem(item);
|
||||||
|
|
||||||
item = new BMenuItem("List view", new BMessage(kListMode), '3');
|
item = new BMenuItem(B_TRANSLATE("List view"),
|
||||||
|
new BMessage(kListMode), '3');
|
||||||
item->SetTarget(PoseView());
|
item->SetTarget(PoseView());
|
||||||
menu->AddItem(item);
|
menu->AddItem(item);
|
||||||
|
|
||||||
menu->AddSeparatorItem();
|
menu->AddSeparatorItem();
|
||||||
|
|
||||||
item = new BMenuItem("Resize to fit", new BMessage(kResizeToFit), 'Y');
|
item = new BMenuItem(B_TRANSLATE("Resize to fit"),
|
||||||
|
new BMessage(kResizeToFit), 'Y');
|
||||||
item->SetTarget(this);
|
item->SetTarget(this);
|
||||||
menu->AddItem(item);
|
menu->AddItem(item);
|
||||||
|
|
||||||
item = new BMenuItem("Clean up", new BMessage(kCleanup), 'K');
|
item = new BMenuItem(B_TRANSLATE("Clean up"), new BMessage(kCleanup), 'K');
|
||||||
item->SetTarget(PoseView());
|
item->SetTarget(PoseView());
|
||||||
menu->AddItem(item);
|
menu->AddItem(item);
|
||||||
|
|
||||||
item = new BMenuItem("Select"B_UTF8_ELLIPSIS,
|
item = new BMenuItem(B_TRANSLATE("Select"B_UTF8_ELLIPSIS),
|
||||||
new BMessage(kShowSelectionWindow), 'A', B_SHIFT_KEY);
|
new BMessage(kShowSelectionWindow), 'A', B_SHIFT_KEY);
|
||||||
item->SetTarget(PoseView());
|
item->SetTarget(PoseView());
|
||||||
menu->AddItem(item);
|
menu->AddItem(item);
|
||||||
|
|
||||||
item = new BMenuItem("Select all", new BMessage(B_SELECT_ALL), 'A');
|
item = new BMenuItem(B_TRANSLATE("Select all"), new BMessage(B_SELECT_ALL),
|
||||||
|
'A');
|
||||||
item->SetTarget(PoseView());
|
item->SetTarget(PoseView());
|
||||||
menu->AddItem(item);
|
menu->AddItem(item);
|
||||||
|
|
||||||
item = new BMenuItem("Invert selection", new BMessage(kInvertSelection),
|
item = new BMenuItem(B_TRANSLATE("Invert selection"),
|
||||||
'S');
|
new BMessage(kInvertSelection), 'S');
|
||||||
item->SetTarget(PoseView());
|
item->SetTarget(PoseView());
|
||||||
menu->AddItem(item);
|
menu->AddItem(item);
|
||||||
|
|
||||||
if (!IsTrash()) {
|
if (!IsTrash()) {
|
||||||
item = new BMenuItem("Open parent", new BMessage(kOpenParentDir),
|
item = new BMenuItem(B_TRANSLATE("Open parent"),
|
||||||
B_UP_ARROW);
|
new BMessage(kOpenParentDir), B_UP_ARROW);
|
||||||
item->SetTarget(PoseView());
|
item->SetTarget(PoseView());
|
||||||
menu->AddItem(item);
|
menu->AddItem(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
item = new BMenuItem("Close", new BMessage(B_QUIT_REQUESTED), 'W');
|
item = new BMenuItem(B_TRANSLATE("Close"), new BMessage(B_QUIT_REQUESTED),
|
||||||
|
'W');
|
||||||
item->SetTarget(this);
|
item->SetTarget(this);
|
||||||
menu->AddItem(item);
|
menu->AddItem(item);
|
||||||
|
|
||||||
item = new BMenuItem("Close all in workspace",
|
item = new BMenuItem(B_TRANSLATE("Close all in workspace"),
|
||||||
new BMessage(kCloseAllInWorkspace), 'Q');
|
new BMessage(kCloseAllInWorkspace), 'Q');
|
||||||
item->SetTarget(be_app);
|
item->SetTarget(be_app);
|
||||||
menu->AddItem(item);
|
menu->AddItem(item);
|
||||||
|
|
||||||
menu->AddSeparatorItem();
|
menu->AddSeparatorItem();
|
||||||
|
|
||||||
item = new BMenuItem("Preferences"B_UTF8_ELLIPSIS,
|
item = new BMenuItem(B_TRANSLATE("Preferences" B_UTF8_ELLIPSIS),
|
||||||
new BMessage(kShowSettingsWindow));
|
new BMessage(kShowSettingsWindow));
|
||||||
item->SetTarget(be_app);
|
item->SetTarget(be_app);
|
||||||
menu->AddItem(item);
|
menu->AddItem(item);
|
||||||
@@ -2050,8 +2080,10 @@ BContainerWindow::MenusBeginning()
|
|||||||
|
|
||||||
AddMimeTypesToMenu(fAttrMenu);
|
AddMimeTypesToMenu(fAttrMenu);
|
||||||
|
|
||||||
if (IsPrintersDir())
|
if (IsPrintersDir()) {
|
||||||
EnableNamedMenuItem(fFileMenu, "Make active printer", selectCount == 1);
|
EnableNamedMenuItem(fFileMenu, B_TRANSLATE("Make active printer"),
|
||||||
|
selectCount == 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -2163,7 +2195,7 @@ BContainerWindow::SetUpEditQueryItem(BMenu *menu)
|
|||||||
bool poseViewIsQuery = TargetModel()->IsQuery();
|
bool poseViewIsQuery = TargetModel()->IsQuery();
|
||||||
// if the view is a query pose view, add edit query menu item
|
// if the view is a query pose view, add edit query menu item
|
||||||
|
|
||||||
BMenuItem *item = menu->FindItem("Edit query");
|
BMenuItem* item = menu->FindItem(B_TRANSLATE("Edit query"));
|
||||||
if (!poseViewIsQuery && !queryInSelection && item)
|
if (!poseViewIsQuery && !queryInSelection && item)
|
||||||
item->Menu()->RemoveItem(item);
|
item->Menu()->RemoveItem(item);
|
||||||
|
|
||||||
@@ -2173,7 +2205,8 @@ BContainerWindow::SetUpEditQueryItem(BMenu *menu)
|
|||||||
item = menu->FindItem(kOpenSelection);
|
item = menu->FindItem(kOpenSelection);
|
||||||
if (item) {
|
if (item) {
|
||||||
int32 itemIndex = item->Menu()->IndexOf(item);
|
int32 itemIndex = item->Menu()->IndexOf(item);
|
||||||
BMenuItem *query = new BMenuItem("Edit query", new BMessage(kEditQuery), 'G');
|
BMenuItem* query = new BMenuItem(B_TRANSLATE("Edit query"),
|
||||||
|
new BMessage(kEditQuery), 'G');
|
||||||
item->Menu()->AddItem(query, itemIndex + 1);
|
item->Menu()->AddItem(query, itemIndex + 1);
|
||||||
query->SetTarget(PoseView());
|
query->SetTarget(PoseView());
|
||||||
}
|
}
|
||||||
@@ -2225,8 +2258,8 @@ BContainerWindow::SetupOpenWithMenu(BMenu *parent)
|
|||||||
|
|
||||||
int32 index = item->Menu()->IndexOf(item);
|
int32 index = item->Menu()->IndexOf(item);
|
||||||
fOpenWithItem = new BMenuItem(
|
fOpenWithItem = new BMenuItem(
|
||||||
new OpenWithMenu("Open with"B_UTF8_ELLIPSIS, &message, this, be_app),
|
new OpenWithMenu(B_TRANSLATE("Open with" B_UTF8_ELLIPSIS),
|
||||||
new BMessage(kOpenSelectionWith));
|
&message, this, be_app), new BMessage(kOpenSelectionWith));
|
||||||
fOpenWithItem->SetTarget(PoseView());
|
fOpenWithItem->SetTarget(PoseView());
|
||||||
fOpenWithItem->SetShortcut('O', B_COMMAND_KEY | B_CONTROL_KEY);
|
fOpenWithItem->SetShortcut('O', B_COMMAND_KEY | B_CONTROL_KEY);
|
||||||
|
|
||||||
@@ -2260,7 +2293,8 @@ BContainerWindow::PopulateMoveCopyNavMenu(BNavMenu *navMenu, uint32 what,
|
|||||||
if (entry.SetTo(ref) == B_OK
|
if (entry.SetTo(ref) == B_OK
|
||||||
&& entry.GetParent(&entry) == B_OK
|
&& entry.GetParent(&entry) == B_OK
|
||||||
&& model.SetTo(&entry) == B_OK) {
|
&& model.SetTo(&entry) == B_OK) {
|
||||||
BNavMenu *menu = new BNavMenu("Current folder",what,this);
|
BNavMenu* menu = new BNavMenu(B_TRANSLATE("Current folder"), what,
|
||||||
|
this);
|
||||||
menu->SetNavDir(model.EntryRef());
|
menu->SetNavDir(model.EntryRef());
|
||||||
menu->SetShowParent(true);
|
menu->SetShowParent(true);
|
||||||
|
|
||||||
@@ -2276,7 +2310,8 @@ BContainerWindow::PopulateMoveCopyNavMenu(BNavMenu *navMenu, uint32 what,
|
|||||||
path.Append("Tracker");
|
path.Append("Tracker");
|
||||||
if (entry.SetTo(path.Path()) == B_OK
|
if (entry.SetTo(path.Path()) == B_OK
|
||||||
&& model.SetTo(&entry) == B_OK) {
|
&& model.SetTo(&entry) == B_OK) {
|
||||||
BMenu *menu = new RecentsMenu("Recent folders",kRecentFolders,what,this);
|
BMenu* menu = new RecentsMenu(B_TRANSLATE("Recent folders"),
|
||||||
|
kRecentFolders, what, this);
|
||||||
|
|
||||||
BMenuItem *item = new SpecialModelMenuItem(&model,menu);
|
BMenuItem *item = new SpecialModelMenuItem(&model,menu);
|
||||||
item->SetMessage(new BMessage((uint32)what));
|
item->SetMessage(new BMessage((uint32)what));
|
||||||
@@ -2375,9 +2410,9 @@ BContainerWindow::SetupMoveCopyMenus(const entry_ref *item_ref, BMenu *parent)
|
|||||||
// Set the "Create Link" item label here so it
|
// Set the "Create Link" item label here so it
|
||||||
// appears correctly when menus are disabled, too.
|
// appears correctly when menus are disabled, too.
|
||||||
if (modifierKeys & B_SHIFT_KEY)
|
if (modifierKeys & B_SHIFT_KEY)
|
||||||
fCreateLinkItem->SetLabel("Create relative link");
|
fCreateLinkItem->SetLabel(B_TRANSLATE("Create relative link"));
|
||||||
else
|
else
|
||||||
fCreateLinkItem->SetLabel("Create link");
|
fCreateLinkItem->SetLabel(B_TRANSLATE("Create link"));
|
||||||
|
|
||||||
// only enable once the menus are built
|
// only enable once the menus are built
|
||||||
fMoveToItem->SetEnabled(false);
|
fMoveToItem->SetEnabled(false);
|
||||||
@@ -2425,9 +2460,9 @@ BContainerWindow::SetupMoveCopyMenus(const entry_ref *item_ref, BMenu *parent)
|
|||||||
BMenuItem *identifyItem = parent->FindItem(kIdentifyEntry);
|
BMenuItem *identifyItem = parent->FindItem(kIdentifyEntry);
|
||||||
if (identifyItem != NULL) {
|
if (identifyItem != NULL) {
|
||||||
if (modifierKeys & B_SHIFT_KEY)
|
if (modifierKeys & B_SHIFT_KEY)
|
||||||
identifyItem->SetLabel("Force identify");
|
identifyItem->SetLabel(B_TRANSLATE("Force identify"));
|
||||||
else
|
else
|
||||||
identifyItem->SetLabel("Identify");
|
identifyItem->SetLabel(B_TRANSLATE("Identify"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2446,10 +2481,10 @@ BContainerWindow::ShowDropContextMenu(BPoint loc)
|
|||||||
if (item == NULL)
|
if (item == NULL)
|
||||||
item = fDropContextMenu->FindItem(kCreateRelativeLink);
|
item = fDropContextMenu->FindItem(kCreateRelativeLink);
|
||||||
if (item && (modifiers() & B_SHIFT_KEY)) {
|
if (item && (modifiers() & B_SHIFT_KEY)) {
|
||||||
item->SetLabel("Create relative link here");
|
item->SetLabel(B_TRANSLATE("Create relative link here"));
|
||||||
item->SetMessage(new BMessage(kCreateRelativeLink));
|
item->SetMessage(new BMessage(kCreateRelativeLink));
|
||||||
} else if (item) {
|
} else if (item) {
|
||||||
item->SetLabel("Create link here");
|
item->SetLabel(B_TRANSLATE("Create link here"));
|
||||||
item->SetMessage(new BMessage(kCreateLink));
|
item->SetMessage(new BMessage(kCreateLink));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2572,7 +2607,8 @@ BContainerWindow::ShowContextMenu(BPoint loc, const entry_ref *ref, BView *)
|
|||||||
if (volume != boot)
|
if (volume != boot)
|
||||||
ejectableVolumeSelected = true;
|
ejectableVolumeSelected = true;
|
||||||
|
|
||||||
EnableNamedMenuItem(fContextMenu, "Unmount", ejectableVolumeSelected);
|
EnableNamedMenuItem(fContextMenu,
|
||||||
|
B_TRANSLATE("Unmount"), ejectableVolumeSelected);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2607,36 +2643,45 @@ BContainerWindow::ShowContextMenu(BPoint loc, const entry_ref *ref, BView *)
|
|||||||
void
|
void
|
||||||
BContainerWindow::AddFileContextMenus(BMenu *menu)
|
BContainerWindow::AddFileContextMenus(BMenu *menu)
|
||||||
{
|
{
|
||||||
menu->AddItem(new BMenuItem("Open", new BMessage(kOpenSelection), 'O'));
|
menu->AddItem(new BMenuItem(B_TRANSLATE("Open"),
|
||||||
menu->AddItem(new BMenuItem("Get info", new BMessage(kGetInfo), 'I'));
|
new BMessage(kOpenSelection), 'O'));
|
||||||
menu->AddItem(new BMenuItem("Edit name", new BMessage(kEditItem), 'E'));
|
menu->AddItem(new BMenuItem(B_TRANSLATE("Get info"), new BMessage(kGetInfo),
|
||||||
|
'I'));
|
||||||
|
menu->AddItem(new BMenuItem(B_TRANSLATE("Edit name"),
|
||||||
|
new BMessage(kEditItem), 'E'));
|
||||||
|
|
||||||
if (!IsTrash() && !InTrash() && !IsPrintersDir())
|
if (!IsTrash() && !InTrash() && !IsPrintersDir()) {
|
||||||
menu->AddItem(new BMenuItem("Duplicate",
|
menu->AddItem(new BMenuItem(B_TRANSLATE("Duplicate"),
|
||||||
new BMessage(kDuplicateSelection), 'D'));
|
new BMessage(kDuplicateSelection), 'D'));
|
||||||
|
}
|
||||||
|
|
||||||
if (!IsTrash() && !InTrash()) {
|
if (!IsTrash() && !InTrash()) {
|
||||||
menu->AddItem(new BMenuItem(TrackerSettings().DontMoveFilesToTrash() ?
|
menu->AddItem(new BMenuItem(TrackerSettings().DontMoveFilesToTrash()
|
||||||
"Delete" : "Move to Trash",
|
? B_TRANSLATE("Delete") : B_TRANSLATE("Move to Trash"),
|
||||||
new BMessage(kMoveToTrash), 'T'));
|
new BMessage(kMoveToTrash), 'T'));
|
||||||
|
|
||||||
// add separator for copy to/move to items (navigation items)
|
// add separator for copy to/move to items (navigation items)
|
||||||
menu->AddSeparatorItem();
|
menu->AddSeparatorItem();
|
||||||
} else {
|
} else {
|
||||||
menu->AddItem(new BMenuItem("Delete", new BMessage(kDelete), 0));
|
menu->AddItem(new BMenuItem(B_TRANSLATE("Delete"),
|
||||||
menu->AddItem(new BMenuItem("Restore", new BMessage(kRestoreFromTrash), 0));
|
new BMessage(kDelete), 0));
|
||||||
|
menu->AddItem(new BMenuItem(B_TRANSLATE("Restore"),
|
||||||
|
new BMessage(kRestoreFromTrash), 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CUT_COPY_PASTE_IN_CONTEXT_MENU
|
#ifdef CUT_COPY_PASTE_IN_CONTEXT_MENU
|
||||||
menu->AddSeparatorItem();
|
menu->AddSeparatorItem();
|
||||||
BMenuItem *cutItem, *copyItem;
|
BMenuItem *cutItem, *copyItem;
|
||||||
menu->AddItem(cutItem = new BMenuItem("Cut", new BMessage(B_CUT), 'X'));
|
menu->AddItem(cutItem = new BMenuItem(B_TRANSLATE("Cut"),
|
||||||
menu->AddItem(copyItem = new BMenuItem("Copy", new BMessage(B_COPY), 'C'));
|
new BMessage(B_CUT), 'X'));
|
||||||
|
menu->AddItem(copyItem = new BMenuItem(B_TRANSLATE("Copy"),
|
||||||
|
new BMessage(B_COPY), 'C'));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
menu->AddSeparatorItem();
|
menu->AddSeparatorItem();
|
||||||
menu->AddItem(new BMenuItem("Identify", new BMessage(kIdentifyEntry)));
|
menu->AddItem(new BMenuItem(B_TRANSLATE("Identify"),
|
||||||
BMenu *addOnMenuItem = new BMenu(kAddOnsMenuName);
|
new BMessage(kIdentifyEntry)));
|
||||||
|
BMenu* addOnMenuItem = new BMenu(B_TRANSLATE("Add-ons"));
|
||||||
addOnMenuItem->SetFont(be_plain_font);
|
addOnMenuItem->SetFont(be_plain_font);
|
||||||
menu->AddItem(addOnMenuItem);
|
menu->AddItem(addOnMenuItem);
|
||||||
|
|
||||||
@@ -2652,19 +2697,23 @@ BContainerWindow::AddFileContextMenus(BMenu *menu)
|
|||||||
void
|
void
|
||||||
BContainerWindow::AddVolumeContextMenus(BMenu *menu)
|
BContainerWindow::AddVolumeContextMenus(BMenu *menu)
|
||||||
{
|
{
|
||||||
menu->AddItem(new BMenuItem("Open", new BMessage(kOpenSelection), 'O'));
|
menu->AddItem(new BMenuItem(B_TRANSLATE("Open"),
|
||||||
menu->AddItem(new BMenuItem("Get info", new BMessage(kGetInfo), 'I'));
|
new BMessage(kOpenSelection), 'O'));
|
||||||
menu->AddItem(new BMenuItem("Edit name", new BMessage(kEditItem), 'E'));
|
menu->AddItem(new BMenuItem(B_TRANSLATE("Get info"),
|
||||||
|
new BMessage(kGetInfo), 'I'));
|
||||||
|
menu->AddItem(new BMenuItem(B_TRANSLATE("Edit name"),
|
||||||
|
new BMessage(kEditItem), 'E'));
|
||||||
|
|
||||||
menu->AddSeparatorItem();
|
menu->AddSeparatorItem();
|
||||||
menu->AddItem(new MountMenu("Mount"));
|
menu->AddItem(new MountMenu(B_TRANSLATE("Mount")));
|
||||||
|
|
||||||
BMenuItem *item = new BMenuItem("Unmount", new BMessage(kUnmountVolume), 'U');
|
BMenuItem *item = new BMenuItem(B_TRANSLATE("Unmount"),
|
||||||
|
new BMessage(kUnmountVolume), 'U');
|
||||||
item->SetEnabled(false);
|
item->SetEnabled(false);
|
||||||
menu->AddItem(item);
|
menu->AddItem(item);
|
||||||
|
|
||||||
menu->AddSeparatorItem();
|
menu->AddSeparatorItem();
|
||||||
menu->AddItem(new BMenu(kAddOnsMenuName));
|
menu->AddItem(new BMenu(B_TRANSLATE("Add-ons")));
|
||||||
|
|
||||||
menu->SetTargetForItems(PoseView());
|
menu->SetTargetForItems(PoseView());
|
||||||
}
|
}
|
||||||
@@ -2678,14 +2727,17 @@ BContainerWindow::AddWindowContextMenus(BMenu *menu)
|
|||||||
// mode menu
|
// mode menu
|
||||||
|
|
||||||
bool needSeparator = true;
|
bool needSeparator = true;
|
||||||
if (IsTrash())
|
if (IsTrash()) {
|
||||||
menu->AddItem(new BMenuItem("Empty Trash", new BMessage(kEmptyTrash)));
|
menu->AddItem(new BMenuItem(B_TRANSLATE("Empty Trash"),
|
||||||
else if (IsPrintersDir())
|
new BMessage(kEmptyTrash)));
|
||||||
menu->AddItem(new BMenuItem("Add printer"B_UTF8_ELLIPSIS, new BMessage(kAddPrinter), 'N'));
|
} else if (IsPrintersDir()) {
|
||||||
else if (InTrash())
|
menu->AddItem(new BMenuItem(B_TRANSLATE("Add printer"B_UTF8_ELLIPSIS),
|
||||||
|
new BMessage(kAddPrinter), 'N'));
|
||||||
|
} else if (InTrash())
|
||||||
needSeparator = false;
|
needSeparator = false;
|
||||||
else {
|
else {
|
||||||
TemplatesMenu *templateMenu = new TemplatesMenu(PoseView());
|
TemplatesMenu* templateMenu = new TemplatesMenu(PoseView(),
|
||||||
|
B_TRANSLATE("New"));
|
||||||
menu->AddItem(templateMenu);
|
menu->AddItem(templateMenu);
|
||||||
templateMenu->SetTargetForItems(PoseView());
|
templateMenu->SetTargetForItems(PoseView());
|
||||||
templateMenu->SetFont(be_plain_font);
|
templateMenu->SetFont(be_plain_font);
|
||||||
@@ -2699,16 +2751,19 @@ BContainerWindow::AddWindowContextMenus(BMenu *menu)
|
|||||||
menu->AddItem(pasteItem);
|
menu->AddItem(pasteItem);
|
||||||
menu->AddSeparatorItem();
|
menu->AddSeparatorItem();
|
||||||
#endif
|
#endif
|
||||||
menu->AddItem(new BMenuItem("Clean up", new BMessage(kCleanup), 'K'));
|
menu->AddItem(new BMenuItem(B_TRANSLATE("Clean up"),
|
||||||
menu->AddItem(new BMenuItem("Select"B_UTF8_ELLIPSIS,
|
new BMessage(kCleanup), 'K'));
|
||||||
|
menu->AddItem(new BMenuItem(B_TRANSLATE("Select"B_UTF8_ELLIPSIS),
|
||||||
new BMessage(kShowSelectionWindow), 'A', B_SHIFT_KEY));
|
new BMessage(kShowSelectionWindow), 'A', B_SHIFT_KEY));
|
||||||
menu->AddItem(new BMenuItem("Select all", new BMessage(B_SELECT_ALL), 'A'));
|
menu->AddItem(new BMenuItem(B_TRANSLATE("Select all"),
|
||||||
if (!IsTrash())
|
new BMessage(B_SELECT_ALL), 'A'));
|
||||||
menu->AddItem(new BMenuItem("Open parent", new BMessage(kOpenParentDir),
|
if (!IsTrash()) {
|
||||||
B_UP_ARROW));
|
menu->AddItem(new BMenuItem(B_TRANSLATE("Open parent"),
|
||||||
|
new BMessage(kOpenParentDir), B_UP_ARROW));
|
||||||
|
}
|
||||||
|
|
||||||
menu->AddSeparatorItem();
|
menu->AddSeparatorItem();
|
||||||
BMenu *addOnMenuItem = new BMenu(kAddOnsMenuName);
|
BMenu* addOnMenuItem = new BMenu(B_TRANSLATE("Add-ons"));
|
||||||
addOnMenuItem->SetFont(be_plain_font);
|
addOnMenuItem->SetFont(be_plain_font);
|
||||||
menu->AddItem(addOnMenuItem);
|
menu->AddItem(addOnMenuItem);
|
||||||
|
|
||||||
@@ -2729,11 +2784,15 @@ BContainerWindow::AddWindowContextMenus(BMenu *menu)
|
|||||||
void
|
void
|
||||||
BContainerWindow::AddDropContextMenus(BMenu *menu)
|
BContainerWindow::AddDropContextMenus(BMenu *menu)
|
||||||
{
|
{
|
||||||
menu->AddItem(new BMenuItem("Create link here", new BMessage(kCreateLink)));
|
menu->AddItem(new BMenuItem(B_TRANSLATE("Create link here"),
|
||||||
menu->AddItem(new BMenuItem("Move here", new BMessage(kMoveSelectionTo)));
|
new BMessage(kCreateLink)));
|
||||||
menu->AddItem(new BMenuItem("Copy here", new BMessage(kCopySelectionTo)));
|
menu->AddItem(new BMenuItem(B_TRANSLATE("Move here"),
|
||||||
|
new BMessage(kMoveSelectionTo)));
|
||||||
|
menu->AddItem(new BMenuItem(B_TRANSLATE("Copy here"),
|
||||||
|
new BMessage(kCopySelectionTo)));
|
||||||
menu->AddSeparatorItem();
|
menu->AddSeparatorItem();
|
||||||
menu->AddItem(new BMenuItem("Cancel", new BMessage(kCancelButton)));
|
menu->AddItem(new BMenuItem(B_TRANSLATE("Cancel"),
|
||||||
|
new BMessage(kCancelButton)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -2741,11 +2800,11 @@ void
|
|||||||
BContainerWindow::AddTrashContextMenus(BMenu *menu)
|
BContainerWindow::AddTrashContextMenus(BMenu *menu)
|
||||||
{
|
{
|
||||||
// setup special trash context menu
|
// setup special trash context menu
|
||||||
menu->AddItem(new BMenuItem("Empty Trash",
|
menu->AddItem(new BMenuItem(B_TRANSLATE("Empty Trash"),
|
||||||
new BMessage(kEmptyTrash)));
|
new BMessage(kEmptyTrash)));
|
||||||
menu->AddItem(new BMenuItem("Open",
|
menu->AddItem(new BMenuItem(B_TRANSLATE("Open"),
|
||||||
new BMessage(kOpenSelection), 'O'));
|
new BMessage(kOpenSelection), 'O'));
|
||||||
menu->AddItem(new BMenuItem("Get info",
|
menu->AddItem(new BMenuItem(B_TRANSLATE("Get info"),
|
||||||
new BMessage(kGetInfo), 'I'));
|
new BMessage(kGetInfo), 'I'));
|
||||||
menu->SetTargetForItems(PoseView());
|
menu->SetTargetForItems(PoseView());
|
||||||
}
|
}
|
||||||
@@ -2887,7 +2946,7 @@ BContainerWindow::EachAddon(BPath &path, bool (*eachAddon)(const Model *,
|
|||||||
void
|
void
|
||||||
BContainerWindow::BuildAddOnMenu(BMenu *menu)
|
BContainerWindow::BuildAddOnMenu(BMenu *menu)
|
||||||
{
|
{
|
||||||
BMenuItem *item = menu->FindItem(kAddOnsMenuName);
|
BMenuItem* item = menu->FindItem(B_TRANSLATE("Add-ons"));
|
||||||
if (menu->IndexOf(item) == 0) {
|
if (menu->IndexOf(item) == 0) {
|
||||||
// the folder of the context menu seems to be named "Add-Ons"
|
// the folder of the context menu seems to be named "Add-Ons"
|
||||||
// so we just take the last menu item, which is correct if not
|
// so we just take the last menu item, which is correct if not
|
||||||
@@ -2965,7 +3024,7 @@ BContainerWindow::UpdateMenu(BMenu *menu, UpdateMenuContext context)
|
|||||||
|
|
||||||
if (context == kMenuBarContext || context == kWindowPopUpContext) {
|
if (context == kMenuBarContext || context == kWindowPopUpContext) {
|
||||||
BMenu* sizeMenu = NULL;
|
BMenu* sizeMenu = NULL;
|
||||||
if (BMenuItem* item = menu->FindItem("Icon view")) {
|
if (BMenuItem* item = menu->FindItem(B_TRANSLATE("Icon view"))) {
|
||||||
sizeMenu = item->Submenu();
|
sizeMenu = item->Submenu();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3001,7 +3060,7 @@ BContainerWindow::UpdateMenu(BMenu *menu, UpdateMenuContext context)
|
|||||||
EnableNamedMenuItem(menu, kEmptyTrash, count > 0);
|
EnableNamedMenuItem(menu, kEmptyTrash, count > 0);
|
||||||
EnableNamedMenuItem(menu, B_SELECT_ALL, count > 0);
|
EnableNamedMenuItem(menu, B_SELECT_ALL, count > 0);
|
||||||
|
|
||||||
BMenuItem *item = menu->FindItem(kTemplatesMenuName);
|
BMenuItem* item = menu->FindItem(B_TRANSLATE("New"));
|
||||||
if (item) {
|
if (item) {
|
||||||
TemplatesMenu *templateMenu = dynamic_cast<TemplatesMenu *>(
|
TemplatesMenu *templateMenu = dynamic_cast<TemplatesMenu *>(
|
||||||
item->Submenu());
|
item->Submenu());
|
||||||
@@ -3022,10 +3081,12 @@ BContainerWindow::LoadAddOn(BMessage *message)
|
|||||||
entry_ref addonRef;
|
entry_ref addonRef;
|
||||||
status_t result = message->FindRef("refs", &addonRef);
|
status_t result = message->FindRef("refs", &addonRef);
|
||||||
if (result != B_OK) {
|
if (result != B_OK) {
|
||||||
char buffer[1024];
|
BString buffer(B_TRANSLATE("Error %error loading add-On %name."));
|
||||||
sprintf(buffer, "Error %s loading add-On %s.", strerror(result), addonRef.name);
|
buffer.ReplaceFirst("%error", strerror(result));
|
||||||
BAlert* alert = new BAlert("", buffer, "Cancel", 0, 0,
|
buffer.ReplaceFirst("%name", addonRef.name);
|
||||||
B_WIDTH_AS_USUAL, B_WARNING_ALERT);
|
|
||||||
|
BAlert* alert = new BAlert("", buffer.String(), B_TRANSLATE("Cancel"),
|
||||||
|
0, 0, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
|
||||||
alert->SetShortcut(0, B_ESCAPE);
|
alert->SetShortcut(0, B_ESCAPE);
|
||||||
alert->Go();
|
alert->Go();
|
||||||
return;
|
return;
|
||||||
@@ -3086,44 +3147,47 @@ BContainerWindow::NewAttributeMenu(BMenu *menu)
|
|||||||
ASSERT(PoseView());
|
ASSERT(PoseView());
|
||||||
|
|
||||||
BMenuItem *item;
|
BMenuItem *item;
|
||||||
menu->AddItem(item = new BMenuItem("Copy layout", new BMessage(kCopyAttributes)));
|
menu->AddItem(item = new BMenuItem(B_TRANSLATE("Copy layout"),
|
||||||
|
new BMessage(kCopyAttributes)));
|
||||||
item->SetTarget(PoseView());
|
item->SetTarget(PoseView());
|
||||||
menu->AddItem(item = new BMenuItem("Paste layout", new BMessage(kPasteAttributes)));
|
menu->AddItem(item = new BMenuItem(B_TRANSLATE("Paste layout"),
|
||||||
|
new BMessage(kPasteAttributes)));
|
||||||
item->SetTarget(PoseView());
|
item->SetTarget(PoseView());
|
||||||
menu->AddSeparatorItem();
|
menu->AddSeparatorItem();
|
||||||
|
|
||||||
menu->AddItem(NewAttributeMenuItem ("Name", kAttrStatName, B_STRING_TYPE,
|
menu->AddItem(NewAttributeMenuItem(B_TRANSLATE("Name"),
|
||||||
145, B_ALIGN_LEFT, true, true));
|
kAttrStatName, B_STRING_TYPE, 145, B_ALIGN_LEFT, true, true));
|
||||||
|
|
||||||
menu->AddItem(NewAttributeMenuItem ("Size", kAttrStatSize, B_OFF_T_TYPE,
|
menu->AddItem(NewAttributeMenuItem (B_TRANSLATE("Size"), kAttrStatSize, B_OFF_T_TYPE,
|
||||||
80, B_ALIGN_RIGHT, false, true));
|
80, B_ALIGN_RIGHT, false, true));
|
||||||
|
|
||||||
menu->AddItem(NewAttributeMenuItem ("Modified", kAttrStatModified, B_TIME_TYPE,
|
menu->AddItem(NewAttributeMenuItem(B_TRANSLATE("Modified"),
|
||||||
150, B_ALIGN_LEFT, false, true));
|
kAttrStatModified, B_TIME_TYPE, 150, B_ALIGN_LEFT, false, true));
|
||||||
|
|
||||||
menu->AddItem(NewAttributeMenuItem ("Created", kAttrStatCreated, B_TIME_TYPE,
|
menu->AddItem(NewAttributeMenuItem(B_TRANSLATE("Created"),
|
||||||
150, B_ALIGN_LEFT, false, true));
|
kAttrStatCreated, B_TIME_TYPE, 150, B_ALIGN_LEFT, false, true));
|
||||||
|
|
||||||
menu->AddItem(NewAttributeMenuItem ("Kind", kAttrMIMEType, B_MIME_STRING_TYPE,
|
menu->AddItem(NewAttributeMenuItem(B_TRANSLATE("Kind"),
|
||||||
145, B_ALIGN_LEFT, false, false));
|
kAttrMIMEType, B_MIME_STRING_TYPE, 145, B_ALIGN_LEFT, false, false));
|
||||||
|
|
||||||
if (IsTrash() || InTrash())
|
if (IsTrash() || InTrash()) {
|
||||||
menu->AddItem(NewAttributeMenuItem ("Original name", kAttrOriginalPath, B_STRING_TYPE,
|
menu->AddItem(NewAttributeMenuItem(B_TRANSLATE("Original name"),
|
||||||
225, B_ALIGN_LEFT, false, false));
|
kAttrOriginalPath, B_STRING_TYPE, 225, B_ALIGN_LEFT, false, false));
|
||||||
else
|
} else {
|
||||||
menu->AddItem(NewAttributeMenuItem ("Location", kAttrPath, B_STRING_TYPE,
|
menu->AddItem(NewAttributeMenuItem(B_TRANSLATE("Location"), kAttrPath,
|
||||||
225, B_ALIGN_LEFT, false, false));
|
B_STRING_TYPE, 225, B_ALIGN_LEFT, false, false));
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef OWNER_GROUP_ATTRIBUTES
|
#ifdef OWNER_GROUP_ATTRIBUTES
|
||||||
menu->AddItem(NewAttributeMenuItem ("Owner", kAttrStatOwner, B_STRING_TYPE,
|
menu->AddItem(NewAttributeMenuItem(B_TRANSLATE("Owner"), kAttrStatOwner,
|
||||||
60, B_ALIGN_LEFT, false, true));
|
B_STRING_TYPE, 60, B_ALIGN_LEFT, false, true));
|
||||||
|
|
||||||
menu->AddItem(NewAttributeMenuItem ("Group", kAttrStatGroup, B_STRING_TYPE,
|
menu->AddItem(NewAttributeMenuItem(B_TRANSLATE("Group"), kAttrStatGroup,
|
||||||
60, B_ALIGN_LEFT, false, true));
|
B_STRING_TYPE, 60, B_ALIGN_LEFT, false, true));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
menu->AddItem(NewAttributeMenuItem ("Permissions", kAttrStatMode, B_STRING_TYPE,
|
menu->AddItem(NewAttributeMenuItem(B_TRANSLATE("Permissions"),
|
||||||
80, B_ALIGN_LEFT, false, true));
|
kAttrStatMode, B_STRING_TYPE, 80, B_ALIGN_LEFT, false, true));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -37,18 +37,24 @@ All rights reserved.
|
|||||||
#include "CountView.h"
|
#include "CountView.h"
|
||||||
|
|
||||||
#include <Application.h>
|
#include <Application.h>
|
||||||
|
#include <Catalog.h>
|
||||||
#include <ControlLook.h>
|
#include <ControlLook.h>
|
||||||
|
#include <Locale.h>
|
||||||
|
|
||||||
#include "AutoLock.h"
|
#include "AutoLock.h"
|
||||||
#include "Bitmaps.h"
|
#include "Bitmaps.h"
|
||||||
#include "ContainerWindow.h"
|
#include "ContainerWindow.h"
|
||||||
#include "DirMenu.h"
|
#include "DirMenu.h"
|
||||||
#include "PoseView.h"
|
#include "PoseView.h"
|
||||||
|
#include "Utilities.h"
|
||||||
|
|
||||||
|
|
||||||
const bigtime_t kBarberPoleDelay = 500000;
|
const bigtime_t kBarberPoleDelay = 500000;
|
||||||
|
|
||||||
|
|
||||||
|
#undef B_TRANSLATE_CONTEXT
|
||||||
|
#define B_TRANSLATE_CONTEXT "libtracker"
|
||||||
|
|
||||||
BCountView::BCountView(BRect bounds, BPoseView* view)
|
BCountView::BCountView(BRect bounds, BPoseView* view)
|
||||||
: BView(bounds, "CountVw", B_FOLLOW_LEFT + B_FOLLOW_BOTTOM,
|
: BView(bounds, "CountVw", B_FOLLOW_LEFT + B_FOLLOW_BOTTOM,
|
||||||
B_PULSE_NEEDED | B_WILL_DRAW),
|
B_PULSE_NEEDED | B_WILL_DRAW),
|
||||||
@@ -217,17 +223,20 @@ BCountView::Draw(BRect updateRect)
|
|||||||
itemString << fLastCount << " " << Filter();
|
itemString << fLastCount << " " << Filter();
|
||||||
} else {
|
} else {
|
||||||
if (fLastCount == 0)
|
if (fLastCount == 0)
|
||||||
itemString << "no items";
|
itemString << B_TRANSLATE("no items");
|
||||||
else if (fLastCount == 1)
|
else if (fLastCount == 1)
|
||||||
itemString << "1 item";
|
itemString << B_TRANSLATE("1 item");
|
||||||
else
|
else {
|
||||||
itemString << fLastCount << " items";
|
itemString.SetTo(B_TRANSLATE("%num items"));
|
||||||
|
char numString[256];
|
||||||
|
snprintf(numString, sizeof(numString), "%ld", fLastCount);
|
||||||
|
itemString.ReplaceFirst("%num", numString);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
BString string(itemString);
|
|
||||||
BRect textRect(TextInvalRect());
|
BRect textRect(TextInvalRect());
|
||||||
|
|
||||||
TruncateString(&string, IsTypingAhead() ? B_TRUNCATE_BEGINNING
|
TruncateString(&itemString, IsTypingAhead() ? B_TRUNCATE_BEGINNING
|
||||||
: IsFiltering() ? B_TRUNCATE_MIDDLE : B_TRUNCATE_END,
|
: IsFiltering() ? B_TRUNCATE_MIDDLE : B_TRUNCATE_END,
|
||||||
textRect.Width());
|
textRect.Width());
|
||||||
|
|
||||||
@@ -238,7 +247,7 @@ BCountView::Draw(BRect updateRect)
|
|||||||
SetHighColor(0, 0, 0);
|
SetHighColor(0, 0, 0);
|
||||||
|
|
||||||
MovePenTo(textRect.LeftBottom());
|
MovePenTo(textRect.LeftBottom());
|
||||||
DrawString(string.String());
|
DrawString(itemString.String());
|
||||||
|
|
||||||
bounds.top++;
|
bounds.top++;
|
||||||
|
|
||||||
|
|||||||
@@ -32,8 +32,10 @@ names are registered trademarks or trademarks of their respective holders.
|
|||||||
All rights reserved.
|
All rights reserved.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <Catalog.h>
|
||||||
#include <Debug.h>
|
#include <Debug.h>
|
||||||
#include <FindDirectory.h>
|
#include <FindDirectory.h>
|
||||||
|
#include <Locale.h>
|
||||||
#include <NodeMonitor.h>
|
#include <NodeMonitor.h>
|
||||||
#include <Path.h>
|
#include <Path.h>
|
||||||
#include <PopUpMenu.h>
|
#include <PopUpMenu.h>
|
||||||
@@ -103,6 +105,8 @@ AddOneShortcut(const Model *model, const char *, uint32 shortcut, bool /*primary
|
|||||||
|
|
||||||
// #pragma mark -
|
// #pragma mark -
|
||||||
|
|
||||||
|
#undef B_TRANSLATE_CONTEXT
|
||||||
|
#define B_TRANSLATE_CONTEXT "libtracker"
|
||||||
|
|
||||||
BDeskWindow::BDeskWindow(LockingList<BWindow> *windowList)
|
BDeskWindow::BDeskWindow(LockingList<BWindow> *windowList)
|
||||||
:
|
:
|
||||||
@@ -266,7 +270,8 @@ BDeskWindow::CreatePoseView(Model *model)
|
|||||||
void
|
void
|
||||||
BDeskWindow::AddWindowContextMenus(BMenu *menu)
|
BDeskWindow::AddWindowContextMenus(BMenu *menu)
|
||||||
{
|
{
|
||||||
TemplatesMenu *tempateMenu = new TemplatesMenu(PoseView());
|
TemplatesMenu* tempateMenu = new TemplatesMenu(PoseView(),
|
||||||
|
B_TRANSLATE("New"));
|
||||||
|
|
||||||
menu->AddItem(tempateMenu);
|
menu->AddItem(tempateMenu);
|
||||||
tempateMenu->SetTargetForItems(PoseView());
|
tempateMenu->SetTargetForItems(PoseView());
|
||||||
@@ -274,32 +279,32 @@ BDeskWindow::AddWindowContextMenus(BMenu *menu)
|
|||||||
|
|
||||||
menu->AddSeparatorItem();
|
menu->AddSeparatorItem();
|
||||||
|
|
||||||
BMenu* iconSizeMenu = new BMenu("Icon view");
|
BMenu* iconSizeMenu = new BMenu(B_TRANSLATE("Icon view"));
|
||||||
|
|
||||||
BMessage* message = new BMessage(kIconMode);
|
BMessage* message = new BMessage(kIconMode);
|
||||||
message->AddInt32("size", 32);
|
message->AddInt32("size", 32);
|
||||||
BMenuItem* item = new BMenuItem("32 x 32", message);
|
BMenuItem* item = new BMenuItem(B_TRANSLATE("32 x 32"), message);
|
||||||
item->SetMarked(PoseView()->IconSizeInt() == 32);
|
item->SetMarked(PoseView()->IconSizeInt() == 32);
|
||||||
item->SetTarget(PoseView());
|
item->SetTarget(PoseView());
|
||||||
iconSizeMenu->AddItem(item);
|
iconSizeMenu->AddItem(item);
|
||||||
|
|
||||||
message = new BMessage(kIconMode);
|
message = new BMessage(kIconMode);
|
||||||
message->AddInt32("size", 40);
|
message->AddInt32("size", 40);
|
||||||
item = new BMenuItem("40 x 40", message);
|
item = new BMenuItem(B_TRANSLATE("40 x 40"), message);
|
||||||
item->SetMarked(PoseView()->IconSizeInt() == 40);
|
item->SetMarked(PoseView()->IconSizeInt() == 40);
|
||||||
item->SetTarget(PoseView());
|
item->SetTarget(PoseView());
|
||||||
iconSizeMenu->AddItem(item);
|
iconSizeMenu->AddItem(item);
|
||||||
|
|
||||||
message = new BMessage(kIconMode);
|
message = new BMessage(kIconMode);
|
||||||
message->AddInt32("size", 48);
|
message->AddInt32("size", 48);
|
||||||
item = new BMenuItem("48 x 48", message);
|
item = new BMenuItem(B_TRANSLATE("48 x 48"), message);
|
||||||
item->SetMarked(PoseView()->IconSizeInt() == 48);
|
item->SetMarked(PoseView()->IconSizeInt() == 48);
|
||||||
item->SetTarget(PoseView());
|
item->SetTarget(PoseView());
|
||||||
iconSizeMenu->AddItem(item);
|
iconSizeMenu->AddItem(item);
|
||||||
|
|
||||||
message = new BMessage(kIconMode);
|
message = new BMessage(kIconMode);
|
||||||
message->AddInt32("size", 64);
|
message->AddInt32("size", 64);
|
||||||
item = new BMenuItem("64 x 64", message);
|
item = new BMenuItem(B_TRANSLATE("64 x 64"), message);
|
||||||
item->SetMarked(PoseView()->IconSizeInt() == 64);
|
item->SetMarked(PoseView()->IconSizeInt() == 64);
|
||||||
item->SetTarget(PoseView());
|
item->SetTarget(PoseView());
|
||||||
iconSizeMenu->AddItem(item);
|
iconSizeMenu->AddItem(item);
|
||||||
@@ -308,13 +313,13 @@ BDeskWindow::AddWindowContextMenus(BMenu *menu)
|
|||||||
|
|
||||||
message = new BMessage(kIconMode);
|
message = new BMessage(kIconMode);
|
||||||
message->AddInt32("scale", 0);
|
message->AddInt32("scale", 0);
|
||||||
item = new BMenuItem("Decrease size", message, '-');
|
item = new BMenuItem(B_TRANSLATE("Decrease size"), message, '-');
|
||||||
item->SetTarget(PoseView());
|
item->SetTarget(PoseView());
|
||||||
iconSizeMenu->AddItem(item);
|
iconSizeMenu->AddItem(item);
|
||||||
|
|
||||||
message = new BMessage(kIconMode);
|
message = new BMessage(kIconMode);
|
||||||
message->AddInt32("scale", 1);
|
message->AddInt32("scale", 1);
|
||||||
item = new BMenuItem("Increase size", message, '+');
|
item = new BMenuItem(B_TRANSLATE("Increase size"), message, '+');
|
||||||
item->SetTarget(PoseView());
|
item->SetTarget(PoseView());
|
||||||
iconSizeMenu->AddItem(item);
|
iconSizeMenu->AddItem(item);
|
||||||
|
|
||||||
@@ -325,27 +330,31 @@ BDeskWindow::AddWindowContextMenus(BMenu *menu)
|
|||||||
iconSizeMenu->Superitem()->SetTarget(PoseView());
|
iconSizeMenu->Superitem()->SetTarget(PoseView());
|
||||||
iconSizeMenu->Superitem()->SetMarked(PoseView()->ViewMode() == kIconMode);
|
iconSizeMenu->Superitem()->SetMarked(PoseView()->ViewMode() == kIconMode);
|
||||||
|
|
||||||
item = new BMenuItem("Mini icon view", new BMessage(kMiniIconMode), '2');
|
item = new BMenuItem(B_TRANSLATE("Mini icon view"),
|
||||||
|
new BMessage(kMiniIconMode), '2');
|
||||||
item->SetMarked(PoseView()->ViewMode() == kMiniIconMode);
|
item->SetMarked(PoseView()->ViewMode() == kMiniIconMode);
|
||||||
menu->AddItem(item);
|
menu->AddItem(item);
|
||||||
|
|
||||||
menu->AddSeparatorItem();
|
menu->AddSeparatorItem();
|
||||||
|
|
||||||
#ifdef CUT_COPY_PASTE_IN_CONTEXT_MENU
|
#ifdef CUT_COPY_PASTE_IN_CONTEXT_MENU
|
||||||
BMenuItem *pasteItem;
|
BMenuItem* pasteItem = new BMenuItem(B_TRANSLATE("Paste"),
|
||||||
menu->AddItem(pasteItem = new BMenuItem("Paste", new BMessage(B_PASTE), 'V'));
|
new BMessage(B_PASTE), 'V'));
|
||||||
|
menu->AddItem(pasteItem);
|
||||||
menu->AddSeparatorItem();
|
menu->AddSeparatorItem();
|
||||||
#endif
|
#endif
|
||||||
menu->AddItem(new BMenuItem("Clean up", new BMessage(kCleanup), 'K'));
|
menu->AddItem(new BMenuItem(B_TRANSLATE("Clean up"), new BMessage(kCleanup),
|
||||||
menu->AddItem(new BMenuItem("Select"B_UTF8_ELLIPSIS,
|
'K'));
|
||||||
|
menu->AddItem(new BMenuItem(B_TRANSLATE("Select"B_UTF8_ELLIPSIS),
|
||||||
new BMessage(kShowSelectionWindow), 'A', B_SHIFT_KEY));
|
new BMessage(kShowSelectionWindow), 'A', B_SHIFT_KEY));
|
||||||
menu->AddItem(new BMenuItem("Select all", new BMessage(B_SELECT_ALL), 'A'));
|
menu->AddItem(new BMenuItem(B_TRANSLATE("Select all"),
|
||||||
|
new BMessage(B_SELECT_ALL), 'A'));
|
||||||
|
|
||||||
menu->AddSeparatorItem();
|
menu->AddSeparatorItem();
|
||||||
menu->AddItem(new MountMenu("Mount"));
|
menu->AddItem(new MountMenu(B_TRANSLATE("Mount")));
|
||||||
|
|
||||||
menu->AddSeparatorItem();
|
menu->AddSeparatorItem();
|
||||||
menu->AddItem(new BMenu(kAddOnsMenuName));
|
menu->AddItem(new BMenu(B_TRANSLATE("Add-ons")));
|
||||||
|
|
||||||
// target items as needed
|
// target items as needed
|
||||||
menu->SetTargetForItems(PoseView());
|
menu->SetTargetForItems(PoseView());
|
||||||
|
|||||||
@@ -35,8 +35,10 @@ All rights reserved.
|
|||||||
// ToDo:
|
// ToDo:
|
||||||
// get rid of fMenuBar, SetMenuBar and related mess
|
// get rid of fMenuBar, SetMenuBar and related mess
|
||||||
|
|
||||||
|
#include <Catalog.h>
|
||||||
#include <Debug.h>
|
#include <Debug.h>
|
||||||
#include <Directory.h>
|
#include <Directory.h>
|
||||||
|
#include <Locale.h>
|
||||||
#include <MenuBar.h>
|
#include <MenuBar.h>
|
||||||
#include <Path.h>
|
#include <Path.h>
|
||||||
#include <Volume.h>
|
#include <Volume.h>
|
||||||
@@ -52,6 +54,9 @@ All rights reserved.
|
|||||||
#include "Utilities.h"
|
#include "Utilities.h"
|
||||||
|
|
||||||
|
|
||||||
|
#undef B_TRANSLATE_CONTEXT
|
||||||
|
#define B_TRANSLATE_CONTEXT "libtracker"
|
||||||
|
|
||||||
BDirMenu::BDirMenu(BMenuBar *bar, uint32 command, const char *entryName)
|
BDirMenu::BDirMenu(BMenuBar *bar, uint32 command, const char *entryName)
|
||||||
: BPopUpMenu("directories"),
|
: BPopUpMenu("directories"),
|
||||||
fMenuBar(bar),
|
fMenuBar(bar),
|
||||||
@@ -249,7 +254,8 @@ BDirMenu::AddDisksIconToMenu(bool atEnd)
|
|||||||
BMessage *message = new BMessage(fCommand);
|
BMessage *message = new BMessage(fCommand);
|
||||||
message->AddRef(fEntryName.String(), model.EntryRef());
|
message->AddRef(fEntryName.String(), model.EntryRef());
|
||||||
|
|
||||||
ModelMenuItem *item = new ModelMenuItem(&model, "Disks", message);
|
ModelMenuItem* item = new ModelMenuItem(&model, B_TRANSLATE("Disks"),
|
||||||
|
message);
|
||||||
if (atEnd)
|
if (atEnd)
|
||||||
AddItem(item);
|
AddItem(item);
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -35,11 +35,14 @@ All rights reserved.
|
|||||||
#include "FSClipboard.h"
|
#include "FSClipboard.h"
|
||||||
#include <Clipboard.h>
|
#include <Clipboard.h>
|
||||||
#include <Alert.h>
|
#include <Alert.h>
|
||||||
|
#include <Catalog.h>
|
||||||
|
#include <Locale.h>
|
||||||
#include <NodeMonitor.h>
|
#include <NodeMonitor.h>
|
||||||
#include "Commands.h"
|
#include "Commands.h"
|
||||||
#include "FSUtils.h"
|
#include "FSUtils.h"
|
||||||
#include "Tracker.h"
|
#include "Tracker.h"
|
||||||
|
|
||||||
|
|
||||||
// prototypes
|
// prototypes
|
||||||
static void MakeNodeFromName(node_ref *node, char *name);
|
static void MakeNodeFromName(node_ref *node, char *name);
|
||||||
static inline void MakeRefName(char *refName, const node_ref *node);
|
static inline void MakeRefName(char *refName, const node_ref *node);
|
||||||
@@ -47,12 +50,6 @@ static inline void MakeModeName(char *modeName, const node_ref *node);
|
|||||||
static inline void MakeModeNameFromRefName(char *modeName, char *refName);
|
static inline void MakeModeNameFromRefName(char *modeName, char *refName);
|
||||||
static inline bool CompareModeAndRefName(const char *modeName, const char *refName);
|
static inline bool CompareModeAndRefName(const char *modeName, const char *refName);
|
||||||
|
|
||||||
|
|
||||||
//these are from PoseView.cpp
|
|
||||||
extern const char *kNoCopyToTrashStr;
|
|
||||||
extern const char *kNoCopyToRootStr;
|
|
||||||
extern const char *kOkToMoveStr;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
static bool
|
static bool
|
||||||
FSClipboardCheckIntegrity()
|
FSClipboardCheckIntegrity()
|
||||||
@@ -111,6 +108,9 @@ CompareModeAndRefName(const char *modeName, const char *refName)
|
|||||||
// #pragma mark -
|
// #pragma mark -
|
||||||
|
|
||||||
|
|
||||||
|
#undef B_TRANSLATE_CONTEXT
|
||||||
|
#define B_TRANSLATE_CONTEXT "libtracker"
|
||||||
|
|
||||||
bool
|
bool
|
||||||
FSClipboardHasRefs()
|
FSClipboardHasRefs()
|
||||||
{
|
{
|
||||||
@@ -468,8 +468,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()) {
|
||||||
BAlert *alert = new BAlert("", kNoCopyToRootStr, "Cancel",
|
BAlert* alert = new BAlert("",
|
||||||
NULL, NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
|
B_TRANSLATE("You must drop items on one of the disk icons "
|
||||||
|
"in the \"Disks\" window."), B_TRANSLATE("Cancel"), NULL, NULL,
|
||||||
|
B_WIDTH_AS_USUAL, B_WARNING_ALERT);
|
||||||
alert->SetShortcut(0, B_ESCAPE);
|
alert->SetShortcut(0, B_ESCAPE);
|
||||||
alert->Go();
|
alert->Go();
|
||||||
okToMove = false;
|
okToMove = false;
|
||||||
@@ -480,8 +482,10 @@ FSClipboardPaste(Model *model, uint32 linksMode)
|
|||||||
|
|
||||||
// can't copy items into the trash
|
// can't copy items into the trash
|
||||||
if (copyList->CountItems() > 0 && model->IsTrash()) {
|
if (copyList->CountItems() > 0 && model->IsTrash()) {
|
||||||
BAlert *alert = new BAlert("", kNoCopyToTrashStr, "Cancel",
|
BAlert* alert = new BAlert("",
|
||||||
NULL, NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
|
B_TRANSLATE("Sorry, you can't copy items to the Trash."),
|
||||||
|
B_TRANSLATE("Cancel"), NULL, NULL, B_WIDTH_AS_USUAL,
|
||||||
|
B_WARNING_ALERT);
|
||||||
alert->SetShortcut(0, B_ESCAPE);
|
alert->SetShortcut(0, B_ESCAPE);
|
||||||
alert->Go();
|
alert->Go();
|
||||||
okToMove = false;
|
okToMove = false;
|
||||||
|
|||||||
+299
-205
@@ -51,10 +51,12 @@ respective holders. All rights reserved.
|
|||||||
|
|
||||||
#include <Alert.h>
|
#include <Alert.h>
|
||||||
#include <Application.h>
|
#include <Application.h>
|
||||||
|
#include <Catalog.h>
|
||||||
#include <Debug.h>
|
#include <Debug.h>
|
||||||
#include <Directory.h>
|
#include <Directory.h>
|
||||||
#include <Entry.h>
|
#include <Entry.h>
|
||||||
#include <FindDirectory.h>
|
#include <FindDirectory.h>
|
||||||
|
#include <Locale.h>
|
||||||
#include <NodeInfo.h>
|
#include <NodeInfo.h>
|
||||||
#include <Path.h>
|
#include <Path.h>
|
||||||
#include <Roster.h>
|
#include <Roster.h>
|
||||||
@@ -99,6 +101,9 @@ enum ConflictCheckResult {
|
|||||||
|
|
||||||
namespace BPrivate {
|
namespace BPrivate {
|
||||||
|
|
||||||
|
#undef B_TRANSLATE_CONTEXT
|
||||||
|
#define B_TRANSLATE_CONTEXT "libtracker"
|
||||||
|
|
||||||
static status_t FSDeleteFolder(BEntry *, CopyLoopControl *, bool updateStatus,
|
static status_t FSDeleteFolder(BEntry *, CopyLoopControl *, bool updateStatus,
|
||||||
bool deleteTopDir = true, bool upateFileNameInStatus = false);
|
bool deleteTopDir = true, bool upateFileNameInStatus = false);
|
||||||
static status_t MoveEntryToTrash(BEntry *, BPoint *, Undo &undo);
|
static status_t MoveEntryToTrash(BEntry *, BPoint *, Undo &undo);
|
||||||
@@ -137,40 +142,54 @@ status_t empty_trash(void *);
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
const char *kDeleteConfirmationStr = "Are you sure you want to delete the "
|
static const char* kDeleteConfirmationStr =
|
||||||
"selected item(s)? This operation cannot be reverted.";
|
B_TRANSLATE_MARK("Are you sure you want to delete the "
|
||||||
|
"selected item(s)? This operation cannot be reverted.");
|
||||||
|
|
||||||
const char *kReplaceStr = "You are trying to replace the item:\n"
|
static const char* kReplaceStr =
|
||||||
"\t%s%s\n"
|
B_TRANSLATE_MARK("You are trying to replace the item:\n"
|
||||||
|
"\t%name%dest\n"
|
||||||
"with:\n"
|
"with:\n"
|
||||||
"\t%s%s\n\n"
|
"\t%name%src\n\n"
|
||||||
"Would you like to replace it with the one you are %s?";
|
"Would you like to replace it with the one you are %movemode?");
|
||||||
|
|
||||||
const char *kDirectoryReplaceStr = "An item named \"%s\" already exists in "
|
static const char* kDirectoryReplaceStr =
|
||||||
|
B_TRANSLATE_MARK("An item named \"%name\" already exists in "
|
||||||
"this folder, and may contain\nitems with the same names. Would you like "
|
"this folder, and may contain\nitems with the same names. Would you like "
|
||||||
"to replace them with those contained in the folder you are %s?";
|
"to replace them with those contained in the folder you are %verb?");
|
||||||
|
|
||||||
const char *kSymLinkReplaceStr = "An item named \"%s\" already exists in this "
|
static const char* kSymLinkReplaceStr =
|
||||||
|
B_TRANSLATE_MARK("An item named \"%name\" already exists in this "
|
||||||
"folder. Would you like to replace it with the symbolic link you are "
|
"folder. Would you like to replace it with the symbolic link you are "
|
||||||
"creating?";
|
"creating?");
|
||||||
|
|
||||||
const char *kNoFreeSpace = "Sorry, there is not enough free space on the "
|
static const char* kNoFreeSpace =
|
||||||
"destination volume to copy the selection.";
|
B_TRANSLATE_MARK("Sorry, there is not enough free space on the "
|
||||||
|
"destination volume to copy the selection.");
|
||||||
|
|
||||||
const char *kFileErrorString = "Error copying file \"%s\":\n\t%s\n\nWould "
|
static const char* kFileErrorString =
|
||||||
"you like to continue?";
|
B_TRANSLATE_MARK("Error copying file \"%name\":\n\t%error\n\n"
|
||||||
const char *kFolderErrorString = "Error copying folder \"%s\":\n\t%s\n\nWould "
|
"Would you like to continue?");
|
||||||
"you like to continue?";
|
|
||||||
const char *kFileDeleteErrorString = "There was an error deleting \"%s\""
|
|
||||||
":\n\t%s";
|
|
||||||
const char *kReplaceManyStr = "Some items already exist in this folder with "
|
|
||||||
"the same names as the items you are %s.\n \nWould you like to replace "
|
|
||||||
"them with the ones you are %s or be prompted for each one?";
|
|
||||||
|
|
||||||
const char *kFindAlternativeStr = "Would you like to find some other suitable "
|
static const char* kFolderErrorString =
|
||||||
"application?";
|
B_TRANSLATE_MARK("Error copying folder \"%name\":\n\t%error\n\n"
|
||||||
const char *kFindApplicationStr = "Would you like to find a suitable "
|
"Would you like to continue?");
|
||||||
"application to open the file?";
|
|
||||||
|
static const char* kFileDeleteErrorString =
|
||||||
|
B_TRANSLATE_MARK("There was an error deleting \"%name\""
|
||||||
|
":\n\t%error");
|
||||||
|
|
||||||
|
static const char* kReplaceManyStr =
|
||||||
|
B_TRANSLATE_MARK("Some items already exist in this folder with "
|
||||||
|
"the same names as the items you are %verb.\n \nWould you like to replace "
|
||||||
|
"them with the ones you are %verb or be prompted for each one?");
|
||||||
|
|
||||||
|
static const char* kFindAlternativeStr =
|
||||||
|
B_TRANSLATE_MARK("Would you like to find some other suitable application?");
|
||||||
|
|
||||||
|
static const char *kFindApplicationStr =
|
||||||
|
B_TRANSLATE_MARK("Would you like to find a suitable application "
|
||||||
|
"to open the file?");
|
||||||
|
|
||||||
// Skip these attributes when copying in Tracker
|
// Skip these attributes when copying in Tracker
|
||||||
const char *kSkipAttributes[] = {
|
const char *kSkipAttributes[] = {
|
||||||
@@ -326,17 +345,18 @@ bool
|
|||||||
TrackerCopyLoopControl::FileError(const char *message, const char *name,
|
TrackerCopyLoopControl::FileError(const char *message, const char *name,
|
||||||
status_t error, bool allowContinue)
|
status_t error, bool allowContinue)
|
||||||
{
|
{
|
||||||
char buffer[512];
|
BString buffer(message);
|
||||||
sprintf(buffer, message, name, strerror(error));
|
buffer.ReplaceFirst("%name", name);
|
||||||
|
buffer.ReplaceFirst("%error", strerror(error));
|
||||||
|
|
||||||
if (allowContinue) {
|
if (allowContinue) {
|
||||||
BAlert *alert = new BAlert("", buffer, "Cancel", "OK", 0,
|
BAlert* alert = new BAlert("", buffer.String(), B_TRANSLATE("Cancel"),
|
||||||
B_WIDTH_AS_USUAL, B_STOP_ALERT);
|
B_TRANSLATE("OK"), 0, B_WIDTH_AS_USUAL, B_STOP_ALERT);
|
||||||
alert->SetShortcut(0, B_ESCAPE);
|
alert->SetShortcut(0, B_ESCAPE);
|
||||||
return alert->Go() != 0;
|
return alert->Go() != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
BAlert *alert = new BAlert("", buffer, "Cancel", 0, 0,
|
BAlert* alert = new BAlert("", buffer.String(), B_TRANSLATE("Cancel"), 0, 0,
|
||||||
B_WIDTH_AS_USUAL, B_STOP_ALERT);
|
B_WIDTH_AS_USUAL, B_STOP_ALERT);
|
||||||
alert->SetShortcut(0, B_ESCAPE);
|
alert->SetShortcut(0, B_ESCAPE);
|
||||||
alert->Go();
|
alert->Go();
|
||||||
@@ -608,18 +628,20 @@ ConfirmChangeIfWellKnownDirectory(const BEntry *entry, const char *action,
|
|||||||
// quick way out
|
// quick way out
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
const char *warning = NULL;
|
BString warning;
|
||||||
bool requireOverride = true;
|
bool requireOverride = true;
|
||||||
|
|
||||||
if (DirectoryMatchesOrContains(entry, B_BEOS_DIRECTORY)) {
|
if (DirectoryMatchesOrContains(entry, B_BEOS_DIRECTORY)) {
|
||||||
warning = "If you %s the system folder or its contents, you "
|
warning.SetTo(
|
||||||
|
B_TRANSLATE("If you %action the system folder or its contents, you "
|
||||||
"won't be able to boot " OS_NAME "! Are you sure you want to do "
|
"won't be able to boot " OS_NAME "! Are you sure you want to do "
|
||||||
"this? To %s the system folder or its contents anyway, hold down "
|
"this? To %action the system folder or its contents anyway, hold down "
|
||||||
"the Shift key and click \"Do it\".";
|
"the Shift key and click \"Do it\"."));
|
||||||
} else if (DirectoryMatches(entry, B_USER_DIRECTORY)) {
|
} else if (DirectoryMatches(entry, B_USER_DIRECTORY)) {
|
||||||
warning = "If you %s the home folder, " OS_NAME " may not "
|
warning .SetTo(
|
||||||
|
B_TRANSLATE("If you %action the home folder, " OS_NAME " may not "
|
||||||
"behave properly! Are you sure you want to do this? "
|
"behave properly! Are you sure you want to do this? "
|
||||||
"To %s the home anyway, click \"Do it\".";
|
"To %action the home anyway, click \"Do it\"."));
|
||||||
requireOverride = false;
|
requireOverride = false;
|
||||||
} else if (DirectoryMatchesOrContains(entry, B_USER_CONFIG_DIRECTORY)
|
} else if (DirectoryMatchesOrContains(entry, B_USER_CONFIG_DIRECTORY)
|
||||||
|| DirectoryMatchesOrContains(entry, B_COMMON_SETTINGS_DIRECTORY)) {
|
|| DirectoryMatchesOrContains(entry, B_COMMON_SETTINGS_DIRECTORY)) {
|
||||||
@@ -628,25 +650,28 @@ ConfirmChangeIfWellKnownDirectory(const BEntry *entry, const char *action,
|
|||||||
B_USER_SETTINGS_DIRECTORY)
|
B_USER_SETTINGS_DIRECTORY)
|
||||||
|| DirectoryMatchesOrContains(entry, "beos_mime",
|
|| DirectoryMatchesOrContains(entry, "beos_mime",
|
||||||
B_COMMON_SETTINGS_DIRECTORY)) {
|
B_COMMON_SETTINGS_DIRECTORY)) {
|
||||||
warning = "If you %s the mime settings, " OS_NAME " may not "
|
warning.SetTo(
|
||||||
"behave properly! Are you sure you want to do this? "
|
B_TRANSLATE("If you %action the mime settings, " OS_NAME
|
||||||
"To %s the mime settings anyway, click \"Do it\".";
|
" may not behave properly! Are you sure you want to do this? "
|
||||||
|
"To %action the mime settings anyway, click \"Do it\"."));
|
||||||
requireOverride = false;
|
requireOverride = false;
|
||||||
} else if (DirectoryMatches(entry, B_USER_CONFIG_DIRECTORY)) {
|
} else if (DirectoryMatches(entry, B_USER_CONFIG_DIRECTORY)) {
|
||||||
warning = "If you %s the config folder, " OS_NAME " may not "
|
warning.SetTo(
|
||||||
"behave properly! Are you sure you want to do this? "
|
B_TRANSLATE("If you %action the config folder, " OS_NAME
|
||||||
"To %s the config folder anyway, click \"Do it\".";
|
" may not behave properly! Are you sure you want to do this? "
|
||||||
|
"To %action the config folder anyway, click \"Do it\"."));
|
||||||
requireOverride = false;
|
requireOverride = false;
|
||||||
} else if (DirectoryMatches(entry, B_USER_SETTINGS_DIRECTORY)
|
} else if (DirectoryMatches(entry, B_USER_SETTINGS_DIRECTORY)
|
||||||
|| DirectoryMatches(entry, B_COMMON_SETTINGS_DIRECTORY)) {
|
|| DirectoryMatches(entry, B_COMMON_SETTINGS_DIRECTORY)) {
|
||||||
warning = "If you %s the settings folder, " OS_NAME " may not "
|
warning.SetTo(
|
||||||
"behave properly! Are you sure you want to do this? "
|
B_TRANSLATE("If you %action the settings folder, " OS_NAME
|
||||||
"To %s the settings folder anyway, click \"Do it\".";
|
" may not behave properly! Are you sure you want to do this? "
|
||||||
|
"To %action the settings folder anyway, click \"Do it\"."));
|
||||||
requireOverride = false;
|
requireOverride = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!warning)
|
if (!warning.Length())
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (dontAsk)
|
if (dontAsk)
|
||||||
@@ -657,13 +682,11 @@ ConfirmChangeIfWellKnownDirectory(const BEntry *entry, const char *action,
|
|||||||
// we already warned about moving home this time around
|
// we already warned about moving home this time around
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
char buffer[256];
|
warning.ReplaceAll("%action", action);
|
||||||
sprintf(buffer, warning, action, action);
|
|
||||||
|
|
||||||
if ((new OverrideAlert("", buffer, "Do it", (requireOverride
|
if ((new OverrideAlert("", warning.String(), B_TRANSLATE("Do it"),
|
||||||
? B_SHIFT_KEY : 0),
|
(requireOverride ? B_SHIFT_KEY : 0), B_TRANSLATE("Cancel"), 0, NULL,
|
||||||
"Cancel", 0, NULL, 0, B_WIDTH_AS_USUAL,
|
0, B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go() == 1) {
|
||||||
B_WARNING_ALERT))->Go() == 1) {
|
|
||||||
if (confirmedAlready)
|
if (confirmedAlready)
|
||||||
*confirmedAlready = kNotConfirmed;
|
*confirmedAlready = kNotConfirmed;
|
||||||
return false;
|
return false;
|
||||||
@@ -687,9 +710,9 @@ InitCopy(CopyLoopControl* loopControl, uint32 moveMode,
|
|||||||
int32 *collisionCount, ConflictCheckResult *preflightResult)
|
int32 *collisionCount, ConflictCheckResult *preflightResult)
|
||||||
{
|
{
|
||||||
if (dstVol->IsReadOnly()) {
|
if (dstVol->IsReadOnly()) {
|
||||||
BAlert *alert = new BAlert("",
|
BAlert* alert = new BAlert("",
|
||||||
"You can't move or copy items to read-only volumes.",
|
B_TRANSLATE("You can't move or copy items to read-only volumes."),
|
||||||
"Cancel", 0, 0, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
|
B_TRANSLATE("Cancel"), 0, 0, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
|
||||||
alert->SetShortcut(0, B_ESCAPE);
|
alert->SetShortcut(0, B_ESCAPE);
|
||||||
alert->Go();
|
alert->Go();
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
@@ -702,21 +725,25 @@ InitCopy(CopyLoopControl* loopControl, uint32 moveMode,
|
|||||||
// the copy loops, except it takes forever to call CalcItemsAndSize
|
// the copy loops, except it takes forever to call CalcItemsAndSize
|
||||||
BEntry entry((entry_ref *)srcList->ItemAt(index));
|
BEntry entry((entry_ref *)srcList->ItemAt(index));
|
||||||
if (IsDisksWindowIcon(&entry)) {
|
if (IsDisksWindowIcon(&entry)) {
|
||||||
const char *errorStr;
|
BString errorStr;
|
||||||
if (moveMode == kCreateLink)
|
if (moveMode == kCreateLink) {
|
||||||
errorStr = "You cannot create a link to the root directory.";
|
errorStr.SetTo(
|
||||||
else
|
B_TRANSLATE("You cannot create a link to the root "
|
||||||
errorStr = "You cannot copy or move the root directory.";
|
"directory."));
|
||||||
|
} else {
|
||||||
|
errorStr.SetTo(
|
||||||
|
B_TRANSLATE("You cannot copy or move the root directory."));
|
||||||
|
}
|
||||||
|
|
||||||
BAlert *alert = new BAlert("", errorStr, "Cancel", 0, 0,
|
BAlert* alert = new BAlert("", errorStr.String(),
|
||||||
B_WIDTH_AS_USUAL, B_WARNING_ALERT);
|
B_TRANSLATE("Cancel"), 0, 0, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
|
||||||
alert->SetShortcut(0, B_ESCAPE);
|
alert->SetShortcut(0, B_ESCAPE);
|
||||||
alert->Go();
|
alert->Go();
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
}
|
}
|
||||||
if (moveMode == kMoveSelectionTo
|
if (moveMode == kMoveSelectionTo
|
||||||
&& !ConfirmChangeIfWellKnownDirectory(&entry, "move", false,
|
&& !ConfirmChangeIfWellKnownDirectory(&entry, B_TRANSLATE("move"),
|
||||||
&askOnceOnly)) {
|
false, &askOnceOnly)) {
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -753,7 +780,8 @@ InitCopy(CopyLoopControl* loopControl, uint32 moveMode,
|
|||||||
|
|
||||||
// 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()) {
|
||||||
BAlert *alert = new BAlert("", kNoFreeSpace, "Cancel",
|
BAlert* alert = new BAlert("",
|
||||||
|
B_TRANSLATE(kNoFreeSpace), B_TRANSLATE("Cancel"),
|
||||||
0, 0, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
|
0, 0, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
|
||||||
alert->SetShortcut(0, B_ESCAPE);
|
alert->SetShortcut(0, B_ESCAPE);
|
||||||
alert->Go();
|
alert->Go();
|
||||||
@@ -923,10 +951,11 @@ MoveTask(BObjectList<entry_ref> *srcList, BEntry *destEntry, BList *pointList,
|
|||||||
|
|
||||||
BEntry sourceEntry(srcRef);
|
BEntry sourceEntry(srcRef);
|
||||||
if (sourceEntry.InitCheck() != B_OK) {
|
if (sourceEntry.InitCheck() != B_OK) {
|
||||||
BString error;
|
BString error(B_TRANSLATE("Error moving \"%name\"."));
|
||||||
error << "Error moving \"" << srcRef->name << "\".";
|
error.ReplaceFirst("%name", srcRef->name);
|
||||||
BAlert *alert = new BAlert("", error.String(), "Cancel", 0, 0,
|
BAlert* alert = new BAlert("", error.String(),
|
||||||
B_WIDTH_AS_USUAL, B_WARNING_ALERT);
|
B_TRANSLATE("Cancel"), 0, 0, B_WIDTH_AS_USUAL,
|
||||||
|
B_WARNING_ALERT);
|
||||||
alert->SetShortcut(0, B_ESCAPE);
|
alert->SetShortcut(0, B_ESCAPE);
|
||||||
alert->Go();
|
alert->Go();
|
||||||
break;
|
break;
|
||||||
@@ -939,11 +968,12 @@ MoveTask(BObjectList<entry_ref> *srcList, BEntry *destEntry, BList *pointList,
|
|||||||
|
|
||||||
result = MoveEntryToTrash(&sourceEntry, loc, undo);
|
result = MoveEntryToTrash(&sourceEntry, loc, undo);
|
||||||
if (result != B_OK) {
|
if (result != B_OK) {
|
||||||
BString error;
|
BString error(B_TRANSLATE("Error moving \"%name\" to Trash. (%error)"));
|
||||||
error << "Error moving \"" << srcRef->name
|
error.ReplaceFirst("%name", srcRef->name);
|
||||||
<< "\" to Trash. (" << strerror(result) << ")";
|
error.ReplaceFirst("%error", strerror(result));
|
||||||
BAlert *alert = new BAlert("", error.String(), "Cancel",
|
BAlert* alert = new BAlert("", error.String(),
|
||||||
0, 0, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
|
B_TRANSLATE("Cancel"), 0, 0, B_WIDTH_AS_USUAL,
|
||||||
|
B_WARNING_ALERT);
|
||||||
alert->SetShortcut(0, B_ESCAPE);
|
alert->SetShortcut(0, B_ESCAPE);
|
||||||
alert->Go();
|
alert->Go();
|
||||||
break;
|
break;
|
||||||
@@ -1054,7 +1084,8 @@ CopyFile(BEntry *srcFile, StatStruct *srcStat, BDirectory *destDir,
|
|||||||
|
|
||||||
// check for free space first
|
// check for free space first
|
||||||
if ((srcStat->st_size + kKBSize) >= volume.FreeBytes()) {
|
if ((srcStat->st_size + kKBSize) >= volume.FreeBytes()) {
|
||||||
loopControl->FileError(kNoFreeSpace, "", B_DEVICE_FULL, false);
|
loopControl->FileError(B_TRANSLATE(kNoFreeSpace), "", B_DEVICE_FULL,
|
||||||
|
false);
|
||||||
throw (status_t)B_DEVICE_FULL;
|
throw (status_t)B_DEVICE_FULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1066,7 +1097,9 @@ CopyFile(BEntry *srcFile, StatStruct *srcStat, BDirectory *destDir,
|
|||||||
loopControl->UpdateStatus(destName, ref, 1024, true);
|
loopControl->UpdateStatus(destName, ref, 1024, true);
|
||||||
|
|
||||||
if (makeOriginalName) {
|
if (makeOriginalName) {
|
||||||
FSMakeOriginalName(destName, destDir, " copy");
|
BString suffix(" ");
|
||||||
|
suffix << B_TRANSLATE_COMMENT("copy", "filename copy"),
|
||||||
|
FSMakeOriginalName(destName, destDir, suffix.String());
|
||||||
undo.UpdateEntry(srcFile, destName);
|
undo.UpdateEntry(srcFile, destName);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1098,8 +1131,8 @@ CopyFile(BEntry *srcFile, StatStruct *srcStat, BDirectory *destDir,
|
|||||||
throw (status_t)err;
|
throw (status_t)err;
|
||||||
|
|
||||||
if (err != B_OK) {
|
if (err != B_OK) {
|
||||||
if (!loopControl->FileError(kFileErrorString, destName, err,
|
if (!loopControl->FileError(B_TRANSLATE(kFileErrorString), destName,
|
||||||
true)) {
|
err, true)) {
|
||||||
throw (status_t)err;
|
throw (status_t)err;
|
||||||
} else {
|
} else {
|
||||||
// user selected continue in spite of error, update status bar
|
// user selected continue in spite of error, update status bar
|
||||||
@@ -1371,7 +1404,9 @@ CopyFolder(BEntry *srcEntry, BDirectory *destDir, CopyLoopControl *loopControl,
|
|||||||
loopControl->UpdateStatus(ref.name, ref, 1024, true);
|
loopControl->UpdateStatus(ref.name, ref, 1024, true);
|
||||||
|
|
||||||
if (makeOriginalName) {
|
if (makeOriginalName) {
|
||||||
FSMakeOriginalName(destName, destDir, " copy");
|
BString suffix(" ");
|
||||||
|
suffix << B_TRANSLATE_COMMENT("copy", "filename copy"),
|
||||||
|
FSMakeOriginalName(destName, destDir, suffix.String());
|
||||||
undo.UpdateEntry(srcEntry, destName);
|
undo.UpdateEntry(srcEntry, destName);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1418,8 +1453,8 @@ CopyFolder(BEntry *srcEntry, BDirectory *destDir, CopyLoopControl *loopControl,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (err != B_OK) {
|
if (err != B_OK) {
|
||||||
if (!loopControl->FileError(kFolderErrorString, destName, err,
|
if (!loopControl->FileError(B_TRANSLATE(kFolderErrorString),
|
||||||
true)) {
|
destName, err, true)) {
|
||||||
throw err;
|
throw err;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1536,7 +1571,9 @@ MoveItem(BEntry *entry, BDirectory *destDir, BPoint *loc, uint32 moveMode,
|
|||||||
strcpy(name, ref.name);
|
strcpy(name, ref.name);
|
||||||
|
|
||||||
BSymLink link;
|
BSymLink link;
|
||||||
FSMakeOriginalName(name, destDir, " link");
|
BString suffix(" ");
|
||||||
|
suffix << B_TRANSLATE_COMMENT("link", "filename link"),
|
||||||
|
FSMakeOriginalName(name, destDir, suffix.String());
|
||||||
undo.UpdateEntry(entry, name);
|
undo.UpdateEntry(entry, name);
|
||||||
|
|
||||||
BPath path;
|
BPath path;
|
||||||
@@ -1616,11 +1653,13 @@ MoveItem(BEntry *entry, BDirectory *destDir, BPoint *loc, uint32 moveMode,
|
|||||||
err = destDir->CreateSymLink(name, path.Path(), &link);
|
err = destDir->CreateSymLink(name, path.Path(), &link);
|
||||||
|
|
||||||
if (err == B_UNSUPPORTED) {
|
if (err == B_UNSUPPORTED) {
|
||||||
throw FailWithAlert(err, "The target disk does not support "
|
throw FailWithAlert(err,
|
||||||
"creating links.", NULL);
|
B_TRANSLATE("The target disk does not support "
|
||||||
|
"creating links."), NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
FailWithAlert::FailOnError(err, "Error creating link to \"%s\".",
|
FailWithAlert::FailOnError(err,
|
||||||
|
B_TRANSLATE("Error creating link to \"%name\"."),
|
||||||
ref.name);
|
ref.name);
|
||||||
|
|
||||||
if (loc && loc != (BPoint *)-1) {
|
if (loc && loc != (BPoint *)-1) {
|
||||||
@@ -1659,19 +1698,19 @@ MoveItem(BEntry *entry, BDirectory *destDir, BPoint *loc, uint32 moveMode,
|
|||||||
// no alert, was already taken care of before
|
// no alert, was already taken care of before
|
||||||
return error;
|
return error;
|
||||||
} catch (MoveError error) {
|
} catch (MoveError error) {
|
||||||
BString errorString;
|
BString errorString(B_TRANSLATE("Error moving \"%name\""));
|
||||||
errorString << "Error moving \"" << ref.name << '"';
|
errorString.ReplaceFirst("%name", ref.name);
|
||||||
(new BAlert("", errorString.String(), "OK", 0, 0, B_WIDTH_AS_USUAL,
|
(new BAlert("", errorString.String(), B_TRANSLATE("OK"), 0, 0,
|
||||||
B_WARNING_ALERT))->Go();
|
B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go();
|
||||||
return error.fError;
|
return error.fError;
|
||||||
} catch (FailWithAlert error) {
|
} catch (FailWithAlert error) {
|
||||||
char buffer[256];
|
BString buffer(error.fString);
|
||||||
if (error.fName)
|
if (error.fName)
|
||||||
sprintf(buffer, error.fString, error.fName);
|
buffer.ReplaceFirst("%name", error.fName);
|
||||||
else
|
else
|
||||||
strcpy(buffer, error.fString);
|
buffer << error.fString;
|
||||||
(new BAlert("", buffer, "OK", 0, 0, B_WIDTH_AS_USUAL,
|
(new BAlert("", buffer.String(), B_TRANSLATE("OK"), 0, 0,
|
||||||
B_WARNING_ALERT))->Go();
|
B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go();
|
||||||
|
|
||||||
return error.fError;
|
return error.fError;
|
||||||
}
|
}
|
||||||
@@ -1803,11 +1842,11 @@ MoveEntryToTrash(BEntry *entry, BPoint *loc, Undo &undo)
|
|||||||
if (volume == boot) {
|
if (volume == boot) {
|
||||||
char name[B_FILE_NAME_LENGTH];
|
char name[B_FILE_NAME_LENGTH];
|
||||||
volume.GetName(name);
|
volume.GetName(name);
|
||||||
char buffer[256];
|
BString buffer(B_TRANSLATE("Cannot unmount the boot volume \"%name\"."));
|
||||||
sprintf(buffer, "Cannot unmount the boot volume \"%s\".",
|
buffer.ReplaceFirst("%name", name);
|
||||||
name);
|
BAlert* alert = new BAlert("", buffer.String(),
|
||||||
BAlert *alert = new BAlert("", buffer, "Cancel", 0, 0,
|
B_TRANSLATE("Cancel"), 0, 0, B_WIDTH_AS_USUAL,
|
||||||
B_WIDTH_AS_USUAL, B_WARNING_ALERT);
|
B_WARNING_ALERT);
|
||||||
alert->SetShortcut(0, B_ESCAPE);
|
alert->SetShortcut(0, B_ESCAPE);
|
||||||
alert->Go();
|
alert->Go();
|
||||||
} else {
|
} else {
|
||||||
@@ -1828,9 +1867,11 @@ MoveEntryToTrash(BEntry *entry, BPoint *loc, Undo &undo)
|
|||||||
trash_dir.GetEntry(&trashEntry);
|
trash_dir.GetEntry(&trashEntry);
|
||||||
|
|
||||||
if (dir == trash_dir || dir.Contains(&trashEntry)) {
|
if (dir == trash_dir || dir.Contains(&trashEntry)) {
|
||||||
(new BAlert("", "You cannot put the Trash, home or Desktop "
|
(new BAlert("",
|
||||||
"directory into the trash.", "OK", 0, 0,
|
B_TRANSLATE("You cannot put the Trash, home or Desktop "
|
||||||
B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go();
|
"directory into the trash."),
|
||||||
|
B_TRANSLATE("OK"),
|
||||||
|
0, 0, B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go();
|
||||||
|
|
||||||
// return no error so we don't get two dialogs
|
// return no error so we don't get two dialogs
|
||||||
return B_OK;
|
return B_OK;
|
||||||
@@ -1854,7 +1895,9 @@ MoveEntryToTrash(BEntry *entry, BPoint *loc, Undo &undo)
|
|||||||
char name[B_FILE_NAME_LENGTH];
|
char name[B_FILE_NAME_LENGTH];
|
||||||
strcpy(name, ref.name);
|
strcpy(name, ref.name);
|
||||||
if (trash_dir.Contains(name)) {
|
if (trash_dir.Contains(name)) {
|
||||||
FSMakeOriginalName(name, &trash_dir, " copy");
|
BString suffix(" ");
|
||||||
|
suffix << B_TRANSLATE_COMMENT("copy", "filename copy"),
|
||||||
|
FSMakeOriginalName(name, &trash_dir, suffix.String());
|
||||||
undo.UpdateEntry(entry, name);
|
undo.UpdateEntry(entry, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1911,13 +1954,14 @@ PreFlightNameCheck(BObjectList<entry_ref> *srcList, const BDirectory *destDir,
|
|||||||
// prompt user only if there is more than one collision, otherwise the
|
// prompt user only if there is more than one collision, otherwise the
|
||||||
// single collision case will be handled as a "Prompt" case by CheckName
|
// single collision case will be handled as a "Prompt" case by CheckName
|
||||||
if (*collisionCount > 1) {
|
if (*collisionCount > 1) {
|
||||||
const char *verb = (moveMode == kMoveSelectionTo) ? "moving"
|
const char* verb = (moveMode == kMoveSelectionTo)
|
||||||
: "copying";
|
? B_TRANSLATE("moving") : B_TRANSLATE("copying");
|
||||||
char replaceMsg[256];
|
BString replaceMsg(B_TRANSLATE(kReplaceManyStr));
|
||||||
sprintf(replaceMsg, kReplaceManyStr, verb, verb);
|
replaceMsg.ReplaceAll("%verb", verb);
|
||||||
|
|
||||||
BAlert *alert = new BAlert("", replaceMsg,
|
BAlert* alert = new BAlert("", replaceMsg.String(),
|
||||||
"Cancel", "Prompt", "Replace all");
|
B_TRANSLATE("Cancel"), B_TRANSLATE("Prompt"),
|
||||||
|
B_TRANSLATE("Replace all"));
|
||||||
alert->SetShortcut(0, B_ESCAPE);
|
alert->SetShortcut(0, B_ESCAPE);
|
||||||
switch (alert->Go()) {
|
switch (alert->Go()) {
|
||||||
case 0:
|
case 0:
|
||||||
@@ -1974,17 +2018,19 @@ CheckName(uint32 moveMode, const BEntry *sourceEntry,
|
|||||||
&& moveMode != kCreateRelativeLink
|
&& moveMode != kCreateRelativeLink
|
||||||
&& (srcDirectory == *destDir
|
&& (srcDirectory == *destDir
|
||||||
|| srcDirectory.Contains(&destEntry))) {
|
|| srcDirectory.Contains(&destEntry))) {
|
||||||
(new BAlert("", "You can't move a folder into itself "
|
(new BAlert("",
|
||||||
"or any of its own sub-folders.", "OK", 0, 0,
|
B_TRANSLATE("You can't move a folder into itself "
|
||||||
B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go();
|
"or any of its own sub-folders."), B_TRANSLATE("OK"),
|
||||||
|
0, 0, B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go();
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (FSIsTrashDir(sourceEntry) && moveMode != kCreateLink
|
if (FSIsTrashDir(sourceEntry) && moveMode != kCreateLink
|
||||||
&& moveMode != kCreateRelativeLink) {
|
&& moveMode != kCreateRelativeLink) {
|
||||||
(new BAlert("", "You can't move or copy the trash.",
|
(new BAlert("",
|
||||||
"OK", 0, 0, B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go();
|
B_TRANSLATE("You can't move or copy the trash."),
|
||||||
|
B_TRANSLATE("OK"), 0, 0, B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go();
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2007,9 +2053,11 @@ CheckName(uint32 moveMode, const BEntry *sourceEntry,
|
|||||||
if (destIsDir) {
|
if (destIsDir) {
|
||||||
BDirectory test_dir(&entry);
|
BDirectory test_dir(&entry);
|
||||||
if (test_dir.Contains(sourceEntry)) {
|
if (test_dir.Contains(sourceEntry)) {
|
||||||
(new BAlert("", "You can't replace a folder "
|
(new BAlert("",
|
||||||
"with one of its sub-folders.", "OK", 0, 0,
|
B_TRANSLATE("You can't replace a folder "
|
||||||
B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go();
|
"with one of its sub-folders."),
|
||||||
|
B_TRANSLATE("OK"),
|
||||||
|
0, 0, B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go();
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2019,10 +2067,10 @@ CheckName(uint32 moveMode, const BEntry *sourceEntry,
|
|||||||
&& moveMode != kCreateRelativeLink
|
&& moveMode != kCreateRelativeLink
|
||||||
&& destIsDir != sourceIsDirectory) {
|
&& destIsDir != sourceIsDirectory) {
|
||||||
(new BAlert("", sourceIsDirectory
|
(new BAlert("", sourceIsDirectory
|
||||||
? "You cannot replace a file with a folder or a symbolic "
|
? B_TRANSLATE("You cannot replace a file with a folder or a "
|
||||||
"link."
|
"symbolic link.")
|
||||||
: "You cannot replace a folder or a symbolic link with a "
|
: B_TRANSLATE("You cannot replace a folder or a symbolic link "
|
||||||
"file.", "OK", 0, 0, B_WIDTH_AS_USUAL,
|
"with a file."), B_TRANSLATE("OK"), 0, 0, B_WIDTH_AS_USUAL,
|
||||||
B_WARNING_ALERT))->Go();
|
B_WARNING_ALERT))->Go();
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
}
|
}
|
||||||
@@ -2030,14 +2078,19 @@ CheckName(uint32 moveMode, const BEntry *sourceEntry,
|
|||||||
if (replaceAll != kReplaceAll) {
|
if (replaceAll != kReplaceAll) {
|
||||||
// prompt user to determine whether to replace or not
|
// prompt user to determine whether to replace or not
|
||||||
|
|
||||||
char replaceMsg[512];
|
BString replaceMsg;
|
||||||
|
|
||||||
if (moveMode == kCreateLink || moveMode == kCreateRelativeLink)
|
if (moveMode == kCreateLink || moveMode == kCreateRelativeLink) {
|
||||||
sprintf(replaceMsg, kSymLinkReplaceStr, name);
|
replaceMsg.SetTo(B_TRANSLATE(kSymLinkReplaceStr));
|
||||||
else if (sourceEntry->IsDirectory())
|
replaceMsg.ReplaceFirst("%name", name);
|
||||||
sprintf(replaceMsg, kDirectoryReplaceStr, name,
|
} else if (sourceEntry->IsDirectory()) {
|
||||||
moveMode == kMoveSelectionTo ? "moving" : "copying");
|
replaceMsg.SetTo(B_TRANSLATE(kDirectoryReplaceStr));
|
||||||
else {
|
replaceMsg.ReplaceFirst("%name", name);
|
||||||
|
replaceMsg.ReplaceFirst("%verb",
|
||||||
|
moveMode == kMoveSelectionTo
|
||||||
|
? B_TRANSLATE("moving")
|
||||||
|
: B_TRANSLATE("copying"));
|
||||||
|
} else {
|
||||||
char sourceBuffer[96], destBuffer[96];
|
char sourceBuffer[96], destBuffer[96];
|
||||||
StatStruct statBuffer;
|
StatStruct statBuffer;
|
||||||
|
|
||||||
@@ -2052,17 +2105,24 @@ CheckName(uint32 moveMode, const BEntry *sourceEntry,
|
|||||||
else
|
else
|
||||||
destBuffer[0] = '\0';
|
destBuffer[0] = '\0';
|
||||||
|
|
||||||
sprintf(replaceMsg, kReplaceStr, name, destBuffer, name,
|
replaceMsg.SetTo(B_TRANSLATE(kReplaceStr));
|
||||||
sourceBuffer, moveMode == kMoveSelectionTo ? "moving"
|
replaceMsg.ReplaceAll("%name", name);
|
||||||
: "copying");
|
replaceMsg.ReplaceFirst("%dest", destBuffer);
|
||||||
|
replaceMsg.ReplaceFirst("%src", sourceBuffer);
|
||||||
|
replaceMsg.ReplaceFirst("%movemode",
|
||||||
|
moveMode == kMoveSelectionTo
|
||||||
|
? B_TRANSLATE("moving")
|
||||||
|
: B_TRANSLATE("copying"));
|
||||||
}
|
}
|
||||||
|
|
||||||
// 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.String(),
|
||||||
else {
|
B_TRANSLATE("Skip"), B_TRANSLATE("Replace all"));
|
||||||
alert = new BAlert("", replaceMsg, "Cancel", "Replace");
|
} else {
|
||||||
|
alert = new BAlert("", replaceMsg.String(),
|
||||||
|
B_TRANSLATE("Cancel"), B_TRANSLATE("Replace"));
|
||||||
alert->SetShortcut(0, B_ESCAPE);
|
alert->SetShortcut(0, B_ESCAPE);
|
||||||
}
|
}
|
||||||
switch (alert->Go()) {
|
switch (alert->Go()) {
|
||||||
@@ -2086,11 +2146,10 @@ CheckName(uint32 moveMode, const BEntry *sourceEntry,
|
|||||||
return B_OK;
|
return B_OK;
|
||||||
|
|
||||||
if (err != B_OK) {
|
if (err != B_OK) {
|
||||||
BString error;
|
BString error(B_TRANSLATE("There was a problem trying to replace \"%name\". The item might be open or busy."));
|
||||||
error << "There was a problem trying to replace \""
|
error.ReplaceFirst("%name", name);;
|
||||||
<< name << "\". The item might be open or busy.";
|
BAlert* alert = new BAlert("", error.String(),
|
||||||
BAlert *alert = new BAlert("", error.String(), "Cancel", 0, 0,
|
B_TRANSLATE("Cancel"), 0, 0, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
|
||||||
B_WIDTH_AS_USUAL, B_WARNING_ALERT);
|
|
||||||
alert->SetShortcut(0, B_ESCAPE);
|
alert->SetShortcut(0, B_ESCAPE);
|
||||||
alert->Go();
|
alert->Go();
|
||||||
}
|
}
|
||||||
@@ -2136,8 +2195,8 @@ FSDeleteFolder(BEntry *dir_entry, CopyLoopControl *loopControl,
|
|||||||
else if (err == B_OK)
|
else if (err == B_OK)
|
||||||
dir.Rewind();
|
dir.Rewind();
|
||||||
else {
|
else {
|
||||||
loopControl->FileError(kFileDeleteErrorString, ref.name, err,
|
loopControl->FileError(B_TRANSLATE(kFileDeleteErrorString),
|
||||||
false);
|
ref.name, err, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2705,8 +2764,9 @@ empty_trash(void *)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (err != B_OK && err != kTrashCanceled && err != kUserCanceled) {
|
if (err != B_OK && err != kTrashCanceled && err != kUserCanceled) {
|
||||||
(new BAlert("", "Error emptying Trash!", "OK", NULL, NULL,
|
(new BAlert("", B_TRANSLATE("Error emptying Trash!"),
|
||||||
B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go();
|
B_TRANSLATE("OK"), NULL, NULL, B_WIDTH_AS_USUAL,
|
||||||
|
B_WARNING_ALERT))->Go();
|
||||||
}
|
}
|
||||||
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
@@ -2720,9 +2780,10 @@ _DeleteTask(BObjectList<entry_ref> *list, bool confirm)
|
|||||||
bool dontMoveToTrash = TrackerSettings().DontMoveFilesToTrash();
|
bool dontMoveToTrash = TrackerSettings().DontMoveFilesToTrash();
|
||||||
|
|
||||||
if (!dontMoveToTrash) {
|
if (!dontMoveToTrash) {
|
||||||
BAlert *alert = new BAlert("", kDeleteConfirmationStr,
|
BAlert* alert = new BAlert("",
|
||||||
"Cancel", "Move to Trash", "Delete", B_WIDTH_AS_USUAL,
|
B_TRANSLATE(kDeleteConfirmationStr), B_TRANSLATE("Cancel"),
|
||||||
B_OFFSET_SPACING, B_WARNING_ALERT);
|
B_TRANSLATE("Move to Trash"), B_TRANSLATE("Delete"),
|
||||||
|
B_WIDTH_AS_USUAL, B_OFFSET_SPACING, B_WARNING_ALERT);
|
||||||
|
|
||||||
alert->SetShortcut(0, B_ESCAPE);
|
alert->SetShortcut(0, B_ESCAPE);
|
||||||
alert->SetShortcut(1, 'm');
|
alert->SetShortcut(1, 'm');
|
||||||
@@ -2737,9 +2798,10 @@ _DeleteTask(BObjectList<entry_ref> *list, bool confirm)
|
|||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
BAlert *alert = new BAlert("", kDeleteConfirmationStr,
|
BAlert* alert = new BAlert("",
|
||||||
"Cancel", "Delete", NULL, B_WIDTH_AS_USUAL, B_OFFSET_SPACING,
|
B_TRANSLATE(kDeleteConfirmationStr), B_TRANSLATE("Cancel"),
|
||||||
B_WARNING_ALERT);
|
B_TRANSLATE("Delete"), NULL, B_WIDTH_AS_USUAL,
|
||||||
|
B_OFFSET_SPACING, B_WARNING_ALERT);
|
||||||
|
|
||||||
alert->SetShortcut(0, B_ESCAPE);
|
alert->SetShortcut(0, B_ESCAPE);
|
||||||
alert->SetShortcut(1, 'd');
|
alert->SetShortcut(1, 'd');
|
||||||
@@ -2774,8 +2836,9 @@ _DeleteTask(BObjectList<entry_ref> *list, bool confirm)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (err != kTrashCanceled && err != kUserCanceled && err != B_OK)
|
if (err != kTrashCanceled && err != kUserCanceled && err != B_OK)
|
||||||
(new BAlert("", "Error deleting items", "OK", NULL, NULL,
|
(new BAlert("", B_TRANSLATE("Error deleting items"),
|
||||||
B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go();
|
B_TRANSLATE("OK"), NULL, NULL, B_WIDTH_AS_USUAL,
|
||||||
|
B_WARNING_ALERT))->Go();
|
||||||
}
|
}
|
||||||
|
|
||||||
delete list;
|
delete list;
|
||||||
@@ -2930,17 +2993,20 @@ FSCreateNewFolderIn(const node_ref *dirNode, entry_ref *newRef,
|
|||||||
status_t result = dir.InitCheck();
|
status_t result = dir.InitCheck();
|
||||||
if (result == B_OK) {
|
if (result == B_OK) {
|
||||||
char name[B_FILE_NAME_LENGTH];
|
char name[B_FILE_NAME_LENGTH];
|
||||||
strcpy(name, "New folder");
|
strcpy(name, B_TRANSLATE("New folder"));
|
||||||
|
|
||||||
int32 fnum = 1;
|
int32 fnum = 1;
|
||||||
while (dir.Contains(name)) {
|
while (dir.Contains(name)) {
|
||||||
// if base name already exists then add a number
|
// if base name already exists then add a number
|
||||||
// ToDo:
|
// ToDo:
|
||||||
// move this logic ot FSMakeOriginalName
|
// move this logic ot FSMakeOriginalName
|
||||||
if (++fnum > 9)
|
if (++fnum > 9) {
|
||||||
sprintf(name, "New folder%ld", fnum);
|
snprintf(name, sizeof(name), B_TRANSLATE("New folder%ld"),
|
||||||
else
|
fnum);
|
||||||
sprintf(name, "New folder %ld", fnum);
|
} else {
|
||||||
|
snprintf(name, sizeof(name), B_TRANSLATE("New folder %ld"),
|
||||||
|
fnum);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
BDirectory newDir;
|
BDirectory newDir;
|
||||||
@@ -2960,8 +3026,9 @@ FSCreateNewFolderIn(const node_ref *dirNode, entry_ref *newRef,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
BAlert *alert = new BAlert("", "Sorry, could not create a new folder.",
|
BAlert* alert = new BAlert("",
|
||||||
"Cancel", 0, 0, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
|
B_TRANSLATE("Sorry, could not create a new folder."),
|
||||||
|
B_TRANSLATE("Cancel"), 0, 0, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
|
||||||
alert->SetShortcut(0, B_ESCAPE);
|
alert->SetShortcut(0, B_ESCAPE);
|
||||||
alert->Go();
|
alert->Go();
|
||||||
return result;
|
return result;
|
||||||
@@ -3120,18 +3187,20 @@ _TrackerLaunchAppWithDocuments(const entry_ref *appRef, const BMessage *refs,
|
|||||||
if (nodeToClose)
|
if (nodeToClose)
|
||||||
dynamic_cast<TTracker *>(be_app)->CloseParent(*nodeToClose);
|
dynamic_cast<TTracker *>(be_app)->CloseParent(*nodeToClose);
|
||||||
} else {
|
} else {
|
||||||
alertString << "Could not open \"" << appRef->name << "\" ("
|
alertString.SetTo(B_TRANSLATE("Could not open \"%name\" (%error). "));
|
||||||
<< strerror(error) << "). ";
|
alertString.ReplaceFirst("%name", appRef->name);
|
||||||
|
alertString.ReplaceFirst("%error", strerror(error));
|
||||||
if (refs && openWithOK && error != B_SHUTTING_DOWN) {
|
if (refs && openWithOK && error != B_SHUTTING_DOWN) {
|
||||||
alertString << kFindAlternativeStr;
|
alertString << B_TRANSLATE(kFindAlternativeStr);
|
||||||
BAlert *alert = new BAlert("", alertString.String(),
|
BAlert* alert = new BAlert("", alertString.String(),
|
||||||
"Cancel", "Find", 0, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
|
B_TRANSLATE("Cancel"), B_TRANSLATE("Find"), 0, B_WIDTH_AS_USUAL,
|
||||||
|
B_WARNING_ALERT);
|
||||||
alert->SetShortcut(0, B_ESCAPE);
|
alert->SetShortcut(0, B_ESCAPE);
|
||||||
if (alert->Go() == 1)
|
if (alert->Go() == 1)
|
||||||
error = TrackerOpenWith(refs);
|
error = TrackerOpenWith(refs);
|
||||||
} else {
|
} else {
|
||||||
BAlert *alert = new BAlert("", alertString.String(),
|
BAlert* alert = new BAlert("", alertString.String(),
|
||||||
"Cancel", 0, 0, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
|
B_TRANSLATE("Cancel"), 0, 0, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
|
||||||
alert->SetShortcut(0, B_ESCAPE);
|
alert->SetShortcut(0, B_ESCAPE);
|
||||||
alert->Go();
|
alert->Go();
|
||||||
}
|
}
|
||||||
@@ -3274,10 +3343,12 @@ _TrackerLaunchDocuments(const entry_ref */*doNotUse*/, const BMessage *refs,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (error != B_OK) {
|
if (error != B_OK) {
|
||||||
alertString << "Could not find an application to open \""
|
alertString.SetTo(B_TRANSLATE("Could not find an application to "
|
||||||
<< documentRef.name << "\" (" << strerror(error) << "). ";
|
"open \"%name\" (%error). "));
|
||||||
|
alertString.ReplaceFirst("%name", documentRef.name);
|
||||||
|
alertString.ReplaceFirst("%error", strerror(error));
|
||||||
if (openWithOK)
|
if (openWithOK)
|
||||||
alternative = kFindApplicationStr;
|
alternative = B_TRANSLATE(kFindApplicationStr);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
@@ -3325,16 +3396,17 @@ _TrackerLaunchDocuments(const entry_ref */*doNotUse*/, const BMessage *refs,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (error == B_LAUNCH_FAILED_EXECUTABLE && !refsToPass) {
|
if (error == B_LAUNCH_FAILED_EXECUTABLE && !refsToPass) {
|
||||||
alertString << "Could not open \"" << app.name
|
alertString.SetTo(B_TRANSLATE("Could not open \"%name\". "
|
||||||
<< "\". The file is mistakenly marked as executable. ";
|
"The file is mistakenly marked as executable. "));
|
||||||
|
alertString.ReplaceFirst("%name", app.name);
|
||||||
|
|
||||||
if (!openWithOK) {
|
if (!openWithOK) {
|
||||||
// offer the possibility to change the permissions
|
// offer the possibility to change the permissions
|
||||||
|
|
||||||
alertString << "\nShould this be fixed?";
|
alertString << B_TRANSLATE("\nShould this be fixed?");
|
||||||
BAlert *alert = new BAlert("", alertString.String(),
|
BAlert* alert = new BAlert("", alertString.String(),
|
||||||
"Cancel", "Proceed", 0, B_WIDTH_AS_USUAL,
|
B_TRANSLATE("Cancel"), B_TRANSLATE("Proceed"), 0,
|
||||||
B_WARNING_ALERT);
|
B_WIDTH_AS_USUAL, B_WARNING_ALERT);
|
||||||
alert->SetShortcut(0, B_ESCAPE);
|
alert->SetShortcut(0, B_ESCAPE);
|
||||||
if (alert->Go() == 1) {
|
if (alert->Go() == 1) {
|
||||||
BEntry entry(&documentRef);
|
BEntry entry(&documentRef);
|
||||||
@@ -3350,44 +3422,66 @@ _TrackerLaunchDocuments(const entry_ref */*doNotUse*/, const BMessage *refs,
|
|||||||
_TrackerLaunchDocuments(NULL, refs, false);
|
_TrackerLaunchDocuments(NULL, refs, false);
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
alertString = "Could not update permissions of "
|
alertString.SetTo(B_TRANSLATE("Could not update "
|
||||||
"file \"";
|
"permissions of file \"%name\". %error"));
|
||||||
alertString << app.name << "\". " << strerror(error);
|
alertString.ReplaceFirst("%name", app.name);
|
||||||
|
alertString.ReplaceFirst("%error", strerror(error));
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
alternative = kFindApplicationStr;
|
alternative = B_TRANSLATE(kFindApplicationStr);
|
||||||
} else if (error == B_LAUNCH_FAILED_APP_IN_TRASH) {
|
} else if (error == B_LAUNCH_FAILED_APP_IN_TRASH) {
|
||||||
alertString << "Could not open \"" << documentRef.name
|
alertString.SetTo(B_TRANSLATE("Could not open \"%document\" "
|
||||||
<< "\" because application \"" << app.name << "\" is in the "
|
"because application \"%app\" is in the Trash. "));
|
||||||
"Trash. ";
|
alertString.ReplaceFirst("%document", documentRef.name);
|
||||||
alternative = kFindAlternativeStr;
|
alertString.ReplaceFirst("%app", app.name);
|
||||||
|
alternative = B_TRANSLATE(kFindAlternativeStr);
|
||||||
} else if (error == B_LAUNCH_FAILED_APP_NOT_FOUND) {
|
} else if (error == B_LAUNCH_FAILED_APP_NOT_FOUND) {
|
||||||
alertString << "Could not open \"" << documentRef.name << "\" "
|
alertString.SetTo(
|
||||||
<< "(" << strerror(error) << "). ";
|
B_TRANSLATE("Could not open \"%name\" (%error). "));
|
||||||
alternative = kFindAlternativeStr;
|
alertString.ReplaceFirst("%name", documentRef.name);
|
||||||
|
alertString.ReplaceFirst("%error", strerror(error));
|
||||||
|
alternative = B_TRANSLATE(kFindAlternativeStr);
|
||||||
} else if (error == B_MISSING_SYMBOL
|
} else if (error == B_MISSING_SYMBOL
|
||||||
&& LoaderErrorDetails(&app, loaderErrorString) == B_OK) {
|
&& LoaderErrorDetails(&app, loaderErrorString) == B_OK) {
|
||||||
alertString << "Could not open \"" << documentRef.name << "\" ";
|
if (openedDocuments) {
|
||||||
if (openedDocuments)
|
alertString.SetTo(B_TRANSLATE("Could not open \"%document\" "
|
||||||
alertString << "with application \"" << app.name << "\" ";
|
"with application \"%app\" (Missing symbol: %symbol). \n"));
|
||||||
alertString << "(Missing symbol: " << loaderErrorString << "). \n";
|
alertString.ReplaceFirst("%document", documentRef.name);
|
||||||
alternative = kFindAlternativeStr;
|
alertString.ReplaceFirst("%app", app.name);
|
||||||
|
alertString.ReplaceFirst("%symbol", loaderErrorString.String());
|
||||||
|
} else {
|
||||||
|
alertString.SetTo(B_TRANSLATE("Could not open \"%document\" "
|
||||||
|
"(Missing symbol: %symbol). \n"));
|
||||||
|
alertString.ReplaceFirst("%document", documentRef.name);
|
||||||
|
alertString.ReplaceFirst("%symbol", loaderErrorString.String());
|
||||||
|
}
|
||||||
|
alternative = B_TRANSLATE(kFindAlternativeStr);
|
||||||
} else if (error == B_MISSING_LIBRARY
|
} else if (error == B_MISSING_LIBRARY
|
||||||
&& LoaderErrorDetails(&app, loaderErrorString) == B_OK) {
|
&& LoaderErrorDetails(&app, loaderErrorString) == B_OK) {
|
||||||
alertString << "Could not open \"" << documentRef.name << "\" ";
|
if (openedDocuments) {
|
||||||
if (openedDocuments)
|
alertString.SetTo(B_TRANSLATE("Could not open \"%document\" "
|
||||||
alertString << "with application \"" << app.name << "\" ";
|
"with application \"%app\" (Missing libraries: %library). "
|
||||||
alertString << "(Missing libraries: " << loaderErrorString
|
"\n"));
|
||||||
<< "). \n";
|
alertString.ReplaceFirst("%document", documentRef.name);
|
||||||
alternative = kFindAlternativeStr;
|
alertString.ReplaceFirst("%app", app.name);
|
||||||
|
alertString.ReplaceFirst("%library", loaderErrorString.String());
|
||||||
} else {
|
} else {
|
||||||
alertString << "Could not open \"" << documentRef.name
|
alertString.SetTo(B_TRANSLATE("Could not open \"%document\" "
|
||||||
<< "\" with application \"" << app.name << "\" ("
|
"(Missing libraries: %library). \n"));
|
||||||
<< strerror(error) << "). ";
|
alertString.ReplaceFirst("%document", documentRef.name);
|
||||||
alternative = kFindAlternativeStr;
|
alertString.ReplaceFirst("%library", loaderErrorString.String());
|
||||||
|
}
|
||||||
|
alternative = B_TRANSLATE(kFindAlternativeStr);
|
||||||
|
} else {
|
||||||
|
alertString.SetTo(B_TRANSLATE("Could not open \"%document\" with "
|
||||||
|
"application \"%app\" (%error). "));
|
||||||
|
alertString.ReplaceFirst("%document", documentRef.name);
|
||||||
|
alertString.ReplaceFirst("%app", app.name);
|
||||||
|
alertString.ReplaceFirst("%error", strerror(error));
|
||||||
|
alternative = B_TRANSLATE(kFindAlternativeStr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3395,15 +3489,15 @@ _TrackerLaunchDocuments(const entry_ref */*doNotUse*/, const BMessage *refs,
|
|||||||
if (openWithOK) {
|
if (openWithOK) {
|
||||||
ASSERT(alternative);
|
ASSERT(alternative);
|
||||||
alertString << alternative;
|
alertString << alternative;
|
||||||
BAlert *alert = new BAlert("", alertString.String(),
|
BAlert* alert = new BAlert("", alertString.String(),
|
||||||
"Cancel", "Find", 0, B_WIDTH_AS_USUAL,
|
B_TRANSLATE("Cancel"), B_TRANSLATE("Find"), 0, B_WIDTH_AS_USUAL,
|
||||||
B_WARNING_ALERT);
|
B_WARNING_ALERT);
|
||||||
alert->SetShortcut(0, B_ESCAPE);
|
alert->SetShortcut(0, B_ESCAPE);
|
||||||
if (alert->Go() == 1)
|
if (alert->Go() == 1)
|
||||||
error = TrackerOpenWith(refs);
|
error = TrackerOpenWith(refs);
|
||||||
} else {
|
} else {
|
||||||
BAlert *alert = new BAlert("", alertString.String(),
|
BAlert* alert = new BAlert("", alertString.String(),
|
||||||
"Cancel", 0, 0, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
|
B_TRANSLATE("Cancel"), 0, 0, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
|
||||||
alert->SetShortcut(0, B_ESCAPE);
|
alert->SetShortcut(0, B_ESCAPE);
|
||||||
alert->Go();
|
alert->Go();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,8 +37,10 @@ All rights reserved.
|
|||||||
#include <compat/sys/stat.h>
|
#include <compat/sys/stat.h>
|
||||||
|
|
||||||
#include <Application.h>
|
#include <Application.h>
|
||||||
|
#include <Catalog.h>
|
||||||
#include <FindDirectory.h>
|
#include <FindDirectory.h>
|
||||||
#include <FilePanel.h>
|
#include <FilePanel.h>
|
||||||
|
#include <Locale.h>
|
||||||
#include <Message.h>
|
#include <Message.h>
|
||||||
#include <Path.h>
|
#include <Path.h>
|
||||||
#include <Query.h>
|
#include <Query.h>
|
||||||
@@ -56,6 +58,10 @@ All rights reserved.
|
|||||||
#include "Utilities.h"
|
#include "Utilities.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#undef B_TRANSLATE_CONTEXT
|
||||||
|
#define B_TRANSLATE_CONTEXT "libtracker"
|
||||||
|
|
||||||
FavoritesMenu::FavoritesMenu(const char *title, BMessage *openFolderMessage,
|
FavoritesMenu::FavoritesMenu(const char *title, BMessage *openFolderMessage,
|
||||||
BMessage *openFileMessage, const BMessenger &target,
|
BMessage *openFileMessage, const BMessenger &target,
|
||||||
bool isSavePanel, BRefFilter *filter)
|
bool isSavePanel, BRefFilter *filter)
|
||||||
@@ -166,7 +172,7 @@ FavoritesMenu::AddNextItem()
|
|||||||
|
|
||||||
if (!fAddedSeparatorForSection) {
|
if (!fAddedSeparatorForSection) {
|
||||||
fAddedSeparatorForSection = true;
|
fAddedSeparatorForSection = true;
|
||||||
AddItem(new TitledSeparatorItem("Favorites"));
|
AddItem(new TitledSeparatorItem(B_TRANSLATE("Favorites")));
|
||||||
}
|
}
|
||||||
fUniqueRefCheck.push_back(*model.EntryRef());
|
fUniqueRefCheck.push_back(*model.EntryRef());
|
||||||
AddItem(item);
|
AddItem(item);
|
||||||
@@ -211,7 +217,8 @@ FavoritesMenu::AddNextItem()
|
|||||||
if (item) {
|
if (item) {
|
||||||
if (!fAddedSeparatorForSection) {
|
if (!fAddedSeparatorForSection) {
|
||||||
fAddedSeparatorForSection = true;
|
fAddedSeparatorForSection = true;
|
||||||
AddItem(new TitledSeparatorItem("Recent documents"));
|
AddItem(new TitledSeparatorItem(
|
||||||
|
B_TRANSLATE("Recent documents")));
|
||||||
}
|
}
|
||||||
AddItem(item);
|
AddItem(item);
|
||||||
fSectionItemCount++;
|
fSectionItemCount++;
|
||||||
@@ -259,7 +266,8 @@ FavoritesMenu::AddNextItem()
|
|||||||
if (item) {
|
if (item) {
|
||||||
if (!fAddedSeparatorForSection) {
|
if (!fAddedSeparatorForSection) {
|
||||||
fAddedSeparatorForSection = true;
|
fAddedSeparatorForSection = true;
|
||||||
AddItem(new TitledSeparatorItem("Recent folders"));
|
AddItem(new TitledSeparatorItem(
|
||||||
|
B_TRANSLATE("Recent folders")));
|
||||||
}
|
}
|
||||||
AddItem(item);
|
AddItem(item);
|
||||||
item->SetEnabled(true);
|
item->SetEnabled(true);
|
||||||
@@ -436,7 +444,7 @@ RecentsMenu::DoneBuildingItemList()
|
|||||||
//
|
//
|
||||||
|
|
||||||
if (CountItems() <= 0) {
|
if (CountItems() <= 0) {
|
||||||
BMenuItem *item = new BMenuItem("<No recent items>", 0);
|
BMenuItem* item = new BMenuItem(B_TRANSLATE("<No recent items>"), 0);
|
||||||
item->SetEnabled(false);
|
item->SetEnabled(false);
|
||||||
AddItem(item);
|
AddItem(item);
|
||||||
} else
|
} else
|
||||||
|
|||||||
@@ -53,9 +53,11 @@ All rights reserved.
|
|||||||
#include <Alert.h>
|
#include <Alert.h>
|
||||||
#include <Application.h>
|
#include <Application.h>
|
||||||
#include <Button.h>
|
#include <Button.h>
|
||||||
|
#include <Catalog.h>
|
||||||
#include <Debug.h>
|
#include <Debug.h>
|
||||||
#include <Directory.h>
|
#include <Directory.h>
|
||||||
#include <FindDirectory.h>
|
#include <FindDirectory.h>
|
||||||
|
#include <Locale.h>
|
||||||
#include <MenuBar.h>
|
#include <MenuBar.h>
|
||||||
#include <MenuField.h>
|
#include <MenuField.h>
|
||||||
#include <MenuItem.h>
|
#include <MenuItem.h>
|
||||||
@@ -133,6 +135,9 @@ key_down_filter(BMessage *message, BHandler **, BMessageFilter *filter)
|
|||||||
// #pragma mark -
|
// #pragma mark -
|
||||||
|
|
||||||
|
|
||||||
|
#undef B_TRANSLATE_CONTEXT
|
||||||
|
#define B_TRANSLATE_CONTEXT "libtracker"
|
||||||
|
|
||||||
TFilePanel::TFilePanel(file_panel_mode mode, BMessenger *target,
|
TFilePanel::TFilePanel(file_panel_mode mode, BMessenger *target,
|
||||||
const BEntry *startDir, uint32 nodeFlavors, bool multipleSelection,
|
const BEntry *startDir, uint32 nodeFlavors, bool multipleSelection,
|
||||||
BMessage *message, BRefFilter *filter, uint32 containerWindowFlags,
|
BMessage *message, BRefFilter *filter, uint32 containerWindowFlags,
|
||||||
@@ -441,8 +446,8 @@ TFilePanel::SetRefFilter(BRefFilter *filter)
|
|||||||
fPoseView->SetRefFilter(filter);
|
fPoseView->SetRefFilter(filter);
|
||||||
fPoseView->CommitActivePose();
|
fPoseView->CommitActivePose();
|
||||||
fPoseView->Refresh();
|
fPoseView->Refresh();
|
||||||
FavoritesMenu *menu = dynamic_cast<FavoritesMenu *>(
|
FavoritesMenu* menu = dynamic_cast<FavoritesMenu *>
|
||||||
fMenuBar->FindItem("Favorites")->Submenu());
|
(fMenuBar->FindItem(B_TRANSLATE("Favorites"))->Submenu());
|
||||||
if (menu)
|
if (menu)
|
||||||
menu->SetRefFilter(filter);
|
menu->SetRefFilter(filter);
|
||||||
}
|
}
|
||||||
@@ -498,7 +503,7 @@ TFilePanel::AdjustButton()
|
|||||||
|
|
||||||
BTextControl *textControl = dynamic_cast<BTextControl *>(FindView("text view"));
|
BTextControl *textControl = dynamic_cast<BTextControl *>(FindView("text view"));
|
||||||
BObjectList<BPose> *selectionList = fPoseView->SelectionList();
|
BObjectList<BPose> *selectionList = fPoseView->SelectionList();
|
||||||
const char *buttonText = fButtonText.String();
|
BString buttonText = fButtonText;
|
||||||
bool enabled = false;
|
bool enabled = false;
|
||||||
|
|
||||||
if (fIsSavePanel && textControl) {
|
if (fIsSavePanel && textControl) {
|
||||||
@@ -509,7 +514,7 @@ TFilePanel::AdjustButton()
|
|||||||
Model *model = selectionList->FirstItem()->TargetModel();
|
Model *model = selectionList->FirstItem()->TargetModel();
|
||||||
if (model->ResolveIfLink()->IsDirectory()) {
|
if (model->ResolveIfLink()->IsDirectory()) {
|
||||||
enabled = true;
|
enabled = true;
|
||||||
buttonText = "Open";
|
buttonText = B_TRANSLATE("Open");
|
||||||
} else {
|
} else {
|
||||||
// insert the name of the selected model into the text field
|
// insert the name of the selected model into the text field
|
||||||
textControl->SetText(model->Name());
|
textControl->SetText(model->Name());
|
||||||
@@ -546,7 +551,7 @@ TFilePanel::AdjustButton()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
button->SetLabel(buttonText);
|
button->SetLabel(buttonText.String());
|
||||||
button->SetEnabled(enabled);
|
button->SetEnabled(enabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -597,24 +602,25 @@ TFilePanel::Init(const BMessage *)
|
|||||||
AddMenus();
|
AddMenus();
|
||||||
AddContextMenus();
|
AddContextMenus();
|
||||||
|
|
||||||
FavoritesMenu *favorites = new FavoritesMenu("Favorites",
|
FavoritesMenu* favorites = new FavoritesMenu(B_TRANSLATE("Favorites"),
|
||||||
new BMessage(kSwitchDirectory), new BMessage(B_REFS_RECEIVED),
|
new BMessage(kSwitchDirectory), new BMessage(B_REFS_RECEIVED),
|
||||||
BMessenger(this), IsSavePanel(), fPoseView->RefFilter());
|
BMessenger(this), IsSavePanel(), fPoseView->RefFilter());
|
||||||
favorites->AddItem(new BMenuItem("Add current folder",
|
favorites->AddItem(new BMenuItem(B_TRANSLATE("Add current folder"),
|
||||||
new BMessage(kAddCurrentDir)));
|
new BMessage(kAddCurrentDir)));
|
||||||
favorites->AddItem(new BMenuItem("Edit favorites"B_UTF8_ELLIPSIS,
|
favorites->AddItem(new BMenuItem(
|
||||||
|
B_TRANSLATE("Edit favorites"B_UTF8_ELLIPSIS),
|
||||||
new BMessage(kEditFavorites)));
|
new BMessage(kEditFavorites)));
|
||||||
|
|
||||||
fMenuBar->AddItem(favorites);
|
fMenuBar->AddItem(favorites);
|
||||||
|
|
||||||
// configure menus
|
// configure menus
|
||||||
BMenuItem *item = fMenuBar->FindItem("Window");
|
BMenuItem* item = fMenuBar->FindItem(B_TRANSLATE("Window"));
|
||||||
if (item) {
|
if (item) {
|
||||||
fMenuBar->RemoveItem(item);
|
fMenuBar->RemoveItem(item);
|
||||||
delete item;
|
delete item;
|
||||||
}
|
}
|
||||||
|
|
||||||
item = fMenuBar->FindItem("File");
|
item = fMenuBar->FindItem(B_TRANSLATE("File"));
|
||||||
if (item) {
|
if (item) {
|
||||||
BMenu *menu = item->Submenu();
|
BMenu *menu = item->Submenu();
|
||||||
if (menu) {
|
if (menu) {
|
||||||
@@ -627,7 +633,7 @@ TFilePanel::Init(const BMessage *)
|
|||||||
delete item;
|
delete item;
|
||||||
|
|
||||||
// remove add-ons menu, identifier menu, separator
|
// remove add-ons menu, identifier menu, separator
|
||||||
item = menu->FindItem(kAddOnsMenuName);
|
item = menu->FindItem(B_TRANSLATE("Add-ons"));
|
||||||
if (item) {
|
if (item) {
|
||||||
int32 index = menu->IndexOf(item);
|
int32 index = menu->IndexOf(item);
|
||||||
delete menu->RemoveItem(index);
|
delete menu->RemoveItem(index);
|
||||||
@@ -683,7 +689,8 @@ TFilePanel::Init(const BMessage *)
|
|||||||
rect.right = rect.left + 170;
|
rect.right = rect.left + 170;
|
||||||
rect.bottom = rect.top + 13;
|
rect.bottom = rect.top + 13;
|
||||||
|
|
||||||
fTextControl = new BTextControl(rect, "text view", "save text", "", NULL,
|
fTextControl = new BTextControl(rect, "text view",
|
||||||
|
B_TRANSLATE("save text"), "", NULL,
|
||||||
B_FOLLOW_LEFT | B_FOLLOW_BOTTOM);
|
B_FOLLOW_LEFT | B_FOLLOW_BOTTOM);
|
||||||
DisallowMetaKeys(fTextControl->TextView());
|
DisallowMetaKeys(fTextControl->TextView());
|
||||||
DisallowFilenameKeys(fTextControl->TextView());
|
DisallowFilenameKeys(fTextControl->TextView());
|
||||||
@@ -691,9 +698,9 @@ TFilePanel::Init(const BMessage *)
|
|||||||
fTextControl->SetDivider(0.0f);
|
fTextControl->SetDivider(0.0f);
|
||||||
fTextControl->TextView()->SetMaxBytes(B_FILE_NAME_LENGTH - 1);
|
fTextControl->TextView()->SetMaxBytes(B_FILE_NAME_LENGTH - 1);
|
||||||
|
|
||||||
fButtonText = "Save";
|
fButtonText.SetTo(B_TRANSLATE("Save"));
|
||||||
} else
|
} else
|
||||||
fButtonText = "Open";
|
fButtonText.SetTo(B_TRANSLATE("Open"));
|
||||||
|
|
||||||
rect = windRect;
|
rect = windRect;
|
||||||
rect.OffsetTo(10, fDirMenuField->Frame().bottom + 10);
|
rect.OffsetTo(10, fDirMenuField->Frame().bottom + 10);
|
||||||
@@ -741,11 +748,12 @@ TFilePanel::Init(const BMessage *)
|
|||||||
fBackView->AddChild(default_button);
|
fBackView->AddChild(default_button);
|
||||||
|
|
||||||
rect.right = rect.left -= 10;
|
rect.right = rect.left -= 10;
|
||||||
float cancel_width = be_plain_font->StringWidth("Cancel") + 20;
|
float cancel_width = be_plain_font->StringWidth(B_TRANSLATE("Cancel")) + 20;
|
||||||
rect.left = (cancel_width > 75) ? (rect.right - cancel_width) : (rect.right - 75);
|
rect.left = (cancel_width > 75) ? (rect.right - cancel_width) : (rect.right - 75);
|
||||||
|
|
||||||
BButton *cancel_button = new BButton(rect, "cancel button", "Cancel",
|
BButton* cancel_button = new BButton(rect, "cancel button",
|
||||||
new BMessage(kCancelButton), B_FOLLOW_RIGHT + B_FOLLOW_BOTTOM);
|
B_TRANSLATE("Cancel"), new BMessage(kCancelButton),
|
||||||
|
B_FOLLOW_RIGHT + B_FOLLOW_BOTTOM);
|
||||||
fBackView->AddChild(cancel_button);
|
fBackView->AddChild(cancel_button);
|
||||||
|
|
||||||
if (!fIsSavePanel)
|
if (!fIsSavePanel)
|
||||||
@@ -847,14 +855,19 @@ TFilePanel::RestoreWindowState(const BMessage &message)
|
|||||||
void
|
void
|
||||||
TFilePanel::AddFileContextMenus(BMenu *menu)
|
TFilePanel::AddFileContextMenus(BMenu *menu)
|
||||||
{
|
{
|
||||||
menu->AddItem(new BMenuItem("Get info", new BMessage(kGetInfo), 'I'));
|
menu->AddItem(new BMenuItem(B_TRANSLATE("Get info"),
|
||||||
menu->AddItem(new BMenuItem("Edit name", new BMessage(kEditItem), 'E'));
|
new BMessage(kGetInfo), 'I'));
|
||||||
menu->AddItem(new BMenuItem(TrackerSettings().DontMoveFilesToTrash() ?
|
menu->AddItem(new BMenuItem(B_TRANSLATE("Edit name"),
|
||||||
"Delete" : "Move to Trash",
|
new BMessage(kEditItem), 'E'));
|
||||||
|
menu->AddItem(new BMenuItem(TrackerSettings().DontMoveFilesToTrash()
|
||||||
|
? B_TRANSLATE("Delete")
|
||||||
|
: B_TRANSLATE("Move to Trash"),
|
||||||
new BMessage(kMoveToTrash), 'T'));
|
new BMessage(kMoveToTrash), 'T'));
|
||||||
menu->AddSeparatorItem();
|
menu->AddSeparatorItem();
|
||||||
menu->AddItem(new BMenuItem("Cut", new BMessage(B_CUT), 'X'));
|
menu->AddItem(new BMenuItem(B_TRANSLATE("Cut"),
|
||||||
menu->AddItem(new BMenuItem("Copy", new BMessage(B_COPY), 'C'));
|
new BMessage(B_CUT), 'X'));
|
||||||
|
menu->AddItem(new BMenuItem(B_TRANSLATE("Copy"),
|
||||||
|
new BMessage(B_COPY), 'C'));
|
||||||
// menu->AddItem(pasteItem = new BMenuItem("Paste", new BMessage(B_PASTE), 'V'));
|
// menu->AddItem(pasteItem = new BMenuItem("Paste", new BMessage(B_PASTE), 'V'));
|
||||||
|
|
||||||
menu->SetTargetForItems(PoseView());
|
menu->SetTargetForItems(PoseView());
|
||||||
@@ -864,12 +877,16 @@ TFilePanel::AddFileContextMenus(BMenu *menu)
|
|||||||
void
|
void
|
||||||
TFilePanel::AddVolumeContextMenus(BMenu *menu)
|
TFilePanel::AddVolumeContextMenus(BMenu *menu)
|
||||||
{
|
{
|
||||||
menu->AddItem(new BMenuItem("Open", new BMessage(kOpenSelection), 'O'));
|
menu->AddItem(new BMenuItem(B_TRANSLATE("Open"),
|
||||||
menu->AddItem(new BMenuItem("Get info", new BMessage(kGetInfo), 'I'));
|
new BMessage(kOpenSelection), 'O'));
|
||||||
menu->AddItem(new BMenuItem("Edit name", new BMessage(kEditItem), 'E'));
|
menu->AddItem(new BMenuItem(B_TRANSLATE("Get info"),
|
||||||
|
new BMessage(kGetInfo), 'I'));
|
||||||
|
menu->AddItem(new BMenuItem(B_TRANSLATE("Edit name"),
|
||||||
|
new BMessage(kEditItem), 'E'));
|
||||||
menu->AddSeparatorItem();
|
menu->AddSeparatorItem();
|
||||||
menu->AddItem(new BMenuItem("Cut", new BMessage(B_CUT), 'X'));
|
menu->AddItem(new BMenuItem(B_TRANSLATE("Cut"), new BMessage(B_CUT), 'X'));
|
||||||
menu->AddItem(new BMenuItem("Copy", new BMessage(B_COPY), 'C'));
|
menu->AddItem(new BMenuItem(B_TRANSLATE("Copy"),
|
||||||
|
new BMessage(B_COPY), 'C'));
|
||||||
// menu->AddItem(pasteItem = new BMenuItem("Paste", new BMessage(B_PASTE), 'V'));
|
// menu->AddItem(pasteItem = new BMenuItem("Paste", new BMessage(B_PASTE), 'V'));
|
||||||
|
|
||||||
menu->SetTargetForItems(PoseView());
|
menu->SetTargetForItems(PoseView());
|
||||||
@@ -879,30 +896,34 @@ TFilePanel::AddVolumeContextMenus(BMenu *menu)
|
|||||||
void
|
void
|
||||||
TFilePanel::AddWindowContextMenus(BMenu *menu)
|
TFilePanel::AddWindowContextMenus(BMenu *menu)
|
||||||
{
|
{
|
||||||
BMenuItem *item = new BMenuItem("New folder", new BMessage(kNewFolder), 'N');
|
BMenuItem* item = new BMenuItem(B_TRANSLATE("New folder"),
|
||||||
|
new BMessage(kNewFolder), 'N');
|
||||||
item->SetTarget(PoseView());
|
item->SetTarget(PoseView());
|
||||||
menu->AddItem(item);
|
menu->AddItem(item);
|
||||||
menu->AddSeparatorItem();
|
menu->AddSeparatorItem();
|
||||||
|
|
||||||
item = new BMenuItem("Paste", new BMessage(B_PASTE), 'V');
|
item = new BMenuItem(B_TRANSLATE("Paste"), new BMessage(B_PASTE), 'V');
|
||||||
item->SetTarget(PoseView());
|
item->SetTarget(PoseView());
|
||||||
menu->AddItem(item);
|
menu->AddItem(item);
|
||||||
menu->AddSeparatorItem();
|
menu->AddSeparatorItem();
|
||||||
|
|
||||||
item = new BMenuItem("Select"B_UTF8_ELLIPSIS, new BMessage(kShowSelectionWindow),
|
item = new BMenuItem(B_TRANSLATE("Select"B_UTF8_ELLIPSIS),
|
||||||
'A', B_SHIFT_KEY);
|
new BMessage(kShowSelectionWindow), 'A', B_SHIFT_KEY);
|
||||||
item->SetTarget(PoseView());
|
item->SetTarget(PoseView());
|
||||||
menu->AddItem(item);
|
menu->AddItem(item);
|
||||||
|
|
||||||
item = new BMenuItem("Select all", new BMessage(B_SELECT_ALL), 'A');
|
item = new BMenuItem(B_TRANSLATE("Select all"),
|
||||||
|
new BMessage(B_SELECT_ALL), 'A');
|
||||||
item->SetTarget(PoseView());
|
item->SetTarget(PoseView());
|
||||||
menu->AddItem(item);
|
menu->AddItem(item);
|
||||||
|
|
||||||
item = new BMenuItem("Invert selection", new BMessage(kInvertSelection), 'S');
|
item = new BMenuItem(B_TRANSLATE("Invert selection"),
|
||||||
|
new BMessage(kInvertSelection), 'S');
|
||||||
item->SetTarget(PoseView());
|
item->SetTarget(PoseView());
|
||||||
menu->AddItem(item);
|
menu->AddItem(item);
|
||||||
|
|
||||||
item = new BMenuItem("Go to parent", new BMessage(kOpenParentDir), B_UP_ARROW);
|
item = new BMenuItem(B_TRANSLATE("Go to parent"),
|
||||||
|
new BMessage(kOpenParentDir), B_UP_ARROW);
|
||||||
item->SetTarget(this);
|
item->SetTarget(this);
|
||||||
menu->AddItem(item);
|
menu->AddItem(item);
|
||||||
}
|
}
|
||||||
@@ -1051,8 +1072,9 @@ TFilePanel::MessageReceived(BMessage *message)
|
|||||||
|
|
||||||
// Don't allow saves of multiple files
|
// Don't allow saves of multiple files
|
||||||
if (count > 1) {
|
if (count > 1) {
|
||||||
ShowCenteredAlert("Sorry, saving more than one item is not allowed.",
|
ShowCenteredAlert(
|
||||||
"Cancel");
|
B_TRANSLATE("Sorry, saving more than one item is not allowed."),
|
||||||
|
B_TRANSLATE("Cancel"));
|
||||||
} else {
|
} else {
|
||||||
// if we are a savepanel, set up the filepanel correctly
|
// if we are a savepanel, set up the filepanel correctly
|
||||||
// then pass control so we follow the same path as if the user
|
// then pass control so we follow the same path as if the user
|
||||||
@@ -1341,40 +1363,48 @@ TFilePanel::HandleSaveButton()
|
|||||||
BDirectory dir;
|
BDirectory dir;
|
||||||
|
|
||||||
if (TargetModel()->IsRoot()) {
|
if (TargetModel()->IsRoot()) {
|
||||||
ShowCenteredAlert("Sorry, you can't save things at the root of "
|
ShowCenteredAlert(
|
||||||
"your system.", "Cancel");
|
B_TRANSLATE("Sorry, you can't save things at the root of "
|
||||||
|
"your system."),
|
||||||
|
B_TRANSLATE("Cancel"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// check for some illegal file names
|
// check for some illegal file names
|
||||||
if (strcmp(fTextControl->Text(), ".") == 0
|
if (strcmp(fTextControl->Text(), ".") == 0
|
||||||
|| strcmp(fTextControl->Text(), "..") == 0) {
|
|| strcmp(fTextControl->Text(), "..") == 0) {
|
||||||
ShowCenteredAlert("The specified name is illegal. Please choose "
|
ShowCenteredAlert(
|
||||||
"another name.", "Cancel");
|
B_TRANSLATE("The specified name is illegal. Please choose "
|
||||||
|
"another name."),
|
||||||
|
B_TRANSLATE("Cancel"));
|
||||||
fTextControl->TextView()->SelectAll();
|
fTextControl->TextView()->SelectAll();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dir.SetTo(TargetModel()->EntryRef()) != B_OK) {
|
if (dir.SetTo(TargetModel()->EntryRef()) != B_OK) {
|
||||||
ShowCenteredAlert("There was a problem trying to save in the folder "
|
ShowCenteredAlert(
|
||||||
"you specified. Please try another one.", "Cancel");
|
B_TRANSLATE("There was a problem trying to save in the folder "
|
||||||
|
"you specified. Please try another one."),
|
||||||
|
B_TRANSLATE("Cancel"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dir.Contains(fTextControl->Text())) {
|
if (dir.Contains(fTextControl->Text())) {
|
||||||
if (dir.Contains(fTextControl->Text(), B_DIRECTORY_NODE)) {
|
if (dir.Contains(fTextControl->Text(), B_DIRECTORY_NODE)) {
|
||||||
ShowCenteredAlert("The specified name is already used as the name "
|
ShowCenteredAlert(
|
||||||
"of a folder. Please choose another name.", "Cancel");
|
B_TRANSLATE("The specified name is already used as the name "
|
||||||
|
"of a folder. Please choose another name."),
|
||||||
|
B_TRANSLATE("Cancel"));
|
||||||
fTextControl->TextView()->SelectAll();
|
fTextControl->TextView()->SelectAll();
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
// if this was invoked by a dbl click, it is an explicit replacement
|
// if this was invoked by a dbl click, it is an explicit replacement
|
||||||
// of the file.
|
// of the file.
|
||||||
BString str;
|
BString str(B_TRANSLATE("The file \"%name\" already exists in the specified folder. Do you want to replace it?"));
|
||||||
str << "The file \"" << fTextControl->Text() << "\" already exists in the "
|
str.ReplaceFirst("%name", fTextControl->Text());
|
||||||
"specified folder. Do you want to replace it?";
|
|
||||||
|
|
||||||
if (ShowCenteredAlert(str.String(), "Cancel", "Replace") == 0) {
|
if (ShowCenteredAlert(str.String(), B_TRANSLATE("Cancel"),
|
||||||
|
B_TRANSLATE("Replace")) == 0) {
|
||||||
// user canceled
|
// user canceled
|
||||||
fTextControl->TextView()->SelectAll();
|
fTextControl->TextView()->SelectAll();
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -38,6 +38,8 @@ All rights reserved.
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include <Beep.h>
|
#include <Beep.h>
|
||||||
|
#include <Catalog.h>
|
||||||
|
#include <Locale.h>
|
||||||
|
|
||||||
|
|
||||||
const uint32 kPermissionsChanged = 'prch';
|
const uint32 kPermissionsChanged = 'prch';
|
||||||
@@ -45,6 +47,9 @@ const uint32 kNewOwnerEntered = 'nwow';
|
|||||||
const uint32 kNewGroupEntered = 'nwgr';
|
const uint32 kNewGroupEntered = 'nwgr';
|
||||||
|
|
||||||
|
|
||||||
|
#undef B_TRANSLATE_CONTEXT
|
||||||
|
#define B_TRANSLATE_CONTEXT "libtracker"
|
||||||
|
|
||||||
FilePermissionsView::FilePermissionsView(BRect rect, Model *model)
|
FilePermissionsView::FilePermissionsView(BRect rect, Model *model)
|
||||||
: BView(rect, "FilePermissionsView", B_FOLLOW_LEFT_RIGHT, B_WILL_DRAW),
|
: BView(rect, "FilePermissionsView", B_FOLLOW_LEFT_RIGHT, B_WILL_DRAW),
|
||||||
fModel(model)
|
fModel(model)
|
||||||
@@ -63,15 +68,17 @@ FilePermissionsView::FilePermissionsView(BRect rect, Model *model)
|
|||||||
strView->SetFontSize(kAttribFontHeight);
|
strView->SetFontSize(kAttribFontHeight);
|
||||||
|
|
||||||
strView = new BStringView(BRect(kColumnLabelMiddle - kColumnLabelWidth / 2
|
strView = new BStringView(BRect(kColumnLabelMiddle - kColumnLabelWidth / 2
|
||||||
+ kColumnLabelSpacing, kColumnLabelTop, kColumnLabelMiddle + kColumnLabelWidth / 2
|
+ kColumnLabelSpacing, kColumnLabelTop,
|
||||||
+ kColumnLabelSpacing, kColumnLabelBottom), "", "Group");
|
kColumnLabelMiddle + kColumnLabelWidth / 2 + kColumnLabelSpacing,
|
||||||
|
kColumnLabelBottom), "", B_TRANSLATE("Group"));
|
||||||
AddChild(strView);
|
AddChild(strView);
|
||||||
strView->SetAlignment(B_ALIGN_CENTER);
|
strView->SetAlignment(B_ALIGN_CENTER);
|
||||||
strView->SetFontSize(kAttribFontHeight);
|
strView->SetFontSize(kAttribFontHeight);
|
||||||
|
|
||||||
strView = new BStringView(BRect(kColumnLabelMiddle - kColumnLabelWidth / 2
|
strView = new BStringView(BRect(kColumnLabelMiddle - kColumnLabelWidth / 2
|
||||||
+ 2 * kColumnLabelSpacing, kColumnLabelTop, kColumnLabelMiddle + kColumnLabelWidth / 2
|
+ 2 * kColumnLabelSpacing, kColumnLabelTop,
|
||||||
+ 2 * kColumnLabelSpacing, kColumnLabelBottom), "", "Other");
|
kColumnLabelMiddle + kColumnLabelWidth / 2 + 2 * kColumnLabelSpacing,
|
||||||
|
kColumnLabelBottom), "", B_TRANSLATE("Other"));
|
||||||
AddChild(strView);
|
AddChild(strView);
|
||||||
strView->SetAlignment(B_ALIGN_CENTER);
|
strView->SetAlignment(B_ALIGN_CENTER);
|
||||||
strView->SetFontSize(kAttribFontHeight);
|
strView->SetFontSize(kAttribFontHeight);
|
||||||
@@ -82,21 +89,24 @@ FilePermissionsView::FilePermissionsView(BRect rect, Model *model)
|
|||||||
- kColumnLabelWidth / 2 - 5, kRowLabelHeight = 14;
|
- kColumnLabelWidth / 2 - 5, kRowLabelHeight = 14;
|
||||||
|
|
||||||
strView = new BStringView(BRect(kRowLabelLeft, kRowLabelTop, kRowLabelRight,
|
strView = new BStringView(BRect(kRowLabelLeft, kRowLabelTop, kRowLabelRight,
|
||||||
kRowLabelTop + kRowLabelHeight), "", "Read");
|
kRowLabelTop + kRowLabelHeight),
|
||||||
|
"", B_TRANSLATE("Read"));
|
||||||
AddChild(strView);
|
AddChild(strView);
|
||||||
strView->SetAlignment(B_ALIGN_RIGHT);
|
strView->SetAlignment(B_ALIGN_RIGHT);
|
||||||
strView->SetFontSize(kAttribFontHeight);
|
strView->SetFontSize(kAttribFontHeight);
|
||||||
|
|
||||||
strView = new BStringView(BRect(kRowLabelLeft, kRowLabelTop
|
strView = new BStringView(BRect(kRowLabelLeft, kRowLabelTop
|
||||||
+ kRowLabelVerticalSpacing, kRowLabelRight, kRowLabelTop
|
+ kRowLabelVerticalSpacing, kRowLabelRight, kRowLabelTop
|
||||||
+ kRowLabelVerticalSpacing + kRowLabelHeight), "", "Write");
|
+ kRowLabelVerticalSpacing + kRowLabelHeight),
|
||||||
|
"", B_TRANSLATE("Write"));
|
||||||
AddChild(strView);
|
AddChild(strView);
|
||||||
strView->SetAlignment(B_ALIGN_RIGHT);
|
strView->SetAlignment(B_ALIGN_RIGHT);
|
||||||
strView->SetFontSize(kAttribFontHeight);
|
strView->SetFontSize(kAttribFontHeight);
|
||||||
|
|
||||||
strView = new BStringView(BRect(kRowLabelLeft, kRowLabelTop
|
strView = new BStringView(BRect(kRowLabelLeft, kRowLabelTop
|
||||||
+ 2 * kRowLabelVerticalSpacing, kRowLabelRight, kRowLabelTop
|
+ 2 * kRowLabelVerticalSpacing, kRowLabelRight, kRowLabelTop
|
||||||
+ 2 * kRowLabelVerticalSpacing + kRowLabelHeight), "", "Execute");
|
+ 2 * kRowLabelVerticalSpacing + kRowLabelHeight),
|
||||||
|
"", B_TRANSLATE("Execute"));
|
||||||
AddChild(strView);
|
AddChild(strView);
|
||||||
strView->SetAlignment(B_ALIGN_RIGHT);
|
strView->SetAlignment(B_ALIGN_RIGHT);
|
||||||
strView->SetFontSize(kAttribFontHeight);
|
strView->SetFontSize(kAttribFontHeight);
|
||||||
@@ -126,8 +136,9 @@ FilePermissionsView::FilePermissionsView(BRect rect, Model *model)
|
|||||||
const float kTextControlLeft = 170, kTextControlRight = 270,
|
const float kTextControlLeft = 170, kTextControlRight = 270,
|
||||||
kTextControlTop = kColumnLabelTop, kTextControlHeight = 14, kTextControlSpacing = 16;
|
kTextControlTop = kColumnLabelTop, kTextControlHeight = 14, kTextControlSpacing = 16;
|
||||||
|
|
||||||
strView = new BStringView(BRect(kTextControlLeft, kTextControlTop, kTextControlRight,
|
strView = new BStringView(BRect(kTextControlLeft, kTextControlTop,
|
||||||
kTextControlTop + kTextControlHeight), "", "Owner");
|
kTextControlRight, kTextControlTop + kTextControlHeight), "",
|
||||||
|
B_TRANSLATE("Owner"));
|
||||||
strView->SetAlignment(B_ALIGN_CENTER);
|
strView->SetAlignment(B_ALIGN_CENTER);
|
||||||
strView->SetFontSize(kAttribFontHeight);
|
strView->SetFontSize(kAttribFontHeight);
|
||||||
AddChild(strView);
|
AddChild(strView);
|
||||||
@@ -138,9 +149,11 @@ FilePermissionsView::FilePermissionsView(BRect rect, Model *model)
|
|||||||
fOwnerTextControl->SetDivider(0);
|
fOwnerTextControl->SetDivider(0);
|
||||||
AddChild(fOwnerTextControl);
|
AddChild(fOwnerTextControl);
|
||||||
|
|
||||||
strView = new BStringView(BRect(kTextControlLeft, kTextControlTop + 5
|
strView = new BStringView(BRect(kTextControlLeft,
|
||||||
+ 2 * kTextControlSpacing, kTextControlRight, kTextControlTop + 2
|
kTextControlTop + 5 + 2 * kTextControlSpacing,
|
||||||
+ 2 * kTextControlSpacing + kTextControlHeight), "", "Group");
|
kTextControlRight,
|
||||||
|
kTextControlTop + 2 + 2 * kTextControlSpacing + kTextControlHeight),
|
||||||
|
"", B_TRANSLATE("Group"));
|
||||||
strView->SetAlignment(B_ALIGN_CENTER);
|
strView->SetAlignment(B_ALIGN_CENTER);
|
||||||
strView->SetFontSize(kAttribFontHeight);
|
strView->SetFontSize(kAttribFontHeight);
|
||||||
AddChild(strView);
|
AddChild(strView);
|
||||||
|
|||||||
+115
-65
@@ -35,12 +35,14 @@ All rights reserved.
|
|||||||
#include <Application.h>
|
#include <Application.h>
|
||||||
#include <Box.h>
|
#include <Box.h>
|
||||||
#include <Button.h>
|
#include <Button.h>
|
||||||
|
#include <Catalog.h>
|
||||||
#include <CheckBox.h>
|
#include <CheckBox.h>
|
||||||
#include <Debug.h>
|
#include <Debug.h>
|
||||||
#include <Directory.h>
|
#include <Directory.h>
|
||||||
#include <FindDirectory.h>
|
#include <FindDirectory.h>
|
||||||
#include <File.h>
|
#include <File.h>
|
||||||
#include <FilePanel.h>
|
#include <FilePanel.h>
|
||||||
|
#include <Locale.h>
|
||||||
#include <MenuField.h>
|
#include <MenuField.h>
|
||||||
#include <MenuItem.h>
|
#include <MenuItem.h>
|
||||||
#include <Mime.h>
|
#include <Mime.h>
|
||||||
@@ -73,6 +75,10 @@ All rights reserved.
|
|||||||
#include "Tracker.h"
|
#include "Tracker.h"
|
||||||
#include "Utilities.h"
|
#include "Utilities.h"
|
||||||
|
|
||||||
|
|
||||||
|
#undef B_TRANSLATE_CONTEXT
|
||||||
|
#define B_TRANSLATE_CONTEXT "libtracker"
|
||||||
|
|
||||||
const char *kAllMimeTypes = "mime/ALLTYPES";
|
const char *kAllMimeTypes = "mime/ALLTYPES";
|
||||||
|
|
||||||
const BRect kInitialRect(100, 100, 530, 210);
|
const BRect kInitialRect(100, 100, 530, 210);
|
||||||
@@ -85,8 +91,12 @@ const uint32 kNameModifiedMessage = 'nmmd';
|
|||||||
const uint32 kSwitchToQueryTemplate = 'swqt';
|
const uint32 kSwitchToQueryTemplate = 'swqt';
|
||||||
const uint32 kRunSaveAsTemplatePanel = 'svtm';
|
const uint32 kRunSaveAsTemplatePanel = 'svtm';
|
||||||
|
|
||||||
const char *kDragNDropTypes [] = { B_QUERY_MIMETYPE, B_QUERY_TEMPLATE_MIMETYPE };
|
const char* kDragNDropTypes [] = {
|
||||||
const char *kDragNDropActionSpecifiers [] = { "Create a Query", "Create a Query template" };
|
B_QUERY_MIMETYPE,
|
||||||
|
B_QUERY_TEMPLATE_MIMETYPE };
|
||||||
|
static const char *kDragNDropActionSpecifiers [] = {
|
||||||
|
B_TRANSLATE_MARK("Create a Query"),
|
||||||
|
B_TRANSLATE_MARK("Create a Query template") };
|
||||||
|
|
||||||
const uint32 kAttachFile = 'attf';
|
const uint32 kAttachFile = 'attf';
|
||||||
|
|
||||||
@@ -162,8 +172,10 @@ MoreOptionsStruct::QueryTemporary(const BNode *node)
|
|||||||
// #pragma mark -
|
// #pragma mark -
|
||||||
|
|
||||||
|
|
||||||
FindWindow::FindWindow(const entry_ref *newRef, bool editIfTemplateOnly)
|
FindWindow::FindWindow(const entry_ref* newRef, bool editIfTemplateOnly)
|
||||||
: BWindow(kInitialRect, "Find", B_TITLED_WINDOW, B_NOT_RESIZABLE | B_NOT_ZOOMABLE),
|
:
|
||||||
|
BWindow(kInitialRect, B_TRANSLATE("Find"), B_TITLED_WINDOW, B_NOT_RESIZABLE
|
||||||
|
| B_NOT_ZOOMABLE),
|
||||||
fFile(TryOpening(newRef)),
|
fFile(TryOpening(newRef)),
|
||||||
fFromTemplate(false),
|
fFromTemplate(false),
|
||||||
fEditTemplateOnly(false),
|
fEditTemplateOnly(false),
|
||||||
@@ -176,7 +188,7 @@ FindWindow::FindWindow(const entry_ref *newRef, bool editIfTemplateOnly)
|
|||||||
if (BNodeInfo(fFile).GetType(type) == B_OK
|
if (BNodeInfo(fFile).GetType(type) == B_OK
|
||||||
&& strcasecmp(type, B_QUERY_TEMPLATE_MIMETYPE) == 0) {
|
&& strcasecmp(type, B_QUERY_TEMPLATE_MIMETYPE) == 0) {
|
||||||
fEditTemplateOnly = true;
|
fEditTemplateOnly = true;
|
||||||
SetTitle("Edit Query template");
|
SetTitle(B_TRANSLATE("Edit Query template"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -625,8 +637,10 @@ FindWindow::MessageReceived(BMessage *message)
|
|||||||
else {
|
else {
|
||||||
BMessenger panel(BackgroundView());
|
BMessenger panel(BackgroundView());
|
||||||
fSaveAsTemplatePanel = new BFilePanel(B_SAVE_PANEL, &panel);
|
fSaveAsTemplatePanel = new BFilePanel(B_SAVE_PANEL, &panel);
|
||||||
fSaveAsTemplatePanel->SetSaveText("Query template");
|
fSaveAsTemplatePanel->SetSaveText(
|
||||||
fSaveAsTemplatePanel->Window()->SetTitle("Save as Query template:");
|
B_TRANSLATE("Query template"));
|
||||||
|
fSaveAsTemplatePanel->Window()->SetTitle(
|
||||||
|
B_TRANSLATE("Save as Query template:"));
|
||||||
fSaveAsTemplatePanel->Show();
|
fSaveAsTemplatePanel->Show();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -680,14 +694,17 @@ FindPanel::FindPanel(BRect frame, BFile *node, FindWindow *parent,
|
|||||||
rect.right = rect.left + 150;
|
rect.right = rect.left + 150;
|
||||||
fMimeTypeField = new BMenuField(rect, "MimeTypeMenu", "", fMimeTypeMenu);
|
fMimeTypeField = new BMenuField(rect, "MimeTypeMenu", "", fMimeTypeMenu);
|
||||||
fMimeTypeField->SetDivider(0.0f);
|
fMimeTypeField->SetDivider(0.0f);
|
||||||
fMimeTypeField->MenuItem()->SetLabel("All files and folders");
|
fMimeTypeField->MenuItem()->SetLabel(B_TRANSLATE("All files and folders"));
|
||||||
AddChild(fMimeTypeField);
|
AddChild(fMimeTypeField);
|
||||||
|
|
||||||
// add popup for search criteria
|
// add popup for search criteria
|
||||||
fSearchModeMenu = new BPopUpMenu("searchMode");
|
fSearchModeMenu = new BPopUpMenu("searchMode");
|
||||||
fSearchModeMenu->AddItem(new BMenuItem("by name", new BMessage(kByNameItem)));
|
fSearchModeMenu->AddItem(new BMenuItem(B_TRANSLATE("by name"),
|
||||||
fSearchModeMenu->AddItem(new BMenuItem("by attribute", new BMessage(kByAttributeItem)));
|
new BMessage(kByNameItem)));
|
||||||
fSearchModeMenu->AddItem(new BMenuItem("by formula", new BMessage(kByFormulaItem)));
|
fSearchModeMenu->AddItem(new BMenuItem(B_TRANSLATE("by attribute"),
|
||||||
|
new BMessage(kByAttributeItem)));
|
||||||
|
fSearchModeMenu->AddItem(new BMenuItem(B_TRANSLATE("by formula"),
|
||||||
|
new BMessage(kByFormulaItem)));
|
||||||
|
|
||||||
fSearchModeMenu->ItemAt(initialMode == kByNameItem ? 0 :
|
fSearchModeMenu->ItemAt(initialMode == kByNameItem ? 0 :
|
||||||
(initialMode == kByAttributeItem ? 1 : 2))->SetMarked(true);
|
(initialMode == kByAttributeItem ? 1 : 2))->SetMarked(true);
|
||||||
@@ -703,7 +720,7 @@ FindPanel::FindPanel(BRect frame, BFile *node, FindWindow *parent,
|
|||||||
rect.right = bounds.right - 15;
|
rect.right = bounds.right - 15;
|
||||||
rect.left = rect.right - 100;
|
rect.left = rect.right - 100;
|
||||||
fVolMenu = new BPopUpMenu("", false, false); // don't radioMode
|
fVolMenu = new BPopUpMenu("", false, false); // don't radioMode
|
||||||
menuField = new BMenuField(rect, "", "On", fVolMenu);
|
menuField = new BMenuField(rect, "", B_TRANSLATE("On"), fVolMenu);
|
||||||
menuField->SetDivider(menuField->StringWidth(menuField->Label()) + 8);
|
menuField->SetDivider(menuField->StringWidth(menuField->Label()) + 8);
|
||||||
AddChild(menuField);
|
AddChild(menuField);
|
||||||
AddVolumes(fVolMenu);
|
AddVolumes(fVolMenu);
|
||||||
@@ -715,8 +732,10 @@ FindPanel::FindPanel(BRect frame, BFile *node, FindWindow *parent,
|
|||||||
dragNDropMessage.AddString("be:types", B_FILE_MIME_TYPE);
|
dragNDropMessage.AddString("be:types", B_FILE_MIME_TYPE);
|
||||||
dragNDropMessage.AddString("be:filetypes", kDragNDropTypes[0]);
|
dragNDropMessage.AddString("be:filetypes", kDragNDropTypes[0]);
|
||||||
dragNDropMessage.AddString("be:filetypes", kDragNDropTypes[1]);
|
dragNDropMessage.AddString("be:filetypes", kDragNDropTypes[1]);
|
||||||
dragNDropMessage.AddString("be:actionspecifier", kDragNDropActionSpecifiers[0]);
|
dragNDropMessage.AddString("be:actionspecifier",
|
||||||
dragNDropMessage.AddString("be:actionspecifier", kDragNDropActionSpecifiers[1]);
|
B_TRANSLATE(kDragNDropActionSpecifiers[0]));
|
||||||
|
dragNDropMessage.AddString("be:actionspecifier",
|
||||||
|
B_TRANSLATE(kDragNDropActionSpecifiers[1]));
|
||||||
|
|
||||||
BMessenger self(this);
|
BMessenger self(this);
|
||||||
fDraggableIcon = new DraggableQueryIcon(DraggableIcon::PreferredRect(draggableIconOrigin,
|
fDraggableIcon = new DraggableQueryIcon(DraggableIcon::PreferredRect(draggableIconOrigin,
|
||||||
@@ -747,7 +766,8 @@ FindPanel::FindPanel(BRect frame, BFile *node, FindWindow *parent,
|
|||||||
rect = expandedBounds;
|
rect = expandedBounds;
|
||||||
rect.right = rect.left + 200;
|
rect.right = rect.left + 200;
|
||||||
rect.bottom = rect.top + 20;;
|
rect.bottom = rect.top + 20;;
|
||||||
fQueryName = new BTextControl(rect, "queryName", "Query name:", "", 0);
|
fQueryName = new BTextControl(rect, "queryName", B_TRANSLATE("Query name:"),
|
||||||
|
"", 0);
|
||||||
fQueryName->SetDivider(fQueryName->StringWidth(fQueryName->Label()) + 5);
|
fQueryName->SetDivider(fQueryName->StringWidth(fQueryName->Label()) + 5);
|
||||||
fMoreOptionsPane->AddItem(fQueryName, 1);
|
fMoreOptionsPane->AddItem(fQueryName, 1);
|
||||||
FillCurrentQueryName(fQueryName, parent);
|
FillCurrentQueryName(fQueryName, parent);
|
||||||
@@ -755,12 +775,14 @@ FindPanel::FindPanel(BRect frame, BFile *node, FindWindow *parent,
|
|||||||
rect.top = rect.bottom + 6;
|
rect.top = rect.bottom + 6;
|
||||||
rect.bottom = rect.top + 16;
|
rect.bottom = rect.top + 16;
|
||||||
rect.right = rect.left + 100;
|
rect.right = rect.left + 100;
|
||||||
fSearchTrashCheck = new BCheckBox(rect, "searchTrash", "Include trash", 0);
|
fSearchTrashCheck = new BCheckBox(rect, "searchTrash",
|
||||||
|
B_TRANSLATE("Include trash"), 0);
|
||||||
fSearchTrashCheck->ResizeToPreferred();
|
fSearchTrashCheck->ResizeToPreferred();
|
||||||
fMoreOptionsPane->AddItem(fSearchTrashCheck, 1);
|
fMoreOptionsPane->AddItem(fSearchTrashCheck, 1);
|
||||||
|
|
||||||
rect.OffsetBy(fSearchTrashCheck->Bounds().Width() + 8, 0);
|
rect.OffsetBy(fSearchTrashCheck->Bounds().Width() + 8, 0);
|
||||||
fTemporaryCheck = new BCheckBox(rect, "temporary", "Temporary", 0);
|
fTemporaryCheck = new BCheckBox(rect, "temporary",
|
||||||
|
B_TRANSLATE("Temporary"), 0);
|
||||||
fMoreOptionsPane->AddItem(fTemporaryCheck, 1);
|
fMoreOptionsPane->AddItem(fTemporaryCheck, 1);
|
||||||
fTemporaryCheck->SetValue(1);
|
fTemporaryCheck->SetValue(1);
|
||||||
|
|
||||||
@@ -788,13 +810,13 @@ FindPanel::FindPanel(BRect frame, BFile *node, FindWindow *parent,
|
|||||||
rect.right = rect.left + 60;
|
rect.right = rect.left + 60;
|
||||||
rect.bottom = rect.top + 20;
|
rect.bottom = rect.top + 20;
|
||||||
BButton *button;
|
BButton *button;
|
||||||
if (editTemplateOnly)
|
if (editTemplateOnly) {
|
||||||
button = new BButton(rect, "save", "Save",
|
button = new BButton(rect, "save", B_TRANSLATE("Save"),
|
||||||
new BMessage(kSaveButton), B_FOLLOW_RIGHT + B_FOLLOW_BOTTOM);
|
new BMessage(kSaveButton), B_FOLLOW_RIGHT + B_FOLLOW_BOTTOM);
|
||||||
else
|
} else {
|
||||||
button = new BButton(rect, "find", "Search",
|
button = new BButton(rect, "find", B_TRANSLATE("Search"),
|
||||||
new BMessage(kFindButton), B_FOLLOW_RIGHT + B_FOLLOW_BOTTOM);
|
new BMessage(kFindButton), B_FOLLOW_RIGHT + B_FOLLOW_BOTTOM);
|
||||||
|
}
|
||||||
AddChild(button);
|
AddChild(button);
|
||||||
button->MakeDefault(true);
|
button->MakeDefault(true);
|
||||||
}
|
}
|
||||||
@@ -956,7 +978,7 @@ FindPanel::ShowVolumeMenuLabel()
|
|||||||
} else if (countSelected > 1)
|
} else if (countSelected > 1)
|
||||||
// if more than two disks selected, don't use the disk name
|
// if more than two disks selected, don't use the disk name
|
||||||
// as a label
|
// as a label
|
||||||
PopUpMenuSetTitle(fVolMenu, "multiple disks");
|
PopUpMenuSetTitle(fVolMenu, B_TRANSLATE("multiple disks"));
|
||||||
else {
|
else {
|
||||||
ASSERT(tmpItem);
|
ASSERT(tmpItem);
|
||||||
PopUpMenuSetTitle(fVolMenu, tmpItem->Label());
|
PopUpMenuSetTitle(fVolMenu, tmpItem->Label());
|
||||||
@@ -1109,14 +1131,17 @@ FindPanel::MessageReceived(BMessage *message)
|
|||||||
bool queryTemplate = false;
|
bool queryTemplate = false;
|
||||||
|
|
||||||
if (actionSpecifier
|
if (actionSpecifier
|
||||||
&& strcasecmp(actionSpecifier, kDragNDropActionSpecifiers[0]) == 0)
|
&& strcasecmp(actionSpecifier,
|
||||||
|
B_TRANSLATE(kDragNDropActionSpecifiers[0])) == 0) {
|
||||||
query = true;
|
query = true;
|
||||||
else if (actionSpecifier
|
} else if (actionSpecifier
|
||||||
&& strcasecmp(actionSpecifier, kDragNDropActionSpecifiers[1]) == 0)
|
&& strcasecmp(actionSpecifier,
|
||||||
|
B_TRANSLATE(kDragNDropActionSpecifiers[1])) == 0) {
|
||||||
queryTemplate = true;
|
queryTemplate = true;
|
||||||
else if (mimeType && strcasecmp(mimeType, kDragNDropTypes[0]) == 0)
|
} else if (mimeType && strcasecmp(mimeType,
|
||||||
|
kDragNDropTypes[0]) == 0) {
|
||||||
query = true;
|
query = true;
|
||||||
else if (mimeType && strcasecmp(mimeType, kDragNDropTypes[1]) == 0)
|
} else if (mimeType && strcasecmp(mimeType, kDragNDropTypes[1]) == 0)
|
||||||
queryTemplate = true;
|
queryTemplate = true;
|
||||||
|
|
||||||
if (query || queryTemplate)
|
if (query || queryTemplate)
|
||||||
@@ -1320,11 +1345,15 @@ FindPanel::GetDefaultName(BString &result) const
|
|||||||
BTextControl *textControl = dynamic_cast<BTextControl *>(FindView("TextControl"));
|
BTextControl *textControl = dynamic_cast<BTextControl *>(FindView("TextControl"));
|
||||||
switch (Mode()) {
|
switch (Mode()) {
|
||||||
case kByNameItem:
|
case kByNameItem:
|
||||||
result << "Name = " << textControl->TextView()->Text();
|
result.SetTo(B_TRANSLATE_COMMENT("Name = %name",
|
||||||
|
"FindResultTitle"));
|
||||||
|
result.ReplaceFirst("%name", textControl->TextView()->Text());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case kByFormulaItem:
|
case kByFormulaItem:
|
||||||
result << "Formula " << textControl->TextView()->Text();
|
result.SetTo(B_TRANSLATE_COMMENT("Formula %formula",
|
||||||
|
"FindResultTitle"));
|
||||||
|
result.ReplaceFirst("%formula", textControl->TextView()->Text());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case kByAttributeItem:
|
case kByAttributeItem:
|
||||||
@@ -1593,7 +1622,8 @@ FindPanel::AddMimeTypesToMenu()
|
|||||||
{
|
{
|
||||||
BMessage *itemMessage = new BMessage(kMIMETypeItem);
|
BMessage *itemMessage = new BMessage(kMIMETypeItem);
|
||||||
itemMessage->AddString("mimetype", kAllMimeTypes);
|
itemMessage->AddString("mimetype", kAllMimeTypes);
|
||||||
MimeTypeMenu()->AddItem(new BMenuItem("All files and folders", itemMessage));
|
MimeTypeMenu()->AddItem(new BMenuItem(B_TRANSLATE("All files and folders"),
|
||||||
|
itemMessage));
|
||||||
MimeTypeMenu()->AddSeparatorItem();
|
MimeTypeMenu()->AddSeparatorItem();
|
||||||
MimeTypeMenu()->ItemAt(0)->SetMarked(true);
|
MimeTypeMenu()->ItemAt(0)->SetMarked(true);
|
||||||
|
|
||||||
@@ -1673,9 +1703,9 @@ FindPanel::AddVolumes(BMenu *menu)
|
|||||||
|
|
||||||
BMessage *message = new BMessage(kVolumeItem);
|
BMessage *message = new BMessage(kVolumeItem);
|
||||||
message->AddInt32("device", -1);
|
message->AddInt32("device", -1);
|
||||||
menu->AddItem(new BMenuItem("All disks", message));
|
menu->AddItem(new BMenuItem(B_TRANSLATE("All disks"), message));
|
||||||
menu->AddSeparatorItem();
|
menu->AddSeparatorItem();
|
||||||
PopUpMenuSetTitle(menu, "All disks");
|
PopUpMenuSetTitle(menu, B_TRANSLATE("All disks"));
|
||||||
|
|
||||||
BVolumeRoster roster;
|
BVolumeRoster roster;
|
||||||
BVolume volume;
|
BVolume volume;
|
||||||
@@ -1813,7 +1843,8 @@ FindPanel::AddRecentQueries(BMenu *menu, bool addSaveAsItem, const BMessenger *t
|
|||||||
menu->AddSeparatorItem();
|
menu->AddSeparatorItem();
|
||||||
|
|
||||||
BMessage *message = new BMessage(kRunSaveAsTemplatePanel);
|
BMessage *message = new BMessage(kRunSaveAsTemplatePanel);
|
||||||
BMenuItem *item = new BMenuItem("Save Query as template"B_UTF8_ELLIPSIS, message);
|
BMenuItem* item = new BMenuItem(
|
||||||
|
B_TRANSLATE("Save Query as template"B_UTF8_ELLIPSIS), message);
|
||||||
menu->AddItem(item);
|
menu->AddItem(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1840,17 +1871,19 @@ FindPanel::SetUpAddRemoveButtons(BBox *box)
|
|||||||
BRect rect = box->Bounds();
|
BRect rect = box->Bounds();
|
||||||
rect.InsetBy(5, 10);
|
rect.InsetBy(5, 10);
|
||||||
rect.top = rect.bottom - 20;
|
rect.top = rect.bottom - 20;
|
||||||
rect.right = rect.left + 22 + be_plain_font->StringWidth("Add");
|
rect.right = rect.left + 22
|
||||||
|
+ be_plain_font->StringWidth(B_TRANSLATE("Add"));
|
||||||
|
|
||||||
button = new BButton(rect, "add", "Add", new BMessage(kAddItem),
|
button = new BButton(rect, "add", B_TRANSLATE("Add"),
|
||||||
B_FOLLOW_RIGHT + B_FOLLOW_BOTTOM);
|
new BMessage(kAddItem), B_FOLLOW_RIGHT + B_FOLLOW_BOTTOM);
|
||||||
button->SetTarget(this);
|
button->SetTarget(this);
|
||||||
box->AddChild(button);
|
box->AddChild(button);
|
||||||
|
|
||||||
rect.OffsetBy(rect.Width() + 6, 0);
|
rect.OffsetBy(rect.Width() + 6, 0);
|
||||||
rect.right = rect.left + 22 + be_plain_font->StringWidth("Remove");
|
rect.right = rect.left + 22
|
||||||
button = new BButton(rect, "remove", "Remove", new BMessage(kRemoveItem),
|
+ be_plain_font->StringWidth(B_TRANSLATE("Remove"));
|
||||||
B_FOLLOW_RIGHT + B_FOLLOW_BOTTOM);
|
button = new BButton(rect, "remove", B_TRANSLATE("Remove"),
|
||||||
|
new BMessage(kRemoveItem), B_FOLLOW_RIGHT + B_FOLLOW_BOTTOM);
|
||||||
|
|
||||||
button->SetEnabled(false);
|
button->SetEnabled(false);
|
||||||
button->SetTarget(this);
|
button->SetTarget(this);
|
||||||
@@ -2333,7 +2366,7 @@ TAttrView::TAttrView(BRect frame, int32 index)
|
|||||||
BPopUpMenu *menu = new BPopUpMenu("PopUp");
|
BPopUpMenu *menu = new BPopUpMenu("PopUp");
|
||||||
|
|
||||||
// add NAME attribute to popup
|
// add NAME attribute to popup
|
||||||
BMenu *submenu = new BMenu("Name");
|
BMenu* submenu = new BMenu(B_TRANSLATE("Name"));
|
||||||
submenu->SetRadioMode(true);
|
submenu->SetRadioMode(true);
|
||||||
submenu->SetFont(be_plain_font);
|
submenu->SetFont(be_plain_font);
|
||||||
BMessage *message = new BMessage(kAttributeItemMain);
|
BMessage *message = new BMessage(kAttributeItemMain);
|
||||||
@@ -2342,13 +2375,24 @@ TAttrView::TAttrView(BRect frame, int32 index)
|
|||||||
BMenuItem *item = new BMenuItem(submenu, message);
|
BMenuItem *item = new BMenuItem(submenu, message);
|
||||||
menu->AddItem(item);
|
menu->AddItem(item);
|
||||||
|
|
||||||
const int32 operators[] = {B_CONTAINS, B_EQ, B_NE, B_BEGINS_WITH, B_ENDS_WITH};
|
const int32 operators[] = {
|
||||||
const char *operatorLabels[] = {"contains", "is", "is not", "starts with", "ends with"};
|
B_CONTAINS,
|
||||||
|
B_EQ,
|
||||||
|
B_NE,
|
||||||
|
B_BEGINS_WITH,
|
||||||
|
B_ENDS_WITH};
|
||||||
|
static const char *operatorLabels[] = {
|
||||||
|
B_TRANSLATE_MARK("contains"),
|
||||||
|
B_TRANSLATE_MARK("is"),
|
||||||
|
B_TRANSLATE_MARK("is not"),
|
||||||
|
B_TRANSLATE_MARK("starts with"),
|
||||||
|
B_TRANSLATE_MARK("ends with")};
|
||||||
|
|
||||||
for (int32 i = 0;i < 5;i++) {
|
for (int32 i = 0; i < 5; i++) {
|
||||||
message = new BMessage(kAttributeItem);
|
message = new BMessage(kAttributeItem);
|
||||||
message->AddInt32("operator", operators[i]);
|
message->AddInt32("operator", operators[i]);
|
||||||
submenu->AddItem(new BMenuItem(operatorLabels[i], message));
|
submenu->AddItem(new BMenuItem(B_TRANSLATE(operatorLabels[i]),
|
||||||
|
message));
|
||||||
}
|
}
|
||||||
|
|
||||||
// mark first item
|
// mark first item
|
||||||
@@ -2356,7 +2400,7 @@ TAttrView::TAttrView(BRect frame, int32 index)
|
|||||||
submenu->ItemAt(0)->SetMarked(true);
|
submenu->ItemAt(0)->SetMarked(true);
|
||||||
|
|
||||||
// add SIZE attribute
|
// add SIZE attribute
|
||||||
submenu = new BMenu("Size");
|
submenu = new BMenu(B_TRANSLATE("Size"));
|
||||||
submenu->SetRadioMode(true);
|
submenu->SetRadioMode(true);
|
||||||
submenu->SetFont(be_plain_font);
|
submenu->SetFont(be_plain_font);
|
||||||
message = new BMessage(kAttributeItemMain);
|
message = new BMessage(kAttributeItemMain);
|
||||||
@@ -2367,18 +2411,18 @@ TAttrView::TAttrView(BRect frame, int32 index)
|
|||||||
|
|
||||||
message = new BMessage(kAttributeItem);
|
message = new BMessage(kAttributeItem);
|
||||||
message->AddInt32("operator", B_GE);
|
message->AddInt32("operator", B_GE);
|
||||||
submenu->AddItem(new BMenuItem("greater than", message));
|
submenu->AddItem(new BMenuItem(B_TRANSLATE("greater than"), message));
|
||||||
|
|
||||||
message = new BMessage(kAttributeItem);
|
message = new BMessage(kAttributeItem);
|
||||||
message->AddInt32("operator", B_LE);
|
message->AddInt32("operator", B_LE);
|
||||||
submenu->AddItem(new BMenuItem("less than", message));
|
submenu->AddItem(new BMenuItem(B_TRANSLATE("less than"), message));
|
||||||
|
|
||||||
message = new BMessage(kAttributeItem);
|
message = new BMessage(kAttributeItem);
|
||||||
message->AddInt32("operator", B_EQ);
|
message->AddInt32("operator", B_EQ);
|
||||||
submenu->AddItem(new BMenuItem("is", message));
|
submenu->AddItem(new BMenuItem(B_TRANSLATE("is"), message));
|
||||||
|
|
||||||
// add "modified" field
|
// add "modified" field
|
||||||
submenu = new BMenu("Modified");
|
submenu = new BMenu(B_TRANSLATE("Modified"));
|
||||||
submenu->SetRadioMode(true);
|
submenu->SetRadioMode(true);
|
||||||
submenu->SetFont(be_plain_font);
|
submenu->SetFont(be_plain_font);
|
||||||
message = new BMessage(kAttributeItemMain);
|
message = new BMessage(kAttributeItemMain);
|
||||||
@@ -2389,11 +2433,11 @@ TAttrView::TAttrView(BRect frame, int32 index)
|
|||||||
|
|
||||||
message = new BMessage(kAttributeItem);
|
message = new BMessage(kAttributeItem);
|
||||||
message->AddInt32("operator", B_LE);
|
message->AddInt32("operator", B_LE);
|
||||||
submenu->AddItem(new BMenuItem("before", message));
|
submenu->AddItem(new BMenuItem(B_TRANSLATE("before"), message));
|
||||||
|
|
||||||
message = new BMessage(kAttributeItem);
|
message = new BMessage(kAttributeItem);
|
||||||
message->AddInt32("operator", B_GE);
|
message->AddInt32("operator", B_GE);
|
||||||
submenu->AddItem(new BMenuItem("after", message));
|
submenu->AddItem(new BMenuItem(B_TRANSLATE("after"), message));
|
||||||
|
|
||||||
BRect bounds(Bounds());
|
BRect bounds(Bounds());
|
||||||
bounds.right = bounds.left + 100;
|
bounds.right = bounds.left + 100;
|
||||||
@@ -2518,14 +2562,14 @@ TAttrView::AddLogicMenu(bool selectAnd)
|
|||||||
BPopUpMenu *menu = new BPopUpMenu("");
|
BPopUpMenu *menu = new BPopUpMenu("");
|
||||||
BMessage *message = new BMessage();
|
BMessage *message = new BMessage();
|
||||||
message->AddInt32("combine", B_AND);
|
message->AddInt32("combine", B_AND);
|
||||||
BMenuItem *item = new BMenuItem("And", message);
|
BMenuItem* item = new BMenuItem(B_TRANSLATE("And"), message);
|
||||||
menu->AddItem(item);
|
menu->AddItem(item);
|
||||||
if (selectAnd)
|
if (selectAnd)
|
||||||
item->SetMarked(true);
|
item->SetMarked(true);
|
||||||
|
|
||||||
message = new BMessage();
|
message = new BMessage();
|
||||||
message->AddInt32("combine", B_OR);
|
message->AddInt32("combine", B_OR);
|
||||||
item = new BMenuItem("Or", message);
|
item = new BMenuItem(B_TRANSLATE("Or"), message);
|
||||||
menu->AddItem(item);
|
menu->AddItem(item);
|
||||||
if (!selectAnd)
|
if (!selectAnd)
|
||||||
item->SetMarked(true);
|
item->SetMarked(true);
|
||||||
@@ -2654,25 +2698,28 @@ TAttrView::AddAttributes(BMenu *menu, const BMimeType &mimeType)
|
|||||||
case B_STRING_TYPE:
|
case B_STRING_TYPE:
|
||||||
message = new BMessage(kAttributeItem);
|
message = new BMessage(kAttributeItem);
|
||||||
message->AddInt32("operator", B_CONTAINS);
|
message->AddInt32("operator", B_CONTAINS);
|
||||||
submenu->AddItem(new BMenuItem("contains", message));
|
submenu->AddItem(new BMenuItem(B_TRANSLATE("contains"),
|
||||||
|
message));
|
||||||
|
|
||||||
message = new BMessage(kAttributeItem);
|
message = new BMessage(kAttributeItem);
|
||||||
message->AddInt32("operator", B_EQ);
|
message->AddInt32("operator", B_EQ);
|
||||||
submenu->AddItem(new BMenuItem("is", message));
|
submenu->AddItem(new BMenuItem(B_TRANSLATE("is"), message));
|
||||||
|
|
||||||
message = new BMessage(kAttributeItem);
|
message = new BMessage(kAttributeItem);
|
||||||
message->AddInt32("operator", B_NE);
|
message->AddInt32("operator", B_NE);
|
||||||
submenu->AddItem(new BMenuItem("is not", message));
|
submenu->AddItem(new BMenuItem(B_TRANSLATE("is not"), message));
|
||||||
submenu->SetTargetForItems(this);
|
submenu->SetTargetForItems(this);
|
||||||
|
|
||||||
message = new BMessage(kAttributeItem);
|
message = new BMessage(kAttributeItem);
|
||||||
message->AddInt32("operator", B_BEGINS_WITH);
|
message->AddInt32("operator", B_BEGINS_WITH);
|
||||||
submenu->AddItem(new BMenuItem("starts with", message));
|
submenu->AddItem(new BMenuItem(B_TRANSLATE("starts with"),
|
||||||
|
message));
|
||||||
submenu->SetTargetForItems(this);
|
submenu->SetTargetForItems(this);
|
||||||
|
|
||||||
message = new BMessage(kAttributeItem);
|
message = new BMessage(kAttributeItem);
|
||||||
message->AddInt32("operator", B_ENDS_WITH);
|
message->AddInt32("operator", B_ENDS_WITH);
|
||||||
submenu->AddItem(new BMenuItem("ends with", message));
|
submenu->AddItem(new BMenuItem(B_TRANSLATE("ends with"),
|
||||||
|
message));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case B_BOOL_TYPE:
|
case B_BOOL_TYPE:
|
||||||
@@ -2689,25 +2736,27 @@ TAttrView::AddAttributes(BMenu *menu, const BMimeType &mimeType)
|
|||||||
case B_DOUBLE_TYPE:
|
case B_DOUBLE_TYPE:
|
||||||
message = new BMessage(kAttributeItem);
|
message = new BMessage(kAttributeItem);
|
||||||
message->AddInt32("operator", B_EQ);
|
message->AddInt32("operator", B_EQ);
|
||||||
submenu->AddItem(new BMenuItem("is", message));
|
submenu->AddItem(new BMenuItem(B_TRANSLATE("is"), message));
|
||||||
|
|
||||||
message = new BMessage(kAttributeItem);
|
message = new BMessage(kAttributeItem);
|
||||||
message->AddInt32("operator", B_GE);
|
message->AddInt32("operator", B_GE);
|
||||||
submenu->AddItem(new BMenuItem("greater than", message));
|
submenu->AddItem(new BMenuItem(B_TRANSLATE("greater than"),
|
||||||
|
message));
|
||||||
|
|
||||||
message = new BMessage(kAttributeItem);
|
message = new BMessage(kAttributeItem);
|
||||||
message->AddInt32("operator", B_LE);
|
message->AddInt32("operator", B_LE);
|
||||||
submenu->AddItem(new BMenuItem("less than", message));
|
submenu->AddItem(new BMenuItem(B_TRANSLATE("less than"),
|
||||||
|
message));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case B_TIME_TYPE:
|
case B_TIME_TYPE:
|
||||||
message = new BMessage(kAttributeItem);
|
message = new BMessage(kAttributeItem);
|
||||||
message->AddInt32("operator", B_LE);
|
message->AddInt32("operator", B_LE);
|
||||||
submenu->AddItem(new BMenuItem("before", message));
|
submenu->AddItem(new BMenuItem(B_TRANSLATE("before"), message));
|
||||||
|
|
||||||
message = new BMessage(kAttributeItem);
|
message = new BMessage(kAttributeItem);
|
||||||
message->AddInt32("operator", B_GE);
|
message->AddInt32("operator", B_GE);
|
||||||
submenu->AddItem(new BMenuItem("after", message));
|
submenu->AddItem(new BMenuItem(B_TRANSLATE("after"), message));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
submenu->SetTargetForItems(this);
|
submenu->SetTargetForItems(this);
|
||||||
@@ -2990,7 +3039,8 @@ DraggableQueryIcon::DragStarted(BMessage *dragMessage)
|
|||||||
ASSERT(window);
|
ASSERT(window);
|
||||||
dragMessage->AddString("be:clip_name",
|
dragMessage->AddString("be:clip_name",
|
||||||
window->BackgroundView()->UserSpecifiedName() ?
|
window->BackgroundView()->UserSpecifiedName() ?
|
||||||
window->BackgroundView()->UserSpecifiedName() : "New Query");
|
window->BackgroundView()->UserSpecifiedName()
|
||||||
|
: B_TRANSLATE("New Query"));
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
+111
-89
@@ -40,10 +40,12 @@ All rights reserved.
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include <Alert.h>
|
#include <Alert.h>
|
||||||
|
#include <Catalog.h>
|
||||||
#include <Debug.h>
|
#include <Debug.h>
|
||||||
#include <Directory.h>
|
#include <Directory.h>
|
||||||
#include <File.h>
|
#include <File.h>
|
||||||
#include <Font.h>
|
#include <Font.h>
|
||||||
|
#include <Locale.h>
|
||||||
#include <MenuField.h>
|
#include <MenuField.h>
|
||||||
#include <Mime.h>
|
#include <Mime.h>
|
||||||
#include <NodeInfo.h>
|
#include <NodeInfo.h>
|
||||||
@@ -69,10 +71,15 @@ All rights reserved.
|
|||||||
#include "Model.h"
|
#include "Model.h"
|
||||||
#include "NavMenu.h"
|
#include "NavMenu.h"
|
||||||
#include "PoseView.h"
|
#include "PoseView.h"
|
||||||
|
#include "StringForSize.h"
|
||||||
#include "Tracker.h"
|
#include "Tracker.h"
|
||||||
#include "WidgetAttributeText.h"
|
#include "WidgetAttributeText.h"
|
||||||
|
|
||||||
|
|
||||||
|
#undef B_TRANSLATE_CONTEXT
|
||||||
|
#define B_TRANSLATE_CONTEXT "libtracker"
|
||||||
|
|
||||||
|
|
||||||
namespace BPrivate {
|
namespace BPrivate {
|
||||||
|
|
||||||
// States for tracking the mouse
|
// States for tracking the mouse
|
||||||
@@ -214,16 +221,6 @@ const uint32 kPaneSwitchClosed = 0;
|
|||||||
const uint32 kPaneSwitchOpen = 2;
|
const uint32 kPaneSwitchOpen = 2;
|
||||||
|
|
||||||
|
|
||||||
static BString &
|
|
||||||
PrintFloat(BString &result, float number)
|
|
||||||
{
|
|
||||||
char buffer[128];
|
|
||||||
sprintf(buffer, "%.1f", number);
|
|
||||||
result += buffer;
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
OpenParentAndSelectOriginal(const entry_ref *ref)
|
OpenParentAndSelectOriginal(const entry_ref *ref)
|
||||||
{
|
{
|
||||||
@@ -389,7 +386,7 @@ BInfoWindow::Show()
|
|||||||
if (!TargetModel()->IsVolume() && !TargetModel()->IsRoot()) {
|
if (!TargetModel()->IsVolume() && !TargetModel()->IsRoot()) {
|
||||||
if (TargetModel()->IsDirectory()) {
|
if (TargetModel()->IsDirectory()) {
|
||||||
// if this is a folder then spawn thread to calculate size
|
// if this is a folder then spawn thread to calculate size
|
||||||
SetSizeStr("calculating" B_UTF8_ELLIPSIS);
|
SetSizeStr(B_TRANSLATE("calculating" B_UTF8_ELLIPSIS));
|
||||||
fCalcThreadID = spawn_thread(BInfoWindow::CalcSize, "CalcSize",
|
fCalcThreadID = spawn_thread(BInfoWindow::CalcSize, "CalcSize",
|
||||||
B_NORMAL_PRIORITY, this);
|
B_NORMAL_PRIORITY, this);
|
||||||
resume_thread(fCalcThreadID);
|
resume_thread(fCalcThreadID);
|
||||||
@@ -402,8 +399,8 @@ BInfoWindow::Show()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
BString buffer;
|
BString buffer(B_TRANSLATE_COMMENT("%name info", "InfoWindow Title"));
|
||||||
buffer << TargetModel()->Name() << " info";
|
buffer.ReplaceFirst("%name", TargetModel()->Name());
|
||||||
SetTitle(buffer.String());
|
SetTitle(buffer.String());
|
||||||
|
|
||||||
lock.Unlock();
|
lock.Unlock();
|
||||||
@@ -461,7 +458,7 @@ BInfoWindow::MessageReceived(BMessage *message)
|
|||||||
|
|
||||||
// Start recalculating..
|
// Start recalculating..
|
||||||
fStopCalc = false;
|
fStopCalc = false;
|
||||||
SetSizeStr("calculating" B_UTF8_ELLIPSIS);
|
SetSizeStr(B_TRANSLATE("calculating" B_UTF8_ELLIPSIS));
|
||||||
fCalcThreadID = spawn_thread(BInfoWindow::CalcSize, "CalcSize",
|
fCalcThreadID = spawn_thread(BInfoWindow::CalcSize, "CalcSize",
|
||||||
B_NORMAL_PRIORITY, this);
|
B_NORMAL_PRIORITY, this);
|
||||||
resume_thread(fCalcThreadID);
|
resume_thread(fCalcThreadID);
|
||||||
@@ -652,8 +649,14 @@ BInfoWindow::MessageReceived(BMessage *message)
|
|||||||
void
|
void
|
||||||
BInfoWindow::GetSizeString(BString &result, off_t size, int32 fileCount)
|
BInfoWindow::GetSizeString(BString &result, off_t size, int32 fileCount)
|
||||||
{
|
{
|
||||||
char numStr[256];
|
char sizeBuffer[128];
|
||||||
sprintf(numStr, "%Ld", size);
|
result << string_for_size((double)size, sizeBuffer, sizeof(sizeBuffer));
|
||||||
|
|
||||||
|
// when we show the byte size, format it with a thousands delimiter (comma)
|
||||||
|
// TODO: use BCountry::FormatNumber
|
||||||
|
if (size >= kKBSize) {
|
||||||
|
char numStr[128];
|
||||||
|
snprintf(numStr, sizeof(numStr), "%Ld", size);
|
||||||
BString bytes;
|
BString bytes;
|
||||||
|
|
||||||
uint32 length = strlen(numStr);
|
uint32 length = strlen(numStr);
|
||||||
@@ -671,28 +674,20 @@ BInfoWindow::GetSizeString(BString &result, off_t size, int32 fileCount)
|
|||||||
charsTillComma = 3;
|
charsTillComma = 3;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else
|
}
|
||||||
bytes = numStr;
|
|
||||||
|
|
||||||
if (size >= kGBSize)
|
result << " " << B_TRANSLATE("(%bytes bytes)");
|
||||||
PrintFloat(result, (float)size / kGBSize) << " GiB";
|
// "bytes" translation could come from string_for_size
|
||||||
else if (size >= kMBSize)
|
// which could be part of the localekit itself
|
||||||
PrintFloat(result, (float)size / kMBSize) << " MiB";
|
result.ReplaceFirst("%bytes", bytes);
|
||||||
else if (size >= kKBSize)
|
}
|
||||||
result << (int64)(size + kHalfKBSize) / kKBSize << "KiB";
|
|
||||||
else
|
|
||||||
result << size;
|
|
||||||
|
|
||||||
if (size >= kKBSize)
|
if (fileCount != 0) {
|
||||||
result << " (" << bytes;
|
result << " " << B_TRANSLATE("for %num files");
|
||||||
|
BString countString;
|
||||||
result << " bytes";
|
countString << fileCount;
|
||||||
|
result.ReplaceFirst("%num", countString);
|
||||||
if (size >= kKBSize)
|
}
|
||||||
result << ")";
|
|
||||||
|
|
||||||
if (fileCount)
|
|
||||||
result << " for " << fileCount << " files";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -711,7 +706,7 @@ BInfoWindow::CalcSize(void *castToWindow)
|
|||||||
if (!lock)
|
if (!lock)
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
|
|
||||||
window->SetSizeStr("Error calculating folder size.");
|
window->SetSizeStr(B_TRANSLATE("Error calculating folder size."));
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -799,10 +794,10 @@ BInfoWindow::OpenFilePanel(const entry_ref *ref)
|
|||||||
false, &message);
|
false, &message);
|
||||||
|
|
||||||
if (fFilePanel != NULL) {
|
if (fFilePanel != NULL) {
|
||||||
fFilePanel->SetButtonLabel(B_DEFAULT_BUTTON,"Select");
|
fFilePanel->SetButtonLabel(B_DEFAULT_BUTTON, B_TRANSLATE("Select"));
|
||||||
fFilePanel->Window()->ResizeTo(500, 300);
|
fFilePanel->Window()->ResizeTo(500, 300);
|
||||||
BString title;
|
BString title(B_TRANSLATE_COMMENT("Link \"%name\" to:", "File dialog title for new sym link"));
|
||||||
title << "Link \"" << fModel->Name() << "\" to:";
|
title.ReplaceFirst("%name", fModel->Name());
|
||||||
fFilePanel->Window()->SetTitle(title.String());
|
fFilePanel->Window()->SetTitle(title.String());
|
||||||
fFilePanel->Show();
|
fFilePanel->Show();
|
||||||
fFilePanelOpen = true;
|
fFilePanelOpen = true;
|
||||||
@@ -880,7 +875,8 @@ AttributeView::AttributeView(BRect rect, Model *model)
|
|||||||
// Find offset for attributes, might be overiden below if there
|
// Find offset for attributes, might be overiden below if there
|
||||||
// is a prefered handle menu displayed
|
// is a prefered handle menu displayed
|
||||||
currentFont.SetSize(kAttribFontHeight);
|
currentFont.SetSize(kAttribFontHeight);
|
||||||
fDivider = currentFont.StringWidth("Modified:") + kBorderMargin + kBorderWidth + 1;
|
fDivider = currentFont.StringWidth(B_TRANSLATE("Modified:"))
|
||||||
|
+ kBorderMargin + kBorderWidth + 1;
|
||||||
// Add a preferred handler pop-up menu if this item
|
// Add a preferred handler pop-up menu if this item
|
||||||
// is a file...This goes in place of the Link To:
|
// is a file...This goes in place of the Link To:
|
||||||
// string...
|
// string...
|
||||||
@@ -897,12 +893,12 @@ AttributeView::AttributeView(BRect rect, Model *model)
|
|||||||
fTitleRect.bottom + (lineHeight * 7),
|
fTitleRect.bottom + (lineHeight * 7),
|
||||||
Bounds().Width() - 5, fTitleRect.bottom + (lineHeight * 8));
|
Bounds().Width() - 5, fTitleRect.bottom + (lineHeight * 8));
|
||||||
fPreferredAppMenu = new BMenuField(preferredAppRect, "", "", new BPopUpMenu(""));
|
fPreferredAppMenu = new BMenuField(preferredAppRect, "", "", new BPopUpMenu(""));
|
||||||
fDivider = currentFont.StringWidth("Opens with:") + 5;
|
fDivider = currentFont.StringWidth(B_TRANSLATE("Opens with:")) + 5;
|
||||||
fPreferredAppMenu->SetDivider(fDivider);
|
fPreferredAppMenu->SetDivider(fDivider);
|
||||||
fDivider += (preferredAppRect.left - 2);
|
fDivider += (preferredAppRect.left - 2);
|
||||||
fPreferredAppMenu->SetFont(¤tFont);
|
fPreferredAppMenu->SetFont(¤tFont);
|
||||||
fPreferredAppMenu->SetHighColor(kAttrTitleColor);
|
fPreferredAppMenu->SetHighColor(kAttrTitleColor);
|
||||||
fPreferredAppMenu->SetLabel("Opens with:");
|
fPreferredAppMenu->SetLabel(B_TRANSLATE("Opens with:"));
|
||||||
|
|
||||||
char prefSignature[B_MIME_TYPE_LENGTH];
|
char prefSignature[B_MIME_TYPE_LENGTH];
|
||||||
nodeInfo.GetPreferredApp(prefSignature);
|
nodeInfo.GetPreferredApp(prefSignature);
|
||||||
@@ -912,7 +908,8 @@ AttributeView::AttributeView(BRect rect, Model *model)
|
|||||||
|
|
||||||
// Add the default menu item and set it to marked
|
// Add the default menu item and set it to marked
|
||||||
BMenuItem *result;
|
BMenuItem *result;
|
||||||
result = new BMenuItem("Default application", new BMessage(kSetPreferredApp));
|
result = new BMenuItem(B_TRANSLATE("Default application"),
|
||||||
|
new BMessage(kSetPreferredApp));
|
||||||
result->SetTarget(this);
|
result->SetTarget(this);
|
||||||
fPreferredAppMenu->Menu()->AddItem(result);
|
fPreferredAppMenu->Menu()->AddItem(result);
|
||||||
result->SetMarked(true);
|
result->SetMarked(true);
|
||||||
@@ -952,7 +949,7 @@ AttributeView::AttributeView(BRect rect, Model *model)
|
|||||||
|
|
||||||
fPermissionsSwitch = new PaneSwitch(BRect(), "Permissions");
|
fPermissionsSwitch = new PaneSwitch(BRect(), "Permissions");
|
||||||
fPermissionsSwitch->SetMessage(new BMessage(kPermissionsSelected));
|
fPermissionsSwitch->SetMessage(new BMessage(kPermissionsSelected));
|
||||||
fPermissionsSwitch->SetLabels(NULL, "Permissions");
|
fPermissionsSwitch->SetLabels(NULL, B_TRANSLATE("Permissions"));
|
||||||
AddChild(fPermissionsSwitch);
|
AddChild(fPermissionsSwitch);
|
||||||
fPermissionsSwitch->ResizeToPreferred();
|
fPermissionsSwitch->ResizeToPreferred();
|
||||||
fPermissionsSwitch->MoveTo(kBorderWidth + 3,
|
fPermissionsSwitch->MoveTo(kBorderWidth + 3,
|
||||||
@@ -1547,17 +1544,22 @@ AttributeView::CheckAndSetSize()
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
fFreeBytes = freeBytes;
|
fFreeBytes = freeBytes;
|
||||||
char buffer[500];
|
|
||||||
if (capacity >= kGBSize)
|
|
||||||
sprintf(buffer, "%.1f G", (float)capacity / kGBSize);
|
|
||||||
else
|
|
||||||
sprintf(buffer, "%.1f M", (float)capacity / kMBSize);
|
|
||||||
|
|
||||||
sprintf(buffer + strlen(buffer), "B (%.1f MB used -- %.1f MB free)",
|
char capacityStr[16], usedStr[16], freeStr[16];
|
||||||
(float)(capacity - fFreeBytes) / kMBSize,
|
sprintf(usedStr, "%.1f", (float)(capacity - fFreeBytes) / kMBSize);
|
||||||
(float)fFreeBytes / kMBSize);
|
sprintf(freeStr, "%.1f", (float)fFreeBytes / kMBSize);
|
||||||
|
|
||||||
|
if (capacity >= kGBSize) {
|
||||||
|
fSizeStr.SetTo(B_TRANSLATE("%capacity GB (%used MB used -- %free MB free)"));
|
||||||
|
sprintf(capacityStr, "%.1f", (float)capacity / kGBSize);
|
||||||
|
} else {
|
||||||
|
fSizeStr.SetTo(B_TRANSLATE("%capacity MB (%used MB used -- %free MB free)"));
|
||||||
|
sprintf(capacityStr, "%.1f", (float)capacity / kMBSize);
|
||||||
|
}
|
||||||
|
fSizeStr.ReplaceFirst("%capacity", capacityStr);
|
||||||
|
fSizeStr.ReplaceFirst("%used", usedStr);
|
||||||
|
fSizeStr.ReplaceFirst("%free", freeStr);
|
||||||
|
|
||||||
fSizeStr = buffer;
|
|
||||||
} else if (fModel->IsFile()) {
|
} else if (fModel->IsFile()) {
|
||||||
// poll for size changes because they do not get node monitored
|
// poll for size changes because they do not get node monitored
|
||||||
// until a file gets closed (with the old BFS)
|
// until a file gets closed (with the old BFS)
|
||||||
@@ -1687,14 +1689,16 @@ AttributeView::Draw(BRect)
|
|||||||
// Capacity/size
|
// Capacity/size
|
||||||
SetHighColor(kAttrTitleColor);
|
SetHighColor(kAttrTitleColor);
|
||||||
if (fModel->IsVolume() || fModel->IsRoot()) {
|
if (fModel->IsVolume() || fModel->IsRoot()) {
|
||||||
MovePenTo(BPoint(fDivider - (StringWidth("Capacity:")), lineBase));
|
MovePenTo(BPoint(fDivider - (StringWidth(B_TRANSLATE("Capacity:"))),
|
||||||
DrawString("Capacity:");
|
lineBase));
|
||||||
|
DrawString(B_TRANSLATE("Capacity:"));
|
||||||
} else {
|
} else {
|
||||||
MovePenTo(BPoint(fDivider - (StringWidth("Size:")), lineBase));
|
MovePenTo(BPoint(fDivider - (StringWidth(B_TRANSLATE("Size:"))),
|
||||||
|
lineBase));
|
||||||
fSizeRect.left = fDivider + 2;
|
fSizeRect.left = fDivider + 2;
|
||||||
fSizeRect.top = lineBase - fontMetrics.ascent;
|
fSizeRect.top = lineBase - fontMetrics.ascent;
|
||||||
fSizeRect.bottom = lineBase + fontMetrics.descent;
|
fSizeRect.bottom = lineBase + fontMetrics.descent;
|
||||||
DrawString("Size:");
|
DrawString(B_TRANSLATE("Size:"));
|
||||||
}
|
}
|
||||||
|
|
||||||
MovePenTo(BPoint(fDivider + kDrawMargin, lineBase));
|
MovePenTo(BPoint(fDivider + kDrawMargin, lineBase));
|
||||||
@@ -1714,27 +1718,29 @@ AttributeView::Draw(BRect)
|
|||||||
|
|
||||||
// Created
|
// Created
|
||||||
SetHighColor(kAttrTitleColor);
|
SetHighColor(kAttrTitleColor);
|
||||||
MovePenTo(BPoint(fDivider - (StringWidth("Created:")), lineBase));
|
MovePenTo(BPoint(fDivider - (StringWidth(B_TRANSLATE("Created:"))),
|
||||||
|
lineBase));
|
||||||
SetHighColor(kAttrTitleColor);
|
SetHighColor(kAttrTitleColor);
|
||||||
DrawString("Created:");
|
DrawString(B_TRANSLATE("Created:"));
|
||||||
MovePenTo(BPoint(fDivider + kDrawMargin, lineBase));
|
MovePenTo(BPoint(fDivider + kDrawMargin, lineBase));
|
||||||
SetHighColor(kAttrValueColor);
|
SetHighColor(kAttrValueColor);
|
||||||
DrawString(fCreatedStr.String());
|
DrawString(fCreatedStr.String());
|
||||||
lineBase += lineHeight;
|
lineBase += lineHeight;
|
||||||
|
|
||||||
// Modified
|
// Modified
|
||||||
MovePenTo(BPoint(fDivider - (StringWidth("Modified:")), lineBase));
|
MovePenTo(BPoint(fDivider - (StringWidth(B_TRANSLATE("Modified:"))),
|
||||||
|
lineBase));
|
||||||
SetHighColor(kAttrTitleColor);
|
SetHighColor(kAttrTitleColor);
|
||||||
DrawString("Modified:");
|
DrawString(B_TRANSLATE("Modified:"));
|
||||||
MovePenTo(BPoint(fDivider + kDrawMargin, lineBase));
|
MovePenTo(BPoint(fDivider + kDrawMargin, lineBase));
|
||||||
SetHighColor(kAttrValueColor);
|
SetHighColor(kAttrValueColor);
|
||||||
DrawString(fModifiedStr.String());
|
DrawString(fModifiedStr.String());
|
||||||
lineBase += lineHeight;
|
lineBase += lineHeight;
|
||||||
|
|
||||||
// Kind
|
// Kind
|
||||||
MovePenTo(BPoint(fDivider - (StringWidth("Kind:")), lineBase));
|
MovePenTo(BPoint(fDivider - (StringWidth(B_TRANSLATE("Kind:"))), lineBase));
|
||||||
SetHighColor(kAttrTitleColor);
|
SetHighColor(kAttrTitleColor);
|
||||||
DrawString("Kind:");
|
DrawString(B_TRANSLATE("Kind:"));
|
||||||
MovePenTo(BPoint(fDivider + kDrawMargin, lineBase));
|
MovePenTo(BPoint(fDivider + kDrawMargin, lineBase));
|
||||||
SetHighColor(kAttrValueColor);
|
SetHighColor(kAttrValueColor);
|
||||||
DrawString(fKindStr.String());
|
DrawString(fKindStr.String());
|
||||||
@@ -1744,9 +1750,10 @@ AttributeView::Draw(BRect)
|
|||||||
GetFont(&normalFont);
|
GetFont(&normalFont);
|
||||||
|
|
||||||
// Path
|
// Path
|
||||||
MovePenTo(BPoint(fDivider - (StringWidth("Location:")), lineBase));
|
MovePenTo(BPoint(fDivider - (StringWidth(B_TRANSLATE("Location:"))),
|
||||||
|
lineBase));
|
||||||
SetHighColor(kAttrTitleColor);
|
SetHighColor(kAttrTitleColor);
|
||||||
DrawString("Location:");
|
DrawString(B_TRANSLATE("Location:"));
|
||||||
|
|
||||||
MovePenTo(BPoint(fDivider + kDrawMargin, lineBase));
|
MovePenTo(BPoint(fDivider + kDrawMargin, lineBase));
|
||||||
SetHighColor(kLinkColor);
|
SetHighColor(kLinkColor);
|
||||||
@@ -1770,9 +1777,10 @@ AttributeView::Draw(BRect)
|
|||||||
|
|
||||||
// Link to/version
|
// Link to/version
|
||||||
if (fModel->IsSymLink()) {
|
if (fModel->IsSymLink()) {
|
||||||
MovePenTo(BPoint(fDivider - (StringWidth("Link to:")), lineBase));
|
MovePenTo(BPoint(fDivider - (StringWidth(B_TRANSLATE("Link to:"))),
|
||||||
|
lineBase));
|
||||||
SetHighColor(kAttrTitleColor);
|
SetHighColor(kAttrTitleColor);
|
||||||
DrawString("Link To:");
|
DrawString(B_TRANSLATE("Link To:"));
|
||||||
MovePenTo(BPoint(fDivider + kDrawMargin, lineBase));
|
MovePenTo(BPoint(fDivider + kDrawMargin, lineBase));
|
||||||
SetHighColor(kLinkColor);
|
SetHighColor(kLinkColor);
|
||||||
|
|
||||||
@@ -1795,9 +1803,10 @@ AttributeView::Draw(BRect)
|
|||||||
fDescRect = BRect(-1, -1, -1, -1);
|
fDescRect = BRect(-1, -1, -1, -1);
|
||||||
} else if (fModel->IsExecutable()) {
|
} else if (fModel->IsExecutable()) {
|
||||||
//Version
|
//Version
|
||||||
MovePenTo(BPoint(fDivider - (StringWidth("Version:")), lineBase));
|
MovePenTo(BPoint(fDivider - (StringWidth(B_TRANSLATE("Version:"))),
|
||||||
|
lineBase));
|
||||||
SetHighColor(kAttrTitleColor);
|
SetHighColor(kAttrTitleColor);
|
||||||
DrawString("Version:");
|
DrawString(B_TRANSLATE("Version:"));
|
||||||
MovePenTo(BPoint(fDivider + kDrawMargin, lineBase));
|
MovePenTo(BPoint(fDivider + kDrawMargin, lineBase));
|
||||||
SetHighColor(kAttrValueColor);
|
SetHighColor(kAttrValueColor);
|
||||||
BString nameString;
|
BString nameString;
|
||||||
@@ -1808,9 +1817,10 @@ AttributeView::Draw(BRect)
|
|||||||
lineBase += lineHeight;
|
lineBase += lineHeight;
|
||||||
|
|
||||||
// Description
|
// Description
|
||||||
MovePenTo(BPoint(fDivider - (StringWidth("Description:")), lineBase));
|
MovePenTo(BPoint(fDivider - (StringWidth(B_TRANSLATE("Description:"))),
|
||||||
|
lineBase));
|
||||||
SetHighColor(kAttrTitleColor);
|
SetHighColor(kAttrTitleColor);
|
||||||
DrawString("Description:");
|
DrawString(B_TRANSLATE("Description:"));
|
||||||
MovePenTo(BPoint(fDivider + kDrawMargin, lineBase));
|
MovePenTo(BPoint(fDivider + kDrawMargin, lineBase));
|
||||||
SetHighColor(kAttrValueColor);
|
SetHighColor(kAttrValueColor);
|
||||||
// Check for truncation
|
// Check for truncation
|
||||||
@@ -1893,9 +1903,11 @@ AttributeView::FinishEditingTitle(bool commit)
|
|||||||
if (entry.InitCheck() == B_OK
|
if (entry.InitCheck() == B_OK
|
||||||
&& entry.GetParent(&parent) == B_OK) {
|
&& entry.GetParent(&parent) == B_OK) {
|
||||||
if (parent.Contains(text)) {
|
if (parent.Contains(text)) {
|
||||||
(new BAlert("", "That name is already taken. "
|
(new BAlert("",
|
||||||
"Please type another one.", "OK", 0, 0,
|
B_TRANSLATE("That name is already taken. "
|
||||||
B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go();
|
"Please type another one."),
|
||||||
|
B_TRANSLATE("OK"),
|
||||||
|
0, 0, B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go();
|
||||||
reopen = true;
|
reopen = true;
|
||||||
} else {
|
} else {
|
||||||
if (fModel->IsVolume()) {
|
if (fModel->IsVolume()) {
|
||||||
@@ -1914,9 +1926,11 @@ AttributeView::FinishEditingTitle(bool commit)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (length >= B_FILE_NAME_LENGTH) {
|
} else if (length >= B_FILE_NAME_LENGTH) {
|
||||||
(new BAlert("", "That name is too long. "
|
(new BAlert("",
|
||||||
"Please type another one.", "OK", 0, 0,
|
B_TRANSLATE("That name is too long. "
|
||||||
B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go();
|
"Please type another one."),
|
||||||
|
B_TRANSLATE("OK"),
|
||||||
|
0, 0, B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go();
|
||||||
reopen = true;
|
reopen = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2020,14 +2034,17 @@ AttributeView::BuildContextMenu(BMenu *parent)
|
|||||||
navigationItem->SetTarget(be_app);
|
navigationItem->SetTarget(be_app);
|
||||||
}
|
}
|
||||||
|
|
||||||
parent->AddItem(new BMenuItem("Open", new BMessage(kOpenSelection), 'O'));
|
parent->AddItem(new BMenuItem(B_TRANSLATE("Open"),
|
||||||
|
new BMessage(kOpenSelection), 'O'));
|
||||||
|
|
||||||
if (!model.IsTrash()) {
|
if (!model.IsTrash()) {
|
||||||
parent->AddItem(new BMenuItem("Edit name", new BMessage(kEditItem), 'E'));
|
parent->AddItem(new BMenuItem(B_TRANSLATE("Edit name"),
|
||||||
|
new BMessage(kEditItem), 'E'));
|
||||||
parent->AddSeparatorItem();
|
parent->AddSeparatorItem();
|
||||||
if (fModel->IsVolume()) {
|
if (fModel->IsVolume()) {
|
||||||
BMenuItem *item;
|
BMenuItem* item = new BMenuItem(B_TRANSLATE("Unmount"),
|
||||||
parent->AddItem(item = new BMenuItem("Unmount", new BMessage(kUnmountVolume), 'U'));
|
new BMessage(kUnmountVolume), 'U');
|
||||||
|
parent->AddItem(item);
|
||||||
// volume model, enable/disable the Unmount item
|
// volume model, enable/disable the Unmount item
|
||||||
BVolume boot;
|
BVolume boot;
|
||||||
BVolumeRoster().GetBootVolume(&boot);
|
BVolumeRoster().GetBootVolume(&boot);
|
||||||
@@ -2035,24 +2052,29 @@ AttributeView::BuildContextMenu(BMenu *parent)
|
|||||||
volume.SetTo(fModel->NodeRef()->device);
|
volume.SetTo(fModel->NodeRef()->device);
|
||||||
if (volume == boot)
|
if (volume == boot)
|
||||||
item->SetEnabled(false);
|
item->SetEnabled(false);
|
||||||
} else
|
} else {
|
||||||
parent->AddItem(new BMenuItem("Identify", new BMessage(kIdentifyEntry)));
|
parent->AddItem(new BMenuItem(B_TRANSLATE("Identify"),
|
||||||
} else
|
new BMessage(kIdentifyEntry)));
|
||||||
parent->AddItem(new BMenuItem("Empty Trash", new BMessage(kEmptyTrash)));
|
}
|
||||||
|
} else {
|
||||||
|
parent->AddItem(new BMenuItem(B_TRANSLATE("Empty Trash"),
|
||||||
|
new BMessage(kEmptyTrash)));
|
||||||
|
}
|
||||||
|
|
||||||
BMenuItem *sizeItem = NULL;
|
BMenuItem *sizeItem = NULL;
|
||||||
if (model.IsDirectory() && !model.IsVolume() && !model.IsRoot()) {
|
if (model.IsDirectory() && !model.IsVolume() && !model.IsRoot()) {
|
||||||
parent->AddItem(sizeItem = new BMenuItem("Recalculate folder size",
|
parent->AddItem(sizeItem = new BMenuItem(B_TRANSLATE("Recalculate folder size"),
|
||||||
new BMessage(kRecalculateSize)));
|
new BMessage(kRecalculateSize)));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (model.IsSymLink()) {
|
if (model.IsSymLink()) {
|
||||||
parent->AddItem(sizeItem = new BMenuItem("Set new link target",
|
parent->AddItem(sizeItem = new BMenuItem(B_TRANSLATE("Set new link target"),
|
||||||
new BMessage(kSetLinkTarget)));
|
new BMessage(kSetLinkTarget)));
|
||||||
}
|
}
|
||||||
|
|
||||||
parent->AddItem(new BSeparatorItem());
|
parent->AddItem(new BSeparatorItem());
|
||||||
parent->AddItem(new BMenuItem("Permissions", new BMessage(kPermissionsSelected), 'P'));
|
parent->AddItem(new BMenuItem(B_TRANSLATE("Permissions"),
|
||||||
|
new BMessage(kPermissionsSelected), 'P'));
|
||||||
|
|
||||||
parent->SetFont(be_plain_font);
|
parent->SetFont(be_plain_font);
|
||||||
parent->SetTargetForItems(this);
|
parent->SetTargetForItems(this);
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ UsePrivateHeaders interface mount shared storage tracker ;
|
|||||||
|
|
||||||
UseLibraryHeaders icon ;
|
UseLibraryHeaders icon ;
|
||||||
|
|
||||||
AddResources libtracker.so : TrackerIcons.rdef ;
|
AddResources libtracker.so : TrackerIcons.rdef libtracker.rdef ;
|
||||||
|
|
||||||
SubDirC++Flags
|
SubDirC++Flags
|
||||||
-D_BUILDING_tracker=1 -DOPEN_TRACKER=1
|
-D_BUILDING_tracker=1 -DOPEN_TRACKER=1
|
||||||
@@ -91,10 +91,45 @@ SharedLibrary libtracker.so :
|
|||||||
VolumeWindow.cpp
|
VolumeWindow.cpp
|
||||||
WidgetAttributeText.cpp
|
WidgetAttributeText.cpp
|
||||||
|
|
||||||
: be translation $(vector_icon_libs) $(TARGET_LIBSTDC++) libshared.a
|
: be translation $(vector_icon_libs) $(TARGET_LIBSTDC++) $(HAIKU_LOCALE_LIBS) libshared.a
|
||||||
|
|
||||||
;
|
;
|
||||||
|
|
||||||
|
DoCatalogs libtracker.so :
|
||||||
|
x-vnd.Haiku-libtracker
|
||||||
|
:
|
||||||
|
Tracker.cpp
|
||||||
|
AutoMounterSettings.cpp
|
||||||
|
ContainerWindow.cpp
|
||||||
|
CountView.cpp
|
||||||
|
DeskWindow.cpp
|
||||||
|
DirMenu.cpp
|
||||||
|
FavoritesMenu.cpp
|
||||||
|
FilePanelPriv.cpp
|
||||||
|
FilePermissionsView.cpp
|
||||||
|
FindPanel.cpp
|
||||||
|
FSClipboard.cpp
|
||||||
|
FSUtils.cpp
|
||||||
|
InfoWindow.cpp
|
||||||
|
Model.cpp
|
||||||
|
MountMenu.cpp
|
||||||
|
NavMenu.cpp
|
||||||
|
OpenWithWindow.cpp
|
||||||
|
PoseView.cpp
|
||||||
|
QueryContainerWindow.cpp
|
||||||
|
QueryPoseView.cpp
|
||||||
|
SelectionWindow.cpp
|
||||||
|
SettingsViews.cpp
|
||||||
|
SlowContextPopup.cpp
|
||||||
|
StatusWindow.cpp
|
||||||
|
TemplatesMenu.cpp
|
||||||
|
Tracker.cpp
|
||||||
|
TrackerInitialState.cpp
|
||||||
|
TrackerSettingsWindow.cpp
|
||||||
|
VolumeWindow.cpp
|
||||||
|
WidgetAttributeText.cpp
|
||||||
|
;
|
||||||
|
|
||||||
|
|
||||||
if $(TARGET_PLATFORM) = libbe_test {
|
if $(TARGET_PLATFORM) = libbe_test {
|
||||||
HaikuInstall install-test-apps : $(HAIKU_APP_TEST_LIB_DIR) : libtracker.so
|
HaikuInstall install-test-apps : $(HAIKU_APP_TEST_LIB_DIR) : libtracker.so
|
||||||
: tests!apps ;
|
: tests!apps ;
|
||||||
|
|||||||
@@ -46,10 +46,12 @@ All rights reserved.
|
|||||||
|
|
||||||
#include <AppDefs.h>
|
#include <AppDefs.h>
|
||||||
#include <Bitmap.h>
|
#include <Bitmap.h>
|
||||||
|
#include <Catalog.h>
|
||||||
#include <Debug.h>
|
#include <Debug.h>
|
||||||
#include <Directory.h>
|
#include <Directory.h>
|
||||||
#include <Entry.h>
|
#include <Entry.h>
|
||||||
#include <File.h>
|
#include <File.h>
|
||||||
|
#include <Locale.h>
|
||||||
#include <NodeInfo.h>
|
#include <NodeInfo.h>
|
||||||
#include <NodeMonitor.h>
|
#include <NodeMonitor.h>
|
||||||
#include <Path.h>
|
#include <Path.h>
|
||||||
@@ -83,6 +85,9 @@ bool CheckNodeIconHintPrivate(const BNode *, bool);
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#undef B_TRANSLATE_CONTEXT
|
||||||
|
#define B_TRANSLATE_CONTEXT "libtracker"
|
||||||
|
|
||||||
Model::Model()
|
Model::Model()
|
||||||
:
|
:
|
||||||
fPreferredAppName(NULL),
|
fPreferredAppName(NULL),
|
||||||
@@ -328,20 +333,23 @@ Model::CompareFolderNamesFirst(const Model *compareModel) const
|
|||||||
const char *
|
const char *
|
||||||
Model::Name() const
|
Model::Name() const
|
||||||
{
|
{
|
||||||
|
static const char* kRootNodeName = B_TRANSLATE_MARK("Disks");
|
||||||
|
static const char* kTrashNodeName = B_TRANSLATE_MARK("Trash");
|
||||||
|
static const char* kDesktopNodeName = B_TRANSLATE_MARK("Desktop");
|
||||||
|
|
||||||
switch (fBaseType) {
|
switch (fBaseType) {
|
||||||
case kRootNode:
|
case kRootNode:
|
||||||
return "Disks";
|
return B_TRANSLATE(kRootNodeName);
|
||||||
|
|
||||||
case kVolumeNode:
|
case kVolumeNode:
|
||||||
if (fVolumeName)
|
if (fVolumeName)
|
||||||
return fVolumeName;
|
return fVolumeName;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case kTrashNode:
|
case kTrashNode:
|
||||||
return "Trash";
|
return B_TRANSLATE(kTrashNodeName);
|
||||||
|
|
||||||
case kDesktopNode:
|
case kDesktopNode:
|
||||||
return "Desktop";
|
return B_TRANSLATE(kDesktopNodeName);
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -34,7 +34,9 @@ All rights reserved.
|
|||||||
|
|
||||||
// MountMenu implements a context menu used for mounting/unmounting volumes
|
// MountMenu implements a context menu used for mounting/unmounting volumes
|
||||||
|
|
||||||
|
#include <Catalog.h>
|
||||||
#include <Debug.h>
|
#include <Debug.h>
|
||||||
|
#include <Locale.h>
|
||||||
#include <MenuItem.h>
|
#include <MenuItem.h>
|
||||||
#include <Mime.h>
|
#include <Mime.h>
|
||||||
#include <InterfaceDefs.h>
|
#include <InterfaceDefs.h>
|
||||||
@@ -154,6 +156,9 @@ AddMenuItemVisitor::Visit(BPartition *partition, int32 level)
|
|||||||
// #pragma mark -
|
// #pragma mark -
|
||||||
|
|
||||||
|
|
||||||
|
#undef B_TRANSLATE_CONTEXT
|
||||||
|
#define B_TRANSLATE_CONTEXT "libtracker"
|
||||||
|
|
||||||
MountMenu::MountMenu(const char *name)
|
MountMenu::MountMenu(const char *name)
|
||||||
: BMenu(name)
|
: BMenu(name)
|
||||||
{
|
{
|
||||||
@@ -214,10 +219,11 @@ MountMenu::AddDynamicItem(add_state)
|
|||||||
|
|
||||||
AddSeparatorItem();
|
AddSeparatorItem();
|
||||||
|
|
||||||
BMenuItem *mountAll = new BMenuItem("Mount all",
|
BMenuItem* mountAll = new BMenuItem(B_TRANSLATE("Mount all"),
|
||||||
new BMessage(kMountAllNow));
|
new BMessage(kMountAllNow));
|
||||||
AddItem(mountAll);
|
AddItem(mountAll);
|
||||||
BMenuItem *mountSettings = new BMenuItem("Settings" B_UTF8_ELLIPSIS,
|
BMenuItem* mountSettings = new BMenuItem(
|
||||||
|
B_TRANSLATE("Settings" B_UTF8_ELLIPSIS),
|
||||||
new BMessage(kRunAutomounterSettings));
|
new BMessage(kRunAutomounterSettings));
|
||||||
AddItem(mountSettings);
|
AddItem(mountSettings);
|
||||||
|
|
||||||
|
|||||||
@@ -42,7 +42,9 @@ All rights reserved.
|
|||||||
|
|
||||||
#include <StopWatch.h>
|
#include <StopWatch.h>
|
||||||
#include <Application.h>
|
#include <Application.h>
|
||||||
|
#include <Catalog.h>
|
||||||
#include <Directory.h>
|
#include <Directory.h>
|
||||||
|
#include <Locale.h>
|
||||||
#include <Query.h>
|
#include <Query.h>
|
||||||
#include <Path.h>
|
#include <Path.h>
|
||||||
#include <Screen.h>
|
#include <Screen.h>
|
||||||
@@ -244,6 +246,9 @@ SpringLoadedFolderCacheDragData(const BMessage *incoming, BMessage **message, BO
|
|||||||
// #pragma mark -
|
// #pragma mark -
|
||||||
|
|
||||||
|
|
||||||
|
#undef B_TRANSLATE_CONTEXT
|
||||||
|
#define B_TRANSLATE_CONTEXT "libtracker"
|
||||||
|
|
||||||
BNavMenu::BNavMenu(const char *title, uint32 message, const BHandler *target,
|
BNavMenu::BNavMenu(const char *title, uint32 message, const BHandler *target,
|
||||||
BWindow *parentWindow, const BObjectList<BString> *list)
|
BWindow *parentWindow, const BObjectList<BString> *list)
|
||||||
: BSlowMenu(title),
|
: BSlowMenu(title),
|
||||||
@@ -722,7 +727,7 @@ BNavMenu::DoneBuildingItemList()
|
|||||||
fItemList->MakeEmpty();
|
fItemList->MakeEmpty();
|
||||||
|
|
||||||
if (!count) {
|
if (!count) {
|
||||||
BMenuItem *item = new BMenuItem("Empty folder", 0);
|
BMenuItem *item = new BMenuItem(B_TRANSLATE("Empty folder"), 0);
|
||||||
item->SetEnabled(false);
|
item->SetEnabled(false);
|
||||||
AddItem(item);
|
AddItem(item);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,6 +44,8 @@ All rights reserved.
|
|||||||
|
|
||||||
#include <Alert.h>
|
#include <Alert.h>
|
||||||
#include <Button.h>
|
#include <Button.h>
|
||||||
|
#include <Catalog.h>
|
||||||
|
#include <Locale.h>
|
||||||
#include <Mime.h>
|
#include <Mime.h>
|
||||||
#include <NodeInfo.h>
|
#include <NodeInfo.h>
|
||||||
#include <Path.h>
|
#include <Path.h>
|
||||||
@@ -55,6 +57,7 @@ All rights reserved.
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
|
||||||
const char *kDefaultOpenWithTemplate = "OpenWithSettings";
|
const char *kDefaultOpenWithTemplate = "OpenWithSettings";
|
||||||
|
|
||||||
// ToDo:
|
// ToDo:
|
||||||
@@ -70,6 +73,9 @@ const int32 kOpenAndMakeDefault = 'OpDf';
|
|||||||
const rgb_color kOpenWithDefaultColor = { 0xFF, 0xFF, 0xCC, 255};
|
const rgb_color kOpenWithDefaultColor = { 0xFF, 0xFF, 0xCC, 255};
|
||||||
|
|
||||||
|
|
||||||
|
#undef B_TRANSLATE_CONTEXT
|
||||||
|
#define B_TRANSLATE_CONTEXT "libtracker"
|
||||||
|
|
||||||
OpenWithContainerWindow::OpenWithContainerWindow(BMessage *entriesToOpen,
|
OpenWithContainerWindow::OpenWithContainerWindow(BMessage *entriesToOpen,
|
||||||
LockingList<BWindow> *windowList, window_look look, window_feel feel,
|
LockingList<BWindow> *windowList, window_look look, window_feel feel,
|
||||||
uint32 flags, uint32 workspace)
|
uint32 flags, uint32 workspace)
|
||||||
@@ -92,7 +98,7 @@ OpenWithContainerWindow::OpenWithContainerWindow(BMessage *entriesToOpen,
|
|||||||
|
|
||||||
// add buttons
|
// add buttons
|
||||||
|
|
||||||
fLaunchButton = new BButton(rect, "ok", "Open",
|
fLaunchButton = new BButton(rect, "ok", B_TRANSLATE("Open"),
|
||||||
new BMessage(kDefaultButton), B_FOLLOW_RIGHT | B_FOLLOW_BOTTOM);
|
new BMessage(kDefaultButton), B_FOLLOW_RIGHT | B_FOLLOW_BOTTOM);
|
||||||
fLaunchButton->ResizeToPreferred();
|
fLaunchButton->ResizeToPreferred();
|
||||||
fLaunchButton->MoveTo(rect.right - 10 - kDocumentKnobWidth
|
fLaunchButton->MoveTo(rect.right - 10 - kDocumentKnobWidth
|
||||||
@@ -102,7 +108,7 @@ OpenWithContainerWindow::OpenWithContainerWindow(BMessage *entriesToOpen,
|
|||||||
|
|
||||||
BRect buttonRect = fLaunchButton->Frame();
|
BRect buttonRect = fLaunchButton->Frame();
|
||||||
fLaunchAndMakeDefaultButton = new BButton(buttonRect, "make default",
|
fLaunchAndMakeDefaultButton = new BButton(buttonRect, "make default",
|
||||||
"Open and make preferred", new BMessage(kOpenAndMakeDefault),
|
B_TRANSLATE("Open and make preferred"), new BMessage(kOpenAndMakeDefault),
|
||||||
B_FOLLOW_RIGHT | B_FOLLOW_BOTTOM);
|
B_FOLLOW_RIGHT | B_FOLLOW_BOTTOM);
|
||||||
// wide button, have to resize to fit text
|
// wide button, have to resize to fit text
|
||||||
fLaunchAndMakeDefaultButton->ResizeToPreferred();
|
fLaunchAndMakeDefaultButton->ResizeToPreferred();
|
||||||
@@ -112,7 +118,7 @@ OpenWithContainerWindow::OpenWithContainerWindow(BMessage *entriesToOpen,
|
|||||||
fLaunchAndMakeDefaultButton->SetEnabled(false);
|
fLaunchAndMakeDefaultButton->SetEnabled(false);
|
||||||
|
|
||||||
buttonRect = fLaunchAndMakeDefaultButton->Frame();
|
buttonRect = fLaunchAndMakeDefaultButton->Frame();
|
||||||
BButton *button = new BButton(buttonRect, "cancel", "Cancel",
|
BButton *button = new BButton(buttonRect, "cancel", B_TRANSLATE("Cancel"),
|
||||||
new BMessage(kCancelButton), B_FOLLOW_RIGHT | B_FOLLOW_BOTTOM);
|
new BMessage(kCancelButton), B_FOLLOW_RIGHT | B_FOLLOW_BOTTOM);
|
||||||
button->ResizeToPreferred();
|
button->ResizeToPreferred();
|
||||||
button->MoveBy(- 10 - button->Bounds().Width(), 0);
|
button->MoveBy(- 10 - button->Bounds().Width(), 0);
|
||||||
@@ -147,7 +153,7 @@ OpenWithContainerWindow::OpenWithContainerWindow(BMessage *entriesToOpen,
|
|||||||
SetTitle(buffer.String());
|
SetTitle(buffer.String());
|
||||||
} else
|
} else
|
||||||
// use generic title
|
// use generic title
|
||||||
SetTitle("Open selection with:");
|
SetTitle(B_TRANSLATE("Open selection with:"));
|
||||||
|
|
||||||
AddCommonFilter(new BMessageFilter(B_KEY_DOWN, &OpenWithContainerWindow::KeyDownFilter));
|
AddCommonFilter(new BMessageFilter(B_KEY_DOWN, &OpenWithContainerWindow::KeyDownFilter));
|
||||||
}
|
}
|
||||||
@@ -377,7 +383,7 @@ OpenWithContainerWindow::NewAttributeMenu(BMenu *menu)
|
|||||||
message->AddInt32("attr_align", B_ALIGN_LEFT);
|
message->AddInt32("attr_align", B_ALIGN_LEFT);
|
||||||
message->AddBool("attr_editable", false);
|
message->AddBool("attr_editable", false);
|
||||||
message->AddBool("attr_statfield", false);
|
message->AddBool("attr_statfield", false);
|
||||||
BMenuItem *item = new BMenuItem("Relation", message);
|
BMenuItem *item = new BMenuItem(B_TRANSLATE("Relation"), message);
|
||||||
menu->AddItem(item);
|
menu->AddItem(item);
|
||||||
message = new BMessage(kAttributeItem);
|
message = new BMessage(kAttributeItem);
|
||||||
message->AddString("attr_name", kAttrAppVersion);
|
message->AddString("attr_name", kAttrAppVersion);
|
||||||
@@ -387,7 +393,7 @@ OpenWithContainerWindow::NewAttributeMenu(BMenu *menu)
|
|||||||
message->AddInt32("attr_align", B_ALIGN_LEFT);
|
message->AddInt32("attr_align", B_ALIGN_LEFT);
|
||||||
message->AddBool("attr_editable", false);
|
message->AddBool("attr_editable", false);
|
||||||
message->AddBool("attr_statfield", false);
|
message->AddBool("attr_statfield", false);
|
||||||
item = new BMenuItem("Version", message);
|
item = new BMenuItem(B_TRANSLATE("Version"), message);
|
||||||
menu->AddItem(item);
|
menu->AddItem(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -662,8 +668,8 @@ OpenWithPoseView::OpenSelection(BPose *pose, int32 *)
|
|||||||
errorString << "Could not find application \""
|
errorString << "Could not find application \""
|
||||||
<< pose->TargetModel()->Name() << "\"";
|
<< pose->TargetModel()->Name() << "\"";
|
||||||
|
|
||||||
(new BAlert("", errorString.String(), "OK", 0, 0, B_WIDTH_AS_USUAL,
|
(new BAlert("", errorString.String(), B_TRANSLATE("OK"), 0, 0,
|
||||||
B_WARNING_ALERT))->Go();
|
B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -677,8 +683,9 @@ 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.";
|
||||||
|
|
||||||
BAlert *alert = new BAlert("", warning.String(),
|
BAlert* alert = new BAlert("", warning.String(),
|
||||||
"Cancel", "Open", 0, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
|
B_TRANSLATE("Cancel"), B_TRANSLATE("Open"), 0, B_WIDTH_AS_USUAL,
|
||||||
|
B_WARNING_ALERT);
|
||||||
alert->SetShortcut(0, B_ESCAPE);
|
alert->SetShortcut(0, B_ESCAPE);
|
||||||
if (alert->Go() == 0)
|
if (alert->Go() == 0)
|
||||||
return;
|
return;
|
||||||
@@ -756,16 +763,16 @@ OpenWithPoseView::SetUpDefaultColumnsIfNeeded()
|
|||||||
if (fColumnList->CountItems() != 0)
|
if (fColumnList->CountItems() != 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
BColumn *nameColumn = new BColumn("Name", kColumnStart, 125, B_ALIGN_LEFT,
|
BColumn *nameColumn = new BColumn(B_TRANSLATE("Name"), kColumnStart, 125,
|
||||||
kAttrStatName, B_STRING_TYPE, true, true);
|
B_ALIGN_LEFT, kAttrStatName, B_STRING_TYPE, true, true);
|
||||||
fColumnList->AddItem(nameColumn);
|
fColumnList->AddItem(nameColumn);
|
||||||
BColumn *relationColumn = new BColumn("Relation", 180, 100, B_ALIGN_LEFT,
|
BColumn *relationColumn = new BColumn(B_TRANSLATE("Relation"), 180, 100,
|
||||||
kAttrOpenWithRelation, B_STRING_TYPE, false, false);
|
B_ALIGN_LEFT, kAttrOpenWithRelation, B_STRING_TYPE, false, false);
|
||||||
fColumnList->AddItem(relationColumn);
|
fColumnList->AddItem(relationColumn);
|
||||||
fColumnList->AddItem(new BColumn("Location", 290, 225, B_ALIGN_LEFT,
|
fColumnList->AddItem(new BColumn(B_TRANSLATE("Location"), 290, 225,
|
||||||
kAttrPath, B_STRING_TYPE, true, false));
|
B_ALIGN_LEFT, kAttrPath, B_STRING_TYPE, true, false));
|
||||||
fColumnList->AddItem(new BColumn("Version", 525, 70, B_ALIGN_LEFT,
|
fColumnList->AddItem(new BColumn(B_TRANSLATE("Version"), 525, 70,
|
||||||
kAttrAppVersion, B_STRING_TYPE, false, false));
|
B_ALIGN_LEFT, kAttrAppVersion, B_STRING_TYPE, false, false));
|
||||||
|
|
||||||
// sort by relation and by name
|
// sort by relation and by name
|
||||||
SetPrimarySort(relationColumn->AttrHash());
|
SetPrimarySort(relationColumn->AttrHash());
|
||||||
@@ -1152,7 +1159,7 @@ OpenWithMenu::DoneBuildingItemList()
|
|||||||
SetTargetForItems(fMessenger);
|
SetTargetForItems(fMessenger);
|
||||||
|
|
||||||
if (!CountItems()) {
|
if (!CountItems()) {
|
||||||
BMenuItem *item = new BMenuItem("no supporting apps", 0);
|
BMenuItem* item = new BMenuItem(B_TRANSLATE("no supporting apps"), 0);
|
||||||
item->SetEnabled(false);
|
item->SetEnabled(false);
|
||||||
AddItem(item);
|
AddItem(item);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ All rights reserved.
|
|||||||
|
|
||||||
#include <Alert.h>
|
#include <Alert.h>
|
||||||
#include <Application.h>
|
#include <Application.h>
|
||||||
|
#include <Catalog.h>
|
||||||
#include <Clipboard.h>
|
#include <Clipboard.h>
|
||||||
#include <Debug.h>
|
#include <Debug.h>
|
||||||
#include <Dragger.h>
|
#include <Dragger.h>
|
||||||
@@ -51,6 +52,7 @@ All rights reserved.
|
|||||||
#include <Screen.h>
|
#include <Screen.h>
|
||||||
#include <Query.h>
|
#include <Query.h>
|
||||||
#include <List.h>
|
#include <List.h>
|
||||||
|
#include <Locale.h>
|
||||||
#include <MenuItem.h>
|
#include <MenuItem.h>
|
||||||
#include <NodeMonitor.h>
|
#include <NodeMonitor.h>
|
||||||
#include <Path.h>
|
#include <Path.h>
|
||||||
@@ -93,6 +95,9 @@ All rights reserved.
|
|||||||
#include "WidthBuffer.h"
|
#include "WidthBuffer.h"
|
||||||
|
|
||||||
|
|
||||||
|
#undef B_TRANSLATE_CONTEXT
|
||||||
|
#define B_TRANSLATE_CONTEXT "libtracker"
|
||||||
|
|
||||||
using std::min;
|
using std::min;
|
||||||
using std::max;
|
using std::max;
|
||||||
|
|
||||||
@@ -4083,24 +4088,23 @@ RunMimeTypeDestinationMenu(const char *actionText, const BObjectList<BString> *t
|
|||||||
} else if (types)
|
} else if (types)
|
||||||
description = embedTypeAs;
|
description = embedTypeAs;
|
||||||
|
|
||||||
const char *labelText;
|
BString labelText;
|
||||||
char text[1024];
|
|
||||||
if (actionText) {
|
if (actionText) {
|
||||||
int32 length = 1024 - 1 - (int32)strlen(actionText);
|
int32 length = 1024 - 1 - (int32)strlen(actionText);
|
||||||
if (length > 0) {
|
if (length > 0) {
|
||||||
description.Truncate(length);
|
description.Truncate(length);
|
||||||
sprintf(text, actionText, description.String());
|
labelText.SetTo(actionText);
|
||||||
labelText = text;
|
labelText.ReplaceFirst("%s", description.String());
|
||||||
} else
|
} else
|
||||||
labelText = "label too long";
|
labelText.SetTo(B_TRANSLATE("label too long"));
|
||||||
} else
|
} else
|
||||||
labelText = description.String();
|
labelText = description;
|
||||||
|
|
||||||
menu->AddItem(new BMenuItem(labelText, 0));
|
menu->AddItem(new BMenuItem(labelText.String(), 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
menu->AddSeparatorItem();
|
menu->AddSeparatorItem();
|
||||||
menu->AddItem(new BMenuItem("Cancel", 0));
|
menu->AddItem(new BMenuItem(B_TRANSLATE("Cancel"), 0));
|
||||||
|
|
||||||
int32 result = -1;
|
int32 result = -1;
|
||||||
BMenuItem *resultingItem = menu->Go(where, false, true);
|
BMenuItem *resultingItem = menu->Go(where, false, true);
|
||||||
@@ -4254,7 +4258,8 @@ BPoseView::HandleDropCommon(BMessage *message, Model *targetModel, BPose *target
|
|||||||
if (specificActionIndex == -1)
|
if (specificActionIndex == -1)
|
||||||
return false;
|
return false;
|
||||||
} else if (types.CountItems() > 0) {
|
} else if (types.CountItems() > 0) {
|
||||||
specificTypeIndex = RunMimeTypeDestinationMenu("Create %s clipping",
|
specificTypeIndex = RunMimeTypeDestinationMenu(
|
||||||
|
B_TRANSLATE("Create %s clipping"),
|
||||||
&types, &typeNames, view->ConvertToScreen(dropPt));
|
&types, &typeNames, view->ConvertToScreen(dropPt));
|
||||||
|
|
||||||
if (specificTypeIndex == -1)
|
if (specificTypeIndex == -1)
|
||||||
|
|||||||
@@ -32,6 +32,8 @@ names are registered trademarks or trademarks of their respective holders.
|
|||||||
All rights reserved.
|
All rights reserved.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <Catalog.h>
|
||||||
|
#include <Locale.h>
|
||||||
#include <Menu.h>
|
#include <Menu.h>
|
||||||
#include <MenuItem.h>
|
#include <MenuItem.h>
|
||||||
#include <Path.h>
|
#include <Path.h>
|
||||||
@@ -45,6 +47,9 @@ All rights reserved.
|
|||||||
#include "QueryPoseView.h"
|
#include "QueryPoseView.h"
|
||||||
|
|
||||||
|
|
||||||
|
#undef B_TRANSLATE_CONTEXT
|
||||||
|
#define B_TRANSLATE_CONTEXT "libtracker"
|
||||||
|
|
||||||
BQueryContainerWindow::BQueryContainerWindow(LockingList<BWindow> *windowList,
|
BQueryContainerWindow::BQueryContainerWindow(LockingList<BWindow> *windowList,
|
||||||
uint32 containerWindowFlags, window_look look,
|
uint32 containerWindowFlags, window_look look,
|
||||||
window_feel feel, uint32 flags, uint32 workspace)
|
window_feel feel, uint32 flags, uint32 workspace)
|
||||||
@@ -85,23 +90,28 @@ BQueryContainerWindow::AddWindowMenu(BMenu *menu)
|
|||||||
{
|
{
|
||||||
BMenuItem *item;
|
BMenuItem *item;
|
||||||
|
|
||||||
item = new BMenuItem("Resize to fit", new BMessage(kResizeToFit), 'Y');
|
item = new BMenuItem(B_TRANSLATE("Resize to fit"),
|
||||||
|
new BMessage(kResizeToFit), 'Y');
|
||||||
item->SetTarget(this);
|
item->SetTarget(this);
|
||||||
menu->AddItem(item);
|
menu->AddItem(item);
|
||||||
|
|
||||||
item = new BMenuItem("Select"B_UTF8_ELLIPSIS, new BMessage(kShowSelectionWindow), 'A', B_SHIFT_KEY);
|
item = new BMenuItem(B_TRANSLATE("Select"B_UTF8_ELLIPSIS),
|
||||||
|
new BMessage(kShowSelectionWindow), 'A', B_SHIFT_KEY);
|
||||||
item->SetTarget(PoseView());
|
item->SetTarget(PoseView());
|
||||||
menu->AddItem(item);
|
menu->AddItem(item);
|
||||||
|
|
||||||
item = new BMenuItem("Select all", new BMessage(B_SELECT_ALL), 'A');
|
item = new BMenuItem(B_TRANSLATE("Select all"), new BMessage(B_SELECT_ALL),
|
||||||
|
'A');
|
||||||
item->SetTarget(PoseView());
|
item->SetTarget(PoseView());
|
||||||
menu->AddItem(item);
|
menu->AddItem(item);
|
||||||
|
|
||||||
item = new BMenuItem("Invert selection", new BMessage(kInvertSelection), 'S');
|
item = new BMenuItem(B_TRANSLATE("Invert selection"),
|
||||||
|
new BMessage(kInvertSelection), 'S');
|
||||||
item->SetTarget(PoseView());
|
item->SetTarget(PoseView());
|
||||||
menu->AddItem(item);
|
menu->AddItem(item);
|
||||||
|
|
||||||
item = new BMenuItem("Close", new BMessage(B_QUIT_REQUESTED), 'W');
|
item = new BMenuItem(B_TRANSLATE("Close"), new BMessage(B_QUIT_REQUESTED),
|
||||||
|
'W');
|
||||||
item->SetTarget(this);
|
item->SetTarget(this);
|
||||||
menu->AddItem(item);
|
menu->AddItem(item);
|
||||||
}
|
}
|
||||||
@@ -110,12 +120,14 @@ BQueryContainerWindow::AddWindowMenu(BMenu *menu)
|
|||||||
void
|
void
|
||||||
BQueryContainerWindow::AddWindowContextMenus(BMenu *menu)
|
BQueryContainerWindow::AddWindowContextMenus(BMenu *menu)
|
||||||
{
|
{
|
||||||
BMenuItem *resizeItem = new BMenuItem("Resize to Fit",
|
BMenuItem* resizeItem = new BMenuItem(B_TRANSLATE("Resize to Fit"),
|
||||||
new BMessage(kResizeToFit), 'Y');
|
new BMessage(kResizeToFit), 'Y');
|
||||||
menu->AddItem(resizeItem);
|
menu->AddItem(resizeItem);
|
||||||
menu->AddItem(new BMenuItem("Select"B_UTF8_ELLIPSIS, new BMessage(kShowSelectionWindow), 'A', B_SHIFT_KEY));
|
menu->AddItem(new BMenuItem(B_TRANSLATE("Select"B_UTF8_ELLIPSIS),
|
||||||
menu->AddItem(new BMenuItem("Select all", new BMessage(B_SELECT_ALL), 'A'));
|
new BMessage(kShowSelectionWindow), 'A', B_SHIFT_KEY));
|
||||||
BMenuItem *closeItem = new BMenuItem("Close",
|
menu->AddItem(new BMenuItem(B_TRANSLATE("Select all"),
|
||||||
|
new BMessage(B_SELECT_ALL), 'A'));
|
||||||
|
BMenuItem* closeItem = new BMenuItem(B_TRANSLATE("Close"),
|
||||||
new BMessage(B_QUIT_REQUESTED), 'W');
|
new BMessage(B_QUIT_REQUESTED), 'W');
|
||||||
menu->AddItem(closeItem);
|
menu->AddItem(closeItem);
|
||||||
// target items as needed
|
// target items as needed
|
||||||
|
|||||||
@@ -35,7 +35,9 @@ All rights reserved.
|
|||||||
|
|
||||||
#include <new>
|
#include <new>
|
||||||
|
|
||||||
|
#include <Catalog.h>
|
||||||
#include <Debug.h>
|
#include <Debug.h>
|
||||||
|
#include <Locale.h>
|
||||||
#include <NodeMonitor.h>
|
#include <NodeMonitor.h>
|
||||||
#include <Query.h>
|
#include <Query.h>
|
||||||
#include <Volume.h>
|
#include <Volume.h>
|
||||||
@@ -54,6 +56,10 @@ All rights reserved.
|
|||||||
|
|
||||||
#include <fs_attr.h>
|
#include <fs_attr.h>
|
||||||
|
|
||||||
|
|
||||||
|
#undef B_TRANSLATE_CONTEXT
|
||||||
|
#define B_TRANSLATE_CONTEXT "libtracker"
|
||||||
|
|
||||||
using std::nothrow;
|
using std::nothrow;
|
||||||
|
|
||||||
// Currently filtering out Trash doesn't node monitor too well - if you
|
// Currently filtering out Trash doesn't node monitor too well - if you
|
||||||
@@ -113,14 +119,14 @@ BQueryPoseView::SetUpDefaultColumnsIfNeeded()
|
|||||||
if (fColumnList->CountItems() != 0)
|
if (fColumnList->CountItems() != 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
fColumnList->AddItem(new BColumn("Name", kColumnStart, 145, B_ALIGN_LEFT,
|
fColumnList->AddItem(new BColumn(B_TRANSLATE("Name"), kColumnStart, 145,
|
||||||
kAttrStatName, B_STRING_TYPE, true, true));
|
B_ALIGN_LEFT, kAttrStatName, B_STRING_TYPE, true, true));
|
||||||
fColumnList->AddItem(new BColumn("Location", 200, 225, B_ALIGN_LEFT,
|
fColumnList->AddItem(new BColumn(B_TRANSLATE("Location"), 200, 225,
|
||||||
kAttrPath, B_STRING_TYPE, true, false));
|
B_ALIGN_LEFT, kAttrPath, B_STRING_TYPE, true, false));
|
||||||
fColumnList->AddItem(new BColumn("Size", 440, 80, B_ALIGN_RIGHT,
|
fColumnList->AddItem(new BColumn(B_TRANSLATE("Size"), 440, 80,
|
||||||
kAttrStatSize, B_OFF_T_TYPE, true, false));
|
B_ALIGN_RIGHT, kAttrStatSize, B_OFF_T_TYPE, true, false));
|
||||||
fColumnList->AddItem(new BColumn("Modified", 535, 150, B_ALIGN_LEFT,
|
fColumnList->AddItem(new BColumn(B_TRANSLATE("Modified"), 535, 150,
|
||||||
kAttrStatModified, B_TIME_TYPE, true, false));
|
B_ALIGN_LEFT, kAttrStatModified, B_TIME_TYPE, true, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -35,6 +35,8 @@ All rights reserved.
|
|||||||
#include <BeBuild.h>
|
#include <BeBuild.h>
|
||||||
#include <Alert.h>
|
#include <Alert.h>
|
||||||
#include <Box.h>
|
#include <Box.h>
|
||||||
|
#include <Catalog.h>
|
||||||
|
#include <Locale.h>
|
||||||
#include <MenuItem.h>
|
#include <MenuItem.h>
|
||||||
|
|
||||||
#include "AutoLock.h"
|
#include "AutoLock.h"
|
||||||
@@ -47,8 +49,12 @@ const int frameThickness = 9;
|
|||||||
|
|
||||||
const uint32 kSelectButtonPressed = 'sbpr';
|
const uint32 kSelectButtonPressed = 'sbpr';
|
||||||
|
|
||||||
SelectionWindow::SelectionWindow(BContainerWindow *window)
|
#undef B_TRANSLATE_CONTEXT
|
||||||
: BWindow(BRect(0, 0, 270, 0), "Select", B_TITLED_WINDOW,
|
#define B_TRANSLATE_CONTEXT "libtracker"
|
||||||
|
|
||||||
|
SelectionWindow::SelectionWindow(BContainerWindow* window)
|
||||||
|
:
|
||||||
|
BWindow(BRect(0, 0, 270, 0), B_TRANSLATE("Select"), B_TITLED_WINDOW,
|
||||||
B_NOT_ZOOMABLE | B_NOT_MINIMIZABLE | B_NOT_V_RESIZABLE
|
B_NOT_ZOOMABLE | B_NOT_MINIMIZABLE | B_NOT_V_RESIZABLE
|
||||||
| B_NO_WORKSPACE_ACTIVATION | B_ASYNCHRONOUS_CONTROLS
|
| B_NO_WORKSPACE_ACTIVATION | B_ASYNCHRONOUS_CONTROLS
|
||||||
| B_NOT_ANCHORED_ON_ACTIVATE),
|
| B_NOT_ANCHORED_ON_ACTIVATE),
|
||||||
@@ -67,11 +73,13 @@ SelectionWindow::SelectionWindow(BContainerWindow *window)
|
|||||||
AddChild(backgroundView);
|
AddChild(backgroundView);
|
||||||
|
|
||||||
BMenu *menu = new BPopUpMenu("");
|
BMenu *menu = new BPopUpMenu("");
|
||||||
menu->AddItem(new BMenuItem("starts with", NULL));
|
menu->AddItem(new BMenuItem(B_TRANSLATE("starts with"), NULL));
|
||||||
menu->AddItem(new BMenuItem("ends with", NULL));
|
menu->AddItem(new BMenuItem(B_TRANSLATE("ends with"), NULL));
|
||||||
menu->AddItem(new BMenuItem("contains", NULL));
|
menu->AddItem(new BMenuItem(B_TRANSLATE("contains"), NULL));
|
||||||
menu->AddItem(new BMenuItem("matches wildcard expression", NULL));
|
menu->AddItem(new BMenuItem(B_TRANSLATE("matches wildcard expression"),
|
||||||
menu->AddItem(new BMenuItem("matches regular expression", NULL));
|
NULL));
|
||||||
|
menu->AddItem(new BMenuItem(B_TRANSLATE("matches regular expression"),
|
||||||
|
NULL));
|
||||||
|
|
||||||
menu->SetLabelFromMarked(true);
|
menu->SetLabelFromMarked(true);
|
||||||
menu->ItemAt(3)->SetMarked(true);
|
menu->ItemAt(3)->SetMarked(true);
|
||||||
@@ -79,9 +87,10 @@ SelectionWindow::SelectionWindow(BContainerWindow *window)
|
|||||||
|
|
||||||
// Set up the menu field
|
// Set up the menu field
|
||||||
fMatchingTypeMenuField = new BMenuField(BRect(7, 6, Bounds().right - 5, 0),
|
fMatchingTypeMenuField = new BMenuField(BRect(7, 6, Bounds().right - 5, 0),
|
||||||
NULL, "Name", menu);
|
NULL, B_TRANSLATE("Name"), menu);
|
||||||
backgroundView->AddChild(fMatchingTypeMenuField);
|
backgroundView->AddChild(fMatchingTypeMenuField);
|
||||||
fMatchingTypeMenuField->SetDivider(fMatchingTypeMenuField->StringWidth("Name") + 8);
|
fMatchingTypeMenuField->SetDivider(fMatchingTypeMenuField->StringWidth(
|
||||||
|
B_TRANSLATE("Name")) + 8);
|
||||||
fMatchingTypeMenuField->ResizeToPreferred();
|
fMatchingTypeMenuField->ResizeToPreferred();
|
||||||
|
|
||||||
// Set up the expression text control
|
// Set up the expression text control
|
||||||
@@ -93,20 +102,23 @@ SelectionWindow::SelectionWindow(BContainerWindow *window)
|
|||||||
fExpressionTextControl->MakeFocus(true);
|
fExpressionTextControl->MakeFocus(true);
|
||||||
|
|
||||||
// Set up the Invert checkbox
|
// Set up the Invert checkbox
|
||||||
fInverseCheckBox = new BCheckBox(BRect(7, fExpressionTextControl->Frame().bottom
|
fInverseCheckBox = new BCheckBox(
|
||||||
+ 6, 6, 6), NULL, "Invert", NULL);
|
BRect(7, fExpressionTextControl->Frame().bottom + 6, 6, 6), NULL,
|
||||||
|
B_TRANSLATE("Invert"), NULL);
|
||||||
backgroundView->AddChild(fInverseCheckBox);
|
backgroundView->AddChild(fInverseCheckBox);
|
||||||
fInverseCheckBox->ResizeToPreferred();
|
fInverseCheckBox->ResizeToPreferred();
|
||||||
|
|
||||||
// Set up the Ignore Case checkbox
|
// Set up the Ignore Case checkbox
|
||||||
fIgnoreCaseCheckBox = new BCheckBox(BRect(fInverseCheckBox->Frame().right + 10,
|
fIgnoreCaseCheckBox = new BCheckBox(
|
||||||
fInverseCheckBox->Frame().top, 6, 6), NULL, "Ignore case", NULL);
|
BRect(fInverseCheckBox->Frame().right + 10,
|
||||||
|
fInverseCheckBox->Frame().top, 6, 6), NULL, B_TRANSLATE("Ignore case"),
|
||||||
|
NULL);
|
||||||
fIgnoreCaseCheckBox->SetValue(1);
|
fIgnoreCaseCheckBox->SetValue(1);
|
||||||
backgroundView->AddChild(fIgnoreCaseCheckBox);
|
backgroundView->AddChild(fIgnoreCaseCheckBox);
|
||||||
fIgnoreCaseCheckBox->ResizeToPreferred();
|
fIgnoreCaseCheckBox->ResizeToPreferred();
|
||||||
|
|
||||||
// Set up the Select button
|
// Set up the Select button
|
||||||
fSelectButton = new BButton(BRect(0, 0, 5, 5), NULL, "Select",
|
fSelectButton = new BButton(BRect(0, 0, 5, 5), NULL, B_TRANSLATE("Select"),
|
||||||
new BMessage(kSelectButtonPressed), B_FOLLOW_RIGHT);
|
new BMessage(kSelectButtonPressed), B_FOLLOW_RIGHT);
|
||||||
|
|
||||||
backgroundView->AddChild(fSelectButton);
|
backgroundView->AddChild(fSelectButton);
|
||||||
@@ -126,11 +138,13 @@ SelectionWindow::SelectionWindow(BContainerWindow *window)
|
|||||||
(fSelectButton->Bounds().Height() / 2 -
|
(fSelectButton->Bounds().Height() / 2 -
|
||||||
(fh.ascent + fh.descent + fh.leading + 4) / 2) + fSelectButton->Frame().top;
|
(fh.ascent + fh.descent + fh.leading + 4) / 2) + fSelectButton->Frame().top;
|
||||||
fInverseCheckBox->MoveTo(fInverseCheckBox->Frame().left, topMiddleButton);
|
fInverseCheckBox->MoveTo(fInverseCheckBox->Frame().left, topMiddleButton);
|
||||||
fIgnoreCaseCheckBox->MoveTo(fIgnoreCaseCheckBox->Frame().left, topMiddleButton);
|
fIgnoreCaseCheckBox->MoveTo(fIgnoreCaseCheckBox->Frame().left,
|
||||||
|
topMiddleButton);
|
||||||
|
|
||||||
float bottomMinWidth = 32 + fSelectButton->Bounds().Width() +
|
float bottomMinWidth = 32 + fSelectButton->Bounds().Width() +
|
||||||
fInverseCheckBox->Bounds().Width() + fIgnoreCaseCheckBox->Bounds().Width();
|
fInverseCheckBox->Bounds().Width() + fIgnoreCaseCheckBox->Bounds().Width();
|
||||||
float topMinWidth = be_plain_font->StringWidth("Name matches wildcard expression:###");
|
float topMinWidth = be_plain_font->StringWidth(
|
||||||
|
B_TRANSLATE("Name matches wildcard expression:###"));
|
||||||
float minWidth = bottomMinWidth > topMinWidth ? bottomMinWidth : topMinWidth;
|
float minWidth = bottomMinWidth > topMinWidth ? bottomMinWidth : topMinWidth;
|
||||||
|
|
||||||
Run();
|
Run();
|
||||||
|
|||||||
@@ -43,6 +43,8 @@ All rights reserved.
|
|||||||
|
|
||||||
#include <Box.h>
|
#include <Box.h>
|
||||||
#include <Button.h>
|
#include <Button.h>
|
||||||
|
#include <Catalog.h>
|
||||||
|
#include <Locale.h>
|
||||||
#include <MenuField.h>
|
#include <MenuField.h>
|
||||||
#include <ColorControl.h>
|
#include <ColorControl.h>
|
||||||
#include <NodeMonitor.h>
|
#include <NodeMonitor.h>
|
||||||
@@ -78,6 +80,9 @@ send_bool_notices(uint32 what, const char *name, bool value)
|
|||||||
// #pragma mark -
|
// #pragma mark -
|
||||||
|
|
||||||
|
|
||||||
|
#undef B_TRANSLATE_CONTEXT
|
||||||
|
#define B_TRANSLATE_CONTEXT "libtracker"
|
||||||
|
|
||||||
SettingsView::SettingsView(BRect rect, const char *name)
|
SettingsView::SettingsView(BRect rect, const char *name)
|
||||||
: BView(rect, name, B_FOLLOW_ALL, 0)
|
: BView(rect, name, B_FOLLOW_ALL, 0)
|
||||||
{
|
{
|
||||||
@@ -164,7 +169,8 @@ DesktopSettingsView::DesktopSettingsView(BRect rect)
|
|||||||
: SettingsView(rect, "DesktopSettingsView")
|
: SettingsView(rect, "DesktopSettingsView")
|
||||||
{
|
{
|
||||||
rect.OffsetTo(B_ORIGIN);
|
rect.OffsetTo(B_ORIGIN);
|
||||||
fShowDisksIconRadioButton = new BRadioButton(rect, "", "Show Disks icon",
|
fShowDisksIconRadioButton = new BRadioButton(rect, "",
|
||||||
|
B_TRANSLATE("Show Disks icon"),
|
||||||
new BMessage(kShowDisksIconChanged));
|
new BMessage(kShowDisksIconChanged));
|
||||||
fShowDisksIconRadioButton->ResizeToPreferred();
|
fShowDisksIconRadioButton->ResizeToPreferred();
|
||||||
AddChild(fShowDisksIconRadioButton);
|
AddChild(fShowDisksIconRadioButton);
|
||||||
@@ -173,14 +179,16 @@ DesktopSettingsView::DesktopSettingsView(BRect rect)
|
|||||||
rect.OffsetBy(0, itemSpacing);
|
rect.OffsetBy(0, itemSpacing);
|
||||||
|
|
||||||
fMountVolumesOntoDesktopRadioButton = new BRadioButton(rect, "",
|
fMountVolumesOntoDesktopRadioButton = new BRadioButton(rect, "",
|
||||||
"Show volumes on Desktop", new BMessage(kVolumesOnDesktopChanged));
|
B_TRANSLATE("Show volumes on Desktop"),
|
||||||
|
new BMessage(kVolumesOnDesktopChanged));
|
||||||
AddChild(fMountVolumesOntoDesktopRadioButton);
|
AddChild(fMountVolumesOntoDesktopRadioButton);
|
||||||
fMountVolumesOntoDesktopRadioButton->ResizeToPreferred();
|
fMountVolumesOntoDesktopRadioButton->ResizeToPreferred();
|
||||||
|
|
||||||
rect.OffsetBy(20, itemSpacing);
|
rect.OffsetBy(20, itemSpacing);
|
||||||
|
|
||||||
fMountSharedVolumesOntoDesktopCheckBox = new BCheckBox(rect, "",
|
fMountSharedVolumesOntoDesktopCheckBox = new BCheckBox(rect, "",
|
||||||
"Show shared volumes on Desktop", new BMessage(kVolumesOnDesktopChanged));
|
B_TRANSLATE("Show shared volumes on Desktop"),
|
||||||
|
new BMessage(kVolumesOnDesktopChanged));
|
||||||
AddChild(fMountSharedVolumesOntoDesktopCheckBox);
|
AddChild(fMountSharedVolumesOntoDesktopCheckBox);
|
||||||
fMountSharedVolumesOntoDesktopCheckBox->ResizeToPreferred();
|
fMountSharedVolumesOntoDesktopCheckBox->ResizeToPreferred();
|
||||||
|
|
||||||
@@ -188,7 +196,8 @@ DesktopSettingsView::DesktopSettingsView(BRect rect)
|
|||||||
|
|
||||||
rect = Bounds();
|
rect = Bounds();
|
||||||
rect.top = rect.bottom;
|
rect.top = rect.bottom;
|
||||||
fMountButton = new BButton(rect, "", "Mount settings" B_UTF8_ELLIPSIS,
|
fMountButton = new BButton(rect, "",
|
||||||
|
B_TRANSLATE("Mount settings" B_UTF8_ELLIPSIS),
|
||||||
new BMessage(kRunAutomounterSettings), B_FOLLOW_LEFT | B_FOLLOW_BOTTOM);
|
new BMessage(kRunAutomounterSettings), B_FOLLOW_LEFT | B_FOLLOW_BOTTOM);
|
||||||
fMountButton->ResizeToPreferred();
|
fMountButton->ResizeToPreferred();
|
||||||
fMountButton->MoveBy(0, -fMountButton->Bounds().Height());
|
fMountButton->MoveBy(0, -fMountButton->Bounds().Height());
|
||||||
@@ -409,7 +418,8 @@ WindowsSettingsView::WindowsSettingsView(BRect rect)
|
|||||||
: SettingsView(rect, "WindowsSettingsView")
|
: SettingsView(rect, "WindowsSettingsView")
|
||||||
{
|
{
|
||||||
rect.OffsetTo(B_ORIGIN);
|
rect.OffsetTo(B_ORIGIN);
|
||||||
fShowFullPathInTitleBarCheckBox = new BCheckBox(rect, "", "Show folder location in title tab",
|
fShowFullPathInTitleBarCheckBox = new BCheckBox(rect, "",
|
||||||
|
B_TRANSLATE("Show folder location in title tab"),
|
||||||
new BMessage(kWindowsShowFullPathChanged));
|
new BMessage(kWindowsShowFullPathChanged));
|
||||||
fShowFullPathInTitleBarCheckBox->ResizeToPreferred();
|
fShowFullPathInTitleBarCheckBox->ResizeToPreferred();
|
||||||
AddChild(fShowFullPathInTitleBarCheckBox);
|
AddChild(fShowFullPathInTitleBarCheckBox);
|
||||||
@@ -417,35 +427,40 @@ WindowsSettingsView::WindowsSettingsView(BRect rect)
|
|||||||
const float itemSpacing = fShowFullPathInTitleBarCheckBox->Bounds().Height() + kItemExtraSpacing;
|
const float itemSpacing = fShowFullPathInTitleBarCheckBox->Bounds().Height() + kItemExtraSpacing;
|
||||||
rect.OffsetBy(0, itemSpacing);
|
rect.OffsetBy(0, itemSpacing);
|
||||||
|
|
||||||
fSingleWindowBrowseCheckBox = new BCheckBox(rect, "", "Single window navigation",
|
fSingleWindowBrowseCheckBox = new BCheckBox(rect, "",
|
||||||
|
B_TRANSLATE("Single window navigation"),
|
||||||
new BMessage(kSingleWindowBrowseChanged));
|
new BMessage(kSingleWindowBrowseChanged));
|
||||||
fSingleWindowBrowseCheckBox->ResizeToPreferred();
|
fSingleWindowBrowseCheckBox->ResizeToPreferred();
|
||||||
AddChild(fSingleWindowBrowseCheckBox);
|
AddChild(fSingleWindowBrowseCheckBox);
|
||||||
|
|
||||||
rect.OffsetBy(20, itemSpacing);
|
rect.OffsetBy(20, itemSpacing);
|
||||||
|
|
||||||
fShowNavigatorCheckBox = new BCheckBox(rect, "", "Show navigator",
|
fShowNavigatorCheckBox = new BCheckBox(rect, "",
|
||||||
|
B_TRANSLATE("Show navigator"),
|
||||||
new BMessage(kShowNavigatorChanged));
|
new BMessage(kShowNavigatorChanged));
|
||||||
fShowNavigatorCheckBox->ResizeToPreferred();
|
fShowNavigatorCheckBox->ResizeToPreferred();
|
||||||
AddChild(fShowNavigatorCheckBox);
|
AddChild(fShowNavigatorCheckBox);
|
||||||
|
|
||||||
rect.OffsetBy(-20, itemSpacing);
|
rect.OffsetBy(-20, itemSpacing);
|
||||||
|
|
||||||
fOutlineSelectionCheckBox = new BCheckBox(rect, "", "Outline selection rectangle only",
|
fOutlineSelectionCheckBox = new BCheckBox(rect, "",
|
||||||
|
B_TRANSLATE("Outline selection rectangle only"),
|
||||||
new BMessage(kTransparentSelectionChanged));
|
new BMessage(kTransparentSelectionChanged));
|
||||||
fOutlineSelectionCheckBox->ResizeToPreferred();
|
fOutlineSelectionCheckBox->ResizeToPreferred();
|
||||||
AddChild(fOutlineSelectionCheckBox);
|
AddChild(fOutlineSelectionCheckBox);
|
||||||
|
|
||||||
rect.OffsetBy(0, itemSpacing);
|
rect.OffsetBy(0, itemSpacing);
|
||||||
|
|
||||||
fSortFolderNamesFirstCheckBox = new BCheckBox(rect, "", "List folders first",
|
fSortFolderNamesFirstCheckBox = new BCheckBox(rect, "",
|
||||||
|
B_TRANSLATE("List folders first"),
|
||||||
new BMessage(kSortFolderNamesFirstChanged));
|
new BMessage(kSortFolderNamesFirstChanged));
|
||||||
fSortFolderNamesFirstCheckBox->ResizeToPreferred();
|
fSortFolderNamesFirstCheckBox->ResizeToPreferred();
|
||||||
AddChild(fSortFolderNamesFirstCheckBox);
|
AddChild(fSortFolderNamesFirstCheckBox);
|
||||||
|
|
||||||
rect.OffsetBy(0, itemSpacing);
|
rect.OffsetBy(0, itemSpacing);
|
||||||
|
|
||||||
fTypeAheadFilteringCheckBox = new BCheckBox(rect, "", "Enable type-ahead filtering",
|
fTypeAheadFilteringCheckBox = new BCheckBox(rect, "",
|
||||||
|
B_TRANSLATE("Enable type-ahead filtering"),
|
||||||
new BMessage(kTypeAheadFilteringChanged));
|
new BMessage(kTypeAheadFilteringChanged));
|
||||||
fTypeAheadFilteringCheckBox->ResizeToPreferred();
|
fTypeAheadFilteringCheckBox->ResizeToPreferred();
|
||||||
AddChild(fTypeAheadFilteringCheckBox);
|
AddChild(fTypeAheadFilteringCheckBox);
|
||||||
@@ -714,12 +729,13 @@ TimeFormatSettingsView::TimeFormatSettingsView(BRect rect)
|
|||||||
|
|
||||||
rect.bottom = ceilf(fontHeight.ascent + fontHeight.descent) + 10;
|
rect.bottom = ceilf(fontHeight.ascent + fontHeight.descent) + 10;
|
||||||
BBox *clockBox = new BBox(rect, "Clock");
|
BBox *clockBox = new BBox(rect, "Clock");
|
||||||
clockBox->SetLabel("Clock");
|
clockBox->SetLabel(B_TRANSLATE("Clock"));
|
||||||
AddChild(clockBox);
|
AddChild(clockBox);
|
||||||
|
|
||||||
rect.left = 8;
|
rect.left = 8;
|
||||||
rect.top = rect.bottom - 8;
|
rect.top = rect.bottom - 8;
|
||||||
f24HrRadioButton = new BRadioButton(rect, "", "24 hour",
|
f24HrRadioButton = new BRadioButton(rect, "",
|
||||||
|
B_TRANSLATE("24 hour"),
|
||||||
new BMessage(kSettingsContentsModified));
|
new BMessage(kSettingsContentsModified));
|
||||||
f24HrRadioButton->ResizeToPreferred();
|
f24HrRadioButton->ResizeToPreferred();
|
||||||
clockBox->AddChild(f24HrRadioButton);
|
clockBox->AddChild(f24HrRadioButton);
|
||||||
@@ -727,7 +743,8 @@ TimeFormatSettingsView::TimeFormatSettingsView(BRect rect)
|
|||||||
const float itemSpacing = f24HrRadioButton->Bounds().Height() + kItemExtraSpacing;
|
const float itemSpacing = f24HrRadioButton->Bounds().Height() + kItemExtraSpacing;
|
||||||
rect.OffsetBy(0, itemSpacing);
|
rect.OffsetBy(0, itemSpacing);
|
||||||
|
|
||||||
f12HrRadioButton = new BRadioButton(rect, "", "12 hour",
|
f12HrRadioButton = new BRadioButton(rect, "",
|
||||||
|
B_TRANSLATE("12 hour"),
|
||||||
new BMessage(kSettingsContentsModified));
|
new BMessage(kSettingsContentsModified));
|
||||||
f12HrRadioButton->ResizeToPreferred();
|
f12HrRadioButton->ResizeToPreferred();
|
||||||
clockBox->AddChild(f12HrRadioButton);
|
clockBox->AddChild(f12HrRadioButton);
|
||||||
@@ -739,25 +756,28 @@ TimeFormatSettingsView::TimeFormatSettingsView(BRect rect)
|
|||||||
rect = clockBox->Frame();
|
rect = clockBox->Frame();
|
||||||
rect.OffsetBy(rect.Width() + 8, 0);
|
rect.OffsetBy(rect.Width() + 8, 0);
|
||||||
BBox *dateFormatBox = new BBox(rect, "Date order");
|
BBox *dateFormatBox = new BBox(rect, "Date order");
|
||||||
dateFormatBox->SetLabel("Date order");
|
dateFormatBox->SetLabel(B_TRANSLATE("Date order"));
|
||||||
AddChild(dateFormatBox);
|
AddChild(dateFormatBox);
|
||||||
|
|
||||||
rect = f24HrRadioButton->Frame();
|
rect = f24HrRadioButton->Frame();
|
||||||
fYMDRadioButton = new BRadioButton(rect, "", "Year-month-day",
|
fYMDRadioButton = new BRadioButton(rect, "",
|
||||||
|
B_TRANSLATE("Year-month-day"),
|
||||||
new BMessage(kSettingsContentsModified));
|
new BMessage(kSettingsContentsModified));
|
||||||
fYMDRadioButton->ResizeToPreferred();
|
fYMDRadioButton->ResizeToPreferred();
|
||||||
dateFormatBox->AddChild(fYMDRadioButton);
|
dateFormatBox->AddChild(fYMDRadioButton);
|
||||||
|
|
||||||
rect.OffsetBy(0, itemSpacing);
|
rect.OffsetBy(0, itemSpacing);
|
||||||
|
|
||||||
fDMYRadioButton = new BRadioButton(rect, "", "Day-month-year",
|
fDMYRadioButton = new BRadioButton(rect, "",
|
||||||
|
B_TRANSLATE("Day-month-year"),
|
||||||
new BMessage(kSettingsContentsModified));
|
new BMessage(kSettingsContentsModified));
|
||||||
fDMYRadioButton->ResizeToPreferred();
|
fDMYRadioButton->ResizeToPreferred();
|
||||||
dateFormatBox->AddChild(fDMYRadioButton);
|
dateFormatBox->AddChild(fDMYRadioButton);
|
||||||
|
|
||||||
rect.OffsetBy(0, itemSpacing);
|
rect.OffsetBy(0, itemSpacing);
|
||||||
|
|
||||||
fMDYRadioButton = new BRadioButton(rect, "", "Month-day-year",
|
fMDYRadioButton = new BRadioButton(rect, "",
|
||||||
|
B_TRANSLATE("Month-day-year"),
|
||||||
new BMessage(kSettingsContentsModified));
|
new BMessage(kSettingsContentsModified));
|
||||||
fMDYRadioButton->ResizeToPreferred();
|
fMDYRadioButton->ResizeToPreferred();
|
||||||
dateFormatBox->AddChild(fMDYRadioButton);
|
dateFormatBox->AddChild(fMDYRadioButton);
|
||||||
@@ -766,8 +786,10 @@ TimeFormatSettingsView::TimeFormatSettingsView(BRect rect)
|
|||||||
dateFormatBox->Bounds().Height());
|
dateFormatBox->Bounds().Height());
|
||||||
|
|
||||||
BPopUpMenu *menu = new BPopUpMenu("Separator");
|
BPopUpMenu *menu = new BPopUpMenu("Separator");
|
||||||
menu->AddItem(new BMenuItem("None", new BMessage(kSettingsContentsModified)));
|
menu->AddItem(new BMenuItem(B_TRANSLATE("None"),
|
||||||
menu->AddItem(new BMenuItem("Space", new BMessage(kSettingsContentsModified)));
|
new BMessage(kSettingsContentsModified)));
|
||||||
|
menu->AddItem(new BMenuItem(B_TRANSLATE("Space"),
|
||||||
|
new BMessage(kSettingsContentsModified)));
|
||||||
menu->AddItem(new BMenuItem("-", new BMessage(kSettingsContentsModified)));
|
menu->AddItem(new BMenuItem("-", new BMessage(kSettingsContentsModified)));
|
||||||
menu->AddItem(new BMenuItem("/", new BMessage(kSettingsContentsModified)));
|
menu->AddItem(new BMenuItem("/", new BMessage(kSettingsContentsModified)));
|
||||||
menu->AddItem(new BMenuItem("\\", new BMessage(kSettingsContentsModified)));
|
menu->AddItem(new BMenuItem("\\", new BMessage(kSettingsContentsModified)));
|
||||||
@@ -785,7 +807,7 @@ TimeFormatSettingsView::TimeFormatSettingsView(BRect rect)
|
|||||||
|
|
||||||
rect.OffsetBy(0, itemSpacing + 10);
|
rect.OffsetBy(0, itemSpacing + 10);
|
||||||
|
|
||||||
BStringView *exampleView = new BStringView(rect, "", "Examples:");
|
BStringView* exampleView = new BStringView(rect, "", B_TRANSLATE("Examples:"));
|
||||||
exampleView->ResizeToPreferred();
|
exampleView->ResizeToPreferred();
|
||||||
AddChild(exampleView);
|
AddChild(exampleView);
|
||||||
|
|
||||||
@@ -1052,7 +1074,8 @@ SpaceBarSettingsView::SpaceBarSettingsView(BRect rect)
|
|||||||
: SettingsView(rect, "SpaceBarSettingsView")
|
: SettingsView(rect, "SpaceBarSettingsView")
|
||||||
{
|
{
|
||||||
rect.OffsetTo(B_ORIGIN);
|
rect.OffsetTo(B_ORIGIN);
|
||||||
fSpaceBarShowCheckBox = new BCheckBox(rect, "", "Show space bars on volumes",
|
fSpaceBarShowCheckBox = new BCheckBox(rect, "",
|
||||||
|
B_TRANSLATE("Show space bars on volumes"),
|
||||||
new BMessage(kUpdateVolumeSpaceBar));
|
new BMessage(kUpdateVolumeSpaceBar));
|
||||||
fSpaceBarShowCheckBox->ResizeToPreferred();
|
fSpaceBarShowCheckBox->ResizeToPreferred();
|
||||||
AddChild(fSpaceBarShowCheckBox);
|
AddChild(fSpaceBarShowCheckBox);
|
||||||
@@ -1064,11 +1087,17 @@ SpaceBarSettingsView::SpaceBarSettingsView(BRect rect)
|
|||||||
menu->SetFont(be_plain_font);
|
menu->SetFont(be_plain_font);
|
||||||
|
|
||||||
BMenuItem *item;
|
BMenuItem *item;
|
||||||
menu->AddItem(item = new BMenuItem("Used space color", new BMessage(kSpaceBarSwitchColor)));
|
menu->AddItem(item = new BMenuItem(
|
||||||
|
B_TRANSLATE("Used space color"),
|
||||||
|
new BMessage(kSpaceBarSwitchColor)));
|
||||||
item->SetMarked(true);
|
item->SetMarked(true);
|
||||||
fCurrentColor = 0;
|
fCurrentColor = 0;
|
||||||
menu->AddItem(new BMenuItem("Free space color", new BMessage(kSpaceBarSwitchColor)));
|
menu->AddItem(new BMenuItem(
|
||||||
menu->AddItem(new BMenuItem("Warning space color", new BMessage(kSpaceBarSwitchColor)));
|
B_TRANSLATE("Free space color"),
|
||||||
|
new BMessage(kSpaceBarSwitchColor)));
|
||||||
|
menu->AddItem(new BMenuItem(
|
||||||
|
B_TRANSLATE("Warning space color"),
|
||||||
|
new BMessage(kSpaceBarSwitchColor)));
|
||||||
|
|
||||||
BBox *box = new BBox(rect);
|
BBox *box = new BBox(rect);
|
||||||
box->SetLabel(fColorPicker = new BMenuField(rect, NULL, NULL, menu));
|
box->SetLabel(fColorPicker = new BMenuField(rect, NULL, NULL, menu));
|
||||||
@@ -1302,7 +1331,8 @@ TrashSettingsView::TrashSettingsView(BRect rect)
|
|||||||
: SettingsView(rect, "TrashSettingsView")
|
: SettingsView(rect, "TrashSettingsView")
|
||||||
{
|
{
|
||||||
rect.OffsetTo(B_ORIGIN);
|
rect.OffsetTo(B_ORIGIN);
|
||||||
fDontMoveFilesToTrashCheckBox = new BCheckBox(rect, "", "Don't move files to Trash",
|
fDontMoveFilesToTrashCheckBox = new BCheckBox(rect, "",
|
||||||
|
B_TRANSLATE("Don't move files to Trash"),
|
||||||
new BMessage(kDontMoveFilesToTrashChanged));
|
new BMessage(kDontMoveFilesToTrashChanged));
|
||||||
fDontMoveFilesToTrashCheckBox->ResizeToPreferred();
|
fDontMoveFilesToTrashCheckBox->ResizeToPreferred();
|
||||||
AddChild(fDontMoveFilesToTrashCheckBox);
|
AddChild(fDontMoveFilesToTrashCheckBox);
|
||||||
@@ -1310,7 +1340,8 @@ TrashSettingsView::TrashSettingsView(BRect rect)
|
|||||||
rect = fDontMoveFilesToTrashCheckBox->Frame();
|
rect = fDontMoveFilesToTrashCheckBox->Frame();
|
||||||
rect.OffsetBy(0, fDontMoveFilesToTrashCheckBox->Bounds().Height() + kItemExtraSpacing);
|
rect.OffsetBy(0, fDontMoveFilesToTrashCheckBox->Bounds().Height() + kItemExtraSpacing);
|
||||||
|
|
||||||
fAskBeforeDeleteFileCheckBox = new BCheckBox(rect, "", "Ask before delete",
|
fAskBeforeDeleteFileCheckBox = new BCheckBox(rect, "",
|
||||||
|
B_TRANSLATE("Ask before delete"),
|
||||||
new BMessage(kAskBeforeDeleteFileChanged));
|
new BMessage(kAskBeforeDeleteFileChanged));
|
||||||
fAskBeforeDeleteFileCheckBox->ResizeToPreferred();
|
fAskBeforeDeleteFileCheckBox->ResizeToPreferred();
|
||||||
AddChild(fAskBeforeDeleteFileCheckBox);
|
AddChild(fAskBeforeDeleteFileCheckBox);
|
||||||
|
|||||||
@@ -38,7 +38,9 @@ All rights reserved.
|
|||||||
#include <Debug.h>
|
#include <Debug.h>
|
||||||
|
|
||||||
#include <Application.h>
|
#include <Application.h>
|
||||||
|
#include <Catalog.h>
|
||||||
#include <Directory.h>
|
#include <Directory.h>
|
||||||
|
#include <Locale.h>
|
||||||
#include <Path.h>
|
#include <Path.h>
|
||||||
#include <Query.h>
|
#include <Query.h>
|
||||||
#include <StopWatch.h>
|
#include <StopWatch.h>
|
||||||
@@ -60,6 +62,9 @@ All rights reserved.
|
|||||||
#include "Tracker.h"
|
#include "Tracker.h"
|
||||||
|
|
||||||
|
|
||||||
|
#undef B_TRANSLATE_CONTEXT
|
||||||
|
#define B_TRANSLATE_CONTEXT "libtracker"
|
||||||
|
|
||||||
BSlowContextMenu::BSlowContextMenu(const char *title)
|
BSlowContextMenu::BSlowContextMenu(const char *title)
|
||||||
: BPopUpMenu(title, false, false),
|
: BPopUpMenu(title, false, false),
|
||||||
fMenuBuilt(false),
|
fMenuBuilt(false),
|
||||||
@@ -486,7 +491,7 @@ BSlowContextMenu::DoneBuildingItemList()
|
|||||||
fItemList->MakeEmpty();
|
fItemList->MakeEmpty();
|
||||||
|
|
||||||
if (!count) {
|
if (!count) {
|
||||||
BMenuItem *item = new BMenuItem("Empty folder", 0);
|
BMenuItem* item = new BMenuItem(B_TRANSLATE("Empty folder"), 0);
|
||||||
item->SetEnabled(false);
|
item->SetEnabled(false);
|
||||||
AddItem(item);
|
AddItem(item);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,8 +39,10 @@ All rights reserved.
|
|||||||
|
|
||||||
#include <Application.h>
|
#include <Application.h>
|
||||||
#include <Button.h>
|
#include <Button.h>
|
||||||
|
#include <Catalog.h>
|
||||||
#include <ControlLook.h>
|
#include <ControlLook.h>
|
||||||
#include <Debug.h>
|
#include <Debug.h>
|
||||||
|
#include <Locale.h>
|
||||||
#include <MessageFilter.h>
|
#include <MessageFilter.h>
|
||||||
#include <StringView.h>
|
#include <StringView.h>
|
||||||
#include <String.h>
|
#include <String.h>
|
||||||
@@ -182,11 +184,14 @@ public:
|
|||||||
// #pragma mark - BStatusWindow
|
// #pragma mark - BStatusWindow
|
||||||
|
|
||||||
|
|
||||||
|
#undef B_TRANSLATE_CONTEXT
|
||||||
|
#define B_TRANSLATE_CONTEXT "libtracker"
|
||||||
|
|
||||||
|
|
||||||
BStatusWindow::BStatusWindow()
|
BStatusWindow::BStatusWindow()
|
||||||
:
|
:
|
||||||
BWindow(kStatusRect, "Tracker status", B_TITLED_WINDOW,
|
BWindow(kStatusRect, B_TRANSLATE("Tracker status"), B_TITLED_WINDOW,
|
||||||
B_NOT_CLOSABLE | B_NOT_RESIZABLE | B_NOT_ZOOMABLE,
|
B_NOT_CLOSABLE | B_NOT_RESIZABLE | B_NOT_ZOOMABLE, B_ALL_WORKSPACES),
|
||||||
B_ALL_WORKSPACES),
|
|
||||||
fRetainDesktopFocus(false)
|
fRetainDesktopFocus(false)
|
||||||
{
|
{
|
||||||
SetSizeLimits(0, 100000, 0, 100000);
|
SetSizeLimits(0, 100000, 0, 100000);
|
||||||
@@ -446,41 +451,41 @@ BStatusView::BStatusView(BRect bounds, thread_id thread,
|
|||||||
rect.top += 6;
|
rect.top += 6;
|
||||||
rect.bottom = rect.top + 15;
|
rect.bottom = rect.top + 15;
|
||||||
|
|
||||||
const char* caption = NULL;
|
BString caption;
|
||||||
int32 id = 0;
|
int32 id = 0;
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case kCopyState:
|
case kCopyState:
|
||||||
caption = "Preparing to copy items" B_UTF8_ELLIPSIS;
|
caption = B_TRANSLATE("Preparing to copy items" B_UTF8_ELLIPSIS);
|
||||||
id = R_CopyStatusBitmap;
|
id = R_CopyStatusBitmap;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case kMoveState:
|
case kMoveState:
|
||||||
caption = "Preparing to move items" B_UTF8_ELLIPSIS;
|
caption = B_TRANSLATE("Preparing to move items" B_UTF8_ELLIPSIS);
|
||||||
id = R_MoveStatusBitmap;
|
id = R_MoveStatusBitmap;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case kCreateLinkState:
|
case kCreateLinkState:
|
||||||
caption = "Preparing to create links" B_UTF8_ELLIPSIS;
|
caption = B_TRANSLATE("Preparing to create links" B_UTF8_ELLIPSIS);
|
||||||
id = R_MoveStatusBitmap;
|
id = R_MoveStatusBitmap;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case kTrashState:
|
case kTrashState:
|
||||||
caption = "Preparing to empty Trash" B_UTF8_ELLIPSIS;
|
caption = B_TRANSLATE("Preparing to empty Trash" B_UTF8_ELLIPSIS);
|
||||||
id = R_TrashStatusBitmap;
|
id = R_TrashStatusBitmap;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case kVolumeState:
|
case kVolumeState:
|
||||||
caption = "Searching for disks to mount" B_UTF8_ELLIPSIS;
|
caption = B_TRANSLATE("Searching for disks to mount" B_UTF8_ELLIPSIS);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case kDeleteState:
|
case kDeleteState:
|
||||||
caption = "Preparing to delete items" B_UTF8_ELLIPSIS;
|
caption = B_TRANSLATE("Preparing to delete items" B_UTF8_ELLIPSIS);
|
||||||
id = R_TrashStatusBitmap;
|
id = R_TrashStatusBitmap;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case kRestoreFromTrashState:
|
case kRestoreFromTrashState:
|
||||||
caption = "Preparing to restore items" B_UTF8_ELLIPSIS;
|
caption = B_TRANSLATE("Preparing to restore items" B_UTF8_ELLIPSIS);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@@ -488,8 +493,8 @@ BStatusView::BStatusView(BRect bounds, thread_id thread,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (caption != NULL) {
|
if (caption.Length() != 0) {
|
||||||
fStatusBar = new BStatusBar(rect, "StatusBar", caption);
|
fStatusBar = new BStatusBar(rect, "StatusBar", caption.String());
|
||||||
fStatusBar->SetBarHeight(12);
|
fStatusBar->SetBarHeight(12);
|
||||||
float width, height;
|
float width, height;
|
||||||
fStatusBar->GetPreferredSize(&width, &height);
|
fStatusBar->GetPreferredSize(&width, &height);
|
||||||
@@ -572,33 +577,37 @@ BStatusView::InitStatus(int32 totalItems, off_t totalSize,
|
|||||||
}
|
}
|
||||||
|
|
||||||
BString buffer;
|
BString buffer;
|
||||||
if (totalItems > 0)
|
if (totalItems > 0) {
|
||||||
buffer << "of " << totalItems;
|
char totalStr[32];
|
||||||
|
buffer.SetTo(B_TRANSLATE("of %items"));
|
||||||
|
snprintf(totalStr, sizeof(totalStr), "%ld", totalItems);
|
||||||
|
buffer.ReplaceFirst("%items", totalStr);
|
||||||
|
}
|
||||||
|
|
||||||
switch (fType) {
|
switch (fType) {
|
||||||
case kCopyState:
|
case kCopyState:
|
||||||
fStatusBar->Reset("Copying: ", buffer.String());
|
fStatusBar->Reset(B_TRANSLATE("Copying: "), buffer.String());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case kCreateLinkState:
|
case kCreateLinkState:
|
||||||
fStatusBar->Reset("Creating links: ", buffer.String());
|
fStatusBar->Reset(B_TRANSLATE("Creating links: "), buffer.String());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case kMoveState:
|
case kMoveState:
|
||||||
fStatusBar->Reset("Moving: ", buffer.String());
|
fStatusBar->Reset(B_TRANSLATE("Moving: "), buffer.String());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case kTrashState:
|
case kTrashState:
|
||||||
fStatusBar->Reset("Emptying Trash" B_UTF8_ELLIPSIS " ",
|
fStatusBar->Reset(B_TRANSLATE("Emptying Trash" B_UTF8_ELLIPSIS " "),
|
||||||
buffer.String());
|
buffer.String());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case kDeleteState:
|
case kDeleteState:
|
||||||
fStatusBar->Reset("Deleting: ", buffer.String());
|
fStatusBar->Reset(B_TRANSLATE("Deleting: "), buffer.String());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case kRestoreFromTrashState:
|
case kRestoreFromTrashState:
|
||||||
fStatusBar->Reset("Restoring: ", buffer.String());
|
fStatusBar->Reset(B_TRANSLATE("Restoring: "), buffer.String());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@@ -650,7 +659,7 @@ BStatusView::Draw(BRect updateRect)
|
|||||||
tp.y += ceilf(fh.leading) + ceilf(fh.ascent);
|
tp.y += ceilf(fh.leading) + ceilf(fh.ascent);
|
||||||
|
|
||||||
if (IsPaused())
|
if (IsPaused())
|
||||||
DrawString("Paused: click to resume or stop", tp);
|
DrawString(B_TRANSLATE("Paused: click to resume or stop"), tp);
|
||||||
else if (fDestDir.Length()) {
|
else if (fDestDir.Length()) {
|
||||||
BString buffer;
|
BString buffer;
|
||||||
buffer << "To: " << fDestDir;
|
buffer << "To: " << fDestDir;
|
||||||
@@ -714,40 +723,48 @@ BStatusView::Draw(BRect updateRect)
|
|||||||
// TODO: Localization of time string...
|
// TODO: Localization of time string...
|
||||||
if (now < finishTime - secondsPerDay) {
|
if (now < finishTime - secondsPerDay) {
|
||||||
// process is going to take more than a day!
|
// process is going to take more than a day!
|
||||||
sprintf(timeText, "%0*d:%0*d %0*d/%0*d/%ld",
|
snprintf(timeText, sizeof(timeText), "%0*d:%0*d %0*d/%0*d/%ld",
|
||||||
2, time->tm_hour, 2, time->tm_min,
|
2, time->tm_hour, 2, time->tm_min,
|
||||||
2, time->tm_mon + 1, 2, time->tm_mday, year);
|
2, time->tm_mon + 1, 2, time->tm_mday, year);
|
||||||
} else {
|
} else {
|
||||||
sprintf(timeText, "%0*d:%0*d",
|
snprintf(timeText, sizeof(timeText), "%0*d:%0*d",
|
||||||
2, time->tm_hour, 2, time->tm_min);
|
2, time->tm_hour, 2, time->tm_min);
|
||||||
}
|
}
|
||||||
|
|
||||||
BString buffer1("Finish: ");
|
|
||||||
buffer1 << timeText;
|
|
||||||
finishTime -= now;
|
finishTime -= now;
|
||||||
time = gmtime(&finishTime);
|
time = gmtime(&finishTime);
|
||||||
|
char finishStr[32];
|
||||||
|
|
||||||
BString buffer2;
|
if (finishTime > secondsPerDay) {
|
||||||
if (finishTime > secondsPerDay)
|
buffer.SetTo(B_TRANSLATE("(Finish: %time - Over %finishtime "
|
||||||
buffer2 << "Over " << finishTime / secondsPerDay << " days";
|
"days left)"));
|
||||||
else if (finishTime > 60 * 60)
|
snprintf(finishStr, sizeof(finishStr), "%ld",
|
||||||
buffer2 << "Over " << finishTime / (60 * 60) << " hours";
|
finishTime / secondsPerDay);
|
||||||
else if (finishTime > 60)
|
} else if (finishTime > 60 * 60) {
|
||||||
buffer2 << finishTime / 60 << " minutes";
|
buffer.SetTo(B_TRANSLATE("(Finish: %time - Over %finishtime "
|
||||||
else
|
"hours left)"));
|
||||||
buffer2 << finishTime << " seconds";
|
snprintf(finishStr, sizeof(finishStr), "%ld",
|
||||||
|
finishTime / (60 * 60));
|
||||||
|
} else if (finishTime > 60) {
|
||||||
|
buffer.SetTo(B_TRANSLATE("(Finish: %time - %finishtime minutes "
|
||||||
|
"left)"));
|
||||||
|
snprintf(finishStr, sizeof(finishStr), "%ld", finishTime / 60);
|
||||||
|
} else {
|
||||||
|
buffer.SetTo(B_TRANSLATE("(Finish: %time - %finishtime seconds "
|
||||||
|
"left)"));
|
||||||
|
snprintf(finishStr, sizeof(finishStr), "%ld", finishTime);
|
||||||
|
}
|
||||||
|
|
||||||
buffer2 << " left";
|
buffer.ReplaceFirst("%time", timeText);
|
||||||
|
buffer.ReplaceFirst("%finishtime", finishStr);
|
||||||
|
|
||||||
buffer = "(";
|
|
||||||
buffer << buffer1 << " - " << buffer2 << ")";
|
|
||||||
tp.x = fStatusBar->Frame().right - StringWidth(buffer.String());
|
tp.x = fStatusBar->Frame().right - StringWidth(buffer.String());
|
||||||
if (tp.x > rightDivider)
|
if (tp.x > rightDivider)
|
||||||
DrawString(buffer.String(), tp);
|
DrawString(buffer.String(), tp);
|
||||||
else {
|
else {
|
||||||
// complete string too wide, try with shorter version
|
// complete string too wide, try with shorter version
|
||||||
buffer = "(";
|
buffer.SetTo(B_TRANSLATE("(Finish: %time)"));
|
||||||
buffer << buffer1 << ")";
|
buffer.ReplaceFirst("%time", timeText);
|
||||||
tp.x = fStatusBar->Frame().right - StringWidth(buffer.String());
|
tp.x = fStatusBar->Frame().right - StringWidth(buffer.String());
|
||||||
if (tp.x > rightDivider)
|
if (tp.x > rightDivider)
|
||||||
DrawString(buffer.String(), tp);
|
DrawString(buffer.String(), tp);
|
||||||
|
|||||||
@@ -33,9 +33,11 @@ All rights reserved.
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <Application.h>
|
#include <Application.h>
|
||||||
|
#include <Catalog.h>
|
||||||
#include <FindDirectory.h>
|
#include <FindDirectory.h>
|
||||||
#include <Directory.h>
|
#include <Directory.h>
|
||||||
#include <NodeInfo.h>
|
#include <NodeInfo.h>
|
||||||
|
#include <Locale.h>
|
||||||
#include <Mime.h>
|
#include <Mime.h>
|
||||||
#include <Message.h>
|
#include <Message.h>
|
||||||
#include <Path.h>
|
#include <Path.h>
|
||||||
@@ -50,12 +52,15 @@ All rights reserved.
|
|||||||
#include "IconMenuItem.h"
|
#include "IconMenuItem.h"
|
||||||
#include "MimeTypes.h"
|
#include "MimeTypes.h"
|
||||||
|
|
||||||
|
|
||||||
|
#undef B_TRANSLATE_CONTEXT
|
||||||
|
#define B_TRANSLATE_CONTEXT "libtracker"
|
||||||
|
|
||||||
|
|
||||||
namespace BPrivate {
|
namespace BPrivate {
|
||||||
|
|
||||||
const char *kTemplatesDirectory = "Tracker/Tracker New Templates";
|
const char *kTemplatesDirectory = "Tracker/Tracker New Templates";
|
||||||
const char *kTemplatesMenuName = "New";
|
|
||||||
|
|
||||||
static const char *kOpenTemplatesMenuName = "Edit templates"B_UTF8_ELLIPSIS;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -112,8 +117,8 @@ TemplatesMenu::BuildMenu(bool addItems)
|
|||||||
delete RemoveItem(0L);
|
delete RemoveItem(0L);
|
||||||
|
|
||||||
// Add the Folder
|
// Add the Folder
|
||||||
IconMenuItem *menuItem = new IconMenuItem("New folder", new BMessage(kNewFolder),
|
IconMenuItem* menuItem = new IconMenuItem(B_TRANSLATE("New folder"),
|
||||||
B_DIR_MIMETYPE,B_MINI_ICON);
|
new BMessage(kNewFolder), B_DIR_MIMETYPE, B_MINI_ICON);
|
||||||
AddItem(menuItem);
|
AddItem(menuItem);
|
||||||
menuItem->SetShortcut('N', 0);
|
menuItem->SetShortcut('N', 0);
|
||||||
|
|
||||||
@@ -172,7 +177,8 @@ TemplatesMenu::BuildMenu(bool addItems)
|
|||||||
message->AddRef("refs", &dirRef);
|
message->AddRef("refs", &dirRef);
|
||||||
|
|
||||||
// Add item to show templates folder.
|
// Add item to show templates folder.
|
||||||
fOpenItem = new BMenuItem(kOpenTemplatesMenuName, message);
|
fOpenItem = new BMenuItem(B_TRANSLATE("Edit templates" B_UTF8_ELLIPSIS),
|
||||||
|
message);
|
||||||
AddItem(fOpenItem);
|
AddItem(fOpenItem);
|
||||||
if (dirRef == entry_ref())
|
if (dirRef == entry_ref())
|
||||||
fOpenItem->SetEnabled(false);
|
fOpenItem->SetEnabled(false);
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ extern const char* kTemplatesMenuName;
|
|||||||
class TemplatesMenu : public BMenu {
|
class TemplatesMenu : public BMenu {
|
||||||
public:
|
public:
|
||||||
TemplatesMenu(const BMessenger &target,
|
TemplatesMenu(const BMessenger &target,
|
||||||
const char *label = kTemplatesMenuName);
|
const char *label);
|
||||||
virtual ~TemplatesMenu();
|
virtual ~TemplatesMenu();
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -40,11 +40,13 @@ All rights reserved.
|
|||||||
|
|
||||||
#include <Alert.h>
|
#include <Alert.h>
|
||||||
#include <Autolock.h>
|
#include <Autolock.h>
|
||||||
|
#include <Catalog.h>
|
||||||
#include <Debug.h>
|
#include <Debug.h>
|
||||||
#include <FindDirectory.h>
|
#include <FindDirectory.h>
|
||||||
#include <fs_attr.h>
|
#include <fs_attr.h>
|
||||||
#include <fs_info.h>
|
#include <fs_info.h>
|
||||||
#include <image.h>
|
#include <image.h>
|
||||||
|
#include <Locale.h>
|
||||||
#include <MenuItem.h>
|
#include <MenuItem.h>
|
||||||
#include <NodeInfo.h>
|
#include <NodeInfo.h>
|
||||||
#include <NodeMonitor.h>
|
#include <NodeMonitor.h>
|
||||||
@@ -206,6 +208,9 @@ GetVolumeFlags(Model *model)
|
|||||||
// #pragma mark -
|
// #pragma mark -
|
||||||
|
|
||||||
|
|
||||||
|
#undef B_TRANSLATE_CONTEXT
|
||||||
|
#define B_TRANSLATE_CONTEXT "libtracker"
|
||||||
|
|
||||||
TTracker::TTracker()
|
TTracker::TTracker()
|
||||||
: BApplication(kTrackerSignature),
|
: BApplication(kTrackerSignature),
|
||||||
fSettingsWindow(NULL)
|
fSettingsWindow(NULL)
|
||||||
@@ -663,9 +668,9 @@ TTracker::OpenRef(const entry_ref *ref, const node_ref *nodeToClose,
|
|||||||
|
|
||||||
if (!brokenLinkWithSpecificHandler) {
|
if (!brokenLinkWithSpecificHandler) {
|
||||||
delete model;
|
delete model;
|
||||||
BAlert *alert = new BAlert("",
|
BAlert* alert = new BAlert("",
|
||||||
"There was an error resolving the link.",
|
B_TRANSLATE("There was an error resolving the link."),
|
||||||
"Cancel", 0, 0, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
|
B_TRANSLATE("Cancel"), 0, 0, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
|
||||||
alert->SetShortcut(0, B_ESCAPE);
|
alert->SetShortcut(0, B_ESCAPE);
|
||||||
alert->Go();
|
alert->Go();
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
@@ -37,8 +37,10 @@ All rights reserved.
|
|||||||
// important sniffer rules
|
// important sniffer rules
|
||||||
|
|
||||||
#include <Alert.h>
|
#include <Alert.h>
|
||||||
|
#include <Catalog.h>
|
||||||
#include <Directory.h>
|
#include <Directory.h>
|
||||||
#include <InterfaceDefs.h>
|
#include <InterfaceDefs.h>
|
||||||
|
#include <Locale.h>
|
||||||
#include <Message.h>
|
#include <Message.h>
|
||||||
#include <Node.h>
|
#include <Node.h>
|
||||||
#include <Path.h>
|
#include <Path.h>
|
||||||
@@ -330,6 +332,9 @@ AddTemporaryBackgroundImages(BMessage *message, const char *imagePath,
|
|||||||
// #pragma mark -
|
// #pragma mark -
|
||||||
|
|
||||||
|
|
||||||
|
#undef B_TRANSLATE_CONTEXT
|
||||||
|
#define B_TRANSLATE_CONTEXT "libtracker"
|
||||||
|
|
||||||
bool
|
bool
|
||||||
TTracker::InstallMimeIfNeeded(const char *type, int32 bitsID,
|
TTracker::InstallMimeIfNeeded(const char *type, int32 bitsID,
|
||||||
const char *shortDescription, const char *longDescription,
|
const char *shortDescription, const char *longDescription,
|
||||||
@@ -592,12 +597,13 @@ TTracker::InstallTemporaryBackgroundImages()
|
|||||||
BPath path;
|
BPath path;
|
||||||
status_t status = find_directory(B_SYSTEM_DATA_DIRECTORY, &path);
|
status_t status = find_directory(B_SYSTEM_DATA_DIRECTORY, &path);
|
||||||
if (status < B_OK) {
|
if (status < B_OK) {
|
||||||
BString errorMessage;
|
// TODO: this error shouldn't be shown to the regular user
|
||||||
errorMessage << "At " << __PRETTY_FUNCTION__ << "\n";
|
BString errorMessage(B_TRANSLATE("At %func \nfind_directory() failed. "
|
||||||
errorMessage << "find_directory() failed. \nReason: ";
|
"\nReason: %error"));
|
||||||
errorMessage << strerror(status);
|
errorMessage.ReplaceFirst("%func", __PRETTY_FUNCTION__);
|
||||||
(new BAlert("AlertError", errorMessage.String(), "OK", NULL, NULL,
|
errorMessage.ReplaceFirst("%error", strerror(status));
|
||||||
B_WIDTH_AS_USUAL, B_STOP_ALERT))->Go();
|
(new BAlert("AlertError", errorMessage.String(), B_TRANSLATE("OK"),
|
||||||
|
NULL, NULL, B_WIDTH_AS_USUAL, B_STOP_ALERT))->Go();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
path.Append("artwork");
|
path.Append("artwork");
|
||||||
|
|||||||
@@ -32,6 +32,8 @@ names are registered trademarks or trademarks of their respective holders.
|
|||||||
All rights reserved.
|
All rights reserved.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <Catalog.h>
|
||||||
|
#include <Locale.h>
|
||||||
|
|
||||||
#include "SettingsViews.h"
|
#include "SettingsViews.h"
|
||||||
#include "TrackerSettings.h"
|
#include "TrackerSettings.h"
|
||||||
@@ -63,10 +65,15 @@ const uint32 kDefaultsButtonPressed = 'Apbp';
|
|||||||
const uint32 kRevertButtonPressed = 'Rebp';
|
const uint32 kRevertButtonPressed = 'Rebp';
|
||||||
|
|
||||||
|
|
||||||
|
#undef B_TRANSLATE_CONTEXT
|
||||||
|
#define B_TRANSLATE_CONTEXT "libtracker"
|
||||||
|
|
||||||
TrackerSettingsWindow::TrackerSettingsWindow()
|
TrackerSettingsWindow::TrackerSettingsWindow()
|
||||||
: BWindow(BRect(80, 80, 450, 350), "Tracker preferences", B_TITLED_WINDOW,
|
:
|
||||||
B_NOT_MINIMIZABLE | B_NOT_RESIZABLE | B_NO_WORKSPACE_ACTIVATION
|
BWindow(BRect(80, 80, 450, 350), B_TRANSLATE("Tracker preferences"),
|
||||||
| B_NOT_ANCHORED_ON_ACTIVATE | B_ASYNCHRONOUS_CONTROLS | B_NOT_ZOOMABLE)
|
B_TITLED_WINDOW, B_NOT_MINIMIZABLE | B_NOT_RESIZABLE
|
||||||
|
| B_NO_WORKSPACE_ACTIVATION | B_NOT_ANCHORED_ON_ACTIVATE
|
||||||
|
| B_ASYNCHRONOUS_CONTROLS | B_NOT_ZOOMABLE)
|
||||||
{
|
{
|
||||||
BRect rect = Bounds();
|
BRect rect = Bounds();
|
||||||
BView *topView = new BView(rect, "Background", B_FOLLOW_ALL, 0);
|
BView *topView = new BView(rect, "Background", B_FOLLOW_ALL, 0);
|
||||||
@@ -74,8 +81,8 @@ TrackerSettingsWindow::TrackerSettingsWindow()
|
|||||||
AddChild(topView);
|
AddChild(topView);
|
||||||
|
|
||||||
rect.InsetBy(10, 10);
|
rect.InsetBy(10, 10);
|
||||||
rect.right = rect.left + be_plain_font->StringWidth("Volume Icons")
|
rect.right = be_plain_font->StringWidth(B_TRANSLATE("Volume Icons"))
|
||||||
+ (float)B_V_SCROLL_BAR_WIDTH + 40.0f;
|
+ rect.left + (float)B_V_SCROLL_BAR_WIDTH + 40.0f;
|
||||||
fSettingsTypeListView = new BListView(rect, "List View", B_SINGLE_SELECTION_LIST,
|
fSettingsTypeListView = new BListView(rect, "List View", B_SINGLE_SELECTION_LIST,
|
||||||
B_FOLLOW_LEFT | B_FOLLOW_TOP_BOTTOM);
|
B_FOLLOW_LEFT | B_FOLLOW_TOP_BOTTOM);
|
||||||
BScrollView* scrollView = new BScrollView("scrollview", fSettingsTypeListView,
|
BScrollView* scrollView = new BScrollView("scrollview", fSettingsTypeListView,
|
||||||
@@ -85,7 +92,7 @@ TrackerSettingsWindow::TrackerSettingsWindow()
|
|||||||
rect = scrollView->Frame();
|
rect = scrollView->Frame();
|
||||||
rect.left = rect.right + 10;
|
rect.left = rect.right + 10;
|
||||||
rect.top = rect.bottom;
|
rect.top = rect.bottom;
|
||||||
fDefaultsButton = new BButton(rect, "Defaults", "Defaults",
|
fDefaultsButton = new BButton(rect, "Defaults", B_TRANSLATE("Defaults"),
|
||||||
new BMessage(kDefaultsButtonPressed), B_FOLLOW_LEFT | B_FOLLOW_BOTTOM);
|
new BMessage(kDefaultsButtonPressed), B_FOLLOW_LEFT | B_FOLLOW_BOTTOM);
|
||||||
fDefaultsButton->ResizeToPreferred();
|
fDefaultsButton->ResizeToPreferred();
|
||||||
fDefaultsButton->SetEnabled(false);
|
fDefaultsButton->SetEnabled(false);
|
||||||
@@ -93,7 +100,7 @@ TrackerSettingsWindow::TrackerSettingsWindow()
|
|||||||
|
|
||||||
rect = fDefaultsButton->Frame();
|
rect = fDefaultsButton->Frame();
|
||||||
rect.left = rect.right + 10;
|
rect.left = rect.right + 10;
|
||||||
fRevertButton = new BButton(rect, "Revert", "Revert",
|
fRevertButton = new BButton(rect, "Revert", B_TRANSLATE("Revert"),
|
||||||
new BMessage(kRevertButtonPressed), B_FOLLOW_LEFT | B_FOLLOW_BOTTOM);
|
new BMessage(kRevertButtonPressed), B_FOLLOW_LEFT | B_FOLLOW_BOTTOM);
|
||||||
fRevertButton->SetEnabled(false);
|
fRevertButton->SetEnabled(false);
|
||||||
fRevertButton->ResizeToPreferred();
|
fRevertButton->ResizeToPreferred();
|
||||||
@@ -109,15 +116,15 @@ TrackerSettingsWindow::TrackerSettingsWindow()
|
|||||||
|
|
||||||
rect = _SettingsFrame();
|
rect = _SettingsFrame();
|
||||||
|
|
||||||
fSettingsTypeListView->AddItem(new SettingsItem("Desktop",
|
fSettingsTypeListView->AddItem(new SettingsItem(B_TRANSLATE("Desktop"),
|
||||||
new DesktopSettingsView(rect)));
|
new DesktopSettingsView(rect)));
|
||||||
fSettingsTypeListView->AddItem(new SettingsItem("Windows",
|
fSettingsTypeListView->AddItem(new SettingsItem(B_TRANSLATE("Windows"),
|
||||||
new WindowsSettingsView(rect)));
|
new WindowsSettingsView(rect)));
|
||||||
fSettingsTypeListView->AddItem(new SettingsItem("Date & Time",
|
fSettingsTypeListView->AddItem(new SettingsItem(B_TRANSLATE("Date & Time"),
|
||||||
new TimeFormatSettingsView(rect)));
|
new TimeFormatSettingsView(rect)));
|
||||||
fSettingsTypeListView->AddItem(new SettingsItem("Trash",
|
fSettingsTypeListView->AddItem(new SettingsItem(B_TRANSLATE("Trash"),
|
||||||
new TrashSettingsView(rect)));
|
new TrashSettingsView(rect)));
|
||||||
fSettingsTypeListView->AddItem(new SettingsItem("Volume icons",
|
fSettingsTypeListView->AddItem(new SettingsItem(B_TRANSLATE("Volume icons"),
|
||||||
new SpaceBarSettingsView(rect)));
|
new SpaceBarSettingsView(rect)));
|
||||||
|
|
||||||
// compute preferred view size
|
// compute preferred view size
|
||||||
|
|||||||
@@ -32,7 +32,9 @@ names are registered trademarks or trademarks of their respective holders.
|
|||||||
All rights reserved.
|
All rights reserved.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <Catalog.h>
|
||||||
#include <Debug.h>
|
#include <Debug.h>
|
||||||
|
#include <Locale.h>
|
||||||
#include <Menu.h>
|
#include <Menu.h>
|
||||||
#include <MenuBar.h>
|
#include <MenuBar.h>
|
||||||
#include <MenuItem.h>
|
#include <MenuItem.h>
|
||||||
@@ -47,6 +49,10 @@ All rights reserved.
|
|||||||
#include "MountMenu.h"
|
#include "MountMenu.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#undef B_TRANSLATE_CONTEXT
|
||||||
|
#define B_TRANSLATE_CONTEXT "libtracker"
|
||||||
|
|
||||||
BVolumeWindow::BVolumeWindow(LockingList<BWindow> *windowList, uint32 openFlags)
|
BVolumeWindow::BVolumeWindow(LockingList<BWindow> *windowList, uint32 openFlags)
|
||||||
: BContainerWindow(windowList, openFlags)
|
: BContainerWindow(windowList, openFlags)
|
||||||
{
|
{
|
||||||
@@ -79,7 +85,7 @@ BVolumeWindow::MenusBeginning()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
BMenuItem *item = fMenuBar->FindItem("Unmount");
|
BMenuItem* item = fMenuBar->FindItem(B_TRANSLATE("Unmount"));
|
||||||
if (item)
|
if (item)
|
||||||
item->SetEnabled(ejectableVolumeSelected);
|
item->SetEnabled(ejectableVolumeSelected);
|
||||||
}
|
}
|
||||||
@@ -88,23 +94,27 @@ BVolumeWindow::MenusBeginning()
|
|||||||
void
|
void
|
||||||
BVolumeWindow::AddFileMenu(BMenu *menu)
|
BVolumeWindow::AddFileMenu(BMenu *menu)
|
||||||
{
|
{
|
||||||
menu->AddItem(new BMenuItem("Find"B_UTF8_ELLIPSIS,
|
menu->AddItem(new BMenuItem(B_TRANSLATE("Find"B_UTF8_ELLIPSIS),
|
||||||
new BMessage(kFindButton), 'F'));
|
new BMessage(kFindButton), 'F'));
|
||||||
menu->AddSeparatorItem();
|
menu->AddSeparatorItem();
|
||||||
|
|
||||||
menu->AddItem(new BMenuItem("Open", new BMessage(kOpenSelection), 'O'));
|
menu->AddItem(new BMenuItem(B_TRANSLATE("Open"),
|
||||||
menu->AddItem(new BMenuItem("Get info", new BMessage(kGetInfo), 'I'));
|
new BMessage(kOpenSelection), 'O'));
|
||||||
menu->AddItem(new BMenuItem("Edit name", new BMessage(kEditItem), 'E'));
|
menu->AddItem(new BMenuItem(B_TRANSLATE("Get info"),
|
||||||
|
new BMessage(kGetInfo), 'I'));
|
||||||
|
menu->AddItem(new BMenuItem(B_TRANSLATE("Edit name"),
|
||||||
|
new BMessage(kEditItem), 'E'));
|
||||||
|
|
||||||
BMenuItem *item = new BMenuItem("Unmount", new BMessage(kUnmountVolume), 'U');
|
BMenuItem* item = new BMenuItem(B_TRANSLATE("Unmount"),
|
||||||
|
new BMessage(kUnmountVolume), 'U');
|
||||||
item->SetEnabled(false);
|
item->SetEnabled(false);
|
||||||
menu->AddItem(item);
|
menu->AddItem(item);
|
||||||
|
|
||||||
menu->AddItem(new BMenuItem("Mount settings" B_UTF8_ELLIPSIS,
|
menu->AddItem(new BMenuItem(B_TRANSLATE("Mount settings" B_UTF8_ELLIPSIS),
|
||||||
new BMessage(kRunAutomounterSettings)));
|
new BMessage(kRunAutomounterSettings)));
|
||||||
|
|
||||||
menu->AddSeparatorItem();
|
menu->AddSeparatorItem();
|
||||||
menu->AddItem(new BMenu(kAddOnsMenuName));
|
menu->AddItem(new BMenu(B_TRANSLATE("Add-ons")));
|
||||||
menu->SetTargetForItems(PoseView());
|
menu->SetTargetForItems(PoseView());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -118,26 +128,35 @@ BVolumeWindow::AddWindowContextMenus(BMenu *menu)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
menu->AddItem(new BMenuItem("Icon view", new BMessage(kIconMode)));
|
menu->AddItem(new BMenuItem(B_TRANSLATE("Icon view"),
|
||||||
menu->AddItem(new BMenuItem("Mini icon view", new BMessage(kMiniIconMode)));
|
new BMessage(kIconMode)));
|
||||||
menu->AddItem(new BMenuItem("List view", new BMessage(kListMode)));
|
menu->AddItem(new BMenuItem(B_TRANSLATE("Mini icon view"),
|
||||||
|
new BMessage(kMiniIconMode)));
|
||||||
|
menu->AddItem(new BMenuItem(B_TRANSLATE("List view"),
|
||||||
|
new BMessage(kListMode)));
|
||||||
menu->AddSeparatorItem();
|
menu->AddSeparatorItem();
|
||||||
|
|
||||||
BMenuItem *resizeItem = new BMenuItem("Resize to fit",new BMessage(kResizeToFit), 'Y');
|
BMenuItem* resizeItem = new BMenuItem(B_TRANSLATE("Resize to fit"),
|
||||||
|
new BMessage(kResizeToFit), 'Y');
|
||||||
menu->AddItem(resizeItem);
|
menu->AddItem(resizeItem);
|
||||||
menu->AddItem(new BMenuItem("Clean up", new BMessage(kCleanup), 'K'));
|
menu->AddItem(new BMenuItem(B_TRANSLATE("Clean up"),
|
||||||
menu->AddItem(new BMenuItem("Select"B_UTF8_ELLIPSIS, new BMessage(kShowSelectionWindow), 'A', B_SHIFT_KEY));
|
new BMessage(kCleanup), 'K'));
|
||||||
menu->AddItem(new BMenuItem("Select all", new BMessage(B_SELECT_ALL), 'A'));
|
menu->AddItem(new BMenuItem(B_TRANSLATE("Select"B_UTF8_ELLIPSIS),
|
||||||
menu->AddItem(new BMenuItem("Invert selection", new BMessage(kInvertSelection), 'S'));
|
new BMessage(kShowSelectionWindow), 'A', B_SHIFT_KEY));
|
||||||
|
menu->AddItem(new BMenuItem(B_TRANSLATE("Select all"),
|
||||||
|
new BMessage(B_SELECT_ALL), 'A'));
|
||||||
|
menu->AddItem(new BMenuItem(B_TRANSLATE("Invert selection"),
|
||||||
|
new BMessage(kInvertSelection), 'S'));
|
||||||
|
|
||||||
BMenuItem *closeItem = new BMenuItem("Close",new BMessage(B_QUIT_REQUESTED), 'W');
|
BMenuItem* closeItem = new BMenuItem(B_TRANSLATE("Close"),
|
||||||
|
new BMessage(B_QUIT_REQUESTED), 'W');
|
||||||
menu->AddItem(closeItem);
|
menu->AddItem(closeItem);
|
||||||
menu->AddSeparatorItem();
|
menu->AddSeparatorItem();
|
||||||
|
|
||||||
menu->AddItem(new MountMenu("Mount"));
|
menu->AddItem(new MountMenu(B_TRANSLATE("Mount")));
|
||||||
menu->AddSeparatorItem();
|
menu->AddSeparatorItem();
|
||||||
|
|
||||||
menu->AddItem(new BMenu(kAddOnsMenuName));
|
menu->AddItem(new BMenu(B_TRANSLATE("Add-ons")));
|
||||||
|
|
||||||
// target items as needed
|
// target items as needed
|
||||||
menu->SetTargetForItems(PoseView());
|
menu->SetTargetForItems(PoseView());
|
||||||
|
|||||||
@@ -40,7 +40,9 @@ All rights reserved.
|
|||||||
|
|
||||||
#include <Alert.h>
|
#include <Alert.h>
|
||||||
#include <AppFileInfo.h>
|
#include <AppFileInfo.h>
|
||||||
|
#include <Catalog.h>
|
||||||
#include <Debug.h>
|
#include <Debug.h>
|
||||||
|
#include <Locale.h>
|
||||||
#include <NodeInfo.h>
|
#include <NodeInfo.h>
|
||||||
#include <Path.h>
|
#include <Path.h>
|
||||||
#include <TextView.h>
|
#include <TextView.h>
|
||||||
@@ -61,6 +63,11 @@ All rights reserved.
|
|||||||
#include "WidgetAttributeText.h"
|
#include "WidgetAttributeText.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#undef B_TRANSLATE_CONTEXT
|
||||||
|
#define B_TRANSLATE_CONTEXT "libtracker"
|
||||||
|
|
||||||
|
|
||||||
const int32 kGenericReadBufferSize = 1024;
|
const int32 kGenericReadBufferSize = 1024;
|
||||||
|
|
||||||
template <class View>
|
template <class View>
|
||||||
@@ -209,30 +216,32 @@ TruncFileSizeBase(BString *result, int64 value, const View *view, float width)
|
|||||||
// if slow, replace float divisions with shifts
|
// if slow, replace float divisions with shifts
|
||||||
// if fast enough, try fitting more decimal places
|
// if fast enough, try fitting more decimal places
|
||||||
|
|
||||||
|
// TODO: reuse libshared's string_for_size
|
||||||
|
|
||||||
// format file size value
|
// format file size value
|
||||||
char buffer[1024];
|
char buffer[1024];
|
||||||
if (value == kUnknownSize) {
|
if (value == kUnknownSize) {
|
||||||
*result = "-";
|
*result = "-";
|
||||||
return view->StringWidth("-");
|
return view->StringWidth("-");
|
||||||
} else if (value < kKBSize) {
|
} else if (value < kKBSize) {
|
||||||
sprintf(buffer, "%Ld bytes", value);
|
sprintf(buffer, B_TRANSLATE("%Ld bytes"), value);
|
||||||
if (view->StringWidth(buffer) > width)
|
if (view->StringWidth(buffer) > width)
|
||||||
sprintf(buffer, "%Ld B", value);
|
sprintf(buffer, B_TRANSLATE("%Ld B"), value);
|
||||||
} else {
|
} else {
|
||||||
const char *suffix;
|
const char *suffix;
|
||||||
float floatValue;
|
float floatValue;
|
||||||
if (value >= kTBSize) {
|
if (value >= kTBSize) {
|
||||||
suffix = "TiB";
|
suffix = B_TRANSLATE("TiB");
|
||||||
floatValue = (float)value / kTBSize;
|
floatValue = (float)value / kTBSize;
|
||||||
} else if (value >= kGBSize) {
|
} else if (value >= kGBSize) {
|
||||||
suffix = "GiB";
|
suffix = B_TRANSLATE("GiB");
|
||||||
floatValue = (float)value / kGBSize;
|
floatValue = (float)value / kGBSize;
|
||||||
} else if (value >= kMBSize) {
|
} else if (value >= kMBSize) {
|
||||||
suffix = "MiB";
|
suffix = B_TRANSLATE("MiB");
|
||||||
floatValue = (float)value / kMBSize;
|
floatValue = (float)value / kMBSize;
|
||||||
} else {
|
} else {
|
||||||
ASSERT(value >= kKBSize);
|
ASSERT(value >= kKBSize);
|
||||||
suffix = "KiB";
|
suffix = B_TRANSLATE("KiB");
|
||||||
floatValue = (float)value / kKBSize;
|
floatValue = (float)value / kKBSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -751,7 +760,7 @@ KindAttributeText::ReadValue(BString *result)
|
|||||||
|
|
||||||
// get the mime type
|
// get the mime type
|
||||||
if (mime.SetType(fModel->MimeType()) != B_OK)
|
if (mime.SetType(fModel->MimeType()) != B_OK)
|
||||||
*result = "Unknown";
|
*result = B_TRANSLATE("Unknown");
|
||||||
// get the short mime type description
|
// get the short mime type description
|
||||||
else if (mime.GetShortDescription(desc) == B_OK)
|
else if (mime.GetShortDescription(desc) == B_OK)
|
||||||
*result = desc;
|
*result = desc;
|
||||||
@@ -872,9 +881,12 @@ NameAttributeText::CommitEditedTextFlavor(BTextView *textView)
|
|||||||
|
|
||||||
bool removeExisting = false;
|
bool removeExisting = false;
|
||||||
if (parent.Contains(text)) {
|
if (parent.Contains(text)) {
|
||||||
BAlert *alert = new BAlert("", "That name is already taken. "
|
BAlert* alert = new BAlert("",
|
||||||
"Please type another one.", "Replace other file", "OK", NULL,
|
B_TRANSLATE("That name is already taken. "
|
||||||
B_WIDTH_AS_USUAL, B_WARNING_ALERT);
|
"Please type another one."),
|
||||||
|
B_TRANSLATE("Replace other file"),
|
||||||
|
B_TRANSLATE("OK"),
|
||||||
|
NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
|
||||||
|
|
||||||
alert->SetShortcut(0, 'r');
|
alert->SetShortcut(0, 'r');
|
||||||
|
|
||||||
@@ -1592,8 +1604,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) {
|
||||||
BAlert *alert = new BAlert("", "Sorry, you cannot edit that attribute.",
|
BAlert* alert = new BAlert("",
|
||||||
"Cancel", 0, 0, B_WIDTH_AS_USUAL, B_STOP_ALERT);
|
B_TRANSLATE("Sorry, you cannot edit that attribute."),
|
||||||
|
B_TRANSLATE("Cancel"),
|
||||||
|
0, 0, B_WIDTH_AS_USUAL, B_STOP_ALERT);
|
||||||
alert->SetShortcut(0, B_ESCAPE);
|
alert->SetShortcut(0, B_ESCAPE);
|
||||||
alert->Go();
|
alert->Go();
|
||||||
return false;
|
return false;
|
||||||
@@ -1626,9 +1640,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)) {
|
||||||
BAlert *alert = new BAlert("", "Sorry, the 'Character' "
|
BAlert* alert = new BAlert("",
|
||||||
"attribute cannot store a multi-byte glyph.",
|
B_TRANSLATE("Sorry, the 'Character' "
|
||||||
"Cancel", 0, 0, B_WIDTH_AS_USUAL, B_STOP_ALERT);
|
"attribute cannot store a multi-byte glyph."),
|
||||||
|
B_TRANSLATE("Cancel"),
|
||||||
|
0, 0, B_WIDTH_AS_USUAL, B_STOP_ALERT);
|
||||||
alert->SetShortcut(0, B_ESCAPE);
|
alert->SetShortcut(0, B_ESCAPE);
|
||||||
alert->Go();
|
alert->Go();
|
||||||
return false;
|
return false;
|
||||||
@@ -1727,9 +1743,10 @@ GenericAttributeText::CommitEditedTextFlavor(BTextView *textView)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (size < 0) {
|
if (size < 0) {
|
||||||
BAlert *alert = new BAlert("",
|
BAlert* alert = new BAlert("",
|
||||||
"There was an error writing the attribute.",
|
B_TRANSLATE("There was an error writing the attribute."),
|
||||||
"Cancel", 0, 0, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
|
B_TRANSLATE("Cancel"),
|
||||||
|
0, 0, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
|
||||||
alert->SetShortcut(0, B_ESCAPE);
|
alert->SetShortcut(0, B_ESCAPE);
|
||||||
alert->Go();
|
alert->Go();
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
resource app_signature "application/x-vnd.Haiku-libtracker";
|
||||||
Reference in New Issue
Block a user