From 1c08462dd345eba3b2e6794940612ce5177518d7 Mon Sep 17 00:00:00 2001 From: Marcos Pinto Date: Wed, 13 Feb 2008 04:45:31 +0000 Subject: [PATCH] add time limits for seeding torrents --- glade/preferences_dialog.glade | 1050 +++++++++++++++++--------------- src/core.py | 27 +- src/dialogs.py | 11 +- src/pref.py | 6 + 4 files changed, 592 insertions(+), 502 deletions(-) diff --git a/glade/preferences_dialog.glade b/glade/preferences_dialog.glade index 0f3eda151..92d185be8 100644 --- a/glade/preferences_dialog.glade +++ b/glade/preferences_dialog.glade @@ -69,24 +69,8 @@ 2 2 - + True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - Store all downloads in: - Store all downloads in: - 0 - 0 - True - True - radio_ask_save - - - - - - True - False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER Select A Folder @@ -94,6 +78,8 @@ 1 2 + 1 + 2 @@ -109,8 +95,9 @@ - + True + False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER Select A Folder @@ -118,10 +105,23 @@ 1 2 - 1 - 2 + + + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + Store all downloads in: + Store all downloads in: + 0 + 0 + True + True + radio_ask_save + + + 1 @@ -165,6 +165,17 @@ GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 1 2 + + + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + Autoload all torrent files in: + 0 + 0 + True + + True @@ -183,17 +194,6 @@ 2 - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - Autoload all torrent files in: - 0 - 0 - True - - @@ -1095,6 +1095,59 @@ Either 3 + + + True + 10 + + + True + Stop seeding torrents when their seed time reaches: + True + 0 + True + + + + False + + + + + True + False + True + Number of hours + 1 + 0 0 100 0.050000000745099998 10 9 + 1 + 2 + True + + + False + 1 + + + + + 4 + + + + + True + False + True + Automatically clear torrents that reach the max seed time + True + 0 + True + + + 5 + + @@ -1174,10 +1227,10 @@ Either 6 2 - + True True - The maximum half-open connections. A high value may crash some cheap routers. Set -1 for unlimited. + The maximum number of connection attempts per second. A high value may crash some cheap routers. Set -1 for unlimited. 1 -1 -1 9000 1 10 10 1 @@ -1185,51 +1238,122 @@ Either 1 2 - 4 - 5 + 5 + 6 GTK_FILL - + True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 10 - - - True - The maximum half-open connections. A high value may crash some cheap routers. Set -1 for unlimited. - 0 - Maximum Half-Open Connections: - - + The maximum number of connection attempts per second. A high value may crash some cheap routers. Set -1 for unlimited. + 0 + Maximum Connection Attempts per Second: - 4 - 5 - GTK_FILL + 5 + 6 - + True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 10 - - - True - The maximum upload speed for all torrents. Set -1 for unlimited. - 0 - Maximum Upload Slots: - - + True + The maximum upload slots for all torrents. Set -1 for unlimited. + 1 + -1 -1 9000 1 10 10 + 1 + 1 + 2 3 4 GTK_FILL + + + True + True + The maximum upload speed for all torrents. Set -1 for unlimited. + 1 + 0 -1 9000 1 10 10 + 1 + 1 + + + 1 + 2 + 2 + 3 + GTK_FILL + + + + + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + The maximum download speed for all torrents. Set -1 for unlimited. + 1 + 0 -1 9000 1 10 10 + 1 + 1 + + + 1 + 2 + 1 + 2 + GTK_FILL + + + + + True + The maximum download speed for all torrents. Set -1 for unlimited. + 0 + Maximum Download Speed (KiB/s): + + + 1 + 2 + + + + + True + True + The maximum number of connections allowed. Set -1 for unlimited. + 1 + -1 -1 1000 1 10 10 + 1 + + + 1 + 2 + GTK_FILL + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 10 + + + True + The maximum number of connections allowed. Set -1 for unlimited. + 0 + Maximum Connections: + + + + + GTK_FILL + + True @@ -1251,121 +1375,50 @@ Either - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 10 - + True - The maximum number of connections allowed. Set -1 for unlimited. + The maximum upload speed for all torrents. Set -1 for unlimited. 0 - Maximum Connections: + Maximum Upload Slots: - GTK_FILL - - - - - True - True - The maximum number of connections allowed. Set -1 for unlimited. - 1 - -1 -1 1000 1 10 10 - 1 - - - 1 - 2 - GTK_FILL - - - - - True - The maximum download speed for all torrents. Set -1 for unlimited. - 0 - Maximum Download Speed (KiB/s): - - - 1 - 2 - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - The maximum download speed for all torrents. Set -1 for unlimited. - 1 - 0 -1 9000 1 10 10 - 1 - 1 - - - 1 - 2 - 1 - 2 - GTK_FILL - - - - - True - True - The maximum upload speed for all torrents. Set -1 for unlimited. - 1 - 0 -1 9000 1 10 10 - 1 - 1 - - - 1 - 2 - 2 - 3 - GTK_FILL - - - - - True - True - The maximum upload slots for all torrents. Set -1 for unlimited. - 1 - -1 -1 9000 1 10 10 - 1 - - - 1 - 2 3 4 GTK_FILL - + True - The maximum number of connection attempts per second. A high value may crash some cheap routers. Set -1 for unlimited. - 0 - Maximum Connection Attempts per Second: + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 10 + + + True + The maximum half-open connections. A high value may crash some cheap routers. Set -1 for unlimited. + 0 + Maximum Half-Open Connections: + + - 5 - 6 + 4 + 5 + GTK_FILL - + True True - The maximum number of connection attempts per second. A high value may crash some cheap routers. Set -1 for unlimited. + The maximum half-open connections. A high value may crash some cheap routers. Set -1 for unlimited. 1 -1 -1 9000 1 10 10 1 @@ -1373,8 +1426,8 @@ Either 1 2 - 5 - 6 + 4 + 5 GTK_FILL @@ -1419,19 +1472,35 @@ Either 2 2 - + True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - The maximum number of connections per torrent. Set -1 for unlimited. - 0 - Maximum Connections: - - + True + The maximum upload slots per torrent. Set -1 for unlimited. + 1 + -1 -1 1000 1 10 10 + 1 + + 1 + 2 + 1 + 2 + GTK_FILL + + + + + True + True + The maximum number of connections per torrent. Set -1 for unlimited. + 1 + -1 -1 1000 1 10 10 + + + 1 + 2 + GTK_FILL + @@ -1453,35 +1522,19 @@ Either - + True - True - The maximum number of connections per torrent. Set -1 for unlimited. - 1 - -1 -1 1000 1 10 10 + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + The maximum number of connections per torrent. Set -1 for unlimited. + 0 + Maximum Connections: + + - - 1 - 2 - GTK_FILL - - - - - True - True - The maximum upload slots per torrent. Set -1 for unlimited. - 1 - -1 -1 1000 1 10 10 - 1 - - - 1 - 2 - 1 - 2 - GTK_FILL - @@ -1591,46 +1644,73 @@ Either - + + True + False + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 8080 0 65000 1 10 10 + + + 3 + 4 + 1 + 2 + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + Port + + + 2 + 3 + 1 + 2 + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + Server + + + 2 + 3 + + + + + True + False + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + False + + + 1 + 2 + 2 + 3 + + + + True False True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - 4 - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - Proxy type - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - Username - - + 1 + 2 1 2 - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - Password - - - 2 - 3 - - True @@ -1649,71 +1729,44 @@ HTTP W/ Auth - + True - False - True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + Password - 1 - 2 - 1 - 2 - - - - - True - False - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - False - - - 1 - 2 2 3 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - Server + Username - 2 - 3 - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - Port - - - 2 - 3 1 2 - + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + Proxy type + + + + True False True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 8080 0 65000 1 10 10 3 4 - 1 - 2 @@ -1786,46 +1839,73 @@ HTTP W/ Auth - + + True + False + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 8080 0 65000 1 10 10 + + + 3 + 4 + 1 + 2 + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + Port + + + 2 + 3 + 1 + 2 + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + Server + + + 2 + 3 + + + + + True + False + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + False + + + 1 + 2 + 2 + 3 + + + + True False True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - 4 - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - Proxy type - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - Username - - + 1 + 2 1 2 - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - Password - - - 2 - 3 - - True @@ -1844,71 +1924,44 @@ HTTP W/ Auth - + True - False - True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + Password - 1 - 2 - 1 - 2 - - - - - True - False - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - False - - - 1 - 2 2 3 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - Server + Username - 2 - 3 - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - Port - - - 2 - 3 1 2 - + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + Proxy type + + + + True False True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 8080 0 65000 1 10 10 3 4 - 1 - 2 @@ -1981,46 +2034,73 @@ HTTP W/ Auth - + + True + False + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 8080 0 65000 1 10 10 + + + 3 + 4 + 1 + 2 + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + Port + + + 2 + 3 + 1 + 2 + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + Server + + + 2 + 3 + + + + + True + False + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + False + + + 1 + 2 + 2 + 3 + + + + True False True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - 4 - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - Proxy type - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - Username - - + 1 + 2 1 2 - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - Password - - - 2 - 3 - - True @@ -2039,71 +2119,44 @@ HTTP W/ Auth - + True - False - True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + Password - 1 - 2 - 1 - 2 - - - - - True - False - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - False - - - 1 - 2 2 3 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - Server + Username - 2 - 3 - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - Port - - - 2 - 3 1 2 - + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + Proxy type + + + + True False True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 8080 0 65000 1 10 10 3 4 - 1 - 2 @@ -2176,46 +2229,73 @@ HTTP W/ Auth - + + True + False + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 8080 0 65000 1 10 10 + + + 3 + 4 + 1 + 2 + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + Port + + + 2 + 3 + 1 + 2 + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + Server + + + 2 + 3 + + + + + True + False + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + False + + + 1 + 2 + 2 + 3 + + + + True False True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - 4 - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - Proxy type - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - Username - - + 1 + 2 1 2 - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - Password - - - 2 - 3 - - True @@ -2234,71 +2314,44 @@ HTTP W/ Auth - + True - False - True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + Password - 1 - 2 - 1 - 2 - - - - - True - False - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - False - - - 1 - 2 2 3 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - Server + Username - 2 - 3 - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - Port - - - 2 - 3 1 2 - + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + Proxy type + + + + True False True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 8080 0 65000 1 10 10 3 4 - 1 - 2 @@ -2532,33 +2585,26 @@ HTTP W/ Auth 2 2 - + True - True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - Custom: - 0 - True - True - radio_open_folder_stock - + 6 + + + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + + + + 1 + 2 1 2 - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - Open folder with: - 0 - True - True - - True @@ -2581,22 +2627,29 @@ Thunar - + True + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 6 - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - + Open folder with: + 0 + True + True + + + + + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + Custom: + 0 + True + True + radio_open_folder_stock + - 1 - 2 1 2 @@ -2944,4 +2997,3 @@ information is sent. - diff --git a/src/core.py b/src/core.py index 8ce27b4d4..a0ae7efe7 100644 --- a/src/core.py +++ b/src/core.py @@ -75,6 +75,7 @@ PREF_FUNCTIONS = { "max_active_torrents" : None, # no need for a function, applied constantly "max_upload_slots_global" : deluge_core.set_max_upload_slots_global, "auto_seed_ratio" : None, # no need for a function, applied constantly + "auto_seed_time" : None, # no need for a function, applied constantly "max_download_speed_bps" : deluge_core.set_download_rate_limit, "max_upload_speed_bps" : deluge_core.set_upload_rate_limit, "enable_dht" : None, # not a normal pref in that is is applied only on start @@ -171,6 +172,7 @@ class torrent_info: self.desired_ratio = 1.0 self.trackers = "" self.trackers_changed = 0 + self.seed_time = 0 self.delete_me = False # set this to true, to delete it on next sync self.del_data = False # set this to true, to delete data on next sync @@ -653,7 +655,6 @@ Space:") + " " + nice_free) if not self.get_pref('clear_max_ratio_torrents') \ and self.get_pref('auto_seed_ratio') > 0 \ and self.get_pref('auto_end_seeding'): - for unique_ID in self.unique_IDs: torrent_state = self.get_core_torrent_state(unique_ID) if (torrent_state["total_wanted"] - torrent_state["total_wanted_done"] == 0) and not torrent_state['is_paused']: @@ -661,8 +662,20 @@ Space:") + " " + nice_free) if ratio >= self.get_pref('auto_seed_ratio'): self.queue_bottom(unique_ID, enforce_queue=False) # don't recurse! self.set_user_pause(unique_ID, True, enforce_queue=False) + + if not self.get_pref('clear_max_rtime_torrents') \ + and self.get_pref('auto_seed_time') > 0 \ + and self.get_pref('auto_time_end_seeding'): + for unique_ID in self.unique_IDs: + torrent_state = self.get_core_torrent_state(unique_ID) + if (torrent_state["total_wanted"] - torrent_state["total_wanted_done"] == 0) and not torrent_state['is_paused']: + seed_time = self.unique_IDs[unique_ID].seed_time + now = time.time() + if (now - seed_time) >= (self.get_pref('auto_seed_time') * 3600): + self.queue_bottom(unique_ID, enforce_queue=False) # don't recurse! + self.set_user_pause(unique_ID, True, enforce_queue=False) - if self.get_pref('clear_max_ratio_torrents'): + if self.get_pref('clear_max_ratio_torrents') and self.get_pref('auto_end_seeding'): for unique_ID in self.unique_IDs.keys(): torrent_state = self.get_core_torrent_state(unique_ID) if (torrent_state["total_wanted"] - torrent_state["total_wanted_done"] == 0): @@ -670,6 +683,15 @@ Space:") + " " + nice_free) if ratio >= self.get_pref('auto_seed_ratio'): self.removed_unique_ids[unique_ID] = 1 self.remove_torrent(unique_ID, False, True) + if self.get_pref('clear_max_time_torrents') and self.get_pref('auto_time_end_seeding'): + for unique_ID in self.unique_IDs.keys(): + torrent_state = self.get_core_torrent_state(unique_ID) + if (torrent_state["total_wanted"] - torrent_state["total_wanted_done"] == 0): + seed_time = self.unique_IDs[unique_ID].seed_time + now = time.time() + if (now - seed_time) >= (self.get_pref('auto_seed_time') * 3600): + self.removed_unique_ids[unique_ID] = 1 + self.remove_torrent(unique_ID, False, True) # Event handling def connect_event(self, event_type, callback): @@ -721,6 +743,7 @@ Space:") + " " + nice_free) # save fast resume once torrent finishes so as to not recheck # seed if client crashes self.save_fastresume_data(event['unique_ID']) + self.unique_IDs[event['unique_ID']].seed_time = time.time() elif event['event_type'] is self.constants['EVENT_FILE_ERROR']: import gtk diff --git a/src/dialogs.py b/src/dialogs.py index d1e16d6c3..166c4f006 100644 --- a/src/dialogs.py +++ b/src/dialogs.py @@ -150,10 +150,14 @@ class PreferencesDlg: self.glade.get_widget("chk_queue_above_completed").set_sensitive(self.preferences.get("queue_seeds_to_bottom")) self.glade.get_widget("chk_queue_above_completed").set_active(self.preferences.get("queue_above_completed")) self.glade.get_widget("chk_autoseed").set_active(self.preferences.get("auto_end_seeding")) + self.glade.get_widget("chk_autotime").set_active(self.preferences.get("auto_time_end_seeding")) self.glade.get_widget("chk_clear_max_ratio_torrents").set_sensitive(self.preferences.get("auto_end_seeding")) self.glade.get_widget("chk_clear_max_ratio_torrents").set_active(self.preferences.get("clear_max_ratio_torrents")) + self.glade.get_widget("chk_clear_max_time_torrents").set_sensitive(self.preferences.get("auto_time_end_seeding")) + self.glade.get_widget("chk_clear_max_time_torrents").set_active(self.preferences.get("clear_max_time_torrents")) self.glade.get_widget("chk_paused").set_active(self.preferences.get("start_paused")) self.glade.get_widget("ratio_spinner").set_value(self.preferences.get("auto_seed_ratio")) + self.glade.get_widget("time_spinner").set_value(self.preferences.get("auto_seed_time")) self.glade.get_widget("chk_dht").set_active(self.preferences.get("enable_dht")) self.glade.get_widget("chk_use_advanced_bar").set_active(self.preferences.get("use_advanced_bar")) @@ -255,7 +259,8 @@ class PreferencesDlg: self.preferences.set("enable_multi_only", self.glade.get_widget("chk_enable_multi_only").get_active()) self.preferences.set("prioritize_first_last_pieces", self.glade.get_widget("chk_prioritize_first_last_pieces").get_active()) self.preferences.set("auto_end_seeding", self.glade.get_widget("chk_autoseed").get_active()) - self.preferences.set("auto_seed_ratio", self.glade.get_widget("ratio_spinner").get_value()) + self.preferences.set("auto_time_end_seeding", self.glade.get_widget("chk_autotime").get_active()) + self.preferences.set("auto_seed_time", self.glade.get_widget("time_spinner").get_value()) self.preferences.set("use_compact_storage", self.glade.get_widget("radio_compact_allocation").get_active()) self.preferences.set("listen_on", [self.glade.get_widget("spin_port_min").get_value(), self.glade.get_widget("spin_port_max").get_value()]) self.preferences.set("max_upload_speed", self.glade.get_widget("spin_max_upload").get_value()) @@ -274,6 +279,7 @@ class PreferencesDlg: self.preferences.set("queue_seeds_to_bottom", self.glade.get_widget("chk_seedbottom").get_active()) self.preferences.set("enable_dht", self.glade.get_widget("chk_dht").get_active()) self.preferences.set("clear_max_ratio_torrents", self.glade.get_widget("chk_clear_max_ratio_torrents").get_active()) + self.preferences.set("clear_max_time_torrents", self.glade.get_widget("chk_clear_max_time_torrents").get_active()) self.preferences.set("queue_above_completed", self.glade.get_widget("chk_queue_above_completed").get_active()) self.preferences.set("start_paused", self.glade.get_widget("chk_paused").get_active()) self.preferences.set("use_advanced_bar", self.glade.get_widget("chk_use_advanced_bar").get_active()) @@ -341,6 +347,9 @@ class PreferencesDlg: elif widget == self.glade.get_widget('chk_autoseed'): self.glade.get_widget('ratio_spinner').set_sensitive(value) self.glade.get_widget('chk_clear_max_ratio_torrents').set_sensitive(value) + elif widget == self.glade.get_widget('chk_autotime'): + self.glade.get_widget('time_spinner').set_sensitive(value) + self.glade.get_widget('chk_clear_max_time_torrents').set_sensitive(value) elif widget == self.glade.get_widget('chk_seedbottom'): self.glade.get_widget('chk_queue_above_completed').set_sensitive(value) elif widget == self.glade.get_widget('chk_enable_files_dialog'): diff --git a/src/pref.py b/src/pref.py index 251b7f823..98c160c85 100644 --- a/src/pref.py +++ b/src/pref.py @@ -48,12 +48,15 @@ if common.windows_check(): "open_folder_location": "", "send_info" : True, "auto_end_seeding" : False, + "auto_time_end_seeding" : False, "auto_seed_ratio" : 0, + "auto_seed_time" : 0, "close_to_tray" : False, "enable_files_dialog" : False, "enable_multi_only" : True, "queue_above_completed" : False, "clear_max_ratio_torrents" : False, + "clear_max_time_torrents" : False, "default_autoload_path" : os.path.expanduser("~"), "default_torrent_path" : os.path.join(os.path.expanduser("~"), 'deluge', 'torrentfiles'), "default_download_path" : os.path.expanduser("~"), @@ -162,13 +165,16 @@ else: "open_folder_location": "", "send_info" : True, "auto_end_seeding" : False, + "auto_time_end_seeding" : False, "new_releases" : True, "auto_seed_ratio" : 0, + "auto_seed_time" : 0, "close_to_tray" : False, "enable_files_dialog" : False, "enable_multi_only" : True, "queue_above_completed" : False, "clear_max_ratio_torrents" : False, + "clear_max_time_torrents" : False, "default_autoload_path" : os.path.expanduser("~"), "default_torrent_path" : os.path.join(xdg.BaseDirectory.save_config_path('deluge'), 'torrentfiles'), "default_download_path" : os.path.expanduser("~"),