Changeset 99142 in vbox for trunk/src/VBox
- Timestamp:
- Mar 23, 2023 12:50:41 PM (22 months ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.cpp
r99141 r99142 1470 1470 1471 1471 /* Prepare VM related stuff: */ 1472 prepareBranding();1473 1472 prepareActions(); 1474 1473 prepareHostScreenData(); 1475 prepareGuestScreenData();1476 1474 prepareKeyboard(); 1477 1475 prepareClose(); 1478 1476 prepareVisualState(); 1477 1478 /* Update VM related stuff: */ 1479 updateBranding(); 1480 updateGuestScreenData(); 1479 1481 enterInitialVisualState(); 1480 1482 … … 1563 1565 } 1564 1566 1565 void UIMachine::prepareBranding()1566 {1567 /* Create the icon dynamically: */1568 m_pMachineWindowIcon = new QIcon;1569 acquireUserMachineIcon(*m_pMachineWindowIcon);1570 1571 #ifndef VBOX_WS_MAC1572 /* Load user's machine-window name postfix: */1573 const QUuid uMachineID = uiCommon().managedVMUuid();1574 m_strMachineWindowNamePostfix = gEDataManager->machineWindowNamePostfix(uMachineID);1575 #endif /* !VBOX_WS_MAC */1576 }1577 1578 1567 void UIMachine::prepareActions() 1579 1568 { … … 1684 1673 } 1685 1674 1686 void UIMachine::prepareGuestScreenData() 1675 void UIMachine::prepareKeyboard() 1676 { 1677 #if defined(VBOX_WS_MAC) || defined(VBOX_WS_WIN) 1678 /* Load extra-data value: */ 1679 m_fIsHidLedsSyncEnabled = gEDataManager->hidLedsSyncState(uiCommon().managedVMUuid()); 1680 /* Connect to extra-data changes to be able to enable/disable feature dynamically: */ 1681 connect(gEDataManager, &UIExtraDataManager::sigHidLedsSyncStateChange, 1682 this, &UIMachine::sltHidLedsSyncStateChanged); 1683 #endif /* VBOX_WS_MAC || VBOX_WS_WIN */ 1684 } 1685 1686 void UIMachine::prepareClose() 1687 { 1688 /* What is the default close action and the restricted are? */ 1689 const QUuid uMachineID = uiCommon().managedVMUuid(); 1690 m_defaultCloseAction = gEDataManager->defaultMachineCloseAction(uMachineID); 1691 m_restrictedCloseActions = gEDataManager->restrictedMachineCloseActions(uMachineID); 1692 } 1693 1694 void UIMachine::prepareVisualState() 1695 { 1696 /* Prepare async visual state type change handler: */ 1697 qRegisterMetaType<UIVisualStateType>(); 1698 connect(this, &UIMachine::sigRequestAsyncVisualStateChange, 1699 this, &UIMachine::sltChangeVisualState, 1700 Qt::QueuedConnection); 1701 1702 /* Load restricted visual states: */ 1703 UIVisualStateType enmRestrictedVisualStates = gEDataManager->restrictedVisualStates(uiCommon().managedVMUuid()); 1704 /* Acquire allowed visual states: */ 1705 m_enmAllowedVisualStates = static_cast<UIVisualStateType>(UIVisualStateType_All ^ enmRestrictedVisualStates); 1706 1707 /* Load requested visual state, it can override initial one: */ 1708 m_enmRequestedVisualState = gEDataManager->requestedVisualState(uiCommon().managedVMUuid()); 1709 /* Check if requested visual state is allowed: */ 1710 if (isVisualStateAllowed(m_enmRequestedVisualState)) 1711 { 1712 switch (m_enmRequestedVisualState) 1713 { 1714 /* Direct transition allowed to scale/fullscreen modes only: */ 1715 case UIVisualStateType_Scale: 1716 case UIVisualStateType_Fullscreen: 1717 m_enmInitialVisualState = m_enmRequestedVisualState; 1718 break; 1719 default: 1720 break; 1721 } 1722 } 1723 } 1724 1725 void UIMachine::updateBranding() 1726 { 1727 /* Create the icon dynamically: */ 1728 delete m_pMachineWindowIcon; 1729 m_pMachineWindowIcon = new QIcon; 1730 acquireUserMachineIcon(*m_pMachineWindowIcon); 1731 1732 #ifndef VBOX_WS_MAC 1733 /* Load user's machine-window name postfix: */ 1734 const QUuid uMachineID = uiCommon().managedVMUuid(); 1735 m_strMachineWindowNamePostfix = gEDataManager->machineWindowNamePostfix(uMachineID); 1736 #endif /* !VBOX_WS_MAC */ 1737 } 1738 1739 void UIMachine::updateGuestScreenData() 1687 1740 { 1688 1741 /* Accquire guest-screen count: */ … … 1740 1793 } 1741 1794 1742 void UIMachine::prepareKeyboard()1743 {1744 #if defined(VBOX_WS_MAC) || defined(VBOX_WS_WIN)1745 /* Load extra-data value: */1746 m_fIsHidLedsSyncEnabled = gEDataManager->hidLedsSyncState(uiCommon().managedVMUuid());1747 /* Connect to extra-data changes to be able to enable/disable feature dynamically: */1748 connect(gEDataManager, &UIExtraDataManager::sigHidLedsSyncStateChange,1749 this, &UIMachine::sltHidLedsSyncStateChanged);1750 #endif /* VBOX_WS_MAC || VBOX_WS_WIN */1751 }1752 1753 void UIMachine::prepareClose()1754 {1755 /* What is the default close action and the restricted are? */1756 const QUuid uMachineID = uiCommon().managedVMUuid();1757 m_defaultCloseAction = gEDataManager->defaultMachineCloseAction(uMachineID);1758 m_restrictedCloseActions = gEDataManager->restrictedMachineCloseActions(uMachineID);1759 }1760 1761 void UIMachine::prepareVisualState()1762 {1763 /* Prepare async visual state type change handler: */1764 qRegisterMetaType<UIVisualStateType>();1765 connect(this, &UIMachine::sigRequestAsyncVisualStateChange,1766 this, &UIMachine::sltChangeVisualState,1767 Qt::QueuedConnection);1768 1769 /* Load restricted visual states: */1770 UIVisualStateType enmRestrictedVisualStates = gEDataManager->restrictedVisualStates(uiCommon().managedVMUuid());1771 /* Acquire allowed visual states: */1772 m_enmAllowedVisualStates = static_cast<UIVisualStateType>(UIVisualStateType_All ^ enmRestrictedVisualStates);1773 1774 /* Load requested visual state, it can override initial one: */1775 m_enmRequestedVisualState = gEDataManager->requestedVisualState(uiCommon().managedVMUuid());1776 /* Check if requested visual state is allowed: */1777 if (isVisualStateAllowed(m_enmRequestedVisualState))1778 {1779 switch (m_enmRequestedVisualState)1780 {1781 /* Direct transition allowed to scale/fullscreen modes only: */1782 case UIVisualStateType_Scale:1783 case UIVisualStateType_Fullscreen:1784 m_enmInitialVisualState = m_enmRequestedVisualState;1785 break;1786 default:1787 break;1788 }1789 }1790 }1791 1792 1795 void UIMachine::enterInitialVisualState() 1793 1796 { … … 1799 1802 /* Delete machine-logic if any: */ 1800 1803 UIMachineLogic::destroy(m_pMachineLogic); 1804 } 1805 1806 void UIMachine::cleanupBranding() 1807 { 1808 /* Cleanup machine-window icon: */ 1809 delete m_pMachineWindowIcon; 1810 m_pMachineWindowIcon = 0; 1801 1811 } 1802 1812 … … 1822 1832 } 1823 1833 1824 void UIMachine::cleanupBranding()1825 {1826 /* Cleanup machine-window icon: */1827 delete m_pMachineWindowIcon;1828 m_pMachineWindowIcon = 0;1829 }1830 1831 1834 void UIMachine::cleanupSession() 1832 1835 { … … 1848 1851 /* Cleanup stuff: */ 1849 1852 cleanupMachineLogic(); 1853 cleanupBranding(); 1850 1854 cleanupHostScreenData(); 1851 1855 cleanupActions(); 1852 cleanupBranding();1853 1856 cleanupSession(); 1854 1857 cleanupNotificationCenter(); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.h
r99141 r99142 846 846 /** Prepare routine: Session stuff. */ 847 847 bool prepareSession(); 848 /** Prepare routine: Branding. */849 void prepareBranding();850 848 /** Prepare routine: Actions stuff. */ 851 849 void prepareActions(); 852 850 /** Prepare routine: Host-screen data stuff. */ 853 851 void prepareHostScreenData(); 854 /** Prepare routine: Guest-screen data stuff. */855 void prepareGuestScreenData();856 852 /** Prepare routine: Keyboard stuff. */ 857 853 void prepareKeyboard(); … … 861 857 void prepareVisualState(); 862 858 859 /** Update routine: Branding. */ 860 void updateBranding(); 861 /** Update routine: Guest screen data stuff. */ 862 void updateGuestScreenData(); 863 863 864 /** Moves VM to initial state. */ 864 865 void enterInitialVisualState(); … … 866 867 /** Cleanup routine: Machine-logic stuff. */ 867 868 void cleanupMachineLogic(); 869 /** Cleanup routine: Branding. */ 870 void cleanupBranding(); 868 871 /** Cleanup routine: Host-screen data stuff. */ 869 872 void cleanupHostScreenData(); 870 873 /** Cleanup routine: Actions stuff. */ 871 874 void cleanupActions(); 872 /** Cleanup routine: Branding. */873 void cleanupBranding();874 875 /** Cleanup routine: Session stuff. */ 875 876 void cleanupSession();
Note:
See TracChangeset
for help on using the changeset viewer.