Changeset 100606 in vbox
- Timestamp:
- Jul 17, 2023 4:32:44 PM (19 months ago)
- Location:
- trunk
- Files:
-
- 2 added
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/log.h
r100221 r100606 403 403 /** Main group, IChoiceFormValue. */ 404 404 LOG_GROUP_MAIN_CHOICEFORMVALUE, 405 /** Main group, IClipboardErrorEvent. */ 406 LOG_GROUP_MAIN_CLIPBOARDERROREVENT, 407 /** Main group, IClipboardEvent. */ 408 LOG_GROUP_MAIN_CLIPBOARDEVENT, 405 409 /** Main group, ICloudClient. */ 406 410 LOG_GROUP_MAIN_CLOUDCLIENT, … … 1015 1019 "MAIN_CERTIFICATE", \ 1016 1020 "MAIN_CHOICEFORMVALUE", \ 1021 "MAIN_CLIPBOARDERROREVENT", \ 1022 "MAIN_CLIPBOARDEVENT", \ 1017 1023 "MAIN_CLOUDCLIENT", \ 1018 1024 "MAIN_CLOUDMACHINE", \ -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMainEventListener.cpp
r98382 r100606 38 38 #include "COMEnums.h" 39 39 #include "CCanShowWindowEvent.h" 40 #include "CClipboardErrorEvent.h" 40 41 #include "CClipboardModeChangedEvent.h" 41 42 #include "CCloudProfileChangedEvent.h" … … 613 614 break; 614 615 } 616 case KVBoxEventType_OnClipboardError: 617 { 618 CClipboardErrorEvent comEventSpecific(pEvent); 619 emit sigClipboardError(comEventSpecific.GetId(), comEventSpecific.GetMsg(), comEventSpecific.GetRcError()); 620 break; 621 } 615 622 case KVBoxEventType_OnDnDModeChanged: 616 623 { -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMainEventListener.h
r98382 r100606 200 200 /** Notifies about the clipboard mode change. */ 201 201 void sigClipboardModeChange(KClipboardMode enmClipboardMode); 202 /** Notifies about a clipboard error. */ 203 void sigClipboardError(QString strId, QString strMsg, long rcError); 202 204 /** Notifies about the drag and drop mode change. */ 203 205 void sigDnDModeChange(KDnDMode enmDnDMode); -
trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.cpp
r100064 r100606 140 140 QApplication::translate("UIMessageCenter", "Encryption password for <nobr>ID = '%1'</nobr> is invalid.") 141 141 .arg(strPasswordId)); 142 } 143 144 /* static */ 145 void UINotificationMessage::showClipboardError(QString strId, QString strMsg, long rcError) 146 { 147 RT_NOREF(strId, rcError); 148 149 UINotificationMessage::createMessage( 150 QApplication::translate("UIMessageCenter", "Shared Clipboard Error"), 151 QApplication::translate("UIMessageCenter", strMsg.toUtf8().constData())); 142 152 } 143 153 -
trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.h
r99664 r100606 108 108 * @param strPasswordId Brings password ID. */ 109 109 static void warnAboutInvalidEncryptionPassword(const QString &strPasswordId); 110 /** Notifies about a clipboard error. */ 111 static void showClipboardError(QString strId, QString strMsg, long rcError); 110 112 111 113 #ifdef VBOX_GUI_WITH_NETWORK_MANAGER -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIConsoleEventHandler.cpp
r98382 r100606 98 98 /** Notifies clipboard mode change. */ 99 99 void sigClipboardModeChange(KClipboardMode enmMode); 100 /** Notifies about a clipboard error. */ 101 void sigClipboardError(QString strId, QString strMsg, long rcError); 100 102 /** Notifies drag and drop mode change. */ 101 103 void sigDnDModeChange(KDnDMode enmMode); … … 228 230 << KVBoxEventType_OnAudioAdapterChanged 229 231 << KVBoxEventType_OnClipboardModeChanged 232 << KVBoxEventType_OnClipboardError 230 233 << KVBoxEventType_OnDnDModeChanged 231 234 ; … … 304 307 connect(m_pQtListener->getWrapped(), &UIMainEventListener::sigClipboardModeChange, 305 308 this, &UIConsoleEventHandlerProxy::sigClipboardModeChange, 309 Qt::DirectConnection); 310 connect(m_pQtListener->getWrapped(), &UIMainEventListener::sigClipboardError, 311 this, &UIConsoleEventHandlerProxy::sigClipboardError, 306 312 Qt::DirectConnection); 307 313 connect(m_pQtListener->getWrapped(), &UIMainEventListener::sigDnDModeChange, … … 412 418 this, &UIConsoleEventHandler::sigClipboardModeChange, 413 419 Qt::QueuedConnection); 420 connect(m_pProxy, &UIConsoleEventHandlerProxy::sigClipboardError, 421 this, &UIConsoleEventHandler::sigClipboardError, 422 Qt::QueuedConnection); 414 423 connect(m_pProxy, &UIConsoleEventHandlerProxy::sigDnDModeChange, 415 424 this, &UIConsoleEventHandler::sigDnDModeChange, -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIConsoleEventHandler.h
r98382 r100606 103 103 /** Notifies clipboard mode change. */ 104 104 void sigClipboardModeChange(KClipboardMode enmMode); 105 /** Notifies about a clipboard error. */ 106 void sigClipboardError(QString strId, QString strMsg, long rcError); 105 107 /** Notifies drag and drop mode change. */ 106 108 void sigDnDModeChange(KDnDMode enmMode); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.cpp
r100064 r100606 1073 1073 { 1074 1074 uisession()->sltMountDVDAdHoc(strSource); 1075 } 1076 1077 void UIMachine::sltClipboardError(QString strId, QString strMsg, long rcError) 1078 { 1079 UINotificationMessage::showClipboardError(strId, strMsg, rcError); 1075 1080 } 1076 1081 … … 1518 1523 connect(uisession(), &UISession::sigClipboardModeChange, 1519 1524 this, &UIMachine::sigClipboardModeChange); 1525 connect(uisession(), &UISession::sigClipboardError, 1526 this, &UIMachine::sltClipboardError); 1520 1527 connect(uisession(), &UISession::sigCPUExecutionCapChange, 1521 1528 this, &UIMachine::sigCPUExecutionCapChange); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.h
r100064 r100606 86 86 /** Notifies about clipboard mode change. */ 87 87 void sigClipboardModeChange(KClipboardMode enmMode); 88 /** Notifies about a clipboard error. */ 89 void sigClipboardError(QString strId, QString strMsg, long rcError); 88 90 /** Notifies about CPU execution cap change. */ 89 91 void sigCPUExecutionCapChange(); … … 725 727 /** @} */ 726 728 729 /** @name Clipboard stuff. 730 ** @{ */ 731 /** Handles clipboard errors. */ 732 void sltClipboardError(QString strId, QString strMsg, long rcError); 733 /** @} */ 734 727 735 /** @name Keyboard stuff. 728 736 ** @{ */ … … 778 786 /** Handles host-screen available-area change. */ 779 787 void sltHandleHostScreenAvailableAreaChange(); 780 781 788 #ifdef VBOX_WS_MAC 782 789 /** macOS X: Restarts display-reconfiguration watchdog timer from the beginning. -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp
r100064 r100606 2515 2515 connect(m_pConsoleEventhandler, &UIConsoleEventHandler::sigClipboardModeChange, 2516 2516 this, &UISession::sigClipboardModeChange); 2517 connect(m_pConsoleEventhandler, &UIConsoleEventHandler::sigClipboardError, 2518 this, &UISession::sigClipboardError); 2517 2519 connect(m_pConsoleEventhandler, &UIConsoleEventHandler::sigCPUExecutionCapChange, 2518 2520 this, &UISession::sigCPUExecutionCapChange); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h
r98940 r100606 92 92 /** Notifies about clipboard mode change. */ 93 93 void sigClipboardModeChange(KClipboardMode enmMode); 94 /** Notifies about a clipboard error. */ 95 void sigClipboardError(QString strId, QString strMsg, long rcError); 94 96 /** Notifies about CPU execution cap change. */ 95 97 void sigCPUExecutionCapChange(); -
trunk/src/VBox/Main/Makefile.kmk
r100038 r100606 1223 1223 src-client/GuestSessionImpl.cpp 1224 1224 endif 1225 ifdef VBOX_WITH_SHARED_CLIPBOARD 1226 VBoxC_SOURCES += \ 1227 src-client/GuestShClPrivate.cpp 1228 endif 1225 1229 ifdef VBOX_WITH_DRAG_AND_DROP 1226 1230 VBoxC_SOURCES += \ -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r100038 r100606 26396 26396 <enum 26397 26397 name="VBoxEventType" 26398 uuid=" 03b0e6ea-28fe-4f0a-a3ec-1a21703da6f7"26398 uuid="f698ab32-91e4-4379-b99c-174cebecfa5e" 26399 26399 > 26400 26400 … … 26912 26912 </desc> 26913 26913 </const> 26914 <const name="OnClipboardError" value="122"> 26915 <desc> 26916 See <link to="IClipboardErrorEvent">IClipboardErrorEvent</link>. 26917 </desc> 26918 </const> 26914 26919 <!-- End event marker --> 26915 <const name="End" value="12 2">26920 <const name="End" value="123"> 26916 26921 <desc> 26917 26922 Must be last event, used for iterations and structures relying on numerical event values. … … 27763 27768 </desc> 27764 27769 </attribute> 27770 </interface> 27771 27772 <interface 27773 name="IClipboardEvent" extends="IEvent" 27774 uuid="f22dd3b4-e4d0-437a-bfdf-0372896ba162" 27775 wsmap="managed"> 27776 <desc> 27777 Abstract base interface for clipboard events. 27778 </desc> 27779 <attribute name="id" type="wstring" readonly="yes"> 27780 <desc>Name of the clipboard this event belongs to. 27781 27782 For Windows or macOS hosts / guests, this string is empty. 27783 For X11-based hosts / guests, this can hold either "PRIMARY" or "SECONDARY". 27784 </desc> 27785 </attribute> 27786 </interface> 27787 27788 <interface 27789 name="IClipboardErrorEvent" extends="IClipboardEvent" 27790 uuid="9e5f6f25-beda-46ad-8ddb-23c0268ac345" 27791 wsmap="managed" autogen="VBoxEvent" id="OnClipboardError" 27792 > 27793 <desc> 27794 Notification when a clipboard error occurred. 27795 </desc> 27796 27797 <attribute name="msg" type="wstring" readonly="yes"> 27798 <desc> 27799 Error message in human readable format. 27800 </desc> 27801 </attribute> 27802 27803 <attribute name="rcError" type="long" readonly="yes"> 27804 <desc> 27805 IPRT-style error code. 27806 </desc> 27807 </attribute> 27808 27765 27809 </interface> 27766 27810 -
trunk/src/VBox/Main/include/ConsoleImpl.h
r100038 r100606 220 220 HRESULT i_onCPUChange(ULONG aCPU, BOOL aRemove); 221 221 HRESULT i_onCPUExecutionCapChange(ULONG aExecutionCap); 222 HRESULT i_onClipboardError(const Utf8Str &aId, const Utf8Str &aErrMsg, LONG aRc); 222 223 HRESULT i_onClipboardModeChange(ClipboardMode_T aClipboardMode); 223 224 HRESULT i_onClipboardFileTransferModeChange(bool aEnabled); … … 1190 1191 #endif 1191 1192 1193 #ifdef VBOX_WITH_SHARED_CLIPBOARD 1194 # ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS 1195 /* Service extension for the Shared Clipboard HGCM service. */ 1196 HGCMSVCEXTHANDLE m_hHgcmSvcExtShCl; 1197 # endif 1198 #endif 1199 1192 1200 #ifdef VBOX_WITH_DRAG_AND_DROP 1193 HGCMSVCEXTHANDLE m_hHgcmSvcExtDragAndDrop;1194 #endif 1195 1201 /* Service extension for the Drag'n Drop HGCM service. */ 1202 HGCMSVCEXTHANDLE m_hHgcmSvcExtDragAndDrop; 1203 #endif 1196 1204 /** Pointer to the progress object of a live cancelable task. 1197 1205 * -
trunk/src/VBox/Main/include/ConsoleVRDPServer.h
r98296 r100606 232 232 233 233 int mcClipboardRefs; 234 HGCMSVCEXTHANDLE mhClipboard;235 234 PFNVRDPCLIPBOARDEXTCALLBACK mpfnClipboardCallback; 236 235 -
trunk/src/VBox/Main/src-client/ConsoleImpl.cpp
r100521 r100606 90 90 #ifdef VBOX_WITH_VIRT_ARMV8 91 91 # include "ResourceStoreImpl.h" 92 #endif 93 #ifdef VBOX_WITH_SHARED_CLIPBOARD 94 # include "GuestShClPrivate.h" 92 95 #endif 93 96 #include "StringifyEnums.h" … … 5653 5656 alock.release(); 5654 5657 ::FireCPUExecutionCapChangedEvent(mEventSource, aExecutionCap); 5658 } 5659 5660 LogFlowThisFunc(("Leaving hrc=%#x\n", hrc)); 5661 return hrc; 5662 } 5663 5664 /** 5665 * Called by IInternalSessionControl::OnClipboardError(). 5666 * 5667 * @note Locks this object for writing. 5668 */ 5669 HRESULT Console::i_onClipboardError(const Utf8Str &aId, const Utf8Str &aErrMsg, LONG aRc) 5670 { 5671 LogFlowThisFunc(("\n")); 5672 5673 AutoCaller autoCaller(this); 5674 AssertComRCReturnRC(autoCaller.hrc()); 5675 5676 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 5677 5678 HRESULT hrc = S_OK; 5679 5680 /* don't trigger the drag and drop mode change if the VM isn't running */ 5681 SafeVMPtrQuiet ptrVM(this); 5682 if (ptrVM.isOk()) 5683 { 5684 if ( mMachineState == MachineState_Running 5685 || mMachineState == MachineState_Teleporting 5686 || mMachineState == MachineState_LiveSnapshotting) 5687 { 5688 } 5689 else 5690 hrc = i_setInvalidMachineStateError(); 5691 ptrVM.release(); 5692 } 5693 5694 /* notify console callbacks on success */ 5695 if (SUCCEEDED(hrc)) 5696 { 5697 alock.release(); 5698 ::FireClipboardErrorEvent(mEventSource, aId, aErrMsg, aRc); 5655 5699 } 5656 5700 … … 8945 8989 alock.release(); 8946 8990 8947 # ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS 8948 /** @todo Deregister area callbacks? */ 8949 # endif 8991 # ifdef VBOX_WITH_SHARED_CLIPBOARD 8992 if (m_hHgcmSvcExtShCl) 8993 { 8994 HGCMHostUnregisterServiceExtension(m_hHgcmSvcExtShCl); 8995 m_hHgcmSvcExtShCl = NULL; 8996 } 8997 GuestShCl::destroyInstance(); 8998 #endif 8999 8950 9000 # ifdef VBOX_WITH_DRAG_AND_DROP 8951 9001 if (m_hHgcmSvcExtDragAndDrop) -
trunk/src/VBox/Main/src-client/ConsoleImplConfigX86.cpp
r99913 r100606 47 47 #include "DisplayImpl.h" 48 48 #include "NvramStoreImpl.h" 49 #ifdef VBOX_WITH_SHARED_CLIPBOARD 50 # include "GuestShClPrivate.h" 51 #endif 49 52 #ifdef VBOX_WITH_DRAG_AND_DROP 50 53 # include "GuestImpl.h" … … 3116 3119 AssertLogRelMsg(RT_SUCCESS(vrc), ("Shared Clipboard: Failed to set initial file transfers mode (%u): vrc=%Rrc\n", 3117 3120 fFileTransfersEnabled, vrc)); 3118 3119 /** @todo Register area callbacks? (See also deregistration todo in Console::i_powerDown.) */3120 3121 # endif 3122 GuestShCl::createInstance(this /* pConsole */); 3123 vrc = HGCMHostRegisterServiceExtension(&m_hHgcmSvcExtShCl, "VBoxSharedClipboard", 3124 &GuestShCl::hgcmDispatcher, 3125 GuestShClInst()); 3126 if (RT_FAILURE(vrc)) 3127 Log(("Cannot register VBoxSharedClipboard extension, vrc=%Rrc\n", vrc)); 3121 3128 } 3122 3129 else -
trunk/src/VBox/Main/src-client/ConsoleVRDPServer.cpp
r98278 r100606 32 32 #include "ConsoleImpl.h" 33 33 #include "DisplayImpl.h" 34 #ifdef VBOX_WITH_SHARED_CLIPBOARD 35 # include "GuestShClPrivate.h" /* For (un-)registering the service extension. */ 36 #endif 34 37 #include "KeyboardImpl.h" 35 38 #include "MouseImpl.h" … … 1346 1349 1347 1350 ConsoleVRDPServer::ConsoleVRDPServer(Console *console) 1348 : mhClipboard(NULL)1349 1351 { 1350 1352 mConsole = console; … … 3412 3414 if (mcClipboardRefs == 0) 3413 3415 { 3414 vrc = HGCMHostRegisterServiceExtension(&mhClipboard, "VBoxSharedClipboard", ClipboardServiceExtension, this); 3416 #ifdef VBOX_WITH_SHARED_CLIPBOARD 3417 vrc = GuestShClInst()->RegisterServiceExtension(ClipboardServiceExtension, this /* pvExtension */); 3415 3418 AssertRC(vrc); 3419 #endif /* VBOX_WITH_SHARED_CLIPBOARD */ 3416 3420 } 3417 3421 … … 3433 3437 mcClipboardRefs--; 3434 3438 3435 if (mcClipboardRefs == 0 && mhClipboard) 3436 { 3437 HGCMHostUnregisterServiceExtension(mhClipboard); 3438 mhClipboard = NULL; 3439 if (mcClipboardRefs == 0) 3440 { 3441 #ifdef VBOX_WITH_SHARED_CLIPBOARD 3442 GuestShClInst()->UnregisterServiceExtension(ClipboardServiceExtension); 3443 #endif /* VBOX_WITH_SHARED_CLIPBOARD */ 3439 3444 } 3440 3445 }
Note:
See TracChangeset
for help on using the changeset viewer.