Separate search and refine search commands
Being able to refine a search query is useful, but so is being able to quickly open a specific change from anywhere. Separate these commands. C-o opens a blank search input; M-o opens a search input pre-filled with th ecurrent query in list view. Change-Id: I49d0f076354322a2652de515d476548926a99182
This commit is contained in:
parent
da0178b2da
commit
b0f595b1c1
@ -515,11 +515,7 @@ class App(object):
|
|||||||
elif keymap.QUIT in commands:
|
elif keymap.QUIT in commands:
|
||||||
self.quit()
|
self.quit()
|
||||||
elif keymap.CHANGE_SEARCH in commands:
|
elif keymap.CHANGE_SEARCH in commands:
|
||||||
if hasattr(self.loop.widget, 'getQueryString'):
|
self.searchDialog('')
|
||||||
default = self.loop.widget.getQueryString()
|
|
||||||
else:
|
|
||||||
default = ''
|
|
||||||
self.searchDialog(default)
|
|
||||||
elif keymap.LIST_HELD in commands:
|
elif keymap.LIST_HELD in commands:
|
||||||
self.doSearch("is:held")
|
self.doSearch("is:held")
|
||||||
elif key in self.config.dashboards:
|
elif key in self.config.dashboards:
|
||||||
|
@ -35,6 +35,7 @@ TOP_SCREEN = 'top screen'
|
|||||||
HELP = 'help'
|
HELP = 'help'
|
||||||
QUIT = 'quit'
|
QUIT = 'quit'
|
||||||
CHANGE_SEARCH = 'change search'
|
CHANGE_SEARCH = 'change search'
|
||||||
|
REFINE_CHANGE_SEARCH = 'refine change search'
|
||||||
LIST_HELD = 'list held changes'
|
LIST_HELD = 'list held changes'
|
||||||
# Change screen:
|
# Change screen:
|
||||||
TOGGLE_REVIEWED = 'toggle reviewed'
|
TOGGLE_REVIEWED = 'toggle reviewed'
|
||||||
@ -87,6 +88,7 @@ DEFAULT_KEYMAP = {
|
|||||||
HELP: ['f1', '?'],
|
HELP: ['f1', '?'],
|
||||||
QUIT: 'ctrl q',
|
QUIT: 'ctrl q',
|
||||||
CHANGE_SEARCH: 'ctrl o',
|
CHANGE_SEARCH: 'ctrl o',
|
||||||
|
REFINE_CHANGE_SEARCH: 'meta o',
|
||||||
LIST_HELD: 'f12',
|
LIST_HELD: 'f12',
|
||||||
|
|
||||||
TOGGLE_REVIEWED: 'v',
|
TOGGLE_REVIEWED: 'v',
|
||||||
|
@ -178,6 +178,8 @@ class ChangeListView(urwid.WidgetWrap):
|
|||||||
"Toggle the starred flag for the currently selected change"),
|
"Toggle the starred flag for the currently selected change"),
|
||||||
(key(keymap.TOGGLE_MARK),
|
(key(keymap.TOGGLE_MARK),
|
||||||
"Toggle the process mark for the currently selected change"),
|
"Toggle the process mark for the currently selected change"),
|
||||||
|
(key(keymap.REFINE_CHANGE_SEARCH),
|
||||||
|
"Refine the current search query"),
|
||||||
(key(keymap.EDIT_TOPIC),
|
(key(keymap.EDIT_TOPIC),
|
||||||
"Set the topic of the marked changes"),
|
"Set the topic of the marked changes"),
|
||||||
(key(keymap.REFRESH),
|
(key(keymap.REFRESH),
|
||||||
@ -559,6 +561,10 @@ class ChangeListView(urwid.WidgetWrap):
|
|||||||
row = self.listbox.body[pos]
|
row = self.listbox.body[pos]
|
||||||
self.app.localCherryPickCommit(row.project_name, row.commit_sha)
|
self.app.localCherryPickCommit(row.project_name, row.commit_sha)
|
||||||
return None
|
return None
|
||||||
|
if keymap.REFINE_CHANGE_SEARCH in commands:
|
||||||
|
default = self.getQueryString()
|
||||||
|
self.app.searchDialog(default)
|
||||||
|
return None
|
||||||
return key
|
return key
|
||||||
|
|
||||||
def onSelect(self, button, change_key):
|
def onSelect(self, button, change_key):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user