Jump to content

µTorrent Sidebar Gadget Beta


patrickbrans

Recommended Posts

@Yochanan: http://sites.google.com/site/ultimasites/files/utorrent-gadget.2010021918002068.gadget?attredirects=0

http://forum.utorrent.com/viewtopic.php?pid=457156#p457156

This one should hopefully behave more similarly to the old one.

It turns out this thing always did poll the backend on connection failure. Which is still bad, as I mentioned earlier, but oh well I don't want to break/change the experience, so I'm just going to implement it that way anyway.

Link to comment
Share on other sites

  • Replies 179
  • Created
  • Last Reply

@Tattvalis: Make sure you're using the updated gadget -- see the link below in this post.

@Yochanan: Ugh. I tried to model the changes after the existing code, but modeled it sloppily. It should be fixed for real now... Sorry for all the stupid bugs!

(I'd like to blame the fact that I'm not completely familiar with this codebase, but that's hardly an excuse :P)

http://sites.google.com/site/ultimasites/files/utorrent-gadget.2010022012293105.gadget?attredirects=0

I went ahead and also incorporated the first half of doone's fix for the torrent line overflow for both skins. (Second half I left alone because IE's CSS support can't handle inserting ellipses on truncated strings, which that shorten() manually does)

Link to comment
Share on other sites

@Tattvalis: Make sure you're using the updated gadget -- see the link below in this post.

@Yochanan: Ugh. I tried to model the changes after the existing code, but modeled it sloppily. It should be fixed for real now... Sorry for all the stupid bugs!

(I'd like to blame the fact that I'm not completely familiar with this codebase, but that's hardly an excuse :P)

http://sites.google.com/site/ultimasites/files/utorrent-gadget.2010022012293105.gadget?attredirects=0

I went ahead and also incorporated the first half of doone's fix for the torrent line overflow for both skins. (Second half I left alone because IE's CSS support can't handle inserting ellipses on truncated strings, which that shorten() manually does)

Link to comment
Share on other sites

  • 3 weeks later...
Probably because the cached token expired, and I was too lazy to implement token re-requesting. I can't say if/when I'll get around to messing with it again, but at the moment, I'm tight on leisure time.

.

I understand, however, is not a big deal, I'll wait for a possible fix, thanks for your help and for your useful gadgets.

Link to comment
Share on other sites

  • 3 weeks later...

Unfortunately while I can connect to WebUI through my browser I can't get the plugin to connect. I've entered the username, password, webui URL is 127.0.0.1 and the webport is set to use 8080 (setup as the default listening port), but on saving I get an error stating it cannot connect.

I've updated to the latest version of the gadget, tried a guest account, tried a simpler password, tried using the PC IP instead of the localhost IP. No ball.

Link to comment
Share on other sites

  • 1 month later...

I'll try to code the re-requesting token when expired myself but I am not very used to this token system and can you tell me how can I understand the token is expired so that I can add a check and re-request function to the places that throw an exception.

Or at least can you tell me how long it takes for a token to expire?

Link to comment
Share on other sites

Okay thanks.

Anyone who suffers token expiration problem on the sidebar gadget, the following instructions will probably help you. ( I am using Windows 7 ).

- Open an explorer window ( simply open Computer )

- Type "%localappdata%\Microsoft\Windows Sidebar\Gadgets\" without the brackets

- Get into the folder that includes "utorrent" in its name

- Get into the "js" folder and open "main.js" with notepad or some other text editor

- Find the function named "getData()", press CTRL+F and write "function getData" without brackets to find it

- Find the following part, it will be a few lines below the "function getData()..":

if (XMLHttp.readyState == 4){
if (XMLHttp.status == 200) {
clearTimeout(cTimeout);
cTimeout = null;
checkSettings = false;
setGetDataTimeout();
parseData();
}
else{
timeoutRequest();
}
}

- Replace the part with the following:

if (XMLHttp.readyState == 4){
if (XMLHttp.status == 200) {
clearTimeout(cTimeout);
cTimeout = null;
checkSettings = false;
setGetDataTimeout();
parseData();
}
else if (XMLHttp.status == 400) {
document.getElementById("dockedDonwload").innerHTML = "Trying to renew the token...";
globaltoken = "";
getToken(function () {
getData();
});
}
else{
timeoutRequest();
}
}

Save and exit the text editor, restart the gadget and you probably won't have hanging problems any more.

Link to comment
Share on other sites

Anyone who suffers token expiration problem on the sidebar gadget, the following instructions will probably help you. ( I am using Windows 7 ). ...

Thanks for your tip it worked fine, even after the resumption of the Hibernate State system.

Link to comment
Share on other sites

When I replace that code segment (tried twice in case of cock-up) my gadget now appears as a tiny grey box.

Just to check, my function now appears as follows

function getData(){ 
XMLHttp = new ActiveXObject("Microsoft.XMLHTTP");
globalURL = globalReqUrl + "&list=1" ;

if(cTimeout != null)
clearTimeout(cTimeout);
cTimeout = setTimeout(timeoutRequest, globaltimeout);

if (XMLHttp.readyState == 4){
if (XMLHttp.status == 200) {
clearTimeout(cTimeout);
cTimeout = null;
checkSettings = false;
setGetDataTimeout();
parseData();
}
else if (XMLHttp.status == 400) {
document.getElementById("dockedDonwload").innerHTML = "Trying to renew the token...";
globaltoken = "";
getToken(function () {
getData();
});
}
else{
timeoutRequest();
}
}
}
XMLHttp.open("GET", globalURL, true);
XMLHttp.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT");
XMLHttp.send(null);

function timeoutRequest(){
XMLHttp.abort();
setGetDataTimeout();
checkSettings = true;
document.getElementById("dockedDonwload").innerHTML = Resources.Error;
document.getElementById("dockedDonwloadCount").innerHTML = Resources.Check;
document.getElementById("dockedDonwloadSpeed").innerHTML = "";
document.getElementById("dockedUpload").innerHTML = Resources.Settings;
document.getElementById("dockedUploadCount").innerHTML = "";
document.getElementById("dockedUploadSpeed").innerHTML = "";
}

function setGetDataTimeout(){
if(getDataTimeout != null)
clearTimeout(getDataTimeout);
getDataTimeout = setTimeout(getData, globalrate);
}
}

Link to comment
Share on other sites

There is one extra paranthesis, you probably misselected it during the replacement.

    else{
timeoutRequest();
}
}


} <--- this one


XMLHttp.open("GET", globalURL, true);
XMLHttp.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT");
XMLHttp.send(null);

remove that and should work fine.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.


×
×
  • Create New...