Fix welcome screen

Don't attempt to show the screen help.  Display the welcome screen
when there are no subscribed projects (rather than when the screen
is empty, since that can now happen if there are no projects with
pending reviews).

Change-Id: I4c4215d61a00c303ad7480ed6c49b7bab0d36463
This commit is contained in:
James E. Blair 2014-08-29 19:14:46 -07:00
parent e2ad48cdf2
commit 206a84d6e1
2 changed files with 8 additions and 7 deletions

View File

@ -124,8 +124,14 @@ class App(object):
self.status.update(title=screen.title)
self.loop = urwid.MainLoop(screen, palette=self.config.palette.getPalette(),
unhandled_input=self.unhandledInput)
if screen.isEmpty():
has_subscribed_projects = False
with self.db.getSession() as session:
if session.getProjects(subscribed=True):
has_subscribed_projects = True
if not has_subscribed_projects:
self.welcome()
self.sync_pipe = self.loop.watch_pipe(self.refresh)
self.loop.screen.tty_signal_keys(start='undefined', stop='undefined')
#self.loop.screen.set_terminal_properties(colors=88)
@ -230,7 +236,7 @@ class App(object):
self.popup(dialog, min_width=76, min_height=len(lines)+4)
def welcome(self):
text = WELCOME_TEXT + self.loop.widget.help()
text = WELCOME_TEXT
dialog = mywid.MessageDialog('Welcome', text)
lines = text.split('\n')
urwid.connect_signal(dialog, 'close',

View File

@ -95,11 +95,6 @@ class ProjectListView(urwid.WidgetWrap):
self._w.contents.append((self.listbox, ('weight', 1)))
self._w.set_focus(3)
def isEmpty(self):
if self.project_rows:
return False
return True
def refresh(self):
if self.subscribed:
self.title = u'Subscribed projects'