Changeset 42382 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Jul 25, 2012 9:35:56 AM (12 years ago)
- Location:
- trunk/src/VBox/Frontends
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxHeadless/VBoxHeadless.cpp
r41959 r42382 43 43 #include <VBox/VBoxVideo.h> 44 44 45 #ifdef VBOX_WITH_VIDEO_REC 45 #ifdef VBOX_WITH_VIDEO_REC 46 46 #include <cstdlib> 47 47 #include <cerrno> … … 827 827 828 828 // open a session 829 CHECK_ERROR_BREAK(m, LockMachine(session, LockType_ Write));829 CHECK_ERROR_BREAK(m, LockMachine(session, LockType_VM)); 830 830 fSessionOpened = true; 831 831 -
trunk/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp
r42248 r42382 1415 1415 AssertReleaseRC(vrc); 1416 1416 1417 rc = pMachine->LockMachine(pSession, LockType_ Write);1417 rc = pMachine->LockMachine(pSession, LockType_VM); 1418 1418 if (FAILED(rc)) 1419 1419 { -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxSnapshotDetailsDlg.cpp
r41610 r42382 112 112 113 113 /* We need a session when we manipulate the snapshot data of a machine. */ 114 CSession session = vboxGlobal().open Session(mSnapshot.GetMachine().GetId(), true);114 CSession session = vboxGlobal().openExistingSession(mSnapshot.GetMachine().GetId()); 115 115 if (session.isNull()) 116 116 return; -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp
r42209 r42382 469 469 AssertMsg(!m_pVirtualMachine, ("Machine already started")); 470 470 471 /* Create session: */472 CSession session = vboxGlobal().openSession(strMachineId );471 /* Create VM session: */ 472 CSession session = vboxGlobal().openSession(strMachineId, KLockType_VM); 473 473 if (session.isNull()) 474 474 return false; … … 1813 1813 * 1814 1814 * @param aId Machine ID. 1815 * @param aExisting @c true to open an existing session with the machine 1816 * which is already running, @c false to open a new direct 1817 * session. 1818 */ 1819 CSession VBoxGlobal::openSession(const QString &aId, bool aExisting /* = false */) 1815 * @param aLockType @c KLockType_Shared to open an existing session with 1816 * the machine which is already running, @c KLockType_Write 1817 * to open a new direct session, @c KLockType_VM to open 1818 * a new session for running a VM in this process. 1819 */ 1820 CSession VBoxGlobal::openSession(const QString &aId, KLockType aLockType /* = KLockType_Shared */) 1820 1821 { 1821 1822 CSession session; … … 1830 1831 if (!foundMachine.isNull()) 1831 1832 { 1832 foundMachine.LockMachine(session, 1833 (aExisting) ? KLockType_Shared : KLockType_Write); 1833 foundMachine.LockMachine(session, aLockType); 1834 1834 if (session.GetType() == KSessionType_Shared) 1835 1835 { -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h
r42209 r42382 239 239 #endif 240 240 241 CSession openSession(const QString &aId, bool aExisting = false);241 CSession openSession(const QString &aId, KLockType aLockType = KLockType_Write); 242 242 243 243 /** Shortcut to openSession (aId, true). */ 244 CSession openExistingSession(const QString &aId) { return openSession (aId, true); }244 CSession openExistingSession(const QString &aId) { return openSession(aId, KLockType_Shared); } 245 245 246 246 void startEnumeratingMedia(); -
trunk/src/VBox/Frontends/VirtualBox/src/selector/VBoxSnapshotsWgt.cpp
r41819 r42382 645 645 /* Open a direct session (this call will handle all errors) */ 646 646 bool busy = mSessionState != KSessionState_Unlocked; 647 CSession session = vboxGlobal().openSession (mMachineId, busy /* aExisting */); 647 CSession session; 648 if (busy) 649 session = vboxGlobal().openExistingSession(mMachineId); 650 else 651 session = vboxGlobal().openSession(mMachineId); 648 652 if (session.isNull()) 649 653 return; … … 779 783 780 784 /* Open a session to work with corresponding VM: */ 781 CSession session = vboxGlobal().openSession(mMachineId, 782 mSessionState != KSessionState_Unlocked /* connect to existing */); 785 CSession session; 786 if (mSessionState != KSessionState_Unlocked) 787 session = vboxGlobal().openExistingSession(mMachineId); 788 else 789 session = vboxGlobal().openSession(mMachineId); 783 790 fIsValid = !session.isNull(); 784 791 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialogSpecific.cpp
r41689 r42382 748 748 749 749 /* Prepare session: */ 750 m_session = dialogType() == SettingsDialogType_Wrong ? CSession() : vboxGlobal().open Session(m_strMachineId, true /* shared */);750 m_session = dialogType() == SettingsDialogType_Wrong ? CSession() : vboxGlobal().openExistingSession(m_strMachineId); 751 751 /* Check that session was created: */ 752 752 if (m_session.isNull()) … … 787 787 788 788 /* Prepare session: */ 789 bool fSessionShared = dialogType() != SettingsDialogType_Offline; 790 m_session = dialogType() == SettingsDialogType_Wrong ? CSession() : vboxGlobal().openSession(m_strMachineId, fSessionShared); 789 if (dialogType() == SettingsDialogType_Wrong) 790 m_session = CSession(); 791 else if (dialogType() != SettingsDialogType_Offline) 792 m_session = vboxGlobal().openExistingSession(m_strMachineId); 793 else 794 m_session = vboxGlobal().openSession(m_strMachineId); 791 795 /* Check that session was created: */ 792 796 if (m_session.isNull())
Note:
See TracChangeset
for help on using the changeset viewer.