diff --git a/res/icons/AUTHORS b/res/icons/AUTHORS index 4dc1d78f3193393fcd73bb1eec24f2c481b5d9a0..701840e29eb80d91e0847f992f5c19f87b7ca972 100644 --- a/res/icons/AUTHORS +++ b/res/icons/AUTHORS @@ -15,4 +15,12 @@ noun_5197_cc.svg : Created by Bibzee noun_38960_cc.svg : Created by Agarunov Oktay-Abraham noun_42425_cc.svg : Created by Luis Rodrigues noun_62146_cc.svg : Created by Sergey Krivoy -noun_2149_cc.svg : Created by Anand A Nair \ No newline at end of file +noun_2149_cc.svg : Created by Anand A Nair +noun_152997_cc.svg : Created by Pedro Ivo Hudson +noun_139613_cc.svg : Created by Aha-Soft +noun_19900_cc.svg : Created by by Stefan Parnarov +noun_178785_cc.svg : by Jevgeni Striganov +noun_41979_cc.svg : by by hunotika +noun_155533_cc.svg : by anbileru adaleru +noun_155520_cc.svg : by anbileru adaleru +noun_155540_cc.svg : by anbileru adaleru \ No newline at end of file diff --git a/res/icons/icons.qrc b/res/icons/icons.qrc index 6bef064abf71418f373ced63370badf17114d71a..1af72a7c804fbb92b62d948d1fdbea1fdbea3d5b 100644 --- a/res/icons/icons.qrc +++ b/res/icons/icons.qrc @@ -1,5 +1,11 @@ <RCC> <qresource prefix="icons"> + <file alias="payment_icon">noun_178785_cc.svg</file> + <file alias="renew_membership">noun_155533_cc.svg</file> + <file alias="certification_icon">noun_41979_cc.svg</file> + <file alias="logout">noun_19900_cc.svg</file> + <file alias="add_community">noun_139613_cc.svg</file> + <file alias="connect_icon">noun_152997_cc.svg</file> <file alias="home_icon">iconmonstr-home-icon.svg</file> <file alias="cutecoin_logo">logo.svg</file> <file alias="add_account_icon">noun_7440_cc.svg</file> diff --git a/res/icons/noun_139613_cc.svg b/res/icons/noun_139613_cc.svg new file mode 100644 index 0000000000000000000000000000000000000000..18a319b7c607bdfcd7ee5a358eef15e611bc7b34 --- /dev/null +++ b/res/icons/noun_139613_cc.svg @@ -0,0 +1,44 @@ +<?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" + viewBox="0 0 100.00001 125" + xml:space="preserve" + x="0px" + y="0px" + id="svg2" + inkscape:version="0.91 r13725" + sodipodi:docname="noun_139613_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="-42.425844" + inkscape:cy="62.5" + inkscape:window-x="0" + inkscape:window-y="0" + inkscape:window-maximized="1" + inkscape:current-layer="svg2" /><path + d="m 25.78125,24.656245 c -1.19804,0.03338 -2.390296,0.356511 -3.5,1 -3.551054,2.059166 -4.777916,6.605196 -2.71875,10.15625 2.059166,3.551054 6.605196,4.777916 10.15625,2.71875 0.456937,-0.264966 0.872582,-0.566293 1.25,-0.90625 l 11.90625,8.84375 c -0.102601,-0.265069 -0.210456,-0.53323 -0.28125,-0.8125 -0.377046,-0.995022 -0.216682,-1.991187 0.03125,-2.96875 l -9.9375,-7.34375 c 1.040295,-2.147247 1.036979,-4.749341 -0.25,-6.96875 -1.415677,-2.441349 -4.020561,-3.792192 -6.65625,-3.71875 z m 53.90625,3.09375 c -1.19804,0.03338 -2.421546,0.356511 -3.53125,1 -3.09834,1.796649 -4.395139,5.479306 -3.3125,8.75 l -11.125,6.65625 c -0.01921,1.463022 -0.639159,2.857354 -1.375,4.1875 L 74.25,39.999995 c 2.284876,2.676533 6.222001,3.422095 9.375,1.59375 3.551054,-2.059166 4.746666,-6.605196 2.6875,-10.15625 -1.415677,-2.441349 -3.989311,-3.760942 -6.625,-3.6875 z m -27.625,6.0625 c -6.491611,0 -6.40625,5.65625 -6.40625,5.65625 l -0.0625,3.03125 c -0.530352,-0.0072 -0.65625,0.514594 -0.65625,1.5625 0,1.570663 0.973035,3.213529 1.84375,4.0625 0.295074,1.234764 0.866408,2.327458 1.625,3.15625 -0.02641,0.0162 -0.06722,0.01506 -0.09375,0.03125 -2.587069,1.578079 -5.672508,2.649945 -7.6875,3.71875 -0.555696,0.29448 -1.144777,0.811066 -1.625,1.46875 -0.32697,0.452412 -0.598878,0.935264 -0.84375,1.4375 -0.009,0.01782 -0.0225,0.04466 -0.03125,0.0625 -0.0335,0.0697 -0.06169,0.148406 -0.09375,0.21875 -0.48672,1.041571 -0.840864,2.134504 -1.03125,3.25 -0.004,0.02072 0.0038,0.04182 0,0.0625 -0.0086,0.05238 -0.02313,0.10387 -0.03125,0.15625 -0.03411,0.193194 -0.06636,0.403903 -0.09375,0.59375 -0.02338,0.156384 -0.04306,0.493278 -0.03125,0.65625 -0.0018,0.0099 9e-4,0.02135 0,0.03125 -0.07182,1.018098 1.84375,1.34375 1.84375,1.34375 0.715321,0.211536 2.029012,0.44187 3.625,0.65625 2.847115,0.46989 5.761037,0.630802 8.625,0.71875 0.277992,0.0086 0.572546,-0.0011 0.875,0 l 0.03125,0 c 0.150498,0 0.31314,0.0018 0.46875,0 0.302454,-0.0018 0.59699,0.0086 0.875,0 2.862703,-0.08791 5.779109,-0.249346 8.625,-0.71875 1.598346,-0.21456 2.908924,-0.444498 3.625,-0.65625 0,0 1.915552,-0.325652 1.84375,-1.34375 -0.0018,-0.0099 9e-4,-0.02133 0,-0.03125 0.01188,-0.162972 -0.0079,-0.499866 -0.03125,-0.65625 -0.03917,-0.271261 -0.103166,-0.566172 -0.15625,-0.84375 -0.210852,-1.219968 -0.58763,-2.440343 -1.15625,-3.5625 -0.0063,-0.0126 0.0065,-0.01868 0,-0.03125 -0.23436,-0.469476 -0.505438,-0.918878 -0.8125,-1.34375 -0.480222,-0.657684 -1.069304,-1.17427 -1.625,-1.46875 -2.014992,-1.068805 -5.100449,-2.140671 -7.6875,-3.71875 -0.02651,-0.0162 -0.06734,-0.01497 -0.09375,-0.03125 0.75861,-0.828792 1.329925,-1.921486 1.625,-3.15625 0.870714,-0.848971 1.8125,-2.491837 1.8125,-4.0625 0,-1.047906 -0.12588,-1.569664 -0.65625,-1.5625 l -0.03125,-3.03125 c 0,0 0.08537,-5.65625 -6.40625,-5.65625 z m -13.46875,19.65625 -19.375,4.84375 C 19.115362,58.083617 19.003698,57.846936 18.875,57.624995 16.815834,54.073941 12.269804,52.878329 8.71875,54.937495 5.1676963,56.996661 3.9408337,61.542691 6,65.093745 c 2.059166,3.551054 6.605196,4.746666 10.15625,2.6875 2.450927,-1.42123 3.803575,-4.041145 3.71875,-6.6875 l 15.84375,-3.9375 c 0.07438,-0.159517 0.172762,-0.313302 0.25,-0.46875 0.603648,-1.339254 1.514598,-2.380579 2.625,-3.21875 z m 31.125,7.78125 c 0.20349,1.074546 0.137248,2.244139 -0.3125,3.21875 l 11.3125,7.34375 c -0.855939,2.066285 -0.802327,4.478297 0.40625,6.5625 2.059166,3.551054 6.605196,4.777916 10.15625,2.71875 3.551054,-2.059166 4.777916,-6.605196 2.71875,-10.15625 -2.059166,-3.551054 -6.605196,-4.777916 -10.15625,-2.71875 -0.574435,0.3331 -1.08329,0.738901 -1.53125,1.1875 l -12.59375,-8.15625 z m -25.3125,6.5 -7.96875,20.84375 c -1.689316,-0.317982 -3.52127,-0.05496 -5.125,0.875 -3.551054,2.059166 -4.746666,6.605196 -2.6875,10.15625 2.059166,3.551055 6.605196,4.777915 10.15625,2.718755 3.551054,-2.05917 4.777916,-6.605201 2.71875,-10.156255 -0.607794,-1.048147 -1.45443,-1.883708 -2.40625,-2.5 l 8.3125,-21.65625 c -0.996859,-0.07277 -2.0091,-0.172782 -3,-0.28125 z" + style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none" + id="path4" + inkscape:connector-curvature="0" /></svg> \ No newline at end of file diff --git a/res/icons/noun_152997_cc.svg b/res/icons/noun_152997_cc.svg new file mode 100644 index 0000000000000000000000000000000000000000..3eb27d7384f0cb2f51e42695974d3f31e74e341a --- /dev/null +++ b/res/icons/noun_152997_cc.svg @@ -0,0 +1,44 @@ +<?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="-255 347 100 125" + enable-background="new -255 347 100 100" + xml:space="preserve" + id="svg2" + inkscape:version="0.91 r13725" + sodipodi:docname="noun_152997_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="743" + inkscape:window-height="480" + id="namedview10" + showgrid="false" + inkscape:zoom="1.888" + inkscape:cx="50" + inkscape:cy="62.5" + inkscape:window-x="0" + inkscape:window-y="0" + inkscape:window-maximized="0" + inkscape:current-layer="svg2" /><path + d="m -205,364 c -24.9,0 -45,20.1 -45,45 0,24.9 20.1,45 45,45 24.9,0 45,-20.1 45,-45 0,-24.9 -20.1,-45 -45,-45 z m -26,72.4 c 1.8,-0.8 3.6,-1.4 5.5,-1.9 5.2,-1.2 8.3,-2.9 9.3,-5.1 0.8,-1.7 0.3,-4 -1.2,-6.9 -9.6,-17.7 -7.9,-27.7 -4.8,-32.9 3.1,-5.3 9.1,-8.2 16.7,-8.2 7.6,0 13.5,2.9 16.6,8.1 3.1,5.2 4.8,15.2 -4.7,33 -1.6,3 -2,5.3 -1.2,7 1,2.1 4.1,3.8 9.3,5 1.8,0.4 4,1.1 6.3,2.1 -6.7,6.3 -15.8,10.1 -25.7,10.1 -10.2,0.1 -19.3,-3.9 -26.1,-10.3 z" + id="path4" + inkscape:connector-curvature="0" /></svg> \ No newline at end of file diff --git a/res/icons/noun_155520_cc.svg b/res/icons/noun_155520_cc.svg new file mode 100644 index 0000000000000000000000000000000000000000..1217dfbec87ef8d09662154329e267fb1f6e6512 --- /dev/null +++ b/res/icons/noun_155520_cc.svg @@ -0,0 +1,59 @@ +<?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" + viewBox="0 0 100 125" + version="1.1" + x="0px" + y="0px" + id="svg2" + inkscape:version="0.91 r13725" + sodipodi:docname="noun_155520_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="743" + inkscape:window-height="480" + 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="0" + inkscape:current-layer="svg2" /> + <g + transform="matrix(1.3457509,0,0,1.3457509,-17.552378,-1285.5892)" + id="g4"> + <path + style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" + d="m 15.110586,975.08438 c -0.257006,0 -0.505174,0.0945 -0.703274,0.2579 l -0.01172,0.015 -0.0059,0 C 14.081837,975.61353 14,976.00871 14,976.40929 l 0,34.68311 c 6.2e-5,0.6214 0.503812,1.1252 1.125238,1.1252 l 33.801091,0 c 0.586855,9.7103 8.643142,17.4323 18.49903,17.4323 10.236198,0 18.560564,-8.3214 18.560564,-18.5575 -0.05194,-0.3616 0,-0.6773 0,-1.0052 l 0,-33.68677 c 0.108906,-0.68863 -0.428123,-1.30945 -1.125237,-1.30105 -23.24491,-0.099 -46.520652,0.13953 -69.7501,-0.015 z m 1.139889,2.26514 67.484972,0 0,24.88708 c -3.148794,-5.77627 -9.278805,-9.70217 -16.310089,-9.70217 -9.856474,0 -17.913031,7.72137 -18.49903,17.43237 l -32.675853,0 z m 4.688492,3.56034 c -1.521671,-0.021 -1.521671,2.27207 0,2.25057 l 58.107989,0 c 1.521671,0.021 1.521671,-2.27203 0,-2.25057 z m 0,5.81077 c -1.521685,-0.021 -1.521685,2.272 0,2.2506 l 34.864793,0 c 1.521686,0.021 1.521686,-2.2721 0,-2.2506 z m 0,5.8138 c -1.521685,-0.021 -1.521685,2.272 0,2.2504 l 23.243195,0 c 1.521684,0.021 1.521684,-2.2719 0,-2.2504 z m 46.486391,2.2504 c 9.019957,0 16.310089,7.28737 16.310089,16.30727 0,9.0199 -7.290132,16.3071 -16.310089,16.3071 -8.975386,0 -16.229773,-7.2172 -16.301298,-16.1753 0.0111,-0.09 0.0111,-0.1819 0,-0.2726 0.07611,-8.9541 7.328792,-16.16647 16.301298,-16.16647 z m -5.822521,9.35937 c -1.007872,0 -1.504007,1.2276 -0.78239,1.9312 l 5.013755,5.0167 -5.013755,5.0136 c -1.104574,1.0606 0.530609,2.6958 1.591156,1.5912 l 5.016685,-5.0166 5.013757,5.0166 c 1.060547,1.1046 2.695728,-0.5306 1.591156,-1.5912 l -5.016685,-5.0136 5.016685,-5.0167 c 0.73468,-0.7155 0.207553,-1.9606 -0.817556,-1.9312 -0.292229,0.015 -0.569676,0.1305 -0.7736,0.34 l -5.013757,5.0138 -5.016685,-5.0138 c -0.212505,-0.218 -0.504294,-0.3407 -0.808766,-0.34 z m -40.66387,0.015 c -1.521685,-0.021 -1.521685,2.2721 0,2.2506 l 11.621597,0 c 1.521684,0.021 1.521684,-2.272 0,-2.2506 z" + id="path6" + inkscape:connector-curvature="0" /> + </g> +</svg> diff --git a/res/icons/noun_155533_cc.svg b/res/icons/noun_155533_cc.svg new file mode 100644 index 0000000000000000000000000000000000000000..88e79c220345d71b075bedec7e217bf52ed7849a --- /dev/null +++ b/res/icons/noun_155533_cc.svg @@ -0,0 +1,59 @@ +<?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" + viewBox="0 0 100 125" + version="1.1" + x="0px" + y="0px" + id="svg2" + inkscape:version="0.91 r13725" + sodipodi:docname="noun_155533_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="743" + inkscape:window-height="480" + 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="0" + inkscape:current-layer="svg2" /> + <g + transform="matrix(1.2812691,0,0,1.2812691,-14.189139,-1221.9757)" + id="g4"> + <path + style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.49966645;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" + d="m 15.110916,975.06807 c -0.621665,-0.004 -1.119023,0.51848 -1.110801,1.14011 -1.54e-4,0.0107 -1.54e-4,0.0215 0,0.0322 l 0,34.85682 c -7.6e-5,0.6217 0.503852,1.1256 1.125456,1.1255 l 33.807617,0 c 0.586097,9.717 8.644024,17.4446 18.502602,17.4446 10.238382,0 18.574502,-8.3278 18.564148,-18.5701 -0.01155,-11.42186 0,-23.20066 0,-34.71614 3.28e-4,-0.0313 -6.5e-4,-0.0626 -0.0029,-0.0938 l 0,-0.0117 0,-0.009 c 0.03354,-0.64318 -0.478479,-1.18327 -1.122524,-1.18408 -23.249396,-0.0987 -46.529588,0.13224 -69.763567,-0.0147 z m 1.14011,2.26556 67.498002,0 0,24.90357 c -3.149351,-5.78006 -9.280447,-9.70996 -16.313238,-9.70996 -9.858578,0 -17.916505,7.72756 -18.502602,17.44456 l -32.682162,0 z m 4.686466,3.56394 c -1.499511,10e-4 -1.499511,2.24977 0,2.25087 l 58.125071,0 c 1.499511,0 1.499511,-2.24977 0,-2.25087 z m 0,5.81487 c -1.500607,0 -1.500607,2.2509 0,2.2509 l 34.874456,0 c 1.500606,0 1.500606,-2.2509 0,-2.2509 z m 0,5.8148 c -1.500607,0 -1.500607,2.2509 0,2.2509 l 23.250614,0 c 1.500606,0 1.500606,-2.2509 0,-2.2509 z m 46.498298,2.2509 c 9.021606,0 16.313238,7.29246 16.313238,16.31906 0,9.0266 -7.291632,16.3191 -16.313238,16.3191 -9.021607,0 -16.310308,-7.2925 -16.310308,-16.3191 0,-9.0266 7.288701,-16.31906 16.310308,-16.31906 z m -0.07034,2.8108 c -1.170749,0.01 -2.351251,0.1892 -3.505324,0.5598 -4.616281,1.4824 -7.847018,5.67446 -8.112657,10.52466 -0.08958,1.5071 2.171195,1.6311 2.245049,0.1231 0.214979,-3.9251 2.817603,-7.303 6.553431,-8.5024 3.735824,-1.19976 7.812697,0.035 10.263918,3.1037 2.45122,3.0686 2.757006,7.325 0.770819,10.7153 -1.752047,2.9905 -4.962346,4.7388 -8.350056,4.666 l 1.679389,-2.0575 c 0.622368,-0.7447 0.07326,-1.8752 -0.896847,-1.8465 -0.331131,0.01 -0.641,0.1656 -0.847022,0.425 l -3.347057,4.1032 c -0.392984,0.4809 -0.322154,1.1892 0.158268,1.5827 l 4.09443,3.3529 c 1.160624,0.9516 2.58796,-0.7893 1.427335,-1.7409 l -1.925584,-1.5768 c 4.045379,-0.05 7.850052,-2.188 9.947383,-5.768 2.454098,-4.1888 2.073993,-9.4725 -0.955465,-13.2651 -2.272099,-2.84446 -5.687763,-4.41696 -9.20001,-4.39916 z m -46.427957,6.56796 c -1.500607,0 -1.500607,2.251 0,2.251 l 11.626771,0 c 1.500607,0 1.500607,-2.251 0,-2.251 z" + id="path6" + inkscape:connector-curvature="0" /> + </g> +</svg> diff --git a/res/icons/noun_155540_cc.svg b/res/icons/noun_155540_cc.svg new file mode 100644 index 0000000000000000000000000000000000000000..adeaf9491b56ed4f6a6efb81c4e1f1e60661b641 --- /dev/null +++ b/res/icons/noun_155540_cc.svg @@ -0,0 +1,59 @@ +<?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" + viewBox="0 0 100 125" + version="1.1" + x="0px" + y="0px" + id="svg2" + inkscape:version="0.91 r13725" + sodipodi:docname="noun_155540_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="743" + inkscape:window-height="480" + id="namedview12" + showgrid="false" + inkscape:zoom="1.888" + inkscape:cx="61.00568" + inkscape:cy="62.5" + inkscape:window-x="0" + inkscape:window-y="0" + inkscape:window-maximized="0" + inkscape:current-layer="svg2" /> + <g + transform="matrix(1.3383945,0,0,1.3383945,-16.919727,-1280.9706)" + id="g4"> + <path + style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" + d="m 67.422429,975.07796 c -17.441637,0.0192 -34.88975,0.12012 -52.311843,0.006 -0.257006,-0.002 -0.504221,0.0953 -0.703273,0.25786 -0.006,0.005 -0.01173,0.01 -0.01758,0.0147 C 14.081844,975.61282 14,976.0079 14,976.4085 l 0,34.6831 c 6.2e-5,0.6214 0.503812,1.1252 1.125238,1.1253 l 33.801091,0 c 0.586857,9.7104 8.643143,17.4324 18.49903,17.4324 10.236196,0 18.569433,-8.3215 18.560564,-18.5577 -0.0099,-11.41928 0,-23.18198 0,-34.69189 0.108903,-0.68861 -0.428123,-1.30955 -1.125238,-1.30106 -5.811227,-0.0247 -11.624378,-0.0269 -17.438256,-0.0205 z m -51.171953,2.27098 67.484971,0 0,24.88706 c -3.148794,-5.77618 -9.278806,-9.70218 -16.310088,-9.70218 -9.856474,0 -17.913032,7.72128 -18.49903,17.43238 l -32.675853,0 z m 4.688491,3.56033 c -1.52167,-0.0215 -1.52167,2.27195 0,2.25045 l 58.107989,0 c 1.521671,0.021 1.521671,-2.27196 0,-2.25045 z m 0,5.81075 c -1.521685,-0.021 -1.521685,2.272 0,2.2505 l 34.864794,0 c 1.521684,0.022 1.521684,-2.272 0,-2.2505 z m 0,5.8138 c -1.521685,-0.022 -1.521685,2.272 0,2.2505 l 23.243195,0 c 1.521685,0.022 1.521685,-2.272 0,-2.2505 z m 46.486392,2.2505 c 9.019955,0 16.310088,7.28718 16.310088,16.30708 0,9.0199 -7.290133,16.3072 -16.310088,16.3072 -8.975387,0 -16.241481,-7.2171 -16.301299,-16.1753 -6.09e-4,-0.091 -6.56e-4,-0.1814 0,-0.2725 0.06436,-8.9543 7.328793,-16.16648 16.301299,-16.16648 z m -0.0117,6.45248 c -0.369837,10e-5 -0.716,0.182 -0.925976,0.4864 l -8.574079,8.5712 c -1.104572,1.0605 0.53061,2.6957 1.591157,1.5911 l 6.795383,-6.7924 0,14.713 c -0.02152,1.5217 2.271996,1.5217 2.250475,0 l 0,-14.716 6.795383,6.7954 c 1.060545,1.1046 2.695779,-0.5306 1.591155,-1.5911 l -8.650266,-8.6474 c -0.0123,-0.014 -0.02506,-0.028 -0.03809,-0.041 l -0.02638,-0.026 c -0.01425,-0.015 -0.0289,-0.03 -0.04396,-0.044 -0.01713,-0.015 -0.03472,-0.03 -0.05275,-0.044 -0.02455,-0.021 -0.04998,-0.04 -0.07619,-0.059 l -0.0147,-0.01 c -0.184168,-0.1222 -0.400227,-0.1874 -0.621226,-0.1876 z m -46.474689,2.9186 c -1.521685,-0.021 -1.521685,2.272 0,2.2504 l 11.621597,0 c 1.521685,0.022 1.521685,-2.2719 0,-2.2504 z" + id="path6" + inkscape:connector-curvature="0" /> + </g> +</svg> diff --git a/res/icons/noun_178785_cc.svg b/res/icons/noun_178785_cc.svg new file mode 100644 index 0000000000000000000000000000000000000000..62d3b75dc5b06632fd5033e5a088cd31b6e8b954 --- /dev/null +++ b/res/icons/noun_178785_cc.svg @@ -0,0 +1,65 @@ +<?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" + style="enable-background:new 0 0 100 100;" + xml:space="preserve" + id="svg2" + inkscape:version="0.91 r13725" + sodipodi:docname="noun_178785_cc.svg"><metadata + id="metadata28"><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="defs26" /><sodipodi:namedview + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1" + objecttolerance="10" + gridtolerance="10" + guidetolerance="10" + inkscape:pageopacity="0" + inkscape:pageshadow="2" + inkscape:window-width="743" + inkscape:window-height="480" + id="namedview24" + showgrid="false" + inkscape:zoom="1.888" + inkscape:cx="58.142293" + inkscape:cy="62.5" + inkscape:window-x="0" + inkscape:window-y="0" + inkscape:window-maximized="0" + inkscape:current-layer="svg2" /><path + d="m 47.7,96 c 4.6,0 8.6,-1.4 11.5,-4.3 l 9.3,-9.3 c 3,-3 4.5,-7.4 4.3,-12.6 -0.1,-1.1 -1,-1.9 -2.1,-1.9 -1.1,0.1 -2,1 -1.9,2.1 0.2,4 -0.9,7.3 -3.1,9.6 -6.7,6.7 -22.4,2.1 -34.4,-9.9 -12,-12 -16.5,-27.8 -9.9,-34.4 5.6,-5.6 17.8,-3.5 29,5.1 0.9,0.7 2.1,0.5 2.8,-0.4 0.7,-0.9 0.5,-2.1 -0.4,-2.8 -13,-10 -27.1,-11.9 -34.3,-4.8 L 9.2,41.7 C 0.7,50.2 5.1,67.8 19.1,81.8 28.3,90.9 39.1,96 47.7,96 Z M 12.2,65.3 18.5,59 c 0.7,1.4 1.6,2.9 2.5,4.3 l -6.4,6.4 c -0.9,-1.5 -1.7,-2.9 -2.4,-4.4 z m -2.8,-8.5 5.9,-5.9 c 0.4,1.4 0.8,2.8 1.4,4.2 l -6.2,6.2 C 10,59.8 9.7,58.3 9.4,56.8 Z m 14,9.8 c 1.1,1.5 2.4,2.9 3.7,4.4 l -6.5,6.5 C 19.3,76.1 18,74.6 16.9,73.1 l 6.5,-6.5 z m 10.8,10.8 -6.5,6.5 c -1.5,-1.1 -2.9,-2.3 -4.3,-3.6 l 6.5,-6.5 c 1.5,1.3 2.9,2.5 4.3,3.6 z m 7.6,5 -6.4,6.4 C 33.9,88.1 32.5,87.3 31,86.3 l 6.4,-6.4 c 1.6,0.9 3,1.7 4.4,2.5 z m -2.3,8 6.2,-6.2 c 1.4,0.6 2.8,1 4.2,1.4 l -6,6 C 43.2,91.5 42.5,91.3 41.8,91.1 41,90.9 40.2,90.6 39.5,90.4 Z m 19.2,-3.9 -2.3,2.3 c -1.8,1.8 -4.2,2.8 -7.2,3.1 l 5.4,-5.4 c 0.8,0.1 1.7,0.1 2.5,0.1 0.5,0 1.1,0 1.6,-0.1 z M 14.4,46.1 9.1,51.4 c 0.3,-2.8 1.2,-5.2 3,-6.9 l 2.3,-2.3 c -0.1,1.3 -0.1,2.6 0,3.9 z" + id="path4" + inkscape:connector-curvature="0" /><path + d="M 98.4,52.7 79.7,33.8 c -0.8,-0.8 -2,-0.8 -2.8,0 -0.4,0.4 -0.6,1 -0.6,1.6 0,0.1 0,0.1 0,0.2 l 0,9.6 -6.4,0 c -1.1,0 -2,0.9 -2,2 0,1.1 0.9,2 2,2 l 8.4,0 c 1.1,0 2,-0.9 2,-2 l 0,-7.1 13.9,14 -13.9,14 0,-6.7 c 0,-1.1 -0.9,-2 -2,-2 l -8.4,0 c -1.1,0 -2,0.9 -2,2 0,1.1 0.9,2 2,2 l 6.4,0 0,9.6 c 0,0 0,0 0,0 0,0.1 0,0.3 0,0.4 0,0.1 0,0.1 0.1,0.2 0,0.1 0,0.1 0.1,0.2 0,0.1 0.1,0.1 0.1,0.2 0,0 0,0.1 0.1,0.1 0.1,0.1 0.2,0.2 0.3,0.3 l 0,0 c 0,0 0,0 0,0 0.1,0.1 0.2,0.2 0.3,0.2 0,0 0.1,0.1 0.1,0.1 0.1,0 0.1,0.1 0.2,0.1 0.1,0 0.1,0 0.2,0.1 0.1,0 0.1,0 0.2,0.1 0.1,0 0.3,0 0.4,0 0.1,0 0.3,0 0.4,0 0.1,0 0.1,0 0.2,-0.1 0.1,0 0.1,0 0.2,-0.1 0.1,0 0.1,-0.1 0.2,-0.1 0.1,0 0.1,0 0.2,-0.1 0.1,-0.1 0.2,-0.2 0.3,-0.3 l 0,0 18.7,-18.8 c 0.6,-0.8 0.6,-2.1 -0.2,-2.8 z" + id="path6" + inkscape:connector-curvature="0" /><path + d="m 63.1,59.3 -4.2,0 c -1.1,0 -2,0.9 -2,2 0,1.1 0.9,2 2,2 l 4.2,0 c 1.1,0 2,-0.9 2,-2 0,-1.1 -0.9,-2 -2,-2 z" + id="path8" + inkscape:connector-curvature="0" /><path + d="m 63.1,45.2 -4.2,0 c -1.1,0 -2,0.9 -2,2 0,1.1 0.9,2 2,2 l 4.2,0 c 1.1,0 2,-0.9 2,-2 0,-1.1 -0.9,-2 -2,-2 z" + id="path10" + inkscape:connector-curvature="0" /><path + d="m 49.5,59.3 -1.8,0 c -1.1,0 -2,0.9 -2,2 0,1.1 0.9,2 2,2 l 1.8,0 c 1.1,0 2,-0.9 2,-2 0,-1.1 -0.9,-2 -2,-2 z" + id="path12" + inkscape:connector-curvature="0" /><path + d="m 49.5,45.2 -1.8,0 c -1.1,0 -2,0.9 -2,2 0,1.1 0.9,2 2,2 l 1.8,0 c 1.1,0 2,-0.9 2,-2 0,-1.1 -0.9,-2 -2,-2 z" + id="path14" + inkscape:connector-curvature="0" /><path + d="m 36.7,59.3 -0.2,0 c -1.1,0 -2,0.9 -2,2 0,1.1 0.9,2 2,2 l 0.2,0 c 1.1,0 2,-0.9 2,-2 0,-1.1 -0.9,-2 -2,-2 z" + id="path16" + inkscape:connector-curvature="0" /><path + d="m 36.7,45.2 -0.2,0 c -1.1,0 -2,0.9 -2,2 0,1.1 0.9,2 2,2 l 0.2,0 c 1.1,0 2,-0.9 2,-2 0,-1.1 -0.9,-2 -2,-2 z" + id="path18" + inkscape:connector-curvature="0" /></svg> \ No newline at end of file diff --git a/res/icons/noun_19900_cc.svg b/res/icons/noun_19900_cc.svg new file mode 100644 index 0000000000000000000000000000000000000000..4eee44fb90a727ea36d57099d0e3c2e12ba46d78 --- /dev/null +++ b/res/icons/noun_19900_cc.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" x="0px" y="0px" viewBox="0 0 100 125" enable-background="new 0 0 100 100" xml:space="preserve"><g><path d="M56.49,47.086c-0.022-0.023-0.04-0.045-0.06-0.066L33.688,24.334c-1.549-1.546-4.052-1.545-5.588-0.001 c-1.537,1.544-1.527,4.052,0.021,5.596l16.344,16.304H3.936C1.754,46.231-0.008,48.003,0,50.188 c0.009,2.185,1.785,3.957,3.967,3.956l40.548,0.001L27.927,70.822c-1.538,1.544-1.527,4.051,0.022,5.595 c1.548,1.546,4.05,1.546,5.587,0l22.567-22.686c0.116-0.119,0.222-0.241,0.32-0.369c0.964-0.722,1.591-1.872,1.585-3.172 C58.006,48.931,57.409,47.81,56.49,47.086z"/><path d="M51.486,63.151l-7.861,7.903v17.939c0,3.433,2.918,6.214,6.519,6.214l7.724-0.002v-7.861l-6.382,0.002V63.151z"/><path d="M51.486,13.406l6.382,0V5.543l-7.724,0c-3.601,0-6.519,2.781-6.519,6.212v17.731l7.861,7.842V13.406z"/><path d="M97.492,8.293L65.182,0.071c-2.04-0.506-3.736,1.751-3.736,5.094v89.679c0,3.326,1.696,5.614,3.736,5.079l32.311-8.22 c1.396-0.352,2.508-2.825,2.508-5.502V13.788C100,11.097,98.888,8.65,97.492,8.293z M74.087,54.922 c-2.72,0-4.924-2.204-4.924-4.922c0-2.72,2.204-4.925,4.924-4.925c2.718,0,4.924,2.205,4.924,4.925 C79.011,52.718,76.805,54.922,74.087,54.922z"/></g><text x="0" y="115" fill="#000000" font-size="5px" font-weight="bold" font-family="'Helvetica Neue', Helvetica, Arial-Unicode, Arial, Sans-serif">Created by Stefan Parnarov</text><text x="0" y="120" fill="#000000" font-size="5px" font-weight="bold" font-family="'Helvetica Neue', Helvetica, Arial-Unicode, Arial, Sans-serif">from the Noun Project</text></svg> \ No newline at end of file diff --git a/res/icons/noun_41979_cc.svg b/res/icons/noun_41979_cc.svg new file mode 100644 index 0000000000000000000000000000000000000000..0f70e6ef4c48aa7df542cc69f0e72c55322a6e5e --- /dev/null +++ b/res/icons/noun_41979_cc.svg @@ -0,0 +1,50 @@ +<?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_41979_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="743" + inkscape:window-height="480" + 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="0" + inkscape:current-layer="svg2" /><rect + width="100" + height="100" + id="rect4" + x="0" + y="12" + style="fill:none" /><path + d="m 29.241,43.591 c 4.499,0 8.16,-3.663 8.16,-8.167 0,-4.494 -3.661,-8.152 -8.16,-8.152 -4.505,0 -8.167,3.659 -8.167,8.152 10e-4,4.504 3.662,8.167 8.167,8.167 z m 0,-13.687 c 3.049,0 5.53,2.477 5.53,5.521 0,3.054 -2.481,5.535 -5.53,5.535 -3.056,0 -5.537,-2.481 -5.537,-5.535 0,-3.044 2.482,-5.521 5.537,-5.521 z m -11.911,32.23 23.821,0 c 0.725,0 1.316,-0.591 1.316,-1.318 l 0,-7.533 c 0,-0.061 -0.007,-0.126 -0.019,-0.188 -0.204,-4.484 -3.98,-8.105 -8.493,-8.105 l -9.445,0 c -4.545,0 -8.361,3.701 -8.495,8.255 0,0.014 0,0.361 0,0.375 l 0,7.195 c 10e-4,0.727 0.588,1.319 1.315,1.319 z m 1.315,-8.809 c 0.094,-3.147 2.728,-5.708 5.866,-5.708 l 9.445,0 c 3.154,0 5.788,2.561 5.87,5.704 0.005,0.099 0.019,0.197 0.042,0.291 l -0.033,5.892 -21.19,0 0,-5.884 -1.315,0 1.315,-0.295 z m 32.038,-19.49 c 0,-0.727 0.584,-1.318 1.315,-1.318 l 23.995,0 c 0.723,0 1.313,0.591 1.313,1.318 0,0.722 -0.591,1.313 -1.313,1.313 l -23.995,0 c -0.731,0 -1.315,-0.591 -1.315,-1.313 z m -4.274,8.86 c 0,-0.727 0.586,-1.313 1.313,-1.313 l 32.542,0 c 0.725,0 1.313,0.586 1.313,1.313 0,0.727 -0.588,1.318 -1.313,1.318 l -32.541,0 c -0.727,0.001 -1.314,-0.591 -1.314,-1.318 z M 16.016,70.638 c 0,-0.727 0.586,-1.318 1.313,-1.318 l 32.542,0 c 0.722,0 1.313,0.592 1.313,1.318 0,0.728 -0.591,1.313 -1.313,1.313 l -32.541,0 c -0.727,0 -1.314,-0.586 -1.314,-1.313 z M 92.294,17 7.707,17 c -1.45,0 -2.63,1.177 -2.63,2.627 l 0,64.68 c 0,1.454 1.18,2.631 2.629,2.631 l 44.487,0 c -2.013,4.265 -3.831,8.617 -5.393,13.073 -0.18,0.517 -0.023,1.089 0.394,1.44 0.422,0.352 1.013,0.412 1.489,0.141 3.021,-1.688 6.098,-3.251 9.164,-4.653 1.205,3.157 2.547,6.281 3.994,9.315 0.223,0.46 0.683,0.746 1.187,0.746 0.021,0 0.047,0 0.072,-0.005 0.528,-0.023 0.99,-0.37 1.171,-0.877 1.536,-4.386 3.368,-8.664 5.398,-12.843 2.018,4.175 3.835,8.452 5.371,12.843 0.176,0.502 0.638,0.849 1.166,0.877 0.026,0.005 0.053,0.005 0.073,0.005 0.505,0 0.964,-0.286 1.187,-0.746 1.431,-2.974 2.768,-6.103 3.99,-9.315 3.077,1.402 6.149,2.965 9.163,4.653 0.476,0.268 1.067,0.216 1.489,-0.136 0.417,-0.353 0.574,-0.929 0.394,-1.445 -1.557,-4.451 -3.36,-8.809 -5.37,-13.073 l 5.162,0 c 1.454,0 2.629,-1.177 2.629,-2.631 l 0,-64.68 C 94.923,18.177 93.748,17 92.294,17 Z m -29.408,85.239 c -1.103,-2.473 -2.13,-4.996 -3.062,-7.529 -0.126,-0.337 -0.389,-0.614 -0.722,-0.755 -0.167,-0.07 -0.341,-0.104 -0.517,-0.104 -0.178,0 -0.358,0.038 -0.527,0.113 -2.533,1.116 -5.075,2.35 -7.592,3.673 2.477,-6.549 5.507,-12.871 8.962,-18.955 1.078,1.243 2.373,2.274 3.837,3.063 1.756,2.801 3.405,5.667 4.925,8.603 -1.962,3.875 -3.764,7.829 -5.304,11.891 z M 61.313,69.817 c 0,-4.602 3.743,-8.345 8.343,-8.345 4.6,0 8.34,3.744 8.34,8.345 0,4.597 -3.74,8.34 -8.34,8.34 -4.6,0 -8.343,-3.743 -8.343,-8.34 z m 19.931,24.148 c -0.325,-0.146 -0.708,-0.15 -1.041,-0.01 -0.335,0.141 -0.598,0.418 -0.72,0.76 -0.945,2.57 -1.973,5.095 -3.054,7.529 -2.512,-6.628 -5.636,-12.994 -9.231,-19.077 0.795,0.146 1.613,0.248 2.458,0.248 4.102,0 7.737,-1.862 10.235,-4.742 3.45,6.089 6.473,12.416 8.949,18.96 -2.516,-1.319 -5.058,-2.552 -7.596,-3.668 z m 8.42,-12.285 -5.178,0 c -0.945,-1.811 -1.938,-3.593 -2.958,-5.361 1.063,-1.942 1.727,-4.138 1.727,-6.501 0,-7.501 -6.103,-13.604 -13.599,-13.604 -7.5,0 -13.603,6.103 -13.603,13.604 0,2.368 0.663,4.563 1.735,6.511 -1.021,1.764 -2.008,3.546 -2.953,5.352 l -44.497,0 0,-59.423 79.326,0 0,59.422 z" + id="path6" + inkscape:connector-curvature="0" /></svg> \ No newline at end of file diff --git a/res/ui/community_tab.ui b/res/ui/community_tab.ui deleted file mode 100644 index 43eb5750042ac2493427e536b2e9837890c72624..0000000000000000000000000000000000000000 --- a/res/ui/community_tab.ui +++ /dev/null @@ -1,147 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<ui version="4.0"> - <class>CommunityTabWidget</class> - <widget class="QWidget" name="CommunityTabWidget"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>636</width> - <height>404</height> - </rect> - </property> - <property name="contextMenuPolicy"> - <enum>Qt::DefaultContextMenu</enum> - </property> - <property name="windowTitle"> - <string>communityTabWidget</string> - </property> - <layout class="QHBoxLayout" name="horizontalLayout"> - <item> - <widget class="QTabWidget" name="tabs_information"> - <property name="currentIndex"> - <number>0</number> - </property> - <property name="iconSize"> - <size> - <width>20</width> - <height>20</height> - </size> - </property> - <property name="elideMode"> - <enum>Qt::ElideNone</enum> - </property> - <widget class="QWidget" name="tab_members"> - <attribute name="icon"> - <iconset resource="../icons/icons.qrc"> - <normaloff>:/icons/members_icon</normaloff>:/icons/members_icon</iconset> - </attribute> - <attribute name="title"> - <string>Identities</string> - </attribute> - <layout class="QVBoxLayout" name="verticalLayout"> - <item> - <layout class="QVBoxLayout" name="verticalLayout_6"> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_3"> - <property name="topMargin"> - <number>0</number> - </property> - <item> - <widget class="QLineEdit" name="edit_textsearch"> - <property name="placeholderText"> - <string>Research a pubkey, an uid...</string> - </property> - </widget> - </item> - <item> - <widget class="QToolButton" name="button_search"> - <property name="text"> - <string>Search</string> - </property> - <property name="popupMode"> - <enum>QToolButton::MenuButtonPopup</enum> - </property> - <property name="toolButtonStyle"> - <enum>Qt::ToolButtonTextBesideIcon</enum> - </property> - </widget> - </item> - </layout> - </item> - <item> - <widget class="QTableView" name="table_identities"> - <property name="contextMenuPolicy"> - <enum>Qt::CustomContextMenu</enum> - </property> - <property name="alternatingRowColors"> - <bool>true</bool> - </property> - <property name="sortingEnabled"> - <bool>true</bool> - </property> - <attribute name="horizontalHeaderShowSortIndicator" stdset="0"> - <bool>true</bool> - </attribute> - <attribute name="horizontalHeaderStretchLastSection"> - <bool>true</bool> - </attribute> - <attribute name="verticalHeaderVisible"> - <bool>false</bool> - </attribute> - </widget> - </item> - </layout> - </item> - </layout> - </widget> - </widget> - </item> - </layout> - </widget> - <resources> - <include location="../icons/icons.qrc"/> - </resources> - <connections> - <connection> - <sender>edit_textsearch</sender> - <signal>returnPressed()</signal> - <receiver>CommunityTabWidget</receiver> - <slot>search_text()</slot> - <hints> - <hint type="sourcelabel"> - <x>170</x> - <y>62</y> - </hint> - <hint type="destinationlabel"> - <x>215</x> - <y>184</y> - </hint> - </hints> - </connection> - <connection> - <sender>button_search</sender> - <signal>clicked()</signal> - <receiver>CommunityTabWidget</receiver> - <slot>search_text()</slot> - <hints> - <hint type="sourcelabel"> - <x>371</x> - <y>62</y> - </hint> - <hint type="destinationlabel"> - <x>215</x> - <y>184</y> - </hint> - </hints> - </connection> - </connections> - <slots> - <slot>identity_context_menu(QPoint)</slot> - <slot>send_membership_demand()</slot> - <slot>send_membership_leaving()</slot> - <slot>search_text()</slot> - <slot>publish_uid()</slot> - <slot>revoke_uid()</slot> - </slots> -</ui> diff --git a/res/ui/community_view.ui b/res/ui/community_view.ui new file mode 100644 index 0000000000000000000000000000000000000000..45b86c534c47c9c4f877f78c6344554a8a402e8d --- /dev/null +++ b/res/ui/community_view.ui @@ -0,0 +1,119 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>CommunityWidget</class> + <widget class="QWidget" name="CommunityWidget"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>624</width> + <height>429</height> + </rect> + </property> + <property name="windowTitle"> + <string>Form</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout"> + <item> + <widget class="QFrame" name="frame"> + <property name="frameShape"> + <enum>QFrame::StyledPanel</enum> + </property> + <property name="frameShadow"> + <enum>QFrame::Raised</enum> + </property> + <layout class="QHBoxLayout" name="horizontalLayout"> + <item> + <widget class="QPushButton" name="button_home"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string/> + </property> + <property name="icon"> + <iconset resource="../icons/icons.qrc"> + <normaloff>:/icons/home_icon</normaloff>:/icons/home_icon</iconset> + </property> + <property name="iconSize"> + <size> + <width>32</width> + <height>32</height> + </size> + </property> + </widget> + </item> + <item> + <widget class="QLabel" name="label_currency"> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="button_send_money"> + <property name="text"> + <string>Send money</string> + </property> + <property name="icon"> + <iconset resource="../icons/icons.qrc"> + <normaloff>:/icons/payment_icon</normaloff>:/icons/payment_icon</iconset> + </property> + <property name="iconSize"> + <size> + <width>32</width> + <height>32</height> + </size> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="button_certification"> + <property name="text"> + <string>Certification</string> + </property> + <property name="icon"> + <iconset resource="../icons/icons.qrc"> + <normaloff>:/icons/certification_icon</normaloff>:/icons/certification_icon</iconset> + </property> + <property name="iconSize"> + <size> + <width>32</width> + <height>32</height> + </size> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="button_membership"> + <property name="text"> + <string>Renew membership</string> + </property> + <property name="icon"> + <iconset resource="../icons/icons.qrc"> + <normaloff>:/icons/renew_membership</normaloff>:/icons/renew_membership</iconset> + </property> + <property name="iconSize"> + <size> + <width>32</width> + <height>32</height> + </size> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QTabWidget" name="tabs"/> + </item> + </layout> + </widget> + <resources> + <include location="../icons/icons.qrc"/> + </resources> + <connections/> +</ui> diff --git a/res/ui/homescreen.ui b/res/ui/homescreen.ui index 9b80e39c6b67b4d0e2e75c4eb0719dbc98729a14..f326a247071175967a5e8908579dd6ec4ee79212 100644 --- a/res/ui/homescreen.ui +++ b/res/ui/homescreen.ui @@ -1,17 +1,17 @@ <?xml version="1.0" encoding="UTF-8"?> <ui version="4.0"> - <class>HomeScreenWidget</class> - <widget class="QWidget" name="HomeScreenWidget"> + <class>HomescreenWidget</class> + <widget class="QWidget" name="HomescreenWidget"> <property name="geometry"> <rect> <x>0</x> <y>0</y> - <width>400</width> - <height>325</height> + <width>648</width> + <height>472</height> </rect> </property> <property name="sizePolicy"> - <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"> + <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> @@ -19,142 +19,174 @@ <property name="windowTitle"> <string>Form</string> </property> - <property name="styleSheet"> - <string notr="true">QLabel { - qproperty-alignment: AlignCenter; -} - -QToolButton { - font-size: 14pt; - font-weight: bold; -}</string> - </property> <layout class="QVBoxLayout" name="verticalLayout"> <item> - <spacer name="verticalSpacer_2"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>40</height> - </size> + <widget class="QFrame" name="frame_connected"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Maximum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> </property> - </spacer> - </item> - <item> - <widget class="QLabel" name="label_welcome"> - <property name="text"> - <string><html><head/><body><p><br/></p></body></html></string> + <property name="frameShape"> + <enum>QFrame::StyledPanel</enum> </property> - <property name="textFormat"> - <enum>Qt::RichText</enum> - </property> - <property name="openExternalLinks"> - <bool>true</bool> + <property name="frameShadow"> + <enum>QFrame::Raised</enum> </property> + <layout class="QHBoxLayout" name="horizontalLayout"> + <property name="sizeConstraint"> + <enum>QLayout::SetMaximumSize</enum> + </property> + <item> + <widget class="QLabel" name="label_connected"> + <property name="styleSheet"> + <string notr="true"> font-size:12pt; font-weight:600;</string> + </property> + <property name="text"> + <string>Connected as</string> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="button_add_community"> + <property name="text"> + <string>Add a community</string> + </property> + <property name="icon"> + <iconset resource="../icons/icons.qrc"> + <normaloff>:/icons/add_community</normaloff>:/icons/add_community</iconset> + </property> + <property name="iconSize"> + <size> + <width>32</width> + <height>32</height> + </size> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="button_disconnect"> + <property name="text"> + <string>Disconnect</string> + </property> + <property name="icon"> + <iconset resource="../icons/icons.qrc"> + <normaloff>:/icons/logout</normaloff>:/icons/logout</iconset> + </property> + <property name="iconSize"> + <size> + <width>32</width> + <height>32</height> + </size> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + </layout> </widget> </item> <item> - <layout class="QHBoxLayout" name="horizontalLayout"> - <property name="topMargin"> - <number>6</number> - </property> - <item> - <widget class="QToolButton" name="button_new"> - <property name="text"> - <string>Create a new account</string> - </property> - <property name="icon"> - <iconset resource="../icons/icons.qrc"> - <normaloff>:/icons/add_account_icon</normaloff>:/icons/add_account_icon</iconset> - </property> - <property name="iconSize"> - <size> - <width>32</width> - <height>32</height> - </size> - </property> - <property name="toolButtonStyle"> - <enum>Qt::ToolButtonTextBesideIcon</enum> - </property> - <property name="autoRaise"> - <bool>false</bool> - </property> - <property name="arrowType"> - <enum>Qt::NoArrow</enum> - </property> - </widget> - </item> - </layout> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_2"> - <property name="topMargin"> - <number>6</number> + <widget class="QFrame" name="frame_disconnected"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Maximum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> </property> - <item> - <widget class="QToolButton" name="button_import"> - <property name="text"> - <string>Import an existing account</string> - </property> - <property name="icon"> - <iconset resource="../icons/icons.qrc"> - <normaloff>:/icons/import_icon</normaloff>:/icons/import_icon</iconset> - </property> - <property name="iconSize"> - <size> - <width>32</width> - <height>32</height> - </size> - </property> - <property name="toolButtonStyle"> - <enum>Qt::ToolButtonTextBesideIcon</enum> - </property> - </widget> - </item> - </layout> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_3"> - <property name="topMargin"> - <number>6</number> + <property name="frameShape"> + <enum>QFrame::StyledPanel</enum> </property> - <item> - <widget class="QToolButton" name="button_info"> - <property name="text"> - <string>Get to know more about ucoin</string> - </property> - <property name="icon"> - <iconset resource="../icons/icons.qrc"> - <normaloff>:/icons/ucoin_info_icon</normaloff>:/icons/ucoin_info_icon</iconset> - </property> - <property name="iconSize"> - <size> - <width>32</width> - <height>32</height> - </size> - </property> - <property name="toolButtonStyle"> - <enum>Qt::ToolButtonTextBesideIcon</enum> - </property> - </widget> - </item> - </layout> - </item> - <item> - <spacer name="verticalSpacer"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>40</height> - </size> + <property name="frameShadow"> + <enum>QFrame::Raised</enum> </property> - </spacer> + <layout class="QHBoxLayout" name="horizontalLayout_2"> + <item> + <widget class="QLabel" name="label_disconnected"> + <property name="text"> + <string><html><head/><body><p><span style=" font-size:12pt; font-weight:600;">Not Connected</span></p></body></html></string> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="toolbutton_connect"> + <property name="text"> + <string>Connect</string> + </property> + <property name="icon"> + <iconset resource="../icons/icons.qrc"> + <normaloff>:/icons/connect_icon</normaloff>:/icons/connect_icon</iconset> + </property> + <property name="iconSize"> + <size> + <width>32</width> + <height>32</height> + </size> + </property> + <property name="popupMode"> + <enum>QToolButton::MenuButtonPopup</enum> + </property> + <property name="toolButtonStyle"> + <enum>Qt::ToolButtonTextBesideIcon</enum> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="toolbutton_new_account"> + <property name="text"> + <string>New account</string> + </property> + <property name="icon"> + <iconset resource="../icons/icons.qrc"> + <normaloff>:/icons/add_account_icon</normaloff>:/icons/add_account_icon</iconset> + </property> + <property name="iconSize"> + <size> + <width>32</width> + <height>32</height> + </size> + </property> + <property name="popupMode"> + <enum>QToolButton::MenuButtonPopup</enum> + </property> + <property name="toolButtonStyle"> + <enum>Qt::ToolButtonTextBesideIcon</enum> + </property> + <property name="autoRaise"> + <bool>false</bool> + </property> + <property name="arrowType"> + <enum>Qt::NoArrow</enum> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_5"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + </layout> + </widget> </item> </layout> </widget> diff --git a/res/ui/identities_tab.ui b/res/ui/identities_tab.ui new file mode 100644 index 0000000000000000000000000000000000000000..5f3f2e072c5778a32cbea7c6f2bfc1b77a0750c5 --- /dev/null +++ b/res/ui/identities_tab.ui @@ -0,0 +1,70 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>IdentitiesTab</class> + <widget class="QWidget" name="IdentitiesTab"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>400</width> + <height>300</height> + </rect> + </property> + <property name="windowTitle"> + <string>Form</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout"> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_3"> + <property name="topMargin"> + <number>0</number> + </property> + <item> + <widget class="QLineEdit" name="edit_textsearch"> + <property name="placeholderText"> + <string>Research a pubkey, an uid...</string> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="button_search"> + <property name="text"> + <string>Search</string> + </property> + <property name="popupMode"> + <enum>QToolButton::MenuButtonPopup</enum> + </property> + <property name="toolButtonStyle"> + <enum>Qt::ToolButtonTextBesideIcon</enum> + </property> + </widget> + </item> + </layout> + </item> + <item> + <widget class="QTableView" name="table_identities"> + <property name="contextMenuPolicy"> + <enum>Qt::CustomContextMenu</enum> + </property> + <property name="alternatingRowColors"> + <bool>true</bool> + </property> + <property name="sortingEnabled"> + <bool>true</bool> + </property> + <attribute name="horizontalHeaderShowSortIndicator" stdset="0"> + <bool>true</bool> + </attribute> + <attribute name="horizontalHeaderStretchLastSection"> + <bool>true</bool> + </attribute> + <attribute name="verticalHeaderVisible"> + <bool>false</bool> + </attribute> + </widget> + </item> + </layout> + </widget> + <resources/> + <connections/> +</ui> diff --git a/res/ui/mainwindow.ui b/res/ui/mainwindow.ui index 10a981179bce626465efa75b0e808ce99f8672bb..f30bd087938b923932b71797e41fda4dc494a2ec 100644 --- a/res/ui/mainwindow.ui +++ b/res/ui/mainwindow.ui @@ -14,18 +14,7 @@ <string notr="true">CuteCoin</string> </property> <widget class="QWidget" name="centralwidget"> - <layout class="QVBoxLayout" name="verticalLayout_6"> - <item> - <widget class="QTabWidget" name="currencies_tabwidget"> - <property name="iconSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - </widget> - </item> - </layout> + <layout class="QVBoxLayout" name="verticalLayout_6"/> </widget> <widget class="QMenuBar" name="menubar"> <property name="geometry"> @@ -33,7 +22,7 @@ <x>0</x> <y>0</y> <width>681</width> - <height>25</height> + <height>29</height> </rect> </property> <widget class="QMenu" name="menu_file"> @@ -48,11 +37,11 @@ </widget> <widget class="QMenu" name="menu_account"> <property name="title"> - <string>Account</string> + <string>Acco&unt</string> </property> <widget class="QMenu" name="menu_contacts_list"> <property name="title"> - <string>&Contacts</string> + <string>Co&ntacts</string> </property> <addaction name="separator"/> </widget> @@ -94,7 +83,7 @@ </action> <action name="action_add_a_contact"> <property name="text"> - <string>&Add a contact</string> + <string>A&dd a contact</string> </property> </action> <action name="actionSend_a_message"> @@ -164,7 +153,7 @@ </action> <action name="actionCertification"> <property name="text"> - <string>&Certification</string> + <string>C&ertification</string> </property> </action> <action name="action_set_as_default"> diff --git a/res/ui/wallets_tab.ui b/res/ui/wallets_tab.ui index cef471bfba54f06dc89fb6eaa1b6d7ee03a642d8..16b4dd1c96d212b9773b06a202151676c417af27 100644 --- a/res/ui/wallets_tab.ui +++ b/res/ui/wallets_tab.ui @@ -29,91 +29,6 @@ QGroupBox::title { </property> <layout class="QGridLayout" name="gridLayout"> <item row="0" column="0"> - <widget class="QGroupBox" name="groupBox"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="styleSheet"> - <string notr="true"/> - </property> - <property name="title"> - <string>Account</string> - </property> - <property name="flat"> - <bool>true</bool> - </property> - <layout class="QGridLayout" name="gridLayout_2"> - <item row="0" column="0"> - <widget class="QLabel" name="label_general"> - <property name="text"> - <string>label_general</string> - </property> - <property name="textFormat"> - <enum>Qt::RichText</enum> - </property> - <property name="alignment"> - <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> - </property> - </widget> - </item> - <item row="1" column="0"> - <layout class="QHBoxLayout" name="horizontalLayout_2"> - <property name="leftMargin"> - <number>0</number> - </property> - <property name="topMargin"> - <number>5</number> - </property> - <item> - <spacer name="horizontalSpacer"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QPushButton" name="button_publish_uid"> - <property name="text"> - <string>Publish UID</string> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="button_revoke_uid"> - <property name="text"> - <string>Revoke UID</string> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="button_membership"> - <property name="text"> - <string>Renew membership</string> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="button_leaving"> - <property name="text"> - <string>Send leaving demand</string> - </property> - </widget> - </item> - </layout> - </item> - </layout> - </widget> - </item> - <item row="1" column="0"> <widget class="QGroupBox" name="groupBox_2"> <property name="title"> <string>Balance</string> @@ -149,7 +64,7 @@ QGroupBox::title { </layout> </widget> </item> - <item row="2" column="0"> + <item row="1" column="0"> <widget class="QTableView" name="table_wallets"> <property name="sizePolicy"> <sizepolicy hsizetype="Expanding" vsizetype="Preferred"> @@ -202,70 +117,6 @@ QGroupBox::title { </hint> </hints> </connection> - <connection> - <sender>button_publish_uid</sender> - <signal>clicked()</signal> - <receiver>WalletsTab</receiver> - <slot>publish_uid()</slot> - <hints> - <hint type="sourcelabel"> - <x>430</x> - <y>69</y> - </hint> - <hint type="destinationlabel"> - <x>461</x> - <y>459</y> - </hint> - </hints> - </connection> - <connection> - <sender>button_revoke_uid</sender> - <signal>clicked()</signal> - <receiver>WalletsTab</receiver> - <slot>revoke_uid()</slot> - <hints> - <hint type="sourcelabel"> - <x>533</x> - <y>69</y> - </hint> - <hint type="destinationlabel"> - <x>461</x> - <y>459</y> - </hint> - </hints> - </connection> - <connection> - <sender>button_membership</sender> - <signal>clicked()</signal> - <receiver>WalletsTab</receiver> - <slot>send_membership_demand()</slot> - <hints> - <hint type="sourcelabel"> - <x>662</x> - <y>69</y> - </hint> - <hint type="destinationlabel"> - <x>461</x> - <y>459</y> - </hint> - </hints> - </connection> - <connection> - <sender>button_leaving</sender> - <signal>clicked()</signal> - <receiver>WalletsTab</receiver> - <slot>send_membership_leaving()</slot> - <hints> - <hint type="sourcelabel"> - <x>823</x> - <y>69</y> - </hint> - <hint type="destinationlabel"> - <x>461</x> - <y>459</y> - </hint> - </hints> - </connection> </connections> <slots> <slot>wallet_context_menu(QPoint)</slot> diff --git a/src/cutecoin/core/app.py b/src/cutecoin/core/app.py index 625f4a893823bdd8eea9398eae2c552919107ad3..5ad77ced20ad7475e7ae18c69d3bedb6b9bf794d 100644 --- a/src/cutecoin/core/app.py +++ b/src/cutecoin/core/app.py @@ -178,7 +178,8 @@ class Application(QObject): self.stop_current_account() self.current_account = account - self.current_account.start_coroutines() + if self.current_account is not None: + self.current_account.start_coroutines() def stop_current_account(self): """ diff --git a/src/cutecoin/core/net/network.py b/src/cutecoin/core/net/network.py index ae81700fe2d5e0d4ed8d9a710df1e78a47877831..4cbd8c10617763df2e36fb88712a8ebff870785b 100644 --- a/src/cutecoin/core/net/network.py +++ b/src/cutecoin/core/net/network.py @@ -251,7 +251,7 @@ class Network(QObject): fork_windows = [n.fork_window for n in self.online_nodes if n.software != "" and n.pubkey in members_pubkeys] if len(fork_windows) > 0: - return statistics.median(fork_windows) + return int(statistics.median(fork_windows)) else: return 0 diff --git a/src/cutecoin/core/net/node.py b/src/cutecoin/core/net/node.py index 811b89bf0747f39839e015d7d401eccbd8349eee..38aaf17d5989986e0a063ba1af6f72d8b3e359ec 100644 --- a/src/cutecoin/core/net/node.py +++ b/src/cutecoin/core/net/node.py @@ -72,7 +72,6 @@ class Node(QObject): def handle_reply(reply): if reply.error() == QNetworkReply.NoError: strdata = bytes(reply.readAll()).decode('utf-8') - logging.debug(strdata) nonlocal peer_data peer_data = json.loads(strdata) future_reply.set_result(True) @@ -95,7 +94,7 @@ class Node(QObject): node = cls(network_manager, peer.currency, [Endpoint.from_inline(e.inline()) for e in peer.endpoints], - "", peer.pubkey, 0, qtbma.blockchain.Block.null_value, time.time(), + "", peer.pubkey, qtbma.blockchain.Block.null_value, Node.ONLINE, time.time(), {'root': "", 'leaves': []}, "", "", 0) logging.debug("Node from address : {:}".format(str(node))) return node @@ -470,5 +469,5 @@ class Node(QObject): self.changed.emit() def __str__(self): - return ','.join([str(self.pubkey), str(self.endpoint.server), str(self.endpoint.port), str(self.block['number']), + return ','.join([str(self.pubkey), str(self.endpoint.server), str(self.endpoint.ipv4), str(self.endpoint.port), str(self.block['number']), str(self.currency), str(self.state), str(self.neighbours)]) diff --git a/src/cutecoin/gui/certification.py b/src/cutecoin/gui/certification.py index c76f14682aa9f91552e17b74bd69e54d25a2f0e3..ca55ef33781e335ca926c64beb068f5425cc433a 100644 --- a/src/cutecoin/gui/certification.py +++ b/src/cutecoin/gui/certification.py @@ -16,7 +16,7 @@ class CertificationDialog(QDialog, Ui_CertificationDialog): classdocs """ - def __init__(self, certifier, app, password_asker): + def __init__(self, app, certifier, password_asker): """ Constructor """ diff --git a/src/cutecoin/gui/community_tile.py b/src/cutecoin/gui/community_tile.py new file mode 100644 index 0000000000000000000000000000000000000000..04fbedc875f7dd77d9e2bd92616f12c23382fd34 --- /dev/null +++ b/src/cutecoin/gui/community_tile.py @@ -0,0 +1,64 @@ +""" +@author: inso +""" + +from PyQt5.QtWidgets import QFrame, QLabel, QVBoxLayout, QLayout, QPushButton +from PyQt5.QtGui import QPalette +from PyQt5.QtCore import QEvent, QSize, pyqtSignal + + +class CommunityTile(QFrame): + clicked = pyqtSignal() + + def __init__(self, parent, app, community): + super().__init__(parent) + self.app = app + self.community = community + self.community.inner_data_changed.connect(self.refresh) + self.text_label = QLabel() + self.setLayout(QVBoxLayout()) + self.layout().setSizeConstraint(QLayout.SetFixedSize) + self.layout().addWidget(self.text_label) + self.setFrameShape(QFrame.StyledPanel) + self.setFrameShadow(QFrame.Raised) + self.refresh() + + def sizeHint(self): + return QSize(250, 250) + + def refresh(self): + current_block = self.community.get_block(self.community.network.latest_block_number) + status = self.tr("Member") if self.app.current_account.pubkey in self.community.members_pubkeys() \ + else self.tr("Non-Member") + description = """<html> + <body> + <p> + <span style=" font-size:16pt; font-weight:600;">{currency}</span> + </p> + <p>{nb_members} {members_label}</p> + <p><span style=" font-weight:600;">{monetary_mass_label}</span> : {monetary_mass}</p> + <p><span style=" font-weight:600;">{status_label}</span> : {status}</p> + <p><span style=" font-weight:600;">{balance_label}</span> : {balance}</p> + </body> + </html>""".format(currency=self.community.currency, + nb_members=len(self.community.members_pubkeys()), + members_label=self.tr("members"), + monetary_mass_label=self.tr("Monetary mass"), + monetary_mass=current_block['monetaryMass'], + status_label=self.tr("Status"), + status=status, + balance_label=self.tr("Balance"), + balance=self.app.current_account.amount(self.community)) + self.text_label.setText(description) + + def mousePressEvent(self, event): + self.clicked.emit() + return super().mousePressEvent(event) + + def enterEvent(self, event): + self.setStyleSheet("color: rgb(0, 115, 173);") + return super().enterEvent(event) + + def leaveEvent(self, event): + self.setStyleSheet("") + return super().leaveEvent(event) \ No newline at end of file diff --git a/src/cutecoin/gui/community_view.py b/src/cutecoin/gui/community_view.py new file mode 100644 index 0000000000000000000000000000000000000000..de3563c1a8c8e1aa1a241d5f05e3065b268076c6 --- /dev/null +++ b/src/cutecoin/gui/community_view.py @@ -0,0 +1,302 @@ +""" +Created on 2 févr. 2014 + +@author: inso +""" + +import time +import logging +from PyQt5.QtWidgets import QWidget, QMessageBox, QDialog +from PyQt5.QtCore import QModelIndex, pyqtSlot, QDateTime, QLocale, QEvent +from PyQt5.QtGui import QIcon + +from ..core.net.api import bma as qtbma +from .wot_tab import WotTabWidget +from .identities_tab import IdentitiesTabWidget +from .transactions_tab import TransactionsTabWidget +from .network_tab import NetworkTabWidget +from . import toast +import asyncio +from ..tools.exceptions import MembershipNotFoundError, LookupFailureError +from ..gen_resources.community_view_uic import Ui_CommunityWidget + + +class CommunityWidget(QWidget, Ui_CommunityWidget): + + """ + classdocs + """ + + def __init__(self, app, status_label): + """ + Constructor + """ + super().__init__() + self.app = app + self.community = None + self.password_asker = None + self.status_label = status_label + + self.status_info = [] + self.status_infotext = {'membership_expire_soon': + self.tr("Warning : Your membership is expiring soon."), + 'warning_certifications': + self.tr("Warning : Your could miss certifications soon.") + } + + super().setupUi(self) + + self.tab_wot = WotTabWidget(self.app) + + self.tab_identities = IdentitiesTabWidget(self.app) + + self.tab_history = TransactionsTabWidget(self.app) + + self.tab_network = NetworkTabWidget(self.app) + + self.tabs.addTab(self.tab_history, + QIcon(':/icons/tx_icon'), + self.tr("Transactions")) + + self.tabs.addTab(self.tab_wot, + QIcon(':/icons/wot_icon'), + self.tr("Web of Trust")) + + self.tabs.addTab(self.tab_identities, + QIcon(':/icons/members_icon'), + self.tr("Search Identities")) + + self.tabs.addTab(self.tab_network, + QIcon(":/icons/network_icon"), + self.tr("Network")) + + def change_account(self, account): + self.account = account + self.tab_wot.change_account(account) + self.tab_identities.change_account(account) + + def change_community(self, community): + self.tab_network.change_community(community) + self.tab_wot.change_community(community) + self.tab_history.change_community(community) + self.tab_identities.change_community(community) + + if self.community: + self.community.network.new_block_mined.disconnect(self.refresh_block) + self.community.network.nodes_changed.disconnect(self.refresh_status) + self.community.inner_data_changed.disconnect(self.refresh_status) + if community: + community.network.new_block_mined.connect(self.refresh_block) + community.network.nodes_changed.connect(self.refresh_status) + community.inner_data_changed.connect(self.refresh_status) + self.label_currency.setText(community.currency) + self.community = community + self.refresh_quality_buttons() + + @pyqtSlot(str) + def display_error(self, error): + QMessageBox.critical(self, ":(", + error, + QMessageBox.Ok) + + @pyqtSlot(int) + def refresh_block(self, block_number): + """ + When a new block is found, start handling data. + @param: block_number: The number of the block mined + """ + logging.debug("Refresh block") + self.status_info.clear() + try: + person = self.app.identities_registry.find(self.app.current_account.pubkey, self.community) + expiration_time = person.membership_expiration_time(self.community) + sig_validity = self.community.parameters['sigValidity'] + warning_expiration_time = int(sig_validity / 3) + will_expire_soon = (expiration_time < warning_expiration_time) + + logging.debug("Try") + if will_expire_soon: + days = int(expiration_time / 3600 / 24) + if days > 0: + self.status_info.append('membership_expire_soon') + + if self.app.preferences['notifications']: + toast.display(self.tr("Membership expiration"), + self.tr("<b>Warning : Membership expiration in {0} days</b>").format(days)) + + certifiers_of = person.unique_valid_certifiers_of(self.app.identities_registry, self.community) + if len(certifiers_of) < self.community.parameters['sigQty']: + self.status_info.append('warning_certifications') + if self.app.preferences['notifications']: + toast.display(self.tr("Certifications number"), + self.tr("<b>Warning : You are certified by only {0} persons, need {1}</b>") + .format(len(certifiers_of), + self.community.parameters['sigQty'])) + + except MembershipNotFoundError as e: + pass + + self.tab_history.start_progress() + self.refresh_data() + + def refresh_quality_buttons(self): + pass + + def refresh_data(self): + """ + Refresh data when the blockchain watcher finished handling datas + """ + self.tab_history.refresh_balance() + self.refresh_status() + + @pyqtSlot() + def refresh_status(self): + """ + Refresh status bar + """ + logging.debug("Refresh status") + if self.community: + text = self.tr(" Block {0}").format(self.community.network.latest_block_number) + + block = self.community.get_block(self.community.network.latest_block_number) + if block != qtbma.blockchain.Block.null_value: + text += " ( {0} )".format(QLocale.toString( + QLocale(), + QDateTime.fromTime_t(block['medianTime']), + QLocale.dateTimeFormat(QLocale(), QLocale.NarrowFormat) + )) + + if self.community.network.quality > 0.66: + icon = '<img src=":/icons/connected" width="12" height="12"/>' + elif self.community.network.quality > 0.33: + icon = '<img src=":/icons/weak_connect" width="12" height="12"/>' + else: + icon = '<img src=":/icons/disconnected" width="12" height="12"/>' + status_infotext = " - ".join([self.status_infotext[info] for info in self.status_info]) + label_text = "{0}{1}".format(icon, text) + if status_infotext != "": + label_text += " - {0}".format(status_infotext) + + if self.app.preferences['expert_mode']: + label_text += self.tr(" - Median fork window : {0}").format(self.community.network.fork_window(self.community.members_pubkeys())) + + self.status_label.setText(label_text) + + def refresh_quality_buttons(self): + if self.account and self.community: + try: + if self.account.identity(self.community).published_uid(self.community): + logging.debug("UID Published") + if self.account.identity(self.community).is_member(self.community): + self.button_membership.setText(self.tr("Renew membership")) + self.button_membership.show() + self.button_certification.show() + else: + logging.debug("Not a member") + self.button_membership.setText(self.tr("Send membership demand")) + self.button_membership.show() + self.button_certification.hide() + else: + logging.debug("UID not published") + self.button_membership.hide() + self.button_certification.hide() + except LookupFailureError: + self.button_membership.hide() + self.button_certification.hide() + + def showEvent(self, event): + self.refresh_status() + + def referential_changed(self): + if self.community and self.tab_history.table_history.model(): + self.tab_history.table_history.model().dataChanged.emit( + QModelIndex(), + QModelIndex(), + []) + self.tab_history.refresh_balance() + + def send_membership_demand(self): + password = self.password_asker.exec_() + if self.password_asker.result() == QDialog.Rejected: + return + asyncio.async(self.account.send_membership(password, self.community, 'IN')) + + def send_membership_leaving(self): + reply = QMessageBox.warning(self, self.tr("Warning"), + self.tr("""Are you sure ? +Sending a leaving demand cannot be canceled. +The process to join back the community later will have to be done again.""") +.format(self.account.pubkey), QMessageBox.Ok | QMessageBox.Cancel) + if reply == QMessageBox.Ok: + password = self.password_asker.exec_() + if self.password_asker.result() == QDialog.Rejected: + return + + asyncio.async(self.account.send_membership(password, self.community, 'OUT')) + + def publish_uid(self): + reply = QMessageBox.warning(self, self.tr("Warning"), + self.tr("""Are you sure ? +Publishing your UID can be canceled by Revoke UID.""") +.format(self.account.pubkey), QMessageBox.Ok | QMessageBox.Cancel) + if reply == QMessageBox.Ok: + password = self.password_asker.exec_() + if self.password_asker.result() == QDialog.Rejected: + return + + try: + self.account.send_selfcert(password, self.community) + toast.display(self.tr("UID Publishing"), + self.tr("Success publishing your UID")) + except ValueError as e: + QMessageBox.critical(self, self.tr("Publish UID error"), + str(e)) + except NoPeerAvailable as e: + QMessageBox.critical(self, self.tr("Network error"), + self.tr("Couldn't connect to network : {0}").format(e), + QMessageBox.Ok) + except Exception as e: + QMessageBox.critical(self, self.tr("Error"), + "{0}".format(e), + QMessageBox.Ok) + + def revoke_uid(self): + reply = QMessageBox.warning(self, self.tr("Warning"), + self.tr("""Are you sure ? +Revoking your UID can only success if it is not already validated by the network.""") +.format(self.account.pubkey), QMessageBox.Ok | QMessageBox.Cancel) + if reply == QMessageBox.Ok: + password = self.password_asker.exec_() + if self.password_asker.result() == QDialog.Rejected: + return + + asyncio.async(self.account.revoke(password, self.community)) + + def handle_membership_broadcasted(self): + if self.app.preferences['notifications']: + toast.display(self.tr("Membership"), self.tr("Success sending Membership demand")) + else: + QMessageBox.information(self, self.tr("Membership"), self.tr("Success sending Membership demand")) + + def handle_revoke_broadcasted(self): + if self.app.preferences['notifications']: + toast.display(self.tr("Revoke"), self.tr("Success sending Revoke demand")) + else: + QMessageBox.information(self, self.tr("Revoke"), self.tr("Success sending Revoke demand")) + + def handle_selfcert_broadcasted(self): + if self.app.preferences['notifications']: + toast.display(self.tr("Self Certification"), self.tr("Success sending Self Certification document")) + else: + QMessageBox.information(self.tr("Self Certification"), self.tr("Success sending Self Certification document")) + + def changeEvent(self, event): + """ + Intercepte LanguageChange event to translate UI + :param QEvent QEvent: Event + :return: + """ + if event.type() == QEvent.LanguageChange: + self.retranslateUi(self) + self.refresh_status() + return super(CommunityWidget, self).changeEvent(event) diff --git a/src/cutecoin/gui/currency_tab.py b/src/cutecoin/gui/currency_tab.py deleted file mode 100644 index 7394d39b7cb35cfc30bdf28bb27aef33978a4003..0000000000000000000000000000000000000000 --- a/src/cutecoin/gui/currency_tab.py +++ /dev/null @@ -1,215 +0,0 @@ -""" -Created on 2 févr. 2014 - -@author: inso -""" - -import time -import logging -from PyQt5.QtWidgets import QWidget, QMessageBox -from PyQt5.QtCore import QModelIndex, pyqtSlot, QDateTime, QLocale, QEvent -from PyQt5.QtGui import QIcon -from ..gen_resources.currency_tab_uic import Ui_CurrencyTabWidget - -from ..core.net.api import bma as qtbma -from .community_tab import CommunityTabWidget -from .wallets_tab import WalletsTabWidget -from .transactions_tab import TransactionsTabWidget -from .network_tab import NetworkTabWidget -from .informations_tab import InformationsTabWidget -from . import toast -import asyncio -from ..tools.exceptions import MembershipNotFoundError, NoPeerAvailable -from ..core.registry import IdentitiesRegistry - - -class CurrencyTabWidget(QWidget, Ui_CurrencyTabWidget): - - """ - classdocs - """ - - def __init__(self, app, community, password_asker, status_label): - """ - Constructor - """ - super().__init__() - self.app = app - self.community = community - self.password_asker = password_asker - self.status_label = status_label - - self.status_info = [] - self.status_infotext = {'membership_expire_soon': - self.tr("Warning : Your membership is expiring soon."), - 'warning_certifications': - self.tr("Warning : Your could miss certifications soon.") - } - - super().setupUi(self) - - self.tab_community = CommunityTabWidget(self.app, - self.app.current_account, - self.community, - self.password_asker, - self) - - self.tab_wallets = WalletsTabWidget(self.app, - self.app.current_account, - self.community, - self.password_asker) - - self.tab_history = TransactionsTabWidget(self.app, - self.community, - self.password_asker, - self) - - self.tab_informations = InformationsTabWidget(self.app, - self.community) - - self.tab_network = NetworkTabWidget(self.app, - self.community) - - self.tabs_account.addTab(self.tab_wallets, - QIcon(':/icons/wallet_icon'), - self.tr("Wallets")) - - self.tabs_account.addTab(self.tab_history, - QIcon(':/icons/tx_icon'), - self.tr("Transactions")) - - self.tabs_account.addTab(self.tab_community, - QIcon(':/icons/community_icon'), - self.tr("Community")) - - self.tabs_account.addTab(self.tab_network, - QIcon(":/icons/network_icon"), - self.tr("Network")) - - self.tabs_account.addTab(self.tab_informations, - QIcon(':/icons/informations_icon'), - self.tr("Informations")) - - self.community.network.new_block_mined.connect(self.refresh_block) - self.community.network.nodes_changed.connect(self.refresh_status) - self.community.inner_data_changed.connect(self.refresh_status) - - @pyqtSlot(str) - def display_error(self, error): - QMessageBox.critical(self, ":(", - error, - QMessageBox.Ok) - - @pyqtSlot(int) - def refresh_block(self, block_number): - """ - When a new block is found, start handling data. - @param: block_number: The number of the block mined - """ - logging.debug("Refresh block") - self.status_info.clear() - try: - person = self.app.identities_registry.find(self.app.current_account.pubkey, self.community) - expiration_time = person.membership_expiration_time(self.community) - sig_validity = self.community.parameters['sigValidity'] - warning_expiration_time = int(sig_validity / 3) - will_expire_soon = (expiration_time < warning_expiration_time) - - logging.debug("Try") - if will_expire_soon: - days = int(expiration_time / 3600 / 24) - if days > 0: - self.status_info.append('membership_expire_soon') - - if self.app.preferences['notifications']: - toast.display(self.tr("Membership expiration"), - self.tr("<b>Warning : Membership expiration in {0} days</b>").format(days)) - - certifiers_of = person.unique_valid_certifiers_of(self.app.identities_registry, self.community) - if len(certifiers_of) < self.community.parameters['sigQty']: - self.status_info.append('warning_certifications') - if self.app.preferences['notifications']: - toast.display(self.tr("Certifications number"), - self.tr("<b>Warning : You are certified by only {0} persons, need {1}</b>") - .format(len(certifiers_of), - self.community.parameters['sigQty'])) - - except MembershipNotFoundError as e: - pass - - self.tab_history.start_progress() - self.refresh_data() - - def refresh_wallets(self): - if self.tab_wallets: - self.tab_wallets.refresh() - - def refresh_data(self): - """ - Refresh data when the blockchain watcher finished handling datas - """ - if self.tab_wallets: - self.tab_wallets.refresh() - - self.tab_history.refresh_balance() - self.refresh_status() - - @pyqtSlot() - def refresh_status(self): - """ - Refresh status bar - """ - logging.debug("Refresh status") - text = self.tr(" Block {0}").format(self.community.network.latest_block_number) - - block = self.community.get_block(self.community.network.latest_block_number) - if block != qtbma.blockchain.Block.null_value: - text += " ( {0} )".format(QLocale.toString( - QLocale(), - QDateTime.fromTime_t(block['medianTime']), - QLocale.dateTimeFormat(QLocale(), QLocale.NarrowFormat) - )) - - if self.community.network.quality > 0.66: - icon = '<img src=":/icons/connected" width="12" height="12"/>' - elif self.community.network.quality > 0.33: - icon = '<img src=":/icons/weak_connect" width="12" height="12"/>' - else: - icon = '<img src=":/icons/disconnected" width="12" height="12"/>' - status_infotext = " - ".join([self.status_infotext[info] for info in self.status_info]) - label_text = "{0}{1}".format(icon, text) - if status_infotext != "": - label_text += " - {0}".format(status_infotext) - - if self.app.preferences['expert_mode']: - label_text += self.tr(" - Median fork window : {0}").format(self.community.network.fork_window(self.community.members_pubkeys())) - - self.status_label.setText(label_text) - - def showEvent(self, event): - self.refresh_status() - - def referential_changed(self): - if self.tab_history.table_history.model(): - self.tab_history.table_history.model().dataChanged.emit( - QModelIndex(), - QModelIndex(), - []) - self.tab_history.refresh_balance() - - if self.tab_wallets: - self.tab_wallets.refresh() - - if self.tab_informations: - self.tab_informations.refresh() - - def changeEvent(self, event): - """ - Intercepte LanguageChange event to translate UI - :param QEvent QEvent: Event - :return: - """ - if event.type() == QEvent.LanguageChange: - self.retranslateUi(self) - self.refresh_status() - return super(CurrencyTabWidget, self).changeEvent(event) diff --git a/src/cutecoin/gui/homescreen.py b/src/cutecoin/gui/homescreen.py index 535bb29887bc6383a2a28bf40a276d6fd7128812..cc4db8af1d720f695d6933d851a4d3efac4dff34 100644 --- a/src/cutecoin/gui/homescreen.py +++ b/src/cutecoin/gui/homescreen.py @@ -4,14 +4,46 @@ Created on 31 janv. 2015 @author: vit """ -from PyQt5.QtWidgets import QWidget -from PyQt5.QtCore import QEvent -from ..gen_resources.homescreen_uic import Ui_HomeScreenWidget -from ..__init__ import __version__ -from . import toast +from PyQt5.QtWidgets import QWidget, QFrame, QGridLayout, QAction +from PyQt5.QtCore import QEvent, Qt, pyqtSlot, pyqtSignal +from ..gen_resources.homescreen_uic import Ui_HomescreenWidget +from .community_tile import CommunityTile +from ..core.community import Community +import logging -class HomeScreenWidget(QWidget, Ui_HomeScreenWidget): +class FrameCommunities(QFrame): + community_tile_clicked = pyqtSignal(Community) + + def __init__(self, parent): + super().__init__(parent) + self.grid_layout = QGridLayout() + self.setLayout(self.grid_layout) + self.grid_layout.setAlignment(Qt.AlignLeft | Qt.AlignTop) + self.setFrameShape(QFrame.StyledPanel) + self.setFrameShadow(QFrame.Raised) + + def sizeHint(self): + return self.parentWidget().size() + + def refresh(self, app): + for i in reversed(range(self.grid_layout.count())): + self.grid_layout.itemAt(i).widget().setParent(None) + + if app.current_account: + for c in app.current_account.communities: + community_tile = CommunityTile(self, app, c) + community_tile.clicked.connect(self.click_on_tile) + self.layout().addWidget(community_tile) + + @pyqtSlot() + def click_on_tile(self): + tile = self.sender() + logging.debug("Click on tile") + self.community_tile_clicked.emit(tile.community) + + +class HomeScreenWidget(QWidget, Ui_HomescreenWidget): """ classdocs """ @@ -23,26 +55,18 @@ class HomeScreenWidget(QWidget, Ui_HomeScreenWidget): super().__init__() self.setupUi(self) self.app = app - self.refresh_text() - self.app.version_requested.connect(self.refresh_text) - - def refresh_text(self): - latest = self.app.available_version - version_info = "" - version_url = "" - if not latest[0]: - version_info = self.tr("Please get the latest release {version}") \ - .format(version=latest[1]) - version_url = latest[2] - - self.label_welcome.setText( - self.tr(""" - <h1>Welcome to Cutecoin {version}</h1> - <h2>{version_info}</h2> - <h3><a href={version_url}>Download link</a></h3> - """).format(version=latest[1], - version_info=version_info, - version_url=version_url)) + self.frame_communities = FrameCommunities(self) + self.layout().addWidget(self.frame_communities) + + def refresh(self): + self.frame_communities.refresh(self.app) + if self.app.current_account: + self.frame_connected.show() + self.label_connected.setText(self.tr("Connected as {0}".format(self.app.current_account.name))) + self.frame_disconnected.hide() + else: + self.frame_disconnected.show() + self.frame_connected.hide() def changeEvent(self, event): """ @@ -52,7 +76,6 @@ class HomeScreenWidget(QWidget, Ui_HomeScreenWidget): """ if event.type() == QEvent.LanguageChange: self.retranslateUi(self) - self.refresh_text() return super(HomeScreenWidget, self).changeEvent(event) diff --git a/src/cutecoin/gui/community_tab.py b/src/cutecoin/gui/identities_tab.py similarity index 82% rename from src/cutecoin/gui/community_tab.py rename to src/cutecoin/gui/identities_tab.py index 6d733008d442f0be45285d0bb49db3d491e35146..646e59bbc0d2f47676cea3022c94ad3277b68665 100644 --- a/src/cutecoin/gui/community_tab.py +++ b/src/cutecoin/gui/identities_tab.py @@ -10,7 +10,7 @@ from PyQt5.QtGui import QIcon, QCursor from PyQt5.QtWidgets import QWidget, QMessageBox, QAction, QMenu, QDialog, \ QAbstractItemView from cutecoin.models.identities import IdentitiesFilterProxyModel, IdentitiesTableModel -from ..gen_resources.community_tab_uic import Ui_CommunityTabWidget +from ..gen_resources.identities_tab_uic import Ui_IdentitiesTab from cutecoin.gui.contact import ConfigureContactDialog from cutecoin.gui.member import MemberDialog from .wot_tab import WotTabWidget @@ -21,27 +21,25 @@ import asyncio from ..core.net.api import bma as qtbma -class CommunityTabWidget(QWidget, Ui_CommunityTabWidget): +class IdentitiesTabWidget(QWidget, Ui_IdentitiesTab): """ classdocs """ - def __init__(self, app, account, community, password_asker, parent): + def __init__(self, app): """ Init :param cutecoin.core.account.Account account: Account instance :param cutecoin.core.community.Community community: Community instance :param cutecoin.gui.password_asker.PasswordAskerDialog password_asker: Password asker dialog - :param cutecoin.gui.currency_tab.CurrencyTabWidget parent: TabWidget instance :return: """ super().__init__() - self.parent = parent self.app = app - self.community = community - self.account = account - self.password_asker = password_asker + self.community = None + self.account = None + self.password_asker = None self.setupUi(self) @@ -54,8 +52,6 @@ class CommunityTabWidget(QWidget, Ui_CommunityTabWidget): self.table_identities.sortByColumn(0, Qt.AscendingOrder) self.table_identities.resizeColumnsToContents() - self.wot_tab = WotTabWidget(self.app, self.account, self.community, self.password_asker, self) - self.tabs_information.addTab(self.wot_tab, QIcon(':/icons/wot_icon'), self.tr("Web of Trust")) members_action = QAction(self.tr("Members"), self) members_action.triggered.connect(self.search_members) self.button_search.addAction(members_action) @@ -63,29 +59,24 @@ class CommunityTabWidget(QWidget, Ui_CommunityTabWidget): direct_connections.triggered.connect(self.search_direct_connections) self.button_search.addAction(direct_connections) - self.account.identity(self.community).inner_data_changed.connect(self.handle_account_identity_change) - self.search_direct_connections() - self.account.membership_broadcasted.connect(self.handle_membership_broadcasted) - self.account.revoke_broadcasted.connect(self.handle_revoke_broadcasted) - self.account.selfcert_broadcasted.connect(self.handle_selfcert_broadcasted) - - def handle_membership_broadcasted(self): - if self.app.preferences['notifications']: - toast.display(self.tr("Membership"), self.tr("Success sending Membership demand")) - else: - QMessageBox.information(self, self.tr("Membership"), self.tr("Success sending Membership demand")) - - def handle_revoke_broadcasted(self): - if self.app.preferences['notifications']: - toast.display(self.tr("Revoke"), self.tr("Success sending Revoke demand")) - else: - QMessageBox.information(self, self.tr("Revoke"), self.tr("Success sending Revoke demand")) + def change_account(self, account): + self.account = account + if self.account is None: + self.community = None + + def change_community(self, community): + if self.community: + try: + self.account.identity(self.community).inner_data_changed.disconnect(self.handle_account_identity_change) + except TypeError as e: + if "disconnect" in str(e): + logging.debug("Disconnect failed between inner_data_changed ans handle_account_identity_changed") + pass + if community: + self.account.identity(community).inner_data_changed.connect(self.handle_account_identity_change) - def handle_selfcert_broadcasted(self): - if self.app.preferences['notifications']: - toast.display(self.tr("Self Certification"), self.tr("Success sending Self Certification document")) - else: - QMessageBox.information(self.tr("Self Certification"), self.tr("Success sending Self Certification document")) + self.community = community + self.table_identities.model().change_community(community) def identity_context_menu(self, point): index = self.table_identities.indexAt(point) @@ -179,8 +170,6 @@ class CommunityTabWidget(QWidget, Ui_CommunityTabWidget): # redraw WoT with this identity selected self.wot_tab.draw_graph({'text': person.uid, 'id': person.pubkey}) # change page to WoT - index_community_tab = self.parent.tabs_account.indexOf(self) - self.parent.tabs_account.setCurrentIndex(index_community_tab) index_wot_tab = self.tabs_information.indexOf(self.wot_tab) self.tabs_information.setCurrentIndex(index_wot_tab) @@ -292,5 +281,5 @@ class CommunityTabWidget(QWidget, Ui_CommunityTabWidget): """ if event.type() == QEvent.LanguageChange: self.retranslateUi(self) - return super(CommunityTabWidget, self).changeEvent(event) + return super(IdentitiesTabWidget, self).changeEvent(event) diff --git a/src/cutecoin/gui/mainwindow.py b/src/cutecoin/gui/mainwindow.py index aef391f5e22a28a26adf1de545f79de77cc9578a..6a15ad977636b56ecf71bb375cdf1939d8a1df48 100644 --- a/src/cutecoin/gui/mainwindow.py +++ b/src/cutecoin/gui/mainwindow.py @@ -8,20 +8,22 @@ from ..gen_resources.about_uic import Ui_AboutPopup from PyQt5.QtWidgets import QMainWindow, QAction, QFileDialog, QProgressBar, \ QMessageBox, QLabel, QComboBox, QDialog, QApplication -from PyQt5.QtCore import QSignalMapper, QObject, QLocale, QEvent, \ +from PyQt5.QtCore import QSignalMapper, pyqtSlot, QLocale, QEvent, \ pyqtSlot, pyqtSignal, QDate, QDateTime, QTimer, QUrl, Qt, QCoreApplication from PyQt5.QtGui import QIcon, QDesktopServices from .process_cfg_account import ProcessConfigureAccount from .transfer import TransferMoneyDialog -from .currency_tab import CurrencyTabWidget +from .community_view import CommunityWidget from .contact import ConfigureContactDialog from .import_account import ImportAccountDialog from .certification import CertificationDialog from .password_asker import PasswordAskerDialog from .preferences import PreferencesDialog +from .process_cfg_community import ProcessConfigureCommunity from .homescreen import HomeScreenWidget from ..core import money +from ..core.community import Community from ..__init__ import __version__ from . import toast @@ -65,11 +67,19 @@ class MainWindow(QMainWindow, Ui_MainWindow): self.statusbar.addPermanentWidget(self.combo_referential) self.homescreen = HomeScreenWidget(self.app) + self.homescreen.frame_communities.community_tile_clicked.connect(self.change_community) + self.homescreen.toolbutton_new_account.addAction(self.action_add_account) + self.homescreen.toolbutton_new_account.addAction(self.action_import) + self.homescreen.button_add_community.clicked.connect(self.action_open_add_community) + self.homescreen.button_disconnect.clicked.connect(lambda :self.action_change_account("")) self.centralWidget().layout().addWidget(self.homescreen) - self.homescreen.button_new.clicked.connect(self.open_add_account_dialog) - self.homescreen.button_import.clicked.connect(self.import_account) - self.open_ucoin_info = lambda: QDesktopServices.openUrl(QUrl("http://ucoin.io/theoretical/")) - self.homescreen.button_info.clicked.connect(self.open_ucoin_info) + self.homescreen.toolbutton_connect.setMenu(self.menu_change_account) + + self.community_view = CommunityWidget(self.app, self.status_label) + self.community_view.button_home.clicked.connect(lambda: self.change_community(None)) + self.community_view.button_certification.clicked.connect(self.open_certification_dialog) + self.community_view.button_send_money.clicked.connect(self.open_transfer_money_dialog) + self.centralWidget().layout().addWidget(self.community_view) def startup(self): self.update_time() @@ -78,6 +88,8 @@ class MainWindow(QMainWindow, Ui_MainWindow): self.showMaximized() else: self.show() + if self.app.current_account: + self.community_view.change_account(self.app.current_account) self.refresh() def open_add_account_dialog(self): @@ -96,8 +108,8 @@ class MainWindow(QMainWindow, Ui_MainWindow): def referential_changed(self, index): if self.app.current_account: self.app.current_account.set_display_referential(index) - if self.currencies_tabwidget.currentWidget(): - self.currencies_tabwidget.currentWidget().referential_changed() + if self.community_view: + self.community_view.referential_changed() @pyqtSlot() def update_time(self): @@ -127,31 +139,30 @@ class MainWindow(QMainWindow, Ui_MainWindow): def action_change_account(self, account_name): self.app.change_current_account(self.app.get_account(account_name)) + self.community_view.change_account(self.app.current_account) self.refresh() @pyqtSlot() - def loader_finished(self): - logging.debug("Finished loading") - self.refresh() - self.busybar.hide() - QApplication.setOverrideCursor(Qt.ArrowCursor) - try: - self.app.disconnect() - except: - logging.debug("Disconnect of app failed") - - QApplication.processEvents() + def action_open_add_community(self): + dialog = ProcessConfigureCommunity(self.app, + self.app.current_account, None, + self.password_asker) + if dialog.exec_() == QDialog.Accepted: + self.app.save(self.app.current_account) + dialog.community.start_coroutines() + self.homescreen.refresh() def open_transfer_money_dialog(self): - dialog = TransferMoneyDialog(self.app, self.app.current_account, + dialog = TransferMoneyDialog(self.app, + self.app.current_account, self.password_asker) dialog.accepted.connect(self.refresh_wallets) if dialog.exec_() == QDialog.Accepted: - currency_tab = self.currencies_tabwidget.currentWidget() - currency_tab.tab_history.table_history.model().sourceModel().refresh_transfers() + self.community_view.tab_history.table_history.model().sourceModel().refresh_transfers() def open_certification_dialog(self): - dialog = CertificationDialog(self.app.current_account, + dialog = CertificationDialog(self.app, + self.app.current_account, self.password_asker) dialog.exec_() @@ -233,33 +244,26 @@ class MainWindow(QMainWindow, Ui_MainWindow): version_info=version_info, version_url=version_url)) - def refresh_wallets(self): - currency_tab = self.currencies_tabwidget.currentWidget() - if currency_tab: - currency_tab.refresh_wallets() + @pyqtSlot(Community) + def change_community(self, community): + if self.community_view.community: + self.community_view.community.stop_coroutines() - def refresh_communities(self): - logging.debug("CLEAR") - self.currencies_tabwidget.clear() - if self.app.current_account: - for community in self.app.current_account.communities: - tab_currency = CurrencyTabWidget(self.app, community, - self.password_asker, - self.status_label) - self.currencies_tabwidget.addTab(tab_currency, - QIcon(":/icons/currency_icon"), - community.name) + if community: + self.homescreen.hide() + self.community_view.show() + else: + self.homescreen.show() + self.community_view.hide() + + self.community_view.change_community(community) def refresh_accounts(self): self.menu_change_account.clear() - signal_mapper = QSignalMapper(self) - for account_name in sorted(self.app.accounts.keys()): action = QAction(account_name, self) + action.triggered.connect(lambda checked, account_name=account_name: self.action_change_account(account_name)) self.menu_change_account.addAction(action) - signal_mapper.setMapping(action, account_name) - action.triggered.connect(signal_mapper.map) - signal_mapper.mapped[str].connect(self.action_change_account) def refresh_contacts(self): self.menu_contacts_list.clear() @@ -281,22 +285,22 @@ class MainWindow(QMainWindow, Ui_MainWindow): """ logging.debug("Refresh started") self.refresh_accounts() + self.homescreen.show() + self.community_view.hide() + self.homescreen.refresh() if self.app.current_account is None: - self.currencies_tabwidget.hide() - self.homescreen.show() self.setWindowTitle(self.tr("CuteCoin {0}").format(__version__)) - self.menu_account.setEnabled(False) + self.action_add_a_contact.setEnabled(False) + self.actionCertification.setEnabled(False) + self.actionTransfer_money.setEnabled(False) self.action_configure_parameters.setEnabled(False) self.action_set_as_default.setEnabled(False) + self.menu_contacts_list.setEnabled(False) self.combo_referential.setEnabled(False) self.status_label.setText(self.tr("")) self.password_asker = None else: - logging.debug("Show currencies loading") - self.currencies_tabwidget.show() - logging.debug("Hide homescreen") - self.homescreen.hide() self.password_asker = PasswordAskerDialog(self.app.current_account) self.combo_referential.blockSignals(True) @@ -308,13 +312,14 @@ class MainWindow(QMainWindow, Ui_MainWindow): self.combo_referential.blockSignals(False) logging.debug(self.app.preferences) self.combo_referential.setCurrentIndex(self.app.preferences['ref']) - self.menu_account.setEnabled(True) + self.action_add_a_contact.setEnabled(True) + self.actionCertification.setEnabled(True) + self.actionTransfer_money.setEnabled(True) + self.menu_contacts_list.setEnabled(True) self.action_configure_parameters.setEnabled(True) self.setWindowTitle(self.tr("CuteCoin {0} - Account : {1}").format(__version__, self.app.current_account.name)) - self.refresh_communities() - self.refresh_wallets() self.refresh_contacts() def import_account(self): diff --git a/src/cutecoin/gui/network_tab.py b/src/cutecoin/gui/network_tab.py index efdd76241b36ecf1c0ea98b97738de9d41b9f1a8..0ff9795bd6fb78fc681653190aafe85bbab04041 100644 --- a/src/cutecoin/gui/network_tab.py +++ b/src/cutecoin/gui/network_tab.py @@ -20,27 +20,34 @@ class NetworkTabWidget(QWidget, Ui_NetworkTabWidget): classdocs """ - def __init__(self, app, community): + def __init__(self, app): """ Constructore of a network tab. :param cutecoin.core.Application app: The application - :param cutecoin.core.Community community: The community :return: A new network tab. :rtype: NetworkTabWidget """ super().__init__() self.app = app - self.community = community + self.community = None self.setupUi(self) - model = NetworkTableModel(community) + model = NetworkTableModel(self.community) proxy = NetworkFilterProxyModel(self) proxy.setSourceModel(model) self.table_network.setModel(proxy) self.table_network.sortByColumn(0, Qt.DescendingOrder) self.table_network.resizeColumnsToContents() - community.network.nodes_changed.connect(self.refresh_nodes) + + def change_community(self, community): + if self.community: + self.community.network.nodes_changed.disconnect(self.refresh_nodes) + if community: + community.network.nodes_changed.connect(self.refresh_nodes) + + self.community = community + self.table_network.model().change_community(community) @pyqtSlot() def refresh_nodes(self): diff --git a/src/cutecoin/gui/process_cfg_community.py b/src/cutecoin/gui/process_cfg_community.py index 33e34f84cc7bc9d8c3c79884dae2710716f286e0..6ec9c4913ac3d50a9255637e32342a6a42499174 100644 --- a/src/cutecoin/gui/process_cfg_community.py +++ b/src/cutecoin/gui/process_cfg_community.py @@ -9,12 +9,12 @@ import asyncio from PyQt5.QtWidgets import QDialog, QMenu, QMessageBox, QApplication from PyQt5.QtGui import QCursor -from PyQt5.QtCore import pyqtSlot +from PyQt5.QtCore import pyqtSlot, pyqtSignal from ..gen_resources.community_cfg_uic import Ui_CommunityConfigurationDialog from ..models.peering import PeeringTreeModel from ..core import Community -from ..core.registry import Identity +from ..core.registry.identity import BlockchainState from ..core.net import Node from . import toast @@ -96,6 +96,7 @@ class ProcessConfigureCommunity(QDialog, Ui_CommunityConfigurationDialog): """ Dialog to configure or add a community """ + community_added = pyqtSignal() def __init__(self, app, account, community, password_asker): """ @@ -115,6 +116,7 @@ class ProcessConfigureCommunity(QDialog, Ui_CommunityConfigurationDialog): self.step = None self.nodes = [] + self.community_added.connect(self.add_community_and_close) step_init = StepPageInit(self) step_add_peers = StepPageAddpeers(self) @@ -218,6 +220,7 @@ class ProcessConfigureCommunity(QDialog, Ui_CommunityConfigurationDialog): self.account.broadcast_error.disconnect(self.handle_error) QApplication.restoreOverrideCursor() + @pyqtSlot() def add_community_and_close(self): if self.community not in self.account.communities: self.account.add_community(self.community) @@ -226,7 +229,7 @@ class ProcessConfigureCommunity(QDialog, Ui_CommunityConfigurationDialog): @asyncio.coroutine def final(self): identity = yield from self.app.identities_registry.future_find(self.account.pubkey, self.community) - if identity.status == Identity.NOT_FOUND: + if identity.blockchain_state == BlockchainState.NOT_FOUND: reply = QMessageBox.question(self, self.tr("Pubkey not found"), self.tr("""The public key of your account wasn't found in the community. :\n {0}\n @@ -239,6 +242,6 @@ Would you like to publish the key ?""").format(self.account.pubkey)) self.account.broadcast_error.connect(self.handle_error) asyncio.async(self.account.send_selfcert(password, self.community)) else: - self.add_community_and_close() + self.community_added.emit() else: - self.add_community_and_close() + self.community_added.emit() diff --git a/src/cutecoin/gui/transactions_tab.py b/src/cutecoin/gui/transactions_tab.py index 50eaa7deb36d77fb3bef5986899db15ef05b2c31..63cd6974f3f3f74facd70ba1e90727252d61ce38 100644 --- a/src/cutecoin/gui/transactions_tab.py +++ b/src/cutecoin/gui/transactions_tab.py @@ -18,27 +18,31 @@ class TransactionsTabWidget(QWidget, Ui_transactionsTabWidget): classdocs """ - def __init__(self, app, community, password_asker, currency_tab): + def __init__(self, app): """ Init :param cutecoin.core.app.Application app: Application instance - :param cutecoin.core.community.Community community: Community instance - :param cutecoin.gui.password_asker.PasswordAskerDialog password_asker: Password dialog instance - :param cutecoin.gui.currency_tab.CurrencyTabWidget currency_tab: Currency tab widget :return: """ super().__init__() self.setupUi(self) self.app = app - self.community = community - self.password_asker = password_asker - self.currency_tab = currency_tab + self.community = None + self.password_asker = None self.progressbar.hide() - self.community.inner_data_changed.connect(self.refresh_minimum_maximum) self.refresh() + def change_community(self, community): + if self.community: + self.community.inner_data_changed.disconnect(self.refresh_minimum_maximum) + if community: + community.inner_data_changed.connect(self.refresh_minimum_maximum) + self.community = community + self.refresh() + self.stop_progress([]) + def refresh_minimum_maximum(self): block = self.community.get_block(1) minimum_datetime = QDateTime() @@ -56,23 +60,24 @@ class TransactionsTabWidget(QWidget, Ui_transactionsTabWidget): def refresh(self): #TODO: Use resetmodel instead of destroy/create - self.refresh_minimum_maximum() - ts_from = self.date_from.dateTime().toTime_t() - ts_to = self.date_to.dateTime().toTime_t() - - model = HistoryTableModel(self.app, self.community) - proxy = TxFilterProxyModel(ts_from, ts_to) - proxy.setSourceModel(model) - proxy.setDynamicSortFilter(True) - proxy.setSortRole(Qt.DisplayRole) - - self.table_history.setModel(proxy) - self.table_history.setSelectionBehavior(QAbstractItemView.SelectRows) - self.table_history.setSortingEnabled(True) - self.table_history.horizontalHeader().setSectionResizeMode(QHeaderView.Interactive) - self.table_history.resizeColumnsToContents() + if self.community: + self.refresh_minimum_maximum() + ts_from = self.date_from.dateTime().toTime_t() + ts_to = self.date_to.dateTime().toTime_t() + + model = HistoryTableModel(self.app, self.community) + proxy = TxFilterProxyModel(ts_from, ts_to) + proxy.setSourceModel(model) + proxy.setDynamicSortFilter(True) + proxy.setSortRole(Qt.DisplayRole) + + self.table_history.setModel(proxy) + self.table_history.setSelectionBehavior(QAbstractItemView.SelectRows) + self.table_history.setSortingEnabled(True) + self.table_history.horizontalHeader().setSectionResizeMode(QHeaderView.Interactive) + self.table_history.resizeColumnsToContents() - self.refresh_balance() + self.refresh_balance() def start_progress(self): def progressing(value, maximum): @@ -100,34 +105,47 @@ class TransactionsTabWidget(QWidget, Ui_transactionsTabWidget): self.table_history.resizeColumnsToContents() def refresh_balance(self): - # if referential is "units" - if self.app.current_account._current_ref == 0: - self.label_balance.show() - self.label_deposit.show() - self.label_payment.show() + if self.app.preferences['expert_mode']: + # if referential is "units" + if self.app.current_account._current_ref == 0: + self.label_balance.show() + self.label_deposit.show() + self.label_payment.show() + else: + self.label_balance.hide() + self.label_deposit.hide() + self.label_payment.hide() + + proxy = self.table_history.model() + balance = proxy.deposits - proxy.payments + localized_deposits = self.app.current_account.current_ref(proxy.deposits, self.community, self.app).diff_localized() + localized_payments = self.app.current_account.current_ref(proxy.payments, self.community, self.app).diff_localized() + localized_balance = self.app.current_account.current_ref(balance, self.community, self.app).diff_localized() + + self.label_deposit.setText(QCoreApplication.translate("TransactionsTabWidget", "<b>Deposits</b> {:} {:}").format( + localized_deposits, + self.app.current_account.current_ref.units(self.community.short_currency) + )) + self.label_payment.setText(QCoreApplication.translate("TransactionsTabWidget", "<b>Payments</b> {:} {:}").format( + localized_payments, + self.app.current_account.current_ref.units(self.community.short_currency) + )) + self.label_balance.setText(QCoreApplication.translate("TransactionsTabWidget", "<b>Balance</b> {:} {:}").format( + localized_balance, + self.app.current_account.current_ref.units(self.community.short_currency) + )) + else: - self.label_balance.hide() - self.label_deposit.hide() - self.label_payment.hide() - - proxy = self.table_history.model() - balance = proxy.deposits - proxy.payments - localized_deposits = self.app.current_account.current_ref(proxy.deposits, self.community, self.app).diff_localized() - localized_payments = self.app.current_account.current_ref(proxy.payments, self.community, self.app).diff_localized() - localized_balance = self.app.current_account.current_ref(balance, self.community, self.app).diff_localized() - - self.label_deposit.setText(QCoreApplication.translate("TransactionsTabWidget", "<b>Deposits</b> {:} {:}").format( - localized_deposits, - self.app.current_account.current_ref.units(self.community.short_currency) - )) - self.label_payment.setText(QCoreApplication.translate("TransactionsTabWidget", "<b>Payments</b> {:} {:}").format( - localized_payments, - self.app.current_account.current_ref.units(self.community.short_currency) - )) - self.label_balance.setText(QCoreApplication.translate("TransactionsTabWidget", "<b>Balance</b> {:} {:}").format( - localized_balance, - self.app.current_account.current_ref.units(self.community.short_currency) - )) + amount = self.app.current_account.amount(self.community) + localized_amount = self.app.current_account.current_ref(amount, self.community, self.app).localized(units=True) + + # set infos in label + self.label_balance.setText( + self.tr("{:}") + .format( + localized_amount + ) + ) def history_context_menu(self, point): index = self.table_history.indexAt(point) diff --git a/src/cutecoin/gui/transfer.py b/src/cutecoin/gui/transfer.py index d6ef4c738d22e0fc406cc4d8ba904051a19372be..cbd86f8207649a7582b0f01d931a8046428ac86f 100644 --- a/src/cutecoin/gui/transfer.py +++ b/src/cutecoin/gui/transfer.py @@ -123,16 +123,10 @@ class TransferMoneyDialog(QDialog, Ui_TransferMoneyDialog): self.community = self.account.communities[index] self.dividend = self.community.dividend amount = self.wallet.value(self.community) - ref_amount = self.account.units_to_ref(amount, self.community) - ref_name = self.account.ref_name(self.community.currency) - # if referential type is quantitative... - if self.account.ref_type() == 'q': - # display int values - ref_amount = QLocale().toString(float(ref_amount), 'f', 0) - else: - # display float values - ref_amount = QLocale().toString(float(ref_amount), 'f', 6) - self.label_total.setText("{0} {1}".format(ref_amount, ref_name)) + + ref_text = self.account.current_ref(amount, self.community, self.app)\ + .diff_localized(units=True, international_system=self.app.preferences['international_system_of_units']) + self.label_total.setText("{0}".format(ref_text)) self.spinbox_amount.setSuffix(" " + self.community.currency) self.spinbox_amount.setValue(0) amount = self.wallet.value(self.community) @@ -143,16 +137,9 @@ class TransferMoneyDialog(QDialog, Ui_TransferMoneyDialog): def change_displayed_wallet(self, index): self.wallet = self.account.wallets[index] amount = self.wallet.value(self.community) - ref_amount = self.account.units_to_ref(amount, self.community) - ref_name = self.account.ref_name(self.community.currency) - # if referential type is quantitative... - if self.account.ref_type() == 'q': - # display int values - ref_amount = QLocale().toString(float(ref_amount), 'f', 0) - else: - # display float values - ref_amount = QLocale().toString(float(ref_amount), 'f', 6) - self.label_total.setText("{0} {1}".format(ref_amount, ref_name)) + ref_text = self.account.current_ref(amount, self.community, self.app)\ + .diff_localized(units=True, international_system=self.app.preferences['international_system_of_units']) + self.label_total.setText("{0}".format(ref_text)) self.spinbox_amount.setValue(0) amount = self.wallet.value(self.community) relative = amount / self.dividend diff --git a/src/cutecoin/gui/wallets_tab.py b/src/cutecoin/gui/wallets_tab.py deleted file mode 100644 index 245cab78ece53388137e30e254738c540288c56d..0000000000000000000000000000000000000000 --- a/src/cutecoin/gui/wallets_tab.py +++ /dev/null @@ -1,353 +0,0 @@ -""" -Created on 15 févr. 2015 - -@author: inso -""" -import asyncio -import logging - -from PyQt5.QtWidgets import QWidget, QMenu, QAction, QApplication, QDialog, QMessageBox -from PyQt5.QtCore import QDateTime, QModelIndex, Qt, QLocale, QEvent -from PyQt5.QtGui import QCursor - -from ..core.registry import Identity -from ..core.wallet import Wallet -from cutecoin.gui import toast -from ..gui.password_asker import PasswordAskerDialog -from ..models.wallets import WalletsTableModel, WalletsFilterProxyModel -from .transfer import TransferMoneyDialog -from ..tools.exceptions import MembershipNotFoundError, NoPeerAvailable, LookupFailureError -from ..gen_resources.wallets_tab_uic import Ui_WalletsTab - - -class WalletsTabWidget(QWidget, Ui_WalletsTab): - """ - classdocs - """ - - def __init__(self, app, account, community, password_asker): - """ - Init - :param cutecoin.core.app.Application app: Application instance - :param cutecoin.core.account.Account account: Account instance - :param cutecoin.core.community.Community community: Community instance - :param cutecoin.gui.password_asker.PasswordAskerDialog password_asker: PasswordAskerDialog instance - """ - super().__init__() - self.setupUi(self) - self.app = app - self.account = account - self.community = community - self.password_asker = password_asker - self.setup_connections() - - def setup_connections(self): - self.account.inner_data_changed.connect(self.refresh_informations_frame) - self.community.inner_data_changed.connect(self.refresh_informations_frame) - - def refresh(self): - self.refresh_informations_frame() - self.refresh_wallets() - self.refresh_quality_buttons() - - def refresh_wallets(self): - # TODO: Using reset model instead of destroy/create - wallets_model = WalletsTableModel(self.app, self.community) - proxy_model = WalletsFilterProxyModel() - proxy_model.setSourceModel(wallets_model) - wallets_model.dataChanged.connect(self.wallet_changed) - self.table_wallets.setModel(proxy_model) - self.table_wallets.resizeColumnsToContents() - - def refresh_informations_frame(self): - parameters = self.community.parameters - try: - identity = self.account.identity(self.community) - membership = identity.membership(self.community) - renew_block = membership['blockNumber'] - last_renewal = self.community.get_block(renew_block)['medianTime'] - expiration = last_renewal + parameters['sigValidity'] - except MembershipNotFoundError: - last_renewal = None - expiration = None - - certified = identity.unique_valid_certified_by(self.app.identities_registry, self.community) - certifiers = identity.unique_valid_certifiers_of(self.app.identities_registry, self.community) - if last_renewal and expiration: - date_renewal = QLocale.toString( - QLocale(), - QDateTime.fromTime_t(last_renewal).date(), QLocale.dateFormat(QLocale(), QLocale.LongFormat) - ) - date_expiration = QLocale.toString( - QLocale(), - QDateTime.fromTime_t(expiration).date(), QLocale.dateFormat(QLocale(), QLocale.LongFormat) - ) - - if self.account.pubkey in self.community.members_pubkeys(): - # set infos in label - self.label_general.setText( - self.tr(""" - <table cellpadding="5"> - <tr><td align="right"><b>{:}</b></td><td>{:}</td></tr> - <tr><td align="right"><b>{:}</b></td><td>{:}</td></tr> - <tr><td align="right"><b>{:}</b></td><td>{:}</td></tr> - </table> - """).format( - self.account.name, self.account.pubkey, - self.tr("Membership"), - self.tr("Last renewal on {:}, expiration on {:}").format(date_renewal, date_expiration), - self.tr("Your web of trust"), - self.tr("Certified by {:} members; Certifier of {:} members").format(len(certifiers), - len(certified)) - ) - ) - else: - # set infos in label - self.label_general.setText( - self.tr(""" - <table cellpadding="5"> - <tr><td align="right"><b>{:}</b></td><td>{:}</td></tr> - <tr><td align="right"><b>{:}</b></td><td>{:}</td></tr> - <tr><td align="right"><b>{:}</b></td><td>{:}</td></tr> - </table> - """).format( - self.account.name, self.account.pubkey, - self.tr("Not a member"), - self.tr("Last renewal on {:}, expiration on {:}").format(date_renewal, date_expiration), - self.tr("Your web of trust"), - self.tr("Certified by {:} members; Certifier of {:} members").format(len(certifiers), - len(certified)) - ) - ) - else: - # set infos in label - self.label_general.setText( - self.tr(""" - <table cellpadding="5"> - <tr><td align="right"><b>{:}</b></td><td>{:}</td></tr> - <tr><td align="right"><b>{:}</b></td></tr> - <tr><td align="right"><b>{:}</b></td><td>{:}</td></tr> - </table> - """).format( - self.account.name, self.account.pubkey, - self.tr("Not a member"), - self.tr("Your web of trust"), - self.tr("Certified by {:} members; Certifier of {:} members").format(len(certifiers), - len(certified)) - ) - ) - - amount = self.account.amount(self.community) - maximum = self.community.monetary_mass - # if referential type is quantitative... - # display int values - localized_amount = self.account.current_ref(amount, self.community, self.app).localized(units=True) - localized_minimum = self.account.current_ref(0, self.community, self.app).localized(units=True) - localized_maximum = self.account.current_ref(maximum, self.community, self.app).localized(units=True) - - # set infos in label - self.label_balance.setText( - self.tr("{:}") - .format( - localized_amount - ) - ) - self.label_balance_range.setText( - self.tr("in [{:} ; {:}]") - .format( - localized_minimum, - localized_maximum - ) - ) - - def wallet_context_menu(self, point): - index = self.table_wallets.indexAt(point) - model = self.table_wallets.model() - if index.row() < model.rowCount(QModelIndex()): - source_index = model.mapToSource(index) - - name_col = model.sourceModel().columns_types.index('name') - name_index = model.index(index.row(), - name_col) - - pubkey_col = model.sourceModel().columns_types.index('pubkey') - pubkey_index = model.sourceModel().index(source_index.row(), - pubkey_col) - - pubkey = model.sourceModel().data(pubkey_index, Qt.DisplayRole) - menu = QMenu(model.data(index, Qt.DisplayRole), self) - - new_wallet = QAction(self.tr("New Wallet"), self) - new_wallet.triggered.connect(self.new_wallet) - - rename = QAction(self.tr("Rename"), self) - rename.triggered.connect(self.rename_wallet) - rename.setData(name_index) - - copy_pubkey = QAction(self.tr("Copy pubkey to clipboard"), self) - copy_pubkey.triggered.connect(self.copy_pubkey_to_clipboard) - copy_pubkey.setData(pubkey) - - transfer_to = QMenu() - transfer_to.setTitle(self.tr("Transfer to...")) - for w in self.account.wallets: - if w == self.account.wallets[source_index.row()]: - continue - transfer_action = QAction(w.name, self) - transfer_action.triggered.connect(self.transfer_to_wallet) - wallets = (self.account.wallets[source_index.row()], w) - transfer_action.setData(wallets) - transfer_to.addAction(transfer_action) - - menu.addAction(new_wallet) - menu.addAction(rename) - menu.addAction(copy_pubkey) - menu.addMenu(transfer_to) - # Show the context menu. - menu.exec_(QCursor.pos()) - - def new_wallet(self): - """ - Create a new wallet - """ - password_asker = PasswordAskerDialog(self.app.current_account) - password = password_asker.exec_() - if password_asker.result() == QDialog.Rejected: - return None - # create new wallet by increasing wallet pool size - self.account.set_walletpool_size(len(self.account.wallets) + 1, password) - # capture new wallet - wallet = self.account.wallets[len(self.account.wallets) - 1] - # feed cache data of the wallet - wallet.refresh_cache(self.community, list()) - # save wallet cache on disk - self.app.save_wallet(self.account, self.account.wallets[len(self.account.wallets) - 1]) - # save account cache on disk (update number of wallets) - self.app.save(self.account) - # refresh wallet list in gui - self.refresh() - - def rename_wallet(self): - index = self.sender().data() - self.table_wallets.edit(index) - - def wallet_changed(self): - self.table_wallets.resizeColumnsToContents() - self.app.save(self.app.current_account) - - def copy_pubkey_to_clipboard(self): - data = self.sender().data() - clipboard = QApplication.clipboard() - if data.__class__ is Wallet: - clipboard.setText(data.pubkey) - elif data.__class__ is Identity: - clipboard.setText(data.pubkey) - elif data.__class__ is str: - clipboard.setText(data) - - def transfer_to_wallet(self): - wallets = self.sender().data() - dialog = TransferMoneyDialog(self.app, self.account, self.password_asker) - dialog.edit_pubkey.setText(wallets[1].pubkey) - dialog.combo_community.setCurrentText(self.community.name) - dialog.combo_wallets.setCurrentText(wallets[0].name) - dialog.radio_pubkey.setChecked(True) - if dialog.exec_() == QDialog.Accepted: - currency_tab = self.window().currencies_tabwidget.currentWidget() - currency_tab.tab_history.table_history.model().sourceModel().refresh_transfers() - - def send_membership_demand(self): - password = self.password_asker.exec_() - if self.password_asker.result() == QDialog.Rejected: - return - asyncio.async(self.account.send_membership(password, self.community, 'IN')) - - def send_membership_leaving(self): - reply = QMessageBox.warning(self, self.tr("Warning"), - self.tr("""Are you sure ? -Sending a leaving demand cannot be canceled. -The process to join back the community later will have to be done again.""") -.format(self.account.pubkey), QMessageBox.Ok | QMessageBox.Cancel) - if reply == QMessageBox.Ok: - password = self.password_asker.exec_() - if self.password_asker.result() == QDialog.Rejected: - return - - asyncio.async(self.account.send_membership(password, self.community, 'OUT')) - - def publish_uid(self): - reply = QMessageBox.warning(self, self.tr("Warning"), - self.tr("""Are you sure ? -Publishing your UID can be canceled by Revoke UID.""") -.format(self.account.pubkey), QMessageBox.Ok | QMessageBox.Cancel) - if reply == QMessageBox.Ok: - password = self.password_asker.exec_() - if self.password_asker.result() == QDialog.Rejected: - return - - try: - self.account.send_selfcert(password, self.community) - toast.display(self.tr("UID Publishing"), - self.tr("Success publishing your UID")) - except ValueError as e: - QMessageBox.critical(self, self.tr("Publish UID error"), - str(e)) - except NoPeerAvailable as e: - QMessageBox.critical(self, self.tr("Network error"), - self.tr("Couldn't connect to network : {0}").format(e), - QMessageBox.Ok) - # except Exception as e: - # QMessageBox.critical(self, self.tr("Error"), - # "{0}".format(e), - # QMessageBox.Ok) - - def revoke_uid(self): - reply = QMessageBox.warning(self, self.tr("Warning"), - self.tr("""Are you sure ? -Revoking your UID can only success if it is not already validated by the network.""") -.format(self.account.pubkey), QMessageBox.Ok | QMessageBox.Cancel) - if reply == QMessageBox.Ok: - password = self.password_asker.exec_() - if self.password_asker.result() == QDialog.Rejected: - return - - asyncio.async(self.account.revoke(password, self.community)) - - def refresh_quality_buttons(self): - try: - if self.account.identity(self.community).published_uid(self.community): - logging.debug("UID Published") - if self.account.identity(self.community).is_member(self.community): - self.button_membership.setText(self.tr("Renew membership")) - self.button_membership.show() - self.button_publish_uid.hide() - self.button_leaving.show() - self.button_revoke_uid.hide() - else: - logging.debug("Not a member") - self.button_membership.setText(self.tr("Send membership demand")) - self.button_membership.show() - self.button_revoke_uid.show() - self.button_leaving.hide() - self.button_publish_uid.hide() - else: - logging.debug("UID not published") - self.button_membership.hide() - self.button_leaving.hide() - self.button_publish_uid.show() - self.button_revoke_uid.hide() - except LookupFailureError: - self.button_membership.hide() - self.button_leaving.hide() - self.button_publish_uid.show() - - def changeEvent(self, event): - """ - Intercepte LanguageChange event to translate UI - :param QEvent QEvent: Event - :return: - """ - if event.type() == QEvent.LanguageChange: - self.retranslateUi(self) - self.refresh() - return super(WalletsTabWidget, self).changeEvent(event) diff --git a/src/cutecoin/gui/wot_tab.py b/src/cutecoin/gui/wot_tab.py index c7e8572e094d9135f4b5b5332b534a30b55f586c..2b5d8795fa1a1acd37f3c981c7712bf015f68975 100644 --- a/src/cutecoin/gui/wot_tab.py +++ b/src/cutecoin/gui/wot_tab.py @@ -2,8 +2,9 @@ import logging from cutecoin.core.graph import Graph +from ..tools.exceptions import MembershipNotFoundError from PyQt5.QtWidgets import QWidget, QComboBox, QLineEdit -from PyQt5.QtCore import pyqtSlot, QEvent +from PyQt5.QtCore import pyqtSlot, QEvent, QLocale, QDateTime from cutecoin.core.net.api import bma from cutecoin.core.registry import BlockchainState from ..gen_resources.wot_tab_uic import Ui_WotTabWidget @@ -12,17 +13,12 @@ from cutecoin.gui.views.wot import NODE_STATUS_HIGHLIGHTED, NODE_STATUS_SELECTED class WotTabWidget(QWidget, Ui_WotTabWidget): - def __init__(self, app, account, community, password_asker, parent=None): + def __init__(self, app): """ :param cutecoin.core.app.Application app: Application instance - :param cutecoin.core.account.Account account: Account instance - :param cutecoin.core.community.Community community: Community instance - :param QWidget parent: Parent :return: """ - super().__init__(parent) - self.parent = parent - + super().__init__() # construct from qtDesigner self.setupUi(self) @@ -41,9 +37,9 @@ class WotTabWidget(QWidget, Ui_WotTabWidget): self.graphicsView.scene().node_contact.connect(self.add_node_as_contact) self.graphicsView.scene().node_member.connect(self.identity_informations) - self.account = account - self.community = community - self.password_asker = password_asker + self.account = None + self.community = None + self.password_asker = None self.app = app # nodes list for menu from search @@ -51,8 +47,95 @@ class WotTabWidget(QWidget, Ui_WotTabWidget): # create node metadata from account self._current_identity = None - self.draw_graph(self.account.identity(self.community)) - self.community.network.new_block_mined.connect(self.refresh) + + def change_account(self, account): + self.account = account + + def change_community(self, community): + if self.community: + self.community.network.new_block_mined.disconnect(self.refresh) + if community: + community.network.new_block_mined.connect(self.refresh) + self.community = community + self.reset() + + def refresh_informations_frame(self): + parameters = self.community.parameters + try: + identity = self.account.identity(self.community) + membership = identity.membership(self.community) + renew_block = membership['blockNumber'] + last_renewal = self.community.get_block(renew_block)['medianTime'] + expiration = last_renewal + parameters['sigValidity'] + except MembershipNotFoundError: + last_renewal = None + expiration = None + + certified = identity.unique_valid_certified_by(self.app.identities_registry, self.community) + certifiers = identity.unique_valid_certifiers_of(self.app.identities_registry, self.community) + if last_renewal and expiration: + date_renewal = QLocale.toString( + QLocale(), + QDateTime.fromTime_t(last_renewal).date(), QLocale.dateFormat(QLocale(), QLocale.LongFormat) + ) + date_expiration = QLocale.toString( + QLocale(), + QDateTime.fromTime_t(expiration).date(), QLocale.dateFormat(QLocale(), QLocale.LongFormat) + ) + + if self.account.pubkey in self.community.members_pubkeys(): + # set infos in label + self.label_general.setText( + self.tr(""" + <table cellpadding="5"> + <tr><td align="right"><b>{:}</b></td><td>{:}</td></tr> + <tr><td align="right"><b>{:}</b></td><td>{:}</td></tr> + <tr><td align="right"><b>{:}</b></td><td>{:}</td></tr> + </table> + """).format( + self.account.name, self.account.pubkey, + self.tr("Membership"), + self.tr("Last renewal on {:}, expiration on {:}").format(date_renewal, date_expiration), + self.tr("Your web of trust"), + self.tr("Certified by {:} members; Certifier of {:} members").format(len(certifiers), + len(certified)) + ) + ) + else: + # set infos in label + self.label_general.setText( + self.tr(""" + <table cellpadding="5"> + <tr><td align="right"><b>{:}</b></td><td>{:}</td></tr> + <tr><td align="right"><b>{:}</b></td><td>{:}</td></tr> + <tr><td align="right"><b>{:}</b></td><td>{:}</td></tr> + </table> + """).format( + self.account.name, self.account.pubkey, + self.tr("Not a member"), + self.tr("Last renewal on {:}, expiration on {:}").format(date_renewal, date_expiration), + self.tr("Your web of trust"), + self.tr("Certified by {:} members; Certifier of {:} members").format(len(certifiers), + len(certified)) + ) + ) + else: + # set infos in label + self.label_general.setText( + self.tr(""" + <table cellpadding="5"> + <tr><td align="right"><b>{:}</b></td><td>{:}</td></tr> + <tr><td align="right"><b>{:}</b></td></tr> + <tr><td align="right"><b>{:}</b></td><td>{:}</td></tr> + </table> + """).format( + self.account.name, self.account.pubkey, + self.tr("Not a member"), + self.tr("Your web of trust"), + self.tr("Certified by {:} members; Certifier of {:} members").format(len(certifiers), + len(certified)) + ) + ) @pyqtSlot(dict) def handle_node_click(self, metadata): @@ -72,51 +155,52 @@ class WotTabWidget(QWidget, Ui_WotTabWidget): """ logging.debug("Draw graph - " + identity.uid) - identity_account = self.account.identity(self.community) - - # Disconnect old identity - try: - if self._current_identity and self._current_identity != identity: - self._current_identity.inner_data_changed.disconnect(self.handle_identity_change) - except TypeError as e: - if "disconnect()" in str(e): - logging.debug("Disconnect of old identity failed.") - - #Connect new identity - if self._current_identity != identity: - self._current_identity = identity - identity.inner_data_changed.connect(self.handle_identity_change) - - # create Identity from node metadata - certifier_list = identity.unique_valid_certifiers_of(self.app.identities_registry, self.community) - certified_list = identity.unique_valid_certified_by(self.app.identities_registry, self.community) - - # create empty graph instance - graph = Graph(self.app, self.community) - - # add wallet node - node_status = 0 - if identity == identity_account: - node_status += NODE_STATUS_HIGHLIGHTED - if identity.is_member(self.community) is False: - node_status += NODE_STATUS_OUT - node_status += NODE_STATUS_SELECTED - graph.add_identity(identity, node_status) - - # populate graph with certifiers-of - graph.add_certifier_list(certifier_list, identity, identity_account) - # populate graph with certified-by - graph.add_certified_list(certified_list, identity, identity_account) - - # draw graph in qt scene - self.graphicsView.scene().update_wot(graph.get()) - - # if selected member is not the account member... - if identity.pubkey != identity_account.pubkey: - # add path from selected member to account member - path = graph.get_shortest_path_between_members(identity, identity_account) - if path: - self.graphicsView.scene().update_path(path) + if self.community: + identity_account = self.account.identity(self.community) + + # Disconnect old identity + try: + if self._current_identity and self._current_identity != identity: + self._current_identity.inner_data_changed.disconnect(self.handle_identity_change) + except TypeError as e: + if "disconnect()" in str(e): + logging.debug("Disconnect of old identity failed.") + + #Connect new identity + if self._current_identity != identity: + self._current_identity = identity + identity.inner_data_changed.connect(self.handle_identity_change) + + # create Identity from node metadata + certifier_list = identity.unique_valid_certifiers_of(self.app.identities_registry, self.community) + certified_list = identity.unique_valid_certified_by(self.app.identities_registry, self.community) + + # create empty graph instance + graph = Graph(self.app, self.community) + + # add wallet node + node_status = 0 + if identity == identity_account: + node_status += NODE_STATUS_HIGHLIGHTED + if identity.is_member(self.community) is False: + node_status += NODE_STATUS_OUT + node_status += NODE_STATUS_SELECTED + graph.add_identity(identity, node_status) + + # populate graph with certifiers-of + graph.add_certifier_list(certifier_list, identity, identity_account) + # populate graph with certified-by + graph.add_certified_list(certified_list, identity, identity_account) + + # draw graph in qt scene + self.graphicsView.scene().update_wot(graph.get()) + + # if selected member is not the account member... + if identity.pubkey != identity_account.pubkey: + # add path from selected member to account member + path = graph.get_shortest_path_between_members(identity, identity_account) + if path: + self.graphicsView.scene().update_path(path) def reset(self): """ @@ -130,7 +214,10 @@ class WotTabWidget(QWidget, Ui_WotTabWidget): """ Refresh graph scene to current metadata """ - self.draw_graph(self._current_identity) + if self._current_identity != None: + self.draw_graph(self._current_identity) + else: + self.reset() @pyqtSlot(str) def handle_identity_change(self, request): diff --git a/src/cutecoin/models/identities.py b/src/cutecoin/models/identities.py index 1a66f0f92b18518a5cb59bc0066a6992cbf0a690..33f3032e5f657d2a417a7890952508abe0524ffc 100644 --- a/src/cutecoin/models/identities.py +++ b/src/cutecoin/models/identities.py @@ -21,6 +21,10 @@ class IdentitiesFilterProxyModel(QSortFilterProxyModel): self.community = sourceModel.community super().setSourceModel(sourceModel) + def change_community(self, community): + self.community = community + self.sourceModel().change_community(community) + def lessThan(self, left, right): """ Sort table by given column number. @@ -73,12 +77,12 @@ class IdentitiesTableModel(QAbstractTableModel): A Qt abstract item model to display communities in a tree """ - def __init__(self, community, parent=None): + def __init__(self, parent=None): """ Constructor """ super().__init__(parent) - self.community = community + self.community = None self.columns_titles = {'uid': self.tr('UID'), 'pubkey': self.tr('Pubkey'), 'renewed': self.tr('Renewed'), @@ -89,6 +93,9 @@ class IdentitiesTableModel(QAbstractTableModel): self._identities = [] self._refresh_slots = [] + def change_community(self, community): + self.community = community + @property def pubkeys(self): """ diff --git a/src/cutecoin/models/network.py b/src/cutecoin/models/network.py index ed957576a890dc5ffdb9ca099334028a099ee774..6282af4647fa54a265887a44730b5616c35fad6d 100644 --- a/src/cutecoin/models/network.py +++ b/src/cutecoin/models/network.py @@ -21,6 +21,10 @@ class NetworkFilterProxyModel(QSortFilterProxyModel): def columnCount(self, parent): return self.sourceModel().columnCount(None) - 1 + def change_community(self, community): + self.community = community + self.sourceModel().change_community(community) + def setSourceModel(self, sourceModel): self.community = sourceModel.community super().setSourceModel(sourceModel) @@ -123,9 +127,17 @@ class NetworkTableModel(QAbstractTableModel): Node.CORRUPTED: self.tr('Corrupted') } + def change_community(self, community): + self.beginResetModel() + self.community = community + self.endResetModel() + @property def nodes(self): - return self.community.network.nodes + if self.community: + return self.community.network.nodes + else: + return [] def rowCount(self, parent): return len(self.nodes) diff --git a/src/cutecoin/tests/process_cfg_community/test_add_community.py b/src/cutecoin/tests/process_cfg_community/test_add_community.py index e3c3c760872639540c37066a6defb18d0f1a5c41..74d99d8cdaf54238ab59aed837998f01b4799b4a 100644 --- a/src/cutecoin/tests/process_cfg_community/test_add_community.py +++ b/src/cutecoin/tests/process_cfg_community/test_add_community.py @@ -51,7 +51,7 @@ class ProcessAddCommunity(unittest.TestCase): self.assertEqual(self.process_community.lineedit_server.text(), "127.0.0.1") self.assertEqual(self.process_community.spinbox_port.value(), 50000) QTest.mouseClick(self.process_community.button_checknode, Qt.LeftButton) - yield from asyncio.sleep(3000) + yield from asyncio.sleep(3) self.assertEqual(self.process_community.button_checknode.text(), "Ok !") self.assertEqual(mock.get_request(0).method, 'GET') self.assertEqual(mock.get_request(0).url, '/network/peering')