VirtualBox

Changeset 14688

Show
Ignore:
Timestamp:
11/27/08 10:39:38 (1 month ago)
Author:
vboxsync
Message:

Fe/Qt4: Systray: Exit pure systray menu when no machines running anymore.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxSelectorWnd.cpp

    r14670 r14688  
    15601560void VBoxSelectorWnd::machineStateChanged (const VBoxMachineStateChangeEvent &e) 
    15611561{ 
     1562#ifdef VBOX_GUI_WITH_SYSTRAY 
     1563    if (vboxGlobal().isTrayMenu()) 
     1564    { 
     1565        /* Check if there are some machines alive - else quit, since 
     1566         * we're not needed anymore as a systray menu. */ 
     1567        int machinesAlive = 0; 
     1568        CVirtualBox vbox = vboxGlobal().virtualBox(); 
     1569        CMachineVector vec = vbox.GetMachines2(); 
     1570        for (CMachineVector::ConstIterator m = vec.begin(); 
     1571            m != vec.end(); ++ m) 
     1572        { 
     1573            switch ((*m).GetState()) 
     1574            { 
     1575                case MachineState_Running: 
     1576                case MachineState_Paused: 
     1577                { 
     1578                    machinesAlive++; 
     1579                    break; 
     1580                } 
     1581            } 
     1582        } 
     1583 
     1584        if (machinesAlive == 0) 
     1585        { 
     1586            fileExit(); 
     1587            return; 
     1588        } 
     1589    } 
     1590#endif 
     1591 
    15621592    refreshVMItem (e.id, 
    15631593                   false /* aDetails */, 

© 2008 Sun Microsystems, Inc.
ContactPrivacy policy