kuuko pushed a commit to branch master.

http://git.enlightenment.org/apps/epour.git/commit/?id=f7e22aa0b98fe87c0c8c588c4a51fc66e65e98ec

commit f7e22aa0b98fe87c0c8c588c4a51fc66e65e98ec
Author: Kai Huuhko <[email protected]>
Date:   Mon Jul 7 01:40:43 2014 +0300

    Add more torrent menu actions + tooltips
---
 epour/gui/__init__.py | 51 +++++++++++++++++++++++++++++++++++++++++++++------
 1 file changed, 45 insertions(+), 6 deletions(-)

diff --git a/epour/gui/__init__.py b/epour/gui/__init__.py
index baca172..c795abe 100644
--- a/epour/gui/__init__.py
+++ b/epour/gui/__init__.py
@@ -23,6 +23,8 @@ import cgi
 import logging
 from datetime import timedelta, datetime
 
+import libtorrent as lt
+
 from efl.evas import EVAS_HINT_EXPAND, EVAS_HINT_FILL, \
     EVAS_ASPECT_CONTROL_VERTICAL, Rectangle
 from efl.ecore import Timer
@@ -267,7 +269,8 @@ class MainInterface(object):
             ("All time uploaded", intrepr(s.all_time_upload)),
             ("Total wanted done", intrepr(s.total_wanted_done)),
             ("Total wanted", intrepr(s.total_wanted)),
-            ("Total downloaded this session", 
intrepr(s.total_payload_download)),
+            ("Total downloaded this session",
+                intrepr(s.total_payload_download)),
             ("Total uploaded this session", intrepr(s.total_payload_upload)),
             ("Total failed", intrepr(s.total_failed_bytes)),
             ("Number of seeds", s.num_seeds),
@@ -569,9 +572,48 @@ class ItemMenu(Menu):
             rem, "and data files", None,
             self.remove_torrent_cb, item, session, h, True
             )
+        self.item_separator_add(None)
+        it = self.item_add(
+            None, "Force reannounce", None, lambda x, y: h.force_reannounce()
+            )
+        it.tooltip_text_set(
+            "<b>Force reannounce</b> will force this torrent<br>"
+            "to do another tracker request, to receive new<br>"
+            "peers.<br><br>"
+            "If the tracker's min_interval has not passed<br>"
+            "since the last announce, the forced announce<br>"
+            "will be scheduled to happen immediately as<br>"
+            "the min_interval expires. This is to honor<br>"
+            "trackers minimum re-announce interval settings."
+            )
         self.item_add(
+            None, "Force DHT reannounce", None,
+            lambda x, y: h.force_dht_reannounce()
+            )
+        it = self.item_add(
+            None, "Scrape tracker", None,
+            lambda x, y: h.scrape_tracker()
+            )
+        it.tooltip_text_set(
+            "<b>Scrape tracker</b> will send a scrape request to the<br>"
+            "tracker. A scrape request queries the tracker for<br>"
+            "statistics such as total number of incomplete peers,<br>"
+            "complete peers, number of downloads etc."
+            )
+        it = self.item_add(
             None, "Force re-check", None,
-            self.force_recheck, h
+            lambda x, y: h.force_recheck()
+            )
+        it.tooltip_text_set(
+            "force_recheck puts the torrent back in a state<br>"
+            "where it assumes to have no resume data.<br>"
+            "All peers will be disconnected and the torrent<br>"
+            "will stop announcing to the tracker. The torrent<br>"
+            "will be added to the checking queue, and will be<br>"
+            "checked (all the files will be read and compared<br>"
+            "to the piece hashes).<br>"
+            "Once the check is complete, the torrent will start<br>"
+            "connecting to peers again, as normal."
             )
         self.item_separator_add(None)
         self.item_add(
@@ -588,16 +630,13 @@ class ItemMenu(Menu):
         menu.close()
         session.remove_torrent(h, with_data)
 
-    def force_recheck(self, menu, item, h):
-        h.force_recheck()
-
     def resume_torrent_cb(self, menu, item, h):
         h.resume()
         h.auto_managed(True)
 
     def pause_torrent_cb(self, menu, item, h):
         h.auto_managed(False)
-        h.pause()
+        h.pause(flags=lt.pause_flags_t.graceful_pause)
 
     def torrent_props_cb(self, menu, item, h):
         from TorrentProps import TorrentProps

-- 


Reply via email to