mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2024-11-22 11:18:08 -06:00
added an ask to exit toggle. Suggestion of masonasons
This commit is contained in:
parent
5964bd6b3d
commit
d2c89a1f91
@ -15,6 +15,7 @@ reverse_timelines = boolean(default=False)
|
||||
time_to_check_streams = integer(default=30)
|
||||
announce_stream_status = boolean(default=True)
|
||||
auto_connect_streams = boolean(default=True)
|
||||
ask_at_exit = boolean(default=True)
|
||||
|
||||
[sound]
|
||||
volume = float(default=1.0)
|
||||
|
@ -50,6 +50,9 @@ class general(wx.Panel):
|
||||
langBox.Add(language, 0, wx.ALL, 5)
|
||||
langBox.Add(self.language, 0, wx.ALL, 5)
|
||||
sizer.Add(langBox, 0, wx.ALL, 5)
|
||||
self.ask_at_exit = wx.CheckBox(self, -1, _(U"Ask to exit TWBlue"))
|
||||
self.ask_at_exit.SetValue(config.main["general"]["ask_at_exit"])
|
||||
sizer.Add(self.ask_at_exit, 0, wx.ALL, 5)
|
||||
self.relative_time = wx.CheckBox(self, -1, _(U"Relative times"))
|
||||
self.relative_time.SetValue(config.main["general"]["relative_times"])
|
||||
sizer.Add(self.relative_time, 0, wx.ALL, 5)
|
||||
@ -372,6 +375,7 @@ class configurationDialog(wx.Dialog):
|
||||
need_restart = True
|
||||
if platform.system() == "Windows":
|
||||
config.main["general"]["voice_enabled"] = self.general.disable_sapi5.GetValue()
|
||||
config.main["general"]["ask_at_exit"] = self.general.ask_at_exit.GetValue()
|
||||
config.main["general"]["hide_gui"] = self.general.show_gui.GetValue()
|
||||
config.main["general"]["max_api_calls"] = self.general.apiCalls.GetValue()
|
||||
config.main["general"]["max_tweets_per_call"] = self.general.itemsPerApiCall.GetValue()
|
||||
|
@ -579,13 +579,14 @@ class mainFrame(wx.Frame):
|
||||
self.nb.AdvanceSelection(forward)
|
||||
|
||||
def close(self, ev=None):
|
||||
# if ev == None or hasattr(ev, "GetLoggingOff") == False:
|
||||
if config.main["general"]["ask_at_exit"] == True:
|
||||
dlg = wx.MessageDialog(self, _(u"Do you really want to close TW Blue?"), _(u"Exit"), wx.YES_NO|wx.ICON_QUESTION)
|
||||
if dlg.ShowModal() == wx.ID_YES:
|
||||
self.exit()
|
||||
dlg.Destroy()
|
||||
# elif hasattr(ev, "GetLoggingOff") == True:
|
||||
# self.exit()
|
||||
else:
|
||||
output.speak(_(u"Exiting..."))
|
||||
self.exit()
|
||||
|
||||
def exit(self, event=None):
|
||||
config.main.write()
|
||||
|
Loading…
Reference in New Issue
Block a user