VirtualBox

Changeset 93476 in vbox for trunk/src


Ignore:
Timestamp:
Jan 28, 2022 2:16:22 PM (3 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9371. Disable enable guest session dependent actions in th file manager menu.

Location:
trunk/src/VBox/Frontends/VirtualBox/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPool.cpp

    r93474 r93476  
    35603560    addAction(pMenu, action(UIActionIndex_M_FileManager_T_Operations));
    35613561    addAction(pMenu, action(UIActionIndex_M_FileManager_T_Log));
    3562     addAction(pMenu, action(UIActionIndex_M_FileManager_T_GuestSession));
    35633562
    35643563    addAction(pMenu, action(UIActionIndex_M_FileManager_M_HostSubmenu));
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManager.cpp

    r93180 r93476  
    488488        pTable->setIsCurrent(pTable == pCurrentGuestTable);
    489489    }
     490    /* Disable host file table if guest session is not running: */
    490491    if (m_pHostFileTable)
    491492        m_pHostFileTable->setEnabled(pCurrentGuestTable->isGuestSessionRunning());
     493    /* Disable/enable file table submenus of the menu: */
     494    UIMenu *pGuestSubmenu = m_pActionPool->action(UIActionIndex_M_FileManager_M_GuestSubmenu)->menu();
     495    if (pGuestSubmenu)
     496        pGuestSubmenu->setEnabled(pCurrentGuestTable->isGuestSessionRunning());
     497    UIMenu *pHostSubmenu = m_pActionPool->action(UIActionIndex_M_FileManager_M_HostSubmenu)->menu();
     498    if (pHostSubmenu)
     499        pHostSubmenu->setEnabled(pCurrentGuestTable->isGuestSessionRunning());
    492500}
    493501
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManagerGuestTable.cpp

    r93473 r93476  
    13911391void UIFileManagerGuestTable::setSessionDependentWidgetsEnabled()
    13921392{
    1393     switch (m_enmState)
    1394     {
    1395         case State_InvalidMachineReference:
    1396         case State_MachineNotRunning:
    1397         case State_NoGuestAdditions:
    1398             setSessionWidgetsEnabled(false);
    1399             m_pWarningLabelContainer->setVisible(true);
    1400             if (m_pGuestSessionPanel)
    1401             {
    1402                 m_pGuestSessionPanel->setEnabled(false);
    1403                 m_pGuestSessionPanel->switchSessionCreateMode();
    1404             }
    1405             break;
    1406         case State_SessionPossible:
    1407             setSessionWidgetsEnabled(false);
    1408             m_pWarningLabelContainer->setVisible(true);
    1409             if (m_pGuestSessionPanel)
    1410             {
    1411                 m_pGuestSessionPanel->setEnabled(true);
    1412                 m_pGuestSessionPanel->switchSessionCreateMode();
    1413             }
    1414             break;
    1415         case State_SessionRunning:
    1416             setSessionWidgetsEnabled(true);
    1417             m_pWarningLabelContainer->setVisible(false);
    1418             if (m_pGuestSessionPanel)
    1419             {
    1420                 m_pGuestSessionPanel->switchSessionCloseMode();
    1421                 m_pGuestSessionPanel->setEnabled(true);
    1422             }
    1423             break;
    1424         default:
    1425             break;
    1426     }
     1393    /* Disable menu actions if guest session is not running: */
     1394    UIMenu *pGuestSubmenu = m_pActionPool->action(UIActionIndex_M_FileManager_M_GuestSubmenu)->menu();
     1395    if (pGuestSubmenu)
     1396        pGuestSubmenu->setEnabled(m_enmState == State_SessionRunning);
     1397    UIMenu *pHostSubmenu = m_pActionPool->action(UIActionIndex_M_FileManager_M_HostSubmenu)->menu();
     1398    if (pHostSubmenu)
     1399        pHostSubmenu->setEnabled(m_enmState == State_SessionRunning);
     1400
     1401    /*Manage the guest session (login) widget: */
     1402    if (m_pGuestSessionPanel)
     1403    {
     1404        m_pGuestSessionPanel->setEnabled(m_enmState == State_SessionPossible || m_enmState == State_SessionRunning);
     1405        if (m_enmState == State_SessionRunning)
     1406            m_pGuestSessionPanel->switchSessionCreateMode();
     1407        else
     1408            m_pGuestSessionPanel->switchSessionCloseMode();
     1409    }
     1410    /* Call to parent: */
     1411    setSessionWidgetsEnabled(m_enmState == State_SessionRunning);
     1412
     1413    if (m_pWarningLabelContainer)
     1414        m_pWarningLabelContainer->setVisible(m_enmState != State_SessionRunning);
     1415
    14271416    emit sigStateChanged(m_enmState == State_SessionRunning);
    14281417}
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