Changeset 57897 in vbox
- Timestamp:
- Sep 25, 2015 2:24:50 PM (9 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumManager.cpp
r56217 r57897 956 956 retranslateUi(); 957 957 958 #ifdef Q_WS_MAC959 /* Prepare Mac window-menu.960 * Should go *after* translation! */961 prepareMacWindowMenu();962 #endif /* Q_WS_MAC */963 964 958 /* Center according pseudo-parent widget: */ 965 959 VBoxGlobal::centerWidget(this, m_pPseudoParentWidget, false); … … 1081 1075 void UIMediumManager::prepareMenuBar() 1082 1076 { 1083 /* Create menu-bar-menu: */1077 /* Create 'Actions' menu: */ 1084 1078 m_pMenu = menuBar()->addMenu(QString()); 1085 1079 AssertPtrReturnVoid(m_pMenu); 1086 1080 { 1087 /* Configure menu-bar-menu: */1081 /* Configure 'Actions' menu: */ 1088 1082 m_pMenu->addAction(m_pActionCopy); 1089 1083 m_pMenu->addAction(m_pActionModify); … … 1092 1086 m_pMenu->addAction(m_pActionRefresh); 1093 1087 } 1088 1089 #ifdef Q_WS_MAC 1090 /* Prepare 'Window' menu: */ 1091 AssertPtrReturnVoid(gpWindowMenuManager); 1092 menuBar()->addMenu(gpWindowMenuManager->createMenu(this)); 1093 gpWindowMenuManager->addWindow(this); 1094 #endif /* Q_WS_MAC */ 1094 1095 } 1095 1096 … … 1329 1330 } 1330 1331 1331 #ifdef Q_WS_MAC1332 void UIMediumManager::prepareMacWindowMenu()1333 {1334 /* Create window-menu for menu-bar: */1335 menuBar()->addMenu(UIWindowMenuManager::instance()->createMenu(this));1336 UIWindowMenuManager::instance()->addWindow(this);1337 }1338 #endif /* Q_WS_MAC */1339 1340 1332 void UIMediumManager::repopulateTreeWidgets() 1341 1333 { … … 1709 1701 } 1710 1702 1703 void UIMediumManager::cleanupMenuBar() 1704 { 1711 1705 #ifdef Q_WS_MAC 1712 void UIMediumManager::cleanupMacWindowMenu() 1713 { 1714 /* Destroy window-menu of menu-bar: */ 1715 UIWindowMenuManager::instance()->removeWindow(this); 1716 UIWindowMenuManager::instance()->destroyMenu(this); 1717 } 1706 /* Cleanup 'Window' menu: */ 1707 AssertPtrReturnVoid(gpWindowMenuManager); 1708 gpWindowMenuManager->removeWindow(this); 1709 gpWindowMenuManager->destroyMenu(this); 1718 1710 #endif /* Q_WS_MAC */ 1711 } 1719 1712 1720 1713 void UIMediumManager::cleanup() 1721 1714 { 1722 #ifdef Q_WS_MAC 1723 /* Cleanup Mac window-menu: */ 1724 cleanupMacWindowMenu(); 1725 #endif /* Q_WS_MAC */ 1715 /* Cleanup menu-bar: */ 1716 cleanupMenuBar(); 1726 1717 } 1727 1718 -
trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumManager.h
r55401 r57897 134 134 /** Prepare progress-bar. */ 135 135 void prepareProgressBar(); 136 #ifdef Q_WS_MAC137 /** Mac OS X: Prepare <i>Window</i> menu. */138 void prepareMacWindowMenu();139 #endif /* Q_WS_MAC */140 136 141 137 /** Repopulates tree-widgets content. */ … … 164 160 void updateInformationFieldsFD(); 165 161 166 #ifdef Q_WS_MAC 167 /** Mac OS X: Cleanup <i>Window</i> menu. */ 168 void cleanupMacWindowMenu(); 169 #endif /* Q_WS_MAC */ 162 /** Cleanup menu-bar. */ 163 void cleanupMenuBar(); 170 164 /** General cleanup wrapper. */ 171 165 void cleanup(); -
trunk/src/VBox/Frontends/VirtualBox/src/platform/darwin/UIWindowMenuManager.cpp
r57895 r57897 196 196 197 197 /* static */ 198 UIWindowMenuManager* UIWindowMenuManager::instance() 199 { 200 /* Make sure 'Window' menu Manager is created: */ 201 if (!m_spInstance) 202 m_spInstance = new UIWindowMenuManager; 203 204 /* Return 'Window' menu Manager: */ 205 return m_spInstance; 198 void UIWindowMenuManager::create() 199 { 200 /* Make sure 'Window' menu Manager is not created: */ 201 AssertReturnVoid(!m_spInstance); 202 203 /* Create 'Window' menu Manager: */ 204 new UIWindowMenuManager; 206 205 } 207 206 -
trunk/src/VBox/Frontends/VirtualBox/src/platform/darwin/UIWindowMenuManager.h
r57892 r57897 38 38 public: 39 39 40 /** Static constructor and instance provider. */41 static UIWindowMenuManager* instance();40 /** Static constructor. */ 41 static void create(); 42 42 /** Static destructor. */ 43 43 static void destroy(); 44 /** Static instance provider. */ 45 static UIWindowMenuManager* instance() { return m_spInstance; } 44 46 45 47 /** Creates 'Window' menu for passed @a pWindow. */ … … 78 80 }; 79 81 82 #define gpWindowMenuManager UIWindowMenuManager::instance() 83 80 84 #endif /* !___UIWindowMenuManager_h___ */ 81 85 -
trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.cpp
r57891 r57897 1155 1155 # endif /* MAC_LEOPARD_STYLE */ 1156 1156 1157 UIWindowMenuManager::instance()->addWindow(this);1158 1157 /* Beta label? */ 1159 1158 if (vboxGlobal().isBeta()) … … 1212 1211 1213 1212 #ifdef Q_WS_MAC 1214 menuBar()->addMenu(UIWindowMenuManager::instance()->createMenu(this)); 1213 /* Prepare 'Window' menu: */ 1214 UIWindowMenuManager::create(); 1215 menuBar()->addMenu(gpWindowMenuManager->createMenu(this)); 1216 gpWindowMenuManager->addWindow(this); 1215 1217 #endif /* Q_WS_MAC */ 1216 1218 … … 1707 1709 void UISelectorWindow::cleanupMenuBar() 1708 1710 { 1711 #ifdef Q_WS_MAC 1712 /* Cleanup 'Window' menu: */ 1713 UIWindowMenuManager::destroy(); 1714 #endif /* Q_WS_MAC */ 1715 1709 1716 /* Destroy action-pool: */ 1710 1717 UIActionPool::destroy(m_pActionPool); … … 1715 1722 /* Destroy event handlers: */ 1716 1723 UIVirtualBoxEventHandler::destroy(); 1717 1718 #ifdef Q_WS_MAC1719 UIWindowMenuManager::destroy();1720 #endif /* Q_WS_MAC */1721 1724 1722 1725 /* Save settings: */ -
trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.h
r57844 r57897 52 52 /** Static destructor. */ 53 53 static void destroy(); 54 /** Static instance . */54 /** Static instance provider. */ 55 55 static UISelectorWindow* instance() { return m_spInstance; } 56 56 … … 60 60 protected: 61 61 62 /** Constructs selector-window. 63 * @param ppSelf brings the pointer to pointer to this window instance used by the external caller. 64 * @param flags brings the selector-window flags dialogs should have. */ 62 /** Constructs selector-window. */ 65 63 UISelectorWindow(); 66 64 /** Destructs selector-window. */ … … 259 257 /** @} */ 260 258 261 /** Static instance. */259 /** Holds the static instance. */ 262 260 static UISelectorWindow *m_spInstance; 263 261
Note:
See TracChangeset
for help on using the changeset viewer.