Mockup grid view

This commit is contained in:
Spiros
2025-04-23 14:35:54 +03:00
parent 0ca4429162
commit 086376086c
11 changed files with 1232 additions and 3 deletions

250
dist/status/Disk_Bad.svg vendored Normal file
View File

@@ -0,0 +1,250 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
viewBox="0 0 48 48"
version="1.1"
id="svg40"
sodipodi:docname="QDiskInfo_Bad.svg"
inkscape:version="1.4 (e7c3feb100, 2024-10-09)"
xml:space="preserve"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"><defs
id="defs40"><clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath1"><path
d="M 0,0 H 34 V 34 H 0 Z"
id="path1" /></clipPath><clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath2"><path
d="M 0,0 H 34 V 34 H 0 Z"
id="path2" /></clipPath><clipPath
id="clipPath18"><path
d="M 0,38 38,38 38,0 0,0 0,38 z"
id="path20-3" /></clipPath></defs><sodipodi:namedview
id="namedview40"
pagecolor="#ffffff"
bordercolor="#000000"
borderopacity="0.25"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="false"
inkscape:deskcolor="#d1d1d1"
showgrid="false"
inkscape:zoom="11.166667"
inkscape:cx="21.044775"
inkscape:cy="17.776119"
inkscape:window-width="1600"
inkscape:window-height="1172"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="g1" /><linearGradient
id="a"
x1="6"
x2="6"
y1="58"
y2="6"
gradientUnits="userSpaceOnUse"><stop
stop-color="#98a7b0"
offset="0"
id="stop1" /><stop
stop-color="#dde1e3"
offset="1"
id="stop2" /></linearGradient><linearGradient
id="b"><stop
stop-color="#292c2f"
offset="0"
id="stop3" /><stop
stop-opacity="0"
offset="1"
id="stop4" /></linearGradient><linearGradient
id="c"
x1=".593691"
x2="76.196591"
y1="36.119742"
y2="36.119742"
gradientTransform="matrix(.99166665 0 0 1 .029538 -.046272)"
gradientUnits="userSpaceOnUse"
xlink:href="#b" /><linearGradient
id="d"
x1="388.423"
x2="388.423"
y1="557.79797"
y2="505.798"
gradientTransform="matrix(.83152667 0 0 .76922858 -321.64966 -385.07572)"
gradientUnits="userSpaceOnUse"><stop
stop-color="#7f8c8d"
offset="0"
id="stop5" /><stop
stop-color="#afb0b3"
offset="1"
id="stop6" /></linearGradient><linearGradient
id="e"
x1="-421.44699"
x2="-410.44699"
y1="-504.20401"
y2="-493.20401"
gradientTransform="matrix(1.4166667 0 0 1.4285715 1.333333 1.142857)"
gradientUnits="userSpaceOnUse"
xlink:href="#b" /><linearGradient
id="f"
x1="1.333"
x2="1.333"
y1="48.714001"
y2="9.714"
gradientTransform="matrix(.73913167 0 0 .76922858 .347333 -.614286)"
gradientUnits="userSpaceOnUse"><stop
stop-color="#eef1f2"
offset="0"
id="stop7" /><stop
stop-color="#f9fafb"
offset="1"
id="stop8" /></linearGradient><linearGradient
id="g"
x1="6"
x2="6"
y1="58"
y2="6"
gradientTransform="matrix(.41954831 0 0 .42307393 10.574493 8.318726)"
gradientUnits="userSpaceOnUse"
xlink:href="#a" /><linearGradient
id="h"
x1="32"
x2="32"
y1="58"
y2="32"
gradientTransform="matrix(-.41954831 0 0 .42307393 37.425586 8.318726)"
gradientUnits="userSpaceOnUse"><stop
stop-color="#8e44ad"
offset="0"
id="stop9" /><stop
stop-color="#af7ac4"
offset="1"
id="stop10" /></linearGradient><linearGradient
id="i"
x1="32"
x2="32"
y1="58"
y2="32"
gradientTransform="matrix(.41954831 0 0 .42307393 10.574493 8.318726)"
gradientUnits="userSpaceOnUse"><stop
stop-color="#fdad23"
offset="0"
id="stop11" /><stop
stop-color="#fdc96f"
offset="1"
id="stop12" /></linearGradient><linearGradient
id="j"
x1="32"
x2="32"
y1="32"
y2="6"
gradientTransform="matrix(.41954831 0 0 .42307393 10.574493 8.318726)"
gradientUnits="userSpaceOnUse"><stop
stop-color="#27ad60"
offset="0"
id="stop13" /><stop
stop-color="#58d68d"
offset="1"
id="stop14" /></linearGradient><linearGradient
id="k"
x1="32"
x2="32"
y1="32"
y2="6"
gradientTransform="matrix(.41954831 0 0 .42307393 10.574493 8.318726)"
gradientUnits="userSpaceOnUse"><stop
stop-color="#1190d9"
offset="0"
id="stop15" /><stop
stop-color="#73c4ef"
offset="1"
id="stop16" /></linearGradient><linearGradient
id="l"
x1="32"
x2="32"
y1="41"
y2="23"
gradientTransform="matrix(.41954831 0 0 .42307393 10.574493 8.318726)"
gradientUnits="userSpaceOnUse"><stop
stop-color="#cecece"
offset="0"
id="stop17" /><stop
stop-color="#ececec"
offset="1"
id="stop18" /></linearGradient><linearGradient
id="m"
x1="32"
x2="32"
y1="36"
y2="28"
gradientTransform="matrix(.41954831 0 0 .42307393 10.574493 8.318726)"
gradientUnits="userSpaceOnUse"><stop
stop-color="#5c7274"
offset="0"
id="stop19" /><stop
stop-color="#a4a4a4"
offset="1"
id="stop20" /></linearGradient><linearGradient
id="n"
x1="32"
x2="32"
y1="35"
y2="29"
gradientTransform="matrix(.41954831 0 0 .42307393 10.574493 8.318726)"
gradientUnits="userSpaceOnUse"
xlink:href="#a" /><g
stroke-width="1"
id="g28"><path
d="m6.9999999 3.9999995h34v40h-34z"
fill="url(#d)"
id="path20" /><path
d="m11.25 39.714286h25.499999v4.285714h-25.499999z"
fill="#292c2e"
id="path21" /><path
d="m14.083333 41.142857h12.75v1.428572h-12.75zm14.166667 0h5.666667v1.428572h-5.666667z"
fill="#f6b44d"
id="path22" /><path
d="m35.333332 39.714286h5.666668v4.285714h-5.666668zm-28.333332 0h5.6666661v4.285714h-5.6666661z"
fill="#292c2f"
opacity=".2"
id="path23" /><path
d="m6.9999999 39.714286h5.6666661v4.285714h-1.416666zm28.333332 0h5.666668v4.285714h-5.666668z"
fill="#292c2f"
opacity=".2"
id="path24" /><path
d="m36.09125 8.9499995 4.90875 4.9471435v30.102857h-19.833334l-11.333333-11.428571z"
fill="url(#e)"
opacity=".2"
id="path25" /><path
d="m16.916665 6.8571424a7.0833333 7.1428572 0 0 0 -7.0833318 7.1428576v6.811429a4.25 4.2857144 0 0 1 1.4109998 3.024284 2.8333333 2.8571429 0 0 1 .0058.164288 2.8333333 2.8571429 0 0 1 -.01417.285713 4.25 4.2857144 0 0 1 0 .0072 4.25 4.2857144 0 0 1 -1.4025004 2.892858v5.385714l4.2499504 4.285714h19.833334l4.25-4.285714v-5.382858a4.25 4.2857144 0 0 1 -1.411-3.024286 2.8333333 2.8571429 0 0 1 -.0058-.164284 2.8333333 2.8571429 0 0 1 .01417-.292858 4.25 4.2857144 0 0 1 1.402501-2.892857v-6.814343a7.0833333 7.1428572 0 0 0 -7.083285-7.1428576z"
fill="url(#f)"
id="path26" /><path
d="m6.9999999 42.571429h4.2500001v1.428571h-4.2500001zm29.749999 0h4.250001v1.428571h-4.250001z"
fill="#292c2f"
opacity=".2"
id="path27" /><path
d="m24.00004 18.049429a3.7759347 3.8076653 0 0 0 -3.775934 3.807664 3.7759347 3.8076653 0 0 0 3.775934 3.807665 3.7759347 3.8076653 0 0 0 3.775934-3.807665 3.7759347 3.8076653 0 0 0 -3.775934-3.807664zm0 2.538442c.697289 0 1.258644.566073 1.258644 1.269222s-.561355 1.269223-1.258644 1.269223c-.69729 0-1.258646-.566074-1.258646-1.269223s.561356-1.269222 1.258646-1.269222z"
fill="url(#g)"
id="path28" /></g><g
id="g1"
inkscape:groupmode="layer"
inkscape:label="1"
transform="translate(1,2)"><g
id="g2"
transform="matrix(0.03053888,0,0,0.03053888,32.426848,-2)"><g
id="g1-5">
<path
class="st0"
d="M 238.6,0 C 106.8,0 0,106.8 0,238.6 0,370.4 106.8,477.2 238.6,477.2 370.4,477.2 477.2,370.4 477.2,238.6 477.2,106.8 370.4,0 238.6,0 m 118.6,298.9 c 16.1,16.1 16.1,42.2 0,58.3 -8.1,8.1 -18.6,12.1 -29.1,12.1 -10.5,0 -21.1,-4 -29.1,-12.1 l -60.3,-60.3 -60.3,60.3 c -8.1,8.1 -18.6,12.1 -29.1,12.1 -10.5,0 -21.1,-4 -29.1,-12.1 -16.1,-16.1 -16.1,-42.2 0,-58.3 L 180.5,238.6 120,178.3 c -16.1,-16.1 -16.1,-42.2 0,-58.3 16.1,-16.1 42.2,-16.1 58.3,0 l 60.3,60.3 60.3,-60.3 c 16.1,-16.1 42.2,-16.1 58.3,0 16.1,16.1 16.1,42.2 0,58.3 l -60.3,60.3 z"
id="path1-3" />
</g><path
style="fill:#ffffff;stroke-width:0.55522"
d="m 136.97944,377.93852 c -19.97441,-3.17473 -34.96197,-18.61725 -37.4893,-38.6273 -0.79101,-6.26281 -0.12388,-12.40797 2.05774,-18.9543 3.07972,-9.24129 3.00063,-9.15005 40.74165,-46.99942 l 34.76854,-34.86835 -34.23417,-33.97906 c -18.82879,-18.68849 -34.97331,-35.10339 -35.87673,-36.47757 -2.57305,-3.91378 -4.90104,-8.83044 -6.31862,-13.34487 -1.12006,-3.56695 -1.29887,-5.26663 -1.28297,-12.19529 0.0174,-7.62798 0.11396,-8.32767 1.83733,-13.32531 4.11856,-11.94355 12.11353,-20.97184 23.12916,-26.11855 6.55761,-3.063864 11.11062,-4.059043 18.5999,-4.065519 10.33112,-0.0083 19.32504,3.148759 27.31901,9.591539 2.22804,1.79571 18.53861,17.7794 36.24572,35.51932 l 32.19475,32.25443 34.15419,-34.04328 c 21.12789,-21.05928 35.3733,-34.83356 37.35064,-36.11537 7.64349,-4.95491 15.25839,-7.21447 24.28698,-7.206639 7.29327,0.0062 11.94522,0.986096 18.14166,3.820969 11.55271,5.28538 19.29707,13.96019 23.61374,26.45082 1.69354,4.90043 1.79356,5.63149 1.811,13.23759 0.0158,6.92866 -0.16293,8.62834 -1.28299,12.19529 -1.43857,4.58124 -3.79188,9.52684 -6.35007,13.34487 -0.9207,1.37418 -16.93375,17.80178 -35.58448,36.50579 l -33.91044,34.0073 33.91044,34.00729 c 18.65073,18.70401 34.66378,35.13161 35.58448,36.50579 2.55819,3.81803 4.9115,8.76362 6.35007,13.34487 1.12006,3.56696 1.29888,5.26663 1.28299,12.1953 -0.0174,7.6061 -0.11746,8.33716 -1.811,13.23758 -4.3277,12.52258 -12.00284,21.10429 -23.7142,26.51529 -5.99079,2.76791 -10.63348,3.7325 -18.0412,3.74836 -9.24395,0.0198 -16.82374,-2.28202 -24.52688,-7.44827 -2.21965,-1.48865 -15.9779,-14.78166 -37.39239,-36.12799 l -33.8806,-33.77273 -33.02355,33.0582 c -18.16295,18.182 -34.52263,34.20568 -36.35486,35.60818 -4.02976,3.08459 -10.91164,6.38084 -15.85216,7.59279 -4.44065,1.08934 -12.55844,1.54732 -16.45338,0.92825 z"
id="path2-5" /></g></g><style
type="text/css"
id="style1">
.st0{fill:#F96464;}
</style></svg>

After

Width:  |  Height:  |  Size: 10 KiB

251
dist/status/Disk_Good.svg vendored Normal file
View File

@@ -0,0 +1,251 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
viewBox="0 0 48 48"
version="1.1"
id="svg40"
sodipodi:docname="QDiskInfo_Good.svg"
inkscape:version="1.4 (e7c3feb100, 2024-10-09)"
xml:space="preserve"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"><defs
id="defs40"><clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath1"><path
d="M 0,0 H 34 V 34 H 0 Z"
id="path1" /></clipPath><clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath2"><path
d="M 0,0 H 34 V 34 H 0 Z"
id="path2" /></clipPath><clipPath
id="clipPath18"><path
d="M 0,38 38,38 38,0 0,0 0,38 z"
id="path20-3" /></clipPath></defs><sodipodi:namedview
id="namedview40"
pagecolor="#ffffff"
bordercolor="#000000"
borderopacity="0.25"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="false"
inkscape:deskcolor="#d1d1d1"
showgrid="false"
inkscape:zoom="11.166667"
inkscape:cx="21.044775"
inkscape:cy="17.776119"
inkscape:window-width="1600"
inkscape:window-height="1172"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="g1" /><linearGradient
id="a"
x1="6"
x2="6"
y1="58"
y2="6"
gradientUnits="userSpaceOnUse"><stop
stop-color="#98a7b0"
offset="0"
id="stop1" /><stop
stop-color="#dde1e3"
offset="1"
id="stop2" /></linearGradient><linearGradient
id="b"><stop
stop-color="#292c2f"
offset="0"
id="stop3" /><stop
stop-opacity="0"
offset="1"
id="stop4" /></linearGradient><linearGradient
id="c"
x1=".593691"
x2="76.196591"
y1="36.119742"
y2="36.119742"
gradientTransform="matrix(.99166665 0 0 1 .029538 -.046272)"
gradientUnits="userSpaceOnUse"
xlink:href="#b" /><linearGradient
id="d"
x1="388.423"
x2="388.423"
y1="557.79797"
y2="505.798"
gradientTransform="matrix(.83152667 0 0 .76922858 -321.64966 -385.07572)"
gradientUnits="userSpaceOnUse"><stop
stop-color="#7f8c8d"
offset="0"
id="stop5" /><stop
stop-color="#afb0b3"
offset="1"
id="stop6" /></linearGradient><linearGradient
id="e"
x1="-421.44699"
x2="-410.44699"
y1="-504.20401"
y2="-493.20401"
gradientTransform="matrix(1.4166667 0 0 1.4285715 1.333333 1.142857)"
gradientUnits="userSpaceOnUse"
xlink:href="#b" /><linearGradient
id="f"
x1="1.333"
x2="1.333"
y1="48.714001"
y2="9.714"
gradientTransform="matrix(.73913167 0 0 .76922858 .347333 -.614286)"
gradientUnits="userSpaceOnUse"><stop
stop-color="#eef1f2"
offset="0"
id="stop7" /><stop
stop-color="#f9fafb"
offset="1"
id="stop8" /></linearGradient><linearGradient
id="g"
x1="6"
x2="6"
y1="58"
y2="6"
gradientTransform="matrix(.41954831 0 0 .42307393 10.574493 8.318726)"
gradientUnits="userSpaceOnUse"
xlink:href="#a" /><linearGradient
id="h"
x1="32"
x2="32"
y1="58"
y2="32"
gradientTransform="matrix(-.41954831 0 0 .42307393 37.425586 8.318726)"
gradientUnits="userSpaceOnUse"><stop
stop-color="#8e44ad"
offset="0"
id="stop9" /><stop
stop-color="#af7ac4"
offset="1"
id="stop10" /></linearGradient><linearGradient
id="i"
x1="32"
x2="32"
y1="58"
y2="32"
gradientTransform="matrix(.41954831 0 0 .42307393 10.574493 8.318726)"
gradientUnits="userSpaceOnUse"><stop
stop-color="#fdad23"
offset="0"
id="stop11" /><stop
stop-color="#fdc96f"
offset="1"
id="stop12" /></linearGradient><linearGradient
id="j"
x1="32"
x2="32"
y1="32"
y2="6"
gradientTransform="matrix(.41954831 0 0 .42307393 10.574493 8.318726)"
gradientUnits="userSpaceOnUse"><stop
stop-color="#27ad60"
offset="0"
id="stop13" /><stop
stop-color="#58d68d"
offset="1"
id="stop14" /></linearGradient><linearGradient
id="k"
x1="32"
x2="32"
y1="32"
y2="6"
gradientTransform="matrix(.41954831 0 0 .42307393 10.574493 8.318726)"
gradientUnits="userSpaceOnUse"><stop
stop-color="#1190d9"
offset="0"
id="stop15" /><stop
stop-color="#73c4ef"
offset="1"
id="stop16" /></linearGradient><linearGradient
id="l"
x1="32"
x2="32"
y1="41"
y2="23"
gradientTransform="matrix(.41954831 0 0 .42307393 10.574493 8.318726)"
gradientUnits="userSpaceOnUse"><stop
stop-color="#cecece"
offset="0"
id="stop17" /><stop
stop-color="#ececec"
offset="1"
id="stop18" /></linearGradient><linearGradient
id="m"
x1="32"
x2="32"
y1="36"
y2="28"
gradientTransform="matrix(.41954831 0 0 .42307393 10.574493 8.318726)"
gradientUnits="userSpaceOnUse"><stop
stop-color="#5c7274"
offset="0"
id="stop19" /><stop
stop-color="#a4a4a4"
offset="1"
id="stop20" /></linearGradient><linearGradient
id="n"
x1="32"
x2="32"
y1="35"
y2="29"
gradientTransform="matrix(.41954831 0 0 .42307393 10.574493 8.318726)"
gradientUnits="userSpaceOnUse"
xlink:href="#a" /><g
stroke-width="1"
id="g28"><path
d="m6.9999999 3.9999995h34v40h-34z"
fill="url(#d)"
id="path20" /><path
d="m11.25 39.714286h25.499999v4.285714h-25.499999z"
fill="#292c2e"
id="path21" /><path
d="m14.083333 41.142857h12.75v1.428572h-12.75zm14.166667 0h5.666667v1.428572h-5.666667z"
fill="#f6b44d"
id="path22" /><path
d="m35.333332 39.714286h5.666668v4.285714h-5.666668zm-28.333332 0h5.6666661v4.285714h-5.6666661z"
fill="#292c2f"
opacity=".2"
id="path23" /><path
d="m6.9999999 39.714286h5.6666661v4.285714h-1.416666zm28.333332 0h5.666668v4.285714h-5.666668z"
fill="#292c2f"
opacity=".2"
id="path24" /><path
d="m36.09125 8.9499995 4.90875 4.9471435v30.102857h-19.833334l-11.333333-11.428571z"
fill="url(#e)"
opacity=".2"
id="path25" /><path
d="m16.916665 6.8571424a7.0833333 7.1428572 0 0 0 -7.0833318 7.1428576v6.811429a4.25 4.2857144 0 0 1 1.4109998 3.024284 2.8333333 2.8571429 0 0 1 .0058.164288 2.8333333 2.8571429 0 0 1 -.01417.285713 4.25 4.2857144 0 0 1 0 .0072 4.25 4.2857144 0 0 1 -1.4025004 2.892858v5.385714l4.2499504 4.285714h19.833334l4.25-4.285714v-5.382858a4.25 4.2857144 0 0 1 -1.411-3.024286 2.8333333 2.8571429 0 0 1 -.0058-.164284 2.8333333 2.8571429 0 0 1 .01417-.292858 4.25 4.2857144 0 0 1 1.402501-2.892857v-6.814343a7.0833333 7.1428572 0 0 0 -7.083285-7.1428576z"
fill="url(#f)"
id="path26" /><path
d="m6.9999999 42.571429h4.2500001v1.428571h-4.2500001zm29.749999 0h4.250001v1.428571h-4.250001z"
fill="#292c2f"
opacity=".2"
id="path27" /><path
d="m24.00004 18.049429a3.7759347 3.8076653 0 0 0 -3.775934 3.807664 3.7759347 3.8076653 0 0 0 3.775934 3.807665 3.7759347 3.8076653 0 0 0 3.775934-3.807665 3.7759347 3.8076653 0 0 0 -3.775934-3.807664zm0 2.538442c.697289 0 1.258644.566073 1.258644 1.269222s-.561355 1.269223-1.258644 1.269223c-.69729 0-1.258646-.566074-1.258646-1.269223s.561356-1.269222 1.258646-1.269222z"
fill="url(#g)"
id="path28" /></g><g
id="g1"
inkscape:groupmode="layer"
inkscape:label="1"
transform="translate(1,2)"><g
id="g4"
transform="matrix(0.32338308,0,0,0.32338308,32.447762,-2)"><path
d="m 33.75,30 c 0,2.07 -1.68,3.75 -3.75,3.75 H 3.75 C 1.68,33.75 0,32.07 0,30 V 3.75 C 0,1.68 1.68,0 3.75,0 H 30 c 2.07,0 3.75,1.68 3.75,3.75 z"
style="fill:#77b255;fill-opacity:1;fill-rule:nonzero;stroke:none"
transform="scale(1.3333333)"
clip-path="url(#clipPath1)"
id="path3" /><path
d="M 12.656,27.188 C 12.055,27.188 11.457,26.957 11,26.5 L 4.906,20.406 c -0.918,-0.914 -0.918,-2.398 0,-3.312 0.914,-0.918 2.399,-0.918 3.313,0 l 4.437,4.437 12.875,-12.875 c 0.914,-0.918 2.399,-0.918 3.313,0 0.918,0.914 0.918,2.399 0,3.313 L 14.312,26.5 c -0.457,0.457 -1.054,0.688 -1.656,0.688"
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
transform="scale(1.3333333)"
clip-path="url(#clipPath2)"
id="path4" /></g></g><style
type="text/css"
id="style1">
.st0{fill:#F96464;}
</style></svg>

After

Width:  |  Height:  |  Size: 8.7 KiB

252
dist/status/Disk_Unknown.svg vendored Normal file
View File

@@ -0,0 +1,252 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
viewBox="0 0 48 48"
version="1.1"
id="svg40"
sodipodi:docname="Disk_Unknown.svg"
inkscape:version="1.4 (e7c3feb100, 2024-10-09)"
xml:space="preserve"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"><defs
id="defs40"><clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath1"><path
d="M 0,0 H 34 V 34 H 0 Z"
id="path1" /></clipPath><clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath2"><path
d="M 0,0 H 34 V 34 H 0 Z"
id="path2" /></clipPath><clipPath
id="clipPath18"><path
d="M 0,38 38,38 38,0 0,0 0,38 z"
id="path20-3" /></clipPath><clipPath
id="clipPath18-3"><path
d="M 0,38 38,38 38,0 0,0 0,38 z"
id="path20-6" /></clipPath></defs><sodipodi:namedview
id="namedview40"
pagecolor="#ffffff"
bordercolor="#000000"
borderopacity="0.25"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="false"
inkscape:deskcolor="#d1d1d1"
showgrid="false"
inkscape:zoom="11.166667"
inkscape:cx="20.999999"
inkscape:cy="17.776119"
inkscape:window-width="1600"
inkscape:window-height="1172"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="g28" /><linearGradient
id="a"
x1="6"
x2="6"
y1="58"
y2="6"
gradientUnits="userSpaceOnUse"><stop
stop-color="#98a7b0"
offset="0"
id="stop1" /><stop
stop-color="#dde1e3"
offset="1"
id="stop2" /></linearGradient><linearGradient
id="b"><stop
stop-color="#292c2f"
offset="0"
id="stop3" /><stop
stop-opacity="0"
offset="1"
id="stop4" /></linearGradient><linearGradient
id="c"
x1=".593691"
x2="76.196591"
y1="36.119742"
y2="36.119742"
gradientTransform="matrix(.99166665 0 0 1 .029538 -.046272)"
gradientUnits="userSpaceOnUse"
xlink:href="#b" /><linearGradient
id="d"
x1="388.423"
x2="388.423"
y1="557.79797"
y2="505.798"
gradientTransform="matrix(.83152667 0 0 .76922858 -321.64966 -385.07572)"
gradientUnits="userSpaceOnUse"><stop
stop-color="#7f8c8d"
offset="0"
id="stop5" /><stop
stop-color="#afb0b3"
offset="1"
id="stop6" /></linearGradient><linearGradient
id="e"
x1="-421.44699"
x2="-410.44699"
y1="-504.20401"
y2="-493.20401"
gradientTransform="matrix(1.4166667 0 0 1.4285715 1.333333 1.142857)"
gradientUnits="userSpaceOnUse"
xlink:href="#b" /><linearGradient
id="f"
x1="1.333"
x2="1.333"
y1="48.714001"
y2="9.714"
gradientTransform="matrix(.73913167 0 0 .76922858 .347333 -.614286)"
gradientUnits="userSpaceOnUse"><stop
stop-color="#eef1f2"
offset="0"
id="stop7" /><stop
stop-color="#f9fafb"
offset="1"
id="stop8" /></linearGradient><linearGradient
id="g"
x1="6"
x2="6"
y1="58"
y2="6"
gradientTransform="matrix(.41954831 0 0 .42307393 10.574493 8.318726)"
gradientUnits="userSpaceOnUse"
xlink:href="#a" /><linearGradient
id="h"
x1="32"
x2="32"
y1="58"
y2="32"
gradientTransform="matrix(-.41954831 0 0 .42307393 37.425586 8.318726)"
gradientUnits="userSpaceOnUse"><stop
stop-color="#8e44ad"
offset="0"
id="stop9" /><stop
stop-color="#af7ac4"
offset="1"
id="stop10" /></linearGradient><linearGradient
id="i"
x1="32"
x2="32"
y1="58"
y2="32"
gradientTransform="matrix(.41954831 0 0 .42307393 10.574493 8.318726)"
gradientUnits="userSpaceOnUse"><stop
stop-color="#fdad23"
offset="0"
id="stop11" /><stop
stop-color="#fdc96f"
offset="1"
id="stop12" /></linearGradient><linearGradient
id="j"
x1="32"
x2="32"
y1="32"
y2="6"
gradientTransform="matrix(.41954831 0 0 .42307393 10.574493 8.318726)"
gradientUnits="userSpaceOnUse"><stop
stop-color="#27ad60"
offset="0"
id="stop13" /><stop
stop-color="#58d68d"
offset="1"
id="stop14" /></linearGradient><linearGradient
id="k"
x1="32"
x2="32"
y1="32"
y2="6"
gradientTransform="matrix(.41954831 0 0 .42307393 10.574493 8.318726)"
gradientUnits="userSpaceOnUse"><stop
stop-color="#1190d9"
offset="0"
id="stop15" /><stop
stop-color="#73c4ef"
offset="1"
id="stop16" /></linearGradient><linearGradient
id="l"
x1="32"
x2="32"
y1="41"
y2="23"
gradientTransform="matrix(.41954831 0 0 .42307393 10.574493 8.318726)"
gradientUnits="userSpaceOnUse"><stop
stop-color="#cecece"
offset="0"
id="stop17" /><stop
stop-color="#ececec"
offset="1"
id="stop18" /></linearGradient><linearGradient
id="m"
x1="32"
x2="32"
y1="36"
y2="28"
gradientTransform="matrix(.41954831 0 0 .42307393 10.574493 8.318726)"
gradientUnits="userSpaceOnUse"><stop
stop-color="#5c7274"
offset="0"
id="stop19" /><stop
stop-color="#a4a4a4"
offset="1"
id="stop20" /></linearGradient><linearGradient
id="n"
x1="32"
x2="32"
y1="35"
y2="29"
gradientTransform="matrix(.41954831 0 0 .42307393 10.574493 8.318726)"
gradientUnits="userSpaceOnUse"
xlink:href="#a" /><g
stroke-width="1"
id="g28"><path
d="m6.9999999 3.9999995h34v40h-34z"
fill="url(#d)"
id="path20" /><path
d="m11.25 39.714286h25.499999v4.285714h-25.499999z"
fill="#292c2e"
id="path21" /><path
d="m14.083333 41.142857h12.75v1.428572h-12.75zm14.166667 0h5.666667v1.428572h-5.666667z"
fill="#f6b44d"
id="path22" /><path
d="m35.333332 39.714286h5.666668v4.285714h-5.666668zm-28.333332 0h5.6666661v4.285714h-5.6666661z"
fill="#292c2f"
opacity=".2"
id="path23" /><path
d="m6.9999999 39.714286h5.6666661v4.285714h-1.416666zm28.333332 0h5.666668v4.285714h-5.666668z"
fill="#292c2f"
opacity=".2"
id="path24" /><path
d="m36.09125 8.9499995 4.90875 4.9471435v30.102857h-19.833334l-11.333333-11.428571z"
fill="url(#e)"
opacity=".2"
id="path25" /><path
d="m16.916665 6.8571424a7.0833333 7.1428572 0 0 0 -7.0833318 7.1428576v6.811429a4.25 4.2857144 0 0 1 1.4109998 3.024284 2.8333333 2.8571429 0 0 1 .0058.164288 2.8333333 2.8571429 0 0 1 -.01417.285713 4.25 4.2857144 0 0 1 0 .0072 4.25 4.2857144 0 0 1 -1.4025004 2.892858v5.385714l4.2499504 4.285714h19.833334l4.25-4.285714v-5.382858a4.25 4.2857144 0 0 1 -1.411-3.024286 2.8333333 2.8571429 0 0 1 -.0058-.164284 2.8333333 2.8571429 0 0 1 .01417-.292858 4.25 4.2857144 0 0 1 1.402501-2.892857v-6.814343a7.0833333 7.1428572 0 0 0 -7.083285-7.1428576z"
fill="url(#f)"
id="path26" /><path
d="m6.9999999 42.571429h4.2500001v1.428571h-4.2500001zm29.749999 0h4.250001v1.428571h-4.250001z"
fill="#292c2f"
opacity=".2"
id="path27" /><g
clip-path="url(#clipPath18-3)"
id="g16-7"
transform="matrix(0.60956583,0,0,-0.60956583,12.113466,33.127714)"><g
transform="translate(18,10)"
id="g22-5"><path
d="m 0,0 c -1.657,0 -3,1.343 -3,3 v 4 c 0,1.657 1.343,3 3,3 0.603,0.006 6,1 6,5 0,2 -2,4 -5,4 -2.441,0 -4,-2 -4,-3 0,-1.657 -1.343,-3 -3,-3 -1.657,0 -3,1.343 -3,3 0,4.878 4.58,9 10,9 C 9,25 12,19.018 12,14 12,9.855 9.723,6.687 5.587,5.079 4.687,4.729 3.797,4.492 3,4.332 V 3 C 3,1.343 1.657,0 0,0"
id="path24-3"
style="fill:#939598;fill-opacity:1;fill-rule:nonzero;stroke:none" /></g><g
transform="translate(21,5)"
id="g26-5"><path
d="m 0,0 c 0,-1.657 -1.343,-3 -3,-3 -1.657,0 -3,1.343 -3,3 0,1.657 1.343,3 3,3 1.657,0 3,-1.343 3,-3"
id="path28"
style="fill:#939598;fill-opacity:1;fill-rule:nonzero;stroke:none" /></g></g></g><g
id="g1"
inkscape:groupmode="layer"
inkscape:label="1"
transform="translate(1,2)" /><style
type="text/css"
id="style1">
.st0{fill:#F96464;}
</style></svg>

After

Width:  |  Height:  |  Size: 8.4 KiB

252
dist/status/Disk_Warning.svg vendored Normal file
View File

@@ -0,0 +1,252 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
viewBox="0 0 48 48"
version="1.1"
id="svg40"
sodipodi:docname="QDiskInfo_Warning.svg"
inkscape:version="1.4 (e7c3feb100, 2024-10-09)"
xml:space="preserve"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"><defs
id="defs40"><clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath1"><path
d="M 0,0 H 34 V 34 H 0 Z"
id="path1" /></clipPath><clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath2"><path
d="M 0,0 H 34 V 34 H 0 Z"
id="path2" /></clipPath><clipPath
id="clipPath18"><path
d="M 0,38 38,38 38,0 0,0 0,38 z"
id="path20-3" /></clipPath></defs><sodipodi:namedview
id="namedview40"
pagecolor="#ffffff"
bordercolor="#000000"
borderopacity="0.25"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="false"
inkscape:deskcolor="#d1d1d1"
showgrid="false"
inkscape:zoom="11.166667"
inkscape:cx="21.044775"
inkscape:cy="17.776119"
inkscape:window-width="1600"
inkscape:window-height="1172"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="g1" /><linearGradient
id="a"
x1="6"
x2="6"
y1="58"
y2="6"
gradientUnits="userSpaceOnUse"><stop
stop-color="#98a7b0"
offset="0"
id="stop1" /><stop
stop-color="#dde1e3"
offset="1"
id="stop2" /></linearGradient><linearGradient
id="b"><stop
stop-color="#292c2f"
offset="0"
id="stop3" /><stop
stop-opacity="0"
offset="1"
id="stop4" /></linearGradient><linearGradient
id="c"
x1=".593691"
x2="76.196591"
y1="36.119742"
y2="36.119742"
gradientTransform="matrix(.99166665 0 0 1 .029538 -.046272)"
gradientUnits="userSpaceOnUse"
xlink:href="#b" /><linearGradient
id="d"
x1="388.423"
x2="388.423"
y1="557.79797"
y2="505.798"
gradientTransform="matrix(.83152667 0 0 .76922858 -321.64966 -385.07572)"
gradientUnits="userSpaceOnUse"><stop
stop-color="#7f8c8d"
offset="0"
id="stop5" /><stop
stop-color="#afb0b3"
offset="1"
id="stop6" /></linearGradient><linearGradient
id="e"
x1="-421.44699"
x2="-410.44699"
y1="-504.20401"
y2="-493.20401"
gradientTransform="matrix(1.4166667 0 0 1.4285715 1.333333 1.142857)"
gradientUnits="userSpaceOnUse"
xlink:href="#b" /><linearGradient
id="f"
x1="1.333"
x2="1.333"
y1="48.714001"
y2="9.714"
gradientTransform="matrix(.73913167 0 0 .76922858 .347333 -.614286)"
gradientUnits="userSpaceOnUse"><stop
stop-color="#eef1f2"
offset="0"
id="stop7" /><stop
stop-color="#f9fafb"
offset="1"
id="stop8" /></linearGradient><linearGradient
id="g"
x1="6"
x2="6"
y1="58"
y2="6"
gradientTransform="matrix(.41954831 0 0 .42307393 10.574493 8.318726)"
gradientUnits="userSpaceOnUse"
xlink:href="#a" /><linearGradient
id="h"
x1="32"
x2="32"
y1="58"
y2="32"
gradientTransform="matrix(-.41954831 0 0 .42307393 37.425586 8.318726)"
gradientUnits="userSpaceOnUse"><stop
stop-color="#8e44ad"
offset="0"
id="stop9" /><stop
stop-color="#af7ac4"
offset="1"
id="stop10" /></linearGradient><linearGradient
id="i"
x1="32"
x2="32"
y1="58"
y2="32"
gradientTransform="matrix(.41954831 0 0 .42307393 10.574493 8.318726)"
gradientUnits="userSpaceOnUse"><stop
stop-color="#fdad23"
offset="0"
id="stop11" /><stop
stop-color="#fdc96f"
offset="1"
id="stop12" /></linearGradient><linearGradient
id="j"
x1="32"
x2="32"
y1="32"
y2="6"
gradientTransform="matrix(.41954831 0 0 .42307393 10.574493 8.318726)"
gradientUnits="userSpaceOnUse"><stop
stop-color="#27ad60"
offset="0"
id="stop13" /><stop
stop-color="#58d68d"
offset="1"
id="stop14" /></linearGradient><linearGradient
id="k"
x1="32"
x2="32"
y1="32"
y2="6"
gradientTransform="matrix(.41954831 0 0 .42307393 10.574493 8.318726)"
gradientUnits="userSpaceOnUse"><stop
stop-color="#1190d9"
offset="0"
id="stop15" /><stop
stop-color="#73c4ef"
offset="1"
id="stop16" /></linearGradient><linearGradient
id="l"
x1="32"
x2="32"
y1="41"
y2="23"
gradientTransform="matrix(.41954831 0 0 .42307393 10.574493 8.318726)"
gradientUnits="userSpaceOnUse"><stop
stop-color="#cecece"
offset="0"
id="stop17" /><stop
stop-color="#ececec"
offset="1"
id="stop18" /></linearGradient><linearGradient
id="m"
x1="32"
x2="32"
y1="36"
y2="28"
gradientTransform="matrix(.41954831 0 0 .42307393 10.574493 8.318726)"
gradientUnits="userSpaceOnUse"><stop
stop-color="#5c7274"
offset="0"
id="stop19" /><stop
stop-color="#a4a4a4"
offset="1"
id="stop20" /></linearGradient><linearGradient
id="n"
x1="32"
x2="32"
y1="35"
y2="29"
gradientTransform="matrix(.41954831 0 0 .42307393 10.574493 8.318726)"
gradientUnits="userSpaceOnUse"
xlink:href="#a" /><g
stroke-width="1"
id="g28"><path
d="m6.9999999 3.9999995h34v40h-34z"
fill="url(#d)"
id="path20" /><path
d="m11.25 39.714286h25.499999v4.285714h-25.499999z"
fill="#292c2e"
id="path21" /><path
d="m14.083333 41.142857h12.75v1.428572h-12.75zm14.166667 0h5.666667v1.428572h-5.666667z"
fill="#f6b44d"
id="path22" /><path
d="m35.333332 39.714286h5.666668v4.285714h-5.666668zm-28.333332 0h5.6666661v4.285714h-5.6666661z"
fill="#292c2f"
opacity=".2"
id="path23" /><path
d="m6.9999999 39.714286h5.6666661v4.285714h-1.416666zm28.333332 0h5.666668v4.285714h-5.666668z"
fill="#292c2f"
opacity=".2"
id="path24" /><path
d="m36.09125 8.9499995 4.90875 4.9471435v30.102857h-19.833334l-11.333333-11.428571z"
fill="url(#e)"
opacity=".2"
id="path25" /><path
d="m16.916665 6.8571424a7.0833333 7.1428572 0 0 0 -7.0833318 7.1428576v6.811429a4.25 4.2857144 0 0 1 1.4109998 3.024284 2.8333333 2.8571429 0 0 1 .0058.164288 2.8333333 2.8571429 0 0 1 -.01417.285713 4.25 4.2857144 0 0 1 0 .0072 4.25 4.2857144 0 0 1 -1.4025004 2.892858v5.385714l4.2499504 4.285714h19.833334l4.25-4.285714v-5.382858a4.25 4.2857144 0 0 1 -1.411-3.024286 2.8333333 2.8571429 0 0 1 -.0058-.164284 2.8333333 2.8571429 0 0 1 .01417-.292858 4.25 4.2857144 0 0 1 1.402501-2.892857v-6.814343a7.0833333 7.1428572 0 0 0 -7.083285-7.1428576z"
fill="url(#f)"
id="path26" /><path
d="m6.9999999 42.571429h4.2500001v1.428571h-4.2500001zm29.749999 0h4.250001v1.428571h-4.250001z"
fill="#292c2f"
opacity=".2"
id="path27" /><path
d="m24.00004 18.049429a3.7759347 3.8076653 0 0 0 -3.775934 3.807664 3.7759347 3.8076653 0 0 0 3.775934 3.807665 3.7759347 3.8076653 0 0 0 3.775934-3.807665 3.7759347 3.8076653 0 0 0 -3.775934-3.807664zm0 2.538442c.697289 0 1.258644.566073 1.258644 1.269222s-.561355 1.269223-1.258644 1.269223c-.69729 0-1.258646-.566074-1.258646-1.269223s.561356-1.269222 1.258646-1.269222z"
fill="url(#g)"
id="path28" /></g><g
id="g1"
inkscape:groupmode="layer"
inkscape:label="1"
transform="translate(1,2)"><g
clip-path="url(#clipPath18)"
id="g16"
transform="matrix(0.42561312,0,0,-0.42561312,31.469564,13.430284)"><g
transform="translate(3.6533,2)"
id="g22"><path
d="m 0,0 c -1.842,0 -2.654,1.338 -1.806,2.973 l 15.609,30.055 c 0.848,1.635 2.238,1.635 3.087,0 L 32.499,2.973 C 33.349,1.338 32.536,0 30.693,0 Z"
id="path24-6"
style="fill:#ffcc4d;fill-opacity:1;fill-rule:nonzero;stroke:none" /></g><g
transform="translate(16.769,26.3398)"
id="g26"><path
d="M 0,0 C 0,1.302 0.961,2.108 2.232,2.108 3.473,2.108 4.465,1.271 4.465,0 v -11.938 c 0,-1.271 -0.992,-2.108 -2.233,-2.108 -1.271,0 -2.232,0.807 -2.232,2.108 z m -0.187,-18.293 c 0,1.333 1.086,2.418 2.419,2.418 1.333,0 2.419,-1.085 2.419,-2.418 0,-1.334 -1.086,-2.419 -2.419,-2.419 -1.333,0 -2.419,1.085 -2.419,2.419"
id="path28-7"
style="fill:#231f20;fill-opacity:1;fill-rule:nonzero;stroke:none" /></g></g></g><style
type="text/css"
id="style1">
.st0{fill:#F96464;}
</style></svg>

After

Width:  |  Height:  |  Size: 8.8 KiB

35
include/gridview.h Normal file
View File

@@ -0,0 +1,35 @@
#pragma once
#include <QDialog>
#include <QGridLayout>
#include <QPushButton>
#include <QScrollArea>
class GridView : public QWidget {
Q_OBJECT
public:
explicit GridView(QWidget *parent = nullptr);
protected:
void resizeEvent(QResizeEvent *) override;
private:
struct DiskItem {
QString name;
QString category;
QString icon;
};
QString searchQuery;
QScrollArea *scrollArea;
QWidget *gridContainer;
QGridLayout *gridLayout;
QPushButton *selectedButton;
QString bgColor, borderColor, hoverColor, selectedColor;
QList<DiskItem> disks;
void extracted(const QVector<DiskItem> &filteredApps, int &cols, int &row, int &col);
void populateGrid();
};

View File

@@ -46,6 +46,8 @@ private slots:
void on_actionASCII_View_triggered();
void on_actionGrid_View_triggered();
private:
Ui::MainWindow *ui;
QSettings settings;

146
src/gridview.cpp Normal file
View File

@@ -0,0 +1,146 @@
#include "gridview.h"
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QLabel>
#include <QFrame>
#include <QIcon>
#include <QCheckBox>
#include <QComboBox>
#include <QPalette>
#include <QLineEdit>
int gridLayoutSpacing = 10;
int iconButtonSize = 64;
GridView::GridView(QWidget *parent) : QWidget(parent) {
setWindowTitle(tr("Grid View"));
resize(600, 300);
QVBoxLayout *mainLayout = new QVBoxLayout(this);
QComboBox *searchField = new QComboBox();
searchField->setEditable(true);
connect(searchField->lineEdit(), &QLineEdit::textChanged, this, [this](const QString &text) {
this->searchQuery = text;
populateGrid();
});
mainLayout->addWidget(searchField);
QPalette palette = this->palette();
bgColor = palette.color(QPalette::Base).name();
borderColor = palette.color(QPalette::Mid).name();
hoverColor = palette.color(QPalette::Highlight).name();
selectedColor = palette.color(QPalette::Highlight).name();
QFrame *gridFrame = new QFrame();
gridFrame->setStyleSheet(QString(
"QFrame { background-color: %1; border-radius: 5px; }"
).arg(bgColor, borderColor));
scrollArea = new QScrollArea();
scrollArea->setWidgetResizable(true);
scrollArea->setFrameStyle(QFrame::NoFrame);
scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
scrollArea->setWidget(gridFrame);
mainLayout->addWidget(scrollArea);
gridContainer = new QWidget();
gridLayout = new QGridLayout(gridContainer);
gridLayout->setAlignment(Qt::AlignTop | Qt::AlignHCenter);
gridLayout->setSpacing(gridLayoutSpacing);
gridFrame->setLayout(gridLayout);
disks = {
{"/dev/sda", "40C", "Bad"},
{"/dev/sdb", "40C", "Good"},
{"/dev/sdc", "40C", "Unknown"},
{"/dev/sdd", "40C", "Warning"}
};
populateGrid();
setLayout(mainLayout);
}
void GridView::resizeEvent(QResizeEvent *) {
populateGrid();
}
void GridView::populateGrid() {
selectedButton = nullptr;
QLayoutItem *child;
while ((child = gridLayout->takeAt(0)) != nullptr) {
delete child->widget();
delete child;
}
int width = scrollArea->viewport()->width();
int columnsFormula = (width + gridLayoutSpacing) / (iconButtonSize + gridLayoutSpacing);
int cols = qMax(1, columnsFormula - 1);
int row = 0, col = 0;
QVector<DiskItem> filteredDisks;
filteredDisks.reserve(disks.size());
for (auto it = disks.cbegin(); it != disks.cend(); ++it) {
const DiskItem &disk = *it;
if (searchQuery.isEmpty() ||
disk.name.contains(searchQuery, Qt::CaseInsensitive) ||
disk.category.contains(searchQuery, Qt::CaseInsensitive)) {
filteredDisks.append(disk);
}
}
extracted(filteredDisks, cols, row, col);
}
void GridView::extracted(const QVector<DiskItem> &filteredDisks, int &cols, int &row, int &col) {
for (int i = 0; i < filteredDisks.size(); ++i) {
const auto &disk = filteredDisks[i];
QWidget *diskWidget = new QWidget();
QVBoxLayout *diskLayout = new QVBoxLayout(diskWidget);
diskLayout->setAlignment(Qt::AlignCenter);
diskLayout->setContentsMargins(0, 0, 0, 0);
QPushButton *iconButton = new QPushButton();
QString iconPath = QString(":/icons/Disk_%1.svg").arg(disk.icon);
iconButton->setIcon(QIcon(iconPath));
iconButton->setIconSize(QSize(48, 48));
iconButton->setFixedSize(iconButtonSize, iconButtonSize);
iconButton->setStyleSheet(
QString("QPushButton { border: 2px solid transparent; "
"border-radius: 10px; }"
"QPushButton:hover { background-color: %1; }"
"QPushButton:pressed { border: 2px solid %2; }")
.arg(hoverColor, selectedColor));
QLabel *nameLabel = new QLabel(disk.name);
nameLabel->setAlignment(Qt::AlignCenter);
QLabel *categoryLabel = new QLabel(disk.category);
categoryLabel->setAlignment(Qt::AlignCenter);
categoryLabel->setStyleSheet("font-size: 10px; color: gray;");
connect(iconButton, &QPushButton::clicked, this, [this, iconButton]() {
if (selectedButton) {
selectedButton->setStyleSheet(iconButton->styleSheet());
}
selectedButton = iconButton;
selectedButton->setStyleSheet(
QString(
"QPushButton { border: 2px solid %1; background-color: %2; }")
.arg(selectedColor, hoverColor));
});
diskLayout->addWidget(iconButton, 0, Qt::AlignCenter);
diskLayout->addWidget(nameLabel, 0, Qt::AlignCenter);
diskLayout->addWidget(categoryLabel, 0, Qt::AlignCenter);
diskWidget->setLayout(diskLayout);
gridLayout->addWidget(diskWidget, row, col);
col++;
if (col >= cols) {
col = 0;
row++;
}
}
}

View File

@@ -4,6 +4,7 @@
#include "statusdot.h"
#include "custombutton.h"
#include "jsonparser.h"
#include "gridview.h"
#include <QDesktopServices>
#include <QFileDialog>
@@ -244,7 +245,12 @@ void MainWindow::updateUI()
}
} else if (isScsi) {
QJsonObject scsiErrorCounterLog = localObj.value("scsi_error_counter_log").toObject();
for (const QString key : {"read", "write", "verify"}) {
static const QString keys[] = {
QStringLiteral("read"),
QStringLiteral("write"),
QStringLiteral("verify")
};
for (const QString& key : keys) {
if (scsiErrorCounterLog.value(key).toObject().value("total_uncorrected_errors").toInt() != 0) {
caution = true;
}
@@ -1372,7 +1378,7 @@ void MainWindow::on_actionASCII_View_triggered()
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Save | QDialogButtonBox::Close, asciiViewDialog);
connect(buttonBox, &QDialogButtonBox::rejected, asciiViewDialog, &QDialog::close);
connect(buttonBox->button(QDialogButtonBox::Save), &QPushButton::clicked, [binaryData, this, deviceNodePath]() {
connect(buttonBox->button(QDialogButtonBox::Save), &QPushButton::clicked, this, [binaryData, this, deviceNodePath]() {
QString filePath = QFileDialog::getSaveFileName(this, tr("Save Binary Data"), deviceNodePath.section('/', -1) + ".bin", tr("Binary Files (*.bin);;All Files (*)"));
if (!filePath.isEmpty()) {
QFile file(filePath);
@@ -1395,3 +1401,11 @@ void MainWindow::on_actionASCII_View_triggered()
asciiViewDialog->exec();
}
void MainWindow::on_actionGrid_View_triggered()
{
auto *gridView = new GridView(nullptr);
gridView->setAttribute(Qt::WA_DeleteOnClose);
gridView->show();
}

View File

@@ -534,6 +534,8 @@
<property name="title">
<string>Disk</string>
</property>
<addaction name="actionGrid_View"/>
<addaction name="separator"/>
</widget>
<addaction name="menuFile"/>
<addaction name="menuDevice"/>
@@ -651,6 +653,14 @@
<string>ASCII View</string>
</property>
</action>
<action name="actionGrid_View">
<property name="icon">
<iconset theme="start-here"/>
</property>
<property name="text">
<string>Grid View</string>
</property>
</action>
</widget>
<resources>
<include location="resources.qrc"/>

View File

@@ -1,5 +1,9 @@
<RCC>
<qresource prefix="/icons">
<file alias="icon.svg">../dist/QDiskInfo.svg</file>
<file alias="Disk_Good.svg">../dist/status/Disk_Good.svg</file>
<file alias="Disk_Bad.svg">../dist/status/Disk_Bad.svg</file>
<file alias="Disk_Warning.svg">../dist/status/Disk_Warning.svg</file>
<file alias="Disk_Unknown.svg">../dist/status/Disk_Unknown.svg</file>
</qresource>
</RCC>

View File

@@ -9,6 +9,7 @@
#include <QProcess>
#include <QPushButton>
#include <QTimer>
#include <qactiongroup.h>
void utils::clearButtonGroup(QButtonGroup* buttonGroup, QHBoxLayout* horizontalLayout, QSpacerItem* buttonStretch, QMenu* menuDisk)
{
@@ -19,7 +20,19 @@ void utils::clearButtonGroup(QButtonGroup* buttonGroup, QHBoxLayout* horizontalL
}
horizontalLayout->removeItem(buttonStretch);
delete buttonStretch;
menuDisk->clear();
// Dirty hack to remove only the radio buttons
QList<QAction*> actions = menuDisk->actions();
bool foundSeparator = false;
for (int i = 0; i < actions.size(); ++i) {
QAction* action = actions[i];
if (foundSeparator) {
menuDisk->removeAction(action);
} else if (action->isSeparator()) {
foundSeparator = true;
}
}
}
QString utils::getSmartctlPath() {