VirtualBox

Changeset 92640 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Nov 30, 2021 8:40:16 AM (3 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9371. Appending file manager toolbar to manager UI's toolbar.

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  
    144144{
    145145    UIFileManagerOptions::destroy();
     146}
     147
     148void UIFileManager::setMachine(const QUuid &machineId)
     149{
     150    m_comMachine = uiCommon().virtualBox().FindMachine(machineId.toString());
    146151}
    147152
     
    288293{
    289294    m_pVerticalToolBar = new QIToolBar;
    290     if (!m_pVerticalToolBar)
     295    if (!m_pVerticalToolBar && !m_pActionPool)
    291296        return;
    292297
     
    307312    m_pVerticalToolBar->addWidget(bottomSpacerWidget);
    308313
    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 
    314314    layout ->addWidget(m_pVerticalToolBar);
    315315}
     
    317317void UIFileManager::prepareConnections()
    318318{
     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    }
    319340
    320341    if (m_pGuestSessionPanel)
     
    355376        m_pToolBar->addAction(m_pActionPool->action(UIActionIndex_M_FileManager_T_Operations));
    356377        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);
    366378
    367379#ifdef VBOX_WS_MAC
     
    583595bool UIFileManager::openSession(const QString& strUserName, const QString& strPassword)
    584596{
    585     AssertReturn(!m_comMachine.isNull(), false);
     597    if (m_comMachine.isNull())
     598    {
     599        appendLog("Invalid machine reference", FileManagerLogType_Error);
     600        return false;
     601    }
    586602    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    }
    588608
    589609    CConsole comConsole = m_comSession.GetConsole();
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManager.h

    r92638 r92640  
    104104    QIToolBar *toolbar() const { return m_pToolBar; }
    105105#endif
     106
     107    void setMachine(const QUuid &machineId);
    106108
    107109protected:
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIToolPaneMachine.cpp

    r92638 r92640  
    316316        m_pPaneVMActivityMonitor->setSelectedVMListItems(m_items);
    317317    }
     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    }
    318324}
    319325
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManagerWidget.cpp

    r92487 r92640  
    966966                    break;
    967967                }
     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                }
    968980                case UIToolType_Error:
    969981                {
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette