Changeset 34158 in vbox
- Timestamp:
- Nov 18, 2010 9:56:36 AM (14 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIActionsPool.cpp
r33470 r34158 1192 1192 * when creating a new QMenuBar. For simplicity we doing this on all 1193 1193 * platforms right now. */ 1194 if (m_actionsPool[UIActionIndex_Simple_Help]) 1195 delete m_actionsPool[UIActionIndex_Simple_Help]; 1196 m_actionsPool[UIActionIndex_Simple_Help] = new ShowHelpAction(this); 1197 if (m_actionsPool[UIActionIndex_Simple_Web]) 1198 delete m_actionsPool[UIActionIndex_Simple_Web]; 1199 m_actionsPool[UIActionIndex_Simple_Web] = new ShowWebAction(this); 1200 if (m_actionsPool[UIActionIndex_Simple_ResetWarnings]) 1201 delete m_actionsPool[UIActionIndex_Simple_ResetWarnings]; 1202 m_actionsPool[UIActionIndex_Simple_ResetWarnings] = new PerformResetWarningsAction(this); 1203 #ifdef VBOX_WITH_REGISTRATION 1204 if (m_actionsPool[UIActionIndex_Simple_Register]) 1205 delete m_actionsPool[UIActionIndex_Simple_Register] 1206 m_actionsPool[UIActionIndex_Simple_Register] = new PerformRegisterAction(this); 1207 #endif /* VBOX_WITH_REGISTRATION */ 1208 #if defined(Q_WS_MAC) && (QT_VERSION >= 0x040700) 1209 /* For whatever reason, Qt doesn't fully remove items with a 1210 * ApplicationSpecificRole from the application menu. Although the QAction 1211 * itself is deleted, a dummy entry is leaved back in the menu. Hiding 1212 * before deletion helps. */ 1213 m_actionsPool[UIActionIndex_Simple_Update]->setVisible(false); 1214 #endif /* Q_WS_MAC */ 1215 /* Delete the help items as well. This makes sure they are removed also 1216 * from the Application menu. */ 1217 #if !(defined(Q_WS_MAC) && (QT_VERSION < 0x040700)) 1218 if (m_actionsPool[UIActionIndex_Simple_About]) 1219 delete m_actionsPool[UIActionIndex_Simple_About]; 1220 m_actionsPool[UIActionIndex_Simple_About] = new ShowAboutAction(this); 1221 if (m_actionsPool[UIActionIndex_Simple_Update]) 1222 delete m_actionsPool[UIActionIndex_Simple_Update]; 1223 m_actionsPool[UIActionIndex_Simple_Update] = new PerformUpdateAction(this); 1224 #endif 1225 if (m_actionsPool[UIActionIndex_Simple_Close]) 1226 delete m_actionsPool[UIActionIndex_Simple_Close]; 1227 m_actionsPool[UIActionIndex_Simple_Close] = new PerformCloseAction(this); 1228 1229 /* Menus */ 1194 1230 if (m_actionsPool[UIActionIndex_Menu_Machine]) 1195 1231 delete m_actionsPool[UIActionIndex_Menu_Machine]; -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineMenuBar.cpp
r33676 r34158 167 167 #ifndef Q_WS_MAC 168 168 pMenu->addSeparator(); 169 #else /* Q_WS_MAC */170 if (m_fIsFirstTime)171 169 #endif /* !Q_WS_MAC */ 172 170 pMenu->addAction(pActionsPool->action(UIActionIndex_Simple_Close)); 173 171 } 174 172 … … 222 220 #endif 223 221 224 #if def Q_WS_MAC222 #if defined(Q_WS_MAC) && (QT_VERSION < 0x040700) 225 223 if (m_fIsFirstTime) 226 # endif /* Q_WS_MAC */224 # endif 227 225 pMenu->addAction(pActionsPool->action(UIActionIndex_Simple_Update)); 228 229 226 #ifndef Q_WS_MAC 230 227 pMenu->addSeparator(); 231 #else /* Q_WS_MAC */ 228 #endif /* !Q_WS_MAC */ 229 #if defined(Q_WS_MAC) && (QT_VERSION < 0x040700) 232 230 if (m_fIsFirstTime) 233 # endif /* !Q_WS_MAC */231 # endif 234 232 pMenu->addAction(pActionsPool->action(UIActionIndex_Simple_About)); 235 233 234 235 #if defined(Q_WS_MAC) && (QT_VERSION < 0x040700) 236 236 /* Because this connections are done to VBoxGlobal, they are needed once only. 237 237 * Otherwise we will get the slots called more than once. */ 238 238 if (m_fIsFirstTime) 239 239 { 240 VBoxGlobal::connect(pActionsPool->action(UIActionIndex_Simple_Help), SIGNAL(triggered()), 241 &vboxProblem(), SLOT(showHelpHelpDialog())); 242 VBoxGlobal::connect(pActionsPool->action(UIActionIndex_Simple_Web), SIGNAL(triggered()), 243 &vboxProblem(), SLOT(showHelpWebDialog())); 244 VBoxGlobal::connect(pActionsPool->action(UIActionIndex_Simple_ResetWarnings), SIGNAL(triggered()), 245 &vboxProblem(), SLOT(resetSuppressedMessages())); 246 #ifdef VBOX_WITH_REGISTRATION 247 VBoxGlobal::connect(pActionsPool->action(UIActionIndex_Simple_Register), SIGNAL(triggered()), 248 &vboxGlobal(), SLOT(showRegistrationDialog())); 249 #endif /* VBOX_WITH_REGISTRATION */ 240 #endif 241 VBoxGlobal::connect(pActionsPool->action(UIActionIndex_Simple_About), SIGNAL(triggered()), 242 &vboxProblem(), SLOT(showHelpAboutDialog())); 250 243 VBoxGlobal::connect(pActionsPool->action(UIActionIndex_Simple_Update), SIGNAL(triggered()), 251 244 &vboxGlobal(), SLOT(showUpdateDialog())); 252 VBoxGlobal::connect(pActionsPool->action(UIActionIndex_Simple_About), SIGNAL(triggered()), 253 &vboxProblem(), SLOT(showHelpAboutDialog())); 254 245 #if defined(Q_WS_MAC) && (QT_VERSION < 0x040700) 246 } 247 #endif 248 249 VBoxGlobal::connect(pActionsPool->action(UIActionIndex_Simple_Help), SIGNAL(triggered()), 250 &vboxProblem(), SLOT(showHelpHelpDialog())); 251 VBoxGlobal::connect(pActionsPool->action(UIActionIndex_Simple_Web), SIGNAL(triggered()), 252 &vboxProblem(), SLOT(showHelpWebDialog())); 253 VBoxGlobal::connect(pActionsPool->action(UIActionIndex_Simple_ResetWarnings), SIGNAL(triggered()), 254 &vboxProblem(), SLOT(resetSuppressedMessages())); 255 255 #ifdef VBOX_WITH_REGISTRATION 256 VBoxGlobal::connect(gEDataEvents, SIGNAL(sigCanShowRegistrationDlg(bool)), 257 pActionsPool->action(UIActionIndex_Simple_Register), SLOT(setEnabled(bool))); 256 VBoxGlobal::connect(pActionsPool->action(UIActionIndex_Simple_Register), SIGNAL(triggered()), 257 &vboxGlobal(), SLOT(showRegistrationDialog())); 258 VBoxGlobal::connect(gEDataEvents, SIGNAL(sigCanShowRegistrationDlg(bool)), 259 pActionsPool->action(UIActionIndex_Simple_Register), SLOT(setEnabled(bool))); 258 260 #endif /* VBOX_WITH_REGISTRATION */ 259 VBoxGlobal::connect(gEDataEvents, SIGNAL(sigCanShowUpdateDlg(bool)), 260 pActionsPool->action(UIActionIndex_Simple_Update), SLOT(setEnabled(bool))); 261 262 m_fIsFirstTime = false; 263 } 261 262 m_fIsFirstTime = false; 264 263 } 265 264
Note:
See TracChangeset
for help on using the changeset viewer.