VirtualBox

Changeset 18197 in vbox for trunk/src/VBox/Main


Ignore:
Timestamp:
Mar 24, 2009 3:44:24 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
44915
Message:

OVF: added getValuesByType & the license text to the describtions

Location:
trunk/src/VBox/Main
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/ApplianceImpl.cpp

    r18177 r18197  
    13231323                               nameVBox);
    13241324
     1325            /* VM description */
    13251326            if (!vsysThis.strDescription.isEmpty())
    13261327                pNewDesc->addEntry(VirtualSystemDescriptionType_Description,
     
    13281329                                    vsysThis.strDescription,
    13291330                                    vsysThis.strDescription);
     1331
     1332            /* VM license */
     1333            if (!vsysThis.strLicenseText.isEmpty())
     1334                pNewDesc->addEntry(VirtualSystemDescriptionType_License,
     1335                                    "",
     1336                                    vsysThis.strLicenseText,
     1337                                    vsysThis.strLicenseText);
    13301338
    13311339            /* Now that we know the OS type, get our internal defaults based on that. */
     
    23742382
    23752383                        llHardDisksCreated.push_back(dstHdVBox);
    2376 
    23772384                        /* Now use the new uuid to attach the disk image to our new machine */
    23782385                        ComPtr<IMachine> sMachine;
     
    34203427 * @return
    34213428 */
     3429STDMETHODIMP VirtualSystemDescription::GetValuesByType(VirtualSystemDescriptionType_T aType,
     3430                                                       VirtualSystemDescriptionValueType_T aWhich,
     3431                                                       ComSafeArrayOut(BSTR, aValues))
     3432{
     3433    if (ComSafeArrayOutIsNull(aValues))
     3434        return E_POINTER;
     3435
     3436    AutoCaller autoCaller(this);
     3437    CheckComRCReturnRC(autoCaller.rc());
     3438
     3439    AutoReadLock alock(this);
     3440
     3441    std::list<VirtualSystemDescriptionEntry*> vsd = findByType (aType);
     3442    com::SafeArray<BSTR> sfaValues((ULONG)vsd.size());
     3443
     3444    list<VirtualSystemDescriptionEntry*>::const_iterator it;
     3445    size_t i = 0;
     3446    for (it = vsd.begin();
     3447         it != vsd.end();
     3448         ++it, ++i)
     3449    {
     3450        const VirtualSystemDescriptionEntry *vsde = (*it);
     3451
     3452        Bstr bstr;
     3453        switch (aWhich)
     3454        {
     3455            case VirtualSystemDescriptionValueType_Reference: bstr = vsde->strRef; break;
     3456            case VirtualSystemDescriptionValueType_Original: bstr = vsde->strOvf; break;
     3457            case VirtualSystemDescriptionValueType_Auto: bstr = vsde->strVbox; break;
     3458            case VirtualSystemDescriptionValueType_ExtraConfig: bstr = vsde->strExtraConfig; break;
     3459        }
     3460
     3461        bstr.cloneTo(&sfaValues[i]);
     3462    }
     3463
     3464    sfaValues.detachTo(ComSafeArrayOutArg(aValues));
     3465
     3466    return S_OK;
     3467}
     3468
     3469/**
     3470 * Public method implementation.
     3471 * @return
     3472 */
    34223473STDMETHODIMP VirtualSystemDescription::SetFinalValues(ComSafeArrayIn(BOOL, aEnabled),
    34233474                                                      ComSafeArrayIn(IN_BSTR, argVboxValues),
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r18177 r18197  
    32243224  <enum
    32253225    name="VirtualSystemDescriptionType"
    3226     uuid="8ac36d00-bb7c-4a35-a835-3f004b27427b"
     3226    uuid="325e7fec-ce06-4174-9654-98f99478d03f"
    32273227  >
    32283228    <desc>Used with <link to="IVirtualSystemDescription" /> to describe the type of
     
    32333233    <const name="Name" value="3" />
    32343234    <const name="Description" value="4" />
    3235     <const name="CPU" value="5" />
    3236     <const name="Memory" value="6" />
    3237     <const name="HardDiskControllerIDE" value="7" />
    3238     <const name="HardDiskControllerSATA" value="8" />
    3239     <const name="HardDiskControllerSCSI" value="9" />
    3240     <const name="HardDiskImage" value="10" />
    3241     <const name="Floppy" value="11" />
    3242     <const name="CDROM" value="12" />
    3243     <const name="NetworkAdapter" value="13" />
    3244     <const name="USBController" value="14" />
    3245     <const name="SoundCard" value="15" />
     3235    <const name="License" value="5" />
     3236    <const name="CPU" value="6" />
     3237    <const name="Memory" value="7" />
     3238    <const name="HardDiskControllerIDE" value="8" />
     3239    <const name="HardDiskControllerSATA" value="9" />
     3240    <const name="HardDiskControllerSCSI" value="10" />
     3241    <const name="HardDiskImage" value="11" />
     3242    <const name="Floppy" value="12" />
     3243    <const name="CDROM" value="13" />
     3244    <const name="NetworkAdapter" value="14" />
     3245    <const name="USBController" value="15" />
     3246    <const name="SoundCard" value="16" />
     3247
     3248  </enum>
     3249
     3250  <enum
     3251    name="VirtualSystemDescriptionValueType"
     3252    uuid="56d9403f-3425-4118-9919-36f2a9b8c77c"
     3253  >
     3254    <desc>Used with <link to="GetValuesByType" /> to describe the value
     3255    type to fetch.</desc>
     3256
     3257    <const name="Reference" value="1" />
     3258    <const name="Original" value="2" />
     3259    <const name="Auto" value="3" />
     3260    <const name="ExtraConfig" value="4" />
    32463261
    32473262  </enum>
     
    34013416
    34023417      <param name="aExtraConfigValues" type="wstring" dir="out" safearray="yes">
     3418        <desc></desc>
     3419      </param>
     3420
     3421    </method>
     3422
     3423    <method name="getValuesByType">
     3424      <desc>This is the same as <link to="getDescriptionByType" /> except that you can specify which
     3425      value types should be returned. See <link to="VirtualSystemDescriptionValueType" /> for possible
     3426      values.</desc>
     3427
     3428      <param name="aType" type="VirtualSystemDescriptionType" dir="in">
     3429        <desc></desc>
     3430      </param>
     3431
     3432      <param name="aWhich" type="VirtualSystemDescriptionValueType" dir="in">
     3433        <desc></desc>
     3434      </param>
     3435
     3436      <param name="aValues" type="wstring" dir="out" safearray="yes">
    34033437        <desc></desc>
    34043438      </param>
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