VirtualBox

Changeset 56506 in vbox


Ignore:
Timestamp:
Jun 18, 2015 11:37:04 AM (9 years ago)
Author:
vboxsync
Message:

DnD: Main: GuestDnDSourceImpl.cpp: More code for guest error handling.

File:
1 edited

Legend:

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

    r56215 r56506  
    438438                                      "Please make sure that all selected elements can be accessed and that your guest user has "
    439439                                      "the appropriate rights."));
     440            break;
     441
     442        case VERR_TIMEOUT:
     443            strError += Utf8StrFmt(tr("The guest was not able to fetch the drag and drop data within time."));
    440444            break;
    441445
     
    848852        {
    849853            rc = waitForEvent(msTimeout, pCtx->mCallback, pCtx->mpResp);
    850             if (RT_FAILURE(rc))
    851             {
    852                 if (rc == VERR_CANCELLED)
    853                     rc = pCtx->mpResp->setProgress(100, DragAndDropSvc::DND_PROGRESS_CANCELLED, VINF_SUCCESS);
    854                 else if (rc != VERR_GSTDND_GUEST_ERROR) /* Guest-side error are already handled in the callback. */
    855                     rc = pCtx->mpResp->setProgress(100, DragAndDropSvc::DND_PROGRESS_ERROR, rc,
    856                                                    GuestDnDSource::i_hostErrorToString(rc));
    857             }
    858             else
     854            if (RT_SUCCESS(rc))
    859855                rc = pCtx->mpResp->setProgress(100, DragAndDropSvc::DND_PROGRESS_COMPLETE, VINF_SUCCESS);
    860856        }
     
    871867#undef UNREGISTER_CALLBACK
    872868
    873     if (rc == VERR_CANCELLED)
    874     {
    875         int rc2 = sendCancel();
    876         AssertRC(rc2);
     869    if (RT_FAILURE(rc))
     870    {
     871        if (rc == VERR_CANCELLED)
     872        {
     873            int rc2 = pCtx->mpResp->setProgress(100, DragAndDropSvc::DND_PROGRESS_CANCELLED, VINF_SUCCESS);
     874            AssertRC(rc2);
     875
     876            rc2 = sendCancel();
     877            AssertRC(rc2);
     878        }
     879        else if (rc != VERR_GSTDND_GUEST_ERROR) /* Guest-side error are already handled in the callback. */
     880        {
     881            rc = pCtx->mpResp->setProgress(100, DragAndDropSvc::DND_PROGRESS_ERROR,
     882                                           rc, GuestDnDSource::i_hostErrorToString(rc));
     883        }
    877884    }
    878885
     
    939946        if (RT_SUCCESS(rc))
    940947        {
     948            LogFlowFunc(("Waiting ...\n"));
     949
    941950            rc = waitForEvent(msTimeout, pCtx->mCallback, pCtx->mpResp);
    942             if (RT_FAILURE(rc))
    943             {
    944                 if (rc == VERR_CANCELLED)
    945                     rc = pCtx->mpResp->setProgress(100, DragAndDropSvc::DND_PROGRESS_CANCELLED, VINF_SUCCESS);
    946                 else if (rc != VERR_GSTDND_GUEST_ERROR) /* Guest-side error are already handled in the callback. */
    947                     rc = pCtx->mpResp->setProgress(100, DragAndDropSvc::DND_PROGRESS_ERROR, rc,
    948                                                    GuestDnDSource::i_hostErrorToString(rc));
    949             }
    950             else
     951            if (RT_SUCCESS(rc))
    951952                rc = pCtx->mpResp->setProgress(100, DragAndDropSvc::DND_PROGRESS_COMPLETE, VINF_SUCCESS);
     953
     954            LogFlowFunc(("Waiting ended with rc=%Rrc\n", rc));
    952955        }
    953956
     
    969972    int rc2;
    970973
    971     if (rc == VERR_CANCELLED)
    972     {
    973         rc2 = sendCancel();
    974         AssertRC(rc2);
     974    if (RT_FAILURE(rc))
     975    {
     976        if (rc == VERR_CANCELLED)
     977        {
     978            rc2 = pCtx->mpResp->setProgress(100, DragAndDropSvc::DND_PROGRESS_CANCELLED, VINF_SUCCESS);
     979            AssertRC(rc2);
     980
     981            rc2 = sendCancel();
     982            AssertRC(rc2);
     983        }
     984        else if (rc != VERR_GSTDND_GUEST_ERROR) /* Guest-side error are already handled in the callback. */
     985        {
     986            rc = pCtx->mpResp->setProgress(100, DragAndDropSvc::DND_PROGRESS_ERROR,
     987                                           rc, GuestDnDSource::i_hostErrorToString(rc));
     988        }
    975989    }
    976990
     
    11361150
    11371151            pCtx->mpResp->reset();
     1152
    11381153            if (RT_SUCCESS(pCBData->rc))
    11391154                pCBData->rc = VERR_GENERAL_FAILURE; /* Make sure some error is set. */
    1140             rc = pCtx->mpResp->setProgress(100, DragAndDropSvc::DND_PROGRESS_ERROR, pCBData->rc);
     1155
     1156            rc = pCtx->mpResp->setProgress(100, DragAndDropSvc::DND_PROGRESS_ERROR, pCBData->rc,
     1157                                           GuestDnDSource::i_guestErrorToString(pCBData->rc));
    11411158            if (RT_SUCCESS(rc))
    1142                 rcCallback = pCBData->rc;
     1159                rcCallback = VERR_GSTDND_GUEST_ERROR;
    11431160            break;
    11441161        }
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