Skip to content

Commit

Permalink
Turn off updates
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.getfiregpg.org/firegpg@273 1e1cc2a3-b62a-0410-bc93-fb3b3b0a0737
  • Loading branch information
theglu committed Jul 1, 2007
1 parent 7b5515b commit 2e59099
Show file tree
Hide file tree
Showing 10 changed files with 65 additions and 34 deletions.
3 changes: 3 additions & 0 deletions ChangeLog
@@ -1,3 +1,6 @@
2007-07-01 Maximilien Cuony
* Option to disable auto-update

2007-06-24 Maximilien Cuony
* 0.4.2.1 repacked, and uploaded to the server !
* Apply diff of 22/06 for gpgAuth
Expand Down
3 changes: 3 additions & 0 deletions TODO
Expand Up @@ -4,6 +4,9 @@ Chaînes auquelles il faudra demander la traduction AVANT UNE NOUVELLE VERSION :
"Always decrypt messages from Authenticated Servers"
"Always decrypt messages from Authenticated Servers"
"Enable gpgAuth (Requires Restart of Firefox)"
"Disable FireGPG's auto updates"
"Warning ! You shouldn't trun off autoupdates if you can't update FireGPG with FireFox, or if you don't check regulary news versions of your addons !"
"Are you realy sure ? We recomand not turn off this option, she is here for help you to have every time latest updates of FireGPG, who is still in beta and can have security issues !"
- firegpg.properties

Tâches libres :
Expand Down
57 changes: 31 additions & 26 deletions content/misc.js
Expand Up @@ -661,47 +661,52 @@ function testIfSomethingsIsNew() {
} else {

//Try to find an update, if it's needed.
var Stamp = new Date();
var nbMs = Stamp.getTime();

var lastUpdate = 0;

var noUpdates = false;
try {
lastUpdate = parseInt(prefs.getCharPref("lastUpdateCheck"));
noUpdates = prefs.getBoolPref("no_updates");
} catch (e) { }

//Not A Number
if (isNaN(lastUpdate))
lastUpdate = 0;
//One day
if (lastUpdate < (nbMs - (24 * 60 * 60 * 1000)))
if (!noUpdates)
{
var Stamp = new Date();
var nbMs = Stamp.getTime();

prefs.setCharPref("lastUpdateCheck",nbMs);

//Get the last version
var updateData = getContent("http://firegpg.tuxfamily.org/stable/update.rdf");
var lastUpdate = 0;

var toDetect = "<version>" + versionAct + "</version>";
try {
lastUpdate = parseInt(prefs.getCharPref("lastUpdateCheck"));
} catch (e) { }

if (updateData.indexOf(toDetect) == -1)
//Not A Number
if (isNaN(lastUpdate))
lastUpdate = 0;
//One day
if (lastUpdate < (nbMs - (24 * 60 * 60 * 1000)))
{

var newVersion = "A new version of FireGPG is available, would you like to update now?";
try {
prefs.setCharPref("lastUpdateCheck",nbMs);

newVersion = i18n.getString('newVersionAlert');
} catch (e) { }
//Get the last version
var updateData = getContent("http://firegpg.tuxfamily.org/stable/update.rdf");

if (confirm(newVersion))
var toDetect = "<version>" + versionAct + "</version>";

if (updateData.indexOf(toDetect) == -1)
{
openUILink("http://firegpg.tuxfamily.org/stable/firegpg.xpi");
}
}

}
var newVersion = "A new version of FireGPG is available, would you like to update now?";
try {

newVersion = i18n.getString('newVersionAlert');
} catch (e) { }

if (confirm(newVersion))
{
openUILink("http://firegpg.tuxfamily.org/stable/firegpg.xpi");
}
}
}
}
}
}

Expand Down
12 changes: 12 additions & 0 deletions content/options.js
Expand Up @@ -136,4 +136,16 @@ function chooseGPGPath()
}
}

/* Show warnings if use try to disable updates */
function showWarnigs()
{
var checkBox = document.getElementById("updates-checkbox");
//Si c'est false, il est entrain d'activer
if (checkBox.checked == false)
{
var i18n = document.getElementById("firegpg-strings");
if (!confirm(i18n.getString('turn-off-updates-w1')) || !confirm(i18n.getString('turn-off-updates-w2')))
checkBox.checked = true;
}
}
// vim:ai:noet:sw=4:ts=4:sts=4:tw=0:fenc=utf-8
3 changes: 2 additions & 1 deletion content/options.xul
Expand Up @@ -50,7 +50,7 @@
<preference id="result-always-in-new-window-pref" name="extensions.firegpg.result_always_in_new_window" type="bool"/>
<preference id="ask-for-save-pass-pref" name="extensions.firegpg.default_memory" type="bool"/>
<preference id="allvays-to-myself-pref" name="extensions.firegpg.allvays_to_myself" type="bool"/>

<preference id="no-updates" name="extensions.firegpg.no_updates" type="bool"/>
</preferences>

<!-- Always sign or verify in a new window -->
Expand All @@ -64,6 +64,7 @@

<checkbox id="allvays-to-myself-checkbox" preference="allvays-to-myself-pref" label="&allvays-to-myself-checkbox;"/>

<checkbox id="updates-checkbox" preference="no-updates" label="&turn-off-updates;" onclick="showWarnigs()"/>


<!-- list of private keys -->
Expand Down
3 changes: 2 additions & 1 deletion defaults/preferences/firegpg.js
Expand Up @@ -12,4 +12,5 @@ pref("extensions.firegpg.no_gpg_agent", false);
pref("extensions.firegpg.default_memory", true);
pref("browser.preferences.animateFadeIn", false);
pref("browser.preferences.instantApply", false);
pref("extension.firegpg.gpgauth.global.enable_gpgauth", true);
pref("extension.firegpg.gpgauth.global.enable_gpgauth", true);
pref("extensions.firegpg.no_updates", false);
4 changes: 3 additions & 1 deletion locale/en-US/firegpg.properties
Expand Up @@ -33,4 +33,6 @@ editorTitle=FireGPG's editor.
editorDescription=Here you can edit and perform some operations on a text.
whatIsNewTitle=What is new ?
whatIsNewDescription=News of FireGPG : (An anonymous ping has been send to FireGPG's team for stats.)
newVersionAlert=A new version of FireGPG is available, would you like to update now?
newVersionAlert=A new version of FireGPG is available, would you like to update now?
turn-off-updates-w1=WARNING: We recommend you don't turn automatic updates off if you are unable to update FireGPG with Firefox or if you don't regularly check for new addon versions.
turn-off-updates-w2=Are you sure? We recommend leaving this option on. It is here to help you maintain FireGPG up to date, which is still in beta and can have security issues.
3 changes: 2 additions & 1 deletion locale/en-US/prefwindow.dtd
Expand Up @@ -24,4 +24,5 @@
<!ENTITY global-allow-keyring-pref.label "Always decrypt messages from Authenticated Servers">
<!ENTITY global-allow-keyring-check.label "Always decrypt messages from Authenticated Servers">
<!ENTITY global-allow-keyring-check.accesskey "A">
<!ENTITY per-domain-preferences.label "Per-domain settings:">
<!ENTITY per-domain-preferences.label "Per-domain settings:">
<!ENTITY turn-off-updates "Disable FireGPG's auto updates">
2 changes: 2 additions & 0 deletions locale/fr/firegpg.properties
Expand Up @@ -34,3 +34,5 @@ editorDescription=Vous pouvez traiter un texte ici.
whatIsNewTitle=Nouveautés de FireGPG
whatIsNewDescription=Voici les nouveautés de FireGPG (en anglais) : (Un ping anonyme à été envoyé à l'équipe de FireGPG pour des statisiques)
newVersionAlert=Une nouvelle version de FireGPG est disponible, voulez-vous effectuer la mise à jour maintenant ?
turn-off-updates-w1=Attention ! Vous ne devriez pas désactiver les autos-mises à jour de FireGPG si vous ne pouvez pas mettre à jour FireGPG avec FireFox, ou si vous ne vérifiez pas régulièrement la présence de nouvelles versions de vos plugins !
turn-off-updates-w2=Êtes vous vraiement certain ? Nous recommandons de ne pas désactiver cette option, elle est là afin de vous aider à avoir toujours la dernière version de FireGPG, qui est encore en Beta et qui pourrait avoir des problèmes de sécurité !
9 changes: 5 additions & 4 deletions locale/fr/prefwindow.dtd
Expand Up @@ -19,9 +19,10 @@
<!ENTITY gmail-buton-crypt-checkbox "Chiffrer">
<!ENTITY gmail-buton-cryptsend-checkbox "Chiffrer et Envoyer">
<!ENTITY allvays-to-myself-checkbox "Toujours chiffrer les messages pour soi-même.">
<!ENTITY enable-gpgauth-check.label "Enable gpgAuth (Requires Restart of Firefox)">
<!ENTITY enable-gpgauth-check.label "Activer gpgAuth (Vous devez redémarrer FireFox)">
<!ENTITY enable-gpgauth-check.accesskey "E">
<!ENTITY global-allow-keyring-pref.label "Always decrypt messages from Authenticated Servers">
<!ENTITY global-allow-keyring-check.label "Always decrypt messages from Authenticated Servers">
<!ENTITY global-allow-keyring-pref.label "Toujours déchiffrer les messages des serveurs authentifiés.">
<!ENTITY global-allow-keyring-check.label "Toujours déchiffrer les messages des serveurs authentifiés.">
<!ENTITY global-allow-keyring-check.accesskey "A">
<!ENTITY per-domain-preferences.label "Per-domain settings:">
<!ENTITY per-domain-preferences.label "Options par domaines:">
<!ENTITY turn-off-updates "Désactiver les mises à jour automatiques de FireGPG.">

0 comments on commit 2e59099

Please sign in to comment.