VirtualBox

Changeset 10999 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Jul 30, 2008 4:44:26 PM (16 years ago)
Author:
vboxsync
Message:

Fe/Qt4: Latest cumulative update for defect #3000:
Little changes to VDM's API & it's callers.
Fixing bug when it was not possible to directly select HD image for attachment through VDM (which invoked from VM Settings / HD Page).
Fixing bug when the action to invoke VDM for selected HD attachment was available to be triggered (crash) if clean-item selected.
Fixing bug with unable to focus separate HD attachment when navigating with keyboard after clearing SATA attachments.

Location:
trunk/src/VBox/Frontends/VirtualBox4
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox4/include/VBoxDiskImageManagerDlg.h

    r9867 r10999  
    4949    VBoxDiskImageManagerDlg (QWidget *aParent = NULL, Qt::WindowFlags aFlags = Qt::Dialog);
    5050
    51     void setup (int aType, bool aDoSelect, const QUuid *aTargetVMId = NULL, bool aRefresh = true, CMachine aMachine = NULL, const QUuid & aHdId = QUuid(), const QUuid & aCdId = QUuid(), const QUuid & aFdId = QUuid());
     51    void setup (int aType, bool aDoSelect, const QUuid &aTargetVMId = QUuid(), bool aRefresh = true, CMachine aMachine = NULL, const QUuid &aHdId = QUuid(), const QUuid &aCdId = QUuid(), const QUuid &aFdId = QUuid());
    5252
    5353    static void showModeless (bool aRefresh = true);
  • trunk/src/VBox/Frontends/VirtualBox4/include/VBoxVMSettingsHD.h

    r10167 r10999  
    287287signals:
    288288
     289    void signalToCloseEditor (QWidget *aEditor,
     290                              QAbstractItemDelegate::EndEditHint aCloseHint);
    289291    void hdChanged();
    290292
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxConsoleWnd.cpp

    r10888 r10999  
    25782578
    25792579    VBoxDiskImageManagerDlg dlg (this);
    2580     QUuid id = csession.GetMachine().GetId();
    2581     dlg.setup (VBoxDefs::FD, true, &id);
     2580    dlg.setup (VBoxDefs::FD, true, csession.GetMachine().GetId());
    25822581
    25832582    if (dlg.exec() == QDialog::Accepted)
     
    26222621
    26232622    VBoxDiskImageManagerDlg dlg (this);
    2624     QUuid id = csession.GetMachine().GetId();
    2625     dlg.setup (VBoxDefs::CD, true, &id);
     2623    dlg.setup (VBoxDefs::CD, true, csession.GetMachine().GetId());
    26262624
    26272625    if (dlg.exec() == QDialog::Accepted)
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxDiskImageManagerDlg.cpp

    r10519 r10999  
    447447
    448448void VBoxDiskImageManagerDlg::setup (int aType, bool aDoSelect,
    449                                      const QUuid *aTargetVMId /* = NULL */,
     449                                     const QUuid &aTargetVMId /* = NULL */,
    450450                                     bool aRefresh /* = true */,
    451451                                     CMachine aMachine /* = NULL */,
     
    465465
    466466    mDoSelect = aDoSelect;
    467     if (aTargetVMId)
    468         mTargetVMId = *aTargetVMId;
     467    if (!aTargetVMId.isNull())
     468        mTargetVMId = aTargetVMId;
    469469
    470470    if (mDoSelect)
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxVMFirstRunWzd.cpp

    r9245 r10999  
    242242{
    243243    VBoxDiskImageManagerDlg vdm (this);
    244     QUuid machineId = mMachine.GetId();
    245244    VBoxDefs::DiskType type = mRbCdType->isChecked() ? VBoxDefs::CD :
    246245        mRbFdType->isChecked() ? VBoxDefs::FD : VBoxDefs::InvalidType;
    247     vdm.setup (type, true, &machineId);
     246    vdm.setup (type, true, mMachine.GetId());
    248247    if (vdm.exec() == QDialog::Accepted)
    249248    {
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxVMSettingsCD.cpp

    r10936 r10999  
    248248    QUuid oldId = mUuidIsoCD;
    249249    VBoxDiskImageManagerDlg dlg (this);
    250     QUuid machineId = mMachine.GetId();
    251     dlg.setup (VBoxDefs::CD, true, &machineId, true /* aRefresh */,
     250    dlg.setup (VBoxDefs::CD, true, mMachine.GetId(), true /* aRefresh */,
    252251               mMachine, QUuid(), mCbIsoCD->getId(), QUuid());
    253252
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxVMSettingsFD.cpp

    r10936 r10999  
    244244    QUuid oldId = mUuidIsoFD;
    245245    VBoxDiskImageManagerDlg dlg (this);
    246     QUuid machineId = mMachine.GetId();
    247     dlg.setup (VBoxDefs::FD, true, &machineId, true /* aRefresh */,
     246    dlg.setup (VBoxDefs::FD, true, mMachine.GetId(), true /* aRefresh */,
    248247               mMachine, QUuid(), mCbIsoFD->getId(), QUuid());
    249248
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxVMSettingsHD.cpp

    r10604 r10999  
    260260    : VBoxMediaComboBox (aParent, VBoxDefs::HD)
    261261{
     262    mInstance = this;
    262263    setBelongsTo (HDSlotUniquizer::instance()->machine().GetId());
    263264    connect (this, SIGNAL (currentIndexChanged (int)), this, SLOT (onActivate()));
     
    265266             parent()->parent(), SLOT (commitData (QWidget *)));
    266267    refresh();
    267     mInstance = this;
    268268}
    269269HDVdiEditor::~HDVdiEditor()
    270270{
    271     mInstance = 0;
     271    if (mInstance == this)
     272        mInstance = 0;
    272273}
    273274
     
    468469             SIGNAL (mediaRemoved (VBoxDefs::DiskType, const QUuid &)),
    469470             this, SLOT (onMediaRemoved (VBoxDefs::DiskType, const QUuid &)));
     471    connect (this, SIGNAL (signalToCloseEditor (QWidget*, QAbstractItemDelegate::EndEditHint)),
     472             mTwAts, SLOT (closeEditor (QWidget*, QAbstractItemDelegate::EndEditHint)));
    470473
    471474    /* Install global event filter */
     
    650653        if (result == QIMessageBox::Yes)
    651654        {
    652             mTwAts->closePersistentEditor (mTwAts->currentIndex());
     655            /* Close the editor to avoid it's infliction to data model */
     656            emit signalToCloseEditor (HDVdiEditor::activeEditor(),
     657                                      QAbstractItemDelegate::NoHint);
     658
     659            /* Run new HD wizard */
    653660            VBoxNewHDWzd dlg (this);
    654661            if (dlg.exec() == QDialog::Accepted)
     
    703710    Assert (mTwAts->currentIndex().isValid());
    704711
     712    /* Close the editor to avoid it's infliction to data model */
     713    emit signalToCloseEditor (HDVdiEditor::activeEditor(),
     714                              QAbstractItemDelegate::NoHint);
     715
     716    HDVdiValue oldVdi (mModel->data (mTwAts->currentIndex(), Qt::EditRole)
     717                       .value<HDVdiValue>());
     718
    705719    VBoxDiskImageManagerDlg dlg (this);
    706     QUuid machineId = mMachine.GetId();
    707     HDVdiValue vdiInfo (mModel->data (mTwAts->currentIndex(), Qt::EditRole)
    708                         .value<HDVdiValue>());
    709     QUuid hdId = vdiInfo.id;
    710     dlg.setup (VBoxDefs::HD, true, &machineId, true, mMachine, hdId);
     720    dlg.setup (VBoxDefs::HD, true, mMachine.GetId(), true, mMachine, oldVdi.id);
    711721
    712722    if (dlg.exec() == QDialog::Accepted)
    713723    {
     724        /* Compose resulting vdi */
    714725        QVariant result;
    715         HDVdiValue val (VBoxMediaComboBox::fullItemName (dlg.selectedPath()),
    716                         dlg.selectedUuid());
    717         result.setValue (val);
     726        HDVdiValue newVdi (VBoxMediaComboBox::fullItemName (dlg.selectedPath()),
     727                           dlg.selectedUuid());
     728        result.setValue (newVdi);
     729
     730        /* Set the model's data */
    718731        mModel->setData (mTwAts->currentIndex(), result);
    719732    }
     
    722735}
    723736
    724 void VBoxVMSettingsHD::onCurrentChanged (const QModelIndex &aIndex)
     737void VBoxVMSettingsHD::onCurrentChanged (const QModelIndex& /* aIndex */)
    725738{
    726739    mNewAction->setEnabled (mModel->rowCount() - 1 <
    727740        HDSlotUniquizer::instance()->list (HDSltValue(), false).count());
    728741    mDelAction->setEnabled (mTwAts->currentIndex().row() != mModel->rowCount() - 1);
    729     mVdmAction->setEnabled (aIndex.isValid() && aIndex.column() == 1);
     742    mVdmAction->setEnabled (mTwAts->currentIndex().row() != mModel->rowCount() - 1 &&
     743                            mTwAts->currentIndex().column() == 1);
    730744}
    731745
     
    744758        if (firstSataPort < list.size())
    745759        {
    746             int rc = vboxProblem().confirmDetachSATASlots (this);
    747             if (rc != QIMessageBox::Ok)
     760            if (vboxProblem().confirmDetachSATASlots (this) != QIMessageBox::Ok)
    748761            {
    749762                /* Switch check-box back to "Qt::Checked" */
     
    757770                /* Delete SATA items */
    758771                mModel->removeSata();
     772
     773                /* Set column #1 of first index to be the current */
     774                mTwAts->setCurrentIndex (mModel->index (0, 1));
     775
    759776                if (mValidator)
    760777                    mValidator->revalidate();
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