Favourites and tweets timelines are available from the menu bar

This commit is contained in:
Manuel Cortez 2015-03-17 11:20:04 -06:00
parent 8c85cc25a0
commit c7d007636e
2 changed files with 7 additions and 4 deletions

View File

@ -154,6 +154,8 @@ class Controller(object):
widgetUtils.connect_event(self.view, widgetUtils.MENU, self.user_details, menuitem=self.view.details)
widgetUtils.connect_event(self.view, widgetUtils.MENU, self.toggle_autoread, menuitem=self.view.autoread)
widgetUtils.connect_event(self.view, widgetUtils.MENU, self.toggle_buffer_mute, self.view.mute_buffer)
widgetUtils.connect_event(self.view, widgetUtils.MENU, self.open_timeline, self.view.timeline)
widgetUtils.connect_event(self.view, widgetUtils.MENU, self.open_favs_timeline, self.view.favs)
widgetUtils.connect_event(self.view.nb, widgetUtils.NOTEBOOK_PAGE_CHANGED, self.buffer_changed)
def set_systray_icon(self):
@ -605,7 +607,10 @@ class Controller(object):
non_tweet = buffer.get_formatted_message()
msg = messages.viewTweet(non_tweet, False)
def open_timeline(self, *args, **kwargs):
def open_favs_timeline(self, *args, **kwargs):
self.open_timeline(default="favourites")
def open_timeline(self, default="tweets", *args, **kwargs):
buff = self.get_best_buffer()
if not hasattr(buff, "get_right_tweet"): return
tweet = buff.get_right_tweet()
@ -613,7 +618,7 @@ class Controller(object):
users = utils.get_all_users(tweet, buff.session.db)
else:
users = [tweet["screen_name"]]
dlg = dialogs.userSelection.selectUserDialog(users=users)
dlg = dialogs.userSelection.selectUserDialog(users=users, default=default)
if dlg.get_response() == widgetUtils.OK:
buffer = self.get_best_buffer()
if utils.if_user_exists(buffer.session.twitter.twitter, dlg.get_user()) != None:

View File

@ -54,9 +54,7 @@ class mainFrame(wx.Frame):
self.viewLists.Enable(False)
self.details = user.Append(wx.NewId(), _(u"Show user &profile"))
self.timeline = user.Append(wx.NewId(), _(u"&Timeline"))
self.timeline.Enable(False)
self.favs = user.Append(wx.NewId(), _(u"V&iew favourites"))
self.favs.Enable(False)
# buffer menu
buffer = wx.Menu()