[Pkg-mozext-commits] [automatic-save-folder] 30/133: Add : - Private Browsing mode compatible ! Thank you to Mozilla developer Ehsan Akhgari from http://ehsanakhgari.org/ for his help with File-picker private browsing function. - Added a Tooltip in the Dynamic folder tab : Attention, if you are in private browsing mode, Firefox will not create the folder if it doesn't exist yet. The opened folder will be the last used on non private browsing.

David Prévot taffit at moszumanska.debian.org
Mon Apr 27 20:33:49 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch wip
in repository automatic-save-folder.

commit 2cca3663b39d3401db0b9a7428902a1ac7a17aa9
Author: Cyan <Cyan at d0063192-6b2e-11de-89a9-0b20f3e2dceb>
Date:   Sat Nov 14 10:44:32 2009 +0000

    Add :
    -  Private Browsing mode compatible !
       Thank you to Mozilla developer Ehsan Akhgari from http://ehsanakhgari.org/
       for his help with File-picker private browsing function.
    -  Added a Tooltip in the Dynamic folder tab : Attention, if you are in private
       browsing mode, Firefox will not create the folder if it doesn't exist yet.
       The opened folder will be the last used on non private browsing.
    
    Change :
       Changed the way the data are read/written to Firefox preferences to conform
       with Firefox version.
       Firefox 2 and Firefox 3 doesn't use the same preference for the File-picker
       save path, only use the appropriate one.
       I hope it will fix the save path selection error some users encountered.
    
    git-svn-id: http://automatic-save-folder.googlecode.com/svn/trunk@30 d0063192-6b2e-11de-89a9-0b20f3e2dceb
---
 content/asf_download.js    | 186 ++++++++++++++++++++++++++-------------------
 content/asf_right_click.js | 139 ++++++++++++++++++++-------------
 content/options.xul        |   9 ++-
 locale/en-US/asf.dtd       |   3 +-
 locale/fr-FR/asf.dtd       |   3 +-
 locale/it-IT/asf.dtd       |   3 +-
 6 files changed, 205 insertions(+), 138 deletions(-)

diff --git a/content/asf_download.js b/content/asf_download.js
index e5ddd24..ff13b1b 100644
--- a/content/asf_download.js
+++ b/content/asf_download.js
@@ -26,11 +26,14 @@ Copyright (C) 2007-2009 Eric Cassar (Cyan).
 						
 		versionChecker: Components.classes["@mozilla.org/xpcom/version-comparator;1"]
                                .getService(Components.interfaces.nsIVersionComparator),
-				   
-		firefoxversion : "",	
+				
+		firefoxversion : "",
 		
 	main: function () {
 		
+		// Enable Private Browsing support with filepicker - Thanks to Ehsan Akhgari at http://ehsanakhgari.org/
+		Components.utils.import("resource://gre/modules/DownloadLastDir.jsm");
+		
 		// Setting private variables usable in this function
 		var prefManager = automatic_save_folder.prefManager;		
 		var versionChecker = automatic_save_folder.versionChecker;
@@ -109,9 +112,9 @@ Copyright (C) 2007-2009 Eric Cassar (Cyan).
 		var dom_regexp = false;
 		var file_regexp = false;
 		for ( var i = 0 ; i < filters.length ; i++)
-		{		
+		{
 			if (filters[i][3] == true)  // if not temporary deactivated
-			{		
+			{
 				dom_regexp = false ; // reset the matching string for the "for" loop
 				file_regexp = false ; // same as above
 			// Check the domain	
@@ -144,43 +147,42 @@ Copyright (C) 2007-2009 Eric Cassar (Cyan).
 			{
 				if ( (keeptemp == false) || ((keeptemp == true) && ( tempdomain != domain )) ) // and, if [same domain not checked] OR [ if same domain (keeptemp) is checked and domain not same as previous one]
 				{	// then change the destination folder to user choice
-					this.saveUnicodeString("browser.download.dir", defaultfolder);
-					if (lastdir == true) // set it for "save as..." on FF1.5 and FF2, on FF3 lastdir is always true
-					{
-						this.saveUnicodeString("browser.download.lastDir", defaultfolder);
-					}	
+					this.set_savepath(defaultfolder);
 				}	
-				else  // else, if domain is the same as the last, set the download.dir to the last folder used (else viewDownloadOption will not show the correct save path and will use the default folder)
-				{     // only affect Firefox3 which update download.lastDir instead of download.dir, so taking download.lastDir data to set download.dir, 
-					  // FF1.5 or FF2 automatically update download.dir, not download.lastDir
+				else  // else, if domain is the same as the last, and the user checked "use the same folder if same domain"
+				{
 					if (this.firefoxversion == "3")
 					{
-						var lastpath = this.loadUnicodeString("browser.download.lastDir");  // this one is the one that will open
-						if (lastpath == "") // if no path is returned (first time using lastDir, or the user reseted the content manually in about:config)
-						{
-							this.saveUnicodeString("browser.download.lastDir", defaultfolder);
-							lastpath = defaultfolder;
-						}
-						this.saveUnicodeString("browser.download.dir", lastpath);   // this one is the one that will be shown in ASF save option
-					}	
+						var lastpath = this.loadUnicodeString("browser.download.lastDir");
+					}
+					if (this.firefoxversion == "2")
+					{
+						var lastpath = this.loadUnicodeString("browser.download.dir");
+					}
+					
+					if (lastpath == "") // if no path is returned (first time using lastDir, or the user reseted the content manually in about:config)
+					{
+						lastpath = defaultfolder;
+					}
+					this.set_savepath(lastpath);
 				}
 			}
 			else // else, if savetype == 0  (folder is set to last folder)
 			{
-				// set the download.dir to the last folder used (else viewDownloadOption will not show the correct save path and will use the default folder)
-				// only affect Firefox3 which update download.lastDir instead of download.dir, so we are taking download.lastDir data to set download.dir, 
-				//  FF1.5 or FF2 automatically update download.dir, not download.lastDir
 				if (this.firefoxversion == "3")
 				{
 					var lastpath = this.loadUnicodeString("browser.download.lastDir");
-					if (lastpath == "") // if no path is returned (first time using lastDir, or the user reseted the content manually in about:config)
-					{
-						this.saveUnicodeString("browser.download.lastDir", defaultfolder);
-						lastpath = defaultfolder;
-					}
-					this.saveUnicodeString("browser.download.dir", lastpath);
-				}	
-			
+				}
+				if (this.firefoxversion == "2")
+				{
+					var lastpath = this.loadUnicodeString("browser.download.dir");
+				}
+				
+				if (lastpath == "") // if no path is returned (first time using lastDir, or the user reseted the content manually in about:config)
+				{
+					lastpath = defaultfolder;
+				}
+				this.set_savepath(lastpath);
 			}
 		}
 		else // if a filter is found 
@@ -223,17 +225,13 @@ Copyright (C) 2007-2009 Eric Cassar (Cyan).
 				folder = this.createfolder(folder, idx);		
 			}
 			
-			this.saveUnicodeString("browser.download.dir", folder);
-			if (lastdir == true) // set it for "save as..." on FF1.5 and FF2, on FF3 lastdir is always true
-			{
-				this.saveUnicodeString("browser.download.lastDir", folder);
-			}
+			this.set_savepath(folder);
 		}
 		
 		// in every case, set the new file hosted domain to tempdomain
 		this.saveUnicodeString("extensions.asf.tempdomain", domain);
 		
-		// Automatic saving when clicking on a link. The save dialog still flash onscreen very quicly.
+		// Automatic saving when clicking on a link. The save dialog still flash onscreen very quickly.
 		if (dialogaccept)
 		{
 			window.close();
@@ -248,6 +246,49 @@ Copyright (C) 2007-2009 Eric Cassar (Cyan).
 	},
 	
 	
+	set_savepath: function(path) {
+		var folderList = this.prefManager.getIntPref("browser.download.folderList");	
+		var lastdir = this.prefManager.getBoolPref("extensions.asf.lastdir");	     // for Firefox2 : set save as Ctrl+S too
+		
+		var directory = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
+		directory.initWithPath(path);
+		
+		
+		if (this.firefoxversion == 2)
+		{
+		
+		this.saveUnicodeString("browser.download.dir", directory.path);
+		if (lastdir)
+			this.saveUnicodeString("browser.download.lastDir", directory.path);		
+		}
+		
+		if (this.firefoxversion == 3)
+		{
+			
+			var inPrivateBrowsing = false;
+			try {
+				var pbs = Components.classes["@mozilla.org/privatebrowsing;1"]
+									.getService(Components.interfaces.nsIPrivateBrowsingService);
+				inPrivateBrowsing = pbs.privateBrowsingEnabled;
+			}
+			catch (e) { // nsIPrivateBrowsingService not working on FF2 and 3.0
+			}
+			
+			if (inPrivateBrowsing)
+			{
+				gDownloadLastDir.file = directory;
+			}
+			else
+			{	
+				this.saveUnicodeString("browser.download.lastDir", directory.path);
+				if (folderList == 2)
+					this.saveUnicodeString("browser.download.dir", directory.path);
+			}
+			
+		}	
+	},
+	
+	
 	loadUnicodeString: function (pref_place) {
 		try 
 		{
@@ -305,13 +346,11 @@ Copyright (C) 2007-2009 Eric Cassar (Cyan).
 		
 		// load the domain and the filename of the saved file	
 		var domain = 	document.getElementById("source").value ;
-			domain = domain.replace(/^.*:\/\//g,'');  // remove the protocol name from the domain
+			domain =    domain.replace(/^.*:\/\//g,'');  // remove the protocol name from the domain
 		var filename = 	document.getElementById("location").value ;
 		var file_name = filename.replace (/\.(?!.*\.).*$/i, "");  // Trim from the last dot to the end of the file = remove extension
 		var extension = filename.match(/([^\.]*)$/i);  // take out the extension (anything not containing a dot, with an ending line)
-		
-		
-		
+
 		
 		
 		// check the filter's data
@@ -455,14 +494,14 @@ Copyright (C) 2007-2009 Eric Cassar (Cyan).
 										.replace(/%asf_x%/g, extension[0]);    // match the filename extension (without the dot)
 		// debug
 		// alert (path);
-		var directory = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
-			
-		directory.initWithPath(path);
 		return path;
 		
 // Canceled the folder creation script, so the folder will not be created if the user cancel the download
 // Firefox will create it automatically when accepting the download... under windows XP and Linux Ubuntu at least (not tested under Vista, MacOS, or any other operating system)
-/*      
+/* 
+		var directory = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
+		
+		directory.initWithPath(path);
 		if (directory.exists()) 
 		{
 			return path;
@@ -491,7 +530,9 @@ Copyright (C) 2007-2009 Eric Cassar (Cyan).
 		var asf_savefolder = document.getElementById('asf_savefolder');
 		var asf_viewdloption = this.prefManager.getBoolPref("extensions.asf.viewdloption");	
 		var asf_viewpathselect = this.prefManager.getBoolPref("extensions.asf.viewpathselect");	
-		var folder = this.loadUnicodeString("browser.download.dir");
+		var folder = "";
+		if (this.firefoxversion == 3) folder = this.loadUnicodeString("browser.download.lastDir");
+		if (this.firefoxversion == 2) folder = this.loadUnicodeString("browser.download.dir");
 		
 		// check the lastpath, if different than current folder, then print radio choice to user
 		// so he can choose from found filters, or last used path.
@@ -519,7 +560,7 @@ Copyright (C) 2007-2009 Eric Cassar (Cyan).
 		//now, if the user checked the option to view asf on saving window, set it to visible
 		if(asf_viewdloption == true) asf_dloptions.style.visibility = "visible";
 		
-		//and last, if the user checked the option to view asf on saving window, set it to visible
+		//and last, if the user checked the option to view the path list on saving window, set it to visible
 		if((asf_viewpathselect == true) && (this.prefManager.getIntPref("extensions.asf.filtersNumber") > 0) )
 		{
 			this.read_all_filterpath();
@@ -569,10 +610,13 @@ Copyright (C) 2007-2009 Eric Cassar (Cyan).
 		var j = 0;
 		for (var i = 0; i < nbrfilters; i++)
 		{
-		// read the filter number x
-		path = this.loadUnicodeString("extensions.asf.filters"+ i +".folder");
-		
-		if ( this.indexInArray(pathlist, path) < 0) { pathlist[++j]= path;}
+			// read the filter number x
+			path = this.loadUnicodeString("extensions.asf.filters"+ i +".folder");
+			
+			if (this.indexInArray(pathlist, path) < 0) 
+			{ 
+				pathlist[++j]= path;
+			}
 		}
 		
 		var pathlist_sort_alpha = true;   // let the user choose in next release.
@@ -580,14 +624,14 @@ Copyright (C) 2007-2009 Eric Cassar (Cyan).
 		
 		for (var i = 0; i < pathlist.length; i++)
 		{
-		path = pathlist[i];
-		path = variable_mode == true? this.createfolder(path) : path; 
-		var menuitem = document.createElementNS('http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul', 'menuitem');
-		menuitem.setAttribute('label', path);
-		menuitem.setAttribute('crop', 'center');
-		menuitem.setAttribute('value', path);
-		menuitem.setAttribute('oncommand', "automatic_save_folder.asf_select_savepath(this)");
-		menupopup.appendChild(menuitem);
+			path = pathlist[i];
+			path = variable_mode == true? this.createfolder(path) : path; 
+			var menuitem = document.createElementNS('http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul', 'menuitem');
+			menuitem.setAttribute('label', path);
+			menuitem.setAttribute('crop', 'center');
+			menuitem.setAttribute('value', path);
+			menuitem.setAttribute('oncommand', "automatic_save_folder.asf_select_savepath(this)");
+			menupopup.appendChild(menuitem);
 		}
 		
 		// Populate the path list into the menu
@@ -598,8 +642,6 @@ Copyright (C) 2007-2009 Eric Cassar (Cyan).
 	
 	asf_toggle_savepath: function () {
 	
-		var lastdir = this.prefManager.getBoolPref("extensions.asf.lastdir");	
-		
 		var asf_savefolder = document.getElementById('asf_savefolder');
 		var asf_lastpath = document.getElementById('asf_lastpath');
 		var asf_pathselect = document.getElementById('asf_pathselect');
@@ -622,32 +664,20 @@ Copyright (C) 2007-2009 Eric Cassar (Cyan).
 			userchoice = asf_folder_list.value ;
 		}
 		
-
-		this.saveUnicodeString("browser.download.dir", userchoice);
-		if (lastdir == true) // set it for "save as..." on FF1.5 and FF2, on FF3 lastdir is always true
-		{
-			this.saveUnicodeString("browser.download.lastDir", userchoice);
-		}	
+		this.set_savepath(userchoice);
 	 
 	},
 	
 	
 	asf_select_savepath: function () {	
-	
-		var lastdir = this.prefManager.getBoolPref("extensions.asf.lastdir");	
-		
+
 		// check the third radio choice
 		var asf_radio_savepath = document.getElementById('asf_radio_savepath');
+		var asf_pathselect = document.getElementById('asf_pathselect');
 		asf_radio_savepath.value = 2;
+		asf_pathselect.checked;
 		
-		// read the selected item value
-		var asf_folder_list = document.getElementById('asf_folder_list');
-		
-		this.saveUnicodeString("browser.download.dir", asf_folder_list.value);
-		if (lastdir == true) // set it for "save as..." on FF1.5 and FF2, on FF3 lastdir is always true
-		{
-			this.saveUnicodeString("browser.download.lastDir", asf_folder_list.value);
-		}
+		this.asf_toggle_savepath();
 	},
 	
 	
diff --git a/content/asf_right_click.js b/content/asf_right_click.js
index ada97c8..e10a51b 100644
--- a/content/asf_right_click.js
+++ b/content/asf_right_click.js
@@ -31,8 +31,9 @@ var automatic_save_folder = {
 					
 	versionChecker: Components.classes["@mozilla.org/xpcom/version-comparator;1"]
 						.getService(Components.interfaces.nsIVersionComparator),
-					
-					
+				
+		firefoxversion : "",
+		
 	rightclick_init: function() {
 		if (!asf_rightclick_loaded) 
 		{
@@ -85,8 +86,8 @@ var automatic_save_folder = {
 			}
 		}
 		
-	},	
-		
+	},
+	
 	
 	// reset Timelimit=0 to =1000 when closing Firefox 
 	// it will reset to 1000 even if closing firefox is canceled.
@@ -257,14 +258,13 @@ var automatic_save_folder = {
 		var versionChecker = this.versionChecker;
 		var appInfo = this.appInfo;
 		
-		var firefoxversion = "";
-		if(versionChecker.compare(appInfo.version, "3.0") >= 0) 
+		if(this.versionChecker.compare(this.appInfo.version, "3.0") >= 0) 
 		{
-			 firefoxversion = "3";			
+			this.firefoxversion = "3";
 		}
 		else 
 		{
-			 firefoxversion = "2";
+			this.firefoxversion = "2";
 		}
 		
 		
@@ -301,7 +301,7 @@ var automatic_save_folder = {
 		}
 		
 		// set the last folder path used into asf.lastpath
-		if (firefoxversion == "3")   // take the download.lastDir if it's FF3
+		if (this.firefoxversion == "3")   // take the download.lastDir if it's FF3
 		{
 			var folder = this.loadUnicodeString("browser.download.lastDir");
 		}
@@ -343,6 +343,7 @@ var automatic_save_folder = {
 			// Check the current website URL if hosted domain checking returned false.
 				if (!dom_regexp && use_currentURL)
 				{
+					
 					var currentURL = document.getElementById("urlbar").value;
 					dom_regexp = this.test_regexp(filters[i][0], currentURL); // check the filter domain with the current website URL only if the hosted domain doesn't match
 				}
@@ -366,43 +367,42 @@ var automatic_save_folder = {
 			{
 				if ( (keeptemp == false) || ((keeptemp == true) && ( tempdomain != domain )) ) // and, if [same domain not checked] OR [ if same domain (keeptemp) is checked and domain not same as previous one]
 				{	// then change the destination folder to user choice
-					this.saveUnicodeString("browser.download.dir", defaultfolder);
-					if (lastdir == true) // set it for "save as..." on FF1.5 and FF2, on FF3 lastdir is always true
-					{
-						this.saveUnicodeString("browser.download.lastDir", defaultfolder);
-					}	
+					this.set_savepath(defaultfolder);
 				}	
-				else  // else, if domain is the same as the last, set the download.dir to the last folder used (else viewDownloadOption will not show the correct save path and will use the default folder)
-				{     // only affect Firefox3 which update download.lastDir instead of download.dir, so taking download.lastDir data to set download.dir, 
-					  // FF1.5 or FF2 automatically update download.dir, not download.lastDir
-					if (firefoxversion == "3")
+				else  // else, if domain is the same as the last, and the user checked "use the same folder if same domain"
+				{
+					if (this.firefoxversion == "3")
+					{
+						var lastpath = this.loadUnicodeString("browser.download.lastDir");
+					}
+					if (this.firefoxversion == "2")
+					{
+						var lastpath = this.loadUnicodeString("browser.download.dir");
+					}
+					
+					if (lastpath == "") // if no path is returned (first time using lastDir, or the user reseted the content manually in about:config)
 					{
-						var lastpath = this.loadUnicodeString("browser.download.lastDir");  // this one is the one that will open
-						if (lastpath == "") // if no path is returned (first time using lastDir, or the user reseted the content manually in about:config)
-						{
-							this.saveUnicodeString("browser.download.lastDir", defaultfolder);
-							lastpath = defaultfolder;
-						}
-						this.saveUnicodeString("browser.download.dir", lastpath);   // this one is the one that will be shown in ASF save option
-					}	
+						lastpath = defaultfolder;
+					}
+					this.set_savepath(lastpath);
 				}
 			}
 			else // else, if savetype == 0  (folder is set to last folder)
 			{
-				// set the download.dir to the last folder used (else viewDownloadOption will not show the correct save path and will use the default folder)
-				// only affect Firefox3 which update download.lastDir instead of download.dir, so we are taking download.lastDir data to set download.dir, 
-				//  FF1.5 or FF2 automatically update download.dir, not download.lastDir
-				if (firefoxversion == "3")
+				if (this.firefoxversion == "3")
 				{
 					var lastpath = this.loadUnicodeString("browser.download.lastDir");
-					if (lastpath == "") // if no path is returned (first time using lastDir, or the user reseted the content manually in about:config)
-					{
-						this.saveUnicodeString("browser.download.lastDir", defaultfolder);
-						lastpath = defaultfolder;
-					}
-					this.saveUnicodeString("browser.download.dir", lastpath);
-				}	
-			
+				}
+				if (this.firefoxversion == "2")
+				{
+					var lastpath = this.loadUnicodeString("browser.download.dir");
+				}
+				
+				if (lastpath == "") // if no path is returned (first time using lastDir, or the user reseted the content manually in about:config)
+				{
+					lastpath = defaultfolder;
+				}
+				this.set_savepath(lastpath);
 			}
 		}
 		else // if a filter is found 
@@ -445,11 +445,7 @@ var automatic_save_folder = {
 				folder = this.createfolder(aFpP, folder, idx);		
 			}
 			
-			this.saveUnicodeString("browser.download.dir", folder);
-			if (lastdir == true) // set it for "save as..." on FF1.5 and FF2, on FF3 lastdir is always true
-			{
-				this.saveUnicodeString("browser.download.lastDir", folder);
-			}
+			this.set_savepath(folder);
 		}
 		
 		// in every case, set the new file hosted domain to tempdomain
@@ -459,6 +455,49 @@ var automatic_save_folder = {
 	},
 	
 	
+	set_savepath: function(path) {
+		var folderList = this.prefManager.getIntPref("browser.download.folderList");	
+		var lastdir = this.prefManager.getBoolPref("extensions.asf.lastdir");	     // for Firefox2 : set save as Ctrl+S too
+		
+		var directory = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
+		directory.initWithPath(path);
+		
+		
+		if (this.firefoxversion == 2)
+		{
+		
+		this.saveUnicodeString("browser.download.dir", directory.path);
+		if (lastdir)
+			this.saveUnicodeString("browser.download.lastDir", directory.path);		
+		}
+		
+		if (this.firefoxversion == 3)
+		{
+			
+			var inPrivateBrowsing = false;
+			try {
+				var pbs = Components.classes["@mozilla.org/privatebrowsing;1"]
+									.getService(Components.interfaces.nsIPrivateBrowsingService);
+				inPrivateBrowsing = pbs.privateBrowsingEnabled;
+			}
+			catch (e) { // nsIPrivateBrowsingService not working on FF2 and 3.0
+			}
+			
+			if (inPrivateBrowsing)
+			{
+				gDownloadLastDir.file = directory;
+			}
+			else
+			{	
+				this.saveUnicodeString("browser.download.lastDir", directory.path);
+				if (folderList == 2)
+					this.saveUnicodeString("browser.download.dir", directory.path);
+			}
+			
+		}	
+	},
+	
+	
 	loadUnicodeString: function (pref_place) {
 		try 
 		{
@@ -515,12 +554,6 @@ var automatic_save_folder = {
 		const ZERO = "0";  // leading zero
 		
 		// load the domain and the filename of the saved file	
-		// var domain = 	document.getElementById("source").value ;
-			// domain = domain.replace(/^.*:\/\//g,'');  // remove the protocol name from the domain
-		// var filename = 	document.getElementById("location").value ;
-		// var file_name = filename.replace (/\.(?!.*\.).*$/i, "");  // Trim from the last dot to the end of the file = remove extension
-		// var extension = filename.match(/([^\.]*)$/i);  // take out the extension (anything not containing a dot, with an ending line)
-		
 		var domain = 	aFpP.fileInfo.uri.host ;
 		var scheme = 	aFpP.fileInfo.uri.scheme ;
 		var filename = 	aFpP.fileInfo.fileName ;
@@ -670,14 +703,14 @@ var automatic_save_folder = {
 										.replace(/%asf_x%/g, extension[0]);    // match the filename extension (without the dot)
 		// debug
 		// alert (path);
-		var directory = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
-			
-		directory.initWithPath(path);
 		return path;
 		
 // Canceled the folder creation script, so the folder will not be created if the user cancel the download
 // Firefox will create it automatically when accepting the download... under windows XP and Linux Ubuntu at least (not tested under Vista, MacOS, or any other operating system)
-/*      
+/* 
+		var directory = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
+		
+		directory.initWithPath(path);     
 		if (directory.exists()) 
 		{
 			return path;
diff --git a/content/options.xul b/content/options.xul
index 08f0d0c..de1833f 100644
--- a/content/options.xul
+++ b/content/options.xul
@@ -50,13 +50,14 @@
 	<tooltip id="tooltip_viewpathselect" style="background-color: #33DD00;" noautohide="true">
 		<description value="&asf.viewpathselect.tooltip;"/>
 	</tooltip>
-	<tooltip id="tooltip_rightclick" orient="vertical" style="background-color: #33DD00;overflow:auto;" noautohide="true">
+	<tooltip id="tooltip_rightclick" orient="vertical" style="background-color: #33DD00;" noautohide="true">
 		<description value="&asf.rightclick.tooltip1;"/>
 		<description value="&asf.rightclick.tooltip2;"/>
 		<description value="&asf.rightclick.tooltip3;"/>
 	</tooltip>
-	<tooltip id="tooltip_variablemode" style="background-color: #33DD00;" noautohide="true">
-		<description value="&asf.variablemode.tooltip;"/>
+	<tooltip id="tooltip_variablemode" orient="vertical" style="background-color: #33DD00;" noautohide="true">
+		<description value="&asf.variablemode.tooltip1;"/>
+		<description value="&asf.variablemode.tooltip2;"/>
 	</tooltip>
 	<vbox>
 		<tabbox>
@@ -130,7 +131,7 @@
 			<caption label="&asf.options.label;"/>
 			<separator class="thin"/>
 			<hbox>
-				<checkbox id="asf-useDownloadDir" preference="asf_useDownloadDir" label="&asf.useDownloadDir.bool;"/>
+				<checkbox id="asf-useDownloadDir" preference="asf_useDownloadDir" label="&asf.useDownloadDir.bool;" oncommand="automatic_save_folder.toggle_options();"/>
 				<menulist id="asf-folderList" preference="asf_folderList" tooltip="tooltip_folderList">
 					<menupopup>
 						<menuitem value="0" label="&asf.desktop.label;"></menuitem>
diff --git a/locale/en-US/asf.dtd b/locale/en-US/asf.dtd
index db14ed6..8d4ea9e 100644
--- a/locale/en-US/asf.dtd
+++ b/locale/en-US/asf.dtd
@@ -57,7 +57,8 @@
 <!-- Dynamics tab-->
 <!ENTITY asf.dynamics.label "Dynamic folders">
 <!ENTITY asf.variablemode.bool "Enable">
-<!ENTITY asf.variablemode.tooltip "Allow you to edit the filters saving path manually and add dynamic variables, like the date of the day or the file name.">
+<!ENTITY asf.variablemode.tooltip1 "Allow you to edit the filters saving path manually and add dynamic variables, like the date of the day or the file name.">
+<!ENTITY asf.variablemode.tooltip2 "Attention: When Firefox is in private browsing mode, non existent dynamic folders will not be created. The last valid folder will be used instead.">
 <!ENTITY asf.variablemode.label "Attention : Uppercase and lowercase tags are different.">
 <!ENTITY asf.variables.label "Tags list :">
 
diff --git a/locale/fr-FR/asf.dtd b/locale/fr-FR/asf.dtd
index 53a0a26..0ef8dd7 100644
--- a/locale/fr-FR/asf.dtd
+++ b/locale/fr-FR/asf.dtd
@@ -57,7 +57,8 @@
 <!-- Dynamics tab-->
 <!ENTITY asf.dynamics.label "Dossiers dynamiques">
 <!ENTITY asf.variablemode.bool "Activer">
-<!ENTITY asf.variablemode.tooltip "Permet d'éditer manuellement le chemin d'enregistrement des filtres et d'ajouter des variables dynamiques, comme la date du jour ou le domaine d'hébergement.">
+<!ENTITY asf.variablemode.tooltip1 "Permet d'éditer manuellement le chemin d'enregistrement des filtres et d'ajouter des variables dynamiques, comme la date du jour ou le domaine d'hébergement.">
+<!ENTITY asf.variablemode.tooltip2 "Attention : Lorsque Firefox utilise la navigation privée, les dossiers dynamiques inexistant ne seront pas créés. Le dernier dossier valide sera proposé à la place.">
 <!ENTITY asf.variablemode.label "Attention : Les majuscules et les minuscules correspondent à des balises différentes.">
 <!ENTITY asf.variables.label "Liste des balises :">
 
diff --git a/locale/it-IT/asf.dtd b/locale/it-IT/asf.dtd
index a31812a..1413a34 100644
--- a/locale/it-IT/asf.dtd
+++ b/locale/it-IT/asf.dtd
@@ -57,7 +57,8 @@
 <!-- Dynamics tab-->
 <!ENTITY asf.dynamics.label "Dynamic folders">
 <!ENTITY asf.variablemode.bool "Enable">
-<!ENTITY asf.variablemode.tooltip "Permette di editare i percorsi di salvataggi manualmente e aggiungere variabili dinamiche, come la data del giorno o il nome del file.">
+<!ENTITY asf.variablemode.tooltip1 "Permette di editare i percorsi di salvataggi manualmente e aggiungere variabili dinamiche, come la data del giorno o il nome del file.">
+<!ENTITY asf.variablemode.tooltip2 "">
 <!ENTITY asf.variablemode.label "Nota : Attenziona ai caratteri maiuscoli e minuscoli.">
 <!ENTITY asf.variables.label "Lista dei tag :">
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/automatic-save-folder.git



More information about the Pkg-mozext-commits mailing list