Small refactoring of Expander and AboutSystem GCI patches.
* Fix excessive snprintf in SystemAbout kernel build date/time; * Create destination folder message adjusted with HIG requirements; Thanks for pointing out, Landon Fuller and Pulkomandy.
This commit is contained in:
@@ -677,9 +677,7 @@ AboutView::AboutView()
|
|||||||
} else
|
} else
|
||||||
buildTimeDate.SetTo(kernelTimeDate);
|
buildTimeDate.SetTo(kernelTimeDate);
|
||||||
|
|
||||||
snprintf(string, sizeof(string), buildTimeDate);
|
BStringView* kernelView = new BStringView("kerneltext", buildTimeDate);
|
||||||
|
|
||||||
BStringView* kernelView = new BStringView("kerneltext", string);
|
|
||||||
kernelView->SetExplicitAlignment(BAlignment(B_ALIGN_LEFT,
|
kernelView->SetExplicitAlignment(BAlignment(B_ALIGN_LEFT,
|
||||||
B_ALIGN_VERTICAL_UNSET));
|
B_ALIGN_VERTICAL_UNSET));
|
||||||
|
|
||||||
|
|||||||
@@ -150,34 +150,32 @@ ExpanderWindow::ValidateDest()
|
|||||||
BVolume volume;
|
BVolume volume;
|
||||||
if (!entry.Exists()) {
|
if (!entry.Exists()) {
|
||||||
BAlert* alert = new BAlert("destAlert",
|
BAlert* alert = new BAlert("destAlert",
|
||||||
B_TRANSLATE("Destination folder doesn't exist, create?"),
|
B_TRANSLATE("Destination folder doesn't exist. "
|
||||||
B_TRANSLATE("Yes"), B_TRANSLATE("No"), NULL,
|
"Would you like to create it?"),
|
||||||
|
B_TRANSLATE("Create"), B_TRANSLATE("Cancel"), NULL,
|
||||||
B_WIDTH_AS_USUAL, B_EVEN_SPACING, B_WARNING_ALERT);
|
B_WIDTH_AS_USUAL, B_EVEN_SPACING, B_WARNING_ALERT);
|
||||||
alert->SetShortcut(0, B_ESCAPE);
|
alert->SetShortcut(0, B_ESCAPE);
|
||||||
if (alert->Go() == 0) {
|
|
||||||
if (create_directory(fDestText->Text(), 0755) == B_OK) {
|
if (alert->Go() != 0)
|
||||||
BEntry newEntry(fDestText->Text(), true);
|
return false;
|
||||||
newEntry.GetRef(&fDestRef);
|
|
||||||
return true;
|
if (create_directory(fDestText->Text(), 0755) != B_OK) {
|
||||||
} else {
|
|
||||||
BAlert* alert = new BAlert("stopAlert",
|
|
||||||
B_TRANSLATE("Failed to create the destination folder."),
|
|
||||||
B_TRANSLATE("Cancel"), NULL, NULL,
|
|
||||||
B_WIDTH_AS_USUAL, B_EVEN_SPACING, B_WARNING_ALERT);
|
|
||||||
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
|
|
||||||
alert->Go();
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
BAlert* alert = new BAlert("stopAlert",
|
BAlert* alert = new BAlert("stopAlert",
|
||||||
B_TRANSLATE("The extraction operation aborted."),
|
B_TRANSLATE("Failed to create the destination folder."),
|
||||||
B_TRANSLATE("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->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
|
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
|
||||||
alert->Go();
|
alert->Go();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else if (!entry.IsDirectory()) {
|
|
||||||
|
BEntry newEntry(fDestText->Text(), true);
|
||||||
|
newEntry.GetRef(&fDestRef);
|
||||||
|
return true;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!entry.IsDirectory()) {
|
||||||
BAlert* alert = new BAlert("destAlert",
|
BAlert* alert = new BAlert("destAlert",
|
||||||
B_TRANSLATE("The destination is not a folder."),
|
B_TRANSLATE("The destination is not a folder."),
|
||||||
B_TRANSLATE("Cancel"), NULL, NULL,
|
B_TRANSLATE("Cancel"), NULL, NULL,
|
||||||
@@ -185,7 +183,9 @@ ExpanderWindow::ValidateDest()
|
|||||||
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
|
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
|
||||||
alert->Go();
|
alert->Go();
|
||||||
return false;
|
return false;
|
||||||
} else if (entry.GetVolume(&volume) != B_OK || volume.IsReadOnly()) {
|
}
|
||||||
|
|
||||||
|
if (entry.GetVolume(&volume) != B_OK || volume.IsReadOnly()) {
|
||||||
BAlert* alert = new BAlert("destAlert",
|
BAlert* alert = new BAlert("destAlert",
|
||||||
B_TRANSLATE("The destination is read only."),
|
B_TRANSLATE("The destination is read only."),
|
||||||
B_TRANSLATE("Cancel"), NULL, NULL, B_WIDTH_AS_USUAL,
|
B_TRANSLATE("Cancel"), NULL, NULL, B_WIDTH_AS_USUAL,
|
||||||
@@ -193,10 +193,10 @@ ExpanderWindow::ValidateDest()
|
|||||||
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
|
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
|
||||||
alert->Go();
|
alert->Go();
|
||||||
return false;
|
return false;
|
||||||
} else {
|
|
||||||
entry.GetRef(&fDestRef);
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
entry.GetRef(&fDestRef);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user