Changeset 14692
- Timestamp:
- 11/27/08 10:51:12 (1 month ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxGlobal.h
r14652 r14692 812 812 } 813 813 814 /* Returns the number of current running machines. */ 815 int machinesAlive() const; 816 814 817 /* various helpers */ 815 818 trunk/src/VBox/Frontends/VirtualBox4/src/VBoxGlobal.cpp
r14669 r14692 3179 3179 3180 3180 return false; 3181 } 3182 3183 /** 3184 * Returns the number of current running VMs. 3185 * 3186 * @return Number of running VMs. 3187 */ 3188 int VBoxGlobal::machinesAlive () const 3189 { 3190 int machinesAlive = 0; 3191 CVirtualBox vbox = vboxGlobal().virtualBox(); 3192 CMachineVector vec = vbox.GetMachines2(); 3193 for (CMachineVector::ConstIterator m = vec.begin(); 3194 m != vec.end(); ++ m) 3195 { 3196 switch ((*m).GetState()) 3197 { 3198 case MachineState_Running: 3199 case MachineState_Paused: 3200 { 3201 machinesAlive++; 3202 break; 3203 } 3204 } 3205 } 3206 3207 return machinesAlive; 3181 3208 } 3182 3209 trunk/src/VBox/Frontends/VirtualBox4/src/VBoxSelectorWnd.cpp
r14689 r14692 1565 1565 /* Check if there are some machines alive - else quit, since 1566 1566 * we're not needed as a systray menu anymore. */ 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) 1567 if (vboxGlobal().machinesAlive() == 0) 1585 1568 { 1586 1569 fileExit();

