mirror of
https://github.com/codex-storage/deluge.git
synced 2025-01-11 12:04:10 +00:00
add login event and enable the logout button once logged in
This commit is contained in:
parent
5153ad6f78
commit
2669ade501
@ -15,8 +15,8 @@ Deluge.ToolBar = {
|
||||
}, this);
|
||||
},
|
||||
|
||||
onLogout: function() {
|
||||
|
||||
onLogin: function() {
|
||||
this.Bar.items.get('logout').enable();
|
||||
},
|
||||
|
||||
onTorrentAction: function(item) {
|
||||
@ -27,49 +27,50 @@ Deluge.ToolBar = {
|
||||
});
|
||||
|
||||
switch (item.id) {
|
||||
case "remove":
|
||||
case 'remove':
|
||||
Deluge.Client.core.remove_torrent(ids, null, {
|
||||
onSuccess: function() {
|
||||
Deluge.Ui.update();
|
||||
}
|
||||
});
|
||||
break;
|
||||
case "pause":
|
||||
case 'pause':
|
||||
Deluge.Client.core.pause_torrent(ids, {
|
||||
onSuccess: function() {
|
||||
Deluge.Ui.update();
|
||||
}
|
||||
});
|
||||
break;
|
||||
case "resume":
|
||||
case 'resume':
|
||||
Deluge.Client.core.resume_torrent(ids, {
|
||||
onSuccess: function() {
|
||||
Deluge.Ui.update();
|
||||
}
|
||||
});
|
||||
break;
|
||||
case "up":
|
||||
case 'up':
|
||||
Deluge.Client.core.queue_up(ids, {
|
||||
onSuccess: function() {
|
||||
Deluge.Ui.update();
|
||||
}
|
||||
});
|
||||
break;
|
||||
case "down":
|
||||
case 'down':
|
||||
Deluge.Client.core.queue_down(ids, {
|
||||
onSuccess: function() {
|
||||
Deluge.Ui.update();
|
||||
}
|
||||
});
|
||||
break;
|
||||
case "connectionman":
|
||||
case 'connectionman':
|
||||
Deluge.Connections.Window.show();
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
onToolbarRender: function(toolbar) {
|
||||
Deluge.Events.on("connect", this.onConnect.bindWithEvent(this));
|
||||
Deluge.Events.on('connect', this.onConnect.bindWithEvent(this));
|
||||
Deluge.Events.on('login', this.onLogin.bindWithEvent(this));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -6,6 +6,7 @@ Deluge.Login = {
|
||||
if (result == true) {
|
||||
Deluge.Login.Window.hide();
|
||||
Deluge.Connections.Window.show();
|
||||
Deluge.Events.fire('login')
|
||||
} else {
|
||||
Ext.MessageBox.show({
|
||||
title: _('Login Failed'),
|
||||
|
Loading…
x
Reference in New Issue
Block a user