From 96705ed1cc8c841bd2ffbe159cde3a47a33b1c5f Mon Sep 17 00:00:00 2001 From: ingvar1995 Date: Thu, 16 Jun 2016 11:59:30 +0300 Subject: [PATCH] ui: statuses --- src/contact.py | 4 +-- src/friend.py | 8 ++--- src/images/busy.png | Bin 0 -> 329 bytes src/images/busy_notification.png | Bin 0 -> 609 bytes src/images/idle.png | Bin 0 -> 231 bytes src/images/idle_notification.png | Bin 0 -> 405 bytes src/images/offline.png | Bin 0 -> 159 bytes src/images/offline_notification.png | Bin 0 -> 445 bytes src/images/online.png | Bin 0 -> 201 bytes src/images/online_notification.png | Bin 0 -> 351 bytes src/list_items.py | 53 ++++++++++++---------------- src/mainscreen.py | 5 +-- 12 files changed, 30 insertions(+), 40 deletions(-) create mode 100644 src/images/busy.png create mode 100644 src/images/busy_notification.png create mode 100644 src/images/idle.png create mode 100644 src/images/idle_notification.png create mode 100644 src/images/offline.png create mode 100644 src/images/offline_notification.png create mode 100644 src/images/online.png create mode 100644 src/images/online_notification.png diff --git a/src/contact.py b/src/contact.py index c957113..0691219 100644 --- a/src/contact.py +++ b/src/contact.py @@ -64,8 +64,8 @@ class Contact(object): return self._status def set_status(self, value): - self._widget.connection_status.data = self._status = value - self._widget.connection_status.repaint() + self._status = value + self._widget.connection_status.update(value) status = property(get_status, set_status) diff --git a/src/friend.py b/src/friend.py index 585a2bd..52e9ac7 100644 --- a/src/friend.py +++ b/src/friend.py @@ -188,12 +188,12 @@ class Friend(contact.Contact): return self._new_messages def inc_messages(self): - self._widget.connection_status.messages = self._new_messages + 1 - self._widget.connection_status.repaint() + self._new_messages += 1 + self._widget.connection_status.update(self.status, True) def reset_messages(self): - self._widget.connection_status.messages = self._new_messages = 0 - self._widget.connection_status.repaint() + self._new_messages = 0 + self._widget.connection_status.update(self.status, False) messages = property(get_messages) diff --git a/src/images/busy.png b/src/images/busy.png new file mode 100644 index 0000000000000000000000000000000000000000..857b3967e78e2ede8726580bce500f0ab163251e GIT binary patch literal 329 zcmeAS@N?(olHy`uVBq!ia0vp^AT}2V8<6ZZI=>f4u@pObhHwBu4M$1`kk47*5m^jW ze;tGwoit`w00kvWTq8Eak7 zF}3%Ctshe$gX_cM`He?pcd#y>opp$9L$kYcdhTnz1#_m&%9|BFVZxc)4L+{Ry)Vd4 z$oLSY(W>(2&aczDeL2h*eAS%yRZfdxx^YWr#p)?W4h%1n=A7Ij)S8$Y;VEL2EB=_r zVYWoOk?w{&->dzbm)&ICm7?S=kyC6 zSddwEEV5{2o=qM5UD?I|Kf7<(YTIAO&BF9m)nfr)sMpPkx=+04S5Mirj`tsP<&wlQ U(b!AOKp!!9y85}Sb4q9e0P<;mxBvhE literal 0 HcmV?d00001 diff --git a/src/images/busy_notification.png b/src/images/busy_notification.png new file mode 100644 index 0000000000000000000000000000000000000000..a01eb3ff6fc36c848de4332e792e40cb5342655f GIT binary patch literal 609 zcmV-n0-pVeP)v76M*zdy7i&K7cWsQ<1c3QV3~M2bA5hxQ#3U38Jr@|I9qz{NIyp z%C!@Q(}60tgsVWcfJa87+}TzmNe;?<{Wg%a7q;#huK^WcU*-#d#T+mLWJ2BfBz{gI z92-bV!|*NW8m31@cWeFrak*0(MN?$nM6|*0Ye{kg+p^7GGrDj56zfhc>A&1ni~p^*A1;Vbno>A@pE=(0`_nOH0!g1>Z35YDs)^x7l11dI%gE4*`T0fXl|~ z^}(QzVT_`V_Vv3qK;zCEHhJJ^-(?$%&OluXh5l({5j^{P_6_xNWg0=`*>% z8$Ah%wD)WM{xLbLz+qVo(CGC}vdM`R;EaLCdR|lTnbI~ z!darwa@uSypT&zez(-{)07k_>kJCPf4NtU=qlmzFem6RtIr7}3ChyGR45_%4l+w_&`S)C@h7daeZiiMohL0`^^Ag_dc+adH za&*NjQz--Pm zn_Wr*4PCMfD;a10nBT~8faNQL;)g~~DVCN4E?*uTWIM3%AWP{M#R*w1#mCrJNLZX; cVB%q5n`Zo^>5tPapraT(UHx3vIVCg!0H8Nc^#A|> literal 0 HcmV?d00001 diff --git a/src/images/idle_notification.png b/src/images/idle_notification.png new file mode 100644 index 0000000000000000000000000000000000000000..29f3b492949410baedb350888010d5cd90fc797b GIT binary patch literal 405 zcmV;G0c!qIX8f2?p zUk71ECym(^Ktah8*NBqf{Irtt#G+J&^73-M%)IR41T^vI! wdXxYB|8LK%+R&+VcQIR!ltI=31tSKA2?p zUk71ECym(^Ktah8*NBqf{Irtt#G+J&^73-M%)IR4JY5_^ zEPB^Y_Vr?R6mYwLy|yJr@wUPVi4&54Bs`t!5ETBRJNtd;#jCMK#$uHxKku6Sp5t_bj%;|_s+mU}wOd{$#l^F#^nPwm zK75XW-zQ}c(~KJ|QVt@o@>?&edd?A_5c2FNbB6R|zV&g%7B%s2Ld0BqGr~K}ZUh^* z#GdgKS{}p{ix2j;*#}x*CMU- z6--j8fmgz&25(DTQDofBtRVC@>*=@8IddXqc7$;RFSJ_}`^@$G^>>vQUAMIUS}U;Z l|L3WV_Ij6@Ua$MizIF4iL&rY+IR*@B22WQ%mvv4FO#ns3vf}^% literal 0 HcmV?d00001 diff --git a/src/images/online.png b/src/images/online.png new file mode 100644 index 0000000000000000000000000000000000000000..1e5f40af916a22aa6ab0cc917757f4e0d4124d96 GIT binary patch literal 201 zcmeAS@N?(olHy`uVBq!ia0vp^AT}2V8<6ZZI=>f4NtU=qlmzFem6RtIr7}3C2~BK_iUt#3 vJYd`{D6yc;VU^%nN%;jyeG3@aISd#!%gB6Ka5wiT&{_shS3j3^P6f%+0& zE7R#1#5Eob;M3Iu1K&N%zlG3q6d<`{pkzvPfR*6J%0xJjm=(_(k}Eh91ZO}>pCX}@ z%s>vrB2)U=(YQs5ziF3CNzi+ZZ&EoFZs z-gk{VD&x*m=CPsgCcEl48+0<)$~=5S#uY|^MVeUiAcu0s=BSA=796`+sW(y2eq1C@ x#9pMrSR|QT@M)Eg9P8{VFY`0~^E