From 0c21af12b0578a0147f7b686954e7e121f959990 Mon Sep 17 00:00:00 2001 From: mathieui Date: Fri, 19 Aug 2016 01:04:43 +0200 Subject: Use the confirmtab for TLS cert validation And wipe the YesNoInput from the codebase --- poezio/windows/__init__.py | 2 +- poezio/windows/input_placeholders.py | 40 ------------------------------------ 2 files changed, 1 insertion(+), 41 deletions(-) (limited to 'poezio/windows') diff --git a/poezio/windows/__init__.py b/poezio/windows/__init__.py index 06200a41..4b52d803 100644 --- a/poezio/windows/__init__.py +++ b/poezio/windows/__init__.py @@ -11,7 +11,7 @@ from poezio.windows.info_bar import GlobalInfoBar, VerticalGlobalInfoBar from poezio.windows.info_wins import InfoWin, XMLInfoWin, PrivateInfoWin, MucListInfoWin, \ ConversationInfoWin, DynamicConversationInfoWin, MucInfoWin, \ ConversationStatusMessageWin, BookmarksInfoWin, ConfirmStatusWin -from poezio.windows.input_placeholders import HelpText, YesNoInput +from poezio.windows.input_placeholders import HelpText from poezio.windows.inputs import Input, HistoryInput, MessageInput, CommandInput from poezio.windows.list import ListWin, ColumnHeaderWin from poezio.windows.misc import VerticalSeparator diff --git a/poezio/windows/input_placeholders.py b/poezio/windows/input_placeholders.py index dd7468a7..3ac478fd 100644 --- a/poezio/windows/input_placeholders.py +++ b/poezio/windows/input_placeholders.py @@ -35,43 +35,3 @@ class HelpText(Win): def on_delete(self): return - -class YesNoInput(Win): - """ - A Window just displaying a Yes/No input - Used to ask a confirmation - """ - def __init__(self, text='', callback=None): - Win.__init__(self) - self.key_func = { - 'y' : self.on_yes, - 'n' : self.on_no, - } - self.txt = text - self.value = None - self.callback = callback - - def on_yes(self): - self.value = True - - def on_no(self): - self.value = False - - def refresh(self, txt=None): - log.debug('Refresh: %s', self.__class__.__name__) - if txt: - self.txt = txt - self._win.erase() - self.addstr(0, 0, self.txt[:self.width-1], to_curses_attr(get_theme().COLOR_WARNING_PROMPT)) - self.finish_line(get_theme().COLOR_WARNING_PROMPT) - self._refresh() - - def do_command(self, key, raw=False): - if key.lower() in self.key_func: - self.key_func[key]() - if self.value is not None and self.callback is not None: - return self.callback() - - def on_delete(self): - return - -- cgit v1.2.3