25 Components.utils.import(
"resource://gre/modules/XPCOMUtils.jsm");
26 Components.utils.import(
"resource://app/jsmodules/sbProperties.jsm");
28 const Ci = Components.interfaces;
29 const Cc = Components.classes;
30 const Cr = Components.results;
34 this._servicePaneNode =
null;
35 this._downloadDevice =
null;
36 this._currentState =
Ci.sbIDeviceBase.STATE_IDLE;
42 classID: Components.ID(
"{ee93796b-090e-4703-982a-1d27bea552c3}"),
43 contractID:
"@songbirdnest.com/Songbird/DownloadDeviceServicePaneModule;1",
45 Ci.sbIDeviceBaseCallback])
50 function sbDownloadDeviceServicePaneModule_servicePaneInit(aServicePaneModule)
52 var devMgr =
Cc[
"@songbirdnest.com/Songbird/DeviceManager;1"]
53 .getService(
Ci.sbIDeviceManager);
54 var downloadCat =
"Songbird Download Device";
55 if (devMgr.hasDeviceForCategory(downloadCat)) {
56 this._downloadDevice = devMgr.getDeviceByCategory(downloadCat)
57 .QueryInterface(
Ci.sbIDownloadDevice);
59 this._downloadDevice.addCallback(
this);
60 this._currentState = this._downloadDevice.getDeviceState(
"download");
65 function sbDownloadDeviceServicePaneModule_fillContextMenu(aNode,
72 function sbDownloadDeviceServicePaneModule_fillNewItemMenu(aNode,
79 function sbDownloadDeviceServicePaneModule_onSelectionChanged(aNode,
86 function sbDownloadDeviceServicePaneModule_canDrop(aNode,
94 function sbDownloadDeviceServicePaneModule_onDrop(aNode,
102 function sbDownloadDeviceServicePaneModule_onDragGesture(aNode,
108 function sbDownloadDeviceServicePaneModule_onBeforeRename(aNode)
113 function sbDownloadDeviceServicePaneModule_onRename(aNode,
119 function sbDownloadDeviceServicePaneModule_get_stringBundle()
124 function sbDownloadDeviceServicePaneModule_shutdown()
126 if (this._downloadDevice) {
127 this._downloadDevice.removeCallback(
this);
133 function sbDownloadDeviceServicePaneModule_onDeviceConnect(aDeviceIdentifier)
138 function sbDownloadDeviceServicePaneModule_onDeviceDisconnect(aDeviceIdentifier)
143 function sbDownloadDeviceServicePaneModule_onTransferStart(aSourceURL,
149 function sbDownloadDeviceServicePaneModule_onTransferComplete(aSourceURL,
155 function sbDownloadDeviceServicePaneModule_onStateChanged(aDeviceIdentifier,
158 this._currentState =
aState;
163 function sbDownloadDeviceServicePaneModule_get_node()
165 if (!this._servicePaneNode) {
166 var lsps =
Cc[
"@songbirdnest.com/servicepane/library;1"]
167 .getService(
Ci.sbILibraryServicePaneService);
168 this._servicePaneNode =
169 lsps.getNodeForLibraryResource(this._downloadDevice.downloadMediaList);
171 return this._servicePaneNode;
175 function sbDownloadDeviceServicePaneModule_onStateChanged()
178 var a = this._node.className.split(
" ");
181 a = a.filter(
function(property) {
182 return property !=
"downloading";
185 if (this._currentState ==
Ci.sbIDeviceBase.STATE_DOWNLOADING) {
186 a.push(
"downloading");
189 this._node.className = a.join(
" ");
194 var
module = XPCOMUtils.generateModule(
196 function(aCompMgr, aFileSpec, aLocation) {
197 XPCOMUtils.categoryManager.addCategoryEntry(
199 "z-download-device-service-pane-module",
sbDeviceFirmwareAutoCheckForUpdate prototype contractID
sbOSDControlService prototype QueryInterface
sbDeviceFirmwareAutoCheckForUpdate prototype classDescription
function sbDownloadDeviceServicePaneModule()
sbDeviceFirmwareAutoCheckForUpdate prototype classID