From 6802e1f86b4a36d02c7ca4d9b455f585f25004ae Mon Sep 17 00:00:00 2001 From: Inso <insomniak.fr@gmail.com> Date: Sat, 23 Jan 2016 21:37:15 +0100 Subject: [PATCH] New icons for identities --- res/icons/AUTHORS | 5 ++- res/icons/icons.qrc | 3 ++ res/icons/noun_213188_cc.svg | 61 ++++++++++++++++++++++++++++++++++ res/icons/noun_213192_cc.svg | 61 ++++++++++++++++++++++++++++++++++ res/icons/noun_213886_cc.svg | 61 ++++++++++++++++++++++++++++++++++ src/sakia/models/identities.py | 10 +++++- 6 files changed, 199 insertions(+), 2 deletions(-) create mode 100644 res/icons/noun_213188_cc.svg create mode 100644 res/icons/noun_213192_cc.svg create mode 100644 res/icons/noun_213886_cc.svg diff --git a/res/icons/AUTHORS b/res/icons/AUTHORS index 23af4ae9..816e2484 100644 --- a/res/icons/AUTHORS +++ b/res/icons/AUTHORS @@ -25,4 +25,7 @@ noun_155533_cc.svg : by anbileru adaleru noun_155520_cc.svg : by anbileru adaleru noun_155540_cc.svg : by anbileru adaleru noun_100552_cc.svg : by Rui -noun_178537_cc.svg : by Nathan David Smith \ No newline at end of file +noun_178537_cc.svg : by Nathan David Smith +noun_213188_cc.svg : by Aha-Soft +noun_213886_cc.svg : by Aha-Soft +noun_213196_cc.svg : by Aha-Soft \ No newline at end of file diff --git a/res/icons/icons.qrc b/res/icons/icons.qrc index 1e3016df..7caf9fdf 100644 --- a/res/icons/icons.qrc +++ b/res/icons/icons.qrc @@ -32,5 +32,8 @@ <file alias="connected">connected.svg</file> <file alias="weak_connect">weak_connect.svg</file> <file alias="disconnected">disconnected.svg</file> + <file alias="member">noun_213188_cc.svg</file> + <file alias="not_member">noun_213192_cc.svg</file> + <file alias="member_warning">noun_213886_cc.svg</file> </qresource> </RCC> diff --git a/res/icons/noun_213188_cc.svg b/res/icons/noun_213188_cc.svg new file mode 100644 index 00000000..53c003da --- /dev/null +++ b/res/icons/noun_213188_cc.svg @@ -0,0 +1,61 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + version="1.1" + x="0px" + y="0px" + viewBox="0 0 100 125" + id="svg2" + inkscape:version="0.91 r13725" + sodipodi:docname="noun_213188_cc.svg"> + <metadata + id="metadata16"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + </cc:Work> + </rdf:RDF> + </metadata> + <defs + id="defs14" /> + <sodipodi:namedview + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1" + objecttolerance="10" + gridtolerance="10" + guidetolerance="10" + inkscape:pageopacity="0" + inkscape:pageshadow="2" + inkscape:window-width="1366" + inkscape:window-height="712" + id="namedview12" + showgrid="false" + inkscape:zoom="1.888" + inkscape:cx="50" + inkscape:cy="62.5" + inkscape:window-x="0" + inkscape:window-y="0" + inkscape:window-maximized="1" + inkscape:current-layer="svg2" /> + <g + transform="matrix(1.2059793,0,0,1.2059793,-9.8622,43.847222)" + id="g4" + style="fill:#008000"> + <path + d="M 50,5 C 39.766783,5 31.46875,15.218727 31.46875,27.8125 c 0,12.6 8.298033,22.8125 18.53125,22.8125 10.233219,0 18.53125,-10.2125 18.53125,-22.8125 C 68.53125,15.218727 60.233219,5 50,5 Z M 31.375,53.78125 c -2.404152,-0.0062 -4.971172,0.888365 -7.46875,2.9375 -6.869896,5.624221 -11.602724,13.02221 -14.1875,21.21875 -2.416609,7.667128 1.916284,9.677963 8.40625,10.53125 5.319031,0.703805 8.871669,2.39866 13.3125,3.8125 C 39.758607,94.940767 44.824222,95 50,95 c 5.175779,0 10.241392,-0.05923 18.5625,-2.71875 4.440831,-1.41384 7.993469,-3.108695 13.3125,-3.8125 6.489965,-0.853287 10.822859,-2.864122 8.40625,-10.53125 -2.584775,-8.19654 -7.317603,-15.594529 -14.1875,-21.21875 -3.998616,-3.276125 -8.168037,-3.638063 -11.5625,-2 -5.088582,2.460207 -9.598378,3.75 -14.53125,3.75 -4.932871,0 -9.442669,-1.289793 -14.53125,-3.75 -1.270588,-0.610381 -2.648768,-0.931273 -4.09375,-0.9375 z" + transform="translate(0,-36)" + style="fill:#008000;fill-opacity:1;fill-rule:nonzero;stroke:none" + id="path6" + inkscape:connector-curvature="0" /> + </g> +</svg> diff --git a/res/icons/noun_213192_cc.svg b/res/icons/noun_213192_cc.svg new file mode 100644 index 00000000..04550973 --- /dev/null +++ b/res/icons/noun_213192_cc.svg @@ -0,0 +1,61 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + version="1.1" + x="0px" + y="0px" + viewBox="0 0 100 125" + id="svg2" + inkscape:version="0.91 r13725" + sodipodi:docname="noun_213192_cc.svg"> + <metadata + id="metadata16"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + </cc:Work> + </rdf:RDF> + </metadata> + <defs + id="defs14" /> + <sodipodi:namedview + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1" + objecttolerance="10" + gridtolerance="10" + guidetolerance="10" + inkscape:pageopacity="0" + inkscape:pageshadow="2" + inkscape:window-width="1366" + inkscape:window-height="712" + id="namedview12" + showgrid="false" + inkscape:zoom="1.888" + inkscape:cx="-50.900424" + inkscape:cy="62.5" + inkscape:window-x="0" + inkscape:window-y="0" + inkscape:window-maximized="1" + inkscape:current-layer="svg2" /> + <g + transform="matrix(1.1000428,0,0,1.1000428,-4.4991194,48.745336)" + id="g4" + style="fill:#aa0000"> + <path + d="M 37.84375,11.46875 C 29.634879,11.46875 23,19.647734 23,29.75 c 0,10.108496 6.634879,18.3125 14.84375,18.3125 8.208869,0 14.875,-8.204004 14.875,-18.3125 0,-10.102266 -6.666131,-18.28125 -14.875,-18.28125 z M 62.1875,47.125 c -0.211762,0 -0.400565,0.08807 -0.5625,0.25 l -7.78125,7.75 c -0.32387,0.32387 -0.32387,0.838607 0,1.15625 L 65.375,67.84375 53.84375,79.375 c -0.32387,0.323871 -0.32387,0.83238 0,1.15625 l 7.78125,7.75 c 0.32387,0.323871 0.83238,0.323871 1.15625,0 L 74.3125,76.75 85.84375,88.28125 c 0.317641,0.323871 0.832379,0.323871 1.15625,0 l 7.75,-7.75 c 0.32387,-0.32387 0.32387,-0.832379 0,-1.15625 L 83.21875,67.84375 94.75,56.28125 c 0.32387,-0.317643 0.32387,-0.83238 0,-1.15625 L 87,47.375 c -0.323871,-0.323871 -0.838609,-0.323871 -1.15625,0 L 74.3125,58.90625 62.78125,47.375 c -0.161935,-0.161936 -0.381989,-0.25 -0.59375,-0.25 z m -39.28125,3.46875 c -1.930766,-0.0062 -4.000722,0.705714 -6,2.34375 -5.512025,4.509274 -9.3009835,10.460417 -11.375,17.03125 -1.9369944,6.15354 1.5493878,7.752389 6.75,8.4375 4.26637,0.560544 7.131153,1.922726 10.6875,3.0625 6.676713,2.130071 10.720738,2.1875 14.875,2.1875 3.936271,0 7.771178,-0.05634 13.84375,-1.875 -0.498263,-0.803446 -0.736565,-1.715998 -0.46875,-2.71875 2.958433,-4.241456 7.074882,-7.494239 10.625,-11.21875 C 59.564201,65.557972 57.27955,63.285776 55,61 53.59241,59.349505 51.156033,58.110192 51.09375,55.65625 51.486131,53.600919 53.11153,52.188947 54.625,50.8125 52.806345,50.388976 51.050842,50.596357 49.5,51.34375 c -4.079521,1.968136 -7.701294,3 -11.65625,3 -3.954957,0 -7.576728,-1.031864 -11.65625,-3 -1.015209,-0.498261 -2.122791,-0.75 -3.28125,-0.75 z" + transform="translate(0,-36)" + style="fill:#aa0000;fill-opacity:1;fill-rule:nonzero;stroke:none" + id="path6" + inkscape:connector-curvature="0" /> + </g> +</svg> diff --git a/res/icons/noun_213886_cc.svg b/res/icons/noun_213886_cc.svg new file mode 100644 index 00000000..8abb8cca --- /dev/null +++ b/res/icons/noun_213886_cc.svg @@ -0,0 +1,61 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + version="1.1" + x="0px" + y="0px" + viewBox="0 0 100 125" + id="svg2" + inkscape:version="0.91 r13725" + sodipodi:docname="noun_213886_cc.svg"> + <metadata + id="metadata16"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + </cc:Work> + </rdf:RDF> + </metadata> + <defs + id="defs14" /> + <sodipodi:namedview + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1" + objecttolerance="10" + gridtolerance="10" + guidetolerance="10" + inkscape:pageopacity="0" + inkscape:pageshadow="2" + inkscape:window-width="1366" + inkscape:window-height="712" + id="namedview12" + showgrid="false" + inkscape:zoom="1.888" + inkscape:cx="50" + inkscape:cy="62.5" + inkscape:window-x="0" + inkscape:window-y="0" + inkscape:window-maximized="1" + inkscape:current-layer="svg2" /> + <g + transform="matrix(1.0756045,0,0,1.0756045,-4.3771943,50.028402)" + id="g4" + style="fill:#d45500"> + <path + d="M 37.84375,11.46875 C 29.634795,11.46875 23,19.672651 23,29.78125 c 0,10.10237 6.634795,18.28125 14.84375,18.28125 8.208953,0 14.875,-8.17888 14.875,-18.28125 0,-10.108599 -6.666047,-18.3125 -14.875,-18.3125 z M 71.28125,47.125 c -0.429757,0 -0.844508,0.257528 -1.0625,0.625 L 47.75,86.6875 c -0.217992,0.367472 -0.211765,0.845049 0,1.21875 0.211763,0.367472 0.632745,0.625 1.0625,0.625 l 44.96875,0 c 0.429756,0 0.850737,-0.257528 1.0625,-0.625 0.217992,-0.373701 0.217965,-0.851278 0,-1.21875 l -22.5,-38.9375 c -0.211765,-0.367472 -0.638974,-0.625 -1.0625,-0.625 z m -48.375,3.46875 c -1.930786,-0.0062 -4.000702,0.705696 -6,2.34375 -5.512083,4.515547 -9.3009621,10.460349 -11.375,17.03125 -1.9370144,6.147373 1.5493347,7.752384 6.75,8.4375 4.266414,0.560551 7.131117,1.922712 10.6875,3.0625 6.676783,2.130092 10.720696,2.1875 14.875,2.1875 2.846352,0 5.650126,-0.02118 9.28125,-0.71875 C 52.032933,73.981145 57.280324,65.206788 62.40625,56.375 61.297605,55.166703 60.076745,54.002546 58.78125,52.9375 55.573654,50.315369 52.221787,50.060819 49.5,51.375 c -4.079563,1.968156 -7.701253,2.96875 -11.65625,2.96875 -3.954997,0 -7.545436,-1.000594 -11.625,-2.96875 -1.015219,-0.492041 -2.154029,-0.775022 -3.3125,-0.78125 z m 48.375,6.1875 c 0.566779,0 1.107615,0.320354 1.5,0.78125 0.392385,0.460898 0.682137,1.090012 0.9375,1.8125 0.523179,1.438747 0.84375,3.313528 0.84375,5.40625 0,2.192376 -0.677317,5.026916 -1.34375,7.375 -0.666432,2.348085 -1.34375,4.1875 -1.34375,4.1875 -0.09342,0.26159 -0.344617,0.4375 -0.59375,0.4375 -0.242905,0 -0.469074,-0.17591 -0.5625,-0.4375 0,0 -0.683546,-1.839415 -1.34375,-4.1875 -0.666433,-2.348084 -1.34375,-5.182624 -1.34375,-7.375 0,-2.092722 0.295548,-3.967503 0.8125,-5.40625 0.26159,-0.722488 0.576365,-1.351602 0.96875,-1.8125 0.392385,-0.460896 0.901971,-0.78125 1.46875,-0.78125 z m 0,21.4375 c 1.575769,0 2.875,1.261751 2.875,2.84375 0,1.581999 -1.299231,2.875 -2.875,2.875 -1.575771,0 -2.84375,-1.293001 -2.84375,-2.875 0,-1.57577 1.267979,-2.84375 2.84375,-2.84375 z" + transform="translate(0,-36)" + style="fill:#d45500;fill-opacity:1;fill-rule:nonzero;stroke:none" + id="path6" + inkscape:connector-curvature="0" /> + </g> +</svg> diff --git a/src/sakia/models/identities.py b/src/sakia/models/identities.py index 9cdbab2b..1f85b5c5 100644 --- a/src/sakia/models/identities.py +++ b/src/sakia/models/identities.py @@ -7,7 +7,7 @@ Created on 5 févr. 2014 from ..tools.exceptions import NoPeerAvailable, MembershipNotFoundError from PyQt5.QtCore import QAbstractTableModel, QSortFilterProxyModel, Qt, \ QDateTime, QModelIndex, QLocale, QEvent -from PyQt5.QtGui import QColor +from PyQt5.QtGui import QColor, QIcon import logging import asyncio @@ -70,6 +70,14 @@ class IdentitiesFilterProxyModel(QSortFilterProxyModel): return QColor(Qt.red) else: return QColor(Qt.blue) + + if role == Qt.DecorationRole: + if expiration_data: + if will_expire_soon: + return QIcon(":/icons/member_warning") + else: + return QIcon(":/icons/member") + return source_data -- GitLab