few minor changes here and there

git-svn-id: svn://10.0.0.236/trunk@64688 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
pavlov%netscape.com
2000-03-31 04:01:02 +00:00
parent d91b1e3ac4
commit f25fdd7b3c
3 changed files with 20 additions and 16 deletions

View File

@@ -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:

View File

@@ -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) {

View File

@@ -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) {