ui fixes for video

This commit is contained in:
ingvar1995 2017-06-15 00:25:16 +03:00
parent 8bc4613407
commit 0a378c1682
2 changed files with 4 additions and 2 deletions

View file

@ -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):

View file

@ -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():