[ui] feature: themes

This commit is contained in:
Vinicius Moreira
2020-11-27 15:52:57 -03:00
parent 813c812030
commit 60228eec97
176 changed files with 11941 additions and 2985 deletions

View File

@@ -13,14 +13,14 @@ from bauh.api.abstract.model import SoftwarePackage, PackageHistory, PackageUpda
from bauh.api.abstract.view import SingleSelectComponent, SelectViewType, InputOption, ViewComponent, PanelComponent, \
FormComponent
from bauh.api.exception import NoInternetException
from bauh.commons import resource, internet
from bauh.commons import resource
from bauh.commons.category import CategoriesDownloader
from bauh.commons.config import save_config
from bauh.commons.html import bold
from bauh.commons.system import SystemProcess, ProcessHandler, new_root_subprocess, get_human_size_str
from bauh.commons.view_utils import new_select
from bauh.gems.snap import snap, URL_CATEGORIES_FILE, SNAP_CACHE_PATH, CATEGORIES_FILE_PATH, SUGGESTIONS_FILE, \
get_icon_path, snapd, CONFIG_FILE
get_icon_path, snapd, CONFIG_FILE, ROOT_DIR
from bauh.gems.snap.config import read_config
from bauh.gems.snap.model import SnapApplication
from bauh.gems.snap.snapd import SnapdClient
@@ -45,14 +45,14 @@ class SnapManager(SoftwareManager):
self.custom_actions = [
CustomSoftwareAction(i18n_status_key='snap.action.refresh.status',
i18n_label_key='snap.action.refresh.label',
icon_path=resource.get_path('img/refresh.svg', context.get_view_path()),
icon_path=resource.get_path('img/refresh.svg', ROOT_DIR),
manager_method='refresh',
requires_root=True,
i18n_confirm_key='snap.action.refresh.confirm'),
CustomSoftwareAction(i18n_status_key='snap.action.channel.status',
i18n_label_key='snap.action.channel.label',
i18n_confirm_key='snap.action.channel.confirm',
icon_path=resource.get_path('img/refresh.svg', context.get_view_path()),
icon_path=resource.get_path('img/refresh.svg', ROOT_DIR),
manager_method='change_channel',
requires_root=True)
]
@@ -230,7 +230,8 @@ class SnapManager(SoftwareManager):
if success:
new_installed = []
try:
current_installed = self.read_installed(disk_loader=disk_loader, internet_available=internet.is_available()).installed
net_available = self.context.internet_checker.is_available()
current_installed = self.read_installed(disk_loader=disk_loader, internet_available=net_available).installed
except:
new_installed = [pkg]
traceback.print_exc()
@@ -261,7 +262,7 @@ class SnapManager(SoftwareManager):
return ProcessHandler(watcher).handle_simple(snap.refresh_and_stream(pkg.name, root_password))[0]
def change_channel(self, pkg: SnapApplication, root_password: str, watcher: ProcessWatcher) -> bool:
if not internet.is_available():
if not self.context.internet_checker.is_available():
raise NoInternetException()
try:

View File

@@ -0,0 +1,128 @@
<?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"
id="Capa_1"
x="0px"
y="0px"
width="512"
height="512"
viewBox="0 0 511.99998 512"
xml:space="preserve"
sodipodi:docname="refresh.svg"
inkscape:version="1.0.1 (3bc2e813f5, 2020-09-07)"><metadata
id="metadata45"><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><defs
id="defs43" /><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="739"
id="namedview41"
showgrid="false"
showborder="true"
inkscape:zoom="0.48437083"
inkscape:cx="133.71431"
inkscape:cy="289.92474"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="Capa_1"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:document-rotation="0" />
<g
id="g8"
transform="matrix(1.0938971,0,0,1.0217723,-10.489433,7.0809411)"
style="fill:#3991e9;fill-opacity:1;stroke:none;stroke-width:39.2413;stroke-miterlimit:4;stroke-dasharray:none">
<g
id="g6"
style="fill:#3991e9;fill-opacity:1;stroke:none;stroke-width:39.2413;stroke-miterlimit:4;stroke-dasharray:none">
<path
d="m 55.323,203.641 c 15.664,0 29.813,-9.405 35.872,-23.854 25.017,-59.604 83.842,-101.61 152.42,-101.61 37.797,0 72.449,12.955 100.23,34.442 l -21.775,3.371 c -7.438,1.153 -13.224,7.054 -14.232,14.512 -1.01,7.454 3.008,14.686 9.867,17.768 l 119.746,53.872 c 5.249,2.357 11.33,1.904 16.168,-1.205 4.83,-3.114 7.764,-8.458 7.796,-14.208 l 0.621,-131.943 c 0.042,-7.506 -4.851,-14.144 -12.024,-16.332 -7.185,-2.188 -14.947,0.589 -19.104,6.837 L 414.403,70.096 C 370.398,26.778 310.1,0 243.615,0 142.806,0 56.133,61.562 19.167,149.06 c -5.134,12.128 -3.84,26.015 3.429,36.987 7.269,10.976 19.556,17.594 32.727,17.594 z"
id="path2"
inkscape:connector-curvature="0"
style="fill:#3991e9;fill-opacity:1;stroke:none;stroke-width:39.2413;stroke-miterlimit:4;stroke-dasharray:none" />
<path
d="m 464.635,301.184 c -7.27,-10.977 -19.558,-17.594 -32.728,-17.594 -15.664,0 -29.813,9.405 -35.872,23.854 -25.018,59.604 -83.843,101.61 -152.42,101.61 -37.798,0 -72.45,-12.955 -100.232,-34.442 l 21.776,-3.369 c 7.437,-1.153 13.223,-7.055 14.233,-14.514 1.009,-7.453 -3.008,-14.686 -9.867,-17.768 L 49.779,285.089 c -5.25,-2.356 -11.33,-1.905 -16.169,1.205 -4.829,3.114 -7.764,8.458 -7.795,14.207 l -0.622,131.943 c -0.042,7.506 4.85,14.144 12.024,16.332 7.185,2.188 14.948,-0.59 19.104,-6.839 l 16.505,-24.805 c 44.004,43.32 104.303,70.098 170.788,70.098 100.811,0 187.481,-61.561 224.446,-149.059 5.137,-12.128 3.843,-26.014 -3.425,-36.987 z"
id="path4"
inkscape:connector-curvature="0"
style="fill:#3991e9;fill-opacity:1;stroke:none;stroke-width:39.2413;stroke-miterlimit:4;stroke-dasharray:none" />
</g>
</g>
<g
id="g10"
transform="translate(-15.027876,-464.19647)">
</g>
<g
id="g12"
transform="translate(-15.027876,-464.19647)">
</g>
<g
id="g14"
transform="translate(-15.027876,-464.19647)">
</g>
<g
id="g16"
transform="translate(-15.027876,-464.19647)">
</g>
<g
id="g18"
transform="translate(-15.027876,-464.19647)">
</g>
<g
id="g20"
transform="translate(-15.027876,-464.19647)">
</g>
<g
id="g22"
transform="translate(-15.027876,-464.19647)">
</g>
<g
id="g24"
transform="translate(-15.027876,-464.19647)">
</g>
<g
id="g26"
transform="translate(-15.027876,-464.19647)">
</g>
<g
id="g28"
transform="translate(-15.027876,-464.19647)">
</g>
<g
id="g30"
transform="translate(-15.027876,-464.19647)">
</g>
<g
id="g32"
transform="translate(-15.027876,-464.19647)">
</g>
<g
id="g34"
transform="translate(-15.027876,-464.19647)">
</g>
<g
id="g36"
transform="translate(-15.027876,-464.19647)">
</g>
<g
id="g38"
transform="translate(-15.027876,-464.19647)">
</g>
</svg>

After

Width:  |  Height:  |  Size: 4.5 KiB