mirror of https://github.com/cutefishos/settings
Add power module
parent
ee5a2b9b25
commit
8c3f894d06
@ -1,101 +1,14 @@
|
||||
<?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:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="64"
|
||||
height="64"
|
||||
version="1.1"
|
||||
id="svg26"
|
||||
sodipodi:docname="performance.svg"
|
||||
inkscape:version="1.0.2 (e86c870879, 2021-01-15)">
|
||||
<metadata
|
||||
id="metadata30">
|
||||
<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 />
|
||||
</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="2160"
|
||||
inkscape:window-height="1258"
|
||||
id="namedview28"
|
||||
showgrid="false"
|
||||
inkscape:zoom="4.0603398"
|
||||
inkscape:cx="-68.388681"
|
||||
inkscape:cy="33.943409"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="35"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="svg26"
|
||||
inkscape:document-rotation="0" />
|
||||
<defs
|
||||
id="defs12">
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#SVGID_1_-6"
|
||||
id="linearGradient914"
|
||||
x1="0"
|
||||
y1="32"
|
||||
x2="64"
|
||||
y2="32"
|
||||
gradientUnits="userSpaceOnUse" />
|
||||
<linearGradient
|
||||
id="SVGID_1_-6"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
x1="256"
|
||||
x2="256"
|
||||
y1="512"
|
||||
y2="0">
|
||||
<stop
|
||||
offset="0"
|
||||
stop-color="#fd3a84"
|
||||
id="stop2-7" />
|
||||
<stop
|
||||
offset="1"
|
||||
stop-color="#ffa68d"
|
||||
id="stop4-5" />
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<rect
|
||||
style="opacity:0.95;fill:url(#linearGradient914);fill-opacity:1.0;stroke:none;stroke-width:1.00157"
|
||||
id="rect906"
|
||||
width="64"
|
||||
height="64"
|
||||
x="0"
|
||||
y="0" />
|
||||
<g
|
||||
id="g94-0"
|
||||
transform="matrix(0.16649938,0,0,0.16649938,-53.866346,-13.734628)" />
|
||||
<g
|
||||
id="g22"
|
||||
transform="matrix(0.13211508,0,0,0.13211508,-1.8214839,-1.8214768)"
|
||||
style="fill:#ffffff;fill-opacity:0.8">
|
||||
<g
|
||||
id="g20"
|
||||
style="fill:#ffffff;fill-opacity:0.8">
|
||||
<path
|
||||
d="m 161.687,350.313 c -3.516,-3.516 -9.206,-3.516 -12.722,0 l -38.167,38.167 c -3.516,3.516 -3.516,9.207 0,12.723 3.516,3.516 9.206,3.516 12.722,0 l 38.167,-38.167 c 3.516,-3.516 3.516,-9.207 0,-12.723 z m 12.722,25.445 -12.722,12.722 c -3.516,3.516 -3.516,9.207 0,12.723 3.516,3.516 9.206,3.516 12.722,0 l 12.722,-12.723 c 3.516,-3.516 3.516,-9.206 0,-12.722 -3.516,-3.516 -9.206,-3.516 -12.722,0 z m -50.889,-50.889 -12.722,12.722 c -3.516,3.516 -3.516,9.207 0,12.723 3.516,3.516 9.206,3.516 12.722,0 l 12.722,-12.723 c 3.516,-3.516 3.516,-9.206 0,-12.722 -3.516,-3.516 -9.206,-3.516 -12.722,0 z M 405.957,113.671 c -0.572,-3.951 -3.677,-7.057 -7.628,-7.628 -2.128,-0.305 -31.099,-4.1 -68.809,4.99 l 71.448,71.448 c 9.089,-37.711 5.294,-66.682 4.989,-68.81 z M 231.659,165.84 c -24.833,24.833 -59.413,68.728 -71.905,98.281 -1.423,3.373 -0.659,7.268 1.932,9.858 l 12.722,12.722 38.167,-38.167 c 14.027,-14.027 36.856,-14.033 50.889,0 14.033,14.033 14.027,36.862 0,50.889 l -38.167,38.167 12.722,12.723 c 2.59,2.59 6.485,3.354 9.858,1.932 29.268,-12.371 72.945,-46.568 98.281,-71.904 25.368,-25.369 40.221,-52.925 48.977,-78.246 l -85.233,-85.233 c -25.318,8.757 -52.874,23.61 -78.243,48.978 z m 108.14,6.361 c 14.033,14.033 14.027,36.862 0,50.889 -14.027,14.027 -36.856,14.033 -50.889,0 -14.033,-14.033 -14.027,-36.862 0,-50.889 14.027,-14.027 36.856,-14.033 50.889,0 z m -12.722,38.167 c 7.02,-7.02 7.013,-18.431 0,-25.445 -7.013,-7.013 -18.425,-7.02 -25.445,0 -7.02,7.02 -7.013,18.431 0,25.445 7.014,7.013 18.425,7.02 25.445,0 z m -81.295,160.394 c -0.324,6.447 -2.848,12.805 -7.762,17.718 -3.516,3.516 -3.516,9.207 0,12.723 0.776,0.776 19.444,18.723 50.889,-12.723 22.013,-22.013 28.484,-43.989 29.747,-60.244 -24.209,18.932 -46.73,33.377 -63.771,40.583 -2.959,1.247 -6.029,1.78 -9.103,1.943 z M 123.52,273.979 c 4.913,-4.913 11.27,-7.436 17.716,-7.761 0.162,-3.068 0.695,-6.134 1.939,-9.086 7.217,-17.071 21.665,-39.6 40.576,-63.787 -16.255,1.265 -38.224,7.739 -60.231,29.745 -31.445,31.445 -13.499,50.113 -12.722,50.889 3.515,3.517 9.206,3.517 12.722,0 z m 127.223,-12.722 c -7.013,-7.014 -18.425,-7.02 -25.444,0 l -50.889,50.889 c -7.02,7.02 -7.013,18.431 0,25.444 7.013,7.014 18.425,7.02 25.445,0 l 50.889,-50.889 c 7.018,-7.019 7.012,-18.43 -0.001,-25.444 z"
|
||||
id="path18"
|
||||
style="fill:#ffffff;fill-opacity:1" />
|
||||
</g>
|
||||
<svg width="64" height="64" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<defs>
|
||||
<linearGradient id="linearGradient914" x2="64" y1="32" y2="32" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#fd3a84" offset="0"/>
|
||||
<stop stop-color="#ffa68d" offset="1"/>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<rect width="64" height="64" fill="url(#linearGradient914)" opacity=".95"/>
|
||||
<g transform="matrix(.099338 0 0 .099338 6.5695 6.5695)" fill="#fff" fill-opacity=".8">
|
||||
<g fill="#fff" fill-opacity=".8">
|
||||
<path d="m161.69 350.31c-3.516-3.516-9.206-3.516-12.722 0l-38.167 38.167c-3.516 3.516-3.516 9.207 0 12.723s9.206 3.516 12.722 0l38.167-38.167c3.516-3.516 3.516-9.207 0-12.723zm12.722 25.445-12.722 12.722c-3.516 3.516-3.516 9.207 0 12.723s9.206 3.516 12.722 0l12.722-12.723c3.516-3.516 3.516-9.206 0-12.722s-9.206-3.516-12.722 0zm-50.889-50.889-12.722 12.722c-3.516 3.516-3.516 9.207 0 12.723s9.206 3.516 12.722 0l12.722-12.723c3.516-3.516 3.516-9.206 0-12.722s-9.206-3.516-12.722 0zm282.44-211.2c-0.572-3.951-3.677-7.057-7.628-7.628-2.128-0.305-31.099-4.1-68.809 4.99l71.448 71.448c9.089-37.711 5.294-66.682 4.989-68.81zm-174.3 52.169c-24.833 24.833-59.413 68.728-71.905 98.281-1.423 3.373-0.659 7.268 1.932 9.858l12.722 12.722 38.167-38.167c14.027-14.027 36.856-14.033 50.889 0s14.027 36.862 0 50.889l-38.167 38.167 12.722 12.723c2.59 2.59 6.485 3.354 9.858 1.932 29.268-12.371 72.945-46.568 98.281-71.904 25.368-25.369 40.221-52.925 48.977-78.246l-85.233-85.233c-25.318 8.757-52.874 23.61-78.243 48.978zm108.14 6.361c14.033 14.033 14.027 36.862 0 50.889s-36.856 14.033-50.889 0-14.027-36.862 0-50.889 36.856-14.033 50.889 0zm-12.722 38.167c7.02-7.02 7.013-18.431 0-25.445-7.013-7.013-18.425-7.02-25.445 0s-7.013 18.431 0 25.445c7.014 7.013 18.425 7.02 25.445 0zm-81.295 160.39c-0.324 6.447-2.848 12.805-7.762 17.718-3.516 3.516-3.516 9.207 0 12.723 0.776 0.776 19.444 18.723 50.889-12.723 22.013-22.013 28.484-43.989 29.747-60.244-24.209 18.932-46.73 33.377-63.771 40.583-2.959 1.247-6.029 1.78-9.103 1.943zm-122.26-96.783c4.913-4.913 11.27-7.436 17.716-7.761 0.162-3.068 0.695-6.134 1.939-9.086 7.217-17.071 21.665-39.6 40.576-63.787-16.255 1.265-38.224 7.739-60.231 29.745-31.445 31.445-13.499 50.113-12.722 50.889 3.515 3.517 9.206 3.517 12.722 0zm127.22-12.722c-7.013-7.014-18.425-7.02-25.444 0l-50.889 50.889c-7.02 7.02-7.013 18.431 0 25.444 7.013 7.014 18.425 7.02 25.445 0l50.889-50.889c7.018-7.019 7.012-18.43-1e-3 -25.444z" fill="#fff" fill-opacity="1"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 2.5 KiB |
@ -1,93 +1,10 @@
|
||||
<?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:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="64"
|
||||
height="64"
|
||||
version="1.1"
|
||||
id="svg26"
|
||||
sodipodi:docname="powersave.svg"
|
||||
inkscape:version="1.0.2 (e86c870879, 2021-01-15)">
|
||||
<metadata
|
||||
id="metadata30">
|
||||
<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 />
|
||||
</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="2160"
|
||||
inkscape:window-height="1258"
|
||||
id="namedview28"
|
||||
showgrid="false"
|
||||
inkscape:zoom="5.7421875"
|
||||
inkscape:cx="40.32412"
|
||||
inkscape:cy="20.636656"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="35"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="svg26"
|
||||
inkscape:document-rotation="0" />
|
||||
<defs
|
||||
id="defs12">
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#SVGID_2_-5"
|
||||
id="linearGradient914"
|
||||
x1="0"
|
||||
y1="32"
|
||||
x2="64"
|
||||
y2="32"
|
||||
gradientUnits="userSpaceOnUse" />
|
||||
<linearGradient
|
||||
id="SVGID_2_-5"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
x1="256"
|
||||
x2="256"
|
||||
y1="436"
|
||||
y2="16"
|
||||
gradientTransform="translate(-715.57057,73.381647)">
|
||||
<stop
|
||||
offset="0"
|
||||
stop-color="#fd5900"
|
||||
id="stop7-3" />
|
||||
<stop
|
||||
offset="1"
|
||||
stop-color="#ffde00"
|
||||
id="stop9-5" />
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<rect
|
||||
style="opacity:0.95;fill:url(#linearGradient914);fill-opacity:1.0;stroke:none;stroke-width:1.00157"
|
||||
id="rect906"
|
||||
width="64"
|
||||
height="64"
|
||||
x="0"
|
||||
y="0" />
|
||||
<g
|
||||
id="g94-0"
|
||||
transform="matrix(0.16649938,0,0,0.16649938,-53.866346,-13.734628)" />
|
||||
<path
|
||||
d="m 51.844902,29.501192 c -0.0804,-0.643311 -0.664107,-1.104106 -1.313246,-1.021324 -0.644503,0.0804 -1.101721,0.668609 -1.021324,1.313244 0.09073,0.723842 0.136689,1.459073 0.136689,2.20702 0,9.731127 -7.915896,17.64702 -17.647021,17.64702 -5.566093,0 -10.791259,-2.664767 -14.10212,-7.058808 h 2.337484 c 0.650331,0 1.176424,-0.526224 1.176424,-1.176556 0,-0.650198 -0.526225,-1.176423 -1.176424,-1.176423 h -4.70596 c -0.650198,0 -1.176424,0.526225 -1.176424,1.176423 v 4.70596 c 0,0.650332 0.526226,1.176424 1.176424,1.176424 0.65033,0 1.176424,-0.526225 1.176424,-1.176424 V 44.826889 C 20.471788,49.300663 26.05563,52 32,52 43.028212,52 52,43.028212 52,32 52,31.153245 51.947144,30.319206 51.844902,29.501192 Z M 14.489668,34.20702 C 14.398935,33.483179 14.35298,32.747947 14.35298,32 c 0,-9.731125 7.915895,-17.64702 17.64702,-17.64702 5.566093,0 10.791259,2.664768 14.10212,7.058808 h -2.337484 c -0.650331,0 -1.176423,0.526225 -1.176423,1.176556 0,0.650199 0.526224,1.176424 1.176423,1.176424 h 4.70596 c 0.650199,0 1.176425,-0.526225 1.176425,-1.176424 v -4.70596 c 0,-0.65033 -0.526226,-1.176424 -1.176425,-1.176424 -0.65033,0 -1.176424,0.526225 -1.176424,1.176424 v 1.290728 C 43.528213,14.699206 37.944371,12 32,12 20.971788,12 12,20.971656 12,32 c 0,0.846755 0.05286,1.680795 0.155098,2.498808 0.07471,0.595101 0.581326,1.030597 1.166094,1.030597 0.04821,0 0.09761,-0.0035 0.147021,-0.0092 0.644635,-0.0804 1.101852,-0.668743 1.021455,-1.313246 z m 14.624239,11.783047 c 0.492716,0.24967 1.08702,0.123173 1.437218,-0.295232 L 42.315761,31.577219 c 0.258545,-0.31139 0.340134,-0.734041 0.213643,-1.118941 -0.125293,-0.3849 -0.44,-0.67788 -0.832979,-0.775496 l -8.269802,-2.067947 2.066887,-8.270862 c 0.133239,-0.53192 -0.119467,-1.085696 -0.607814,-1.333908 -0.490595,-0.247018 -1.084504,-0.12516 -1.437218,0.295232 L 21.683841,32.422914 c -0.258543,0.31139 -0.340133,0.734173 -0.213642,1.119073 0.125293,0.384902 0.44,0.677881 0.83298,0.775498 l 8.269801,2.068078 -2.066888,8.270861 c -0.133106,0.531788 0.1196,1.085563 0.607815,1.333643 z"
|
||||
id="path16"
|
||||
style="fill:#ffffff;fill-opacity:1;stroke-width:0.132451" />
|
||||
<svg width="64" height="64" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<defs>
|
||||
<linearGradient id="linearGradient863" x1="31.71" x2="32.644" y1="61.741" y2="4.8507" gradientTransform="matrix(3.7796 0 0 3.7796 -58.247 -6.0472)" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#ff670a" offset="0"/>
|
||||
<stop stop-color="#ffc53f" offset="1"/>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<rect width="64" height="64" fill="url(#linearGradient863)"/>
|
||||
<path d="m46.884 30.126c-0.0603-0.48248-0.49808-0.82808-0.98493-0.76599-0.48338 0.0603-0.82629 0.50146-0.76599 0.98493 0.06805 0.54288 0.10252 1.0943 0.10252 1.6553 0 7.2983-5.9369 13.235-13.235 13.235-4.1746 0-8.0934-1.9986-10.577-5.2941h1.7531c0.48775 0 0.88232-0.39467 0.88232-0.88242 0-0.48765-0.39467-0.88232-0.88232-0.88232h-3.5295c-0.48765 0-0.88232 0.39467-0.88232 0.88232v3.5295c0 0.48775 0.39467 0.88232 0.88232 0.88232 0.48775 0 0.88232-0.39467 0.88232-0.88232v-0.96814c2.8245 3.3553 7.0124 5.3798 11.471 5.3798 8.2712 0 15-6.7288 15-15 0-0.63507-0.03964-1.2606-0.11632-1.8741zm-28.016 3.5294c-0.06805-0.54288-0.10252-1.0943-0.10252-1.6553 0-7.2983 5.9369-13.235 13.235-13.235 4.1746 0 8.0934 1.9986 10.577 5.2941h-1.7531c-0.48775 0-0.88232 0.39467-0.88232 0.88242 0 0.48765 0.39467 0.88232 0.88232 0.88232h3.5295c0.48765 0 0.88232-0.39467 0.88232-0.88232v-3.5295c0-0.48775-0.39467-0.88232-0.88232-0.88232-0.48775 0-0.88232 0.39467-0.88232 0.88232v0.96805c-2.8245-3.3554-7.0124-5.3798-11.471-5.3798-8.2712 0-15 6.7287-15 15 0 0.63507 0.03965 1.2606 0.11632 1.8741 0.05603 0.44633 0.43599 0.77295 0.87457 0.77295 0.03616 0 0.07321-0.0026 0.11027-0.0069 0.48348-0.0603 0.82639-0.50156 0.76609-0.98494zm10.968 8.8373c0.36954 0.18725 0.81526 0.09238 1.0779-0.22142l8.8235-10.588c0.19391-0.23354 0.2551-0.55053 0.16023-0.83921-0.09397-0.28868-0.33-0.50841-0.62473-0.58162l-6.2024-1.551 1.5502-6.2031c0.09993-0.39894-0.0896-0.81427-0.45586-1.0004-0.36795-0.18526-0.81338-0.09387-1.0779 0.22142l-8.8235 10.588c-0.19391 0.23354-0.2551 0.55063-0.16023 0.8393 0.09397 0.28868 0.33 0.50841 0.62474 0.58162l6.2024 1.5511-1.5502 6.2031c-0.09983 0.39884 0.0897 0.81417 0.45586 1.0002z" fill="#fff" stroke-width=".099338"/>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 2.2 KiB |
@ -0,0 +1,46 @@
|
||||
/*
|
||||
* Copyright (C) 2021 CutefishOS Team.
|
||||
*
|
||||
* Author: Reion Wong <reionwong@gmail.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "powermanager.h"
|
||||
|
||||
PowerManager::PowerManager(QObject *parent)
|
||||
: QObject(parent)
|
||||
, m_iface("org.cutefish.PowerManager",
|
||||
"/CPUManagement", "org.cutefish.CPUManagement",
|
||||
QDBusConnection::sessionBus())
|
||||
, m_mode(-1)
|
||||
{
|
||||
if (m_iface.isValid()) {
|
||||
m_mode = m_iface.property("mode").toInt();
|
||||
}
|
||||
}
|
||||
|
||||
int PowerManager::mode() const
|
||||
{
|
||||
return m_mode;
|
||||
}
|
||||
|
||||
void PowerManager::setMode(int mode)
|
||||
{
|
||||
if (m_mode != mode) {
|
||||
m_iface.call("setMode", mode);
|
||||
m_mode = mode;
|
||||
emit modeChanged();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,45 @@
|
||||
/*
|
||||
* Copyright (C) 2021 CutefishOS Team.
|
||||
*
|
||||
* Author: Reion Wong <reionwong@gmail.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef POWERMANAGER_H
|
||||
#define POWERMANAGER_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QDBusInterface>
|
||||
|
||||
class PowerManager : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(int mode READ mode WRITE setMode NOTIFY modeChanged)
|
||||
|
||||
public:
|
||||
explicit PowerManager(QObject *parent = nullptr);
|
||||
|
||||
int mode() const;
|
||||
void setMode(int mode);
|
||||
|
||||
signals:
|
||||
void modeChanged();
|
||||
|
||||
private:
|
||||
QDBusInterface m_iface;
|
||||
int m_mode;
|
||||
};
|
||||
|
||||
#endif // POWERMANAGER_H
|
||||
Loading…
Reference in New Issue