summaryrefslogtreecommitdiff
path: root/poezio/windows/info_wins.py
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2016-08-19 01:00:06 +0200
committermathieui <mathieui@mathieui.net>2016-08-19 01:00:06 +0200
commit82d00d495b816c237cbefac3ff2387907a7f8843 (patch)
treea9eb2b831373b765165959b003be3fc43aa8a1db /poezio/windows/info_wins.py
parentc94df86b2cb0230cda2281f1d955b8796b2b29bb (diff)
downloadpoezio-82d00d495b816c237cbefac3ff2387907a7f8843.tar.gz
poezio-82d00d495b816c237cbefac3ff2387907a7f8843.tar.bz2
poezio-82d00d495b816c237cbefac3ff2387907a7f8843.tar.xz
poezio-82d00d495b816c237cbefac3ff2387907a7f8843.zip
Add a "confirm" tab type
This tab will be used when an external events prompts a boolean choice to a user, like a new ssl cert, or a XEP (e.g. 0070) that needs an answer, and for which a command-line interface with an info message would be a pain.
Diffstat (limited to 'poezio/windows/info_wins.py')
-rw-r--r--poezio/windows/info_wins.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/poezio/windows/info_wins.py b/poezio/windows/info_wins.py
index 4ca72449..da470cb5 100644
--- a/poezio/windows/info_wins.py
+++ b/poezio/windows/info_wins.py
@@ -304,3 +304,21 @@ class BookmarksInfoWin(InfoWin):
def write_remote_status(self, preferred):
self.addstr('Remote storage: %s' % preferred, to_curses_attr(get_theme().COLOR_INFORMATION_BAR))
+class ConfirmStatusWin(Win):
+ def __init__(self, text, critical=False):
+ Win.__init__(self)
+ self.text = text
+ self.critical = critical
+
+ def refresh(self):
+ log.debug('Refresh: %s', self.__class__.__name__)
+ self._win.erase()
+ if self.critical:
+ color = get_theme().COLOR_WARNING_PROMPT
+ else:
+ color = get_theme().COLOR_INFORMATION_BAR
+ c_color = to_curses_attr(color)
+ self.addstr(self.text, c_color)
+ self.finish_line(color)
+ self._refresh()
+