[Pkg-mozext-commits] [automatic-save-folder] 37/133: Add : Added an option to not automatically accept the download if no filter is found. (Thanks to FrizzleFry)
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 8c06d8cad495f9535a9619a6264a6d6c798f3cbd
Author: Cyan <Cyan at d0063192-6b2e-11de-89a9-0b20f3e2dceb>
Date: Sat Dec 5 13:43:40 2009 +0000
Add : Added an option to not automatically accept the download if no filter is found. (Thanks to FrizzleFry)
git-svn-id: http://automatic-save-folder.googlecode.com/svn/trunk@37 d0063192-6b2e-11de-89a9-0b20f3e2dceb
---
content/asf.js | 23 +++++++++++++++++++++--
content/asf_download.js | 18 ++++++++++--------
content/options.xul | 7 ++++++-
defaults/preferences/asf.js | 1 +
locale/en-US/asf.dtd | 2 ++
locale/fr-FR/asf.dtd | 2 ++
locale/it-IT/asf.dtd | 2 ++
7 files changed, 44 insertions(+), 11 deletions(-)
diff --git a/content/asf.js b/content/asf.js
index 7c84a2d..db3e64e 100644
--- a/content/asf.js
+++ b/content/asf.js
@@ -214,6 +214,7 @@ var automatic_save_folder = {
var viewdloption = document.getElementById("asf-viewdloption");
var viewpathlist = document.getElementById("asf-viewpathselect");
var dialogaccept = document.getElementById("asf-dialogaccept");
+ var dialogacceptFiltered = document.getElementById("asf-dialogacceptFiltered");
var useDownloadDir = document.getElementById("asf-useDownloadDir");
// check if autosave is selected, if not : set the saving path to "filtered" and disable the dropdown menu.
@@ -228,9 +229,27 @@ var automatic_save_folder = {
document.getElementById("asf-folderList").disabled = false;
}
- // if the option is opened from the saving window, disable the autosave feature (Not working when set from here.)
- dialogaccept.disabled = (window.opener.location == "chrome://mozapps/content/downloads/unknownContentType.xul") ? true : false ;
+ // set the sub-dialogaccept option to grey state
+ if (dialogaccept.checked == false)
+ {
+ dialogacceptFiltered.checked = false;
+ dialogacceptFiltered.disabled = true;
+ }
+ if (dialogaccept.checked == true)
+ {
+ dialogacceptFiltered.disabled = false;
+ }
+
+ // if the option window is opened from the saving window, disable the autosave feature (Not working when set from here.)
+ if (window.opener.location == "chrome://mozapps/content/downloads/unknownContentType.xul")
+ {
+ dialogaccept.disabled = true;
+ dialogacceptFiltered.disabled = true;
+ }
+
+
+ // set the sub-D/L option to grey state
if (viewdloption.checked == false)
{
viewpathlist.checked = false;
diff --git a/content/asf_download.js b/content/asf_download.js
index adde5d9..fbf6ffe 100644
--- a/content/asf_download.js
+++ b/content/asf_download.js
@@ -65,14 +65,15 @@ Copyright (C) 2007-2009 Eric Cassar (Cyan).
// load prefmanager data
- var savetype = prefManager.getIntPref("extensions.asf.savetype");
- var lastdir = prefManager.getBoolPref("extensions.asf.lastdir"); // for Firefox2 : set save as Ctrl+S too
- var defaultfolder = this.loadUnicodeString("extensions.asf.defaultfolder");
- var keeptemp = prefManager.getBoolPref("extensions.asf.keeptemp");
- var tempdomain = this.loadUnicodeString("extensions.asf.tempdomain"); // hosted domain from last saved file
- var variable_mode = prefManager.getBoolPref("extensions.asf.variablemode"); // enable Variables in folder creation (dynamic Folders)
- var dialogaccept = prefManager.getBoolPref("extensions.asf.dialogaccept");
- var use_currentURL = prefManager.getBoolPref("extensions.asf.usecurrenturl");
+ var savetype = prefManager.getIntPref("extensions.asf.savetype");
+ var lastdir = prefManager.getBoolPref("extensions.asf.lastdir"); // for Firefox2 : set save as Ctrl+S too
+ var defaultfolder = this.loadUnicodeString("extensions.asf.defaultfolder");
+ var keeptemp = prefManager.getBoolPref("extensions.asf.keeptemp");
+ var tempdomain = this.loadUnicodeString("extensions.asf.tempdomain"); // hosted domain from last saved file
+ var variable_mode = prefManager.getBoolPref("extensions.asf.variablemode"); // enable Variables in folder creation (dynamic Folders)
+ var dialogaccept = prefManager.getBoolPref("extensions.asf.dialogaccept");
+ var dialogacceptFiltered = prefManager.getBoolPref("extensions.asf.dialogacceptFiltered");
+ var use_currentURL = prefManager.getBoolPref("extensions.asf.usecurrenturl");
// If variable/Dynamic folders mode is ON, let's replace the variables to create the new defaultfolder
if (variable_mode == true)
@@ -221,6 +222,7 @@ Copyright (C) 2007-2009 Eric Cassar (Cyan).
// Automatic saving when clicking on a link. The save dialog still flash onscreen very quickly.
+ if (dialogacceptFiltered && idx < 0) dialogaccept = false; // no filter matched, do not autoaccept the dialog
if (dialogaccept)
{
window.close();
diff --git a/content/options.xul b/content/options.xul
index 0a186f7..f08f31a 100644
--- a/content/options.xul
+++ b/content/options.xul
@@ -30,6 +30,7 @@
<preference id="asf_savetype" name="extensions.asf.savetype" type="int"/>
<preference id="asf_variablemode" name="extensions.asf.variablemode" type="bool"/>
<preference id="asf_dialogaccept" name="extensions.asf.dialogaccept" type="bool"/>
+ <preference id="asf_dialogacceptFiltered" name="extensions.asf.dialogacceptFiltered" type="bool"/>
<preference id="asf_rightclick" name="extensions.asf.rightclick" type="bool"/>
<preference id="asf_usecurrenturl" name="extensions.asf.usecurrenturl" type="bool"/>
<preference id="asf_useDownloadDir" name="browser.download.useDownloadDir" type="bool"/>
@@ -59,6 +60,9 @@
<description value="&asf.variablemode.tooltip1;"/>
<description value="&asf.variablemode.tooltip2;"/>
</tooltip>
+ <tooltip id="tooltip_dialogacceptFiltered" orient="vertical" style="background-color: #33DD00;" noautohide="true">
+ <description value="&asf.dialogacceptFiltered.tooltip;"/>
+ </tooltip>
<vbox>
<tabbox>
<tabs>
@@ -141,7 +145,8 @@
</menupopup>
</menulist>
</hbox>
- <checkbox id="asf-dialogaccept" preference="asf_dialogaccept" label="&asf.dialogaccept.bool;"/>
+ <checkbox id="asf-dialogaccept" preference="asf_dialogaccept" label="&asf.dialogaccept.bool;" oncommand="automatic_save_folder.toggle_options();"/>
+ <checkbox id="asf-dialogacceptFiltered" preference="asf_dialogacceptFiltered" label="&asf.dialogacceptFiltered.bool;" tooltip="tooltip_dialogacceptFiltered" style="margin-left:25px;"/>
<checkbox id="asf-viewdloption" preference="asf_viewdloption" label="&asf.viewdloption.bool;" tooltip="tooltip_viewdloption" oncommand="automatic_save_folder.toggle_options();"/>
<checkbox id="asf-viewpathselect" preference="asf_viewpathselect" label="&asf.viewpathselect.bool;" tooltip="tooltip_viewpathselect" style="margin-left:25px;white-space:pre-wrap"/>
<separator class="thin"/>
diff --git a/defaults/preferences/asf.js b/defaults/preferences/asf.js
index 69f64f1..6d4c04a 100644
--- a/defaults/preferences/asf.js
+++ b/defaults/preferences/asf.js
@@ -15,5 +15,6 @@ pref("extensions.asf at mangaheart.org.description", "chrome://asf/locale/asf.prope
// does only affect the user if useDownloadDir = true ---- if "always ask the destination folder" is selected in FF options, it has no effect on the user.
pref("browser.download.folderList", 2);
pref("extensions.asf.dialogaccept", false);
+ pref("extensions.asf.dialogacceptFiltered", false);
pref("extensions.asf.rightclick", true);
pref("extensions.asf.usecurrenturl", false);
\ No newline at end of file
diff --git a/locale/en-US/asf.dtd b/locale/en-US/asf.dtd
index 509a14f..ec6c42e 100644
--- a/locale/en-US/asf.dtd
+++ b/locale/en-US/asf.dtd
@@ -40,6 +40,8 @@
<!ENTITY asf.filteredfolder.label "Set by the filters">
<!ENTITY asf.folderList.tooltip "If the "Downloads" folder doesn't exist, the file explorer will be shown.">
<!ENTITY asf.dialogaccept.bool "Automatically accept the "What should Firefox do with this file" dialog windows.">
+<!ENTITY asf.dialogacceptFiltered.bool "Only if a filter is found">
+<!ENTITY asf.dialogacceptFiltered.tooltip "Will not automatically accept the "What should Firefox do with this file" dialog windows if no filter matches.">
<!ENTITY asf.viewdloption.bool "View options when downloading">
<!ENTITY asf.viewdloption.tooltip "Allow you to see the last two destination folders and a link to add or edit the filters">
<!ENTITY asf.viewpathselect.bool "View the list of folders">
diff --git a/locale/fr-FR/asf.dtd b/locale/fr-FR/asf.dtd
index f053a4c..b06001d 100644
--- a/locale/fr-FR/asf.dtd
+++ b/locale/fr-FR/asf.dtd
@@ -40,6 +40,8 @@
<!ENTITY asf.filteredfolder.label "Défini par les filtres">
<!ENTITY asf.folderList.tooltip "Si le dossier "Téléchargements" n'existe pas, l'explorateur de fichier s'affichera.">
<!ENTITY asf.dialogaccept.bool "Valider automatiquement la fenêtre "Que doit faire Firefox avec ce fichier ?".">
+<!ENTITY asf.dialogacceptFiltered.bool "Seulement si un filtre est trouvé">
+<!ENTITY asf.dialogacceptFiltered.tooltip "Ne valide pas automatiquement la fenêtre "Que doit faire Firefox avec ce fichier ?" si aucun filtre ne correspond.">
<!ENTITY asf.viewdloption.bool "Afficher les options lors de l'enregistrement">
<!ENTITY asf.viewdloption.tooltip "Permet de voir les deux derniers dossiers d'enregistrement et un lien pour éditer ou ajouter de nouveaux filtres.">
<!ENTITY asf.viewpathselect.bool "Afficher la liste des filtres">
diff --git a/locale/it-IT/asf.dtd b/locale/it-IT/asf.dtd
index 788e81e..ffc5bb0 100644
--- a/locale/it-IT/asf.dtd
+++ b/locale/it-IT/asf.dtd
@@ -40,6 +40,8 @@
<!ENTITY asf.filteredfolder.label "">
<!ENTITY asf.folderList.tooltip "">
<!ENTITY asf.dialogaccept.bool "">
+<!ENTITY asf.dialogacceptFiltered.bool "">
+<!ENTITY asf.dialogacceptFiltered.tooltip "">
<!ENTITY asf.viewdloption.bool "Vedere le opzioni mentre scarica">
<!ENTITY asf.viewdloption.tooltip "permette di vedere le due ultime cartelle di destinazione e un collegamento per aggiungere o modificare filtri.">
<!ENTITY asf.viewpathselect.bool "Vedi la lista dei filtri">
--
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