Ticket #4425: Installer.diff

File Installer.diff, 3.2 KB (added by BeSman, 14 years ago)

This is a patch which allow access to Bootman directly from installer

  • InstallerWindow.cpp

     
    213213        TR("Write boot sector"), new BMessage(MSG_WRITE_BOOT_SECTOR));
    214214    fMakeBootableButton->SetEnabled(false);
    215215
     216    fBootmanButton = new BButton("bootman_button",
     217        TR("Setup Boot Menu"), new BMessage(MSG_WRITE_BOOTMAN));
     218    fBootmanButton->SetEnabled(false);
     219
    216220    SetLayout(new BGroupLayout(B_HORIZONTAL));
    217221    AddChild(BGroupLayoutBuilder(B_VERTICAL)
    218222        .Add(BGroupLayoutBuilder(B_HORIZONTAL)
     
    238242            .Add(BGroupLayoutBuilder(B_HORIZONTAL, 10)
    239243                .Add(fSetupButton)
    240244                .Add(fMakeBootableButton)
     245                .Add(fBootmanButton)
    241246                .AddGlue()
    242247                .Add(fBeginButton)
    243248            )
     
    268273        "the installation, but you can manually make a\n"
    269274        "partition bootable in case you do not need to\n"
    270275        "perform an installation."));
    271 
     276    fBootmanButton->SetToolTip(
     277        TR("Install/Uninstall our Boot Menu, which allow you to choose\n"
     278        "operating system to boot when computer starts up\n"
     279        "If you have another Boot manager such as LILO or GRUB\n"
     280        "You do not need to perform this one\n"));
    272281    // finish creating window
    273282    if (!be_roster->IsRunning(kDeskbarSignature))
    274283        SetFlags(Flags() | B_NOT_MINIMIZABLE);
     
    485494            fWorkerThread->WriteBootSector(fDestMenu);
    486495            break;
    487496
     497        case MSG_WRITE_BOOTMAN:
     498        {
     499            BPath bootPath;
     500            find_directory(B_BEOS_BOOT_DIRECTORY, &bootPath);
     501            BString command("/bin/bootman ");
     502            command += bootPath.Path();
     503            system(command.String());
     504        }
     505            break;
    488506        default:
    489507            BWindow::MessageReceived(msg);
    490508            break;
     
    562580{
    563581    fSetupButton->SetEnabled(!disable);
    564582    fMakeBootableButton->SetEnabled(!disable);
     583    fBootmanButton->SetEnabled(!disable);
    565584    fSrcMenuField->SetEnabled(!disable);
    566585    fDestMenuField->SetEnabled(!disable);
    567586}
     
    651670    fBeginButton->SetLabel(TR("Begin"));
    652671    fBeginButton->SetEnabled(srcItem && dstItem);
    653672
    654     // adjust "Write Boot Sector" button
     673    // adjust "Write Boot Sector and Setup Boot Menu" button
    655674    if (dstItem) {
    656675        char buffer[256];
    657676        snprintf(buffer, sizeof(buffer), TR("Write boot sector to '%s'"),
     
    661680        label = TR("Write boot sector");
    662681    fMakeBootableButton->SetEnabled(dstItem);
    663682    fMakeBootableButton->SetLabel(label.String());
    664 
     683    fBootmanButton->SetEnabled(dstItem);
     684   
    665685    if (!fEncouragedToSetupPartitions && !foundOneSuitableTarget) {
    666686        // Focus the users attention on the DriveSetup button
    667687        fEncouragedToSetupPartitions = true;
  • InstallerWindow.h

     
    3535const uint32 MSG_INSTALL_FINISHED = 'iIFN';
    3636const uint32 MSG_RESET = 'iRSI';
    3737const uint32 MSG_WRITE_BOOT_SECTOR = 'iWBS';
     38const uint32 MSG_WRITE_BOOTMAN = 'iWBM';
    3839
    3940const char PACKAGES_DIRECTORY[] = "_packages_";
    4041const char VAR_DIRECTORY[] = "var";
     
    8687            BButton*            fBeginButton;
    8788            BButton*            fSetupButton;
    8889            BButton*            fMakeBootableButton;
    89 
     90            BButton*            fBootmanButton;
    9091            bool                fEncouragedToSetupPartitions;
    9192
    9293            bool                fDriveSetupLaunched;