Changeset 90706 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Aug 17, 2021 5:10:51 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.cpp
r90567 r90706 571 571 if (iElement & UIVisualElement_WindowTitle) 572 572 { 573 /* Get machine state: */ 574 KMachineState state = uisession()->machineState(); 573 /* Make sure machine state is one of valid: */ 574 const KMachineState enmState = uisession()->machineState(); 575 if (enmState == KMachineState_Null) 576 return; 577 575 578 /* Prepare full name: */ 576 QString strSnapshotName; 579 QString strMachineName = machineName(); 580 581 /* Append snapshot name: */ 577 582 if (machine().GetSnapshotCount() > 0) 578 583 { 579 CSnapshot snapshot = machine().GetCurrentSnapshot();580 str SnapshotName = " (" + snapshot.GetName() + ")";581 } 582 QString strMachineName = machineName() + strSnapshotName; 583 if (state != KMachineState_Null)584 strMachineName += " [" + gpConverter->toString(state) + "]";585 /* Unusual on the Mac. */ 584 const CSnapshot comSnapshot = machine().GetCurrentSnapshot(); 585 strMachineName += " (" + comSnapshot.GetName() + ")"; 586 } 587 588 /* Append state name: */ 589 strMachineName += " [" + gpConverter->toString(enmState) + "]"; 590 586 591 #ifndef VBOX_WS_MAC 592 /* Append user product name (besides macOS): */ 587 593 const QString strUserProductName = uisession()->machineWindowNamePostfix(); 588 594 strMachineName += " - " + (strUserProductName.isEmpty() ? defaultWindowTitle() : strUserProductName); 589 595 #endif /* !VBOX_WS_MAC */ 596 590 597 /* Check if we can get graphics adapter: */ 591 598 CGraphicsAdapter comAdapter = machine().GetGraphicsAdapter(); 592 if (!machine().isOk()) 593 { 594 // What can I say, we really want to notify user about this 595 // one, but if that happens on VM shutdown/poweroff there 596 // will no be a chance to do it, cause application got exited. 597 msgCenter().cannotAcquireMachineParameter(machine()); 598 } 599 else 599 if (machine().isOk() && comAdapter.isNotNull()) 600 600 { 601 601 /* Append screen number only if there are more than one present: */ … … 603 603 strMachineName += QString(" : %1").arg(m_uScreenId + 1); 604 604 } 605 606 /* Assign title finally: */ 605 607 setWindowTitle(strMachineName); 606 608 }
Note:
See TracChangeset
for help on using the changeset viewer.