Changeset 51569 in vbox
- Timestamp:
- Jun 6, 2014 3:23:18 PM (11 years ago)
- svn:sync-xref-src-repo-rev:
- 94249
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp
r51565 r51569 826 826 } 827 827 828 int UIExtraDataManager::hostScreenForPassedGuestScreen(int iGuestScreenIndex, const QString &strID) 829 { 830 /* Choose corresponding key: */ 831 const QString strKey = extraDataKeyPerScreen(GUI_VirtualScreenToHostScreen, iGuestScreenIndex, true); 832 833 /* Load value and convert it to index: */ 834 const QString strValue = extraDataString(strKey, strID); 835 bool fOk = false; 836 const int iHostScreenIndex = strValue.toULong(&fOk); 837 838 /* Return corresponding index: */ 839 return fOk ? iHostScreenIndex : -1; 840 } 841 842 void UIExtraDataManager::setHostScreenForPassedGuestScreen(int iGuestScreenIndex, int iHostScreenIndex, const QString &strID) 843 { 844 /* Choose corresponding key: */ 845 const QString strKey = extraDataKeyPerScreen(GUI_VirtualScreenToHostScreen, iGuestScreenIndex, true); 846 847 /* Save passed index under corresponding value: */ 848 setExtraDataString(strKey, iHostScreenIndex != -1 ? QString::number(iHostScreenIndex) : QString(), strID); 849 } 850 828 851 MachineCloseAction UIExtraDataManager::restrictedMachineCloseActions(const QString &strID) const 829 852 { … … 1203 1226 1204 1227 /* static */ 1205 QString UIExtraDataManager::extraDataKeyPerScreen(const QString &strBase, ulong uScreenIndex )1206 { 1207 return uScreenIndex ? strBase + QString::number(uScreenIndex) : strBase;1228 QString UIExtraDataManager::extraDataKeyPerScreen(const QString &strBase, ulong uScreenIndex, bool fSameRuleForPrimary /* = false */) 1229 { 1230 return fSameRuleForPrimary || uScreenIndex ? strBase + QString::number(uScreenIndex) : strBase; 1208 1231 } 1209 1232 -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.h
r51565 r51569 235 235 void setRequestedVisualState(UIVisualStateType visualState, const QString &strID); 236 236 237 /** Returns host-screen index corresponding to passed guest-screen @a iGuestScreenIndex. */ 238 int hostScreenForPassedGuestScreen(int iGuestScreenIndex, const QString &strID); 239 /** Defines host-screen index corresponding to passed guest-screen @a iGuestScreenIndex as @a iHostScreenIndex. */ 240 void setHostScreenForPassedGuestScreen(int iGuestScreenIndex, int iHostScreenIndex, const QString &strID); 241 237 242 /** Returns default machine close action. */ 238 243 MachineCloseAction defaultMachineCloseAction(const QString &strID) const; … … 315 320 void setExtraDataStringList(const QString &strKey, const QStringList &strValue, const QString &strID = m_sstrGlobalID); 316 321 317 /** Return a string consisting of @a strBase with a suffix for the passed screen.318 * Used for storing per-screen extra-data. */319 static QString extraDataKeyPerScreen(const QString &strBase, ulong uScreenIndex );322 /** Returns string consisting of @a strBase appended with @a uScreenIndex for the *non-primary* screen-index. 323 * If @a fSameRuleForPrimary is 'true' same rule will be used for *primary* screen-index. Used for storing per-screen extra-data. */ 324 static QString extraDataKeyPerScreen(const QString &strBase, ulong uScreenIndex, bool fSameRuleForPrimary = false); 320 325 321 326 /** Singleton Extra-data Manager instance. */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMultiScreenLayout.cpp
r51054 r51569 93 93 { 94 94 /* If the user ever selected a combination in the view menu, we have the following entry: */ 95 QString strTest = machine.GetExtraData(QString("%1%2").arg(GUI_VirtualScreenToHostScreen).arg(iGuestScreen)); 96 bool fOk; 97 /* Check is this value can be converted: */ 98 iHostScreen = strTest.toInt(&fOk); 95 iHostScreen = gEDataManager->hostScreenForPassedGuestScreen(iGuestScreen, vboxGlobal().managedVMUuid()); 99 96 /* Revalidate: */ 100 fValid = fOk /* Valid data */ 101 && iHostScreen >= 0 && iHostScreen < m_cHostScreens /* In the host screen bounds? */ 97 fValid = iHostScreen >= 0 && iHostScreen < m_cHostScreens /* In the host screen bounds? */ 102 98 && m_screenMap.key(iHostScreen, -1) == -1; /* Not taken already? */ 103 99 } … … 379 375 int iHostScreen = m_screenMap.value(iGuestScreen, -1); 380 376 if (fWithSave) 381 { 382 QString strHostScreen(iHostScreen != -1 ? QString::number(iHostScreen) : QString()); 383 machine.SetExtraData(QString("%1%2").arg(GUI_VirtualScreenToHostScreen).arg(iViewAction), strHostScreen); 384 } 377 gEDataManager->setHostScreenForPassedGuestScreen(iViewAction, iHostScreen, vboxGlobal().managedVMUuid()); 385 378 QList<QAction*> screenActions = viewActions.at(iViewAction)->menu()->actions(); 386 379 /* Update screen actions: */
Note:
See TracChangeset
for help on using the changeset viewer.