few minor changes here and there

This commit is contained in:
pavlov%netscape.com 2000-03-31 04:01:02 +00:00
Родитель 75bf0e0ade
Коммит f22eeade2f
3 изменённых файлов: 20 добавлений и 16 удалений

Просмотреть файл

@ -87,8 +87,13 @@ function onOK()
if (!file)
return false;
var isDir = file.isDirectory();
var isFile = file.isFile();
if (file.exists()) {
var isDir = file.isDirectory();
var isFile = file.isFile();
} else { /* we are saving a new file */
isDir = false;
isFile = false;
}
switch(filePickerMode) {
case nsIFilePicker.modeOpen:
@ -111,6 +116,9 @@ function onOK()
else
ret = nsIFilePicker.returnCancel;
retvals.directory = file.parent.path;
} else if (!file.exists()) {
ret = nsIFilePicker.returnOK;
retvals.directory = file.parent.path;
}
break;
case nsIFilePicker.modeGetFolder:

Просмотреть файл

@ -66,7 +66,7 @@ nsFilePicker.prototype = {
get file() { debug("getter called " + this.mFile); return this.mFile; },
/* attribute wstring defaultString; */
set defaultString(a) { throw "readonly property"; },
set defaultString(a) { this.mSelectedFilter = a; },
get defaultString() { return this.mSelectedFilter; },
/* methods */
@ -77,12 +77,6 @@ nsFilePicker.prototype = {
},
setFilters: function(filterMask) {
dump(filterMask + "\n");
if (filterMask & nsIFilePicker.filterAll) {
dump("filterAll\n");
this.mFilterTitles.push(bundle.GetStringFromName("allTitle"));
this.mFilters.push(bundle.GetStringFromName("allFilter"));
}
if (filterMask & nsIFilePicker.filterHTML) {
this.mFilterTitles.push(bundle.GetStringFromName("htmlTitle"));
this.mFilters.push(bundle.GetStringFromName("htmlFilter"));
@ -103,6 +97,10 @@ nsFilePicker.prototype = {
this.mFilterTitles.push(bundle.GetStringFromName("xulTitle"));
this.mFilters.push(bundle.GetStringFromName("xulFilter"));
}
if (filterMask & nsIFilePicker.filterAll) {
this.mFilterTitles.push(bundle.GetStringFromName("allTitle"));
this.mFilters.push(bundle.GetStringFromName("allFilter"));
}
},
appendFilter: function(title, extentions) {

Просмотреть файл

@ -66,7 +66,7 @@ nsFilePicker.prototype = {
get file() { debug("getter called " + this.mFile); return this.mFile; },
/* attribute wstring defaultString; */
set defaultString(a) { throw "readonly property"; },
set defaultString(a) { this.mSelectedFilter = a; },
get defaultString() { return this.mSelectedFilter; },
/* methods */
@ -77,12 +77,6 @@ nsFilePicker.prototype = {
},
setFilters: function(filterMask) {
dump(filterMask + "\n");
if (filterMask & nsIFilePicker.filterAll) {
dump("filterAll\n");
this.mFilterTitles.push(bundle.GetStringFromName("allTitle"));
this.mFilters.push(bundle.GetStringFromName("allFilter"));
}
if (filterMask & nsIFilePicker.filterHTML) {
this.mFilterTitles.push(bundle.GetStringFromName("htmlTitle"));
this.mFilters.push(bundle.GetStringFromName("htmlFilter"));
@ -103,6 +97,10 @@ nsFilePicker.prototype = {
this.mFilterTitles.push(bundle.GetStringFromName("xulTitle"));
this.mFilters.push(bundle.GetStringFromName("xulFilter"));
}
if (filterMask & nsIFilePicker.filterAll) {
this.mFilterTitles.push(bundle.GetStringFromName("allTitle"));
this.mFilters.push(bundle.GetStringFromName("allFilter"));
}
},
appendFilter: function(title, extentions) {