VirtualBox

Changeset 8395 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Apr 25, 2008 4:13:45 PM (17 years ago)
Author:
vboxsync
Message:

SATA ui: Asking the user for confirmation of running NewHDWzd or VDM if the count of virtual disks available for the current VM is less than the count of attachments added.

Location:
trunk/src/VBox/Frontends/VirtualBox
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/include/VBoxProblemReporter.h

    r8337 r8395  
    197197
    198198    int confirmDetachSATASlots (QWidget *aParent);
     199    int confirmRunNewHDWzdOrVDM (QWidget *aParent, const QString &aVMName);
    199200
    200201    void cannotCreateHardDiskImage (
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxProblemReporter.cpp

    r8392 r8395  
    10711071}
    10721072
     1073int VBoxProblemReporter::confirmRunNewHDWzdOrVDM (QWidget *aParent,
     1074                                                  const QString &aVMName)
     1075{
     1076    return message (aParent, Question,
     1077        tr ("<p>The count of currently available virtual hard disks which can "
     1078            "be attached to <b><nobr>%1</nobr></b> virtual machine is less "
     1079            "than the count of attachments for this virtual machine.</p>"
     1080            "<p>You can run <b><nobr>New Virtual Disk</nobr></b> wizard by pressing "
     1081            "<b><nobr>Create</nobr></b> button to add new hard disk or start "
     1082            "<b><nobr>Virtual Disk Manager</nobr></b> by pressing "
     1083            "<b><nobr>Manage</nobr></b> button to add some *.vdi file or "
     1084            "release some hard disk attached to another virtual machine.</p>")
     1085            .arg (aVMName),
     1086        0, /* aAutoConfirmId */
     1087        QIMessageBox::Yes | QIMessageBox::Default,
     1088        QIMessageBox::No,
     1089        QIMessageBox::Cancel | QIMessageBox::Escape,
     1090        tr ("&Create", "hard disk"),
     1091        tr ("&Manage", "hard disk"));
     1092}
     1093
    10731094void VBoxProblemReporter::cannotCreateHardDiskImage (
    10741095    QWidget *parent, const CVirtualBox &vbox, const QString &src,
  • trunk/src/VBox/Frontends/VirtualBox/ui/VBoxHardDiskSettings.ui

    r8370 r8395  
    260260    <include location="local" impldecl="in implementation">VBoxMediaComboBox.h</include>
    261261    <include location="local" impldecl="in implementation">VBoxDiskImageManagerDlg.h</include>
     262    <include location="local" impldecl="in implementation">VBoxNewHDWzd.h</include>
    262263    <include location="local" impldecl="in implementation">VBoxHardDiskSettings.ui.h</include>
    263264</includes>
  • trunk/src/VBox/Frontends/VirtualBox/ui/VBoxHardDiskSettings.ui.h

    r8394 r8395  
    443443    }
    444444
     445    int vdiCount()
     446    {
     447        return mVector [1]->count();
     448    }
     449
    445450private:
    446451
     
    712717    if (mLvHD->childCount() == 1)
    713718        onCurrentChanged (item);
     719
     720    int result = mLvHD->childCount() - 1 > item->vdiCount() ?
     721        vboxProblem().confirmRunNewHDWzdOrVDM (this, mMachine.GetName()) :
     722        QIMessageBox::Cancel;
     723    if (result == QIMessageBox::Yes)
     724    {
     725        VBoxNewHDWzd dlg (this, "VBoxNewHDWzd");
     726        if (dlg.exec() == QDialog::Accepted)
     727        {
     728            CHardDisk hd = dlg.hardDisk();
     729            VBoxMedia::Status status =
     730                hd.GetAccessible() ? VBoxMedia::Ok :
     731                hd.isOk() ? VBoxMedia::Inaccessible :
     732                VBoxMedia::Error;
     733            vboxGlobal().addMedia (VBoxMedia (CUnknown (hd), VBoxDefs::HD, status));
     734            item->setId (dlg.hardDisk().GetId());
     735        }
     736    }
     737    else if (result == QIMessageBox::No)
     738        showVDM();
    714739
    715740    emit hddListChanged();
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette