mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2025-07-18 14:06:07 -04:00
Next-gen: Audio uploader is now MVC, so tweets can include audios. Sounds tutorial is MVC and has been improved.
This commit is contained in:
@@ -1 +1 @@
|
||||
import gui
|
||||
from soundsTutorial import *
|
@@ -1,59 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import wx
|
||||
import config
|
||||
import os
|
||||
import paths
|
||||
import sound
|
||||
|
||||
class soundsTutorial(wx.Dialog):
|
||||
def __init__(self):
|
||||
self.actions = [
|
||||
_(u"The tweet may contain a playable audio"),
|
||||
_(u"A timeline has been created"),
|
||||
_(u"A timeline has been deleted"),
|
||||
_(u"You've received a direct message"),
|
||||
_(u"You've sent a direct message"),
|
||||
_(u"A bug has happened"),
|
||||
_(u"You've added a tweet to your favourites"),
|
||||
_(u"Someone's favourites have been updated"),
|
||||
_(u"There are no more tweets to read"),
|
||||
_(u"A list has a new tweet"),
|
||||
_(u"You can't add any more characters on the tweet"),
|
||||
_(u"You've been mentioned "),
|
||||
_(u"A new event has happened"),
|
||||
_(u"TW Blue is ready "),
|
||||
_(u"You've replied"),
|
||||
_(u"You've retweeted"),
|
||||
_(u"A search has been updated"),
|
||||
_(u"There's a new tweet in the main buffer"),
|
||||
_(u"You've sent a tweet"),
|
||||
_(u"There's a new tweet in a timeline"),
|
||||
_(u"You have a new follower"),
|
||||
_(u"You've turned the volume up or down")]
|
||||
self.files = os.listdir(paths.sound_path("default"))
|
||||
super(soundsTutorial, self).__init__(None, -1)
|
||||
if len(self.actions) > len(self.files):
|
||||
wx.MessageDialog(None, _(u"It seems as though the currently used sound pack needs an update. %i fails are still be required to use this function. Make sure to obtain the needed lacking sounds or to contact with the sound pack developer.") % (len(self.actions) - len(self.files)), _(u"Error"), wx.ICON_ERROR).ShowModal()
|
||||
self.Destroy()
|
||||
self.SetTitle(_(u"Sounds tutorial"))
|
||||
panel = wx.Panel(self)
|
||||
sizer = wx.BoxSizer(wx.VERTICAL)
|
||||
label = wx.StaticText(panel, -1, _(u"Press enter to listen to the sound for the selected event"))
|
||||
self.items = wx.ListBox(panel, 1, choices=self.actions, style=wx.LB_SINGLE)
|
||||
self.items.SetSelection(0)
|
||||
listBox = wx.BoxSizer(wx.HORIZONTAL)
|
||||
listBox.Add(label)
|
||||
listBox.Add(self.items)
|
||||
play = wx.Button(panel, 1, (u"Play"))
|
||||
play.SetDefault()
|
||||
self.Bind(wx.EVT_BUTTON, self.onPlay, play)
|
||||
close = wx.Button(panel, wx.ID_CANCEL)
|
||||
btnBox = wx.BoxSizer(wx.HORIZONTAL)
|
||||
btnBox.Add(play)
|
||||
btnBox.Add(close)
|
||||
sizer.Add(listBox)
|
||||
sizer.Add(btnBox)
|
||||
panel.SetSizer(sizer)
|
||||
|
||||
def onPlay(self, ev):
|
||||
sound.player.play(self.files[self.items.GetSelection()])
|
22
src/extra/SoundsTutorial/soundsTutorial.py
Normal file
22
src/extra/SoundsTutorial/soundsTutorial.py
Normal file
@@ -0,0 +1,22 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import widgetUtils
|
||||
import config
|
||||
import os
|
||||
import paths
|
||||
import sound
|
||||
import wx_ui
|
||||
import soundsTutorial_constants
|
||||
|
||||
class soundsTutorial(object):
|
||||
def __init__(self):
|
||||
super(soundsTutorial, self).__init__()
|
||||
self.actions = []
|
||||
[self.actions.append(i[1]) for i in soundsTutorial_constants.actions]
|
||||
self.files = []
|
||||
[self.files.append(i[0]) for i in soundsTutorial_constants.actions]
|
||||
self.dialog = wx_ui.soundsTutorialDialog(self.actions)
|
||||
widgetUtils.connect_event(self.dialog.play, widgetUtils.BUTTON_PRESSED, self.on_play)
|
||||
self.dialog.get_response()
|
||||
|
||||
def on_play(self, *args, **kwargs):
|
||||
sound.player.play(self.files[self.dialog.items.GetSelection()]+".ogg")
|
23
src/extra/SoundsTutorial/soundsTutorial_constants.py
Normal file
23
src/extra/SoundsTutorial/soundsTutorial_constants.py
Normal file
@@ -0,0 +1,23 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
actions = [ ("audio", _(u"The tweet may contain a playable audio")),
|
||||
("create_timeline", _(u"A timeline has been created")),
|
||||
("delete_timeline", _(u"A timeline has been deleted")),
|
||||
("dm_received", _(u"You've received a direct message")),
|
||||
("dm_sent", _(u"You've sent a direct message")),
|
||||
("error", _(u"A bug has happened")),
|
||||
("favourite", _(u"You've added a tweet to your favourites")),
|
||||
("favourites_timeline_updated", _(u"Someone's favourites have been updated")),
|
||||
("limit", _(u"There are no more tweets to read")),
|
||||
("list_tweet", _(u"A list has a new tweet")),
|
||||
("max_length", _(u"You can't add any more characters on the tweet")),
|
||||
("mention_received", _(u"You've been mentioned ")),
|
||||
("new_event", _(u"A new event has happened")),
|
||||
("ready", _(u"TW Blue is ready ")),
|
||||
("reply_send", _(u"You've replied")),
|
||||
("retweet_send", _(u"You've retweeted")),
|
||||
("search_updated", _(u"A search has been updated")),
|
||||
("tweet_received", _(u"There's a new tweet in the main buffer")),
|
||||
("tweet_send", _(u"You've sent a tweet")),
|
||||
("tweet_timeline", _(u"There's a new tweet in a timeline")),
|
||||
("update_followers", _(u"You have a new follower")),
|
||||
("volume_changed", _(u"You've turned the volume up or down"))]
|
25
src/extra/SoundsTutorial/wx_ui.py
Normal file
25
src/extra/SoundsTutorial/wx_ui.py
Normal file
@@ -0,0 +1,25 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import wx
|
||||
import widgetUtils
|
||||
|
||||
class soundsTutorialDialog(widgetUtils.BaseDialog):
|
||||
def __init__(self, actions):
|
||||
super(soundsTutorialDialog, self).__init__(None, -1)
|
||||
self.SetTitle(_(u"Sounds tutorial"))
|
||||
panel = wx.Panel(self)
|
||||
sizer = wx.BoxSizer(wx.VERTICAL)
|
||||
label = wx.StaticText(panel, -1, _(u"Press enter to listen to the sound for the selected event"))
|
||||
self.items = wx.ListBox(panel, 1, choices=actions, style=wx.LB_SINGLE)
|
||||
self.items.SetSelection(0)
|
||||
listBox = wx.BoxSizer(wx.HORIZONTAL)
|
||||
listBox.Add(label)
|
||||
listBox.Add(self.items)
|
||||
self.play = wx.Button(panel, 1, (u"Play"))
|
||||
self.play.SetDefault()
|
||||
close = wx.Button(panel, wx.ID_CANCEL)
|
||||
btnBox = wx.BoxSizer(wx.HORIZONTAL)
|
||||
btnBox.Add(self.play)
|
||||
btnBox.Add(close)
|
||||
sizer.Add(listBox)
|
||||
sizer.Add(btnBox)
|
||||
panel.SetSizer(sizer)
|
Reference in New Issue
Block a user