Add refresh command

Let ctrl-r run a sync all projects task in list views, and sync
the current change in the change view.

Change-Id: I65cfb755bd387b68fe2dbd1562f149adb4421ea1
This commit is contained in:
James E. Blair
2014-07-16 05:04:56 -07:00
parent cff0b0cc9a
commit 42419904a8
3 changed files with 25 additions and 5 deletions

View File

@@ -67,8 +67,9 @@ class ProjectListHeader(urwid.WidgetWrap):
class ProjectListView(urwid.WidgetWrap):
_help = """
<l> Toggle whether only subscribed projects or all projects are listed.
<s> Toggle the subscription flag for the currently selected project.
<l> Toggle whether only subscribed projects or all projects are listed.
<s> Toggle the subscription flag for the currently selected project.
<ctrl-r> Sync all projects.
"""
def help(self):
@@ -146,6 +147,11 @@ class ProjectListView(urwid.WidgetWrap):
if subscribed:
self.app.sync.submitTask(sync.SyncProjectTask(project_key))
return None
if key == 'ctrl r':
self.app.sync.submitTask(
sync.SyncSubscribedProjectsTask(sync.HIGH_PRIORITY))
self.app.status.update()
return None
return super(ProjectListView, self).keypress(size, key)