Changeset 51476 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- May 30, 2014 2:58:02 PM (11 years ago)
- svn:sync-xref-src-repo-rev:
- 94064
- Location:
- trunk/src/VBox
- Files:
-
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox
- Property svn:mergeinfo changed
/branches/VBox-4.3/src/VBox merged: 93628-93629
- Property svn:mergeinfo changed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManageControlVM.cpp
r48538 r51476 5 5 6 6 /* 7 * Copyright (C) 2006-201 3Oracle Corporation7 * Copyright (C) 2006-2014 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 198 198 } 199 199 200 D ragAndDropMode_T mode;200 DnDMode_T mode; 201 201 if (!strcmp(a->argv[2], "disabled")) 202 mode = D ragAndDropMode_Disabled;202 mode = DnDMode_Disabled; 203 203 else if (!strcmp(a->argv[2], "hosttoguest")) 204 mode = D ragAndDropMode_HostToGuest;204 mode = DnDMode_HostToGuest; 205 205 else if (!strcmp(a->argv[2], "guesttohost")) 206 mode = D ragAndDropMode_GuestToHost;206 mode = DnDMode_GuestToHost; 207 207 else if (!strcmp(a->argv[2], "bidirectional")) 208 mode = D ragAndDropMode_Bidirectional;208 mode = DnDMode_Bidirectional; 209 209 else 210 210 { … … 214 214 if (SUCCEEDED(rc)) 215 215 { 216 CHECK_ERROR_BREAK(sessionMachine, COMSETTER(D ragAndDropMode)(mode));216 CHECK_ERROR_BREAK(sessionMachine, COMSETTER(DnDMode)(mode)); 217 217 } 218 218 } -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageInfo.cpp
r51384 r51476 1610 1610 { 1611 1611 const char *psz = "Unknown"; 1612 D ragAndDropMode_T enmMode;1613 rc = machine->COMGETTER(D ragAndDropMode)(&enmMode);1612 DnDMode_T enmMode; 1613 rc = machine->COMGETTER(DnDMode)(&enmMode); 1614 1614 switch (enmMode) 1615 1615 { 1616 case D ragAndDropMode_Disabled:1616 case DnDMode_Disabled: 1617 1617 if (details == VMINFO_MACHINEREADABLE) 1618 1618 psz = "disabled"; … … 1620 1620 psz = "disabled"; 1621 1621 break; 1622 case D ragAndDropMode_HostToGuest:1622 case DnDMode_HostToGuest: 1623 1623 if (details == VMINFO_MACHINEREADABLE) 1624 1624 psz = "hosttoguest"; … … 1626 1626 psz = "HostToGuest"; 1627 1627 break; 1628 case D ragAndDropMode_GuestToHost:1628 case DnDMode_GuestToHost: 1629 1629 if (details == VMINFO_MACHINEREADABLE) 1630 1630 psz = "guesttohost"; … … 1632 1632 psz = "GuestToHost"; 1633 1633 break; 1634 case D ragAndDropMode_Bidirectional:1634 case DnDMode_Bidirectional: 1635 1635 if (details == VMINFO_MACHINEREADABLE) 1636 1636 psz = "bidirectional"; -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp
r51259 r51476 2168 2168 case MODIFYVM_DRAGANDDROP: 2169 2169 { 2170 D ragAndDropMode_T mode;2170 DnDMode_T mode; 2171 2171 if (!RTStrICmp(ValueUnion.psz, "disabled")) 2172 mode = D ragAndDropMode_Disabled;2172 mode = DnDMode_Disabled; 2173 2173 else if (!RTStrICmp(ValueUnion.psz, "hosttoguest")) 2174 mode = D ragAndDropMode_HostToGuest;2174 mode = DnDMode_HostToGuest; 2175 2175 else if (!RTStrICmp(ValueUnion.psz, "guesttohost")) 2176 mode = D ragAndDropMode_GuestToHost;2176 mode = DnDMode_GuestToHost; 2177 2177 else if (!RTStrICmp(ValueUnion.psz, "bidirectional")) 2178 mode = D ragAndDropMode_Bidirectional;2178 mode = DnDMode_Bidirectional; 2179 2179 else 2180 2180 { … … 2184 2184 if (SUCCEEDED(rc)) 2185 2185 { 2186 CHECK_ERROR(machine, COMSETTER(D ragAndDropMode)(mode));2186 CHECK_ERROR(machine, COMSETTER(DnDMode)(mode)); 2187 2187 } 2188 2188 break; -
trunk/src/VBox/Frontends/VirtualBox/src/UIVMInfoDialog.cpp
r51410 r51476 606 606 QString strClipboardMode = gpConverter->toString(m.GetClipboardMode()); 607 607 /* Determine Drag&Drop mode: */ 608 QString strD ragAndDropMode = gpConverter->toString(m.GetDragAndDropMode());608 QString strDnDMode = gpConverter->toString(m.GetDnDMode()); 609 609 610 610 /* Deterine virtualization attributes: */ … … 658 658 strResult += formatValue(tr("VM Uptime"), strUptime, iMaxLength); 659 659 strResult += formatValue(tr("Clipboard Mode"), strClipboardMode, iMaxLength); 660 strResult += formatValue(tr("Drag'n'Drop Mode"), strD ragAndDropMode, iMaxLength);660 strResult += formatValue(tr("Drag'n'Drop Mode"), strDnDMode, iMaxLength); 661 661 strResult += formatValue(VBoxGlobal::tr("VT-x/AMD-V", "details report"), strVirtualization, iMaxLength); 662 662 strResult += formatValue(VBoxGlobal::tr("Nested Paging", "details report"), strNestedPaging, iMaxLength); -
trunk/src/VBox/Frontends/VirtualBox/src/converter/UIConverterBackend.h
r51401 r51476 6 6 7 7 /* 8 * Copyright (C) 2012 Oracle Corporation8 * Copyright (C) 2012-2014 Oracle Corporation 9 9 * 10 10 * This file is part of VirtualBox Open Source Edition (OSE), as … … 88 88 template<> bool canConvert<KDeviceType>(); 89 89 template<> bool canConvert<KClipboardMode>(); 90 template<> bool canConvert<KD ragAndDropMode>();90 template<> bool canConvert<KDnDMode>(); 91 91 template<> bool canConvert<KPointingHIDType>(); 92 92 template<> bool canConvert<KMediumType>(); … … 161 161 template<> QString toString(const KDeviceType &type); 162 162 template<> QString toString(const KClipboardMode &mode); 163 template<> QString toString(const KD ragAndDropMode &mode);163 template<> QString toString(const KDnDMode &mode); 164 164 template<> QString toString(const KPointingHIDType &type); 165 165 template<> QString toString(const KMediumType &type); -
trunk/src/VBox/Frontends/VirtualBox/src/converter/UIConverterBackendCOM.cpp
r50041 r51476 7 7 8 8 /* 9 * Copyright (C) 2012-201 3Oracle Corporation9 * Copyright (C) 2012-2014 Oracle Corporation 10 10 * 11 11 * This file is part of VirtualBox Open Source Edition (OSE), as … … 34 34 template<> bool canConvert<KDeviceType>() { return true; } 35 35 template<> bool canConvert<KClipboardMode>() { return true; } 36 template<> bool canConvert<KD ragAndDropMode>() { return true; }36 template<> bool canConvert<KDnDMode>() { return true; } 37 37 template<> bool canConvert<KPointingHIDType>() { return true; } 38 38 template<> bool canConvert<KMediumType>() { return true; } … … 202 202 } 203 203 204 /* QString <= KD ragAndDropMode: */205 template<> QString toString(const KD ragAndDropMode &mode)204 /* QString <= KDnDMode: */ 205 template<> QString toString(const KDnDMode &mode) 206 206 { 207 207 switch (mode) 208 208 { 209 case KD ragAndDropMode_Disabled: return QApplication::translate("VBoxGlobal", "Disabled", "DragAndDropType");210 case KD ragAndDropMode_HostToGuest: return QApplication::translate("VBoxGlobal", "Host To Guest", "DragAndDropType");211 case KD ragAndDropMode_GuestToHost: return QApplication::translate("VBoxGlobal", "Guest To Host", "DragAndDropType");212 case KD ragAndDropMode_Bidirectional: return QApplication::translate("VBoxGlobal", "Bidirectional", "DragAndDropType");209 case KDnDMode_Disabled: return QApplication::translate("VBoxGlobal", "Disabled", "DragAndDropType"); 210 case KDnDMode_HostToGuest: return QApplication::translate("VBoxGlobal", "Host To Guest", "DragAndDropType"); 211 case KDnDMode_GuestToHost: return QApplication::translate("VBoxGlobal", "Guest To Host", "DragAndDropType"); 212 case KDnDMode_Bidirectional: return QApplication::translate("VBoxGlobal", "Bidirectional", "DragAndDropType"); 213 213 default: AssertMsgFailed(("No text for %d", mode)); break; 214 214 } -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIDnDDataObject_win.cpp
r50604 r51476 41 41 42 42 UIDnDDataObject::UIDnDDataObject(CSession &session, 43 CDnDSource &dndSource, 43 44 const QStringList &lstFormats, 44 45 QWidget *pParent) 45 46 : mSession(session), 47 mDnDSource(dndSource), 46 48 mpParent(pParent), 47 49 mStatus(Uninitialized), … … 65 67 RT_BZERO(mpStgMedium, sizeof(STGMEDIUM) * cMaxFormats); 66 68 67 for (int i = 0; i < lstFormats.size(); i++) 69 for (int i = 0; 70 ( i < lstFormats.size() 71 && i < cMaxFormats); i++) 68 72 { 69 73 const QString &strFormat = lstFormats.at(i); … … 95 99 } 96 100 97 LogFlowFunc(("Total registered formats: %RU32 (of %d total)\n",101 LogFlowFunc(("Total registered native formats: %RU32 (for %d formats from guest)\n", 98 102 cRegisteredFormats, lstFormats.size())); 99 103 hr = S_OK; … … 290 294 { 291 295 rc = UIDnDDrag::RetrieveData(mSession, 296 mDnDSource, 297 /** @todo Support other actions. */ 292 298 Qt::CopyAction, 293 299 strMIMEType, vaType, mVaData, -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIDnDDataObject_win.h
r50604 r51476 29 29 /* COM includes: */ 30 30 #include "COMEnums.h" 31 #include "CDndSource.h" 31 32 #include "CSession.h" 32 33 … … 49 50 public: 50 51 51 UIDnDDataObject(CSession &session, const QStringList &lstFormats, QWidget *pParent);52 UIDnDDataObject(CSession &session, CDnDSource &dndSource, const QStringList &lstFormats, QWidget *pParent); 52 53 virtual ~UIDnDDataObject(void); 53 54 … … 87 88 QWidget *mpParent; 88 89 CSession mSession; 90 CDnDSource mDnDSource; 89 91 Status mStatus; 90 92 LONG mRefCount; -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIDnDDrag.cpp
r51033 r51476 44 44 #endif 45 45 46 UIDnDDrag::UIDnDDrag(CSession &session, 46 UIDnDDrag::UIDnDDrag(CSession &session, 47 CDnDSource &dndSource, 47 48 const QStringList &lstFormats, 48 49 Qt::DropAction defAction, Qt::DropActions actions, 49 50 QWidget *pParent /* = NULL */) 50 51 : m_session(session) 52 , m_dndSource(dndSource) 51 53 , m_lstFormats(lstFormats) 52 54 , m_defAction(defAction) … … 72 74 #ifdef RT_OS_WINDOWS 73 75 UIDnDDropSource *pDropSource = new UIDnDDropSource(m_pParent); 74 UIDnDDataObject *pDataObject = new UIDnDDataObject(m_session, m_ lstFormats, m_pParent);76 UIDnDDataObject *pDataObject = new UIDnDDataObject(m_session, m_dndSource, m_lstFormats, m_pParent); 75 77 76 78 DWORD dwOKEffects = DROPEFFECT_NONE; … … 86 88 87 89 DWORD dwEffect; 90 LogFlowFunc(("dwOKEffects=0x%x\n", dwOKEffects)); 88 91 HRESULT hr = ::DoDragDrop(pDataObject, pDropSource, 89 92 dwOKEffects, &dwEffect); 90 LogFlow ThisFunc(("DoDragDrop ended with hr=%Rhrc, dwEffect=%RI32\n",91 93 LogFlowFunc(("DoDragDrop ended with hr=%Rhrc, dwEffect=%RI32\n", 94 hr, dwEffect)); 92 95 93 96 if (pDropSource) … … 99 102 100 103 /* pMData is transfered to the QDrag object, so no need for deletion. */ 101 pMData = new UIDnDMimeData(m_session, 104 pMData = new UIDnDMimeData(m_session, m_dndSource, 102 105 m_lstFormats, m_defAction, m_actions, 103 106 m_pParent); … … 129 132 /* static */ 130 133 int UIDnDDrag::RetrieveData(const CSession &session, 134 CDnDSource &dndSource, 131 135 Qt::DropAction dropAction, 132 136 const QString &strMimeType, … … 140 144 CGuest guest = session.GetConsole().GetGuest(); 141 145 142 /* Start getting the data from the guest. First inform the guestwe146 /* Start getting the data from the source. First inform the source we 143 147 * want the data in the specified MIME type. */ 144 CProgress progress = guest.DragGHDropped(strMimeType,145 148 CProgress progress = dndSource.Drop(strMimeType, 149 UIDnDHandler::toVBoxDnDAction(dropAction)); 146 150 if (guest.isOk()) 147 151 { … … 157 161 if (RT_SUCCESS(rc)) 158 162 { 159 /* After the data successfully arrived from the guest, we query it from Main. */ 160 QVector<uint8_t> vecData = guest.DragGHGetData(); 163 /* After we successfully retrieved data from 164 * the source, we query it from Main. */ 165 QVector<uint8_t> vecData = dndSource.ReceiveData(); 161 166 if (!vecData.isEmpty()) 162 167 { -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIDnDDrag.h
r50602 r51476 28 28 #include "CSession.h" 29 29 #include "CConsole.h" 30 #include "CDnDSource.h" 30 31 #include "CGuest.h" 31 32 … … 45 46 public: 46 47 47 UIDnDDrag(CSession &session, 48 UIDnDDrag(CSession &session, CDnDSource &dndSource, 48 49 const QStringList &lstFormats, Qt::DropAction defAction, Qt::DropActions actions, 49 50 QWidget *pParent = NULL); … … 54 55 public: 55 56 56 static int RetrieveData(const CSession &session, Qt::DropAction dropAction, const QString &strMimeType, QVariant::Type vaType, QVariant &vaData, QWidget *pParent);57 static int RetrieveData(const CSession &session, CDnDSource &dndSource, Qt::DropAction dropAction, const QString &strMimeType, QVariant::Type vaType, QVariant &vaData, QWidget *pParent); 57 58 58 59 private: 59 60 60 61 CSession m_session; 62 CDnDSource m_dndSource; 61 63 QStringList m_lstFormats; 62 64 Qt::DropAction m_defAction; -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIDnDHandler.cpp
r51033 r51476 34 34 #include "UIDnDHandler.h" 35 35 #ifdef VBOX_WITH_DRAG_AND_DROP_GH 36 # include "CDnDSource.h" 36 37 # include "UIDnDDrag.h" 37 38 #endif … … 39 40 40 41 /* COM includes: */ 42 #include "CConsole.h" 43 #include "CDnDTarget.h" 44 #include "CGuest.h" 41 45 #include "CSession.h" 42 #include "CConsole.h" 43 #include "CGuest.h" 46 47 44 48 45 49 UIDnDHandler *UIDnDHandler::m_pInstance = NULL; 46 50 47 51 UIDnDHandler::UIDnDHandler(void) 48 : mMode(Unknown)49 52 { 50 53 } 51 54 52 55 /* 53 * Host -> Guest 54 */ 55 56 Qt::DropAction UIDnDHandler::dragHGEnter(CGuest &guest, ulong screenId, int x, int y, 57 Qt::DropAction proposedAction, Qt::DropActions possibleActions, 58 const QMimeData *pMimeData, QWidget * /* pParent = NULL */) 59 { 60 if (mMode == GH) /* Wrong mode? Bail out. */ 61 return Qt::IgnoreAction; 62 56 * Frontend -> Target. 57 */ 58 59 Qt::DropAction UIDnDHandler::dragEnter(CDnDTarget &dndTarget, ulong screenId, int x, int y, 60 Qt::DropAction proposedAction, Qt::DropActions possibleActions, 61 const QMimeData *pMimeData, QWidget * /* pParent = NULL */) 62 { 63 63 LogFlowFunc(("screenId=%RU32, x=%d, y=%d, action=%ld\n", 64 64 screenId, x, y, toVBoxDnDAction(proposedAction))); 65 65 66 66 /* Ask the guest for starting a DnD event. */ 67 KDragAndDropAction result = guest.DragHGEnter(screenId, 68 x, 69 y, 70 toVBoxDnDAction(proposedAction), 71 toVBoxDnDActions(possibleActions), 72 pMimeData->formats().toVector()); 67 KDnDAction result = dndTarget.Enter(screenId, 68 x, 69 y, 70 toVBoxDnDAction(proposedAction), 71 toVBoxDnDActions(possibleActions), 72 pMimeData->formats().toVector()); 73 73 74 /* Set the DnD action returned by the guest. */ 74 75 return toQtDnDAction(result); 75 76 } 76 77 77 Qt::DropAction UIDnDHandler::dragHGMove(CGuest &guest, ulong screenId, int x, int y, 78 Qt::DropAction proposedAction, Qt::DropActions possibleActions, 79 const QMimeData *pMimeData, QWidget * /* pParent = NULL */) 80 { 81 if (mMode == GH) /* Wrong mode? Bail out. */ 82 return Qt::IgnoreAction; 83 78 Qt::DropAction UIDnDHandler::dragMove(CDnDTarget &dndTarget, ulong screenId, int x, int y, 79 Qt::DropAction proposedAction, Qt::DropActions possibleActions, 80 const QMimeData *pMimeData, QWidget * /* pParent = NULL */) 81 { 84 82 #ifdef DEBUG_andy 85 83 LogFlowFunc(("screenId=%RU32, x=%d, y=%d, action=%ld\n", … … 89 87 /* Notify the guest that the mouse has been moved while doing 90 88 * a drag'n drop operation. */ 91 KD ragAndDropAction result = guest.DragHGMove(screenId,92 93 94 95 96 89 KDnDAction result = dndTarget.Move(screenId, 90 x, 91 y, 92 toVBoxDnDAction(proposedAction), 93 toVBoxDnDActions(possibleActions), 94 pMimeData->formats().toVector()); 97 95 /* Set the DnD action returned by the guest. */ 98 96 return toQtDnDAction(result); 99 97 } 100 98 101 Qt::DropAction UIDnDHandler::drag HGDrop(CGuest &guest, ulong screenId, int x, int y,102 Qt::DropAction proposedAction, Qt::DropActions possibleActions,103 const QMimeData *pMimeData, QWidget *pParent /* = NULL */)104 { 105 if (mMode == GH) /* Wrong mode? Bail out. */ 106 return Qt::IgnoreAction;99 Qt::DropAction UIDnDHandler::dragDrop(CSession &session, CDnDTarget &dndTarget, 100 ulong screenId, int x, int y, 101 Qt::DropAction proposedAction, Qt::DropActions possibleActions, 102 const QMimeData *pMimeData, QWidget *pParent /* = NULL */) 103 { 104 CGuest guest = session.GetConsole().GetGuest(); 107 105 108 106 LogFlowFunc(("screenId=%RU32, x=%d, y=%d, action=%ld\n", … … 112 110 QString format; 113 111 /* Ask the guest for dropping data. */ 114 KD ragAndDropAction result = guest.DragHGDrop(screenId,115 116 117 118 119 112 KDnDAction result = dndTarget.Drop(screenId, 113 x, 114 y, 115 toVBoxDnDAction(proposedAction), 116 toVBoxDnDActions(possibleActions), 117 pMimeData->formats().toVector(), format); 120 118 /* Has the guest accepted the drop event? */ 121 if (result != KD ragAndDropAction_Ignore)119 if (result != KDnDAction_Ignore) 122 120 { 123 121 /* Get the actual MIME data in the requested format. */ 122 AssertPtr(pMimeData); 124 123 const QByteArray &d = pMimeData->data(format); 125 124 if ( !d.isEmpty() … … 131 130 memcpy(dv.data(), d.constData(), d.size()); 132 131 133 CProgress progress = guest.DragHGPutData(screenId, format, dv);132 CProgress progress = dndTarget.SendData(screenId, format, dv); 134 133 if (guest.isOk()) 135 134 { … … 142 141 { 143 142 msgCenter().cannotDropData(progress, pParent); 144 result = KD ragAndDropAction_Ignore;143 result = KDnDAction_Ignore; 145 144 } 146 145 } … … 148 147 { 149 148 msgCenter().cannotDropData(guest, pParent); 150 result = KD ragAndDropAction_Ignore;149 result = KDnDAction_Ignore; 151 150 } 152 151 } … … 156 155 } 157 156 158 void UIDnDHandler::dragHGLeave(CGuest &guest, ulong screenId, QWidget * /* pParent = NULL */) 159 { 160 if (mMode == GH) /* Wrong mode? Bail out. */ 161 return; 162 157 void UIDnDHandler::dragLeave(CDnDTarget &dndTarget, 158 ulong screenId, QWidget * /* pParent = NULL */) 159 { 163 160 LogFlowFunc(("screenId=%RU32\n", screenId)); 164 guest.DragHGLeave(screenId); 165 } 166 167 int UIDnDHandler::dragGHPending(CSession &session, ulong screenId, QWidget *pParent /* = NULL */) 161 dndTarget.Leave(screenId); 162 } 163 164 /* 165 * Source -> Frontend. 166 */ 167 168 int UIDnDHandler::dragIsPending(CSession &session, CDnDSource &dndSource, 169 ulong screenId, QWidget *pParent /* = NULL */) 168 170 { 169 171 int rc; 170 172 #ifdef VBOX_WITH_DRAG_AND_DROP_GH 171 if (mMode == HG) /* Wrong mode? Bail out. */172 return VERR_WRONG_ORDER;173 174 173 /* 175 * How this works: Host is asking the guest if there is any DnD176 * operation pending, when the mouse leaves the guest window 177 * (DragGHPending). On return there is some info about a running DnD178 * operation (or defaultAction is KDragAndDropAction_Ignore if not). With174 * How this works: Source is asking the target if there is any DnD 175 * operation pending, when the mouse leaves the guest window. On 176 * return there is some info about a running DnD operation 177 * (or defaultAction is KDnDAction_Ignore if not). With 179 178 * this information we create a Qt QDrag object with our own QMimeType 180 179 * implementation and call exec. Please note, this *blocks* until the DnD … … 183 182 CGuest guest = session.GetConsole().GetGuest(); 184 183 QVector<QString> vecFmtGuest; 185 QVector<KD ragAndDropAction> vecActions;186 KD ragAndDropAction defaultAction = guest.DragGHPending(screenId, vecFmtGuest, vecActions);184 QVector<KDnDAction> vecActions; 185 KDnDAction defaultAction = dndSource.DragIsPending(screenId, vecFmtGuest, vecActions); 187 186 LogFlowFunc(("defaultAction=%d, numFormats=%d\n", defaultAction, vecFmtGuest.size())); 188 187 189 188 QStringList lstFmtNative; 190 if (defaultAction != KD ragAndDropAction_Ignore)189 if (defaultAction != KDnDAction_Ignore) 191 190 { 192 191 /* … … 234 233 if (!lstFmtNative.isEmpty()) 235 234 { 236 UIDnDDrag *pDrag = new UIDnDDrag(session, lstFmtNative, 237 toQtDnDAction(defaultAction), 238 toQtDnDActions(vecActions), pParent); 239 rc = pDrag->DoDragDrop(); 240 241 delete pDrag; 235 try 236 { 237 UIDnDDrag *pDrag = new UIDnDDrag(session, dndSource, lstFmtNative, 238 toQtDnDAction(defaultAction), 239 toQtDnDActions(vecActions), pParent); 240 rc = pDrag->DoDragDrop(); 241 242 delete pDrag; 243 } 244 catch (std::bad_alloc &) 245 { 246 rc = VERR_NO_MEMORY; 247 } 242 248 } 243 else 244 rc = V INF_SUCCESS;249 else /* No format data from the guest arrived yet. */ 250 rc = VERR_NO_DATA; 245 251 #else /* !VBOX_WITH_DRAG_AND_DROP_GH */ 246 252 NOREF(session); … … 260 266 261 267 /* static */ 262 KD ragAndDropAction UIDnDHandler::toVBoxDnDAction(Qt::DropAction action)268 KDnDAction UIDnDHandler::toVBoxDnDAction(Qt::DropAction action) 263 269 { 264 270 if (action == Qt::CopyAction) 265 return KD ragAndDropAction_Copy;271 return KDnDAction_Copy; 266 272 if (action == Qt::MoveAction) 267 return KD ragAndDropAction_Move;273 return KDnDAction_Move; 268 274 if (action == Qt::LinkAction) 269 return KD ragAndDropAction_Link;270 271 return KD ragAndDropAction_Ignore;275 return KDnDAction_Link; 276 277 return KDnDAction_Ignore; 272 278 } 273 279 274 280 /* static */ 275 QVector<KD ragAndDropAction> UIDnDHandler::toVBoxDnDActions(Qt::DropActions actions)276 { 277 QVector<KD ragAndDropAction> vbActions;281 QVector<KDnDAction> UIDnDHandler::toVBoxDnDActions(Qt::DropActions actions) 282 { 283 QVector<KDnDAction> vbActions; 278 284 if (actions.testFlag(Qt::IgnoreAction)) 279 vbActions << KD ragAndDropAction_Ignore;285 vbActions << KDnDAction_Ignore; 280 286 if (actions.testFlag(Qt::CopyAction)) 281 vbActions << KD ragAndDropAction_Copy;287 vbActions << KDnDAction_Copy; 282 288 if (actions.testFlag(Qt::MoveAction)) 283 vbActions << KD ragAndDropAction_Move;289 vbActions << KDnDAction_Move; 284 290 if (actions.testFlag(Qt::LinkAction)) 285 vbActions << KD ragAndDropAction_Link;291 vbActions << KDnDAction_Link; 286 292 287 293 return vbActions; … … 289 295 290 296 /* static */ 291 Qt::DropAction UIDnDHandler::toQtDnDAction(KD ragAndDropAction action)297 Qt::DropAction UIDnDHandler::toQtDnDAction(KDnDAction action) 292 298 { 293 299 Qt::DropAction dropAct = Qt::IgnoreAction; 294 if (action == KD ragAndDropAction_Copy)300 if (action == KDnDAction_Copy) 295 301 dropAct = Qt::CopyAction; 296 if (action == KD ragAndDropAction_Move)302 if (action == KDnDAction_Move) 297 303 dropAct = Qt::MoveAction; 298 if (action == KD ragAndDropAction_Link)304 if (action == KDnDAction_Link) 299 305 dropAct = Qt::LinkAction; 300 306 … … 304 310 305 311 /* static */ 306 Qt::DropActions UIDnDHandler::toQtDnDActions(const QVector<KD ragAndDropAction> &vecActions)312 Qt::DropActions UIDnDHandler::toQtDnDActions(const QVector<KDnDAction> &vecActions) 307 313 { 308 314 Qt::DropActions dropActs = Qt::IgnoreAction; … … 311 317 switch (vecActions.at(i)) 312 318 { 313 case KD ragAndDropAction_Ignore:319 case KDnDAction_Ignore: 314 320 dropActs |= Qt::IgnoreAction; 315 321 break; 316 case KD ragAndDropAction_Copy:322 case KDnDAction_Copy: 317 323 dropActs |= Qt::CopyAction; 318 324 break; 319 case KD ragAndDropAction_Move:325 case KDnDAction_Move: 320 326 dropActs |= Qt::MoveAction; 321 327 break; 322 case KD ragAndDropAction_Link:328 case KDnDAction_Link: 323 329 dropActs |= Qt::LinkAction; 324 330 break; -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIDnDHandler.h
r50460 r51476 3 3 * 4 4 * VBox frontends: Qt GUI ("VirtualBox"): 5 * UIDnDHandler class declaration 5 * UIDnDHandler class declaration. 6 6 */ 7 7 … … 26 26 /* Forward declarations: */ 27 27 class QMimeData; 28 class CDnDSource; 29 class CDnDTarget; 30 class CGuest; 28 31 class CSession; 29 class CGuest;30 32 class UIDnDMimeData; 31 33 … … 37 39 38 40 /* Singleton factory. */ 39 static UIDnDHandler *instance(void)41 static UIDnDHandler *instance(void) 40 42 { 41 43 if (!m_pInstance) … … 56 58 * Current operation mode. 57 59 */ 58 enum Mode60 enum Direction 59 61 { 60 62 /** Unknown mode. */ 61 63 Unknown = 0, 62 64 /** Host to guest. */ 63 H G,65 HostToGuest, 64 66 /** Guest to host. */ 65 GH 67 GuestToHost 68 /** @todo Implement guest to guest. */ 66 69 }; 67 70 68 /* Host -> Guest. */69 Qt::DropAction dragHGEnter(CGuest &guest, ulong screenId, int x, int y, Qt::DropAction proposedAction, Qt::DropActions possibleActions, const QMimeData *pMimeData, QWidget *pParent = NULL);70 Qt::DropAction dragHGMove (CGuest &guest, ulong screenId, int x, int y, Qt::DropAction proposedAction, Qt::DropActions possibleActions, const QMimeData *pMimeData, QWidget *pParent = NULL);71 Qt::DropAction dragHGDrop (CGuest &guest, ulong screenId, int x, int y, Qt::DropAction proposedAction, Qt::DropActions possibleActions, const QMimeData *pMimeData, QWidget *pParent = NULL);72 void dragHGLeave(CGuest &guest, ulong screenId, QWidget *pParent = NULL);71 /* Frontend -> Target. */ 72 Qt::DropAction dragEnter(CDnDTarget &dndTarget, ulong screenId, int x, int y, Qt::DropAction proposedAction, Qt::DropActions possibleActions, const QMimeData *pMimeData, QWidget *pParent = NULL); 73 Qt::DropAction dragMove (CDnDTarget &dndTarget, ulong screenId, int x, int y, Qt::DropAction proposedAction, Qt::DropActions possibleActions, const QMimeData *pMimeData, QWidget *pParent = NULL); 74 Qt::DropAction dragDrop (CSession &session, CDnDTarget &dndTarget, ulong screenId, int x, int y, Qt::DropAction proposedAction, Qt::DropActions possibleActions, const QMimeData *pMimeData, QWidget *pParent = NULL); 75 void dragLeave(CDnDTarget &dndTarget, ulong screenId, QWidget *pParent = NULL); 73 76 74 /* Guest -> Host. */75 int dragGHPending(CSession &session, ulong screenId, QWidget *pParent = NULL);77 /* Source -> Frontend. */ 78 int dragIsPending(CSession &session, CDnDSource &dndSource, ulong screenId, QWidget *pParent = NULL); 76 79 77 80 public: 78 81 79 static KD ragAndDropAction toVBoxDnDAction(Qt::DropAction action);80 static QVector<KD ragAndDropAction> toVBoxDnDActions(Qt::DropActions actions);81 static Qt::DropAction toQtDnDAction(KDragAndDropAction action);82 static Qt::DropActions toQtDnDActions(const QVector<KDragAndDropAction> &vecActions);82 static KDnDAction toVBoxDnDAction(Qt::DropAction action); 83 static QVector<KDnDAction> toVBoxDnDActions(Qt::DropActions actions); 84 static Qt::DropAction toQtDnDAction(KDnDAction action); 85 static Qt::DropActions toQtDnDActions(const QVector<KDnDAction> &vecActions); 83 86 84 87 private: 85 static UIDnDHandler *m_pInstance;86 88 87 89 UIDnDHandler(void); 88 90 virtual ~UIDnDHandler(void) {} 89 91 90 /** The current operation mode. */ 91 Mode mMode; 92 private: 93 94 /** Static pointer to singleton instance. */ 95 static UIDnDHandler *m_pInstance; 92 96 }; 93 97 94 #define gDnD UIDnDHandler::instance() 98 /** Gets the singleton instance of the drag'n drop UI helper class. */ 99 #define DnDHandler() UIDnDHandler::instance() 95 100 96 101 #endif /* ___UIDnDHandler_h___ */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIDnDMIMEData.cpp
r51033 r51476 38 38 #include "UIMessageCenter.h" 39 39 40 UIDnDMimeData::UIDnDMimeData(CSession &session, 40 UIDnDMimeData::UIDnDMimeData(CSession &session, 41 CDnDSource &dndSource, 41 42 QStringList formats, 42 43 Qt::DropAction defAction, Qt::DropActions actions, 43 44 QWidget *pParent) 44 45 : m_Session(session) 46 , m_DnDSource(dndSource) 45 47 , m_lstFormats(formats) 46 48 , m_defAction(defAction) … … 109 111 110 112 QVariant UIDnDMimeData::retrieveData(const QString &strMIMEType, 111 QVariant::Type vaType) const113 QVariant::Type vaType) 112 114 { 113 115 LogFlowFunc(("m_enmState=%d, mimeType=%s, type=%d (%s)\n", … … 165 167 { 166 168 rc = UIDnDDrag::RetrieveData(m_Session, 169 m_DnDSource, 167 170 m_defAction, 168 171 strMIMEType, vaType, m_vaData, … … 198 201 LogFlowFunc(("MouseMove: x=%d, y=%d\n", 199 202 pMouseEvent->globalX(), pMouseEvent->globalY())); 200 203 201 204 return true; 202 205 /* Never reached. */ … … 207 210 LogFlowFunc(("MouseButtonRelease\n")); 208 211 m_enmState = Dropped; 209 212 210 213 return true; 211 214 /* Never reached. */ … … 220 223 m_enmState = Canceled; 221 224 } 222 225 223 226 return true; 224 227 /* Never reached. */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIDnDMIMEData.h
r50734 r51476 26 26 /* COM includes: */ 27 27 #include "COMEnums.h" 28 #include "CConsole.h" 29 #include "CDnDSource.h" 30 #include "CGuest.h" 28 31 #include "CSession.h" 29 #include "CConsole.h"30 #include "CGuest.h"31 32 32 33 #include "UIDnDHandler.h" … … 61 62 public: 62 63 63 UIDnDMimeData(CSession &session, QStringList formats, Qt::DropAction defAction, Qt::DropActions actions, QWidget *pParent);64 UIDnDMimeData(CSession &session, CDnDSource &dndSource, QStringList formats, Qt::DropAction defAction, Qt::DropActions actions, QWidget *pParent); 64 65 65 66 public: … … 78 79 virtual bool hasFormat(const QString &mimeType) const; 79 80 80 virtual QVariant retrieveData(const QString &mimeType, QVariant::Type type) const;81 virtual QVariant retrieveData(const QString &mimeType, QVariant::Type type); 81 82 82 83 #ifndef RT_OS_WINDOWS … … 98 99 99 100 CSession m_Session; 101 CDnDSource m_DnDSource; 100 102 QStringList m_lstFormats; 101 103 Qt::DropAction m_defAction; -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp
r51398 r51476 5 5 6 6 /* 7 * Copyright (C) 2010-201 3Oracle Corporation7 * Copyright (C) 2010-2014 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 729 729 { 730 730 foreach (QAction *pAction, m_pDragAndDropActions->actions()) 731 pAction->setText(gpConverter->toString(pAction->data().value<KD ragAndDropMode>()));731 pAction->setText(gpConverter->toString(pAction->data().value<KDnDMode>())); 732 732 } 733 733 } … … 1864 1864 { 1865 1865 m_pDragAndDropActions = new QActionGroup(this); 1866 for (int i = KD ragAndDropMode_Disabled; i < KDragAndDropMode_Max; ++i)1866 for (int i = KDnDMode_Disabled; i < KDnDMode_Max; ++i) 1867 1867 { 1868 KD ragAndDropMode mode = (KDragAndDropMode)i;1868 KDnDMode mode = (KDnDMode)i; 1869 1869 QAction *pAction = new QAction(gpConverter->toString(mode), m_pDragAndDropActions); 1870 1870 pMenu->addAction(pAction); 1871 1871 pAction->setData(QVariant::fromValue(mode)); 1872 1872 pAction->setCheckable(true); 1873 pAction->setChecked(session().GetMachine().GetD ragAndDropMode() == mode);1873 pAction->setChecked(session().GetMachine().GetDnDMode() == mode); 1874 1874 } 1875 1875 connect(m_pDragAndDropActions, SIGNAL(triggered(QAction*)), … … 1879 1879 else 1880 1880 foreach (QAction *pAction, m_pDragAndDropActions->actions()) 1881 if (pAction->data().value<KD ragAndDropMode>() == session().GetMachine().GetDragAndDropMode())1881 if (pAction->data().value<KDnDMode>() == session().GetMachine().GetDnDMode()) 1882 1882 pAction->setChecked(true); 1883 1883 } … … 1961 1961 { 1962 1962 /* Assign new mode (without save): */ 1963 KD ragAndDropMode mode = pAction->data().value<KDragAndDropMode>();1964 session().GetMachine().SetD ragAndDropMode(mode);1963 KDnDMode mode = pAction->data().value<KDnDMode>(); 1964 session().GetMachine().SetDnDMode(mode); 1965 1965 } 1966 1966 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp
r51467 r51476 61 61 #include "CFramebuffer.h" 62 62 #ifdef VBOX_WITH_DRAG_AND_DROP 63 # include "CDnDSource.h" 64 # include "CDnDTarget.h" 63 65 # include "CGuest.h" 66 # include "CGuestDnDTarget.h" 67 # include "CGuestDnDSource.h" 64 68 #endif /* VBOX_WITH_DRAG_AND_DROP */ 65 69 … … 1160 1164 void UIMachineView::dragEnterEvent(QDragEnterEvent *pEvent) 1161 1165 { 1162 /* The guest object to talk to. */ 1166 AssertPtrReturnVoid(pEvent); 1167 1168 /* Get mouse-pointer location. */ 1169 const QPoint &cpnt = viewportToContents(pEvent->pos()); 1170 1163 1171 CGuest guest = session().GetConsole().GetGuest(); 1164 1165 /* Get mouse-pointer location */ 1166 const QPoint &cpnt = viewportToContents(pEvent->pos()); 1167 1168 /* Ask the guest for starting a DnD event. */ 1169 Qt::DropAction result = gDnD->dragHGEnter(guest, 1170 screenId(), 1171 frameBuffer()->convertHostXTo(cpnt.x()), 1172 frameBuffer()->convertHostYTo(cpnt.y()), 1173 pEvent->proposedAction(), 1174 pEvent->possibleActions(), 1175 pEvent->mimeData(), this); 1172 CGuestDnDTarget dndTarget = guest.GetDnDTarget(); 1173 1174 /* Ask the target for starting a DnD event. */ 1175 Qt::DropAction result = DnDHandler()->dragEnter(static_cast<CDnDTarget>(dndTarget), 1176 screenId(), 1177 frameBuffer()->convertHostXTo(cpnt.x()), 1178 frameBuffer()->convertHostYTo(cpnt.y()), 1179 pEvent->proposedAction(), 1180 pEvent->possibleActions(), 1181 pEvent->mimeData(), this /* pParent */); 1176 1182 1177 1183 /* Set the DnD action returned by the guest. */ … … 1182 1188 void UIMachineView::dragMoveEvent(QDragMoveEvent *pEvent) 1183 1189 { 1184 /* The guest object to talk to. */ 1190 AssertPtrReturnVoid(pEvent); 1191 1192 /* Get mouse-pointer location. */ 1193 const QPoint &cpnt = viewportToContents(pEvent->pos()); 1194 1185 1195 CGuest guest = session().GetConsole().GetGuest(); 1186 1187 /* Get mouse-pointer location */ 1188 const QPoint &cpnt = viewportToContents(pEvent->pos()); 1196 CGuestDnDTarget dndTarget = guest.GetDnDTarget(); 1189 1197 1190 1198 /* Ask the guest for moving the drop cursor. */ 1191 Qt::DropAction result = gDnD->dragHGMove(guest,1192 screenId(),1193 frameBuffer()->convertHostXTo(cpnt.x()),1194 frameBuffer()->convertHostYTo(cpnt.y()),1195 pEvent->proposedAction(),1196 pEvent->possibleActions(),1197 pEvent->mimeData(), this);1199 Qt::DropAction result = DnDHandler()->dragMove(static_cast<CDnDTarget>(dndTarget), 1200 screenId(), 1201 frameBuffer()->convertHostXTo(cpnt.x()), 1202 frameBuffer()->convertHostYTo(cpnt.y()), 1203 pEvent->proposedAction(), 1204 pEvent->possibleActions(), 1205 pEvent->mimeData(), this /* pParent */); 1198 1206 1199 1207 /* Set the DnD action returned by the guest. */ … … 1204 1212 void UIMachineView::dragLeaveEvent(QDragLeaveEvent *pEvent) 1205 1213 { 1206 /* The guest object to talk to. */ 1214 AssertPtrReturnVoid(pEvent); 1215 1207 1216 CGuest guest = session().GetConsole().GetGuest(); 1217 CGuestDnDTarget dndTarget = guest.GetDnDTarget(); 1208 1218 1209 1219 /* Ask the guest for stopping this DnD event. */ 1210 gDnD->dragHGLeave(guest, screenId(), this); 1220 DnDHandler()->dragLeave(static_cast<CDnDTarget>(dndTarget), 1221 screenId(), this /* pParent */); 1211 1222 pEvent->accept(); 1212 1223 } 1213 1224 1225 void UIMachineView::dragIsPending(void) 1226 { 1227 /* At the moment we only support guest->host DnD. */ 1228 /** @todo Add guest->guest DnD functionality here by getting 1229 * the source of guest B (when copying from B to A). */ 1230 CGuest guest = session().GetConsole().GetGuest(); 1231 CDnDSource &dndSource = static_cast<CDnDSource>(guest.GetDnDSource()); 1232 1233 /* Check for a pending DnD event within the guest and if so, handle all the 1234 * magic. */ 1235 DnDHandler()->dragIsPending(session(), dndSource, screenId(), this /* pParent */); 1236 } 1237 1214 1238 void UIMachineView::dropEvent(QDropEvent *pEvent) 1215 1239 { 1216 /* The guest object to talk to. */ 1240 AssertPtrReturnVoid(pEvent); 1241 1242 /* Get mouse-pointer location. */ 1243 const QPoint &cpnt = viewportToContents(pEvent->pos()); 1244 1217 1245 CGuest guest = session().GetConsole().GetGuest(); 1218 1219 /* Get mouse-pointer location */ 1220 const QPoint &cpnt = viewportToContents(pEvent->pos()); 1246 CGuestDnDTarget dndTarget = guest.GetDnDTarget(); 1221 1247 1222 1248 /* Ask the guest for dropping data. */ 1223 Qt::DropAction result = gDnD->dragHGDrop(guest, 1224 screenId(), 1225 frameBuffer()->convertHostXTo(cpnt.x()), 1226 frameBuffer()->convertHostYTo(cpnt.y()), 1227 pEvent->proposedAction(), 1228 pEvent->possibleActions(), 1229 pEvent->mimeData(), this); 1249 Qt::DropAction result = DnDHandler()->dragDrop(session(), 1250 static_cast<CDnDTarget>(dndTarget), 1251 screenId(), 1252 frameBuffer()->convertHostXTo(cpnt.x()), 1253 frameBuffer()->convertHostYTo(cpnt.y()), 1254 pEvent->proposedAction(), 1255 pEvent->possibleActions(), 1256 pEvent->mimeData(), this /* pParent */); 1230 1257 1231 1258 /* Set the DnD action returned by the guest. */ … … 1233 1260 pEvent->accept(); 1234 1261 } 1235 1236 void UIMachineView::handleGHDnd(void)1237 {1238 /* The guest object to talk to. */1239 CGuest guest = session().GetConsole().GetGuest();1240 1241 /* Check for a pending DnD event within the guest and if so, handle all the1242 * magic. */1243 gDnD->dragGHPending(session(), screenId(), this);1244 }1245 1262 #endif /* VBOX_WITH_DRAG_AND_DROP */ 1246 1263 … … 1249 1266 bool UIMachineView::winEvent(MSG *pMsg, long* /* piResult */) 1250 1267 { 1251 /* Check if some system event should be filtered-out. 1252 * Returning 'true' means filtering-out, 1253 * Returning 'false' means passing event to Qt. */ 1254 bool fResult = false; /* Pass to Qt by default: */ 1268 AssertPtrReturn(pMsg, false); 1269 1270 /* Check if some system event should be filtered out. 1271 * Returning @c true means filtering-out, 1272 * Returning @c false means passing event to Qt. */ 1273 bool fResult = false; /* Pass to Qt by default. */ 1255 1274 switch (pMsg->message) 1256 1275 { … … 1260 1279 case WM_SYSKEYUP: 1261 1280 { 1262 /* Filter using keyboard-filter: */ 1263 bool fKeyboardFilteringResult = machineLogic()->keyboardHandler()->winEventFilter(pMsg, screenId()); 1264 /* Keyboard filter rules the result: */ 1281 /* Filter using keyboard filter? */ 1282 bool fKeyboardFilteringResult = 1283 machineLogic()->keyboardHandler()->winEventFilter(pMsg, screenId()); 1284 /* Keyboard filter rules the result? */ 1265 1285 fResult = fKeyboardFilteringResult; 1266 1286 break; … … 1269 1289 break; 1270 1290 } 1271 /* Return result: */ 1291 1272 1292 return fResult; 1273 1293 } … … 1277 1297 bool UIMachineView::x11Event(XEvent *pEvent) 1278 1298 { 1279 /* Check if some system event should be filtered-out. 1280 * Returning 'true' means filtering-out, 1281 * Returning 'false' means passing event to Qt. */ 1282 bool fResult = false; /* Pass to Qt by default: */ 1299 AssertPtrReturn(pEvent, false); 1300 1301 /* Check if some system event should be filtered out. 1302 * Returning @c true means filtering-out, 1303 * Returning @c false means passing event to Qt. */ 1304 bool fResult = false; /* Pass to Qt by default. */ 1283 1305 switch (pEvent->type) 1284 1306 { … … 1288 1310 case XKeyRelease: 1289 1311 { 1290 /* Filter using keyboard-filter: */ 1291 bool fKeyboardFilteringResult = machineLogic()->keyboardHandler()->x11EventFilter(pEvent, screenId()); 1292 /* Filter using mouse-filter: */ 1293 bool fMouseFilteringResult = machineLogic()->mouseHandler()->x11EventFilter(pEvent, screenId()); 1294 /* If at least one of filters wants to filter event out then the result is 'true': */ 1312 /* Filter using keyboard-filter? */ 1313 bool fKeyboardFilteringResult = 1314 machineLogic()->keyboardHandler()->x11EventFilter(pEvent, screenId()); 1315 /* Filter using mouse-filter? */ 1316 bool fMouseFilteringResult = 1317 machineLogic()->mouseHandler()->x11EventFilter(pEvent, screenId()); 1318 /* If at least one of filters wants to filter event out then the result is true. */ 1295 1319 fResult = fKeyboardFilteringResult || fMouseFilteringResult; 1296 1320 break; … … 1299 1323 break; 1300 1324 } 1301 /* Return result: */ 1325 1302 1326 return fResult; 1303 1327 } 1304 1328 1305 #endif 1306 1329 #endif /* Q_WS_X11 */ 1330 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.h
r51436 r51476 39 39 class UIMachineWindow; 40 40 class UIFrameBuffer; 41 #ifdef VBOX_WITH_DRAG_AND_DROP 42 class CDnDTarget; 43 #endif 41 44 class CSession; 42 45 … … 217 220 void dragLeaveEvent(QDragLeaveEvent *pEvent); 218 221 void dragMoveEvent(QDragMoveEvent *pEvent); 222 void dragIsPending(void); 219 223 void dropEvent(QDropEvent *pEvent); 220 221 void handleGHDnd();222 224 #endif /* VBOX_WITH_DRAG_AND_DROP */ 223 225 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMouseHandler.cpp
r51339 r51476 7 7 8 8 /* 9 * Copyright (C) 2010-201 2Oracle Corporation9 * Copyright (C) 2010-2014 Oracle Corporation 10 10 * 11 11 * This file is part of VirtualBox Open Source Edition (OSE), as … … 936 936 || cpnt.y() > iCh - 1) 937 937 { 938 bool fHandle dGHDnD938 bool fHandleDnDPending 939 939 = RT_BOOL(mouseButtons.testFlag(Qt::LeftButton)); 940 if (fHandle dGHDnD)941 { 942 m_views[uScreenId]-> handleGHDnd();940 if (fHandleDnDPending) 941 { 942 m_views[uScreenId]->dragIsPending(); 943 943 return true; 944 944 } -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsGeneral.cpp
r48576 r51476 7 7 8 8 /* 9 * Copyright (C) 2006-201 2Oracle Corporation9 * Copyright (C) 2006-2014 Oracle Corporation 10 10 * 11 11 * This file is part of VirtualBox Open Source Edition (OSE), as … … 44 44 45 45 /* Drag'n'drop mode */ 46 mCbDragAndDrop->addItem (""); /* KD ragAndDropMode_Disabled */47 mCbDragAndDrop->addItem (""); /* KD ragAndDropMode_HostToGuest */48 mCbDragAndDrop->addItem (""); /* KD ragAndDropMode_GuestToHost */49 mCbDragAndDrop->addItem (""); /* KD ragAndDropMode_Bidirectional */46 mCbDragAndDrop->addItem (""); /* KDnDMode_Disabled */ 47 mCbDragAndDrop->addItem (""); /* KDnDMode_HostToGuest */ 48 mCbDragAndDrop->addItem (""); /* KDnDMode_GuestToHost */ 49 mCbDragAndDrop->addItem (""); /* KDnDMode_Bidirectional */ 50 50 51 51 #ifdef Q_WS_MAC … … 115 115 generalData.m_strSnapshotsHomeDir = QFileInfo(m_machine.GetSettingsFilePath()).absolutePath(); 116 116 generalData.m_clipboardMode = m_machine.GetClipboardMode(); 117 generalData.m_d ragAndDropMode = m_machine.GetDragAndDropMode();117 generalData.m_dndMode = m_machine.GetDnDMode(); 118 118 generalData.m_strDescription = m_machine.GetDescription(); 119 119 … … 141 141 mPsSnapshot->setHomeDir(generalData.m_strSnapshotsHomeDir); 142 142 mCbClipboard->setCurrentIndex(generalData.m_clipboardMode); 143 mCbDragAndDrop->setCurrentIndex(generalData.m_d ragAndDropMode);143 mCbDragAndDrop->setCurrentIndex(generalData.m_dndMode); 144 144 mTeDescription->setPlainText(generalData.m_strDescription); 145 145 … … 166 166 generalData.m_strSnapshotsFolder = mPsSnapshot->path(); 167 167 generalData.m_clipboardMode = (KClipboardMode)mCbClipboard->currentIndex(); 168 generalData.m_d ragAndDropMode = (KDragAndDropMode)mCbDragAndDrop->currentIndex();168 generalData.m_dndMode = (KDnDMode)mCbDragAndDrop->currentIndex(); 169 169 generalData.m_strDescription = mTeDescription->toPlainText().isEmpty() ? 170 170 QString::null : mTeDescription->toPlainText(); … … 192 192 /* Advanced tab: */ 193 193 m_machine.SetClipboardMode(generalData.m_clipboardMode); 194 m_machine.SetD ragAndDropMode(generalData.m_dragAndDropMode);194 m_machine.SetDnDMode(generalData.m_dndMode); 195 195 m_machine.SetExtraData(GUI_SaveMountedAtRuntime, generalData.m_fSaveMountedAtRuntime ? "yes" : "no"); 196 196 m_machine.SetExtraData(GUI_ShowMiniToolBar, generalData.m_fShowMiniToolBar ? "yes" : "no"); … … 292 292 293 293 /* Drag'n'drop mode */ 294 mCbDragAndDrop->setItemText (0, gpConverter->toString (KD ragAndDropMode_Disabled));295 mCbDragAndDrop->setItemText (1, gpConverter->toString (KD ragAndDropMode_HostToGuest));296 mCbDragAndDrop->setItemText (2, gpConverter->toString (KD ragAndDropMode_GuestToHost));297 mCbDragAndDrop->setItemText (3, gpConverter->toString (KD ragAndDropMode_Bidirectional));294 mCbDragAndDrop->setItemText (0, gpConverter->toString (KDnDMode_Disabled)); 295 mCbDragAndDrop->setItemText (1, gpConverter->toString (KDnDMode_HostToGuest)); 296 mCbDragAndDrop->setItemText (2, gpConverter->toString (KDnDMode_GuestToHost)); 297 mCbDragAndDrop->setItemText (3, gpConverter->toString (KDnDMode_Bidirectional)); 298 298 } 299 299 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsGeneral.h
r47944 r51476 6 6 7 7 /* 8 * Copyright (C) 2006-201 2Oracle Corporation8 * Copyright (C) 2006-2014 Oracle Corporation 9 9 * 10 10 * This file is part of VirtualBox Open Source Edition (OSE), as … … 37 37 , m_strSnapshotsHomeDir(QString()) 38 38 , m_clipboardMode(KClipboardMode_Disabled) 39 , m_d ragAndDropMode(KDragAndDropMode_Disabled)39 , m_dndMode(KDnDMode_Disabled) 40 40 , m_strDescription(QString()) {} 41 41 /* Functions: */ … … 50 50 (m_strSnapshotsHomeDir == other.m_strSnapshotsHomeDir) && 51 51 (m_clipboardMode == other.m_clipboardMode) && 52 (m_d ragAndDropMode == other.m_dragAndDropMode) &&52 (m_dndMode == other.m_dndMode) && 53 53 (m_strDescription == other.m_strDescription); 54 54 } … … 65 65 QString m_strSnapshotsHomeDir; 66 66 KClipboardMode m_clipboardMode; 67 KD ragAndDropMode m_dragAndDropMode;67 KDnDMode m_dndMode; 68 68 QString m_strDescription; 69 69 };
Note:
See TracChangeset
for help on using the changeset viewer.