Changeset 92640 in vbox for trunk/src/VBox
- Timestamp:
- Nov 30, 2021 8:40:16 AM (3 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManager.cpp
r92638 r92640 144 144 { 145 145 UIFileManagerOptions::destroy(); 146 } 147 148 void UIFileManager::setMachine(const QUuid &machineId) 149 { 150 m_comMachine = uiCommon().virtualBox().FindMachine(machineId.toString()); 146 151 } 147 152 … … 288 293 { 289 294 m_pVerticalToolBar = new QIToolBar; 290 if (!m_pVerticalToolBar )295 if (!m_pVerticalToolBar && !m_pActionPool) 291 296 return; 292 297 … … 307 312 m_pVerticalToolBar->addWidget(bottomSpacerWidget); 308 313 309 connect(m_pActionPool->action(UIActionIndex_M_FileManager_S_CopyToHost), &QAction::triggered,310 this, &UIFileManager::sltCopyGuestToHost);311 connect(m_pActionPool->action(UIActionIndex_M_FileManager_S_CopyToGuest), &QAction::triggered,312 this, &UIFileManager::sltCopyHostToGuest);313 314 314 layout ->addWidget(m_pVerticalToolBar); 315 315 } … … 317 317 void UIFileManager::prepareConnections() 318 318 { 319 if (m_pActionPool) 320 { 321 if (m_pActionPool->action(UIActionIndex_M_FileManager_T_Options)) 322 connect(m_pActionPool->action(UIActionIndex_M_FileManager_T_Options), &QAction::toggled, 323 this, &UIFileManager::sltPanelActionToggled); 324 if (m_pActionPool->action(UIActionIndex_M_FileManager_T_Log)) 325 connect(m_pActionPool->action(UIActionIndex_M_FileManager_T_Log), &QAction::toggled, 326 this, &UIFileManager::sltPanelActionToggled); 327 if (m_pActionPool->action(UIActionIndex_M_FileManager_T_GuestSession)) 328 connect(m_pActionPool->action(UIActionIndex_M_FileManager_T_GuestSession), &QAction::toggled, 329 this, &UIFileManager::sltPanelActionToggled); 330 if (m_pActionPool->action(UIActionIndex_M_FileManager_T_Operations)) 331 connect(m_pActionPool->action(UIActionIndex_M_FileManager_T_Operations), &QAction::toggled, 332 this, &UIFileManager::sltPanelActionToggled); 333 if (m_pActionPool->action(UIActionIndex_M_FileManager_S_CopyToHost)) 334 connect(m_pActionPool->action(UIActionIndex_M_FileManager_S_CopyToHost), &QAction::triggered, 335 this, &UIFileManager::sltCopyGuestToHost); 336 if (m_pActionPool->action(UIActionIndex_M_FileManager_S_CopyToGuest)) 337 connect(m_pActionPool->action(UIActionIndex_M_FileManager_S_CopyToGuest), &QAction::triggered, 338 this, &UIFileManager::sltCopyHostToGuest); 339 } 319 340 320 341 if (m_pGuestSessionPanel) … … 355 376 m_pToolBar->addAction(m_pActionPool->action(UIActionIndex_M_FileManager_T_Operations)); 356 377 m_pToolBar->addAction(m_pActionPool->action(UIActionIndex_M_FileManager_T_Log)); 357 358 connect(m_pActionPool->action(UIActionIndex_M_FileManager_T_Options), &QAction::toggled,359 this, &UIFileManager::sltPanelActionToggled);360 connect(m_pActionPool->action(UIActionIndex_M_FileManager_T_Log), &QAction::toggled,361 this, &UIFileManager::sltPanelActionToggled);362 connect(m_pActionPool->action(UIActionIndex_M_FileManager_T_GuestSession), &QAction::toggled,363 this, &UIFileManager::sltPanelActionToggled);364 connect(m_pActionPool->action(UIActionIndex_M_FileManager_T_Operations), &QAction::toggled,365 this, &UIFileManager::sltPanelActionToggled);366 378 367 379 #ifdef VBOX_WS_MAC … … 583 595 bool UIFileManager::openSession(const QString& strUserName, const QString& strPassword) 584 596 { 585 AssertReturn(!m_comMachine.isNull(), false); 597 if (m_comMachine.isNull()) 598 { 599 appendLog("Invalid machine reference", FileManagerLogType_Error); 600 return false; 601 } 586 602 m_comSession = uiCommon().openSession(m_comMachine.GetId(), KLockType_Shared); 587 AssertReturn(!m_comSession.isNull(), false); 603 if (!m_comSession.isNull()) 604 { 605 appendLog("Could not open machine session", FileManagerLogType_Error); 606 return false; 607 } 588 608 589 609 CConsole comConsole = m_comSession.GetConsole(); -
trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManager.h
r92638 r92640 104 104 QIToolBar *toolbar() const { return m_pToolBar; } 105 105 #endif 106 107 void setMachine(const QUuid &machineId); 106 108 107 109 protected: -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIToolPaneMachine.cpp
r92638 r92640 316 316 m_pPaneVMActivityMonitor->setSelectedVMListItems(m_items); 317 317 } 318 if (isToolOpened(UIToolType_FileManager)) 319 { 320 AssertPtrReturnVoid(m_pPaneFileManager); 321 if (!m_items.isEmpty() && m_items[0]) 322 m_pPaneFileManager->setMachine(m_items[0]->id()); 323 } 318 324 } 319 325 -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManagerWidget.cpp
r92487 r92640 966 966 break; 967 967 } 968 case UIToolType_FileManager: 969 { 970 m_pToolBar->addAction(m_pActionPool->action(UIActionIndex_M_FileManager_T_GuestSession)); 971 m_pToolBar->addAction(m_pActionPool->action(UIActionIndex_M_FileManager_T_Options)); 972 m_pToolBar->addAction(m_pActionPool->action(UIActionIndex_M_FileManager_T_Operations)); 973 m_pToolBar->addAction(m_pActionPool->action(UIActionIndex_M_FileManager_T_Log)); 974 m_pToolBar->addSeparator(); 975 m_pToolBar->addAction(actionPool()->action(UIActionIndexMN_M_Machine_S_Settings)); 976 m_pToolBar->addAction(actionPool()->action(UIActionIndexMN_M_Machine_S_Discard)); 977 m_pToolBar->addAction(actionPool()->action(UIActionIndexMN_M_Machine_M_StartOrShow)); 978 break; 979 } 968 980 case UIToolType_Error: 969 981 {
Note:
See TracChangeset
for help on using the changeset viewer.