Ticket #8519: patch.diff

File patch.diff, 1.6 KB (added by mr.Noisy, 11 years ago)

Final patch with few codestyle fixes

  • ExpanderWindow.cpp

    diff --git a/ExpanderWindow.cpp b/ExpanderWindow.cpp
    index 9ea6fdc..92227dd 100644
    a b ExpanderWindow::ValidateDest()  
    150150    BVolume volume;
    151151    if (!entry.Exists()) {
    152152        BAlert* alert = new BAlert("destAlert",
    153             B_TRANSLATE("The destination folder does not exist."),
    154             B_TRANSLATE("Cancel"), NULL, NULL,
     153            B_TRANSLATE("Destination folder doesn't exist, create?"),
     154            B_TRANSLATE("Yes"), B_TRANSLATE("No"), NULL,
    155155            B_WIDTH_AS_USUAL, B_EVEN_SPACING, B_WARNING_ALERT);
    156         alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
    157         alert->Go();
    158         return false;
     156        alert->SetShortcut(0, B_ESCAPE);
     157        if (alert->Go() == 0) {
     158            if (create_directory(fDestText->Text(), 0755) == B_OK) {
     159                BEntry newEntry(fDestText->Text(), true);
     160                newEntry.GetRef(&fDestRef);
     161                return true;
     162            } else {
     163                BAlert* alert = new BAlert("stopAlert",
     164                    B_TRANSLATE("Failed to create the destination folder."),
     165                    B_TRANSLATE("Cancel"), NULL, NULL,
     166                    B_WIDTH_AS_USUAL, B_EVEN_SPACING, B_WARNING_ALERT);
     167                alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
     168                alert->Go();
     169                return false;
     170            }
     171        } else {
     172            BAlert* alert = new BAlert("stopAlert",
     173                B_TRANSLATE("The extraction operation aborted."),
     174                B_TRANSLATE("Cancel"), NULL, NULL,
     175                B_WIDTH_AS_USUAL, B_EVEN_SPACING, B_WARNING_ALERT);
     176            alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
     177            alert->Go();
     178            return false;
     179        }
    159180    } else if (!entry.IsDirectory()) {
    160181        BAlert* alert = new BAlert("destAlert",
    161182            B_TRANSLATE("The destination is not a folder."),