VirtualBox

Changeset 92616 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Nov 28, 2021 5:45:25 PM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
148508
Message:

FE/Qt: bugref:9371. Some renaming.

Location:
trunk/src/VBox/Frontends/VirtualBox
Files:
5 edited
2 moved

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk

    r92082 r92616  
    722722        src/guestctrl/UIFileManagerOperationsPanel.h \
    723723        src/guestctrl/UIFileManagerOptionsPanel.h \
    724         src/guestctrl/UIFileManagerSessionPanel.h \
     724        src/guestctrl/UIFileManagerGuestSessionPanel.h \
    725725        src/guestctrl/UIFileManagerTable.h \
    726726        src/guestctrl/UIGuestControlConsole.h \
     
    990990        src/guestctrl/UIFileManagerLogPanel.cpp \
    991991        src/guestctrl/UIFileManagerOperationsPanel.cpp \
    992         src/guestctrl/UIFileManagerSessionPanel.cpp \
     992        src/guestctrl/UIFileManagerGuestSessionPanel.cpp \
    993993        src/guestctrl/UIFileManagerTable.cpp \
    994994        src/guestctrl/UIFileManagerGuestTable.cpp \
     
    12431243        src/guestctrl/UIFileManagerOperationsPanel.cpp \
    12441244        src/guestctrl/UIFileManagerOptionsPanel.cpp \
    1245         src/guestctrl/UIFileManagerSessionPanel.cpp \
     1245        src/guestctrl/UIFileManagerGuestSessionPanel.cpp \
    12461246        src/guestctrl/UIFileManagerTable.cpp \
    12471247        src/guestctrl/UIGuestControlConsole.cpp \
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPool.cpp

    r92563 r92616  
    17021702};
    17031703
    1704 /** Toggle action extension, used to toggle 'File Manager Session' panel in file manager. */
    1705 class UIActionMenuFileManagerSession : public UIActionToggle
    1706 {
    1707     Q_OBJECT;
    1708 
    1709 public:
    1710 
    1711     /** Constructs action passing @a pParent to the base-class. */
    1712     UIActionMenuFileManagerSession(UIActionPool *pParent)
     1704/** Toggle action extension, used to toggle 'File Manager Guest Session' panel in file manager. */
     1705class UIActionMenuFileManagerGuestSession : public UIActionToggle
     1706{
     1707    Q_OBJECT;
     1708
     1709public:
     1710
     1711    /** Constructs action passing @a pParent to the base-class. */
     1712    UIActionMenuFileManagerGuestSession(UIActionPool *pParent)
    17131713        : UIActionToggle(pParent)
    17141714    {
     
    17231723    virtual QString shortcutExtraDataID() const /* override */
    17241724    {
    1725         return QString("ToggleFileManagerSessionPanel");
     1725        return QString("ToggleFileManagerGuestSessionPanel");
    17261726    }
    17271727
     
    31063106    m_pool[UIActionIndex_M_FileManager_T_Log] = new UIActionMenuFileManagerLog(this);
    31073107    m_pool[UIActionIndex_M_FileManager_T_Operations] = new UIActionMenuFileManagerOperations(this);
    3108     m_pool[UIActionIndex_M_FileManager_T_Session] = new UIActionMenuFileManagerSession(this);
     3108    m_pool[UIActionIndex_M_FileManager_T_GuestSession] = new UIActionMenuFileManagerGuestSession(this);
    31093109    m_pool[UIActionIndex_M_FileManager_S_Host_GoUp] = new UIActionMenuFileManagerGoUp(this);
    31103110    m_pool[UIActionIndex_M_FileManager_S_Guest_GoUp] = new UIActionMenuFileManagerGoUp(this);
     
    35573557void UIActionPool::updateMenuFileManagerWrapper(UIMenu *pMenu)
    35583558{
    3559     addAction(pMenu, action(UIActionIndex_M_FileManager_T_Session));
     3559    addAction(pMenu, action(UIActionIndex_M_FileManager_T_GuestSession));
    35603560    addAction(pMenu, action(UIActionIndex_M_FileManager_T_Options));
    35613561    addAction(pMenu, action(UIActionIndex_M_FileManager_T_Operations));
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPool.h

    r92487 r92616  
    112112    UIActionIndex_M_FileManager_T_Log,
    113113    UIActionIndex_M_FileManager_T_Operations,
    114     UIActionIndex_M_FileManager_T_Session,
     114    UIActionIndex_M_FileManager_T_GuestSession,
    115115    UIActionIndex_M_FileManager_S_Host_GoUp,
    116116    UIActionIndex_M_FileManager_S_Guest_GoUp,
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManager.cpp

    r92610 r92616  
    3131#include "UIIconPool.h"
    3232#include "UIFileManager.h"
    33 #include "UIFileManagerSessionPanel.h"
     33#include "UIFileManagerGuestSessionPanel.h"
    3434#include "UIFileManagerOptionsPanel.h"
    3535#include "UIFileManagerLogPanel.h"
     
    126126    , m_pOptionsPanel(0)
    127127    , m_pLogPanel(0)
    128     , m_pSessionPanel(0)
     128    , m_pGuestSessionPanel(0)
    129129    , m_pOperationsPanel(0)
    130130    , m_fDialogBeingClosed(false)
     
    246246
    247247    pTopLayout->addLayout(pFileTableContainerLayout);
    248     m_pSessionPanel = new UIFileManagerSessionPanel;
    249     if (m_pSessionPanel)
    250     {
    251         m_pSessionPanel->hide();
    252         m_panelActionMap.insert(m_pSessionPanel, m_pActionPool->action(UIActionIndex_M_FileManager_T_Session));
    253         pTopLayout->addWidget(m_pSessionPanel);
     248    m_pGuestSessionPanel = new UIFileManagerGuestSessionPanel;
     249    if (m_pGuestSessionPanel)
     250    {
     251        m_pGuestSessionPanel->hide();
     252        m_panelActionMap.insert(m_pGuestSessionPanel, m_pActionPool->action(UIActionIndex_M_FileManager_T_GuestSession));
     253        pTopLayout->addWidget(m_pGuestSessionPanel);
    254254    }
    255255
     
    330330{
    331331    if (m_pQtGuestListener)
    332     {
    333332        connect(m_pQtGuestListener->getWrapped(), &UIMainEventListener::sigGuestSessionUnregistered,
    334333                this, &UIFileManager::sltGuestSessionUnregistered);
    335     }
    336     if (m_pSessionPanel)
    337     {
    338         connect(m_pSessionPanel, &UIFileManagerSessionPanel::sigCreateSession,
    339                 this, &UIFileManager::sltCreateSession);
    340         connect(m_pSessionPanel, &UIFileManagerSessionPanel::sigCloseSession,
    341                 this, &UIFileManager::sltCloseSession);
    342         connect(m_pSessionPanel, &UIFileManagerSessionPanel::sigHidePanel,
     334
     335    if (m_pGuestSessionPanel)
     336    {
     337        connect(m_pGuestSessionPanel, &UIFileManagerGuestSessionPanel::sigCreateSession,
     338                this, &UIFileManager::sltCreateGuestSession);
     339        connect(m_pGuestSessionPanel, &UIFileManagerGuestSessionPanel::sigCloseSession,
     340                this, &UIFileManager::sltCloseGuestSession);
     341        connect(m_pGuestSessionPanel, &UIFileManagerGuestSessionPanel::sigHidePanel,
    343342                this, &UIFileManager::sltHandleHidePanel);
    344343    }
     
    367366        m_pToolBar->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
    368367
    369         m_pToolBar->addAction(m_pActionPool->action(UIActionIndex_M_FileManager_T_Session));
     368        m_pToolBar->addAction(m_pActionPool->action(UIActionIndex_M_FileManager_T_GuestSession));
    370369        m_pToolBar->addAction(m_pActionPool->action(UIActionIndex_M_FileManager_T_Options));
    371370        m_pToolBar->addAction(m_pActionPool->action(UIActionIndex_M_FileManager_T_Operations));
     
    376375        connect(m_pActionPool->action(UIActionIndex_M_FileManager_T_Log), &QAction::toggled,
    377376                this, &UIFileManager::sltPanelActionToggled);
    378         connect(m_pActionPool->action(UIActionIndex_M_FileManager_T_Session), &QAction::toggled,
     377        connect(m_pActionPool->action(UIActionIndex_M_FileManager_T_GuestSession), &QAction::toggled,
    379378                this, &UIFileManager::sltPanelActionToggled);
    380379        connect(m_pActionPool->action(UIActionIndex_M_FileManager_T_Operations), &QAction::toggled,
     
    395394}
    396395
    397 
    398396void UIFileManager::sltGuestSessionUnregistered(CGuestSession guestSession)
    399397{
     
    403401    {
    404402        m_comGuestSession.detach();
    405         postSessionClosed();
    406     }
    407 }
    408 
    409 void UIFileManager::sltCreateSession(QString strUserName, QString strPassword)
     403        postGuestSessionClosed();
     404    }
     405}
     406
     407void UIFileManager::sltCreateGuestSession(QString strUserName, QString strPassword)
    410408{
    411409    if (!UIGuestControlInterface::isGuestAdditionsAvailable(m_comGuest))
    412410    {
    413411        appendLog("Could not find Guest Additions", FileManagerLogType_Error);
    414         postSessionClosed();
    415         if (m_pSessionPanel)
    416             m_pSessionPanel->markForError(true);
     412        postGuestSessionClosed();
     413        if (m_pGuestSessionPanel)
     414            m_pGuestSessionPanel->markForError(true);
    417415        return;
    418416    }
     
    420418    {
    421419        appendLog("No user name is given", FileManagerLogType_Error);
    422         if (m_pSessionPanel)
    423             m_pSessionPanel->markForError(true);
    424         return;
    425     }
    426     if (m_pSessionPanel)
    427         m_pSessionPanel->markForError(!createSession(strUserName, strPassword));
    428 }
    429 
    430 void UIFileManager::sltCloseSession()
     420        if (m_pGuestSessionPanel)
     421            m_pGuestSessionPanel->markForError(true);
     422        return;
     423    }
     424    if (m_pGuestSessionPanel)
     425        m_pGuestSessionPanel->markForError(!createGuestSession(strUserName, strPassword));
     426}
     427
     428void UIFileManager::sltCloseGuestSession()
    431429{
    432430    if (!m_comGuestSession.isOk())
    433431    {
    434432        appendLog("Guest session is not valid", FileManagerLogType_Error);
    435         postSessionClosed();
     433        postGuestSessionClosed();
    436434        return;
    437435    }
     
    444442    m_comGuestSession.Close();
    445443    appendLog("Guest session is closed", FileManagerLogType_Info);
    446     postSessionClosed();
     444    postGuestSessionClosed();
    447445}
    448446
     
    460458        {
    461459            initFileTable();
    462             postSessionCreated();
     460            postGuestSessionCreated();
    463461        }
    464462        appendLog(QString("%1: %2").arg("Session status has changed").arg(gpConverter->toString(m_comGuestSession.GetStatus())),
     
    578576}
    579577
    580 void UIFileManager::postSessionCreated()
    581 {
    582     if (m_pSessionPanel)
    583         m_pSessionPanel->switchSessionCloseMode();
     578void UIFileManager::postGuestSessionCreated()
     579{
     580    if (m_pGuestSessionPanel)
     581        m_pGuestSessionPanel->switchSessionCloseMode();
    584582    if (m_pGuestFileTable)
    585583        m_pGuestFileTable->setEnabled(true);
     
    588586}
    589587
    590 void UIFileManager::postSessionClosed()
    591 {
    592     if (m_pSessionPanel)
    593         m_pSessionPanel->switchSessionCreateMode();
     588void UIFileManager::postGuestSessionClosed()
     589{
     590    if (m_pGuestSessionPanel)
     591        m_pGuestSessionPanel->switchSessionCreateMode();
    594592    if (m_pGuestFileTable)
    595593        m_pGuestFileTable->setEnabled(false);
     
    598596}
    599597
    600 bool UIFileManager::createSession(const QString& strUserName, const QString& strPassword,
    601                                               const QString& strDomain /* not used currently */)
     598bool UIFileManager::createGuestSession(const QString& strUserName, const QString& strPassword,
     599                                  const QString& strDomain /* not used currently */)
    602600{
    603601    if (!m_comGuest.isOk())
     
    612610    }
    613611    appendLog("Guest session has been created", FileManagerLogType_Info);
    614     if (m_pSessionPanel)
    615         m_pSessionPanel->switchSessionCloseMode();
     612    if (m_pGuestSessionPanel)
     613        m_pGuestSessionPanel->switchSessionCloseMode();
    616614
    617615    /* Prepare session listener */
     
    625623    qRegisterMetaType<CGuestSessionStateChangedEvent>();
    626624
    627 
    628625    connect(m_pQtSessionListener->getWrapped(), &UIMainEventListener::sigGuestSessionStatedChanged,
    629626            this, &UIFileManager::sltGuestSessionStateChanged);
     
    631628    /* Wait session to start. For some reason we cannot get GuestSessionStatusChanged event
    632629        consistently. So we wait: */
    633     appendLog("Waiting the session to start", FileManagerLogType_Info);
     630    appendLog("Waiting the guest session to start", FileManagerLogType_Info);
    634631    const ULONG waitTimeout = 2000;
    635632    KGuestSessionWaitResult waitResult = m_comGuestSession.WaitFor(KGuestSessionWaitForFlag_Start, waitTimeout);
    636633    if (waitResult != KGuestSessionWaitResult_Start)
    637634    {
    638         appendLog("The session did not start", FileManagerLogType_Error);
    639         sltCloseSession();
     635        appendLog("The guest session did not start", FileManagerLogType_Error);
     636        sltCloseGuestSession();
    640637        return false;
    641638    }
     
    645642
    646643void UIFileManager::prepareListener(ComObjPtr<UIMainEventListenerImpl> &QtListener,
    647                                                 CEventListener &comEventListener,
    648                                                 CEventSource comEventSource, QVector<KVBoxEventType>& eventTypes)
     644                                    CEventListener &comEventListener,
     645                                    CEventSource comEventSource, QVector<KVBoxEventType>& eventTypes)
    649646{
    650647    if (!comEventSource.isOk())
     
    727724    }
    728725    /* Make sure Session panel is visible: */
    729     if (m_pSessionPanel && !m_pSessionPanel->isVisible())
    730         showPanel(m_pSessionPanel);
     726    if (m_pGuestSessionPanel && !m_pGuestSessionPanel->isVisible())
     727        showPanel(m_pGuestSessionPanel);
    731728}
    732729
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManager.h

    r89111 r92616  
    4949class UIFileManagerLogPanel;
    5050class UIFileManagerOperationsPanel;
    51 class UIFileManagerSessionPanel;
     51class UIFileManagerGuestSessionPanel;
    5252class UIFileManagerOptionsPanel;
    5353class UIFileManagerGuestTable;
     
    110110
    111111    void sltGuestSessionUnregistered(CGuestSession guestSession);
    112     void sltCreateSession(QString strUserName, QString strPassword);
    113     void sltCloseSession();
     112    void sltCreateGuestSession(QString strUserName, QString strPassword);
     113    void sltCloseGuestSession();
    114114    void sltGuestSessionStateChanged(const CGuestSessionStateChangedEvent &cEvent);
    115115    void sltReceieveLogOutput(QString strOutput, FileManagerLogType eLogType);
     
    131131    void prepareVerticalToolBar(QHBoxLayout *layout);
    132132    void prepareToolBar();
    133     bool createSession(const QString& strUserName, const QString& strPassword,
     133    bool createGuestSession(const QString& strUserName, const QString& strPassword,
    134134                       const QString& strDomain = QString() /* not used currently */);
    135135
     
    145145    /** @name Perform operations needed after creating/ending a guest control session
    146146      * @{ */
    147         void postSessionCreated();
    148         void postSessionClosed();
     147        void postGuestSessionCreated();
     148        void postGuestSessionClosed();
    149149    /** @} */
    150150
     
    191191    UIFileManagerOptionsPanel          *m_pOptionsPanel;
    192192    UIFileManagerLogPanel              *m_pLogPanel;
    193     UIFileManagerSessionPanel          *m_pSessionPanel;
     193    UIFileManagerGuestSessionPanel     *m_pGuestSessionPanel;
    194194    UIFileManagerOperationsPanel       *m_pOperationsPanel;
    195195    bool                                m_fDialogBeingClosed;
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManagerGuestSessionPanel.cpp

    r92615 r92616  
    2323/* GUI includes: */
    2424#include "QILineEdit.h"
    25 #include "UIFileManagerSessionPanel.h"
     25#include "UIFileManagerGuestSessionPanel.h"
    2626
    2727/*********************************************************************************************************************************
     
    261261
    262262/*********************************************************************************************************************************
    263 *   UIFileManagerSessionPanel implementation.                                                                        *
     263*   UIFileManagerGuestSessionPanel implementation.                                                                        *
    264264*********************************************************************************************************************************/
    265265
    266 UIFileManagerSessionPanel::UIFileManagerSessionPanel(QWidget *pParent /* = 0 */)
     266UIFileManagerGuestSessionPanel::UIFileManagerGuestSessionPanel(QWidget *pParent /* = 0 */)
    267267    : UIDialogPanel(pParent)
    268268    , m_pSessionCreateWidget(0)
     
    271271}
    272272
    273 void UIFileManagerSessionPanel::switchSessionCloseMode()
     273void UIFileManagerGuestSessionPanel::switchSessionCloseMode()
    274274{
    275275    if (m_pSessionCreateWidget)
     
    277277}
    278278
    279 void UIFileManagerSessionPanel::switchSessionCreateMode()
     279void UIFileManagerGuestSessionPanel::switchSessionCreateMode()
    280280{
    281281    if (m_pSessionCreateWidget)
     
    283283}
    284284
    285 QString UIFileManagerSessionPanel::panelName() const
    286 {
    287     return "SessionPanel";
    288 }
    289 
    290 void UIFileManagerSessionPanel::markForError(bool fMarkForError)
     285QString UIFileManagerGuestSessionPanel::panelName() const
     286{
     287    return "GuestSessionPanel";
     288}
     289
     290void UIFileManagerGuestSessionPanel::markForError(bool fMarkForError)
    291291{
    292292    if (m_pSessionCreateWidget)
     
    294294}
    295295
    296 void UIFileManagerSessionPanel::prepareWidgets()
     296void UIFileManagerGuestSessionPanel::prepareWidgets()
    297297{
    298298    if (!mainLayout())
     
    303303}
    304304
    305 void UIFileManagerSessionPanel::prepareConnections()
     305void UIFileManagerGuestSessionPanel::prepareConnections()
    306306{
    307307    if (m_pSessionCreateWidget)
    308308    {
    309309        connect(m_pSessionCreateWidget, &UIGuestSessionCreateWidget::sigCreateSession,
    310                 this, &UIFileManagerSessionPanel::sigCreateSession);
     310                this, &UIFileManagerGuestSessionPanel::sigCreateSession);
    311311        connect(m_pSessionCreateWidget, &UIGuestSessionCreateWidget::sigCloseSession,
    312                 this, &UIFileManagerSessionPanel::sigCloseSession);
    313     }
    314 }
    315 
    316 void UIFileManagerSessionPanel::retranslateUi()
     312                this, &UIFileManagerGuestSessionPanel::sigCloseSession);
     313    }
     314}
     315
     316void UIFileManagerGuestSessionPanel::retranslateUi()
    317317{
    318318    UIDialogPanel::retranslateUi();
     
    320320}
    321321
    322 void UIFileManagerSessionPanel::showEvent(QShowEvent *pEvent)
     322void UIFileManagerGuestSessionPanel::showEvent(QShowEvent *pEvent)
    323323{
    324324    markForError(false);
     
    326326}
    327327
    328 #include "UIFileManagerSessionPanel.moc"
     328#include "UIFileManagerGuestSessionPanel.moc"
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManagerGuestSessionPanel.h

    r92615 r92616  
    1616 */
    1717
    18 #ifndef FEQT_INCLUDED_SRC_guestctrl_UIFileManagerSessionPanel_h
    19 #define FEQT_INCLUDED_SRC_guestctrl_UIFileManagerSessionPanel_h
     18#ifndef FEQT_INCLUDED_SRC_guestctrl_UIFileManagerGuestSessionPanel_h
     19#define FEQT_INCLUDED_SRC_guestctrl_UIFileManagerGuestSessionPanel_h
    2020#ifndef RT_WITHOUT_PRAGMA_ONCE
    2121# pragma once
     
    2929
    3030/** UIDialogPanel extension providing GUI for creating/stopping a guest session. */
    31 class UIFileManagerSessionPanel : public UIDialogPanel
     31class UIFileManagerGuestSessionPanel : public UIDialogPanel
    3232{
    3333    Q_OBJECT;
     
    4040public:
    4141
    42     UIFileManagerSessionPanel(QWidget *pParent = 0);
     42    UIFileManagerGuestSessionPanel(QWidget *pParent = 0);
    4343    /** @name Enable/disable member widget wrt. guest session status.
    4444      * @{ */
     
    6161};
    6262
    63 #endif /* !FEQT_INCLUDED_SRC_guestctrl_UIFileManagerSessionPanel_h */
     63#endif /* !FEQT_INCLUDED_SRC_guestctrl_UIFileManagerGuestSessionPanel_h */
Note: See TracChangeset for help on using the changeset viewer.

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