Commit 765f1807 authored by mathieui's avatar mathieui Committed by louiz’

Fix various issues with the /configure tab

Vertical tab list, text not erased from previous tab
parent adf3cfe6
......@@ -75,7 +75,7 @@ class DataFormsTab(Tab):
def refresh(self):
self.topic_win.refresh(self._form['title'])
self.tab_win.refresh()
self.refresh_tab_win()
self.help_win.refresh()
self.help_win_dyn.refresh(self.form_win.get_help_message())
self.form_win.refresh()
......@@ -88,7 +88,7 @@ class FieldInput(object):
"""
def __init__(self, field):
self._field = field
self.color = (14, -1)
self.color = get_theme().COLOR_NORMAL_TEXT
def set_color(self, color):
self.color = color
......@@ -131,6 +131,7 @@ class ColoredLabel(windows.Win):
def refresh(self):
with g_lock:
self._win.erase()
self._win.attron(to_curses_attr(self.color))
self.addstr(0, 0, self.text)
self._win.attroff(to_curses_attr(self.color))
......@@ -157,7 +158,7 @@ class DummyInput(FieldInput, windows.Win):
class ColoredLabel(windows.Win):
def __init__(self, text):
self.text = text
self.color = (14, -1)
self.color = get_theme().COLOR_NORMAL_TEXT
windows.Win.__init__(self)
def resize(self, height, width, y, x):
......@@ -169,6 +170,7 @@ class ColoredLabel(windows.Win):
def refresh(self):
with g_lock:
self._win.erase()
self._win.attron(to_curses_attr(self.color))
self.addstr(0, 0, self.text)
self._win.attroff(to_curses_attr(self.color))
......@@ -189,6 +191,7 @@ class BooleanWin(FieldInput, windows.Win):
def refresh(self):
with g_lock:
self._win.erase()
self._win.attron(to_curses_attr(self.color))
self.addnstr(0, 0, ' '*(8), self.width)
self.addstr(0, 2, "%s"%self.value)
......@@ -253,6 +256,7 @@ class TextMultiWin(FieldInput, windows.Win):
def refresh(self):
if not self.edition_input:
with g_lock:
self._win.erase()
self._win.attron(to_curses_attr(self.color))
self.addnstr(0, 0, ' '*self.width, self.width)
option = self.options[self.val_pos]
......@@ -305,6 +309,7 @@ class ListMultiWin(FieldInput, windows.Win):
def refresh(self):
with g_lock:
self._win.erase()
self._win.attron(to_curses_attr(self.color))
self.addnstr(0, 0, ' '*self.width, self.width)
if self.val_pos > 0:
......@@ -351,6 +356,7 @@ class ListSingleWin(FieldInput, windows.Win):
def refresh(self):
with g_lock:
self._win.erase()
self._win.attron(to_curses_attr(self.color))
self.addnstr(0, 0, ' '*self.width, self.width)
if self.val_pos > 0:
......@@ -377,7 +383,7 @@ class TextSingleWin(FieldInput, windows.Input):
self.text = field.getValue() if isinstance(field.getValue(), str)\
else ""
self.pos = len(self.text)
self.color = (14, -1)
self.color = get_theme().COLOR_NORMAL_TEXT
def reply(self):
self._field['label'] = ''
......@@ -427,7 +433,7 @@ class FormWin(object):
}
def __init__(self, form, height, width, y, x):
self._form = form
self._win = curses.newwin(height, width, y, x)
self._win = windows.Win._tab_win.derwin(height, width, y, x)
self.current_input = 0
self.inputs = [] # dict list
for (name, field) in self._form.getFields().items():
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment