VirtualBox

Changeset 97481 in vbox


Ignore:
Timestamp:
Nov 9, 2022 2:13:50 PM (2 years ago)
Author:
vboxsync
Message:

Guest Control/Main: A bit nicer progress object descriptions, which now also include information about how many (other) objects are copied to where. bugref:10286

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-client/GuestSessionImplTasks.cpp

    r97476 r97481  
    15831583        Assert(mVecLists[0]->mVecEntries.size());
    15841584
    1585         Utf8Str strFirstOp = mDest + mVecLists[0]->mVecEntries[0]->strPath;
     1585        Utf8Str const &strFirstOp = mVecLists[0]->mVecEntries[0]->strPath;
     1586
     1587        /* Now that we know how many objects we're handling, tweak the progress description so that it
     1588         * reflects more accurately what the progress is actually doing. */
     1589        if (cOperations > 1)
     1590        {
     1591            mDesc.printf(tr("Copying \"%s\" [and %zu %s] from guest to \"%s\" on the host ..."),
     1592                         strFirstOp.c_str(), cOperations - 1, cOperations > 2 ? tr("others") : tr("other"), mDest.c_str());
     1593        }
     1594        else
     1595            mDesc.printf(tr("Copying \"%s\" from guest to \"%s\" on the host ..."), strFirstOp.c_str(), mDest.c_str());
     1596
    15861597        hrc = pProgress->init(static_cast<IGuestSession*>(mSession), Bstr(mDesc).raw(),
    15871598                              TRUE /* aCancelable */, cOperations + 1 /* Number of operations */, Bstr(strFirstOp).raw());
     
    20252036        Assert(mVecLists[0]->mVecEntries.size());
    20262037
     2038        Utf8Str const &strFirstOp = mVecLists[0]->mVecEntries[0]->strPath;
     2039
     2040        /* Now that we know how many objects we're handling, tweak the progress description so that it
     2041         * reflects more accurately what the progress is actually doing. */
     2042        if (cOperations > 1)
     2043        {
     2044            mDesc.printf(tr("Copying \"%s\" [and %zu %s] from host to \"%s\" on the guest ..."),
     2045                         strFirstOp.c_str(), cOperations - 1, cOperations > 2 ? tr("others") : tr("other"), mDest.c_str());
     2046        }
     2047        else
     2048            mDesc.printf(tr("Copying \"%s\" from host to \"%s\" on the guest ..."), strFirstOp.c_str(), mDest.c_str());
     2049
    20272050        hrc = pProgress->init(static_cast<IGuestSession*>(mSession), Bstr(mDesc).raw(),
    20282051                              TRUE /* aCancelable */, cOperations + 1 /* Number of operations */,
    2029                               Bstr(mDesc).raw());
     2052                              Bstr(strFirstOp).raw());
    20302053    }
    20312054    else /* If no operations have been defined, go with an "empty" progress object when will be used for error handling. */
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