]> granicus.if.org Git - transmission/commitdiff
#5974: Torrents queued should be able to "Resume Now" (patch by JJTagy)
authorMike Gelfand <mikedld@mikedld.com>
Sun, 3 Jan 2016 20:57:42 +0000 (20:57 +0000)
committerMike Gelfand <mikedld@mikedld.com>
Sun, 3 Jan 2016 20:57:42 +0000 (20:57 +0000)
web/javascript/torrent.js
web/javascript/transmission.js

index 4f29270121b39c726b848c912c8e3f7850aa85aa..a90760cbc1a44a3a36ac571b84208855e1fa6934 100644 (file)
@@ -259,6 +259,8 @@ Torrent.prototype =
        isStopped: function() { return this.getStatus() === Torrent._StatusStopped; },
        isChecking: function() { return this.getStatus() === Torrent._StatusCheck; },
        isDownloading: function() { return this.getStatus() === Torrent._StatusDownload; },
+       isQueued: function() { return this.getStatus() === Torrent._StatusDownloadWait ||
+                                     this.getStatus() === Torrent._StatusSeedWait; },
        isDone: function() { return this.getLeftUntilDone() < 1; },
        needsMetaData: function(){ return this.getMetadataPercentComplete() < 1; },
        getActivity: function() { return this.getDownloadSpeed() + this.getUploadSpeed(); },
index cff750ef228e3f72765a459cb1aad2a08023f656..82fa1176c251564694cc6aa8ac580a36a5818cf5 100644 (file)
@@ -216,7 +216,7 @@ Transmission.prototype =
                                        var tl = $(event.target);
                                        tl.contextmenu("enableEntry", "pause_selected", s.activeSel > 0);
                                        tl.contextmenu("enableEntry", "resume_selected", s.pausedSel > 0);
-                                       tl.contextmenu("enableEntry", "resume_now_selected", s.pausedSel > 0);
+                                       tl.contextmenu("enableEntry", "resume_now_selected", s.pausedSel > 0 || s.queuedSel > 0);
                                        tl.contextmenu("enableEntry", "rename", s.sel == 1);
                                });
                        }, this)
@@ -1325,7 +1325,8 @@ Transmission.prototype =
                        paused: 0,
                        sel: 0,
                        activeSel: 0,
-                       pausedSel: 0
+                       pausedSel: 0,
+                       queuedSel: 0
                };
 
                clearTimeout(this.buttonRefreshTimer);
@@ -1334,12 +1335,14 @@ Transmission.prototype =
                for (var i=0, row; row=this._rows[i]; ++i) {
                        var isStopped = row.getTorrent().isStopped();
                        var isSelected = row.isSelected();
+                       var isQueued = row.getTorrent().isQueued();
                        ++stats.total;
                        if (!isStopped) ++stats.active;
                        if (isStopped) ++stats.paused;
                        if (isSelected) ++stats.sel;
                        if (isSelected && !isStopped) ++stats.activeSel;
                        if (isSelected && isStopped) ++stats.pausedSel;
+                       if (isSelected && isQueued) ++stats.queuedSel;
                }
 
                callback(stats);