Changeset 101719 in vbox
- Timestamp:
- Nov 2, 2023 3:13:38 PM (13 months ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.cpp
r100606 r101719 757 757 { 758 758 return uisession()->setClipboardMode(enmMode); 759 } 760 761 bool UIMachine::toggleClipboardFileTransfer(bool fEnabled) 762 { 763 return uisession()->toggleClipboardFileTransfer(fEnabled); 764 } 765 766 bool UIMachine::isClipboardFileTransferEnabled() 767 { 768 return uisession()->isClipboardFileTransferEnabled(); 759 769 } 760 770 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.h
r100606 r101719 516 516 /** Defines clipboard mode. */ 517 517 bool setClipboardMode(KClipboardMode enmMode); 518 /** En/disables guest clipboard file transfers. */ 519 bool toggleClipboardFileTransfer(bool fEnabled); 520 /** Returns true if clipboard file transfer is enabled. Returns false otherwise or in case of an error. */ 521 bool isClipboardFileTransferEnabled(); 518 522 519 523 /** Acquires D&D mode. */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp
r101035 r101719 765 765 , m_pRunningOrPausedOrStuckActions(0) 766 766 , m_pSharedClipboardActions(0) 767 , m_pFileTransferToggleAction(0) 767 768 , m_pDragAndDropActions(0) 768 769 , m_fIsWindowsCreated(false) … … 2287 2288 } 2288 2289 2290 void UIMachineLogic::sltFileTransferToggled(bool fChecked) 2291 { 2292 uimachine()->toggleClipboardFileTransfer(fChecked); 2293 } 2294 2289 2295 void UIMachineLogic::sltToggleNetworkAdapterConnection(bool fChecked) 2290 2296 { … … 2835 2841 /* Connect action-group trigger: */ 2836 2842 connect(m_pSharedClipboardActions, &QActionGroup::triggered, this, &UIMachineLogic::sltChangeSharedClipboardType); 2843 m_pFileTransferToggleAction = new QAction(QApplication::translate("UIActionPool", "Enable clipboard file transfers")); 2844 m_pFileTransferToggleAction->setCheckable(true); 2845 m_pFileTransferToggleAction->setChecked(uimachine()->isClipboardFileTransferEnabled()); 2846 /* pMenu takes the ownership of the m_pFileTransferToggleAction. */ 2847 pMenu->addAction(m_pFileTransferToggleAction); 2848 connect(m_pFileTransferToggleAction, &QAction::toggled, this, &UIMachineLogic::sltFileTransferToggled); 2837 2849 } 2838 2850 /* Subsequent runs: */ 2839 2851 else 2852 { 2853 if (m_pFileTransferToggleAction) 2854 { 2855 m_pFileTransferToggleAction->blockSignals(true); 2856 m_pFileTransferToggleAction->setChecked(uimachine()->isClipboardFileTransferEnabled()); 2857 m_pFileTransferToggleAction->blockSignals(false); 2858 } 2840 2859 foreach (QAction *pAction, m_pSharedClipboardActions->actions()) 2841 2860 if (pAction->data().value<KClipboardMode>() == enmCurrentMode) 2842 2861 pAction->setChecked(true); 2862 } 2843 2863 } 2844 2864 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.h
r100064 r101719 287 287 void sltAttachWebcamDevice(); 288 288 void sltChangeSharedClipboardType(QAction *pAction); 289 void sltFileTransferToggled(bool fChecked); 289 290 void sltToggleNetworkAdapterConnection(bool fChecked); 290 291 void sltChangeDragAndDropType(QAction *pAction); … … 375 376 QActionGroup *m_pRunningOrPausedOrStuckActions; 376 377 QActionGroup *m_pSharedClipboardActions; 378 QAction *m_pFileTransferToggleAction; 377 379 QActionGroup *m_pDragAndDropActions; 378 380 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp
r101316 r101719 604 604 UINotificationMessage::cannotAcquireMachineParameter(comMachine); 605 605 return fSuccess; 606 } 607 608 bool UISession::toggleClipboardFileTransfer(bool fEnabled) 609 { 610 CMachine comMachine = machine(); 611 comMachine.SetClipboardFileTransfersEnabled(fEnabled); 612 const bool fSuccess = comMachine.isOk(); 613 if (!fSuccess) 614 UINotificationMessage::cannotAcquireMachineParameter(comMachine); 615 return fSuccess; 616 } 617 618 bool UISession::isClipboardFileTransferEnabled() 619 { 620 CMachine comMachine = machine(); 621 bool fEnabled = comMachine.GetClipboardFileTransfersEnabled(); 622 const bool fSuccess = comMachine.isOk(); 623 if (!fSuccess) 624 { 625 UINotificationMessage::cannotAcquireMachineParameter(comMachine); 626 return false; 627 } 628 return fEnabled; 606 629 } 607 630 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h
r100606 r101719 315 315 /** Defines clipboard mode. */ 316 316 bool setClipboardMode(KClipboardMode enmMode); 317 /** En/disables guest clipboard file transfers. */ 318 bool toggleClipboardFileTransfer(bool fEnabled); 319 /** Returns true if clipboard file transfer is enabled. Returns false otherwise or in case of an error. */ 320 bool isClipboardFileTransferEnabled(); 317 321 318 322 /** Acquires D&D mode. */
Note:
See TracChangeset
for help on using the changeset viewer.