Просмотр исходного кода

Use image instead of custom message type

CURA-8601
Jaime van Kessel 3 лет назад
Родитель
Сommit
527de2b6ef

+ 353 - 0
plugins/UM3NetworkPrinting/resources/svg/CloudPlatform.svg

@@ -0,0 +1,353 @@
+<?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 274.75 126.24"
+   version="1.1"
+   id="svg425"
+   sodipodi:docname="CloudPlatform.svg"
+   width="274.75"
+   height="126.24"
+   inkscape:version="0.92.5 (2060ec1f9f, 2020-04-08)">
+  <metadata
+     id="metadata429">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <dc:title></dc:title>
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <sodipodi:namedview
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1"
+     objecttolerance="10"
+     gridtolerance="10"
+     guidetolerance="10"
+     inkscape:pageopacity="0"
+     inkscape:pageshadow="2"
+     inkscape:window-width="1920"
+     inkscape:window-height="1200"
+     id="namedview427"
+     showgrid="false"
+     fit-margin-left="1"
+     fit-margin-bottom="1"
+     fit-margin-top="1"
+     fit-margin-right="1"
+     inkscape:zoom="2.593819"
+     inkscape:cx="115.77157"
+     inkscape:cy="14.444977"
+     inkscape:window-x="0"
+     inkscape:window-y="0"
+     inkscape:window-maximized="1"
+     inkscape:current-layer="svg425" />
+  <defs
+     id="defs332">
+    <style
+       id="style330">.cls-1{fill:#f3f8fe;}.cls-2{fill:none;stroke:#061884;stroke-miterlimit:10;}.cls-3{fill:#061884;}.cls-4,.cls-6{fill:#fff;}.cls-4{fill-rule:evenodd;}.cls-5{fill:#dde9fd;}.cls-7{fill:#c5dbfb;}</style>
+  </defs>
+  <g
+     id="Layer_2"
+     data-name="Layer 2"
+     transform="translate(-28.84,-11.189998)">
+    <path
+       class="cls-1"
+       d="M 71.93,79.82 H 49.62 a 4.12,4.12 0 0 0 -4.13,4.11 v 47.55 a 4.13,4.13 0 0 0 4.13,4.12 h 22.31 a 4.13,4.13 0 0 0 4.13,-4.12 V 83.93 a 4.12,4.12 0 0 0 -4.13,-4.11 z m 2.18,51 a 2.82,2.82 0 0 1 -2.82,2.82 h -21 a 2.83,2.83 0 0 1 -2.82,-2.82 V 84.58 a 2.84,2.84 0 0 1 2.82,-2.83 h 5.92 a 1.45,1.45 0 0 0 1.45,1.46 h 6.3 a 1.46,1.46 0 0 0 1.46,-1.46 h 5.91 a 2.83,2.83 0 0 1 2.82,2.83 z"
+       id="path334"
+       inkscape:connector-curvature="0"
+       style="fill:#f3f8fe" />
+    <path
+       class="cls-2"
+       d="M 71.93,79.82 H 49.62 a 4.12,4.12 0 0 0 -4.13,4.11 v 47.55 a 4.13,4.13 0 0 0 4.13,4.12 h 22.31 a 4.13,4.13 0 0 0 4.13,-4.12 V 83.93 a 4.12,4.12 0 0 0 -4.13,-4.11 z"
+       id="path336"
+       inkscape:connector-curvature="0"
+       style="fill:none;stroke:#061884;stroke-miterlimit:10" />
+    <path
+       class="cls-3"
+       d="m 63.2,81 h -4.85 a 0.5,0.5 0 1 0 0,1 h 4.85 a 0.5,0.5 0 0 0 0,-1 z"
+       id="path338"
+       inkscape:connector-curvature="0"
+       style="fill:#061884" />
+    <path
+       class="cls-4"
+       d="m 74.11,84.58 v 46.26 a 2.82,2.82 0 0 1 -2.82,2.82 h -21 a 2.83,2.83 0 0 1 -2.82,-2.82 V 84.58 a 2.84,2.84 0 0 1 2.82,-2.83 h 5.92 a 1.45,1.45 0 0 0 1.45,1.46 h 6.3 a 1.46,1.46 0 0 0 1.46,-1.46 h 5.91 a 2.83,2.83 0 0 1 2.78,2.83 z"
+       id="path340"
+       inkscape:connector-curvature="0"
+       style="fill:#ffffff;fill-rule:evenodd" />
+    <rect
+       class="cls-5"
+       x="50.32"
+       y="125.88"
+       width="19.91"
+       height="4.7399998"
+       id="rect342"
+       style="fill:#dde9fd" />
+    <rect
+       class="cls-5"
+       x="50.32"
+       y="85.959999"
+       width="19.91"
+       height="1.9"
+       rx="0.94999999"
+       id="rect344"
+       style="fill:#dde9fd" />
+    <rect
+       class="cls-5"
+       x="50.32"
+       y="114.4"
+       width="10.43"
+       height="1.9"
+       rx="0.94999999"
+       id="rect346"
+       style="fill:#dde9fd" />
+    <rect
+       class="cls-5"
+       x="50.32"
+       y="117.25"
+       width="10.43"
+       height="1.9"
+       rx="0.94999999"
+       id="rect348"
+       style="fill:#dde9fd" />
+    <path
+       class="cls-1"
+       d="m 291.5,135.38 a 5.12,5.12 0 0 0 5.11,-5.11 v -0.38 a 0.38,0.38 0 0 0 -0.37,-0.37 h -103.9 a 0.37,0.37 0 0 0 -0.36,0.37 v 0.38 a 5.11,5.11 0 0 0 5.1,5.11 z"
+       id="path350"
+       inkscape:connector-curvature="0"
+       style="fill:#f3f8fe" />
+    <path
+       class="cls-3"
+       d="m 296.24,129.89 h -103.9 v 0.38 0 a 4.74,4.74 0 0 0 4.74,4.74 h 94.42 a 4.74,4.74 0 0 0 4.74,-4.74 v -0.38 m 0,-0.73 a 0.73,0.73 0 0 1 0.73,0.73 v 0.38 a 5.47,5.47 0 0 1 -5.47,5.47 h -94.42 a 5.47,5.47 0 0 1 -5.47,-5.47 v -0.38 a 0.73,0.73 0 0 1 0.73,-0.73 z"
+       id="path352"
+       inkscape:connector-curvature="0"
+       style="fill:#061884" />
+    <path
+       class="cls-3"
+       d="m 235.51,129.16 a 2.93,2.93 0 0 0 2.93,2.93 h 11.71 a 2.93,2.93 0 0 0 2.92,-2.93 z"
+       id="path354"
+       inkscape:connector-curvature="0"
+       style="fill:#061884" />
+    <path
+       class="cls-1"
+       d="M 287.83,129.52 V 71.36 a 2.56,2.56 0 0 0 -2.56,-2.56 h -81.95 a 2.56,2.56 0 0 0 -2.56,2.56 v 58.16 z"
+       id="path356"
+       inkscape:connector-curvature="0"
+       style="fill:#f3f8fe" />
+    <path
+       class="cls-2"
+       d="M 287.83,129.52 V 71.36 a 2.56,2.56 0 0 0 -2.56,-2.56 h -81.95 a 2.56,2.56 0 0 0 -2.56,2.56 v 58.16"
+       id="path358"
+       inkscape:connector-curvature="0"
+       style="fill:none;stroke:#061884;stroke-miterlimit:10" />
+    <path
+       class="cls-6"
+       d="m 284.17,128.79 v -56 a 0.36,0.36 0 0 0 -0.37,-0.36 h -79 a 0.36,0.36 0 0 0 -0.36,0.36 v 56 z"
+       id="path360"
+       inkscape:connector-curvature="0"
+       style="fill:#ffffff" />
+    <path
+       class="cls-1"
+       d="m 283.8,72.82 h -79 v 55.61 h 79 V 72.82 m 0.74,0 v 56.34 H 204.05 V 72.82 a 0.73,0.73 0 0 1 0.73,-0.73 h 79 a 0.74,0.74 0 0 1 0.76,0.73 z"
+       id="path362"
+       inkscape:connector-curvature="0"
+       style="fill:#f3f8fe" />
+    <path
+       class="cls-2"
+       d="M 204.11,129.57 V 73.86 a 1.64,1.64 0 0 1 1.64,-1.64 H 283 a 1.64,1.64 0 0 1 1.64,1.64 v 55.71"
+       id="path364"
+       inkscape:connector-curvature="0"
+       style="fill:none;stroke:#061884;stroke-miterlimit:10" />
+    <path
+       class="cls-2"
+       d="m 291.5,135.38 a 5.12,5.12 0 0 0 5.11,-5.11 v -0.38 a 0.38,0.38 0 0 0 -0.37,-0.37 h -103.9 a 0.37,0.37 0 0 0 -0.36,0.37 v 0.38 a 5.11,5.11 0 0 0 5.1,5.11 z"
+       id="path366"
+       inkscape:connector-curvature="0"
+       style="fill:none;stroke:#061884;stroke-miterlimit:10" />
+    <path
+       class="cls-3"
+       d="m 131.73,12.19 c -3.87,0 -8.7,5.75 -14.75,17.5 -4.63,9 -8.26,18.32 -8.3,18.41 a 0.86443623,0.86443623 0 0 0 1.61,0.63 c 5.46,-14.09 16.24,-36 21.88,-34.77 5.64,1.23 5.35,21.35 3.87,33.76 a 0.86142324,0.86142324 0 1 0 1.71,0.21 c 0.41,-3.45 3.75,-33.71 -5.22,-35.65 a 3.57,3.57 0 0 0 -0.8,-0.09 z"
+       id="path368"
+       inkscape:connector-curvature="0"
+       style="fill:#061884" />
+    <path
+       class="cls-3"
+       d="m 143.87,17.34 a 3.56,3.56 0 0 0 -0.8,0.08 c -9,1.94 -5.63,32.2 -5.22,35.65 a 0.86142324,0.86142324 0 1 0 1.71,-0.21 c -1.48,-12.41 -1.74,-32.55 3.87,-33.76 5.61,-1.21 16.42,20.68 21.88,34.77 a 0.86443623,0.86443623 0 1 0 1.61,-0.63 c 0,-0.09 -3.67,-9.42 -8.3,-18.41 -6.05,-11.75 -10.88,-17.49 -14.75,-17.49 z"
+       id="path370"
+       inkscape:connector-curvature="0"
+       style="fill:#061884" />
+    <path
+       class="cls-1"
+       d="m 178,135.58 a 2.25,2.25 0 0 0 2.24,-2.24 v -84 A 2.3,2.3 0 0 0 178,47 H 94.81 a 2.29,2.29 0 0 0 -2.24,2.29 v 84 a 2.24,2.24 0 0 0 2.24,2.24 h 6 l 0.69,-0.38 c 3.56,-2 3.94,-2.2 8.66,-2.2 h 51.59 c 4.72,0 5.09,0.21 8.66,2.2 l 0.69,0.38 z"
+       id="path372"
+       inkscape:connector-curvature="0"
+       style="fill:#f3f8fe" />
+    <path
+       class="cls-3"
+       d="M 178,47.45 H 94.81 A 1.85,1.85 0 0 0 93,49.31 v 84 0 a 1.81,1.81 0 0 0 1.81,1.81 h 5.93 c 4.15,-2.3 4.37,-2.58 9.46,-2.58 h 51.59 c 5.08,0 5.31,0.28 9.46,2.58 H 178 a 1.81,1.81 0 0 0 1.81,-1.81 v -84 A 1.85,1.85 0 0 0 178,47.45 m 2.67,1.86 v 84 A 2.68,2.68 0 0 1 178,136 h -7 l -0.19,-0.11 -0.59,-0.33 c -3.55,-2 -3.84,-2.14 -8.45,-2.14 H 110.2 c -4.61,0 -4.9,0.16 -8.45,2.14 l -0.59,0.33 -0.2,0.11 h -6.15 a 2.66,2.66 0 0 1 -2.67,-2.67 v -84 a 2.69,2.69 0 0 1 2.67,-2.72 H 178 a 2.7,2.7 0 0 1 2.71,2.7 z"
+       id="path374"
+       inkscape:connector-curvature="0"
+       style="fill:#061884" />
+    <rect
+       class="cls-3"
+       x="111.92"
+       y="126.55"
+       width="3.4400001"
+       height="0.86000001"
+       id="rect376"
+       style="fill:#061884" />
+    <circle
+       class="cls-3"
+       cx="102.46"
+       cy="50.029999"
+       r="0.86000001"
+       id="circle378"
+       style="fill:#061884" />
+    <circle
+       class="cls-3"
+       cx="124.81"
+       cy="50.029999"
+       r="0.86000001"
+       id="circle380"
+       style="fill:#061884" />
+    <circle
+       class="cls-3"
+       cx="147.17"
+       cy="50.029999"
+       r="0.86000001"
+       id="circle382"
+       style="fill:#061884" />
+    <circle
+       class="cls-3"
+       cx="169.53"
+       cy="50.029999"
+       r="0.86000001"
+       id="circle384"
+       style="fill:#061884" />
+    <circle
+       class="cls-3"
+       cx="102.46"
+       cy="126.55"
+       r="0.86000001"
+       id="circle386"
+       style="fill:#061884" />
+    <circle
+       class="cls-3"
+       cx="169.53"
+       cy="126.55"
+       r="0.86000001"
+       id="circle388"
+       style="fill:#061884" />
+    <path
+       class="cls-6"
+       d="m 168.52,121.82 a 6.6,6.6 0 0 0 6.6,-6.59 V 60.42 A 3.1,3.1 0 0 0 172,57.34 h -71.19 a 3.08,3.08 0 0 0 -3.08,3.08 v 54.81 a 6.59,6.59 0 0 0 6.6,6.59 z"
+       id="path390"
+       inkscape:connector-curvature="0"
+       style="fill:#ffffff" />
+    <path
+       class="cls-1"
+       d="m 172,57.77 h -71.19 a 2.65,2.65 0 0 0 -2.65,2.65 v 54.81 a 6.16,6.16 0 0 0 6.17,6.16 h 64.19 a 6.18,6.18 0 0 0 6.17,-6.16 V 60.42 A 2.66,2.66 0 0 0 172,57.77 m 3.52,2.65 v 54.81 0 a 7,7 0 0 1 -7,7 h -64.19 a 7,7 0 0 1 -7,-7 V 60.42 a 3.51,3.51 0 0 1 3.51,-3.51 H 172 a 3.52,3.52 0 0 1 3.55,3.51 z"
+       id="path392"
+       inkscape:connector-curvature="0"
+       style="fill:#f3f8fe" />
+    <path
+       class="cls-3"
+       d="m 172,56.91 h -71.19 a 3.51,3.51 0 0 0 -3.51,3.51 v 54.81 a 7,7 0 0 0 7,7 h 64.19 a 7,7 0 0 0 7,-7 V 60.42 A 3.52,3.52 0 0 0 172,56.91 m 4.38,3.51 v 54.81 a 7.9,7.9 0 0 1 -7.89,7.88 h -64.16 a 7.88,7.88 0 0 1 -7.89,-7.88 V 60.42 a 4.37,4.37 0 0 1 4.37,-4.37 H 172 a 4.38,4.38 0 0 1 4.41,4.37 z"
+       id="path394"
+       inkscape:connector-curvature="0"
+       style="fill:#061884" />
+    <path
+       class="cls-7"
+       d="m 146.31,118 h -20.64 v 10.32 h 20.64 V 118 m 0,-0.85 v 0 a 0.83,0.83 0 0 1 0.84,0.83 v 10.32 0 a 0.83,0.83 0 0 1 -0.84,0.83 h -20.66 a 0.84,0.84 0 0 1 -0.84,-0.83 v -10.37 a 0.84,0.84 0 0 1 0.84,-0.83 z"
+       id="path396"
+       inkscape:connector-curvature="0"
+       style="fill:#c5dbfb" />
+    <path
+       class="cls-6"
+       d="m 142.1,65.93 a 1.35,1.35 0 0 0 1.29,-1 L 145,58.77 v -2.29 h -18 v 2.29 l 1.6,6.23 a 1.34,1.34 0 0 0 1.28,1 z"
+       id="path398"
+       inkscape:connector-curvature="0"
+       style="fill:#ffffff" />
+    <path
+       class="cls-3"
+       d="m 144.59,56.91 h -17.2 v 1.8 l 1.61,6.14 a 0.9,0.9 0 0 0 0.87,0.65 h 12.23 a 0.89,0.89 0 0 0 0.87,-0.65 l 1.62,-6.14 v -1.8 m 0.86,-0.86 v 2.78 0.1 l -1.62,6.16 a 1.77,1.77 0 0 1 -1.7,1.27 h -12.25 a 1.78,1.78 0 0 1 -1.7,-1.29 l -1.62,-6.14 v -0.1 -2.78 z"
+       id="path400"
+       inkscape:connector-curvature="0"
+       style="fill:#061884" />
+    <path
+       class="cls-6"
+       d="m 140.19,67.65 h 0.15 a 1.34,1.34 0 0 0 1.17,-1.48 l -0.84,-7.11 h -9.36 l -0.84,7.11 v 0.15 a 1.32,1.32 0 0 0 1.33,1.33 z"
+       id="path402"
+       inkscape:connector-curvature="0"
+       style="fill:#ffffff" />
+    <path
+       class="cls-3"
+       d="m 140.29,59.49 h -8.6 l -0.79,6.73 v 0.1 a 0.9,0.9 0 0 0 0.9,0.9 h 8.49 a 0.9,0.9 0 0 0 0.79,-1 l -0.79,-6.73 m 0.77,-0.86 0.09,0.76 0.79,6.74 a 1.21,1.21 0 0 1 0,0.19 1.76,1.76 0 0 1 -1.76,1.76 h -8.58 a 1.76,1.76 0 0 1 -1.55,-1.95 l 0.79,-6.73 0.09,-0.76 z"
+       id="path404"
+       inkscape:connector-curvature="0"
+       style="fill:#061884" />
+    <path
+       class="cls-6"
+       d="m 147,59.06 a 2.59,2.59 0 0 0 0,-5.16 h -22 a 2.59,2.59 0 0 0 0,5.16 z"
+       id="path406"
+       inkscape:connector-curvature="0"
+       style="fill:#ffffff" />
+    <path
+       class="cls-3"
+       d="m 147,54.33 h -22 a 2,2 0 0 0 -1.92,2.13 2.07,2.07 0 0 0 1.92,2.17 h 22 a 2.07,2.07 0 0 0 1.92,-2.17 2,2 0 0 0 -1.92,-2.13 m 2.78,2.13 a 2.92,2.92 0 0 1 -2.78,3 h -22 a 3,3 0 0 1 0,-6 h 22 a 2.9,2.9 0 0 1 2.75,3 z"
+       id="path408"
+       inkscape:connector-curvature="0"
+       style="fill:#061884" />
+    <rect
+       class="cls-3"
+       x="135.56"
+       y="54.330002"
+       width="0.86000001"
+       height="4.3699999"
+       id="rect410"
+       style="fill:#061884" />
+    <line
+       class="cls-2"
+       x1="29.84"
+       y1="135.92999"
+       x2="302.59"
+       y2="135.92999"
+       id="line412"
+       style="fill:none;stroke:#061884;stroke-miterlimit:10" />
+    <polygon
+       class="cls-5"
+       points="112.35,101.51 124.06,121.81 147.5,121.81 159.22,101.51 147.5,81.22 124.06,81.22 "
+       id="polygon414"
+       style="fill:#dde9fd" />
+    <polygon
+       class="cls-5"
+       points="224.57,103.51 234.68,121.01 254.89,121.01 264.99,103.51 254.89,86.01 234.68,86.01 "
+       id="polygon416"
+       style="fill:#dde9fd" />
+    <path
+       class="cls-6"
+       d="m 125.65,117.53 a 0.41,0.41 0 0 0 -0.41,0.4 v 10.37 0 a 0.41,0.41 0 0 0 0.41,0.4 h 20.68 a 0.4,0.4 0 0 0 0.41,-0.4 v -10.37 0 a 0.4,0.4 0 0 0 -0.41,-0.4 z"
+       id="path418"
+       inkscape:connector-curvature="0"
+       style="fill:#ffffff" />
+    <path
+       class="cls-3"
+       d="m 146.33,117.1 h -20.68 a 0.84,0.84 0 0 0 -0.84,0.83 v 10.37 a 0.84,0.84 0 0 0 0.84,0.83 h 20.68 a 0.83,0.83 0 0 0 0.84,-0.83 v -10.37 0 a 0.83,0.83 0 0 0 -0.84,-0.83 m 1.7,0.83 v 10.37 a 1.7,1.7 0 0 1 -1.7,1.69 h -20.68 a 1.7,1.7 0 0 1 -1.7,-1.69 v -10.37 a 1.7,1.7 0 0 1 1.7,-1.69 h 20.68 a 1.7,1.7 0 0 1 1.67,1.69 z"
+       id="path420"
+       inkscape:connector-curvature="0"
+       style="fill:#061884" />
+    <polygon
+       class="cls-5"
+       points="50.22,101.67 55.22,110.33 65.22,110.33 70.22,101.67 65.22,93.01 55.22,93.01 "
+       id="polygon422"
+       style="fill:#dde9fd" />
+  </g>
+</svg>

+ 5 - 2
plugins/UM3NetworkPrinting/src/Messages/CloudFlowMessage.py

@@ -16,12 +16,15 @@ I18N_CATALOG = i18nCatalog("cura")
 class CloudFlowMessage(Message):
 
     def __init__(self, printer_name: str) -> None:
-
+        image_path = os.path.join(
+            CuraApplication.getInstance().getPluginRegistry().getPluginPath("UM3NetworkPrinting") or "",
+            "resources", "svg", "CloudPlatform.svg"
+        )
         super().__init__(
             text=I18N_CATALOG.i18nc("@info:status",
                                     f"Your printer <b>{printer_name}</b> could be connected via cloud.\n Manage your print queue and monitor your prints from anywhere connecting your printer to Digital Factory"),
             title=I18N_CATALOG.i18nc("@info:title", "Are you ready for cloud printing?"),
-            message_type=Message.MessageType.CLOUD
+            image_source=QUrl.fromLocalFile(image_path)
         )
         self._printer_name = printer_name
         self.addAction("get_started", I18N_CATALOG.i18nc("@action", "Get started"), "", "")

+ 1 - 1
resources/themes/cura-light/theme.json

@@ -626,7 +626,7 @@
         "message_close": [1, 1],
         "message_radius": [0.25, 0.25],
         "message_action_button": [0, 2.5],
-        "message_image": [15.0, 5.0],
+        "message_image": [15.0, 10.0],
         "message_type_icon": [2, 2],
 
         "infill_button_margin": [0.5, 0.5],