[vbox-dev] VirtualBox Coding questions

Alexey Eromenko al4321 at gmail.com
Sat Jan 7 17:17:49 PST 2012


Hi,

I'm trying to modify VirtualBox GUI to include my new feature
(vbox-unattended).

In file "src/VBox/Frontends/VirtualBox/src/wizards/newvm/UINewVMWzd.cpp"
(vbox SVN) I see:
UINewVMWzdPage5::constructMachine()
{
  ...
  m.AttachDevice(ctrDvdName, 1, 0, KDeviceType_DVD, CMedium());
}

I try to change the code to open DVD medium:

              QString isopath = "/tmp/cd1.iso";
              CMedium mymedium = vboxGlobal().openMedium(isopath,
KDeviceType_DVD, KAccessMode_ReadOnly, 0);
              m.AttachDevice(ctrDvdName, 1, 0, KDeviceType_DVD, mymedium);

I get compiling error:

/home/user/Linstall/vbox/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UINewVMWzd.cpp:
In member function ‘bool UINewVMWzdPage5::constructMachine()’:
/home/user/Linstall/vbox/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UINewVMWzd.cpp:901:
error: no matching function for call to
‘VBoxGlobal::openMedium(QString&, KDeviceType, KAccessMode, int)’
/home/user/Linstall/vbox/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h:631:
note: candidates are: QString
VBoxGlobal::openMedium(VBoxDefs::MediumType, QString, QWidget*)
...

What would be the correct way ?

Thanks in advance,
-- 
-Alexey Eromenko "Technologov", 08.01.2012.




More information about the vbox-dev mailing list