Changeset 55687 in vbox
- Timestamp:
- May 6, 2015 9:08:05 AM (9 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime
- Files:
-
- 2 edited
-
UISession.cpp (modified) (4 diffs)
-
UISession.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp
r55678 r55687 198 198 } 199 199 200 /* Apply ad-hoc reconfigurations from the command line .*/200 /* Apply ad-hoc reconfigurations from the command line: */ 201 201 if (vboxGlobal().hasFloppyImageToMount()) 202 202 mountAdHocImage(KDeviceType_Floppy, UIMediumType_Floppy, vboxGlobal().getFloppyImage()); … … 1848 1848 } 1849 1849 1850 bool UISession::mountAdHocImage(KDeviceType enmDeviceType, UIMediumType enmMediumType, QString const &strImage) 1851 { 1852 /* 1853 * The 'none' image name means ejecting what ever is in the drive, so leave 1854 * the image variables null. 1855 */ 1850 bool UISession::mountAdHocImage(KDeviceType enmDeviceType, UIMediumType enmMediumType, const QString &strImage) 1851 { 1852 /* The 'none' image name means ejecting what ever is in the drive, 1853 * so leave the image variables null. */ 1856 1854 CVirtualBox vbox = vboxGlobal().virtualBox(); 1857 1855 UIMedium uiImage; 1858 1856 if (strImage != "none") 1859 1857 { 1860 /* 1861 * Open the image. 1862 */ 1863 QString strMediumID; 1858 /* Open the image: */ 1864 1859 CVirtualBox vbox = vboxGlobal().virtualBox(); 1865 1860 CMedium vboxImage = vbox.OpenMedium(strImage, enmDeviceType, KAccessMode_ReadWrite, false /* fForceNewUuid */); 1866 1861 if (!vbox.isOk() || vboxImage.isNull()) 1867 1862 { 1868 msgCenter().cannotOpenMedium(vbox, enmMediumType, strImage , mainMachineWindow());1863 msgCenter().cannotOpenMedium(vbox, enmMediumType, strImage); 1869 1864 return false; 1870 1865 } 1871 1866 1872 /* 1873 * Work the cache and use the cached image if possible. 1874 */ 1867 /* Work the cache and use the cached image if possible: */ 1875 1868 uiImage = vboxGlobal().medium(vboxImage.GetId()); 1876 1869 if (uiImage.isNull()) … … 1882 1875 if (vbox.isOk()) 1883 1876 { 1884 /* 1885 * Find suitable storage controller. 1886 */ 1877 /* Find suitable storage controller: */ 1887 1878 foreach (const CStorageController &controller, machine().GetStorageControllers()) 1888 1879 { … … 1891 1882 if (attachment.GetType() == enmDeviceType) 1892 1883 { 1893 /* 1894 * Mount the image. 1895 */ 1884 /* Mount the image: */ 1896 1885 machine().MountMedium(controller.GetName(), attachment.GetPort(), attachment.GetDevice(), uiImage.medium(), true /* force */); 1897 1886 if (machine().isOk()) 1898 1887 return true; 1899 msgCenter().cannotRemountMedium(machine(), uiImage, !uiImage.isNull() /* mount*/, false /* retry? */, mainMachineWindow());1888 msgCenter().cannotRemountMedium(machine(), uiImage, !uiImage.isNull() /* mount */, false /* retry */); 1900 1889 return false; 1901 1890 } 1902 1891 } 1903 1892 } 1904 msgCenter().cannotRemountMedium(machine(), uiImage, !uiImage.isNull() /* mount*/, false /* retry? */, mainMachineWindow());1893 msgCenter().cannotRemountMedium(machine(), uiImage, !uiImage.isNull() /* mount */, false /* retry */); 1905 1894 } 1906 1895 else 1907 msgCenter().cannotOpenMedium(vbox, enmMediumType, strImage , mainMachineWindow());1896 msgCenter().cannotOpenMedium(vbox, enmMediumType, strImage); 1908 1897 return false; 1909 1898 } -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h
r55678 r55687 380 380 void setPointerShape(const uchar *pShapeData, bool fHasAlpha, uint uXHot, uint uYHot, uint uWidth, uint uHeight); 381 381 bool preprocessInitialization(); 382 bool mountAdHocImage(KDeviceType enmDeviceType, enum UIMediumDefs::UIMediumType enmMediumType, QString const&strImage);382 bool mountAdHocImage(KDeviceType enmDeviceType, UIMediumType enmMediumType, const QString &strImage); 383 383 bool postprocessInitialization(); 384 384 int countOfVisibleWindows();
Note:
See TracChangeset
for help on using the changeset viewer.

