Fix refresh on project and change lists
Make the help text more accurate for the refresh command on both the project and change lists. When the change list is for a specific project, cause the refresh command to sync only that project. Change-Id: If1ba361b948e2e54d4ffc7f348525b5c9a9770b6
This commit is contained in:
parent
890a0892ef
commit
ce1fccbccb
@ -154,6 +154,10 @@ class ChangeListHeader(urwid.WidgetWrap):
|
|||||||
class ChangeListView(urwid.WidgetWrap):
|
class ChangeListView(urwid.WidgetWrap):
|
||||||
def help(self):
|
def help(self):
|
||||||
key = self.app.config.keymap.formatKeys
|
key = self.app.config.keymap.formatKeys
|
||||||
|
if self.project_key:
|
||||||
|
refresh_help = "Sync current project"
|
||||||
|
else:
|
||||||
|
refresh_help = "Sync subscribed projects"
|
||||||
return [
|
return [
|
||||||
(key(keymap.TOGGLE_HELD),
|
(key(keymap.TOGGLE_HELD),
|
||||||
"Toggle the held flag for the currently selected change"),
|
"Toggle the held flag for the currently selected change"),
|
||||||
@ -168,7 +172,7 @@ class ChangeListView(urwid.WidgetWrap):
|
|||||||
(key(keymap.TOGGLE_STARRED),
|
(key(keymap.TOGGLE_STARRED),
|
||||||
"Toggle the starred flag for the currently selected change"),
|
"Toggle the starred flag for the currently selected change"),
|
||||||
(key(keymap.REFRESH),
|
(key(keymap.REFRESH),
|
||||||
"Sync all projects"),
|
refresh_help),
|
||||||
(key(keymap.SORT_BY_NUMBER),
|
(key(keymap.SORT_BY_NUMBER),
|
||||||
"Sort changes by number"),
|
"Sort changes by number"),
|
||||||
(key(keymap.SORT_BY_UPDATED),
|
(key(keymap.SORT_BY_UPDATED),
|
||||||
@ -455,8 +459,12 @@ class ChangeListView(urwid.WidgetWrap):
|
|||||||
row.update(change, self.categories)
|
row.update(change, self.categories)
|
||||||
return None
|
return None
|
||||||
if keymap.REFRESH in commands:
|
if keymap.REFRESH in commands:
|
||||||
self.app.sync.submitTask(
|
if self.project_key:
|
||||||
sync.SyncSubscribedProjectsTask(sync.HIGH_PRIORITY))
|
self.app.sync.submitTask(
|
||||||
|
sync.SyncProjectTask(self.project_key, sync.HIGH_PRIORITY))
|
||||||
|
else:
|
||||||
|
self.app.sync.submitTask(
|
||||||
|
sync.SyncSubscribedProjectsTask(sync.HIGH_PRIORITY))
|
||||||
self.app.status.update()
|
self.app.status.update()
|
||||||
return None
|
return None
|
||||||
if keymap.SORT_BY_NUMBER in commands:
|
if keymap.SORT_BY_NUMBER in commands:
|
||||||
|
@ -79,7 +79,7 @@ class ProjectListView(urwid.WidgetWrap):
|
|||||||
(key(keymap.TOGGLE_SUBSCRIBED),
|
(key(keymap.TOGGLE_SUBSCRIBED),
|
||||||
"Toggle the subscription flag for the currently selected project"),
|
"Toggle the subscription flag for the currently selected project"),
|
||||||
(key(keymap.REFRESH),
|
(key(keymap.REFRESH),
|
||||||
"Sync all projects")
|
"Sync subscribed projects")
|
||||||
]
|
]
|
||||||
|
|
||||||
def __init__(self, app):
|
def __init__(self, app):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user