mirror of
https://github.com/codex-storage/deluge.git
synced 2025-01-17 06:41:26 +00:00
Added an audible bell on torrent completion (optional, off by default)
This commit is contained in:
parent
935777fb49
commit
cf58aa780a
@ -40,6 +40,7 @@ import deluge.common
|
||||
import colors
|
||||
from deluge.ui.client import client
|
||||
|
||||
import curses
|
||||
import time
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
@ -68,6 +69,7 @@ class EventLog(component.Component):
|
||||
self.previous_time = time.localtime(0)
|
||||
|
||||
def on_torrent_added_event(self, torrent_id, from_state):
|
||||
if from_state: return
|
||||
def on_torrent_status(status):
|
||||
self.write("{!green!}Torrent Added{!input!}(from_state=%s): {!info!}%s (%s)" % (
|
||||
from_state, status["name"], torrent_id)
|
||||
@ -89,11 +91,12 @@ class EventLog(component.Component):
|
||||
if state in colors.state_color:
|
||||
state = colors.state_color[state] + state
|
||||
|
||||
#self.write("State change: %s {!info!}%s (%s)" %
|
||||
self.write("%s: {!info!}%s ({!cyan!}%s{!info!})" %
|
||||
(state, self.console.get_torrent_name(torrent_id), torrent_id))
|
||||
|
||||
def on_torrent_finished_event(self, torrent_id):
|
||||
if component.get("AllTorrents").config["ring_bell"]:
|
||||
curses.beep()
|
||||
self.write("{!info!}Torrent Finished: %s (%s)" %
|
||||
(self.console.get_torrent_name(torrent_id), torrent_id))
|
||||
|
||||
|
@ -175,7 +175,8 @@ DEFAULT_PREFS = {
|
||||
"torrents_per_tab_press": 15,
|
||||
"sort_primary": "queue",
|
||||
"sort_secondary": "name",
|
||||
"separate_complete": True
|
||||
"separate_complete": True,
|
||||
"ring_bell": False
|
||||
}
|
||||
|
||||
column_pref_names = ["queue","name","size","state",
|
||||
|
@ -317,6 +317,7 @@ class InterfacePane(BasePane):
|
||||
self.add_checked_input("move_selection","Move selection when moving torrents in the queue",parent.console_config["move_selection"])
|
||||
self.add_checked_input("third_tab_lists_all","Third tab lists all remaining torrents in legacy mode",parent.console_config["third_tab_lists_all"])
|
||||
self.add_int_spin_input("torrents_per_tab_press","Torrents per tab press",parent.console_config["torrents_per_tab_press"], 5, 100)
|
||||
self.add_checked_input("ring_bell","Ring system bell when a download finishes",parent.console_config["ring_bell"])
|
||||
|
||||
self.add_header("Columns To Display", True)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user