VirtualBox

Changeset 92814 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Dec 8, 2021 1:57:05 PM (3 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9371. More fixes foron the session management stuff.

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

Legend:

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

    r92790 r92814  
    145145{
    146146    UIFileManagerOptions::destroy();
     147    if (m_pGuestTablesContainer)
     148    {
     149        for (int i = 0; i < m_pGuestTablesContainer->count(); ++i)
     150        {
     151            UIFileManagerGuestTable *pTable = qobject_cast<UIFileManagerGuestTable*>(m_pGuestTablesContainer->widget(i));
     152            if (pTable)
     153                pTable->disconnect();
     154        }
     155    }
    147156}
    148157
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManagerDialog.cpp

    r92753 r92814  
    3131#endif
    3232
     33/* COM includes: */
     34#include "COMEnums.h"
     35#include "CMachine.h"
    3336
    3437/*********************************************************************************************************************************
     
    3639*********************************************************************************************************************************/
    3740
    38 UIFileManagerDialogFactory::UIFileManagerDialogFactory(UIActionPool *pActionPool, const CMachine &comMachine)
     41UIFileManagerDialogFactory::UIFileManagerDialogFactory(UIActionPool *pActionPool, const QUuid &uMachineId, const QString &strMachineName)
    3942    : m_pActionPool(pActionPool)
    40     , m_comMachine(comMachine)
     43    , m_uMachineId(uMachineId)
     44    , m_strMachineName(strMachineName)
    4145{
    4246}
     
    4549UIFileManagerDialogFactory::UIFileManagerDialogFactory()
    4650    : m_pActionPool(0)
    47     , m_comMachine(CMachine())
     51    , m_uMachineId(QUuid())
    4852{
    4953}
     
    5155void UIFileManagerDialogFactory::create(QIManagerDialog *&pDialog, QWidget *pCenterWidget)
    5256{
    53     pDialog = new UIFileManagerDialog(pCenterWidget, m_pActionPool, m_comMachine);
     57    pDialog = new UIFileManagerDialog(pCenterWidget, m_pActionPool, m_uMachineId, m_strMachineName);
    5458}
    5559
     
    6165UIFileManagerDialog::UIFileManagerDialog(QWidget *pCenterWidget,
    6266                                         UIActionPool *pActionPool,
    63                                          const CMachine &comMachine)
     67                                         const QUuid &uMachineId,
     68                                         const QString &strMachineName)
    6469    : QIWithRetranslateUI<QIManagerDialog>(pCenterWidget)
    6570    , m_pActionPool(pActionPool)
    66     , m_comMachine(comMachine)
     71    , m_uMachineId(uMachineId)
     72    , m_strMachineName(strMachineName)
    6773{
    6874}
     
    7480void UIFileManagerDialog::retranslateUi()
    7581{
    76     if (!m_comMachine.isNull())
    77         setWindowTitle(UIFileManager::tr("%1 - File Manager").arg(m_comMachine.GetName()));
     82    if (!m_strMachineName.isEmpty())
     83        setWindowTitle(UIFileManager::tr("%1 - File Manager").arg(m_strMachineName));
    7884    else
    7985        setWindowTitle(UIFileManager::tr("File Manager"));
     
    105111void UIFileManagerDialog::configureCentralWidget()
    106112{
     113    CMachine comMachine;
     114    CVirtualBox vbox = uiCommon().virtualBox();
     115    if (!vbox.isNull() && !m_uMachineId.isNull())
     116        comMachine = vbox.FindMachine(m_uMachineId.toString());
    107117    /* Create widget: */
    108118    UIFileManager *pWidget = new UIFileManager(EmbedTo_Dialog, m_pActionPool,
    109                                                m_comMachine, this, true);
     119                                               comMachine, this, true);
    110120
    111121    if (pWidget)
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManagerDialog.h

    r92638 r92814  
    2929#include "QIWithRetranslateUI.h"
    3030
    31 /* COM includes: */
    32 #include "COMEnums.h"
    33 #include "CMachine.h"
     31
    3432
    3533/* Forward declarations: */
     
    3836class UIActionPool;
    3937class UIFileManagerDialog;
    40 class CMachine;
    4138
    4239
     
    4643public:
    4744
    48     UIFileManagerDialogFactory(UIActionPool *pActionPool, const CMachine &comMachine);
     45    UIFileManagerDialogFactory(UIActionPool *pActionPool, const QUuid &uMachineId, const QString &strMachineName);
    4946    UIFileManagerDialogFactory();
    5047
     
    5653
    5754    UIActionPool *m_pActionPool;
    58     CMachine      m_comMachine;
     55    QUuid      m_uMachineId;
     56    QString    m_strMachineName;
    5957};
    6058
     
    6967      * @param  pCenterWidget  Passes the widget reference to center according to.
    7068      * @param  pActionPool    Passes the action-pool reference.
    71       * @param  comMachine     Passes the machine reference. */
    72     UIFileManagerDialog(QWidget *pCenterWidget, UIActionPool *pActionPool, const CMachine &comMachine);
     69      * @param  uMachineId     Passes the machine id. */
     70    UIFileManagerDialog(QWidget *pCenterWidget, UIActionPool *pActionPool, const QUuid &uMachineId, const QString &strMachineName);
    7371    ~UIFileManagerDialog();
    7472
     
    110108    void manageEscapeShortCut();
    111109    UIActionPool *m_pActionPool;
    112     CMachine    m_comMachine;
     110    QUuid    m_uMachineId;
     111    QString  m_strMachineName;
    113112};
    114113
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManagerGuestTable.cpp

    r92790 r92814  
    178178}
    179179
     180UIFileManagerGuestTable::~UIFileManagerGuestTable()
     181{
     182    cleanAll();
     183}
     184
    180185void UIFileManagerGuestTable::initFileTable()
    181186{
     
    201206                break;
    202207            case CheckMachine_MachineNotRunning:
    203                 strWarningText = UIFileManager::tr("Guest system is not running. File manager work only on running guests.");
     208                strWarningText = UIFileManager::tr("File manager cannot work since it works only with running guests.");
    204209                break;
    205210            case CheckMachine_NoGuestAdditions:
    206                 strWarningText = UIFileManager::tr("No guest additions is found on the guest system. File manager needs guest additions to function correctly.");
     211                strWarningText = UIFileManager::tr("File manager cannot work since it needs running guest additions in the guest system.");
    207212                break;
    208213            case CheckMachine_SessionPossible:
     
    853858void UIFileManagerGuestTable::sltHandleGuestSessionPanelHidden()
    854859{
     860    return;
    855861    if (m_pActionPool && m_pActionPool->action(UIActionIndex_M_FileManager_T_GuestSession))
    856862        m_pActionPool->action(UIActionIndex_M_FileManager_T_GuestSession)->setChecked(false);
     
    870876    if (enmMachineState == KMachineState_Running)
    871877        openMachineSession();
     878    else if (enmMachineState == KMachineState_Paused)
     879        return;
    872880    else
    873     {
    874881        cleanAll();
    875     }
    876882
    877883    setSessionDependentWidgetsEnabled(isSessionPossible());
     
    881887bool UIFileManagerGuestTable::closeMachineSession()
    882888{
    883     if (!m_comSession.isNull())
    884         m_comSession.UnlockMachine();
    885 
    886889    if (!m_comGuest.isNull())
    887890        m_comGuest.detach();
    888891
    889     if (!m_comSession.isNull())
    890         m_comSession.detach();
    891892    if (!m_comConsole.isNull())
    892893        m_comConsole.detach();
    893894
     895    if (!m_comSession.isNull())
     896    {
     897        m_comSession.UnlockMachine();
     898        m_comSession.detach();
     899    }
    894900    return true;
    895901}
     
    957963    if (!m_pQtGuestListener.isNull())
    958964    {
    959         disconnect(m_pQtGuestListener->getWrapped(), &UIMainEventListener::sigGuestSessionUnregistered,
    960                    this, &UIFileManagerGuestTable::sltGuestSessionUnregistered);
    961         disconnect(m_pQtGuestListener->getWrapped(), &UIMainEventListener::sigGuestSessionRegistered,
    962                    this, &UIFileManagerGuestTable::sltGuestSessionRegistered);
     965        m_pQtGuestListener->getWrapped()->disconnect();
    963966        if (!m_comGuest.isNull())
    964967            cleanupListener(m_pQtGuestListener, m_comGuestListener, m_comGuest.GetEventSource());
     
    970973    if (!m_pQtSessionListener.isNull())
    971974    {
    972         disconnect(m_pQtSessionListener->getWrapped(), &UIMainEventListener::sigGuestSessionStatedChanged,
    973                    this, &UIFileManagerGuestTable::sltGuestSessionStateChanged);
     975        m_pQtSessionListener->getWrapped()->disconnect();
    974976        if (!m_comGuestSession.isNull())
    975977            cleanupListener(m_pQtSessionListener, m_comSessionListener, m_comGuestSession.GetEventSource());
     
    981983    if (!m_pQtConsoleListener.isNull())
    982984    {
    983         disconnect(m_pQtConsoleListener->getWrapped(), &UIMainEventListener::sigAdditionsChange,
    984                    this, &UIFileManagerGuestTable::sltAdditionsStateChange);
     985        m_pQtConsoleListener->getWrapped()->disconnect();
    985986        if (!m_comConsole.isNull())
    986987            cleanupListener(m_pQtConsoleListener, m_comConsoleListener, m_comConsole.GetEventSource());
     
    11781179void UIFileManagerGuestTable::closeGuestSession()
    11791180{
    1180 
    11811181    if (!m_comGuestSession.isNull())
    11821182    {
    11831183        m_comGuestSession.Close();
    11841184        m_comGuestSession.detach();
     1185        emit sigLogOutput("Guest session is closed", m_strTableName, FileManagerLogType_Info);
    11851186    }
    11861187    reset();
    1187     emit sigLogOutput("Guest session is closed", m_strTableName, FileManagerLogType_Info);
    11881188    postGuestSessionClosed();
    11891189}
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManagerGuestTable.h

    r92790 r92814  
    5959
    6060    UIFileManagerGuestTable(UIActionPool *pActionPool, const CMachine &comMachine, QWidget *pParent = 0);
     61    ~UIFileManagerGuestTable();
    6162    void copyGuestToHost(const QString& hostDestinationPath);
    6263    void copyHostToGuest(const QStringList &hostSourcePathList,
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp

    r92744 r92814  
    17811781
    17821782    QIManagerDialog *pFileManagerDialog;
    1783     UIFileManagerDialogFactory dialogFactory(actionPool(), machine());
     1783    UIFileManagerDialogFactory dialogFactory(actionPool(), machine().GetId(), machine().GetName());
    17841784    dialogFactory.prepare(pFileManagerDialog, activeMachineWindow());
    17851785    if (pFileManagerDialog)
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