updated on Mon Jan 23 12:00:23 UTC 2012
[aur-mirror.git] / vboxgtk-svn / fixes.patch
blob3b29b36a47c2612b608ebbc1617da8da1e3250a5
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
3 @@ -407,6 +407,7 @@
4 <property name="visible">True</property>
5 <child>
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>
10 </object>
11 @@ -417,6 +418,7 @@
12 </child>
13 <child>
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"/>
18 <child>
19 @@ -634,10 +636,10 @@
20 </packing>
21 </child>
22 <child>
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>
29 </object>
30 <packing>
31 <property name="top_attach">2</property>
32 @@ -647,7 +649,7 @@
33 </packing>
34 </child>
35 <child>
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"/>
41 @@ -688,10 +690,10 @@
42 </packing>
43 </child>
44 <child>
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>
51 </object>
52 <packing>
53 <property name="top_attach">4</property>
54 @@ -701,6 +703,33 @@
55 </packing>
56 </child>
57 <child>
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"/>
62 + </object>
63 + <packing>
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>
69 + </packing>
70 + </child>
71 + <child>
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>
76 + </object>
77 + <packing>
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>
82 + </packing>
83 + </child>
84 + <child>
85 <object class="GtkHBox" id="hbox_mac">
86 <property name="visible">True</property>
87 <child>
88 @@ -731,8 +760,8 @@
89 <packing>
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>
98 </packing>
99 @@ -1719,16 +1748,6 @@
100 </packing>
101 </child>
102 <child>
103 - <object class="GtkHSeparator" id="hseparator1">
104 - <property name="visible">True</property>
105 - </object>
106 - <packing>
107 - <property name="expand">False</property>
108 - <property name="padding">2</property>
109 - <property name="position">2</property>
110 - </packing>
111 - </child>
112 - <child>
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>
118 </packing>
119 </child>
120 + <child>
121 + <object class="GtkHSeparator" id="hseparator1">
122 + <property name="visible">True</property>
123 + </object>
124 + <packing>
125 + <property name="expand">False</property>
126 + <property name="padding">2</property>
127 + <property name="position">2</property>
128 + </packing>
129 + </child>
130 </object>
131 <packing>
132 <property name="expand">False</property>
133 @@ -2010,8 +2039,9 @@
134 <widgets>
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
146 @@ -160,7 +160,8 @@
147 def add_hd(self, path):
148 try:
149 mode = self.cts.AccessMode_ReadWrite
150 - hd = self.vbox.openHardDisk(path, mode)
151 + hd = self.vbox.openMedium(path, self.cts.DeviceType_HardDisk,
152 + mode, False)
153 self.hard_disks.append(hd)
154 return (0, None)
155 except Exception as e:
156 @@ -181,7 +182,7 @@
157 def add_dvd_image(self, path):
158 try:
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)
163 return (0, None)
164 except Exception as e:
165 @@ -277,7 +278,14 @@
166 except:
167 # Probably no device was connected
168 pass
169 - session.machine.attachDevice(sc, port, 0, type, device)
170 + try:
171 + try:
172 + device_medium = self.vbox.findMedium(device, type)
173 + except:
174 + device_medium = None
175 + session.machine.attachDevice(sc, port, 0, type, device_medium)
176 + except:
177 + pass
178 session.machine.saveSettings()
179 return (0, None)
180 except Exception as e:
181 @@ -295,7 +303,13 @@
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)
186 + try:
187 + dvd = self.vbox.findMedium(dvd_id, self.cts.DeviceType_DVD)
188 + except:
189 + try:
190 + dvd = self.vbox.host.findHostDVDDrive(dvd_id)
191 + except:
192 + dvd = None
193 try:
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
212 net.MACAddress = mac
213 net.cableConnected = cable
214 net.traceEnabled = trace
215 net.traceFile = trace_file
216 - if attachment == self.cts.NetworkAttachmentType_Null:
217 - net.detach()
218 - elif attachment == self.cts.NetworkAttachmentType_NAT:
219 - net.attachToNAT()
220 - elif attachment == self.cts.NetworkAttachmentType_Bridged:
221 - net.attachToBridgedInterface()
222 - elif attachment == self.cts.NetworkAttachmentType_Internal:
223 - net.attachToInternalNetwork()
224 + net.attachmentType = attachment
226 if audiodev == -1:
227 session.machine.audioAdapter.enabled = False
228 else:
229 @@ -349,7 +358,7 @@
230 vm = self.vms[vm_number]
231 try:
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()
236 return (0, None)
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),
259 @@ -516,8 +519,8 @@
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 @@
271 if intnet == '':
272 intnet = 'intnet'
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):
302 @@ -628,6 +635,8 @@
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);
308 finished = False
309 while not finished:
310 if dialog.run() != 0: