Skip to content

Commit

Permalink
Add toggle for if errors are announced
Browse files Browse the repository at this point in the history
  • Loading branch information
masonasons committed Aug 23, 2021
1 parent cd8c93d commit 0742382
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
4 changes: 4 additions & 0 deletions GUI/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ def __init__(self, parent):
self.wrap=wx.CheckBox(self, -1, "Word wrap in text fields")
self.main_box.Add(self.wrap, 0, wx.ALL, 10)
self.wrap.SetValue(globals.prefs.wrap)
self.errors=wx.CheckBox(self, -1, "Play sound and speak message for errors")
self.main_box.Add(self.errors, 0, wx.ALL, 10)
self.errors.SetValue(globals.prefs.errors)
# self.move_amount_label = wx.StaticText(self, -1, "Number of tweets to move when using control+windows+page up/down")
# self.move_amount = wx.TextCtrl(self, -1, "")
# self.main_box.Add(self.move_amount, 0, wx.ALL, 10)
Expand Down Expand Up @@ -180,6 +183,7 @@ def OnOK(self, event):
refresh=True
globals.prefs.demojify=self.general.demojify.GetValue()
globals.prefs.demojify_tweet=self.general.demojify_tweet.GetValue()
globals.prefs.errors=self.general.errors.GetValue()
globals.prefs.tweetTemplate=self.templates.tweetTemplate.GetValue()
globals.prefs.quoteTemplate=self.templates.quoteTemplate.GetValue()
globals.prefs.retweetTemplate=self.templates.retweetTemplate.GetValue()
Expand Down
1 change: 1 addition & 0 deletions docs/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
0.66
Don't load multiple conversations at once.
Checkbox in general tab for speaking errors.

0.65
Actually fixed the options dialog, maybe sort of I don't know.
Expand Down
1 change: 1 addition & 0 deletions globals.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ def load():
prefs.quoteTemplate=prefs.get("quoteTemplate","Quoting $user.name$ ($user.screen_name$): $text$")
prefs.userTemplate=prefs.get("userTemplate","$name$ ($screen_name$): $followers_count$ followers, $friends_count$ friends, $statuses_count$ tweets. Bio: $description$")
prefs.accounts=prefs.get("accounts",1)
prefs.errors=prefs.get("errors",True)
prefs.streaming=prefs.get("streaming",False)
prefs.invisible=prefs.get("invisible",False)
prefs.invisible_sync=prefs.get("invisible_sync",True)
Expand Down
10 changes: 6 additions & 4 deletions utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -498,14 +498,16 @@ def handle_error(error,name="Unknown"):
if "429" in str(error):
globals.errors.append("Error in "+name+": "+error.response.text)
return
speak.speak("Error in "+name+": "+error.response.text)
if globals.prefs.errors==True:
speak.speak("Error in "+name+": "+error.response.text)
sound.play(globals.currentAccount,"error")
globals.errors.append("Error in "+name+": "+error.response.text)
sound.play(globals.currentAccount,"error")
else:
if error.reason!="" and error.reason!=None:
speak.speak("Error in "+name+": "+error.reason)
if globals.prefs.errors==True:
speak.speak("Error in "+name+": "+error.reason)
sound.play(globals.currentAccount,"error")
globals.errors.append("Error in "+name+": "+error.reason)
sound.play(globals.currentAccount,"error")

def get_account(id):
for i in globals.accounts:
Expand Down

0 comments on commit 0742382

Please sign in to comment.