VirtualBox

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


Ignore:
Timestamp:
Nov 27, 2008 9:39:38 AM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
39998
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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 */,
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