From ae47bea56712be78291c4d741bfd44bb544afd56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20Cort=C3=A9z?= Date: Tue, 12 Apr 2016 15:59:22 -0500 Subject: [PATCH] Added audio buffers creation --- src/controller/mainController.py | 10 ++++++++-- src/wxUI/commonMessages.py | 5 ++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/controller/mainController.py b/src/controller/mainController.py index b792c83..0afb3c2 100644 --- a/src/controller/mainController.py +++ b/src/controller/mainController.py @@ -205,8 +205,14 @@ class Controller(object): user = a.get_user() buffertype = a.get_buffer_type() user_id = "" - print user for i in d: if i[1] == user: user_id = i[0] - print user_id \ No newline at end of file + if user_id == None: + commonMessages.no_user_exist() + return + if buffertype == "audio": + audio = buffers.audioBuffer(parent=self.window.tb, name="{0}_audio".format(user_id,), composefunc="compose_audio", session=self.session, endpoint="get", parent_endpoint="audio", full_list=True, count=self.session.settings["buffers"]["count_for_audio_buffers"], user_id=user_id) + self.buffers.append(audio) + self.window.insert_buffer(audio.tab, _(u"{0}'s audios").format(user,), self.window.search("audios")) + call_threaded(audio.get_items) \ No newline at end of file diff --git a/src/wxUI/commonMessages.py b/src/wxUI/commonMessages.py index 4b509bd..8a4c79d 100644 --- a/src/wxUI/commonMessages.py +++ b/src/wxUI/commonMessages.py @@ -9,4 +9,7 @@ def no_update_available(): return wx.MessageDialog(None, _(u"Your {0} version is up to date").format(application.name,), _(u"Update"), style=wx.OK).ShowModal() def remove_buffer(): - return wx.MessageDialog(None, _(u"Do you really want to dismiss this buffer?"), _(u"Attention"), style=wx.ICON_QUESTION|wx.YES_NO).ShowModal() \ No newline at end of file + return wx.MessageDialog(None, _(u"Do you really want to dismiss this buffer?"), _(u"Attention"), style=wx.ICON_QUESTION|wx.YES_NO).ShowModal() + +def no_user_exist(): + wx.MessageDialog(None, _(u"This user does not exist"), _(u"Error"), style=wx.ICON_ERROR).ShowModal() \ No newline at end of file