50 Components.utils.import(
"resource://app/jsmodules/DOMUtils.jsm");
60 if (typeof(
Cc) ==
"undefined")
61 var
Cc = Components.classes;
62 if (typeof(
Ci) ==
"undefined")
63 var
Ci = Components.interfaces;
64 if (typeof(
Cr) ==
"undefined")
65 var
Cr = Components.results;
66 if (typeof(
Cu) ==
"undefined")
67 var
Cu = Components.utils;
84 this._widget = aWidget;
101 _domEventListenerSet:
null,
102 _libraryImporter:
null,
115 initialize:
function firstRuniTunesSvc_initialize() {
117 this._libraryImporter = Cc[
"@songbirdnest.com/Songbird/ITunesImporter;1"]
118 .getService(Ci.sbILibraryImporter);
126 finalize:
function firstRuniTunesSvc_finalize() {
128 if (this._domEventListenerSet)
129 this._domEventListenerSet.removeAll();
130 this._domEventListenerSet =
null;
141 saveSettings:
function firstRuniTunesSvc_saveSettings() {
143 this._saveITunesSettings();
159 function firstRuniTunesSvc__saveITunesImportSettings() {
161 var importCheckbox = this._getElement(
"itunes_import_checkbox");
162 var importEnabled = importCheckbox.checked;
163 var importLibraryFilePath = this._libraryImporter.libraryDefaultFilePath;
167 if (!importLibraryFilePath)
172 (
"songbird.library_importer.library_file_path",
173 importLibraryFilePath);
174 Application.prefs.setValue(
"songbird.firstrun.do_import_library",
true);
175 Application.prefs.setValue(
"songbird.library_importer.import_tracks",
177 Application.prefs.setValue(
"songbird.library_importer.import_playlists",
181 var exportCheckbox = this._getElement(
"itunes_export_checkbox");
182 var exportEnabled = exportCheckbox.checked;
185 Application.prefs.setValue(
"songbird.library_exporter.export_tracks",
187 Application.prefs.setValue(
"songbird.library_exporter.export_playlists",
190 (
"songbird.library_exporter.export_smartplaylists",
193 #ifdef METRICS_ENABLED
195 var metrics = Cc[
"@songbirdnest.com/Songbird/Metrics;1"]
196 .createInstance(Ci.sbIMetrics);
201 metrics.metricsInc(
"firstrun",
"mediaimport",
"itunes");
205 metrics.metricsInc(
"firstrun",
"mediaexport",
"itunes");
221 _getElement:
function firstRuniTunesSvc__getElement(aElementID) {
222 return document.getAnonymousElementByAttribute(this._widget,
function firstRuniTunesSvc(aWidget)
DataRemote prototype constructor