VirtualBox

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


Ignore:
Timestamp:
Dec 13, 2021 1:46:35 PM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
148835
Message:

FE/Qt: bugref:9371. More session management stuff for file manager.

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

Legend:

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

    r92860 r92884  
    247247    m_fMarkedForError = fMarkForError;
    248248
    249         if (m_pUserNameEdit)
    250         {
    251             QPalette mPalette = m_pUserNameEdit->palette();
    252             if (m_fMarkedForError)
    253                 mPalette.setColor(QPalette::Base, m_errorBaseColor);
    254             else
    255                 mPalette.setColor(QPalette::Base, m_defaultBaseColor);
    256             m_pUserNameEdit->setPalette(mPalette);
    257         }
    258         if (m_pPasswordEdit)
    259         {
    260             QPalette mPalette = m_pPasswordEdit->palette();
    261             if (m_fMarkedForError)
    262                 mPalette.setColor(QPalette::Base, m_errorBaseColor);
    263             else
    264                 mPalette.setColor(QPalette::Base, m_defaultBaseColor);
    265             m_pPasswordEdit->setPalette(mPalette);
    266         }
     249    if (m_pUserNameEdit)
     250    {
     251        QPalette mPalette = m_pUserNameEdit->palette();
     252        if (m_fMarkedForError)
     253            mPalette.setColor(QPalette::Base, m_errorBaseColor);
     254        else
     255            mPalette.setColor(QPalette::Base, m_defaultBaseColor);
     256        m_pUserNameEdit->setPalette(mPalette);
     257    }
     258    if (m_pPasswordEdit)
     259    {
     260        QPalette mPalette = m_pPasswordEdit->palette();
     261        if (m_fMarkedForError)
     262            mPalette.setColor(QPalette::Base, m_errorBaseColor);
     263        else
     264            mPalette.setColor(QPalette::Base, m_defaultBaseColor);
     265        m_pPasswordEdit->setPalette(mPalette);
     266    }
    267267}
    268268
     
    12041204}
    12051205
    1206 void UIFileManagerGuestTable::postGuestSessionCreated()
    1207 {
    1208     if (m_pGuestSessionPanel)
    1209         m_pGuestSessionPanel->switchSessionCloseMode();
    1210 }
    1211 
    1212 void UIFileManagerGuestTable::postGuestSessionClosed()
    1213 {
    1214     if (m_pGuestSessionPanel)
    1215         m_pGuestSessionPanel->switchSessionCreateMode();
    1216 }
    1217 
    12181206void UIFileManagerGuestTable::prepareListener(ComObjPtr<UIMainEventListenerImpl> &QtListener,
    12191207                                              CEventListener &comEventListener,
     
    12581246    {
    12591247        m_comGuestSession.detach();
    1260         postGuestSessionClosed();
    12611248        emit sigLogOutput("Guest session unregistered", m_strTableName, FileManagerLogType_Info);
    12621249    }
     
    12791266    if (m_comGuestSession.isOk())
    12801267    {
     1268        emit sigLogOutput(QString("%1: %2").arg("Guest session status has changed").arg(gpConverter->toString(m_comGuestSession.GetStatus())),
     1269                  m_strTableName, FileManagerLogType_Info);
     1270
    12811271        if (m_comGuestSession.GetStatus() == KGuestSessionStatus_Started)
    12821272            initFileTable();
    1283         emit sigLogOutput(QString("%1: %2").arg("Guest session status has changed").arg(gpConverter->toString(m_comGuestSession.GetStatus())),
    1284                   m_strTableName, FileManagerLogType_Info);
     1273        else
     1274        {
     1275            cleanupGuestSessionListener();
     1276            closeGuestSession();
     1277        }
    12851278    }
    12861279    else
    12871280        emit sigLogOutput("Guest session is not valid", m_strTableName, FileManagerLogType_Error);
    1288     postGuestSessionCreated();
    12891281    setStateAndEnableWidgets();
    12901282}
     
    13371329void UIFileManagerGuestTable::sltHandleCloseSessionRequest()
    13381330{
     1331    cleanupGuestSessionListener();
    13391332    closeGuestSession();
    13401333}
     
    13621355            m_pWarningLabel->setVisible(true);
    13631356            m_pGuestSessionPanel->setEnabled(false);
     1357            if (m_pGuestSessionPanel)
     1358                m_pGuestSessionPanel->switchSessionCreateMode();
    13641359            break;
    13651360        case State_SessionPossible:
     
    13671362            m_pWarningLabel->setVisible(true);
    13681363            m_pGuestSessionPanel->setEnabled(true);
     1364            if (m_pGuestSessionPanel)
     1365                m_pGuestSessionPanel->switchSessionCreateMode();
    13691366            break;
    13701367        case State_SessionRunning:
     
    13721369            m_pWarningLabel->setVisible(false);
    13731370            m_pGuestSessionPanel->setEnabled(true);
     1371            if (m_pGuestSessionPanel)
     1372                m_pGuestSessionPanel->switchSessionCloseMode();
    13741373            break;
    13751374        default:
     
    13891388    {
    13901389        emit sigLogOutput("Could not find Guest Additions", m_strTableName, FileManagerLogType_Error);
    1391         postGuestSessionClosed();
    13921390        if (m_pGuestSessionPanel)
    13931391            m_pGuestSessionPanel->markForError(true);
     
    14151413            this, &UIFileManagerGuestTable::sltGuestSessionStateChanged);
    14161414
     1415    if (m_comGuestSession.GetStatus() != KGuestSessionStatus_Started ||
     1416        m_comGuestSession.GetStatus() != KGuestSessionStatus_Starting)
     1417        return false;
    14171418    return true;
    14181419}
     
    14201421void UIFileManagerGuestTable::closeGuestSession()
    14211422{
    1422     cleanupGuestSessionListener();
    14231423    if (!m_comGuestSession.isNull())
     1424    {
    14241425        m_comGuestSession.Close();
    1425     // if (!m_comGuestSession.isNull())
    1426     // {
    1427     //     m_comGuestSession.Close();
    1428     //     m_comGuestSession.detach();
    1429     //     emit sigLogOutput("Guest session is closed", m_strTableName, FileManagerLogType_Info);
    1430     // }
    1431     // reset();
    1432     // postGuestSessionClosed();
     1426        m_comGuestSession.detach();
     1427        emit sigLogOutput("Guest session is closed", m_strTableName, FileManagerLogType_Info);
     1428    }
     1429    reset();
    14331430}
    14341431
    14351432void UIFileManagerGuestTable::cleanAll()
    14361433{
    1437     printf("UIFileManagerGuestTable::cleanAll()\n");
    1438 
    14391434    cleanupConsoleListener();
    14401435    cleanupGuestListener();
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManagerGuestTable.h

    r92860 r92884  
    140140    void setStateAndEnableWidgets();
    141141
    142     /** @name Perform operations needed after creating/ending a guest control session
    143       * @{ */
    144         void postGuestSessionCreated();
    145         void postGuestSessionClosed();
    146     /** @} */
    147 
    148142    void initFileTable();
    149143    void cleanAll();
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