зеркало из https://github.com/mozilla/gecko-dev.git
bug 360513: Show file type suffix in import/export file picker filter description (wildmat pattern). patch by gekacheka@yahoo.com, r=lilmatt, me. ui-review=dmose
This commit is contained in:
Родитель
9a141c1f90
Коммит
30ff6758f8
|
@ -122,10 +122,11 @@ var gAlarmsPane = {
|
|||
|
||||
var bundlePreferences = document.getElementById("bundlePreferences");
|
||||
var title = bundlePreferences.getString("Open");
|
||||
var filterLabel = bundlePreferences.getString("filterWav");
|
||||
var wildmat = "*.wav";
|
||||
var label = bundlePreferences.getFormattedString("filterWav", [wildmat], 1);
|
||||
|
||||
fp.init(window, title, nsIFilePicker.modeOpen);
|
||||
fp.appendFilter(filterLabel, "*.wav");
|
||||
fp.appendFilter(label, wildmat);
|
||||
fp.appendFilters(nsIFilePicker.filterAll);
|
||||
|
||||
var ret = fp.show();
|
||||
|
|
|
@ -58,9 +58,11 @@ function getFileTypes(aCount) {
|
|||
var sbs = Components.classes["@mozilla.org/intl/stringbundle;1"]
|
||||
.getService(Components.interfaces.nsIStringBundleService);
|
||||
var props = sbs.createBundle("chrome://calendar/locale/calendar.properties");
|
||||
var wildmat = '*.html; *.htm';
|
||||
var label = props.formatStringFromName('filterHtml', [wildmat], 1);
|
||||
return([{defaultExtension:'html',
|
||||
extensionFilter:'*.html; *.htm',
|
||||
description: props.GetStringFromName('htmlDesc')}]);
|
||||
extensionFilter: wildmat,
|
||||
description: label}]);
|
||||
};
|
||||
|
||||
// not prototype.export. export is reserved.
|
||||
|
|
|
@ -51,16 +51,19 @@ function QueryInterface(aIID) {
|
|||
return this;
|
||||
};
|
||||
|
||||
calIcsImporter.prototype.getFileTypes =
|
||||
function getFileTypes(aCount) {
|
||||
function getIcsFileTypes(aCount) {
|
||||
aCount.value = 1;
|
||||
var sbs = Components.classes["@mozilla.org/intl/stringbundle;1"]
|
||||
.getService(Components.interfaces.nsIStringBundleService);
|
||||
var props = sbs.createBundle("chrome://calendar/locale/calendar.properties");
|
||||
var wildmat = '*.ics';
|
||||
var label = props.formatStringFromName('filterIcs', [wildmat], 1);
|
||||
return([{defaultExtension:'ics',
|
||||
extensionFilter:'*.ics',
|
||||
description: props.GetStringFromName('icsDesc')}]);
|
||||
};
|
||||
extensionFilter: wildmat,
|
||||
description: label}]);
|
||||
}
|
||||
|
||||
calIcsImporter.prototype.getFileTypes = getIcsFileTypes;
|
||||
|
||||
calIcsImporter.prototype.importFromStream =
|
||||
function ics_importFromStream(aStream, aCount) {
|
||||
|
@ -219,16 +222,7 @@ function QueryInterface(aIID) {
|
|||
return this;
|
||||
};
|
||||
|
||||
calIcsExporter.prototype.getFileTypes =
|
||||
function getFileTypes(aCount) {
|
||||
aCount.value = 1;
|
||||
var sbs = Components.classes["@mozilla.org/intl/stringbundle;1"]
|
||||
.getService(Components.interfaces.nsIStringBundleService);
|
||||
var props = sbs.createBundle("chrome://calendar/locale/calendar.properties");
|
||||
return([{defaultExtension:'ics',
|
||||
extensionFilter:'*.ics',
|
||||
description: props.GetStringFromName('icsDesc')}]);
|
||||
};
|
||||
calIcsExporter.prototype.getFileTypes = getIcsFileTypes;
|
||||
|
||||
// not prototype.export. export is reserved.
|
||||
calIcsExporter.prototype.exportToStream =
|
||||
|
|
|
@ -52,16 +52,19 @@ function QueryInterface(aIID) {
|
|||
return this;
|
||||
};
|
||||
|
||||
calOutlookCSVImporter.prototype.getFileTypes =
|
||||
function getFileTypes(aCount) {
|
||||
function getOutlookCsvFileTypes(aCount) {
|
||||
aCount.value = 1;
|
||||
var sbs = Components.classes["@mozilla.org/intl/stringbundle;1"]
|
||||
.getService(Components.interfaces.nsIStringBundleService);
|
||||
var props = sbs.createBundle("chrome://calendar/locale/calendar.properties");
|
||||
var wildmat = '*.csv';
|
||||
var label = props.formatStringFromName('filterOutlookCsv', [wildmat], 1);
|
||||
return([{defaultExtension:'csv',
|
||||
extensionFilter:'*.csv',
|
||||
description: props.GetStringFromName('outlookDesc')}]);
|
||||
};
|
||||
extensionFilter: wildmat,
|
||||
description: label}]);
|
||||
}
|
||||
|
||||
calOutlookCSVImporter.prototype.getFileTypes = getOutlookCsvFileTypes;
|
||||
|
||||
const localeEn = {
|
||||
headTitle : "Subject",
|
||||
|
@ -400,16 +403,7 @@ function QueryInterface(aIID) {
|
|||
return this;
|
||||
};
|
||||
|
||||
calOutlookCSVExporter.prototype.getFileTypes =
|
||||
function getFileTypes(aCount) {
|
||||
aCount.value = 1;
|
||||
var sbs = Components.classes["@mozilla.org/intl/stringbundle;1"]
|
||||
.getService(Components.interfaces.nsIStringBundleService);
|
||||
var props = sbs.createBundle("chrome://calendar/locale/calendar.properties");
|
||||
return([{defaultExtension:'csv',
|
||||
extensionFilter:'*.csv',
|
||||
description:props.GetStringFromName('outlookDesc')}]);
|
||||
};
|
||||
calOutlookCSVExporter.prototype.getFileTypes = getOutlookCsvFileTypes;
|
||||
|
||||
// not prototype.export. export is reserved.
|
||||
calOutlookCSVExporter.prototype.exportToStream =
|
||||
|
|
|
@ -166,17 +166,18 @@ filepickerDefString=MozillaCalendarFile.ics
|
|||
### %1$S in the server name
|
||||
filepickerDefServerString=MozillaCalendar%1$S.ics
|
||||
|
||||
#filter
|
||||
filterCalendar=Calendar Files
|
||||
filtervCalendar=vCalendar Files
|
||||
filterXcs=iCalendar XML Document
|
||||
filterXml=XML Document
|
||||
filterRtf=Rich Text Format (RTF)
|
||||
filterHtml=HTML Files
|
||||
filterCsv=Comma Separated
|
||||
filterOutlookCsv=Outlook Comma Separated
|
||||
filterRdf=iCalendar RDF
|
||||
filterWav=WAV Files (*.wav)
|
||||
# Filters for export/import/open file picker. %1$S will be replaced with
|
||||
# wildmat used to filter files by extension, such as (*.html; *.htm).
|
||||
filterIcs=iCalendar (%1$S)
|
||||
filterVcs=vCalendar 1.0 (%1$S)
|
||||
filterXcs=iCalendar XML Document (%1$S)
|
||||
filterXml=XML Document (%1$S)
|
||||
filterRtf=Rich Text Format (%1$S)
|
||||
filterHtml=Web Page (%1$S)
|
||||
filterCsv=Comma Separated Values (%1$S)
|
||||
filterOutlookCsv=Outlook Comma Separated Values (%1$S)
|
||||
filterRdf=iCalendar RDF (%1$S)
|
||||
filterWav=Waveform Audio (%1$S)
|
||||
|
||||
# Literal Outlook CSV headers. Take from a .csv file exported by Outlook.
|
||||
# For matching first line of .csv file to import Outlook Comma Separated events.
|
||||
|
@ -231,11 +232,6 @@ monthPrinterName = Monthly Grid
|
|||
|
||||
rotate=Rotate
|
||||
|
||||
# Import/Export
|
||||
htmlDesc=HTML
|
||||
icsDesc=iCalendar
|
||||
outlookDesc=Comma Separated Values (from Outlook)
|
||||
|
||||
# Providers
|
||||
caldavName=CalDAV
|
||||
compositeName=Composite
|
||||
|
|
|
@ -506,7 +506,9 @@ function openLocalCalendar() {
|
|||
const nsIFilePicker = Components.interfaces.nsIFilePicker;
|
||||
var fp = Components.classes["@mozilla.org/filepicker;1"].createInstance(nsIFilePicker);
|
||||
fp.init(window, gCalendarBundle.getString("Open"), nsIFilePicker.modeOpen);
|
||||
fp.appendFilter(gCalendarBundle.getString("filterCalendar"), "*.ics");
|
||||
var wildmat = "*.ics";
|
||||
var description = gCalendarBundle.getFormattedString("filterIcs", [wildmat]);
|
||||
fp.appendFilter(description, wildmat);
|
||||
fp.appendFilters(nsIFilePicker.filterAll);
|
||||
|
||||
if (fp.show() != nsIFilePicker.returnOK) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче