Updated to use B_TRANSLATE* macros. relates to #5408.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36666 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -77,16 +77,18 @@ DirectoryFilePanel::Show()
|
|||||||
}
|
}
|
||||||
|
|
||||||
rect.right = rect.left -= 30;
|
rect.right = rect.left -= 30;
|
||||||
float width = be_plain_font->StringWidth(TR("Select current")) + 20;
|
float width = be_plain_font->StringWidth(
|
||||||
|
B_TRANSLATE("Select current")) + 20;
|
||||||
rect.left = width > 75 ? rect.right - width : rect.right - 75;
|
rect.left = width > 75 ? rect.right - width : rect.right - 75;
|
||||||
fCurrentButton = new BButton(rect, "directoryButton", TR("Select current"),
|
fCurrentButton = new BButton(rect, "directoryButton",
|
||||||
new BMessage(MSG_DIRECTORY), B_FOLLOW_RIGHT | B_FOLLOW_BOTTOM);
|
B_TRANSLATE("Select current"), new BMessage(MSG_DIRECTORY),
|
||||||
|
B_FOLLOW_RIGHT | B_FOLLOW_BOTTOM);
|
||||||
|
|
||||||
background->AddChild(fCurrentButton);
|
background->AddChild(fCurrentButton);
|
||||||
fCurrentButton->SetTarget(Messenger());
|
fCurrentButton->SetTarget(Messenger());
|
||||||
|
|
||||||
SetButtonLabel(B_DEFAULT_BUTTON, TR("Select"));
|
SetButtonLabel(B_DEFAULT_BUTTON, B_TRANSLATE("Select"));
|
||||||
Window()->SetTitle(TR("Expander: Choose destination"));
|
Window()->SetTitle(B_TRANSLATE("Expander: Choose destination"));
|
||||||
|
|
||||||
Window()->Unlock();
|
Window()->Unlock();
|
||||||
|
|
||||||
@@ -106,7 +108,7 @@ DirectoryFilePanel::SelectionChanged()
|
|||||||
entry_ref ref;
|
entry_ref ref;
|
||||||
GetPanelDirectory(&ref);
|
GetPanelDirectory(&ref);
|
||||||
if (snprintf(label, sizeof(label),
|
if (snprintf(label, sizeof(label),
|
||||||
TR("Select '%s'"), ref.name) >= (int)sizeof(label))
|
B_TRANSLATE("Select '%s'"), ref.name) >= (int)sizeof(label))
|
||||||
strcpy(label + sizeof(label) - 5, B_UTF8_ELLIPSIS "'");
|
strcpy(label + sizeof(label) - 5, B_UTF8_ELLIPSIS "'");
|
||||||
|
|
||||||
// Resize button so that the label fits
|
// Resize button so that the label fits
|
||||||
|
|||||||
@@ -31,13 +31,13 @@ ExpanderApp::ExpanderApp()
|
|||||||
void
|
void
|
||||||
ExpanderApp::AboutRequested()
|
ExpanderApp::AboutRequested()
|
||||||
{
|
{
|
||||||
BString appName = TR("Expander");
|
BString appName = B_TRANSLATE("Expander");
|
||||||
int nameLength = appName.CountChars();
|
int nameLength = appName.CountChars();
|
||||||
BAlert* alert = new BAlert("about",
|
BAlert* alert = new BAlert("about",
|
||||||
appName.Append(TR("\n\twritten by Jérôme Duval\n"
|
appName.Append(B_TRANSLATE("\n\twritten by Jérôme Duval\n"
|
||||||
"\tCopyright 2004-2006, Haiku Inc.\n\noriginal Be version by \n"
|
"\tCopyright 2004-2006, Haiku Inc.\n\noriginal Be version by \n"
|
||||||
"Dominic, Hiroshi, Peter, Pavel and Robert\n")),
|
"Dominic, Hiroshi, Peter, Pavel and Robert\n")),
|
||||||
TR("OK"));
|
B_TRANSLATE("OK"));
|
||||||
BTextView* view = alert->TextView();
|
BTextView* view = alert->TextView();
|
||||||
BFont font;
|
BFont font;
|
||||||
|
|
||||||
|
|||||||
@@ -31,39 +31,40 @@ ExpanderPreferences::ExpanderPreferences(BMessage *settings)
|
|||||||
fUsePanel(NULL)
|
fUsePanel(NULL)
|
||||||
{
|
{
|
||||||
BBox* box = new BBox("background");
|
BBox* box = new BBox("background");
|
||||||
box->SetLabel(TR("Expander settings"));
|
box->SetLabel(B_TRANSLATE("Expander settings"));
|
||||||
|
|
||||||
fAutoExpand = new BCheckBox("autoExpand",
|
fAutoExpand = new BCheckBox("autoExpand",
|
||||||
TR("Automatically expand files"), NULL);
|
B_TRANSLATE("Automatically expand files"), NULL);
|
||||||
fCloseWindow = new BCheckBox("closeWindowWhenDone",
|
fCloseWindow = new BCheckBox("closeWindowWhenDone",
|
||||||
TR("Close window when done expanding"), NULL);
|
B_TRANSLATE("Close window when done expanding"), NULL);
|
||||||
|
|
||||||
fLeaveDest = new BRadioButton("leaveDest",
|
fLeaveDest = new BRadioButton("leaveDest",
|
||||||
TR("Leave destination folder path empty"),
|
B_TRANSLATE("Leave destination folder path empty"),
|
||||||
new BMessage(MSG_LEAVEDEST));
|
new BMessage(MSG_LEAVEDEST));
|
||||||
fSameDest = new BRadioButton("sameDir",
|
fSameDest = new BRadioButton("sameDir",
|
||||||
TR("Same directory as source (archive) file"),
|
B_TRANSLATE("Same directory as source (archive) file"),
|
||||||
new BMessage(MSG_SAMEDIR));
|
new BMessage(MSG_SAMEDIR));
|
||||||
fDestUse = new BRadioButton("destUse",
|
fDestUse = new BRadioButton("destUse",
|
||||||
TR("Use:"), new BMessage(MSG_DESTUSE));
|
B_TRANSLATE("Use:"), new BMessage(MSG_DESTUSE));
|
||||||
fDestText = new BTextControl("destText", "", "", new BMessage(MSG_DESTTEXT));
|
fDestText = new BTextControl("destText", "", "",
|
||||||
|
new BMessage(MSG_DESTTEXT));
|
||||||
fDestText->SetDivider(0);
|
fDestText->SetDivider(0);
|
||||||
fDestText->TextView()->MakeEditable(false);
|
fDestText->TextView()->MakeEditable(false);
|
||||||
fDestText->SetEnabled(false);
|
fDestText->SetEnabled(false);
|
||||||
fSelect = new BButton("selectButton", TR("Select"),
|
fSelect = new BButton("selectButton", B_TRANSLATE("Select"),
|
||||||
new BMessage(MSG_DESTSELECT));
|
new BMessage(MSG_DESTSELECT));
|
||||||
fSelect->SetEnabled(false);
|
fSelect->SetEnabled(false);
|
||||||
|
|
||||||
fOpenDest = new BCheckBox("openDestination",
|
fOpenDest = new BCheckBox("openDestination",
|
||||||
TR("Open destination folder after extraction"), NULL);
|
B_TRANSLATE("Open destination folder after extraction"), NULL);
|
||||||
fAutoShow = new BCheckBox("autoShow",
|
fAutoShow = new BCheckBox("autoShow",
|
||||||
TR("Automatically show contents listing"), NULL);
|
B_TRANSLATE("Automatically show contents listing"), NULL);
|
||||||
|
|
||||||
BView* view = new BGroupView();
|
BView* view = new BGroupView();
|
||||||
view->SetLayout(new BGroupLayout(B_HORIZONTAL));
|
view->SetLayout(new BGroupLayout(B_HORIZONTAL));
|
||||||
view->AddChild(BGroupLayoutBuilder(B_VERTICAL)
|
view->AddChild(BGroupLayoutBuilder(B_VERTICAL)
|
||||||
.AddGroup(B_HORIZONTAL)
|
.AddGroup(B_HORIZONTAL)
|
||||||
.Add(new BStringView("expansion", TR("Expansion:")))
|
.Add(new BStringView("expansion", B_TRANSLATE("Expansion:")))
|
||||||
.AddGlue()
|
.AddGlue()
|
||||||
.End()
|
.End()
|
||||||
.AddGroup(B_VERTICAL, 1)
|
.AddGroup(B_VERTICAL, 1)
|
||||||
@@ -72,7 +73,8 @@ ExpanderPreferences::ExpanderPreferences(BMessage *settings)
|
|||||||
.SetInsets(10, 0, 0, 10)
|
.SetInsets(10, 0, 0, 10)
|
||||||
.End()
|
.End()
|
||||||
.AddGroup(B_HORIZONTAL)
|
.AddGroup(B_HORIZONTAL)
|
||||||
.Add(new BStringView("destinationFolder", TR("Destination folder:")))
|
.Add(new BStringView("destinationFolder",
|
||||||
|
B_TRANSLATE("Destination folder:")))
|
||||||
.AddGlue()
|
.AddGlue()
|
||||||
.End()
|
.End()
|
||||||
.AddGroup(B_VERTICAL, 1)
|
.AddGroup(B_VERTICAL, 1)
|
||||||
@@ -87,7 +89,7 @@ ExpanderPreferences::ExpanderPreferences(BMessage *settings)
|
|||||||
.SetInsets(10, 0, 0, 10)
|
.SetInsets(10, 0, 0, 10)
|
||||||
.End()
|
.End()
|
||||||
.AddGroup(B_HORIZONTAL)
|
.AddGroup(B_HORIZONTAL)
|
||||||
.Add(new BStringView("other", TR("Other:")))
|
.Add(new BStringView("other", B_TRANSLATE("Other:")))
|
||||||
.AddGlue()
|
.AddGlue()
|
||||||
.End()
|
.End()
|
||||||
.AddGroup(B_VERTICAL, 1)
|
.AddGroup(B_VERTICAL, 1)
|
||||||
@@ -99,21 +101,22 @@ ExpanderPreferences::ExpanderPreferences(BMessage *settings)
|
|||||||
);
|
);
|
||||||
box->AddChild(view);
|
box->AddChild(view);
|
||||||
|
|
||||||
BButton* button = new BButton("OKButton", TR("OK"), new BMessage(MSG_OK));
|
BButton* button = new BButton("OKButton", B_TRANSLATE("OK"),
|
||||||
|
new BMessage(MSG_OK));
|
||||||
button->MakeDefault(true);
|
button->MakeDefault(true);
|
||||||
BButton* cancel = new BButton("CancelButton", TR("Cancel"),
|
BButton* cancel = new BButton("CancelButton", B_TRANSLATE("Cancel"),
|
||||||
new BMessage(MSG_CANCEL));
|
new BMessage(MSG_CANCEL));
|
||||||
|
|
||||||
SetLayout(new BGroupLayout(B_HORIZONTAL));
|
SetLayout(new BGroupLayout(B_HORIZONTAL));
|
||||||
AddChild(BGroupLayoutBuilder(B_VERTICAL, 11)
|
AddChild(BGroupLayoutBuilder(B_VERTICAL, 11)
|
||||||
.Add(box)
|
.Add(box)
|
||||||
.AddGroup(B_HORIZONTAL, 10)
|
.AddGroup(B_HORIZONTAL, 10)
|
||||||
.AddGlue()
|
.AddGlue()
|
||||||
.Add(cancel)
|
.Add(cancel)
|
||||||
.Add(button)
|
.Add(button)
|
||||||
.End()
|
.End()
|
||||||
.SetInsets(10, 10, 10, 10)
|
.SetInsets(10, 10, 10, 10)
|
||||||
);
|
);
|
||||||
|
|
||||||
CenterOnScreen();
|
CenterOnScreen();
|
||||||
|
|
||||||
@@ -220,13 +223,18 @@ ExpanderPreferences::MessageReceived(BMessage* msg)
|
|||||||
Hide();
|
Hide();
|
||||||
break;
|
break;
|
||||||
case MSG_OK:
|
case MSG_OK:
|
||||||
fSettings->ReplaceBool("automatically_expand_files", fAutoExpand->Value() == B_CONTROL_ON);
|
fSettings->ReplaceBool("automatically_expand_files",
|
||||||
fSettings->ReplaceBool("close_when_done", fCloseWindow->Value() == B_CONTROL_ON);
|
fAutoExpand->Value() == B_CONTROL_ON);
|
||||||
fSettings->ReplaceInt8("destination_folder", (fSameDest->Value() == B_CONTROL_ON) ? 0x63
|
fSettings->ReplaceBool("close_when_done",
|
||||||
|
fCloseWindow->Value() == B_CONTROL_ON);
|
||||||
|
fSettings->ReplaceInt8("destination_folder",
|
||||||
|
(fSameDest->Value() == B_CONTROL_ON) ? 0x63
|
||||||
: ((fLeaveDest->Value() == B_CONTROL_ON) ? 0x66 : 0x65));
|
: ((fLeaveDest->Value() == B_CONTROL_ON) ? 0x66 : 0x65));
|
||||||
fSettings->ReplaceRef("destination_folder_use", &fRef);
|
fSettings->ReplaceRef("destination_folder_use", &fRef);
|
||||||
fSettings->ReplaceBool("open_destination_folder", fOpenDest->Value() == B_CONTROL_ON);
|
fSettings->ReplaceBool("open_destination_folder",
|
||||||
fSettings->ReplaceBool("show_contents_listing", fAutoShow->Value() == B_CONTROL_ON);
|
fOpenDest->Value() == B_CONTROL_ON);
|
||||||
|
fSettings->ReplaceBool("show_contents_listing",
|
||||||
|
fAutoShow->Value() == B_CONTROL_ON);
|
||||||
Hide();
|
Hide();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -50,7 +50,8 @@ const uint32 MSG_SHOWCONTENTS = 'mSCT';
|
|||||||
ExpanderWindow::ExpanderWindow(BRect frame, const entry_ref* ref,
|
ExpanderWindow::ExpanderWindow(BRect frame, const entry_ref* ref,
|
||||||
BMessage* settings)
|
BMessage* settings)
|
||||||
:
|
:
|
||||||
BWindow(frame, TR_CMT("Expander", "!! Window Title !!"), B_TITLED_WINDOW, B_NORMAL_WINDOW_FEEL),
|
BWindow(frame, B_TRANSLATE_COMMENT("Expander", "!! Window Title !!"),
|
||||||
|
B_TITLED_WINDOW, B_NORMAL_WINDOW_FEEL),
|
||||||
fSourcePanel(NULL),
|
fSourcePanel(NULL),
|
||||||
fDestPanel(NULL),
|
fDestPanel(NULL),
|
||||||
fSourceChanged(true),
|
fSourceChanged(true),
|
||||||
@@ -66,9 +67,12 @@ ExpanderWindow::ExpanderWindow(BRect frame, const entry_ref* ref,
|
|||||||
|
|
||||||
_AddMenuBar(layout);
|
_AddMenuBar(layout);
|
||||||
|
|
||||||
fDestButton = new BButton(TR("Destination"), new BMessage(MSG_DEST));
|
fDestButton = new BButton(B_TRANSLATE("Destination"),
|
||||||
fSourceButton = new BButton(TR("Source"), new BMessage(MSG_SOURCE));
|
new BMessage(MSG_DEST));
|
||||||
fExpandButton = new BButton(TR("Expand"), new BMessage(MSG_EXPAND));
|
fSourceButton = new BButton(B_TRANSLATE("Source"),
|
||||||
|
new BMessage(MSG_SOURCE));
|
||||||
|
fExpandButton = new BButton(B_TRANSLATE("Expand"),
|
||||||
|
new BMessage(MSG_EXPAND));
|
||||||
|
|
||||||
BSize size = fDestButton->PreferredSize();
|
BSize size = fDestButton->PreferredSize();
|
||||||
size.width = max_c(size.width, fSourceButton->PreferredSize().width);
|
size.width = max_c(size.width, fSourceButton->PreferredSize().width);
|
||||||
@@ -103,7 +107,8 @@ ExpanderWindow::ExpanderWindow(BRect frame, const entry_ref* ref,
|
|||||||
.Add(fDestText = new BTextControl(NULL, NULL,
|
.Add(fDestText = new BTextControl(NULL, NULL,
|
||||||
new BMessage(MSG_DESTTEXT)))
|
new BMessage(MSG_DESTTEXT)))
|
||||||
.AddGroup(B_HORIZONTAL, spacing)
|
.AddGroup(B_HORIZONTAL, spacing)
|
||||||
.Add(fShowContents = new BCheckBox(TR("Show contents"),
|
.Add(fShowContents = new BCheckBox(
|
||||||
|
B_TRANSLATE("Show contents"),
|
||||||
new BMessage(MSG_SHOWCONTENTS)))
|
new BMessage(MSG_SHOWCONTENTS)))
|
||||||
.Add(fStatusView = new BStringView(NULL, NULL))
|
.Add(fStatusView = new BStringView(NULL, NULL))
|
||||||
.End()
|
.End()
|
||||||
@@ -144,23 +149,23 @@ ExpanderWindow::ValidateDest()
|
|||||||
BEntry entry(fDestText->Text(), true);
|
BEntry entry(fDestText->Text(), true);
|
||||||
BVolume volume;
|
BVolume volume;
|
||||||
if (!entry.Exists()) {
|
if (!entry.Exists()) {
|
||||||
BAlert* alert = new BAlert("destAlert",
|
BAlert* alert = new BAlert("destAlert",
|
||||||
TR("The destination folder does not exist."),
|
B_TRANSLATE("The destination folder does not exist."),
|
||||||
TR("Cancel"), NULL, NULL,
|
B_TRANSLATE("Cancel"), NULL, NULL,
|
||||||
B_WIDTH_AS_USUAL, B_EVEN_SPACING, B_WARNING_ALERT);
|
B_WIDTH_AS_USUAL, B_EVEN_SPACING, B_WARNING_ALERT);
|
||||||
alert->Go();
|
alert->Go();
|
||||||
return false;
|
return false;
|
||||||
} else if (!entry.IsDirectory()) {
|
} else if (!entry.IsDirectory()) {
|
||||||
(new BAlert("destAlert",
|
(new BAlert("destAlert",
|
||||||
TR("The destination is not a folder."),
|
B_TRANSLATE("The destination is not a folder."),
|
||||||
TR("Cancel"), NULL, NULL,
|
B_TRANSLATE("Cancel"), NULL, NULL,
|
||||||
B_WIDTH_AS_USUAL, B_EVEN_SPACING, B_WARNING_ALERT))->Go();
|
B_WIDTH_AS_USUAL, B_EVEN_SPACING, B_WARNING_ALERT))->Go();
|
||||||
return false;
|
return false;
|
||||||
} else if (entry.GetVolume(&volume) != B_OK || volume.IsReadOnly()) {
|
} else if (entry.GetVolume(&volume) != B_OK || volume.IsReadOnly()) {
|
||||||
(new BAlert("destAlert",
|
(new BAlert("destAlert",
|
||||||
TR("The destination is read only."),
|
B_TRANSLATE("The destination is read only."),
|
||||||
TR("Cancel"), NULL, NULL, B_WIDTH_AS_USUAL, B_EVEN_SPACING,
|
B_TRANSLATE("Cancel"), NULL, NULL, B_WIDTH_AS_USUAL,
|
||||||
B_WARNING_ALERT))->Go();
|
B_EVEN_SPACING, B_WARNING_ALERT))->Go();
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
entry.GetRef(&fDestRef);
|
entry.GetRef(&fDestRef);
|
||||||
@@ -183,7 +188,8 @@ ExpanderWindow::MessageReceived(BMessage* msg)
|
|||||||
BMessenger messenger(this);
|
BMessenger messenger(this);
|
||||||
fSourcePanel = new BFilePanel(B_OPEN_PANEL, &messenger, &srcRef,
|
fSourcePanel = new BFilePanel(B_OPEN_PANEL, &messenger, &srcRef,
|
||||||
B_FILE_NODE, false, NULL, new RuleRefFilter(fRules), true);
|
B_FILE_NODE, false, NULL, new RuleRefFilter(fRules), true);
|
||||||
(fSourcePanel->Window())->SetTitle(TR("Expander: Open"));
|
(fSourcePanel->Window())->SetTitle(
|
||||||
|
B_TRANSLATE("Expander: Open"));
|
||||||
} else
|
} else
|
||||||
fSourcePanel->SetPanelDirectory(&srcRef);
|
fSourcePanel->SetPanelDirectory(&srcRef);
|
||||||
fSourcePanel->Show();
|
fSourcePanel->Show();
|
||||||
@@ -191,7 +197,7 @@ ExpanderWindow::MessageReceived(BMessage* msg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
case MSG_DEST:
|
case MSG_DEST:
|
||||||
{
|
{
|
||||||
BEntry entry(fDestText->Text(), true);
|
BEntry entry(fDestText->Text(), true);
|
||||||
entry_ref destRef;
|
entry_ref destRef;
|
||||||
if (entry.Exists() && entry.IsDirectory())
|
if (entry.Exists() && entry.IsDirectory())
|
||||||
@@ -201,7 +207,7 @@ ExpanderWindow::MessageReceived(BMessage* msg)
|
|||||||
fDestPanel = new DirectoryFilePanel(B_OPEN_PANEL, &messenger,
|
fDestPanel = new DirectoryFilePanel(B_OPEN_PANEL, &messenger,
|
||||||
&destRef, B_DIRECTORY_NODE, false, NULL,
|
&destRef, B_DIRECTORY_NODE, false, NULL,
|
||||||
new DirectoryRefFilter(), true);
|
new DirectoryRefFilter(), true);
|
||||||
} else
|
} else
|
||||||
fDestPanel->SetPanelDirectory(&destRef);
|
fDestPanel->SetPanelDirectory(&destRef);
|
||||||
fDestPanel->Show();
|
fDestPanel->Show();
|
||||||
break;
|
break;
|
||||||
@@ -236,8 +242,9 @@ ExpanderWindow::MessageReceived(BMessage* msg)
|
|||||||
if (fExpandingStarted) {
|
if (fExpandingStarted) {
|
||||||
fExpandingThread->SuspendExternalExpander();
|
fExpandingThread->SuspendExternalExpander();
|
||||||
BAlert* alert = new BAlert("stopAlert",
|
BAlert* alert = new BAlert("stopAlert",
|
||||||
TR("Are you sure you want to stop expanding this\narchive? The expanded items may not be complete."),
|
B_TRANSLATE("Are you sure you want to stop expanding this\n"
|
||||||
TR("Stop"), TR("Continue"), NULL,
|
"archive? The expanded items may not be complete."),
|
||||||
|
B_TRANSLATE("Stop"), B_TRANSLATE("Continue"), NULL,
|
||||||
B_WIDTH_AS_USUAL, B_EVEN_SPACING, B_WARNING_ALERT);
|
B_WIDTH_AS_USUAL, B_EVEN_SPACING, B_WARNING_ALERT);
|
||||||
if (alert->Go() == 0) {
|
if (alert->Go() == 0) {
|
||||||
fExpandingThread->ResumeExternalExpander();
|
fExpandingThread->ResumeExternalExpander();
|
||||||
@@ -254,7 +261,7 @@ ExpanderWindow::MessageReceived(BMessage* msg)
|
|||||||
case MSG_SHOWCONTENTS:
|
case MSG_SHOWCONTENTS:
|
||||||
// change menu item label
|
// change menu item label
|
||||||
fShowItem->SetLabel(fShowContents->Value() == B_CONTROL_OFF
|
fShowItem->SetLabel(fShowContents->Value() == B_CONTROL_OFF
|
||||||
? TR("Show contents") : TR("Hide contents"));
|
? B_TRANSLATE("Show contents") : B_TRANSLATE("Hide contents"));
|
||||||
|
|
||||||
if (fShowContents->Value() == B_CONTROL_OFF) {
|
if (fShowContents->Value() == B_CONTROL_OFF) {
|
||||||
if (fListingStarted)
|
if (fListingStarted)
|
||||||
@@ -269,8 +276,9 @@ ExpanderWindow::MessageReceived(BMessage* msg)
|
|||||||
{
|
{
|
||||||
BEntry entry(fSourceText->Text(), true);
|
BEntry entry(fSourceText->Text(), true);
|
||||||
if (!entry.Exists()) {
|
if (!entry.Exists()) {
|
||||||
BAlert* alert = new BAlert("srcAlert", TR("The file doesn't exist"),
|
BAlert* alert = new BAlert("srcAlert",
|
||||||
TR("Cancel"), NULL, NULL,
|
B_TRANSLATE("The file doesn't exist"),
|
||||||
|
B_TRANSLATE("Cancel"), NULL, NULL,
|
||||||
B_WIDTH_AS_USUAL, B_EVEN_SPACING, B_WARNING_ALERT);
|
B_WIDTH_AS_USUAL, B_EVEN_SPACING, B_WARNING_ALERT);
|
||||||
alert->Go();
|
alert->Go();
|
||||||
break;
|
break;
|
||||||
@@ -291,8 +299,9 @@ ExpanderWindow::MessageReceived(BMessage* msg)
|
|||||||
|
|
||||||
BString string = "The file : ";
|
BString string = "The file : ";
|
||||||
string += fSourceText->Text();
|
string += fSourceText->Text();
|
||||||
string += TR_MARK(" is not supported");
|
string += B_TRANSLATE_MARK(" is not supported");
|
||||||
BAlert* alert = new BAlert("srcAlert", string.String(), TR("Cancel"),
|
BAlert* alert = new BAlert("srcAlert", string.String(),
|
||||||
|
B_TRANSLATE("Cancel"),
|
||||||
NULL, NULL, B_WIDTH_AS_USUAL, B_EVEN_SPACING, B_INFO_ALERT);
|
NULL, NULL, B_WIDTH_AS_USUAL, B_EVEN_SPACING, B_INFO_ALERT);
|
||||||
alert->Go();
|
alert->Go();
|
||||||
|
|
||||||
@@ -333,7 +342,7 @@ ExpanderWindow::MessageReceived(BMessage* msg)
|
|||||||
// thread has finished (finished, quit, killed, we don't know)
|
// thread has finished (finished, quit, killed, we don't know)
|
||||||
// reset window state
|
// reset window state
|
||||||
if (fExpandingStarted) {
|
if (fExpandingStarted) {
|
||||||
fStatusView->SetText(TR("File expanded"));
|
fStatusView->SetText(B_TRANSLATE("File expanded"));
|
||||||
StopExpanding();
|
StopExpanding();
|
||||||
OpenDestFolder();
|
OpenDestFolder();
|
||||||
CloseWindowOrKeepOpen();
|
CloseWindowOrKeepOpen();
|
||||||
@@ -348,7 +357,7 @@ ExpanderWindow::MessageReceived(BMessage* msg)
|
|||||||
case 'exrr': // thread has finished
|
case 'exrr': // thread has finished
|
||||||
// reset window state
|
// reset window state
|
||||||
|
|
||||||
fStatusView->SetText(TR("Error when expanding archive"));
|
fStatusView->SetText(B_TRANSLATE("Error when expanding archive"));
|
||||||
CloseWindowOrKeepOpen();
|
CloseWindowOrKeepOpen();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -369,9 +378,10 @@ ExpanderWindow::CanQuit()
|
|||||||
if (fExpandingStarted) {
|
if (fExpandingStarted) {
|
||||||
fExpandingThread->SuspendExternalExpander();
|
fExpandingThread->SuspendExternalExpander();
|
||||||
BAlert* alert = new BAlert("stopAlert",
|
BAlert* alert = new BAlert("stopAlert",
|
||||||
TR("Are you sure you want to stop expanding this\narchive? The expanded items may not be complete."),
|
B_TRANSLATE("Are you sure you want to stop expanding this\n"
|
||||||
TR("Stop"), TR("Continue"), NULL, B_WIDTH_AS_USUAL, B_EVEN_SPACING,
|
"archive? The expanded items may not be complete."),
|
||||||
B_WARNING_ALERT);
|
B_TRANSLATE("Stop"), B_TRANSLATE("Continue"), NULL,
|
||||||
|
B_WIDTH_AS_USUAL, B_EVEN_SPACING, B_WARNING_ALERT);
|
||||||
if (alert->Go() == 0) {
|
if (alert->Go() == 0) {
|
||||||
fExpandingThread->ResumeExternalExpander();
|
fExpandingThread->ResumeExternalExpander();
|
||||||
StopExpanding();
|
StopExpanding();
|
||||||
@@ -463,33 +473,34 @@ void
|
|||||||
ExpanderWindow::_AddMenuBar(BLayout* layout)
|
ExpanderWindow::_AddMenuBar(BLayout* layout)
|
||||||
{
|
{
|
||||||
fBar = new BMenuBar("menu_bar", B_ITEMS_IN_ROW, B_INVALIDATE_AFTER_LAYOUT);
|
fBar = new BMenuBar("menu_bar", B_ITEMS_IN_ROW, B_INVALIDATE_AFTER_LAYOUT);
|
||||||
BMenu* menu = new BMenu(TR("File"));
|
BMenu* menu = new BMenu(B_TRANSLATE("File"));
|
||||||
BMenuItem* item;
|
BMenuItem* item;
|
||||||
menu->AddItem(item = new BMenuItem(TR("About Expander…"),
|
menu->AddItem(item = new BMenuItem(B_TRANSLATE("About Expander…"),
|
||||||
new BMessage(B_ABOUT_REQUESTED)));
|
new BMessage(B_ABOUT_REQUESTED)));
|
||||||
item->SetTarget(be_app_messenger);
|
item->SetTarget(be_app_messenger);
|
||||||
menu->AddSeparatorItem();
|
menu->AddSeparatorItem();
|
||||||
menu->AddItem(fSourceItem = new BMenuItem(TR("Set source…"),
|
menu->AddItem(fSourceItem = new BMenuItem(B_TRANSLATE("Set source…"),
|
||||||
new BMessage(MSG_SOURCE), 'O'));
|
new BMessage(MSG_SOURCE), 'O'));
|
||||||
menu->AddItem(fDestItem = new BMenuItem(TR("Set destination…"),
|
menu->AddItem(fDestItem = new BMenuItem(B_TRANSLATE("Set destination…"),
|
||||||
new BMessage(MSG_DEST), 'D'));
|
new BMessage(MSG_DEST), 'D'));
|
||||||
menu->AddSeparatorItem();
|
menu->AddSeparatorItem();
|
||||||
menu->AddItem(fExpandItem = new BMenuItem(TR("Expand"),
|
menu->AddItem(fExpandItem = new BMenuItem(B_TRANSLATE("Expand"),
|
||||||
new BMessage(MSG_EXPAND), 'E'));
|
new BMessage(MSG_EXPAND), 'E'));
|
||||||
fExpandItem->SetEnabled(false);
|
fExpandItem->SetEnabled(false);
|
||||||
menu->AddItem(fShowItem = new BMenuItem(TR("Show contents"),
|
menu->AddItem(fShowItem = new BMenuItem(B_TRANSLATE("Show contents"),
|
||||||
new BMessage(MSG_SHOW), 'L'));
|
new BMessage(MSG_SHOW), 'L'));
|
||||||
fShowItem->SetEnabled(false);
|
fShowItem->SetEnabled(false);
|
||||||
menu->AddSeparatorItem();
|
menu->AddSeparatorItem();
|
||||||
menu->AddItem(fStopItem = new BMenuItem(TR("Stop"),
|
menu->AddItem(fStopItem = new BMenuItem(B_TRANSLATE("Stop"),
|
||||||
new BMessage(MSG_STOP), 'K'));
|
new BMessage(MSG_STOP), 'K'));
|
||||||
fStopItem->SetEnabled(false);
|
fStopItem->SetEnabled(false);
|
||||||
menu->AddSeparatorItem();
|
menu->AddSeparatorItem();
|
||||||
menu->AddItem(new BMenuItem(TR("Close"), new BMessage(B_QUIT_REQUESTED), 'W'));
|
menu->AddItem(new BMenuItem(B_TRANSLATE("Close"),
|
||||||
|
new BMessage(B_QUIT_REQUESTED), 'W'));
|
||||||
fBar->AddItem(menu);
|
fBar->AddItem(menu);
|
||||||
|
|
||||||
menu = new BMenu(TR("Settings"));
|
menu = new BMenu(B_TRANSLATE("Settings"));
|
||||||
menu->AddItem(fPreferencesItem = new BMenuItem(TR("Settings…"),
|
menu->AddItem(fPreferencesItem = new BMenuItem(B_TRANSLATE("Settings…"),
|
||||||
new BMessage(MSG_PREFERENCES), 'S'));
|
new BMessage(MSG_PREFERENCES), 'S'));
|
||||||
fBar->AddItem(menu);
|
fBar->AddItem(menu);
|
||||||
layout->AddView(fBar);
|
layout->AddView(fBar);
|
||||||
@@ -509,8 +520,8 @@ ExpanderWindow::StartExpanding()
|
|||||||
BEntry destEntry(fDestText->Text(), true);
|
BEntry destEntry(fDestText->Text(), true);
|
||||||
if (!destEntry.Exists()) {
|
if (!destEntry.Exists()) {
|
||||||
BAlert* alert = new BAlert("destAlert",
|
BAlert* alert = new BAlert("destAlert",
|
||||||
TR("The folder was either moved, renamed or not\nsupported."),
|
B_TRANSLATE("The folder was either moved, renamed or not\nsupported."),
|
||||||
TR("Cancel"), NULL, NULL,
|
B_TRANSLATE("Cancel"), NULL, NULL,
|
||||||
B_WIDTH_AS_USUAL, B_EVEN_SPACING, B_WARNING_ALERT);
|
B_WIDTH_AS_USUAL, B_EVEN_SPACING, B_WARNING_ALERT);
|
||||||
alert->Go();
|
alert->Go();
|
||||||
return;
|
return;
|
||||||
@@ -521,7 +532,7 @@ ExpanderWindow::StartExpanding()
|
|||||||
message.AddRef("srcRef", &fSourceRef);
|
message.AddRef("srcRef", &fSourceRef);
|
||||||
message.AddRef("destRef", &fDestRef);
|
message.AddRef("destRef", &fDestRef);
|
||||||
|
|
||||||
fExpandButton->SetLabel(TR("Stop"));
|
fExpandButton->SetLabel(B_TRANSLATE("Stop"));
|
||||||
fSourceButton->SetEnabled(false);
|
fSourceButton->SetEnabled(false);
|
||||||
fDestButton->SetEnabled(false);
|
fDestButton->SetEnabled(false);
|
||||||
fShowContents->SetEnabled(false);
|
fShowContents->SetEnabled(false);
|
||||||
@@ -534,7 +545,7 @@ ExpanderWindow::StartExpanding()
|
|||||||
|
|
||||||
BEntry entry(&fSourceRef);
|
BEntry entry(&fSourceRef);
|
||||||
BPath path(&entry);
|
BPath path(&entry);
|
||||||
BString text(TR("Expanding file "));
|
BString text(B_TRANSLATE("Expanding file "));
|
||||||
text.Append(path.Leaf());
|
text.Append(path.Leaf());
|
||||||
fStatusView->SetText(text.String());
|
fStatusView->SetText(text.String());
|
||||||
|
|
||||||
@@ -555,7 +566,7 @@ ExpanderWindow::StopExpanding(void)
|
|||||||
|
|
||||||
fExpandingStarted = false;
|
fExpandingStarted = false;
|
||||||
|
|
||||||
fExpandButton->SetLabel(TR("Expand"));
|
fExpandButton->SetLabel(B_TRANSLATE("Expand"));
|
||||||
fSourceButton->SetEnabled(true);
|
fSourceButton->SetEnabled(true);
|
||||||
fDestButton->SetEnabled(true);
|
fDestButton->SetEnabled(true);
|
||||||
fShowContents->SetEnabled(true);
|
fShowContents->SetEnabled(true);
|
||||||
@@ -579,7 +590,7 @@ ExpanderWindow::_ExpandListingText()
|
|||||||
|
|
||||||
if (Frame().right + delta > screenFrame.right)
|
if (Frame().right + delta > screenFrame.right)
|
||||||
delta = screenFrame.right - Frame().right - 4.0f;
|
delta = screenFrame.right - Frame().right - 4.0f;
|
||||||
|
|
||||||
ResizeBy(delta, 0.0f);
|
ResizeBy(delta, 0.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -614,7 +625,7 @@ ExpanderWindow::_UpdateWindowSize(bool showContents)
|
|||||||
if (fPreviousHeight < 0.0) {
|
if (fPreviousHeight < 0.0) {
|
||||||
BFont font;
|
BFont font;
|
||||||
font_height fontHeight;
|
font_height fontHeight;
|
||||||
fListingText->GetFont(&font);
|
fListingText->GetFont(&font);
|
||||||
font.GetHeight(&fontHeight);
|
font.GetHeight(&fontHeight);
|
||||||
fLineHeight = ceilf(fontHeight.ascent + fontHeight.descent
|
fLineHeight = ceilf(fontHeight.ascent + fontHeight.descent
|
||||||
+ fontHeight.leading);
|
+ fontHeight.leading);
|
||||||
@@ -622,7 +633,7 @@ ExpanderWindow::_UpdateWindowSize(bool showContents)
|
|||||||
}
|
}
|
||||||
minHeight = bottom + 5.0 * fLineHeight;
|
minHeight = bottom + 5.0 * fLineHeight;
|
||||||
maxHeight = 32767.0;
|
maxHeight = 32767.0;
|
||||||
|
|
||||||
bottom = max_c(fPreviousHeight, minHeight);
|
bottom = max_c(fPreviousHeight, minHeight);
|
||||||
} else {
|
} else {
|
||||||
minHeight = fSizeLimit;
|
minHeight = fSizeLimit;
|
||||||
@@ -660,7 +671,7 @@ ExpanderWindow::StartListing()
|
|||||||
fDestItem->SetEnabled(false);
|
fDestItem->SetEnabled(false);
|
||||||
fExpandItem->SetEnabled(false);
|
fExpandItem->SetEnabled(false);
|
||||||
fShowItem->SetEnabled(true);
|
fShowItem->SetEnabled(true);
|
||||||
fShowItem->SetLabel(TR("Hide contents"));
|
fShowItem->SetLabel(B_TRANSLATE("Hide contents"));
|
||||||
fStopItem->SetEnabled(false);
|
fStopItem->SetEnabled(false);
|
||||||
fPreferencesItem->SetEnabled(false);
|
fPreferencesItem->SetEnabled(false);
|
||||||
|
|
||||||
@@ -670,7 +681,7 @@ ExpanderWindow::StartListing()
|
|||||||
|
|
||||||
BEntry entry(&fSourceRef);
|
BEntry entry(&fSourceRef);
|
||||||
BPath path(&entry);
|
BPath path(&entry);
|
||||||
BString text(TR("Creating listing for "));
|
BString text(B_TRANSLATE("Creating listing for "));
|
||||||
text.Append(path.Leaf());
|
text.Append(path.Leaf());
|
||||||
fStatusView->SetText(text.String());
|
fStatusView->SetText(text.String());
|
||||||
fListingText->SetText("");
|
fListingText->SetText("");
|
||||||
|
|||||||
Reference in New Issue
Block a user