From 298dba4d6c2ae53b4054844cc03d4363808c6a7a Mon Sep 17 00:00:00 2001 From: ingvar1995 Date: Tue, 7 Jun 2016 22:43:25 +0300 Subject: [PATCH] video call button --- src/images/videocall.png | Bin 0 -> 3625 bytes src/list_items.py | 2 +- src/mainscreen.py | 22 ++++++++++++++-------- src/profile.py | 1 - 4 files changed, 15 insertions(+), 10 deletions(-) create mode 100755 src/images/videocall.png diff --git a/src/images/videocall.png b/src/images/videocall.png new file mode 100755 index 0000000000000000000000000000000000000000..ef9fa86820f09d1bab5143d35797efa79f5b4ba9 GIT binary patch literal 3625 zcmY+HWmME%*T(phHME40Y4p zp`a3iQZK%1J?mM|hkgClUi*AG*L6Oe9eqzh1$9lRuJ$m8@0Dg1X#u&8m zE}i1((lJ6ODmYok-H4W$-3ak2m?nWo07?SUj)LaR(i*nkQCBBm?#qn=$HoS~rZp5I zk0G5Q+JL@~4b6{=88}}J$ak4)KHVC=s-ITcEFOPF-i?^RshOJ?#HMDW}*O%lTMc$Fe40zYMDBrfa*^`8y-Sd3lNh7qJ~l7`~X1! zVAIFR=?8>m05lqhrtqJFm5^cdA;W#ci^$<&9VGklxQxP^kycWG6jkN78+e{Ua zj%OK+;vte$D@Q{BkefhzbK9d!KRjh69xol+Kxr+!*GhQJVQ05~wK-CTRRMri@1U_O zAy^$#umWMQ>(zVi0|MuVWVt@4ubgVBRO*4;-8s`E>|bxx^Wt%{vzr?mGumAUOWOg{ zz$;9Lb(`tslixw`i_?>pFKb*O;txVJ3C>nJhK_X$SVj^_!t55d;xsQlkzHS~PH=Q- z+2PCtXx0s>Jz~`|UmuAVa6}^#`MbHtuN~Hwh0eiB%Thq~V2U=~js{_>XyzKG#!RskE>zbdSfZHCSfNmxpe z4wKK6idd>Yw!}H@e9a*w1gd?+cWt3_Q6Re*GtO9I`i$^1Xgi94`V|*@e-w=&hfabN zO3Ww*&2EBXJyi6(B^PO>(U_pn2Z+DCh-lUnOAe_uRQ#8`9*HZKVG7fDPd4h{EtVNa z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+5{lh&lz_qY})ZFPch&d@ak5*i6^32zmR*O;q z`a9zaMrhLKNluagfkLS{xYQ6~VgCu@f0~YR%#4D;JhMeOB&l4eD@*!T-Yji}e?#I-2nEX~D zs9O!aEcE8of`+yb^q28k9X0iG0=wgAC3r{Qf7ED2;m1U^D>HTg-Iu$ilq@OAly@n% zk{BKDcH=rs__&6ub;UIA1N?%@yJhOazy|W!sif*sorNt@afP{BaP9Eo9Rv6&*jo4> zHZolNH@uU1)ekbQ)W&4Pi#cPM-A+?r%nzTtJN)@R7QZ5)7bCeM1a!$Z+Hl|-kkc!x zp&T@sy&!I^94x5n^h?2dchcWRg5){fBuHtM-d2lO)`=*Hdou2fRwJ^<_e58NHqJ`n j4e9?r<-hiFBrAgfkzQX46e{EI?gwb8>#J2FY+n8!M%azJ literal 0 HcmV?d00001 diff --git a/src/list_items.py b/src/list_items.py index 7f9ef8c..d3e856b 100644 --- a/src/list_items.py +++ b/src/list_items.py @@ -70,7 +70,7 @@ class MessageEdit(QtGui.QTextBrowser): arr = text.split('\n') for i in range(len(arr)): if arr[i].startswith('>'): - arr[i] = '' + arr[i] + '' + arr[i] = '' + arr[i][4:] + '' self.setHtml('
'.join(arr)) diff --git a/src/mainscreen.py b/src/mainscreen.py index 70bcdfc..058160d 100644 --- a/src/mainscreen.py +++ b/src/mainscreen.py @@ -286,7 +286,11 @@ class MainWindow(QtGui.QMainWindow): self.callButton = QtGui.QPushButton(Form) self.callButton.setGeometry(QtCore.QRect(550, 30, 50, 50)) self.callButton.setObjectName("callButton") - self.callButton.clicked.connect(self.call) + self.callButton.clicked.connect(lambda: self.profile.call_click(True)) + self.videocallButton = QtGui.QPushButton(Form) + self.videocallButton.setGeometry(QtCore.QRect(550, 30, 50, 50)) + self.videocallButton.setObjectName("videocallButton") + self.videocallButton.clicked.connect(lambda: self.profile.call_click(True, True)) self.update_call_state('call') self.typing = QtGui.QLabel(Form) self.typing.setGeometry(QtCore.QRect(500, 40, 50, 30)) @@ -372,15 +376,16 @@ class MainWindow(QtGui.QMainWindow): def resizeEvent(self, *args, **kwargs): self.messages.setGeometry(0, 0, self.width() - 300, self.height() - 172) self.friends_list.setGeometry(0, 0, 270, self.height() - 140) - self.callButton.setGeometry(QtCore.QRect(self.width() - 370, 20, 50, 50)) - self.typing.setGeometry(QtCore.QRect(self.width() - 420, 30, 50, 30)) + self.videocallButton.setGeometry(QtCore.QRect(self.width() - 350, 20, 50, 50)) + self.callButton.setGeometry(QtCore.QRect(self.width() - 410, 20, 50, 50)) + self.typing.setGeometry(QtCore.QRect(self.width() - 470, 30, 50, 30)) self.messageEdit.setGeometry(QtCore.QRect(120, 2, self.width() - 490, 55)) self.screenshotButton.setGeometry(QtCore.QRect(0, 2, 55, 55)) self.fileTransferButton.setGeometry(QtCore.QRect(60, 2, 55, 55)) self.sendMessageButton.setGeometry(QtCore.QRect(self.width() - 360, 2, 60, 55)) - self.account_name.setGeometry(QtCore.QRect(100, 30, self.width() - 520, 25)) + self.account_name.setGeometry(QtCore.QRect(100, 30, self.width() - 600, 25)) self.account_status.setGeometry(QtCore.QRect(100, 50, self.width() - 520, 25)) self.messageEdit.setFocus() self.profile.update() @@ -458,10 +463,6 @@ class MainWindow(QtGui.QMainWindow): if hide: self.hide() - def call(self): - if self.profile.is_active_online(): # active friend exists and online - self.profile.call_click(True) - def active_call(self): self.update_call_state('finish_call') @@ -472,10 +473,15 @@ class MainWindow(QtGui.QMainWindow): self.update_call_state('call') def update_call_state(self, fl): + # TODO: do smth with video call button pixmap = QtGui.QPixmap(curr_directory() + '/images/{}.png'.format(fl)) icon = QtGui.QIcon(pixmap) self.callButton.setIcon(icon) self.callButton.setIconSize(QtCore.QSize(50, 50)) + pixmap = QtGui.QPixmap(curr_directory() + '/images/videocall.png') + icon = QtGui.QIcon(pixmap) + self.videocallButton.setIcon(icon) + self.videocallButton.setIconSize(QtCore.QSize(35, 35)) # ----------------------------------------------------------------------------------------------------------------- # Functions which called when user open context menu in friends list diff --git a/src/profile.py b/src/profile.py index 6f11f87..61a7043 100644 --- a/src/profile.py +++ b/src/profile.py @@ -563,7 +563,6 @@ class Profile(Contact, Singleton): try: for message in messages: self.split_and_send(friend_number, message.get_data()[-1], message.get_data()[0].encode('utf-8')) - friend.mark_as_sent() except: pass