Module: deluge
Branch: master
Commit: 08843ccad592cddd874037f6d47906246f73c2a0

Author: Nick Lanham <[email protected]>
Date:   Tue Mar  8 12:21:45 2011 +0100

support prefs that don't fit on the screen

remove superfluous log message

---

 deluge/ui/console/modes/alltorrents.py      |    1 -
 deluge/ui/console/modes/preference_panes.py |   18 +++++++++++++++++-
 deluge/ui/console/modes/preferences.py      |    1 +
 3 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/deluge/ui/console/modes/alltorrents.py 
b/deluge/ui/console/modes/alltorrents.py
index 778ffa4..083bbf6 100644
--- a/deluge/ui/console/modes/alltorrents.py
+++ b/deluge/ui/console/modes/alltorrents.py
@@ -262,7 +262,6 @@ class AllTorrents(BaseMode, component.Component):
 
     # component start/update
     def start(self):
-        log.error("STARTING")
         component.get("SessionProxy").get_torrents_status(self.__status_dict, 
self.__status_fields).addCallback(self.set_state,False)
 
     def update(self):
diff --git a/deluge/ui/console/modes/preference_panes.py 
b/deluge/ui/console/modes/preference_panes.py
index 25aafd7..e249216 100644
--- a/deluge/ui/console/modes/preference_panes.py
+++ b/deluge/ui/console/modes/preference_panes.py
@@ -93,6 +93,9 @@ class BasePane:
         self.inputs = []
         self.active_input = -1
         
+        # have we scrolled down in the list
+        self.input_offset = 0
+        
     def move(self,r,c):
         self._cursor_row = r
         self._cursor_col = c
@@ -134,12 +137,25 @@ class BasePane:
                 if not isinstance(ipt,NoInput):
                     self.active_input = i
                     break
+        drew_act = not active
         crow = 1
         for i,ipt in enumerate(self.inputs):
-            if ipt.depend_skip():
+            if ipt.depend_skip() or i<self.input_offset:
+                if active and i==self.active_input:
+                    self.input_offset-=1
+                    mode.refresh()
+                    return 0
                 continue
             act = active and i==self.active_input
+            if act: drew_act = True
             crow += ipt.render(screen,crow,width, act, self.offset)
+            if crow >= (mode.prefs_height):
+                break
+
+        if not drew_act:
+            self.input_offset+=1
+            mode.refresh()
+            return 0
 
         if active and self._cursor_row >= 0:
             curses.curs_set(2)
diff --git a/deluge/ui/console/modes/preferences.py 
b/deluge/ui/console/modes/preferences.py
index a44bf80..0c0cd5a 100644
--- a/deluge/ui/console/modes/preferences.py
+++ b/deluge/ui/console/modes/preferences.py
@@ -129,6 +129,7 @@ class Preferences(BaseMode):
 
         # create the panes
         self.prefs_width = self.cols-self.div_off-1
+        self.prefs_height = self.rows-4
         self.panes = [
             DownloadsPane(self.div_off+2, self, self.prefs_width),
             NetworkPane(self.div_off+2, self, self.prefs_width),

-- 
You received this message because you are subscribed to the Google Groups 
"deluge-commit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/deluge-commit?hl=en.

Reply via email to