27 if (typeof QATestTools ==
'undefined') {
31 QATestTools.Controller =
35 this.addPlaylistGetInfo();
38 addPlaylistGetInfo:
function() {
39 var
cmdHelper =
Cc[
"@songbirdnest.com/Songbird/PlaylistCommandsHelper;1"]
40 .getService(
Ci.sbIPlaylistCommandsHelper);
41 this.getInfoCmd = cmdHelper.createCommandObjectForAction
45 this.displayPlaylistInfo);
46 cmdHelper.addCommandObjectForType(cmdHelper.TARGET_SERVICEPANE_MENU,
49 cmdHelper.addCommandObjectForType(cmdHelper.TARGET_SERVICEPANE_MENU,
54 displayPlaylistInfo:
function(aContext, aSubMenuId, aCommandId,
aHost) {
55 this._medialist = aContext.medialist;
57 WindowUtils.openModalDialog
59 "chrome://mockcdcontroller/content/playlistInfoDialog.xul",
68 var
cmdHelper =
Cc[
"@songbirdnest.com/Songbird/PlaylistCommandsHelper;1"]
69 .getService(
Ci.sbIPlaylistCommandsHelper);
70 cmdHelper.removeCommandObjectForType(cmdHelper.TARGET_SERVICEPANE_MENU,
73 cmdHelper.removeCommandObjectForType(cmdHelper.TARGET_SERVICEPANE_MENU,
80 if (typeof MockCDController ==
'undefined') {
81 var MockCDController = {};
87 MockCDController.Controller =
92 document.getElementById(
"mockcdcontroller-showcontroller-cmd");
95 showCommand.addEventListener(
97 function() {
self.showCDControllerPane(); },
100 var showCommandDevice =
101 document.getElementById(
"mockdevicecontroller-showcontroller-cmd");
103 showCommandDevice.addEventListener(
105 function() {
self.showDeviceControllerPane(); },
108 var showDeviceCapsDump =
109 document.getElementById(
"dumpdevicecaps-cmd");
111 showDeviceCapsDump.addEventListener(
113 function() {
self.showDeviceCapsDump(); },
117 document.getElementById(
"fakepds-cmd");
119 showFakePDS.addEventListener(
121 function() {
self.showFakePDS(); },
125 if (
Application.prefs.getValue(
"extensions.cdripcontroller.startup_show_controller",
127 setTimeout(
function() {
self.showCDControllerPane(); }, 200);
131 showCDControllerPane:
function()
133 window.openDialog(
"chrome://mockcdcontroller/content/mockCDControllerDialog.xul",
134 "cd-controller-pane",
135 "chrome,centerscreen,resizable=false");
138 showDeviceControllerPane:
function()
140 window.openDialog(
"chrome://mockcdcontroller/content/deviceControllerDialog.xul",
141 "device-controller-pane",
142 "chrome,centerscreen,resizable=false");
145 showDeviceCapsDump:
function()
148 "chrome://mockcdcontroller/content/deviceCapsDump.xul",
149 "device-caps-dump-dialog",
150 "chrome,centerscreen,resizable=yes");
153 showFakePDS:
function() {
155 "chrome://mockcdcontroller/content/fakePDS.xul",
157 "chrome,centerscreen,resizable=yes");
161 window.addEventListener(
"load",
162 function(e) { QATestTools.Controller.onLoad(e);
163 MockCDController.Controller.onLoad(e); },
166 window.addEventListener(
"unload",
167 function(e) { QATestTools.Controller.onUnload(e); },
aWindow setTimeout(function(){_this.restoreHistory(aWindow, aTabs, aTabData, aIdMap);}, 0)
function onUnload()
onUnload - called when the cover preview window unloads.