mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-21 09:38:44 +00:00
allow marking in file view (no actions just yet)
This commit is contained in:
parent
5dcc935852
commit
f6f3a8e084
1 changed files with 28 additions and 5 deletions
|
@ -220,12 +220,24 @@ class TorrentDetail(BaseMode, component.Component):
|
||||||
self.file_limit = idx
|
self.file_limit = idx
|
||||||
|
|
||||||
if idx >= self.file_off:
|
if idx >= self.file_off:
|
||||||
# set fg/bg colors based on if we are selected or not
|
# set fg/bg colors based on if we are selected/marked or not
|
||||||
|
|
||||||
|
# default values
|
||||||
|
fg = "white"
|
||||||
|
bg = "black"
|
||||||
|
|
||||||
|
if fl[1] in self.marked:
|
||||||
|
bg = "blue"
|
||||||
|
|
||||||
if idx == self.current_file_idx:
|
if idx == self.current_file_idx:
|
||||||
self.current_file = fl
|
self.current_file = fl
|
||||||
fc = "{!black,white!}"
|
bg = "white"
|
||||||
|
if fl[1] in self.marked:
|
||||||
|
fg = "blue"
|
||||||
else:
|
else:
|
||||||
fc = "{!white,black!}"
|
fg = "black"
|
||||||
|
|
||||||
|
color_string = "{!%s,%s!}"%(fg,bg)
|
||||||
|
|
||||||
#actually draw the dir/file string
|
#actually draw the dir/file string
|
||||||
if fl[3] and fl[4]: # this is an expanded directory
|
if fl[3] and fl[4]: # this is an expanded directory
|
||||||
|
@ -239,7 +251,7 @@ class TorrentDetail(BaseMode, component.Component):
|
||||||
deluge.common.fsize(fl[2]),fl[5],fl[6]],
|
deluge.common.fsize(fl[2]),fl[5],fl[6]],
|
||||||
self.column_widths)
|
self.column_widths)
|
||||||
|
|
||||||
self.add_string(off,"%s%s"%(fc,r),trim=False)
|
self.add_string(off,"%s%s"%(color_string,r),trim=False)
|
||||||
off += 1
|
off += 1
|
||||||
|
|
||||||
if fl[3] and fl[4]:
|
if fl[3] and fl[4]:
|
||||||
|
@ -322,6 +334,12 @@ class TorrentDetail(BaseMode, component.Component):
|
||||||
component.get("ConsoleUI").set_mode(self.alltorrentmode)
|
component.get("ConsoleUI").set_mode(self.alltorrentmode)
|
||||||
self.alltorrentmode.resume()
|
self.alltorrentmode.resume()
|
||||||
|
|
||||||
|
def _mark_unmark(self,idx):
|
||||||
|
if idx in self.marked:
|
||||||
|
del self.marked[idx]
|
||||||
|
else:
|
||||||
|
self.marked[idx] = True
|
||||||
|
|
||||||
def _doRead(self):
|
def _doRead(self):
|
||||||
c = self.stdscr.getch()
|
c = self.stdscr.getch()
|
||||||
|
|
||||||
|
@ -359,5 +377,10 @@ class TorrentDetail(BaseMode, component.Component):
|
||||||
# space
|
# space
|
||||||
elif c == 32:
|
elif c == 32:
|
||||||
self.expcol_cur_file()
|
self.expcol_cur_file()
|
||||||
|
else:
|
||||||
|
if c > 31 and c < 256:
|
||||||
|
if chr(c) == 'm':
|
||||||
|
if self.current_file:
|
||||||
|
self._mark_unmark(self.current_file[1])
|
||||||
|
|
||||||
self.refresh()
|
self.refresh()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue