Changeset 44832 in vbox for trunk/src/VBox
- Timestamp:
- Feb 26, 2013 4:11:20 PM (12 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMultiScreenLayout.cpp
r44831 r44832 120 120 } 121 121 122 /* Get the list of all view-menu actions: */ 123 QList<QAction*> viewMenuActions = gActionPool->action(UIActionIndexRuntime_Menu_View)->menu()->actions(); 124 /* Get the list of all view related actions: */ 125 QList<QAction*> viewActions; 126 for (int i = 0; i < viewMenuActions.size(); ++i) 127 { 128 if (viewMenuActions[i]->data().toBool()) 129 viewActions << viewMenuActions[i]; 130 } 131 /* Mark currently chosen action: */ 132 for (int i = 0; i < viewActions.size(); ++i) 133 { 134 int iHostScreen = m_pScreenMap->value(i); 135 QList<QAction*> screenActions = viewActions.at(i)->menu()->actions(); 136 for (int w = 0; w < screenActions.size(); ++w) 137 { 138 QAction *pTmpAction = screenActions.at(w); 139 pTmpAction->blockSignals(true); 140 pTmpAction->setChecked(RT_HIWORD(pTmpAction->data().toInt()) == iHostScreen); 141 pTmpAction->blockSignals(false); 142 } 143 } 122 /* Update menu actions: */ 123 updateMenuActions(false); 144 124 } 145 125 … … 224 204 } 225 205 226 /* Get the list of all view-menu actions: */ 227 QList<QAction*> viewMenuActions = gActionPool->action(UIActionIndexRuntime_Menu_View)->menu()->actions(); 228 /* Get the list of all view related actions: */ 229 QList<QAction*> viewActions; 230 for (int i = 0; i < viewMenuActions.size(); ++i) 231 { 232 if (viewMenuActions[i]->data().toBool()) 233 viewActions << viewMenuActions[i]; 234 } 235 /* Update the menu items. Even if we can't switch we have to revert the menu items. */ 236 for (int i = 0; i < viewActions.size(); ++i) 237 { 238 int iHostScreen = m_pScreenMap->value(i); 239 machine.SetExtraData(QString("%1%2").arg(GUI_VirtualScreenToHostScreen).arg(i), QString::number(iHostScreen)); 240 QList<QAction*> screenActions = viewActions.at(i)->menu()->actions(); 241 for (int w = 0; w < screenActions.size(); ++w) 242 { 243 QAction *pTmpAction = screenActions.at(w); 244 pTmpAction->blockSignals(true); 245 pTmpAction->setChecked(RT_HIWORD(pTmpAction->data().toInt()) == iHostScreen); 246 pTmpAction->blockSignals(false); 247 } 248 } 206 /* Update menu actions: */ 207 updateMenuActions(true); 249 208 250 209 /* On success inform the observer. */ … … 309 268 } 310 269 270 void UIMultiScreenLayout::updateMenuActions(bool fWithSave) 271 { 272 /* Get the list of all view-menu actions: */ 273 QList<QAction*> viewMenuActions = gActionPool->action(UIActionIndexRuntime_Menu_View)->menu()->actions(); 274 /* Get the list of all view related actions: */ 275 QList<QAction*> viewActions; 276 for (int i = 0; i < viewMenuActions.size(); ++i) 277 if (viewMenuActions[i]->data().toBool()) 278 viewActions << viewMenuActions[i]; 279 /* Update view actions: */ 280 CMachine machine = m_pMachineLogic->session().GetMachine(); 281 for (int i = 0; i < viewActions.size(); ++i) 282 { 283 int iHostScreen = m_pScreenMap->value(i); 284 if (fWithSave) 285 machine.SetExtraData(QString("%1%2").arg(GUI_VirtualScreenToHostScreen).arg(i), QString::number(iHostScreen)); 286 QList<QAction*> screenActions = viewActions.at(i)->menu()->actions(); 287 /* Update screen actions: */ 288 for (int j = 0; j < screenActions.size(); ++j) 289 { 290 QAction *pTmpAction = screenActions.at(j); 291 pTmpAction->blockSignals(true); 292 pTmpAction->setChecked(RT_HIWORD(pTmpAction->data().toInt()) == iHostScreen); 293 pTmpAction->blockSignals(false); 294 } 295 } 296 } 297 311 298 quint64 UIMultiScreenLayout::memoryRequirements(const QMap<int, int> *pScreenLayout) const 312 299 { -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMultiScreenLayout.h
r44831 r44832 74 74 75 75 /* Other helpers: */ 76 void updateMenuActions(bool fWithSave); 76 77 quint64 memoryRequirements(const QMap<int, int> *pScreenLayout) const; 77 78
Note:
See TracChangeset
for help on using the changeset viewer.