Implemented the .clear() -> .erase() change which supposedly fixes a lot of flicker issues

This commit is contained in:
Asmageddon 2012-05-28 21:24:12 +02:00
parent 8d1e4297ec
commit 506a98aee2
5 changed files with 9 additions and 9 deletions

View File

@ -551,7 +551,7 @@ class AllTorrents(BaseMode, component.Component):
def show_torrent_details(self,tid): def show_torrent_details(self,tid):
def dodeets(arg): def dodeets(arg):
if arg and True in arg[0]: if arg and True in arg[0]:
self.stdscr.clear() self.stdscr.erase()
component.get("ConsoleUI").set_mode(TorrentDetail(self,tid,self.stdscr, self.config, self.encoding)) component.get("ConsoleUI").set_mode(TorrentDetail(self,tid,self.stdscr, self.config, self.encoding))
else: else:
self.messages.append(("Error","An error occured trying to display torrent details")) self.messages.append(("Error","An error occured trying to display torrent details"))
@ -588,7 +588,7 @@ class AllTorrents(BaseMode, component.Component):
def __legacy_mode(self): def __legacy_mode(self):
def dolegacy(arg): def dolegacy(arg):
if arg and True in arg[0]: if arg and True in arg[0]:
self.stdscr.clear() self.stdscr.erase()
component.get("ConsoleUI").set_mode(self.legacy_mode) component.get("ConsoleUI").set_mode(self.legacy_mode)
self.legacy_mode.refresh() self.legacy_mode.refresh()
curses.curs_set(2) curses.curs_set(2)

View File

@ -121,7 +121,7 @@ class ConnectionManager(BaseMode):
def __on_connected(self,result): def __on_connected(self,result):
component.start() component.start()
self.stdscr.clear() self.stdscr.erase()
at = AllTorrents(self.stdscr, self.encoding) at = AllTorrents(self.stdscr, self.encoding)
component.get("ConsoleUI").set_mode(at) component.get("ConsoleUI").set_mode(at)
at.resume() at.resume()

View File

@ -80,7 +80,7 @@ class EventView(BaseMode):
curses.doupdate() curses.doupdate()
def back_to_overview(self): def back_to_overview(self):
self.stdscr.clear() self.stdscr.erase()
component.get("ConsoleUI").set_mode(self.parent_mode) component.get("ConsoleUI").set_mode(self.parent_mode)
self.parent_mode.resume() self.parent_mode.resume()

View File

@ -256,7 +256,7 @@ class Preferences(BaseMode):
def back_to_parent(self): def back_to_parent(self):
self.stdscr.clear() self.stdscr.erase()
component.get("ConsoleUI").set_mode(self.parent_mode) component.get("ConsoleUI").set_mode(self.parent_mode)
self.parent_mode.resume() self.parent_mode.resume()

View File

@ -478,7 +478,7 @@ class TorrentDetail(BaseMode, component.Component):
def back_to_overview(self): def back_to_overview(self):
component.stop(["TorrentDetail"]) component.stop(["TorrentDetail"])
component.deregister(self) component.deregister(self)
self.stdscr.clear() self.stdscr.erase()
component.get("ConsoleUI").set_mode(self.alltorrentmode) component.get("ConsoleUI").set_mode(self.alltorrentmode)
self.alltorrentmode._go_top = False self.alltorrentmode._go_top = False
self.alltorrentmode.resume() self.alltorrentmode.resume()