From 0a378c168215b5b43ed9342c79f379689a1a0d9d Mon Sep 17 00:00:00 2001 From: ingvar1995 Date: Thu, 15 Jun 2017 00:25:16 +0300 Subject: [PATCH] ui fixes for video --- toxygen/avwidgets.py | 3 +-- toxygen/profile.py | 3 +++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/toxygen/avwidgets.py b/toxygen/avwidgets.py index ff276c4..84f2174 100644 --- a/toxygen/avwidgets.py +++ b/toxygen/avwidgets.py @@ -7,7 +7,6 @@ import wave import settings from util import curr_directory -# TODO: widget for video # TODO: improve IncomingCallWidget @@ -56,7 +55,7 @@ class IncomingCallWidget(widgets.CenteredWidget): self.call_type.setText(text) pr = profile.Profile.get_instance() self.accept_audio.clicked.connect(lambda: pr.accept_call(friend_number, True, False) or self.stop()) - self.accept_video.clicked.connect(lambda: pr.accept_call(friend_number, True, True)) + self.accept_video.clicked.connect(lambda: pr.accept_call(friend_number, True, True) or self.stop()) self.decline.clicked.connect(lambda: pr.stop_call(friend_number, False) or self.stop()) class SoundPlay(QtCore.QThread): diff --git a/toxygen/profile.py b/toxygen/profile.py index dd123ed..b479cb1 100644 --- a/toxygen/profile.py +++ b/toxygen/profile.py @@ -14,6 +14,8 @@ import avwidgets import plugin_support import basecontact import items_factory +import cv2 +import threading class Profile(basecontact.BaseContact, Singleton): @@ -1255,6 +1257,7 @@ class Profile(basecontact.BaseContact, Singleton): if hasattr(self, '_call_widget'): self._call_widget[friend_number].close() del self._call_widget[friend_number] + threading.Timer(3.0, lambda: cv2.destroyWindow(str(friend_number))).start() friend = self.get_friend_by_number(friend_number) friend.append_message(InfoMessage(text, time.time())) if friend_number == self.get_active_number():