[Pkg-mozext-commits] [automatic-save-folder] 40/133: Fix : - When using instantApply, the suggested filters weren't refreshed after closing the preference window. - On Firefox 2, the nsIDownloadManager doesn't exist, so I can't find the default download folder. "..." is use instead of the suggested path when the user force the file saving to Desktop or Downloads.

David Prévot taffit at moszumanska.debian.org
Mon Apr 27 20:33:50 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 7c457918f6e380d53c9ad88d71c0f780bc2e8892
Author: Cyan <Cyan at d0063192-6b2e-11de-89a9-0b20f3e2dceb>
Date:   Sun Dec 6 14:49:55 2009 +0000

    Fix :
    - When using instantApply, the suggested filters weren't refreshed after closing
      the preference window.
    - On Firefox 2, the nsIDownloadManager doesn't exist, so I can't find the
      default download folder.
      "..." is use instead of the suggested path when the user force the file saving
      to Desktop or Downloads.
    
    git-svn-id: http://automatic-save-folder.googlecode.com/svn/trunk@40 d0063192-6b2e-11de-89a9-0b20f3e2dceb
---
 content/asf.js          |  9 ++++++++-
 content/asf_download.js | 34 ++++++++++++++++++++++++----------
 content/options.xul     |  1 +
 locale/en-US/about.dtd  |  3 ++-
 locale/fr-FR/about.dtd  |  3 ++-
 5 files changed, 37 insertions(+), 13 deletions(-)

diff --git a/content/asf.js b/content/asf.js
index db3e64e..f126a6c 100644
--- a/content/asf.js
+++ b/content/asf.js
@@ -669,7 +669,13 @@ var automatic_save_folder = {
 	//save the options
 		this.asf_saveoptions();
 		
-	//close the options	
+	// close the preference window
+		this.asf_close();
+	},
+	
+	asf_close: function() {
+	
+		//close the options	
 		window.close();
 		if (window.opener.location == "chrome://mozapps/content/downloads/unknownContentType.xul") // if the option is opened from the saving window
 		{ 	
@@ -677,6 +683,7 @@ var automatic_save_folder = {
 			window.opener.sizeToContent();
 		}		
 		window.opener.focus;
+	
 	}
 	
 };
\ No newline at end of file
diff --git a/content/asf_download.js b/content/asf_download.js
index b130b85..9b06ef3 100644
--- a/content/asf_download.js
+++ b/content/asf_download.js
@@ -257,18 +257,21 @@ Copyright (C) 2007-2009 Eric Cassar (Cyan).
 								.getService(Components.interfaces.nsIProperties)
 								.get("Desk", Components.interfaces.nsILocalFile);
 
-			var dnldMgr = Components.classes["@mozilla.org/download-manager;1"]
-									.getService(Components.interfaces.nsIDownloadManager);
-			var supportDownloadLabel = !dnldMgr.defaultDownloadsDirectory.equals(desk);			
-			
-			if ( (folderList == 0) || (folderList == 1 && !supportDownloadLabel) ) // if desktop or if OS doesn't support default Download dir
+			if (this.firefoxversion == 3) 
 			{
-				var directory = desk;
+				var dnldMgr = Components.classes["@mozilla.org/download-manager;1"]
+									.getService(Components.interfaces.nsIDownloadManager);
+				var supportDownloadLabel = !dnldMgr.defaultDownloadsDirectory.equals(desk);			
+				
+				if ( (folderList == 0) || (folderList == 1 && !supportDownloadLabel) ) // if desktop or if OS doesn't support default Download dir
+				{
+					var directory = desk;
+				}
+				if (folderList == 1 && supportDownloadLabel) // default Downloads folder
+				{
+					directory.initWithPath(dnldMgr.defaultDownloadsDirectory.path);
+				}
 			}
-			if (folderList == 1 && supportDownloadLabel) // default Downloads folder
-			{
-				directory.initWithPath(dnldMgr.defaultDownloadsDirectory.path);
-			}		
 		}
 		
 		
@@ -585,6 +588,17 @@ Copyright (C) 2007-2009 Eric Cassar (Cyan).
 		
 		var folder = "";
 		if (this.firefoxversion == 2) folder = this.loadUnicodeString("browser.download.dir");
+		if (this.firefoxversion == 2) // set the show suggested path to "..." because I didn't find how to read the default donloads folder path. (See function Set_savepath(); )
+		{
+			if (useDownloadDir && folderList == 0)  // desktop
+			{
+				folder = "...";
+			}
+			if (useDownloadDir && folderList == 1) // default Downloads folder
+			{
+				folder = "...";
+			}
+		}
 		if (this.firefoxversion == 3)
 		{
 			
diff --git a/content/options.xul b/content/options.xul
index f08f31a..9178be1 100644
--- a/content/options.xul
+++ b/content/options.xul
@@ -18,6 +18,7 @@
 			defaultButton="accept"
 			onload="automatic_save_folder.asf_load();"
 			ondialogaccept="automatic_save_folder.asf_savepref();"
+			ondialogcancel="automatic_save_folder.asf_close();"
 			xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" title="&prefwindow.title; (&asf.version;)"
 >
 <prefpane id="asf-options"  style="padding:1px !important" flex="1" >
diff --git a/locale/en-US/about.dtd b/locale/en-US/about.dtd
index 765a372..caad865 100644
--- a/locale/en-US/about.dtd
+++ b/locale/en-US/about.dtd
@@ -25,7 +25,7 @@
 <!ENTITY about.fix "Fixed">
 <!ENTITY about.version.title "Version">
 
-<!-- Keep the newline intact as it uses <pre> tags, keep the 2 begining spaces to create indentation -->
+<!-- Keep the newline intact as it uses the < pre > tag, keep the 2 begining spaces to create indentation -->
 <!ENTITY about.version.094 "+ Add filtering on Right-Click menus "Save link as...", "Save image as..." and "Save as...(Ctrl+S)"
   (Need at least Firefox 2.0 and is not compatible with Download Sort add-on. If you have both activated, Download Sort prevails)
 + ASF is now working with Private browsing, and will prevent saving any data to Firefox preferences.
@@ -45,6 +45,7 @@
 ! Correct the filter's checking when Dynamic folder creation is enabled
 ! Prevent an exception when "use current website URL" option is enabled and the address bar doesn't contain an URL.
   Happened with redirection download script and Firefox closing the new empty popup window, or using middle mouse-button click on a link.
+! When using instantApply, the suggested filters weren't refreshed after closing the preference window.
 
 Other updates :
 + Source code and revisions available on http://code.google.com/p/automatic-save-folder
diff --git a/locale/fr-FR/about.dtd b/locale/fr-FR/about.dtd
index 21c115d..9b573c1 100644
--- a/locale/fr-FR/about.dtd
+++ b/locale/fr-FR/about.dtd
@@ -25,7 +25,7 @@
 <!ENTITY about.fix "Correction">
 <!ENTITY about.version.title "Version">
 
-<!-- Conserver les retour à la ligne car le tag <pre> est utilisé, gardez les deux espaces en début de ligne pour l'indentation -->
+<!-- Conserver les retour à la ligne car le tag < pre > est utilisé, gardez les deux espaces en début de ligne pour l'indentation -->
 <!ENTITY about.version.094 "+ Ajout du filtrage avec les menus du clic-droit "Enregistrer la cible sous...", "Enregistrer l'image sous..." et "Enregistrer sous...(Ctrl+S)"
   (Ne fonctionne qu'à partir de Firefox 2.0 et est incompatible avec l'extension Download Sort. Si les deux extensions sont activées, Download Sort est prioritaire)
 + ASF fonctionne maintenant avec la Navigation Privée, empéchant toutes données d'être enregistrées dans les préférences de Firefox.
@@ -45,6 +45,7 @@
 ! Correction d'une vérification du filtrage lorsque les variables dynamiques étaient utilisés.
 ! Correction d'une exception lorsque l'option "Utiliser l'URL du site courant" est activé et que la barre d'adresse ne contient pas d'URL. 
   Se produisait généralement avec les script de redirection lorsque Firefox refermait le nouvel onglet vide, ou en cliquant sur un lien avec la molette de la souris.
+! En utilisant l'option InstantApply, les filtres suggérés n'étaient pas rechargés à la fermeture de la fenêtre de préférences.
 
 Autres mises à jour :
 + Code source et révisions disponibles sur http://code.google.com/p/automatic-save-folder

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