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
|
||||
buildTimeDate.SetTo(kernelTimeDate);
|
||||
|
||||
snprintf(string, sizeof(string), buildTimeDate);
|
||||
|
||||
BStringView* kernelView = new BStringView("kerneltext", string);
|
||||
BStringView* kernelView = new BStringView("kerneltext", buildTimeDate);
|
||||
kernelView->SetExplicitAlignment(BAlignment(B_ALIGN_LEFT,
|
||||
B_ALIGN_VERTICAL_UNSET));
|
||||
|
||||
|
||||
@@ -150,34 +150,32 @@ ExpanderWindow::ValidateDest()
|
||||
BVolume volume;
|
||||
if (!entry.Exists()) {
|
||||
BAlert* alert = new BAlert("destAlert",
|
||||
B_TRANSLATE("Destination folder doesn't exist, create?"),
|
||||
B_TRANSLATE("Yes"), B_TRANSLATE("No"), NULL,
|
||||
B_TRANSLATE("Destination folder doesn't exist. "
|
||||
"Would you like to create it?"),
|
||||
B_TRANSLATE("Create"), B_TRANSLATE("Cancel"), NULL,
|
||||
B_WIDTH_AS_USUAL, B_EVEN_SPACING, B_WARNING_ALERT);
|
||||
alert->SetShortcut(0, B_ESCAPE);
|
||||
if (alert->Go() == 0) {
|
||||
if (create_directory(fDestText->Text(), 0755) == B_OK) {
|
||||
BEntry newEntry(fDestText->Text(), true);
|
||||
newEntry.GetRef(&fDestRef);
|
||||
return true;
|
||||
} 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 {
|
||||
|
||||
if (alert->Go() != 0)
|
||||
return false;
|
||||
|
||||
if (create_directory(fDestText->Text(), 0755) != B_OK) {
|
||||
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_WIDTH_AS_USUAL, B_EVEN_SPACING, B_WARNING_ALERT);
|
||||
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
|
||||
alert->Go();
|
||||
return false;
|
||||
}
|
||||
} else if (!entry.IsDirectory()) {
|
||||
|
||||
BEntry newEntry(fDestText->Text(), true);
|
||||
newEntry.GetRef(&fDestRef);
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
if (!entry.IsDirectory()) {
|
||||
BAlert* alert = new BAlert("destAlert",
|
||||
B_TRANSLATE("The destination is not a folder."),
|
||||
B_TRANSLATE("Cancel"), NULL, NULL,
|
||||
@@ -185,7 +183,9 @@ ExpanderWindow::ValidateDest()
|
||||
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
|
||||
alert->Go();
|
||||
return false;
|
||||
} else if (entry.GetVolume(&volume) != B_OK || volume.IsReadOnly()) {
|
||||
}
|
||||
|
||||
if (entry.GetVolume(&volume) != B_OK || volume.IsReadOnly()) {
|
||||
BAlert* alert = new BAlert("destAlert",
|
||||
B_TRANSLATE("The destination is read only."),
|
||||
B_TRANSLATE("Cancel"), NULL, NULL, B_WIDTH_AS_USUAL,
|
||||
@@ -193,10 +193,10 @@ ExpanderWindow::ValidateDest()
|
||||
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
|
||||
alert->Go();
|
||||
return false;
|
||||
} else {
|
||||
entry.GetRef(&fDestRef);
|
||||
return true;
|
||||
}
|
||||
|
||||
entry.GetRef(&fDestRef);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user