VirtualBox

Changeset 53050 in vbox for trunk


Ignore:
Timestamp:
Oct 13, 2014 6:10:56 PM (10 years ago)
Author:
vboxsync
Message:

FE/Qt: Runtime UI rework/cleanup for 7115 (part #20): Indicator-pool: Fixing few other assertions on machine power-off.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/runtime
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIIndicatorsPool.cpp

    r52902 r53050  
    315315
    316316    /** Constructor, passes @a session to the UISessionStateStatusBarIndicator constructor. */
    317     UIIndicatorNetwork(CSession &session)
    318         : UISessionStateStatusBarIndicator(session)
     317    UIIndicatorNetwork(UISession *pSession)
     318        : UISessionStateStatusBarIndicator(pSession->session())
     319        , m_pSession(pSession)
    319320        , m_pTimerAutoUpdate(0)
    320321    {
     
    324325        setStateIcon(KDeviceActivity_Writing, UIIconPool::iconSet(":/nw_write_16px.png"));
    325326        setStateIcon(KDeviceActivity_Null,    UIIconPool::iconSet(":/nw_disabled_16px.png"));
     327        /* Configure machine state-change listener: */
     328        connect(m_pSession, SIGNAL(sigMachineStateChange()),
     329                this, SLOT(sltHandleMachineStateChange()));
    326330        /* Create auto-update timer: */
    327331        m_pTimerAutoUpdate = new QTimer(this);
     
    330334            /* Configure auto-update timer: */
    331335            connect(m_pTimerAutoUpdate, SIGNAL(timeout()), SLOT(sltUpdateNetworkIPs()));
    332             m_pTimerAutoUpdate->start(5000);
     336            /* Start timer immediately if machine is running: */
     337            sltHandleMachineStateChange();
    333338        }
    334339        /* Translate finally: */
     
    337342
    338343private slots:
     344
     345    /** Updates auto-update timer depending on machine state. */
     346    void sltHandleMachineStateChange()
     347    {
     348        if (m_pSession->machineState() == KMachineState_Running)
     349        {
     350            /* Start auto-update timer otherwise: */
     351            m_pTimerAutoUpdate->start(5000);
     352            return;
     353        }
     354        /* Stop auto-update timer otherwise: */
     355        m_pTimerAutoUpdate->stop();
     356    }
    339357
    340358    /** Updates network IP addresses. */
     
    425443    }
    426444
     445    /** Holds the session UI reference. */
     446    UISession *m_pSession;
    427447    /** Holds the auto-update timer instance. */
    428448    QTimer *m_pTimerAutoUpdate;
     
    12281248                case IndicatorType_OpticalDisks:      m_pool[indicatorType] = new UIIndicatorOpticalDisks(m_session);  break;
    12291249                case IndicatorType_FloppyDisks:       m_pool[indicatorType] = new UIIndicatorFloppyDisks(m_session);   break;
    1230                 case IndicatorType_Network:           m_pool[indicatorType] = new UIIndicatorNetwork(m_session);       break;
     1250                case IndicatorType_Network:           m_pool[indicatorType] = new UIIndicatorNetwork(m_pSession);       break;
    12311251                case IndicatorType_USB:               m_pool[indicatorType] = new UIIndicatorUSB(m_session);           break;
    12321252                case IndicatorType_SharedFolders:     m_pool[indicatorType] = new UIIndicatorSharedFolders(m_session); break;
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineDefs.h

    r52727 r53050  
    2626    UIVisualElement_WindowTitle           = RT_BIT(0),
    2727    UIVisualElement_MouseIntegrationStuff = RT_BIT(1),
    28     UIVisualElement_PauseStuff            = RT_BIT(2),
     28    UIVisualElement_IndicatorPoolStuff    = RT_BIT(2),
    2929    UIVisualElement_HDStuff               = RT_BIT(3),
    3030    UIVisualElement_CDStuff               = RT_BIT(4),
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.cpp

    r52902 r53050  
    271271    pEvent->ignore();
    272272
    273     /* If VM process is running separately, then leave it alone and close UI: */
    274     if (vboxGlobal().isSeparateProcess())
    275     {
    276         uisession()->closeRuntimeUI();
    277         return;
    278     }
    279 
    280273    /* Make sure machine is in one of the allowed states: */
    281274    if (!uisession()->isRunning() && !uisession()->isPaused() && !uisession()->isStuck())
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.cpp

    r52937 r53050  
    6868    UIMachineWindow::sltMachineStateChanged();
    6969
    70     /* Update pause and virtualization stuff: */
    71     updateAppearanceOf(UIVisualElement_PauseStuff | UIVisualElement_FeaturesStuff);
     70    /* Update indicator-pool and virtualization stuff: */
     71    updateAppearanceOf(UIVisualElement_IndicatorPoolStuff | UIVisualElement_FeaturesStuff);
    7272}
    7373
     
    507507
    508508    /* Update machine window content: */
    509     if (iElement & UIVisualElement_PauseStuff)
    510     {
    511         if (!statusBar()->isHidden())
    512         {
    513             if (uisession()->isPaused())
    514                 m_pIndicatorsPool->setAutoUpdateIndicatorStates(false);
    515             else if (uisession()->isRunning())
    516                 m_pIndicatorsPool->setAutoUpdateIndicatorStates(statusBar()->isVisible());
    517         }
    518     }
     509    if (iElement & UIVisualElement_IndicatorPoolStuff)
     510        m_pIndicatorsPool->setAutoUpdateIndicatorStates(statusBar()->isVisible() && uisession()->isRunning());
    519511    if (iElement & UIVisualElement_HDStuff)
    520512        m_pIndicatorsPool->updateAppearance(IndicatorType_HardDisks);
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