Skip to content

Commit 7d3a9ea

Browse files
committed
See CHANGELOG update
1 parent dd09c1d commit 7d3a9ea

5 files changed

Lines changed: 96 additions & 73 deletions

File tree

CHANGELOG.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,14 @@ Updated to jQuery 3.7.1 and jQuery-UI 1.14.1
1515

1616
PHP 8.4 compatibility
1717

18+
Added Subtype OS filter in VM settings.
19+
20+
Updated Encryption settings tab to match Disk Encryption wording
21+
in VirtualBox 7.1.
22+
23+
Fixed bug when pressing escape to close dialog that would cause
24+
subsequent dialogs to malfunction until the page was reloaded.
25+
1826
-------------------------------------
1927
7.1-1 2025-04-24
2028
-------------------------------------

endpoints/lib/vboxconnector.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3200,6 +3200,7 @@ public function remote_vboxGetGuestOSTypes($args) {
32003200
'familyId' => $g->familyId,
32013201
'familyDescription' => $g->familyDescription,
32023202
'id' => $g->id,
3203+
'subtype' => $g->subtype,
32033204
'description' => $g->description,
32043205
'is64Bit' => $bit64,
32053206
'recommendedRAM' => $g->recommendedRAM,

js/chooser.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1787,7 +1787,7 @@ var vboxChooser = {
17871787
} else {
17881788

17891789
// Hold history
1790-
vboxChooser._showOnlyGroupHistory[vboxChooser._showOnlyGroupHistory.length] = gelm;
1790+
vboxChooser._showOnlyGroupHistory.push(gelm);
17911791
}
17921792

17931793

js/dialogs.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1669,7 +1669,7 @@ function vboxSettingsDialog(title,panes,data,pane,icon,langContext,presave) {
16691669
text: trans('Cancel','QIMessageBox'),
16701670
click: function() {
16711671
results.reject();
1672-
$(this).trigger('close').empty().remove();
1672+
$('#vboxSettingsDialog').trigger('close').empty().remove();
16731673
$(document).trigger('click');
16741674
}
16751675
}
@@ -1680,8 +1680,10 @@ function vboxSettingsDialog(title,panes,data,pane,icon,langContext,presave) {
16801680
$('#vboxSettingsDialog').data('formDataChanged', false);
16811681

16821682
// Show dialog
1683-
$('#vboxSettingsDialog').dialog({'closeOnEscape':true,'width':(panes.length > 1 ? 900 : 600),'height':(panes.length > 1 ? 500 : 450),'buttons':buttons,'modal':true,'autoOpen':true,'classes':{'ui-dialog':'vboxSettingsDialog vboxDialogContent'},'title':(icon ? '<img src="images/vbox/'+icon+'_16px.png" class="vboxDialogTitleIcon" /> ' : '') + title}).on("dialogbeforeclose",function(){
1684-
$(this).parent().find('span:contains("'+trans('Cancel','QIMessageBox')+'")').trigger('click');
1683+
$('#vboxSettingsDialog').dialog({'closeOnEscape':true,'width':(panes.length > 1 ? 900 : 600),'height':(panes.length > 1 ? 500 : 450),'buttons':buttons,'modal':true,'autoOpen':true,'classes':{'ui-dialog':'vboxSettingsDialog vboxDialogContent'},'title':(icon ? '<img src="images/vbox/'+icon+'_16px.png" class="vboxDialogTitleIcon" /> ' : '') + title}).on("dialogbeforeclose",(e)=>{
1684+
e.preventDefault();
1685+
buttons[1].click();
1686+
return false;
16851687
});
16861688

16871689
// Resize pane

panes/settingsGeneral.html

Lines changed: 81 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,25 @@
1919
<table class='vboxVertical'>
2020
<tr>
2121
<th><span class='translateos'>Name:</span></th>
22-
<td colspan='2'><input type='text' class='vboxText' name='vboxSettingsGeneralName' /></td>
22+
<td colspan='2'><input type='text' class='vboxText' id='vboxSettingsGeneralName' name='vboxSettingsGeneralName' /></td>
2323
</tr>
2424
<tr>
2525
<th><span class='translateos'>Type:</span></th>
2626
<td><select name='vboxSettingsGeneralOSFamily' id='vboxSettingsGeneralOSFamily' >
2727
<option value='Linux'>Linux</option>
2828
</select></td>
29-
<td rowspan='2'><img name='vboxOSTypeImg' height='32' width='32' /></td>
29+
<td rowspan='3'><img id='vboxOSTypeImg' name='vboxOSTypeImg' height='32' width='32' /></td>
30+
</tr>
31+
<tr>
32+
<th><span id="vboxSettingsGeneralSubtypeLabel" class='translateos'>Subtype:</span></th>
33+
<td><select id='vboxSettingsGeneralSubtype' name='vboxSettingsGeneralSubtype'>
34+
<option value='Debian'>Debian</option>
35+
</select></td>
3036
</tr>
3137
<tr>
3238
<th><span class='translateos'>Version:</span></th>
3339
<td><select id='vboxSettingsGeneralOSType' name='vboxSettingsGeneralOSType'>
34-
<option value='Debian'>Debian</option>
40+
<option value='Bookworm'>Bookworm</option>
3541
</select></td>
3642
</tr>
3743
<tr id='vboxSettingsRowVMIcon' class='vboxRunningEnabled' style='display:none'>
@@ -101,17 +107,17 @@
101107
</div>
102108

103109
<!-- Encryption Tab -->
104-
<div id='vboxSettingsTabGeneralEncryption' title='Encryption'>
110+
<div id='vboxSettingsTabGeneralEncryption' title='Disk Encryption'>
105111
<table class='vboxVertical'>
106112
<tr>
107113
<td colspan='2'>
108114
<label><input type='checkbox' class='vboxCheckbox vboxEnablerCheckbox' name='vboxSettingsGeneralEncryptionEnable' />
109-
<span class='translate'>Enable Encryption</span>
115+
<span class='translate'>Enable Disk Encryption</span>
110116
</label>
111117
</td>
112118
</tr>
113119
<tr>
114-
<th><span class='translate'>Encryption Cipher:</span></th>
120+
<th><span class='translate'>Disk Encryption Cipher:</span></th>
115121
<td>
116122
<select name='vboxSettingsTabGeneralEncryptionCipher'>
117123
<option value=''>Leave Unchanged</option>
@@ -187,16 +193,12 @@
187193
* Hide start / stop config if not enabled
188194
*/
189195
if(!$('#vboxPane').data('vboxConfig').startStopConfig) {
190-
191196
$('#vboxSettingsTabGeneralBasic').find('tr.vboxStartStopConfig').hide();
192-
193197
}
194198

195199
/* Custom icons */
196200
if($('#vboxPane').data('vboxConfig').enableCustomIcons) {
197-
198201
$('#vboxSettingsRowVMIcon').css('display','');
199-
200202
$(document.forms['frmVboxSettings'].vboxSettingsGeneralIcon).blur(function(){
201203
$('#vboxSettingsGeneralIconImg').attr('src',(this.value ? this.value : 'images/vbox/blank.gif'));
202204
});
@@ -206,13 +208,28 @@
206208
* Called when OS family type changes
207209
*/
208210
function vboxSettingsUpdateOSList(osfam) {
209-
document.forms['frmVboxSettings'].vboxSettingsGeneralOSType.options.length = 0;
210-
$(document.forms['frmVboxSettings'].vboxSettingsGeneralOSType).children().remove();
211-
for(var i = 0; i < vboxSettingsOSTypes[osfam].osTypes.length; i++) {
212-
document.forms['frmVboxSettings'].vboxSettingsGeneralOSType.options[i] = new Option(vboxSettingsOSTypes[osfam].osTypes[i].description, vboxSettingsOSTypes[osfam].osTypes[i].id);
211+
$("#vboxSettingsGeneralOSType").empty();
212+
$("#vboxSettingsGeneralSubtype").empty();
213+
214+
const subTypes = {};
215+
for(const osType of vboxSettingsOSTypes[osfam].osTypes) {
216+
$("#vboxSettingsGeneralOSType").append($('<option />', {text: osType.description, value:osType.id}));
217+
if(osType.subtype) {
218+
if(!subTypes[osType.subtype]) {
219+
subTypes[osType.subtype] = {};
220+
$(vboxSettingsGeneralSubtype).append($('<option />', {text:osType.subtype, value:osType.subtype}));
221+
}
222+
}
213223
}
224+
// Update subtypes
225+
$("#vboxSettingsGeneralSubtypeLabel").toggleClass('disabled', $("#vboxSettingsGeneralSubtype").children().length == 0);
226+
$("#vboxSettingsGeneralSubtype").prop('disabled', $("#vboxSettingsGeneralSubtype").children().length == 0);
227+
214228
// Update image
215-
document.images["vboxOSTypeImg"].src = "images/vbox/" + vboxGuestOSTypeIcon(vboxSettingsOSTypes[osfam].osTypes[0].id);
229+
$("#vboxOSTypeImg").prop('src', "images/vbox/" + vboxGuestOSTypeIcon(vboxSettingsOSTypes[osfam].osTypes[0].id));
230+
if(vboxSettingsOSTypes[osfam].osTypes[0].subtype) {
231+
$("#vboxSettingsGeneralSubtype").val(vboxSettingsOSTypes[osfam].osTypes[0].subtype).change();
232+
}
216233
}
217234

218235
var vboxSettingsOSTypes = new Array();
@@ -243,7 +260,7 @@
243260
vboxDefaultOSTypeId = vboxSettingsOSTypes[vboxOSTypes[i].familyId].osTypes.length;
244261
}
245262

246-
vboxSettingsOSTypes[vboxOSTypes[i].familyId].osTypes[vboxSettingsOSTypes[vboxOSTypes[i].familyId].osTypes.length] = {'id':vboxOSTypes[i].id,'description':vboxOSTypes[i].description };
263+
vboxSettingsOSTypes[vboxOSTypes[i].familyId].osTypes.push({'id':vboxOSTypes[i].id,'description':vboxOSTypes[i].description,'subtype':vboxOSTypes[i].subtype});
247264

248265
vboxSettingsOSTypesObj[vboxOSTypes[i].id] = vboxOSTypes[i];
249266

@@ -253,29 +270,29 @@
253270

254271
}
255272
// clear all options
256-
document.forms['frmVboxSettings'].vboxSettingsGeneralOSFamily.options.length = 0;
257-
$(document.forms['frmVboxSettings'].vboxSettingsGeneralOSFamily).children().remove();
273+
$(document.forms['frmVboxSettings'].vboxSettingsGeneralOSFamily).empty();
258274
for(var i in vboxSettingsOSTypes) {
259275
// default os type family? record in dosfam
260276
if(i == dosfam) dosfam = document.forms['frmVboxSettings'].vboxSettingsGeneralOSFamily.options.length;
261277
document.forms['frmVboxSettings'].vboxSettingsGeneralOSFamily.options[document.forms['frmVboxSettings'].vboxSettingsGeneralOSFamily.options.length] = new Option(vboxSettingsOSTypes[i].description, vboxSettingsOSTypes[i].id);
262278
}
263279
// OnChange, update os type list and icon
264-
document.getElementById('vboxSettingsGeneralOSFamily').setAttribute('onChange','vboxSettingsUpdateOSList(this.value)');
265-
document.getElementById('vboxSettingsGeneralOSType').setAttribute('onChange','document.images["vboxOSTypeImg"].src = "images/vbox/" + vboxGuestOSTypeIcon(this.value)');
266-
280+
$('#vboxSettingsGeneralOSFamily').on('change',(e) => vboxSettingsUpdateOSList(e.target.value));
281+
$('#vboxSettingsGeneralOSType').on('change',(e) => $("#vboxOSTypeImg").prop("src", "images/vbox/" + vboxGuestOSTypeIcon(e.target.value)));
282+
$('#vboxSettingsGeneralSubtype').on('change', (e) => {
283+
if(!e.target.value) return;
284+
$('#vboxSettingsGeneralOSType').empty();
285+
for(const osType of vboxSettingsOSTypes[$('#vboxSettingsGeneralOSFamily').val()].osTypes) {
286+
if(osType.subtype != e.target.value) continue;
287+
$('#vboxSettingsGeneralOSType').append($('<option />', {value:osType.id, text:osType.description}));
288+
}
289+
});
267290

268291

269292

270293
/* Update settings when data is loaded */
271294
$('#vboxSettingsDialog').on('dataLoaded', function(){
272295

273-
/* Defaults from machine */
274-
document.forms['frmVboxSettings'].vboxSettingsGeneralName.value = $('#vboxSettingsDialog').data('vboxMachineData').name;
275-
document.forms['frmVboxSettings'].vboxSettingsGeneralOSFamily.value = vboxSettingsOSTypesObj[$('#vboxSettingsDialog').data('vboxMachineData').OSTypeId].familyId;
276-
$(document.forms['frmVboxSettings'].vboxSettingsGeneralOSFamily).change();
277-
document.forms['frmVboxSettings'].vboxSettingsGeneralOSType.value = $('#vboxSettingsDialog').data('vboxMachineData').OSTypeId;
278-
$(document.forms['frmVboxSettings'].vboxSettingsGeneralOSType).change();
279296
document.forms['frmVboxSettings'].vboxSettingsGeneralSnapshotFolder.value = $('#vboxSettingsDialog').data('vboxMachineData').snapshotFolder;
280297
document.forms['frmVboxSettings'].vboxSettingsGeneralDescription.innerHTML = $('#vboxSettingsDialog').data('vboxMachineData').description;
281298

@@ -284,21 +301,7 @@
284301
$(document.forms['frmVboxSettings'].vboxSettingsTabGeneralInputMouse).val($('#vboxSettingsDialog').data('vboxMachineData').pointingHIDType);
285302
$(document.forms['frmVboxSettings'].vboxSettingsClipboardMode).val($('#vboxSettingsDialog').data('vboxMachineData').ClipboardMode);
286303

287-
/* OS Type */
288304

289-
// shorthand
290-
var vboxOSTypes = $('#vboxPane').data('vboxOSTypes');
291-
for(var i = 0; i < vboxOSTypes.length; i++) {
292-
if(vboxOSTypes[i].id == $('#vboxSettingsDialog').data('vboxMachineData').OSTypeId) {
293-
// Set the family then os type
294-
$(document.forms['frmVboxSettings'].vboxSettingsGeneralOSFamily).children('[value="'+vboxOSTypes[i].familyId+'"]').prop('selected',true);
295-
$(document.forms['frmVboxSettings'].vboxSettingsGeneralOSFamily).trigger('change');
296-
$(document.forms['frmVboxSettings'].vboxSettingsGeneralOSType).children('[value="'+vboxOSTypes[i].id+'"]').prop('selected',true);
297-
$(document.forms['frmVboxSettings'].vboxSettingsGeneralOSType).trigger('change');
298-
break;
299-
}
300-
}
301-
302305
/* Custom icons */
303306
if($('#vboxPane').data('vboxConfig').enableCustomIcons) {
304307

@@ -337,42 +340,51 @@
337340
$(document.images["vboxOSTypeImg"]).removeClass('vboxDisabled');
338341
}
339342

343+
/* OS Type */
344+
$("#vboxSettingsGeneralName").val($('#vboxSettingsDialog').data('vboxMachineData').name);
345+
$("#vboxSettingsGeneralOSFamily").val(vboxSettingsOSTypesObj[$('#vboxSettingsDialog').data('vboxMachineData').OSTypeId].familyId).change();
346+
if(vboxSettingsOSTypesObj[$('#vboxSettingsDialog').data('vboxMachineData').OSTypeId].subtype) {
347+
$("#vboxSettingsGeneralSubtype").val(vboxSettingsOSTypesObj[$('#vboxSettingsDialog').data('vboxMachineData').OSTypeId].subtype).change();
348+
}
349+
$("#vboxSettingsGeneralOSType").val($('#vboxSettingsDialog').data('vboxMachineData').OSTypeId).change();
350+
351+
352+
/* Encrypted media */
340353
/*
341354
* This is a poor way to determine extpack installation status, but the web service can't access IExtPackManager :(
342355
*/
343-
if(!($('#vboxSettingsDialog').data('vboxMachineData').VRDEServer && $('#vboxSettingsDialog').data('vboxMachineData').VRDEServer.VRDEExtPack)) {
356+
if(!($('#vboxSettingsDialog').data('vboxMachineData').VRDEServer && $('#vboxSettingsDialog').data('vboxMachineData').VRDEServer.VRDEExtPack)) {
344357
$('#vboxSettingsTabGeneralEncryption').parent().tabs('disable', 3);
345358
} else {
346359
$('#vboxSettingsTabGeneralEncryption').parent().tabs('enable', 3);
347360

348-
// Encrypted media
349-
var encIds = vboxMedia.getEncryptedMediaIds(
350-
vboxStorage.getAttachedBaseMedia($('#vboxSettingsDialog').data('vboxMachineData'))
351-
);
352-
353-
var lastCipher = null;
354-
var uniqueCiphers = true;
355-
for(var i = 0; i < encIds.length; i++) {
356-
if(lastCipher && (lastCipher != encIds[i].cipher)) {
357-
uniqueCiphers = false;
358-
break;
359-
}
360-
lastCipher = encIds[i].cipher;
361-
}
362-
$(document.forms['frmVboxSettings'].vboxSettingsGeneralEncryptionEnable).prop('checked', (encIds.length))
363-
.triggerHandler('click');
364-
365-
if(uniqueCiphers) {
366-
$(document.forms['frmVboxSettings'].vboxSettingsTabGeneralEncryptionCipher).val(lastCipher);
367-
}
368-
369-
$('#vboxSettingsDialog').data('vboxEncSettings', {
370-
enabled: $(document.forms['frmVboxSettings'].vboxSettingsGeneralEncryptionEnable).prop('checked'),
371-
uniqueCiphers: $(document.forms['frmVboxSettings'].vboxSettingsTabGeneralEncryptionCipher).val()
372-
});
373-
}
361+
var encIds = vboxMedia.getEncryptedMediaIds(
362+
vboxStorage.getAttachedBaseMedia($('#vboxSettingsDialog').data('vboxMachineData'))
363+
);
364+
365+
var lastCipher = null;
366+
var uniqueCiphers = true;
367+
for(var i = 0; i < encIds.length; i++) {
368+
if(lastCipher && (lastCipher != encIds[i].cipher)) {
369+
uniqueCiphers = false;
370+
break;
371+
}
372+
lastCipher = encIds[i].cipher;
373+
}
374+
$(document.forms['frmVboxSettings'].vboxSettingsGeneralEncryptionEnable).prop('checked', (encIds.length))
375+
.triggerHandler('click');
376+
377+
if(uniqueCiphers) {
378+
$(document.forms['frmVboxSettings'].vboxSettingsTabGeneralEncryptionCipher).val(lastCipher);
379+
}
380+
381+
$('#vboxSettingsDialog').data('vboxEncSettings', {
382+
enabled: $(document.forms['frmVboxSettings'].vboxSettingsGeneralEncryptionEnable).prop('checked'),
383+
uniqueCiphers: $(document.forms['frmVboxSettings'].vboxSettingsTabGeneralEncryptionCipher).val()
384+
});
385+
386+
}
374387

375-
376388
/* Change general settings onSave() */
377389
}).on('save',function(){
378390

0 commit comments

Comments
 (0)