VirtualBox

Changeset 92753 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Dec 6, 2021 8:51:01 AM (3 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9371. Some changes to cleanup stuff.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/guestctrl
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManager.cpp

    r92741 r92753  
    129129    , m_pLogPanel(0)
    130130    , m_pOperationsPanel(0)
    131     , m_fDialogBeingClosed(false)
    132131{
    133132    loadOptions();
     
    146145{
    147146    UIFileManagerOptions::destroy();
    148 }
    149 
    150 void UIFileManager::setDialogBeingClosed(bool fFlag)
    151 {
    152     m_fDialogBeingClosed = fFlag;
    153147}
    154148
     
    610604void UIFileManager::savePanelVisibility()
    611605{
    612     if (m_fDialogBeingClosed)
    613         return;
    614606    /* Save a list of currently visible panels: */
    615607    QStringList strNameList;
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManager.h

    r92733 r92753  
    9292    QMenu *menu() const;
    9393
    94     void setDialogBeingClosed(bool fFlag);
    95 
    9694#ifdef VBOX_WS_MAC
    9795    /** Returns the toolbar. */
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManagerDialog.cpp

    r92638 r92753  
    7070UIFileManagerDialog::~UIFileManagerDialog()
    7171{
    72     UIFileManager *pWidget = qobject_cast<UIFileManager*>(widget());
    73     if (pWidget)
    74         pWidget->setDialogBeingClosed(true);
    7572}
    7673
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManagerGuestTable.cpp

    r92741 r92753  
    151151}
    152152
    153 #include <QPushButton>
    154153UIFileManagerGuestTable::UIFileManagerGuestTable(UIActionPool *pActionPool, const CMachine &comMachine, QWidget *pParent /*= 0*/)
    155154    :UIFileManagerTable(pActionPool, pParent)
     
    757756            connect(m_pGuestSessionPanel, &UIFileManagerGuestSessionPanel::sigCreateSession,
    758757                    this, &UIFileManagerGuestTable::sltCreateGuestSession);
    759             // connect(m_pGuestSessionPanel, &UIFileManagerGuestSessionPanel::sigCloseSession,
    760             //         this, &UIFileManagerGuestTable::sltCloseGuestSession);
     758            connect(m_pGuestSessionPanel, &UIFileManagerGuestSessionPanel::sigCloseSession,
     759                    this, &UIFileManagerGuestTable::sltHandleCloseSessionRequest);
    761760            connect(m_pGuestSessionPanel, &UIFileManagerGuestSessionPanel::sigHidePanel,
    762761                    this, &UIFileManagerGuestTable::sltHandleGuestSessionPanelHidden);
     
    906905}
    907906
     907void UIFileManagerGuestTable::cleanupSessionListener()
     908{
     909    disconnect(m_pQtSessionListener->getWrapped(), &UIMainEventListener::sigGuestSessionStatedChanged,
     910            this, &UIFileManagerGuestTable::sltGuestSessionStateChanged);
     911    cleanupListener(m_pQtSessionListener, m_comSessionListener, m_comGuest.GetEventSource());
     912}
    908913
    909914void UIFileManagerGuestTable::postGuestSessionCreated()
     
    10151020}
    10161021
     1022bool UIFileManagerGuestTable::isGuestSessionPossible()
     1023{
     1024    if (m_comMachine.isNull())
     1025        return false;
     1026    if (m_comMachine.GetState() != KMachineState_Running)
     1027        return false;
     1028    if (!checkGuestSession())
     1029        return false;
     1030    return true;
     1031}
     1032
     1033void UIFileManagerGuestTable::sltHandleCloseSessionRequest()
     1034{
     1035}
     1036
     1037
    10171038/*////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/
    10181039/*////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManagerGuestTable.h

    r92741 r92753  
    9090    void sltHandleGuestSessionPanelHidden();
    9191    void sltHandleGuestSessionPanelShown();
    92 
    9392    void sltGuestSessionUnregistered(CGuestSession guestSession);
    9493    void sltGuestSessionRegistered(CGuestSession guestSession);
    9594    void sltGuestSessionStateChanged(const CGuestSessionStateChangedEvent &cEvent);
    9695    void sltCreateGuestSession(QString strUserName, QString strPassword);
     96    void sltHandleCloseSessionRequest();
    9797
    9898private:
     
    114114                         CEventSource comEventSource);
    115115    void cleanupGuestListener();
     116    void cleanupSessionListener();
    116117
    117118    void prepareGuestSessionPanel();
     
    127128
    128129    void initFileTable();
     130    /** Returns false if it is not possible to open a guest session on the machine.
     131      * That is if machine is not running, or does not have guest additions etc. */
     132    bool isGuestSessionPossible();
    129133
    130134    CGuest                    m_comGuest;
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