Commits

Stefan Scherfke  committed 4dcfac7

Tea Timer no remembers if you don’t wannt to update to a specific version.

  • Participants
  • Parent commits 85802e0
  • Tags 1.7.1

Comments (0)

Files changed (3)

File ChangeLog.txt

 =======================================
 
 
-2010-07-12 – 1.7.1:
+2010-07-18 – 1.7.1:
 
+* [NEW] TT now remembers if you don’t want to upgrade to a specific version.
 * [FIX] Growl works again.
 * [FIX] Problem with pausing and resetting the timer.
 

File Tea Timer.wdgt/Info.plist

 	<key>CFBundleName</key>
 	<string>Tea Timer</string>
 	<key>CFBundleVersion</key>
-	<string>1.7.0.9</string>
+	<string>1.7.1</string>
 	<key>MainHTML</key>
 	<string>TeaTimer.html</string>
 	<key>CloseBoxInsetX</key>

File Tea Timer.wdgt/Scripts/Updater.js

  */
 function Updater() {
 	this.clientVersion = null;
+	this.availableVersion = null;
 	this.updateCheck = true;
 	this.lastChecked = null;
 	this.url = 'http://update.sofa-rockers.org/check/1/';
 	$('#no').bind('mouseout mouseup', function(event) {
 		$(event.target).attr('src', 'Images/cancelUpdate.png');});
 	$('#no').click(function(event) {
-		$('#update').css('display', 'none');});
+		$('#update').css('display', 'none');
+		if (window.widget)
+		    widget.setPreferenceForKey(updater.availableVersion,
+		            'noupdate.version');
+	});
 	$('#yes').bind('mouseover mousedown', function(event) {
 		$(event.target).attr('src', 'Images/doUpdate_clicked.png');});
 	$('#yes').bind('mouseout mouseup', function(event) {
 	$('#yes').click(function(event) {
 		if (window.widget)
 			widget.openURL('http://stefan.sofa-rockers.org');
+			widget.setPreferenceForKey(null, 'noupdate.version');
 		$('#update').css('display', 'none');
 	});
 }
 			type: 'GET',
 		 	dataType: 'string',
 		  	success: function(availableVersion) {
+		  	    updater.availableVersion = availableVersion;
 				if (availableVersion > updater.clientVersion) {
+				    // Check if update is not wanted
+				    var buf = widget.preferenceForKey('noupdate.version');
+                	if (buf && availableVersion == buf) {
+                	    return;
+                	}
+                	
 					$('#clientVersion').text(updater.clientVersion);
 					$('#availableVersion').text(availableVersion);
 					$('#update').css('display', 'block');