Skip to content

Commit

Permalink
Merge pull request #39 from jean-edouard/stable-6-sticky-cd
Browse files Browse the repository at this point in the history
STABLE-6: Make all CD-ROM drives sticky by default
  • Loading branch information
rossphilipson authored Jul 20, 2016
2 parents 05f10cf + f0d7b9a commit 23ae407
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 9 deletions.
4 changes: 3 additions & 1 deletion dist/script/models/hostModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,9 @@ XenClient.UI.HostModel = function() {
var devices = [];
dojo.forEach(self.available_cds, function(item, i){
// XC-10237 - USB CD-ROM drives cannot be made sticky
var canMakeSticky = (item["usb-id"] == "");
// var canMakeSticky = (item["usb-id"] == "");
// OXT-661 - Enable stickyness all CD-ROM drives
var canMakeSticky = true;
devices[i] = { "id": item.id, "name": item.name, "vm": item.vm, sticky: item["vm-sticky"], canMakeSticky: canMakeSticky };
});
return devices;
Expand Down
4 changes: 4 additions & 0 deletions widgets/xenclient/Devices.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,10 @@ return declare("citrix.xenclient.Devices", [dialog, _boundContainerMixin, _citri
check.set("checked", false);
} else {
this._setEnabled(check, true);
// OXT-661 - Make CDs sticky by default
if (prefix == "cd") {
check.set("checked", true);
}
}
} else {
this._setEnabled(check, false);
Expand Down
20 changes: 12 additions & 8 deletions widgets/xenclient/MediaWizard.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,14 +261,18 @@ return declare("citrix.xenclient.MediaWizard", [_wizard], {
this._setDisplay(this.isoControl, assignableISOs);

// CDs
var availableCD = (XUICache.Host.available_cds.length > 0);
//var availableCD = (XUICache.Host.available_cds.length > 0);
// OXT-661: WORKAROUND: disable CD-ROM boot since it doesn't do anything
var availableCD = false;
var assignableCD = false;
dojo.some(this.host.available_cds, function(cd) {
if (cd.vm == "" && cd["vm-sticky"] == "0") {
assignableCD = true;
return true;
}
}, this);
if (availableCD) {
dojo.some(this.host.available_cds, function(cd) {
if (cd.vm == "" && cd["vm-sticky"] == "0") {
assignableCD = true;
return true;
}
}, this);
}

// Hide dropdown
this._setDisplay(this.cds, false);
Expand All @@ -277,7 +281,7 @@ return declare("citrix.xenclient.MediaWizard", [_wizard], {
this._setEnabled(this.autoStart_cd, assignableCD);
this._setDisplay(this.cdWarning, (availableCD && !assignableCD));

var defaultBoot = assignableISOs ? "autoStart_iso" : assignableCD ? "autoStart_cd": "autoStart_network";
var defaultBoot = assignableISOs ? "autoStart_iso" : assignableCD ? "autoStart_cd": "autoStart_off";
this[defaultBoot].set("checked", true);
this._onBootChange();
},
Expand Down

0 comments on commit 23ae407

Please sign in to comment.