diff --git a/gertty/app.py b/gertty/app.py index 87aad46..9d77ed6 100644 --- a/gertty/app.py +++ b/gertty/app.py @@ -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', diff --git a/gertty/view/project_list.py b/gertty/view/project_list.py index 87dbceb..221bed7 100644 --- a/gertty/view/project_list.py +++ b/gertty/view/project_list.py @@ -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'