VirtualBox

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


Ignore:
Timestamp:
Jul 8, 2024 4:33:52 PM (7 months ago)
Author:
vboxsync
Message:

FE/VBoxManage: Added a new flag SHOW_PROGRESS_OPS for showProgress() to only show the (sub) operation descriptions without all too much details (as with SHOW_PROGRESS_DETAILS). Needed for the new recording progress object. bugref:10718

Location:
trunk/src/VBox/Frontends/VBoxManage
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManage.cpp

    r98103 r105194  
    319319        fFlags = SHOW_PROGRESS_DETAILS;
    320320
    321     const bool fDetailed = RT_BOOL(fFlags & SHOW_PROGRESS_DETAILS);
    322     const bool fQuiet = !RT_BOOL(fFlags & (SHOW_PROGRESS | SHOW_PROGRESS_DETAILS));
    323 
     321    const bool fDetailed =  RT_BOOL(fFlags & SHOW_PROGRESS_DETAILS);
     322    const bool fOps      =  RT_BOOL(fFlags & SHOW_PROGRESS_OPS);
     323    const bool fQuiet    = !RT_BOOL(fFlags & (SHOW_PROGRESS | SHOW_PROGRESS_DETAILS | SHOW_PROGRESS_OPS));
     324
     325    AssertReturn((!fDetailed && !fOps) || (fDetailed != fOps), E_INVALIDARG); /* Mutually exclusive. */
    324326
    325327    BOOL fCompleted = FALSE;
     
    369371    }
    370372
    371     if (!fQuiet && !fDetailed)
     373    if (!fQuiet && !fDetailed && !fOps)
    372374    {
    373375        RTStrmPrintf(g_pStdErr, "0%%...");
     
    395397        progress->COMGETTER(Percent(&ulCurrentPercent));
    396398
    397         if (fDetailed)
     399        if (   fDetailed
     400            || fOps)
    398401        {
    399402            ULONG ulOperation = 1;
     
    422425                progress->COMGETTER(TimeRemaining)(&lSecsRem);
    423426
    424                 RTStrmPrintf(g_pStdErr, VBoxManage::tr("(%u/%u) %ls %02u%% => %02u%% (%d s remaining)\n"), ulOperation + 1, cOperations,
    425                              bstrOperationDescription.raw(), ulCurrentOperationPercent, ulCurrentPercent, lSecsRem);
     427                if (fDetailed)
     428                    RTStrmPrintf(g_pStdErr, VBoxManage::tr("(%u/%u) %ls %02u%% => %02u%% (%d s remaining)\n"), ulOperation + 1, cOperations,
     429                                 bstrOperationDescription.raw(), ulCurrentOperationPercent, ulCurrentPercent, lSecsRem);
     430                else
     431                    RTStrmPrintf(g_pStdErr, VBoxManage::tr("%02u%%: %ls\n"), ulCurrentPercent, bstrOperationDescription.raw());
     432
    426433                ulLastPercent = ulCurrentPercent;
    427434                ulLastOperationPercent = ulCurrentOperationPercent;
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManage.h

    r99775 r105194  
    156156# define SHOW_PROGRESS_DESC     RT_BIT_32(0)
    157157# define SHOW_PROGRESS          RT_BIT_32(1)
     158/** Shows detailed information of the progress.
     159 *  Mutually exclusive with SHOW_PROGRESS_OPS. */
    158160# define SHOW_PROGRESS_DETAILS  RT_BIT_32(2)
     161/** Only shows the operation descriptions without other details.
     162 *  Mutually exclusive with SHOW_PROGRESS_DETAILS. */
     163# define SHOW_PROGRESS_OPS      RT_BIT_32(3)
    159164HRESULT showProgress(ComPtr<IProgress> progress, uint32_t fFlags = SHOW_PROGRESS);
    160165
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