mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2024-11-27 05:03:14 -06:00
Session manager deletes invalid sessions; plays audio from any URL when the tweet has more than one
This commit is contained in:
parent
18f7cb6c96
commit
9d64901791
@ -297,14 +297,21 @@ class basePanel(wx.Panel):
|
||||
ev.Skip()
|
||||
return
|
||||
if event == "audio" and len(urls) > 0:
|
||||
self.streamer(urls[0])
|
||||
if len(urls) == 1:
|
||||
self.streamer(urls[0])
|
||||
elif len(urls) > 1:
|
||||
urlList = gui.dialogs.urlList.urlList(urls)
|
||||
if urlList.ShowModal() == wx.ID_OK:
|
||||
self.streamer(urls[urlList.lista.GetSelection()])
|
||||
elif event == "url":
|
||||
if len(urls) == 0: return
|
||||
elif len(urls) == 1:
|
||||
output.speak(_(u"Opening URL..."), True)
|
||||
webbrowser.open(urls[0])
|
||||
elif len(urls) > 1:
|
||||
gui.dialogs.urlList.urlList(urls).ShowModal()
|
||||
urlList = gui.dialogs.urlList.urlList(urls)
|
||||
if urlList.ShowModal() == wx.ID_OK:
|
||||
webbrowser.open_new_tab(urls[urlList.lista.GetSelection()])
|
||||
elif event == "volume_down":
|
||||
if config.main["sound"]["volume"] > 0.05:
|
||||
config.main["sound"]["volume"] = config.main["sound"]["volume"]-0.05
|
||||
|
@ -46,8 +46,7 @@ class urlList(wx.Dialog):
|
||||
self.SetClientSize(sizer.CalcMin())
|
||||
|
||||
def onGo(self, ev):
|
||||
webbrowser.open(self.lista.GetStringSelection())
|
||||
self.Destroy()
|
||||
self.EndModal(wx.ID_OK)
|
||||
|
||||
def populate_list(self):
|
||||
for i in self.urls:
|
||||
|
@ -1,4 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import shutil
|
||||
import time
|
||||
import wx
|
||||
import manager
|
||||
@ -55,9 +56,12 @@ class sessionManagerWindow(wx.Dialog):
|
||||
strconfig = "%s/session.conf" % (paths.config_path(i))
|
||||
config_test = Configuration(strconfig)
|
||||
name = config_test["twitter"]["user_name"]
|
||||
if name != "" and config_test["twitter"]["user_key"] != "" and config_test["twitter"]["user_secret"] != "":
|
||||
if name != "" or (config_test["twitter"]["user_key"] != "" and config_test["twitter"]["user_secret"] != ""):
|
||||
self.list.insert_item(False, name)
|
||||
self.sessions.append(i)
|
||||
else:
|
||||
del config_test
|
||||
shutil.rmtree(path=paths.config_path(i), ignore_errors=True)
|
||||
if self.list.get_count() > 0:
|
||||
self.list.select_item(0)
|
||||
self.list.list.SetSize(self.list.list.GetBestSize())
|
||||
|
Loading…
Reference in New Issue
Block a user