- Timestamp:
- Apr 30, 2015 1:39:17 PM (10 years ago)
- svn:sync-xref-src-repo-rev:
- 99919
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/selector
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.cpp
r55550 r55552 470 470 /* Launch/show current VM: */ 471 471 CMachine machine = pItem->machine(); 472 vboxGlobal().launchMachine(machine, qApp->keyboardModifiers() == Qt::ShiftModifier ? 473 VBoxGlobal::LaunchMode_Headless : 474 VBoxGlobal::LaunchMode_Default); 472 vboxGlobal().launchMachine(machine, 473 UIVMItem::isItemRunningHeadless(pItem) ? VBoxGlobal::LaunchMode_Separate : 474 qApp->keyboardModifiers() == Qt::ShiftModifier ? VBoxGlobal::LaunchMode_Headless : 475 VBoxGlobal::LaunchMode_Default); 475 476 } 476 477 } … … 1976 1977 { 1977 1978 if ((UIVMItem::isItemPoweredOff(pItem) && UIVMItem::isItemEditable(pItem)) || 1978 (UIVMItem::isItemStarted(pItem) && pItem->canSwitchTo()))1979 (UIVMItem::isItemStarted(pItem) && (pItem->canSwitchTo() || UIVMItem::isItemRunningHeadless(pItem)))) 1979 1980 return true; 1980 1981 } -
trunk/src/VBox/Frontends/VirtualBox/src/selector/UIVMItem.cpp
r52730 r55552 477 477 478 478 /* static */ 479 bool UIVMItem::isItemRunningHeadless(UIVMItem *pItem) 480 { 481 if (isItemRunning(pItem)) 482 { 483 /* Open session to determine which frontend VM is started with: */ 484 CSession session = vboxGlobal().openExistingSession(pItem->id()); 485 if (!session.isNull()) 486 { 487 /* Acquire the session type: */ 488 const QString strSessionType = session.GetMachine().GetSessionType(); 489 /* Close the session early: */ 490 session.UnlockMachine(); 491 /* Check whether we are in 'headless' session type: */ 492 if (strSessionType.compare("headless", Qt::CaseInsensitive) == 0) 493 return true; 494 } 495 } 496 return false; 497 } 498 499 /* static */ 479 500 bool UIVMItem::isItemPaused(UIVMItem *pItem) 480 501 { -
trunk/src/VBox/Frontends/VirtualBox/src/selector/UIVMItem.h
r55401 r55552 80 80 static bool isItemStarted(UIVMItem *pItem); 81 81 static bool isItemRunning(UIVMItem *pItem); 82 static bool isItemRunningHeadless(UIVMItem *pItem); 82 83 static bool isItemPaused(UIVMItem *pItem); 83 84 static bool isItemStuck(UIVMItem *pItem);
Note:
See TracChangeset
for help on using the changeset viewer.