Skip to content
Snippets Groups Projects
Commit bae4d410 authored by inso's avatar inso
Browse files

New icons in network tab

parent e7e7390f
No related branches found
No related tags found
No related merge requests found
......@@ -28,4 +28,8 @@ noun_100552_cc.svg : by Rui
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
noun_213196_cc.svg : by Aha-Soft
noun_60040_cc.svg : by Dmitry Baranovskiy
noun_87601_cc.svg : by Arthur Shlain
noun_274635_cc.svg : by Pham Thi Dieu Linh
noun_198591_cc.svg : by Андрей Уханёв
\ No newline at end of file
......@@ -35,5 +35,10 @@
<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>
<file alias="forked">noun_60040_cc.svg</file>
<file alias="offline">noun_87601_cc.svg</file>
<file alias="synchronized">noun_274635_cc.svg</file>
<file alias="corrupted">noun_198591_cc.svg</file>
</qresource>
</RCC>
<?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 99.999 125"
enable-background="new 0 0 99.999 100"
xml:space="preserve"
id="svg2"
inkscape:version="0.91 r13725"
sodipodi:docname="noun_198591_cc.svg"><metadata
id="metadata14"><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="defs12" /><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="namedview10"
showgrid="false"
inkscape:zoom="1.888"
inkscape:cx="49.9995"
inkscape:cy="62.5"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="svg2" /><path
d="m 86.731,35.862 8.268,-8.267 -10.59,-10.593 -8.284,8.283 C 60.558,14.231 39.493,14.253 23.946,25.353 L 15.595,17 5.001,27.59 13.369,35.959 C 2.337,51.494 2.336,72.504 13.366,88.041 l -8.367,8.367 10.594,10.59 8.351,-8.35 c 15.545,11.099 36.609,11.121 52.179,0.066 L 84.407,107 94.997,96.406 86.729,88.138 C 97.854,72.561 97.854,51.438 86.731,35.862 Z M 72.891,28.52 50.001,51.409 27.18,28.586 C 40.896,19.178 59.15,19.155 72.891,28.52 Z M 16.604,84.805 C 7.257,71.1 7.257,52.897 16.603,39.191 L 39.409,62 16.604,84.805 Z m 10.577,10.606 22.82,-22.819 22.889,22.89 c -13.742,9.367 -31.995,9.34 -45.709,-0.071 z M 83.496,84.905 60.593,62 83.498,39.096 c 9.431,13.75 9.431,32.06 -0.002,45.809 z"
id="path4"
inkscape:connector-curvature="0"
style="fill:#6c5353" /></svg>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:sketch="http://www.bohemiancoding.com/sketch/ns"
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"
viewBox="0 0 30 37.5"
version="1.1"
x="0px"
y="0px"
id="svg2"
inkscape:version="0.91 r13725"
sodipodi:docname="noun_274635_cc.svg">
<metadata
id="metadata22">
<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="defs20" />
<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="namedview18"
showgrid="false"
inkscape:zoom="6.2933333"
inkscape:cx="15"
inkscape:cy="18.75"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="svg2" />
<title
id="title4">action_012-history-arrow-time-update</title>
<desc
id="desc6">Created with Sketch.</desc>
<g
sketch:type="MSPage"
id="g8"
transform="matrix(1.0647348,0,0,1.0647348,-1.8454517,4.1873838)"
style="fill:#008000;fill-rule:evenodd;stroke:none;stroke-width:1">
<g
sketch:type="MSArtboardGroup"
transform="translate(-90,-90)"
id="g10"
style="fill:#008000">
<path
d="m 114.3382,97.08445 -1.1269,0.94558 c -0.84382,0.708053 -0.64338,1.40872 0.45043,1.562694 l 3.69774,0.520526 c 0.54582,0.0768 0.99829,-0.305762 1.01729,-0.85361 l 0.12949,-3.73195 c 0.0384,-1.106118 -0.61569,-1.424029 -1.46073,-0.714951 l -1.20361,1.009943 c -4.79252,-5.711508 -13.30772,-6.456492 -19.019228,-1.663968 -5.711508,4.792525 -6.456492,13.307726 -1.663968,19.019236 4.792525,5.7115 13.307726,6.45649 19.019236,1.66396 1.98848,-1.66854 3.43633,-3.84334 4.20465,-6.29948 0.16183,-0.51734 -0.12637,-1.06791 -0.6437,-1.22974 -0.51734,-0.16183 -1.06791,0.12636 -1.22974,0.6437 -0.65647,2.09858 -1.89232,3.95478 -3.59298,5.38181 -4.88103,4.09567 -12.15808,3.45901 -16.253749,-1.42202 -4.095669,-4.88103 -3.459009,-12.15808 1.422019,-16.253749 4.88103,-4.095669 12.15808,-3.459009 16.25375,1.422019 z m -14.780852,3.78713 -0.700482,0.70049 c -0.197092,0.19709 -0.195891,0.51784 0.0035,0.71724 l 6.350314,6.35031 c 0.19903,0.19903 0.52358,0.19718 0.71424,0.007 l 4.94913,-4.94913 c 0.19543,-0.19543 0.20252,-0.50521 -0.003,-0.71073 l -0.70049,-0.70048 c -0.19709,-0.19709 -0.518,-0.19573 -0.70405,-0.01 l -3.89545,3.89545 -5.303,-5.30299 c -0.19543,-0.19543 -0.505203,-0.20252 -0.710723,0.003 z"
sketch:type="MSShapeGroup"
id="path12"
inkscape:connector-curvature="0"
style="fill:#008000" />
</g>
</g>
</svg>
<?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"
enable-background="new 0 0 100 100"
xml:space="preserve"
id="svg2"
inkscape:version="0.91 r13725"
sodipodi:docname="noun_60040_cc.svg"><metadata
id="metadata14"><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="defs12" /><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="namedview10"
showgrid="false"
inkscape:zoom="1.888"
inkscape:cx="18.19375"
inkscape:cy="62.5"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="svg2" /><path
d="M 99.87499,38.500263 C 99.87499,31.625118 94.249868,26 87.374724,26 c -4.625098,0 -8.625182,2.500053 -10.875229,6.250132 l -53.251121,0 C 21.123329,28.500053 16.998242,26 12.373145,26 5.4979998,26 -0.127119,31.625118 -0.127119,38.500263 c 0,6.875145 5.6251188,12.500263 12.500264,12.500263 4.625097,0 8.625181,-2.500052 10.875229,-6.250131 l 53.376123,0 c 2.125045,3.750079 6.250132,6.250131 10.875229,6.250131 6.750142,0 12.375264,-5.625118 12.375264,-12.500263 z m -87.501845,7.500158 c -4.125087,0 -7.5001584,-3.375071 -7.5001584,-7.500158 0,-4.125087 3.3750714,-7.500158 7.5001584,-7.500158 4.125086,0 7.500158,3.375071 7.500158,7.500158 0,4.125087 -3.375072,7.500158 -7.500159,7.500158 z m 75.001579,0 c -4.125087,0 -7.500158,-3.375071 -7.500158,-7.500158 0,-4.125087 3.375071,-7.500158 7.500158,-7.500158 4.125087,0 7.500158,3.375071 7.500158,7.500158 0,4.125087 -3.375071,7.500158 -7.500158,7.500158 z m 0,5.000105 -13.125277,22.750479 6.875145,0 0,2.250048 c 0,1.875039 -0.625013,6.250131 -6.250132,6.250131 l -51.626086,0 c -2.125045,-3.750079 -6.250132,-6.250131 -10.875229,-6.250131 -6.8751452,0 -12.500264,5.625118 -12.500264,12.500263 0,6.875145 5.6251188,12.500264 12.500264,12.500264 4.625097,0 8.625181,-2.500054 10.875229,-6.250132 l 51.626086,0 c 13.75029,0 18.750395,-11.250237 18.750395,-18.750395 l 0,-2.250048 6.875145,0 L 87.374724,51.000526 Z M 12.373145,96.001474 c -4.125087,0 -7.5001584,-3.375071 -7.5001584,-7.500158 0,-4.125087 3.3750714,-7.500158 7.5001584,-7.500158 4.125086,0 7.500158,3.375071 7.500158,7.500158 0,4.125087 -3.375072,7.500158 -7.500159,7.500158 z"
id="path4"
inkscape:connector-curvature="0"
style="fill:#d45500" /></svg>
\ No newline at end of file
<?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"
enable-background="new 0 0 100 100"
xml:space="preserve"
id="svg2"
inkscape:version="0.91 r13725"
sodipodi:docname="noun_87601_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" /><path
d="m 0.83531061,26.711164 c 0,4.97582 1.74826129,9.682677 5.11030139,13.448161 l 0,15.599867 c 0,5.513746 4.572376,10.086122 10.086122,10.086122 l 6.993044,0 c 1.479297,13.179198 12.775753,23.534282 26.492877,23.534282 13.717126,0 25.01358,-10.355084 26.62736,-23.534282 l 6.993044,0 c 1.882743,0 3.36204,1.479297 3.36204,3.36204 l 0,15.465385 c -3.227559,3.765486 -5.110301,8.472342 -5.110301,13.448166 l 0,24.879095 16.810202,0 0,-24.74462 c 0,-4.975817 -1.748261,-9.682673 -5.110301,-13.448158 l 0,-15.599868 c 0,-5.513746 -4.572375,-10.086121 -10.086121,-10.086121 l -6.993045,0 C 74.531235,45.942035 63.234781,35.58695 49.517655,35.58695 c -13.717124,0 -25.01358,10.355085 -26.62736,23.534283 l -6.993044,0 c -1.882742,0 -3.36204,-1.479297 -3.36204,-3.362041 l 0,-15.465385 c 3.227559,-3.765485 5.110302,-8.472342 5.110302,-13.448162 l 0,-24.8790979 -16.81020239,0 0,24.7446169 z M 88.248361,98.25538 c 0,-2.420666 0.537926,-4.572372 1.748261,-6.589597 1.075853,2.017225 1.74826,4.303412 1.74826,6.589597 l 0,7.93442 -3.36204,0 0,-7.93442 z m 0,14.6585 3.36204,0 0,3.36204 -3.36204,0 0,-3.36204 z M 49.517655,42.311031 c 11.161975,0 20.172242,9.010268 20.172242,20.172243 0,11.161973 -9.010267,20.172242 -20.172242,20.172242 -11.161973,0 -20.172242,-9.010269 -20.172242,-20.172242 0,-11.161975 9.010269,-20.172243 20.172242,-20.172243 z M 7.5593909,8.6906274 l 3.3620411,0 0,3.3620406 -3.3620411,0 0,-3.3620406 z m 0,10.0861206 3.3620411,0 0,7.934416 c 0,2.420669 -0.537927,4.572375 -1.748261,6.589599 C 8.097318,31.283539 7.4249098,28.997351 7.4249098,26.711164 l 0,-7.934416 z"
id="path4"
inkscape:connector-curvature="0"
style="fill:#d40000" /><polygon
points="46.5,50 41.2,55.3 44.7,58.8 50,53.5 55.3,58.8 58.8,55.3 53.5,50 58.8,44.7 55.3,41.2 50,46.5 44.7,41.2 41.2,44.7 "
id="polygon6"
transform="matrix(1.3448162,0,0,1.3448162,-17.723152,-4.7575344)"
style="fill:#d40000" /></svg>
\ No newline at end of file
......@@ -67,16 +67,18 @@ class IdentitiesFilterProxyModel(QSortFilterProxyModel):
if role == Qt.ForegroundRole:
if expiration_data:
if will_expire_soon:
return QColor(Qt.red)
return QColor("darkorange").darker(120)
else:
return QColor(Qt.blue)
if role == Qt.DecorationRole:
if role == Qt.DecorationRole and source_index.column() == self.sourceModel().columns_ids.index('uid'):
if expiration_data:
if will_expire_soon:
return QIcon(":/icons/member_warning")
else:
else:
return QIcon(":/icons/member")
else:
return QIcon(":/icons/not_member")
return source_data
......
......@@ -8,7 +8,7 @@ import logging
import asyncio
from PyQt5.QtCore import QAbstractTableModel, Qt, QVariant, QSortFilterProxyModel
from PyQt5.QtGui import QColor, QFont
from PyQt5.QtGui import QColor, QFont, QIcon
from ..tools.exceptions import NoPeerAvailable
from ..tools.decorators import asyncify, once_at_a_time, cancel_once_task
......@@ -131,6 +131,12 @@ class NetworkTableModel(QAbstractTableModel):
Node.DESYNCED: QColor('#ffbd81'),
Node.CORRUPTED: QColor(Qt.lightGray)
}
self.node_icons = {
Node.ONLINE: ":/icons/synchronized",
Node.OFFLINE: ":/icons/offline",
Node.DESYNCED: ":/icons/forked",
Node.CORRUPTED: ":/icons/corrupted"
}
self.node_states = {
Node.ONLINE: lambda: self.tr('Online'),
Node.OFFLINE: lambda: self.tr('Offline'),
......@@ -214,6 +220,9 @@ class NetworkTableModel(QAbstractTableModel):
if role == Qt.ToolTipRole:
return self.node_states[node[self.columns_types.index('state')]]()
if role == Qt.DecorationRole and index.column() == 0:
return QIcon(self.node_icons[node[self.columns_types.index('state')]])
return QVariant()
def flags(self, index):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment