Changeset 55963 in vbox for trunk/src/VBox/Main/src-client/GuestDnDPrivate.cpp
- Timestamp:
- May 20, 2015 11:18:14 AM (10 years ago)
- svn:sync-xref-src-repo-rev:
- 100467
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/GuestDnDPrivate.cpp
r55640 r55963 177 177 } 178 178 179 int GuestDnDCallbackEvent::Notify(int rc )179 int GuestDnDCallbackEvent::Notify(int rc /* = VINF_SUCCESS */) 180 180 { 181 181 mRc = rc; … … 209 209 } 210 210 211 /* static */212 Utf8Str GuestDnDResponse::errorToString(const ComObjPtr<Guest>& pGuest, int guestRc)213 {214 Utf8Str strError;215 216 switch (guestRc)217 {218 case VERR_ACCESS_DENIED:219 strError += Utf8StrFmt(pGuest->tr("For one or more guest files or directories selected for transferring to the host your guest "220 "user does not have the appropriate access rights for. Please make sure that all selected "221 "elements can be accessed and that your guest user has the appropriate rights."));222 break;223 224 case VERR_NOT_FOUND:225 /* Should not happen due to file locking on the guest, but anyway ... */226 strError += Utf8StrFmt(pGuest->tr("One or more guest files or directories selected for transferring to the host were not"227 "found on the guest anymore. This can be the case if the guest files were moved and/or"228 "altered while the drag and drop operation was in progress."));229 break;230 231 case VERR_SHARING_VIOLATION:232 strError += Utf8StrFmt(pGuest->tr("One or more guest files or directories selected for transferring to the host were locked. "233 "Please make sure that all selected elements can be accessed and that your guest user has "234 "the appropriate rights."));235 break;236 237 default:238 strError += Utf8StrFmt("Drag and drop guest error (%Rrc)", guestRc);239 break;240 }241 242 return strError;243 }244 245 211 int GuestDnDResponse::notifyAboutGuestResponse(void) const 246 212 { … … 312 278 313 279 int GuestDnDResponse::setProgress(unsigned uPercentage, 314 uint32_t uStatus, int rcOp /* = VINF_SUCCESS */) 315 { 316 LogFlowFunc(("uStatus=%RU32, uPercentage=%RU32, rcOp=%Rrc\n", 317 uStatus, uPercentage, rcOp)); 280 uint32_t uStatus, 281 int rcOp /* = VINF_SUCCESS */, const Utf8Str &strMsg /* = "" */) 282 { 283 LogFlowFunc(("uStatus=%RU32, uPercentage=%RU32, rcOp=%Rrc, strMsg=%s\n", 284 uStatus, uPercentage, rcOp, strMsg.c_str())); 318 285 319 286 int rc = VINF_SUCCESS; … … 338 305 hr = m_progress->i_notifyComplete(VBOX_E_IPRT_ERROR, 339 306 COM_IIDOF(IGuest), 340 m_parent->getComponentName(), 341 GuestDnDResponse::errorToString(m_parent, rcOp).c_str()); 307 m_parent->getComponentName(), strMsg.c_str()); 342 308 reset(); 343 309 break; … … 898 864 * Wait until our desired callback triggered the 899 865 * wait event. As we don't want to block if the guest does not 900 * respond, sodo busy waiting here.866 * respond, do busy waiting here. 901 867 */ 902 868 rc = Event.Wait(500 /* ms */); … … 908 874 } 909 875 else if (rc == VERR_TIMEOUT) /* Continue waiting. */ 910 rc = VINF_SUCCESS;876 continue; 911 877 912 878 if ( msTimeout != RT_INDEFINITE_WAIT … … 914 880 { 915 881 rc = VERR_TIMEOUT; 916 } 917 else if (pResp->isProgressCanceled()) 918 { 919 pResp->setProgress(100 /* Percent */, DragAndDropSvc::DND_PROGRESS_CANCELLED); 882 LogFlowFunc(("Guest did not respond within time\n")); 883 } 884 else if (pResp->isProgressCanceled()) /** @todo GuestDnDResponse *pResp needs to go. */ 885 { 886 LogFlowFunc(("Canceled by user\n")); 920 887 rc = VERR_CANCELLED; 921 888 }
Note:
See TracChangeset
for help on using the changeset viewer.