Fix keypress handling on board view
Change-Id: Ic91bb91871091436e41802cd0a9e606cd8b90969
This commit is contained in:
parent
1da12089a5
commit
47cf3f610d
|
@ -37,7 +37,7 @@ class BoardView(urwid.WidgetWrap, mywid.Searchable):
|
||||||
def getCommands(self):
|
def getCommands(self):
|
||||||
return [
|
return [
|
||||||
(keymap.REFRESH,
|
(keymap.REFRESH,
|
||||||
"Sync subscribed boards"),
|
"Sync current board"),
|
||||||
(keymap.INTERACTIVE_SEARCH,
|
(keymap.INTERACTIVE_SEARCH,
|
||||||
"Interactive search"),
|
"Interactive search"),
|
||||||
]
|
]
|
||||||
|
@ -117,6 +117,21 @@ class BoardView(urwid.WidgetWrap, mywid.Searchable):
|
||||||
self.log.debug("Open story %s", story_key)
|
self.log.debug("Open story %s", story_key)
|
||||||
self.app.openStory(story_key)
|
self.app.openStory(story_key)
|
||||||
|
|
||||||
|
def keypress(self, size, key):
|
||||||
|
if self.searchKeypress(size, key):
|
||||||
|
return None
|
||||||
|
|
||||||
|
if not self.app.input_buffer:
|
||||||
|
key = super(BoardView, self).keypress(size, key)
|
||||||
|
keys = self.app.input_buffer + [key]
|
||||||
|
commands = self.app.config.keymap.getCommands(keys)
|
||||||
|
ret = self.handleCommands(commands)
|
||||||
|
if ret is True:
|
||||||
|
if keymap.FURTHER_INPUT not in commands:
|
||||||
|
self.app.clearInputBuffer()
|
||||||
|
return None
|
||||||
|
return key
|
||||||
|
|
||||||
def handleCommands(self, commands):
|
def handleCommands(self, commands):
|
||||||
if keymap.REFRESH in commands:
|
if keymap.REFRESH in commands:
|
||||||
self.app.sync.submitTask(
|
self.app.sync.submitTask(
|
||||||
|
|
Loading…
Reference in New Issue