1 --- vboxgtk/data/xml/vboxgtk.xml 2011-02-20 13:45:03.650001763 +0800
2 +++ vboxgtk/data/xml/vboxgtk.xml 2011-08-07 22:45:48.385673969 +0800
4 <property name="visible">True</property>
6 <object class="GtkLabel" id="label_hd">
7 + <property name="visible">True</property>
8 <property name="xalign">0</property>
9 <property name="label" translatable="yes">HD: </property>
14 <object class="GtkComboBox" id="combobox_hd">
15 + <property name="visible">True</property>
16 <property name="model">liststore_combo_hd</property>
17 <signal name="changed" handler="on_combobox_hd_changed"/>
23 - <object class="GtkLabel" id="label_hostif">
24 + <object class="GtkLabel" id="label_bridgedif">
25 <property name="visible">True</property>
26 <property name="xalign">0</property>
27 - <property name="label" translatable="yes">Host interface: </property>
28 + <property name="label" translatable="yes">Bridged interface: </property>
31 <property name="top_attach">2</property>
36 - <object class="GtkEntry" id="entry_hostif">
37 + <object class="GtkEntry" id="entry_bridgedif">
38 <property name="visible">True</property>
39 <property name="can_focus">True</property>
40 <signal name="changed" handler="on_devices_changed"/>
45 - <object class="GtkLabel" id="label_mac">
46 + <object class="GtkLabel" id="label_hostonlyif">
47 <property name="visible">True</property>
48 <property name="xalign">0</property>
49 - <property name="label" translatable="yes">MAC address: </property>
50 + <property name="label" translatable="yes">Host only interface: </property>
53 <property name="top_attach">4</property>
58 + <object class="GtkEntry" id="entry_hostonlyif">
59 + <property name="visible">True</property>
60 + <property name="can_focus">True</property>
61 + <signal name="changed" handler="on_devices_changed"/>
64 + <property name="left_attach">1</property>
65 + <property name="right_attach">2</property>
66 + <property name="top_attach">4</property>
67 + <property name="bottom_attach">5</property>
68 + <property name="y_options"></property>
72 + <object class="GtkLabel" id="label_mac">
73 + <property name="visible">True</property>
74 + <property name="xalign">0</property>
75 + <property name="label" translatable="yes">MAC address: </property>
78 + <property name="top_attach">5</property>
79 + <property name="bottom_attach">6</property>
80 + <property name="x_options">GTK_FILL</property>
81 + <property name="y_options"></property>
85 <object class="GtkHBox" id="hbox_mac">
86 <property name="visible">True</property>
90 <property name="left_attach">1</property>
91 <property name="right_attach">2</property>
92 - <property name="top_attach">4</property>
93 - <property name="bottom_attach">5</property>
94 + <property name="top_attach">5</property>
95 + <property name="bottom_attach">6</property>
96 <property name="x_options">GTK_FILL</property>
97 <property name="y_options"></property>
99 @@ -1719,16 +1748,6 @@
103 - <object class="GtkHSeparator" id="hseparator1">
104 - <property name="visible">True</property>
107 - <property name="expand">False</property>
108 - <property name="padding">2</property>
109 - <property name="position">2</property>
113 <object class="GtkButton" id="button_manage_hd_new">
114 <property name="label" translatable="yes">New...</property>
115 <property name="visible">True</property>
116 @@ -1760,6 +1779,16 @@
117 <property name="position">1</property>
121 + <object class="GtkHSeparator" id="hseparator1">
122 + <property name="visible">True</property>
125 + <property name="expand">False</property>
126 + <property name="padding">2</property>
127 + <property name="position">2</property>
132 <property name="expand">False</property>
133 @@ -2010,8 +2039,9 @@
135 <widget name="label_nic_att"/>
136 <widget name="label_nic_dev"/>
137 - <widget name="label_hostif"/>
138 + <widget name="label_bridgedif"/>
139 <widget name="label_intnet"/>
140 + <widget name="label_hostonlyif"/>
141 <widget name="label_mac"/>
142 <widget name="label_trace_file"/>
143 <widget name="label_audio_dev"/>
144 --- vboxgtk/vboxgtk/vboxdao_generic.py 2011-02-20 13:45:03.140001764 +0800
145 +++ vboxgtk/vboxgtk/vboxdao_generic.py 2011-08-07 22:11:50.034064775 +0800
147 def add_hd(self, path):
149 mode = self.cts.AccessMode_ReadWrite
150 - hd = self.vbox.openHardDisk(path, mode)
151 + hd = self.vbox.openMedium(path, self.cts.DeviceType_HardDisk,
153 self.hard_disks.append(hd)
155 except Exception as e:
157 def add_dvd_image(self, path):
159 dvd = self.vbox.openMedium(path, self.cts.DeviceType_DVD,
160 - self.cts.AccessMode_ReadOnly)
161 + self.cts.AccessMode_ReadOnly, False)
162 self.dvd_images.append(dvd)
164 except Exception as e:
167 # Probably no device was connected
169 - session.machine.attachDevice(sc, port, 0, type, device)
172 + device_medium = self.vbox.findMedium(device, type)
174 + device_medium = None
175 + session.machine.attachDevice(sc, port, 0, type, device_medium)
178 session.machine.saveSettings()
180 except Exception as e:
183 def mount_dvd(self, vm_number, dvd_id):
184 vm = self.vms[vm_number]
185 - dvd = self.vbox.findMedium(dvd_id, self.cts.DeviceType_DVD)
187 + dvd = self.vbox.findMedium(dvd_id, self.cts.DeviceType_DVD)
190 + dvd = self.vbox.host.findHostDVDDrive(dvd_id)
194 session = self.get_session(vm)
195 sc = session.machine.getStorageControllers()[0].name
196 @@ -318,26 +332,21 @@
197 session.machine.passthroughDevice(sc, 1, 0, dvd_passthrough)
198 session.machine.saveSettings()
200 - def update_devices(self, vm_number, attachment, device, intnet, hostif,
201 - mac, cable, trace, trace_file, audiodev):
202 + def update_devices(self, vm_number, attachment, device, intnet, bridgedif,
203 + hostonlyif, mac, cable, trace, trace_file, audiodev):
204 vm = self.vms[vm_number]
205 session = self.get_session(vm)
206 net = session.machine.getNetworkAdapter(0)
207 net.adapterType = device
208 net.internalNetwork = intnet
209 - net.hostInterface = hostif
210 + net.bridgedInterface = bridgedif
211 + net.hostOnlyInterface = hostonlyif
213 net.cableConnected = cable
214 net.traceEnabled = trace
215 net.traceFile = trace_file
216 - if attachment == self.cts.NetworkAttachmentType_Null:
218 - elif attachment == self.cts.NetworkAttachmentType_NAT:
220 - elif attachment == self.cts.NetworkAttachmentType_Bridged:
221 - net.attachToBridgedInterface()
222 - elif attachment == self.cts.NetworkAttachmentType_Internal:
223 - net.attachToInternalNetwork()
224 + net.attachmentType = attachment
227 session.machine.audioAdapter.enabled = False
230 vm = self.vms[vm_number]
232 session = self.get_session(vm)
233 - session.machine.createSharedFolder(name, folder, writable)
234 + session.machine.createSharedFolder(name, folder, writable, True)
235 session.machine.saveSettings()
237 except Exception as e:
238 --- vboxgtk/vboxgtk/vboxgtk_iface.py 2011-02-20 13:45:03.140001764 +0800
239 +++ vboxgtk/vboxgtk/vboxgtk_iface.py 2011-08-07 22:28:49.885206435 +0800
240 @@ -125,13 +125,16 @@
241 list_nic_atts = (('Null', self.vboxdao.cts.NetworkAttachmentType_Null),
242 ('NAT', self.vboxdao.cts.NetworkAttachmentType_NAT),
243 ('Bridged', self.vboxdao.cts.NetworkAttachmentType_Bridged),
244 - ('Internal network', self.vboxdao.cts.NetworkAttachmentType_Internal))
245 + ('Internal network', self.vboxdao.cts.NetworkAttachmentType_Internal),
246 + ('Host only', self.vboxdao.cts.NetworkAttachmentType_HostOnly))
247 extend(model_nic_atts, list_nic_atts)
248 model_nic_devs = self.builder.get_object('liststore_nic_devs')
249 list_nic_devs = (('Am79C970A', self.vboxdao.cts.NetworkAdapterType_Am79C970A),
250 ('Am79C973', self.vboxdao.cts.NetworkAdapterType_Am79C973),
251 ('82540EM', self.vboxdao.cts.NetworkAdapterType_I82540EM),
252 - ('I82543GC', self.vboxdao.cts.NetworkAdapterType_I82543GC))
253 + ('I82543GC', self.vboxdao.cts.NetworkAdapterType_I82543GC),
254 + ('I82545EM', self.vboxdao.cts.NetworkAdapterType_I82545EM),
255 + ('Virtio', self.vboxdao.cts.NetworkAdapterType_Virtio))
256 extend(model_nic_devs, list_nic_devs)
257 model_audio_drivers = self.builder.get_object('liststore_audio_devs')
258 list_audio_drivers = (('Null', self.vboxdao.cts.AudioDriverType_Null),
260 self.select_value_in_combobox('combobox_nic_devs', 1, net.adapterType)
261 if net.internalNetwork is not None:
262 self.builder.get_object('entry_intnet').set_text(net.internalNetwork)
263 - if net.hostInterface is not None:
264 - self.builder.get_object('entry_hostif').set_text(net.hostInterface)
265 + if net.hostOnlyInterface is not None:
266 + self.builder.get_object('entry_bridgedif').set_text(net.bridgedInterface)
267 self.builder.get_object('entry_mac').set_text(net.MACAddress)
268 self.builder.get_object('checkbutton_cable_connected').set_active(net.cableConnected)
269 self.builder.get_object('checkbutton_trace').set_active(net.traceEnabled)
270 @@ -557,10 +560,11 @@
273 self.builder.get_object('entry_intnet').set_text(intnet)
274 - hostif = self.builder.get_object('entry_hostif').get_text()
275 + bridgedif = self.builder.get_object('entry_bridgedif').get_text()
276 + hostonlyif = self.builder.get_object('entry_hostonlyif').get_text()
277 self.vboxdao.update_devices(self.selected_vm, net_att, net_dev,
278 - intnet, hostif, mac, cable, trace,
279 - trace_file, audio_dev)
280 + intnet, bridgedif, hostonlyif, mac, cable,
281 + trace, trace_file, audio_dev)
283 def on_devices_nic_atts_changed(self, obj):
284 if self.resetting_devices:
285 @@ -585,11 +589,14 @@
286 sens = nic_att != self.vboxdao.cts.NetworkAttachmentType_Null and nic_att_sensitive
287 self.builder.get_object(w).set_sensitive(sens)
288 sens = nic_att == self.vboxdao.cts.NetworkAttachmentType_Bridged and nic_att_sensitive
289 - self.builder.get_object('label_hostif').set_sensitive(sens)
290 - self.builder.get_object('entry_hostif').set_sensitive(sens)
291 + self.builder.get_object('label_bridgedif').set_sensitive(sens)
292 + self.builder.get_object('entry_bridgedif').set_sensitive(sens)
293 sens = nic_att == self.vboxdao.cts.NetworkAttachmentType_Internal and nic_att_sensitive
294 self.builder.get_object('label_intnet').set_sensitive(sens)
295 self.builder.get_object('entry_intnet').set_sensitive(sens)
296 + sens = nic_att == self.vboxdao.cts.NetworkAttachmentType_HostOnly and nic_att_sensitive
297 + self.builder.get_object('label_hostonlyif').set_sensitive(sens)
298 + self.builder.get_object('entry_hostonlyif').set_sensitive(sens)
299 self.update_trace_file_state()
301 def update_trace_file_state(self):
304 def on_button_shared_add_clicked(self, obj):
305 dialog = self.builder.get_object('dialog_addshared')
306 + self.builder.get_object('entry_shared_name').set_text('');
307 + self.builder.get_object('checkbutton_shared_writable').set_active(False);
310 if dialog.run() != 0: