Changeset 50609 in vbox for trunk/src/VBox
- Timestamp:
- Feb 26, 2014 2:32:11 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/GuestDnDImpl.cpp
r50593 r50609 204 204 HRESULT queryProgressTo(IProgress **ppProgress); 205 205 206 public: 207 208 Utf8Str errorToString(const ComObjPtr<Guest>& pGuest, int guestRc); 209 206 210 private: 207 211 RTSEMEVENT m_EventSem; … … 296 300 } 297 301 298 DnDGuestResponse::~DnDGuestResponse( )302 DnDGuestResponse::~DnDGuestResponse(void) 299 303 { 300 304 reset(); … … 303 307 } 304 308 305 int DnDGuestResponse::notifyAboutGuestResponse()306 {307 return RTSemEventSignal(m_EventSem);308 }309 310 int DnDGuestResponse::waitForGuestResponse(RTMSINTERVAL msTimeout /*= 500 */)311 {312 int rc = RTSemEventWait(m_EventSem, msTimeout);313 #ifdef DEBUG_andy314 LogFlowFunc(("msTimeout=%RU32, rc=%Rrc\n", msTimeout, rc));315 #endif316 return rc;317 }318 319 309 int DnDGuestResponse::dataAdd(const void *pvData, uint32_t cbData, 320 310 uint32_t *pcbCurSize) … … 341 331 342 332 return rc; 333 } 334 335 /* static */ 336 Utf8Str DnDGuestResponse::errorToString(const ComObjPtr<Guest>& pGuest, int guestRc) 337 { 338 Utf8Str strError; 339 340 switch (guestRc) 341 { 342 case VERR_SHARING_VIOLATION: 343 strError += Utf8StrFmt(pGuest->tr("One or more guest files or directories selected for transferring to the host were locked. " 344 "Please make sure that all selected elements can be accessed and that your guest user has " 345 "the appropriate rights.")); 346 break; 347 348 default: 349 strError += Utf8StrFmt("Drag'n drop guest error (%Rrc)", guestRc); 350 break; 351 } 352 353 return strError; 354 } 355 356 int DnDGuestResponse::notifyAboutGuestResponse(void) 357 { 358 return RTSemEventSignal(m_EventSem); 343 359 } 344 360 … … 384 400 if (uState == DragAndDropSvc::DND_PROGRESS_ERROR) 385 401 { 386 hr = m_progress->notifyComplete( E_FAIL,402 hr = m_progress->notifyComplete(VBOX_E_IPRT_ERROR, 387 403 COM_IIDOF(IGuest), 388 404 m_parent->getComponentName(), 389 m_parent->tr("Drag'n drop guest error (%Rrc)"), rcOp);405 DnDGuestResponse::errorToString(m_parent, rcOp).c_str()); 390 406 reset(); 391 407 } … … 458 474 } 459 475 476 int DnDGuestResponse::waitForGuestResponse(RTMSINTERVAL msTimeout /*= 500 */) 477 { 478 int rc = RTSemEventWait(m_EventSem, msTimeout); 479 #ifdef DEBUG_andy 480 LogFlowFunc(("msTimeout=%RU32, rc=%Rrc\n", msTimeout, rc)); 481 #endif 482 return rc; 483 } 484 485 /////////////////////////////////////////////////////////////////////////////// 486 460 487 HRESULT GuestDnDPrivate::adjustCoords(ULONG uScreenId, ULONG *puX, ULONG *puY) const 461 488 { … … 499 526 p->tr("VMM device is not available (is the VM running?)")); 500 527 501 LogFlowFunc(("hgcmHostCall msg=%RU32, numParms=%RU32\n", u32Function, cParms));528 LogFlowFunc(("hgcmHostCall uMsg=%RU32, cParms=%RU32\n", u32Function, cParms)); 502 529 int rc = pVMMDev->hgcmHostCall("VBoxDragAndDropSvc", 503 530 u32Function, … … 505 532 if (RT_FAILURE(rc)) 506 533 { 507 LogFlowFunc(("hgcmHostCall error:%Rrc\n", rc));508 throw p->setError(VBOX_E_ VM_ERROR,534 LogFlowFunc(("hgcmHostCall failed with rc=%Rrc\n", rc)); 535 throw p->setError(VBOX_E_IPRT_ERROR, 509 536 p->tr("hgcmHostCall failed (%Rrc)"), rc); 510 537 }
Note:
See TracChangeset
for help on using the changeset viewer.