- Timestamp:
- Dec 14, 2021 2:55:00 PM (3 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/guestctrl
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManager.cpp
r92847 r92899 257 257 258 258 m_pVerticalToolBar->setOrientation(Qt::Vertical); 259 m_pVerticalToolBar->setEnabled(false);260 259 261 260 /* Add to dummy QWidget to toolbar to center the action icons vertically: */ … … 268 267 269 268 m_pVerticalToolBar->addWidget(topSpacerWidget); 270 m_pVerticalToolBar->addAction(m_pActionPool->action(UIActionIndex_M_FileManager_S_CopyToHost)); 271 m_pVerticalToolBar->addAction(m_pActionPool->action(UIActionIndex_M_FileManager_S_CopyToGuest)); 269 if (m_pActionPool->action(UIActionIndex_M_FileManager_S_CopyToHost)) 270 { 271 m_pVerticalToolBar->addAction(m_pActionPool->action(UIActionIndex_M_FileManager_S_CopyToHost)); 272 m_pActionPool->action(UIActionIndex_M_FileManager_S_CopyToHost)->setEnabled(false); 273 } 274 if (m_pActionPool->action(UIActionIndex_M_FileManager_S_CopyToGuest)) 275 { 276 m_pVerticalToolBar->addAction(m_pActionPool->action(UIActionIndex_M_FileManager_S_CopyToGuest)); 277 m_pActionPool->action(UIActionIndex_M_FileManager_S_CopyToGuest)->setEnabled(false); 278 } 279 272 280 m_pVerticalToolBar->addWidget(bottomSpacerWidget); 273 281 … … 315 323 connect(m_pHostFileTable, &UIFileManagerHostTable::sigDeleteConfirmationOptionChanged, 316 324 this, &UIFileManager::sltHandleOptionsUpdated); 325 connect(m_pHostFileTable, &UIFileManagerGuestTable::sigSelectionChanged, 326 this, &UIFileManager::sltFileTableSelectionChanged); 317 327 } 318 328 connect(&uiCommon(), &UICommon::sigAskToCommitData, … … 431 441 } 432 442 443 void UIFileManager::sltFileTableSelectionChanged(bool fHasSelection) 444 { 445 /* Enable/disable vertical toolbar actions: */ 446 UIFileManagerGuestTable *pGuestTable = qobject_cast<UIFileManagerGuestTable*>(sender()); 447 448 if (pGuestTable) 449 { 450 if (m_pActionPool->action(UIActionIndex_M_FileManager_S_CopyToHost)) 451 m_pActionPool->action(UIActionIndex_M_FileManager_S_CopyToHost)->setEnabled(fHasSelection); 452 return; 453 } 454 455 if (sender() == m_pHostFileTable) 456 { 457 if (m_pActionPool->action(UIActionIndex_M_FileManager_S_CopyToGuest)) 458 m_pActionPool->action(UIActionIndex_M_FileManager_S_CopyToGuest)->setEnabled(fHasSelection); 459 } 460 } 461 433 462 void UIFileManager::copyToHost() 434 463 { … … 691 720 connect(pGuestFileTable, &UIFileManagerGuestTable::sigLogOutput, 692 721 this, &UIFileManager::sltReceieveLogOutput); 722 connect(pGuestFileTable, &UIFileManagerGuestTable::sigSelectionChanged, 723 this, &UIFileManager::sltFileTableSelectionChanged); 724 693 725 // connect(m_pGuestFileTable, &UIFileManagerGuestTable::sigNewFileOperation, 694 726 // this, &UIFileManager::sltReceieveNewFileOperation); -
trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManager.h
r92790 r92899 114 114 void sltHandleHidePanel(UIDialogPanel *pPanel); 115 115 void sltCommitDataSignalReceived(); 116 void sltFileTableSelectionChanged(bool fHasSelection); 116 117 117 118 private: -
trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManagerTable.cpp
r92860 r92899 1444 1444 foreach (QAction *pAction, m_selectionDependentActions) 1445 1445 pAction->setEnabled(fIsEnabled); 1446 if (m_pView) 1447 emit sigSelectionChanged(m_pView->hasSelection()); 1446 1448 } 1447 1449 -
trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManagerTable.h
r92860 r92899 138 138 void sigLogOutput(QString strLog, const QString &strMachineName, FileManagerLogType eLogType); 139 139 void sigDeleteConfirmationOptionChanged(); 140 void sigSelectionChanged(bool fHasSelection); 140 141 141 142 public:
Note:
See TracChangeset
for help on using the changeset viewer.