IF there are no tweets or favs, the timeline is not created

This commit is contained in:
Manuel Cortez 2015-08-21 09:12:54 -05:00
parent 57315c3b6e
commit 71fed7300b
2 changed files with 12 additions and 0 deletions

View File

@ -715,6 +715,9 @@ class Controller(object):
answer = commonMessageDialogs.protected_user() answer = commonMessageDialogs.protected_user()
if answer == widgetUtils.NO: return if answer == widgetUtils.NO: return
if dlg.get_action() == "tweets": if dlg.get_action() == "tweets":
if usr["statuses_count"] == 0:
commonMessageDialogs.no_tweets()
return
if dlg.get_user() in buff.session.settings["other_buffers"]["timelines"]: if dlg.get_user() in buff.session.settings["other_buffers"]["timelines"]:
commonMessageDialogs.timeline_exist() commonMessageDialogs.timeline_exist()
return return
@ -728,6 +731,9 @@ class Controller(object):
pub.sendMessage("restart-streams", streams=["timelinesStream"], session=buff.session) pub.sendMessage("restart-streams", streams=["timelinesStream"], session=buff.session)
buffer.session.sound.play("create_timeline.ogg") buffer.session.sound.play("create_timeline.ogg")
else: else:
if usr["favourites_count"] == 0:
commonMessageDialogs.no_favs()
return
if dlg.get_user() in buffer.session.settings["other_buffers"]["favourites_timelines"]: if dlg.get_user() in buffer.session.settings["other_buffers"]["favourites_timelines"]:
commonMessageDialogs.timeline_exist() commonMessageDialogs.timeline_exist()
return return

View File

@ -52,3 +52,9 @@ def no_following():
def donation(): def donation():
dlg = wx.MessageDialog(None, _(u"If you like {0} we need your help to keep it going. Help us by donating to the project. This will help us pay for the server, the domain and some other things to ensure that {0} will be actively maintained. Your donation will give us the means to continue the development of {0}, and to keep {0} free. Would you like to donate now?").format(application.name), _(u"We need your help"), wx.ICON_QUESTION|wx.YES_NO) dlg = wx.MessageDialog(None, _(u"If you like {0} we need your help to keep it going. Help us by donating to the project. This will help us pay for the server, the domain and some other things to ensure that {0} will be actively maintained. Your donation will give us the means to continue the development of {0}, and to keep {0} free. Would you like to donate now?").format(application.name), _(u"We need your help"), wx.ICON_QUESTION|wx.YES_NO)
return dlg.ShowModal() return dlg.ShowModal()
def no_tweets():
return wx.MessageDialog(None, _(u"This user has no tweets. {0} can't create a timeline.").format(application.name), _(u"Error"), wx.ICON_ERROR).ShowModal()
def no_favs():
return wx.MessageDialog(None, _(u"This user has no favorited tweets. {0} can't create a timeline.").format(application.name), _(u"Error"), wx.ICON_ERROR).ShowModal()