Ignore:
Timestamp:
04/27/2009 08:48:39 PM (16 years ago)
Author:
Damien Churchill <damoc@gmail.com>
Branches:
2.0.x, develop, extjs4-port, master
Children:
b88542f
Parents:
2ac545d
Message:

add torrents to be added to the grid before their info has been
retrieved with a url or filename in place of the torrent name

File:
1 edited

Legend:

Unmodified
Added
Removed
  • deluge/ui/web/js/Deluge.Add.Url.js

    r2ac545d r8582915  
    7171                var field = this.form.items.get('url');
    7272                var url = field.getValue();
     73                var torrentId = this.createTorrentId();
    7374               
    7475                Deluge.Client.web.download_torrent_from_url(url, {
    7576                        success: this.onDownload,
    76                         scope: this
     77                        scope: this,
     78                        torrentId: torrentId
    7779                });
    7880                this.hide();
    79                 this.fireEvent('beforeadd', url);
     81                this.fireEvent('beforeadd', torrentId, url);
    8082        },
    8183       
    82         onDownload: function(filename) {
     84        onDownload: function(filename, obj, resp, req) {
    8385                this.form.items.get('url').setValue('');
    8486                Deluge.Client.web.get_torrent_info(filename, {
    8587                        success: this.onGotInfo,
    8688                        scope: this,
    87                         filename: filename
     89                        filename: filename,
     90                        torrentId: req.options.torrentId
    8891                });
    8992        },
     
    9194        onGotInfo: function(info, obj, response, request) {
    9295                info['filename'] = request.options.filename;
    93                 this.fireEvent('add', info);
     96                this.fireEvent('add', request.options.torrentId, info);
    9497        }
    9598});
Note: See TracChangeset for help on using the changeset viewer.