[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

@@ -590,7 +590,8 @@ class AppImageManager(SoftwareManager):
updater = DatabaseUpdater(task_man=task_manager,
i18n=self.context.i18n,
http_client=self.context.http_client, logger=self.context.logger,
db_locks=self.db_locks, interval=interval)
db_locks=self.db_locks, interval=interval,
internet_checker=self.context.internet_checker)
if local_config['db_updater']['enabled']:
updater.start()
elif internet_available:

31
bauh/gems/appimage/resources/img/upgrade.svg Normal file → Executable file
View File

@@ -8,13 +8,13 @@
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
viewBox="0 0 47.810421 48"
viewBox="0 0 512 512"
enable-background="new 0 0 26 26"
id="svg8"
sodipodi:docname="upgrade.svg"
inkscape:version="0.92.5 (2060ec1f9f, 2020-04-08)"
width="47.810421"
height="48">
inkscape:version="1.0.1 (3bc2e813f5, 2020-09-07)"
width="512"
height="512">
<metadata
id="metadata14">
<rdf:RDF>
@@ -42,10 +42,10 @@
inkscape:window-height="739"
id="namedview10"
showgrid="false"
showborder="false"
inkscape:zoom="3.2091769"
inkscape:cx="-13.285588"
inkscape:cy="-0.030460959"
showborder="true"
inkscape:zoom="0.80229424"
inkscape:cx="65.887412"
inkscape:cy="257.44157"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
@@ -53,24 +53,21 @@
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0" />
fit-margin-bottom="0"
inkscape:document-rotation="0" />
<g
id="g6"
transform="matrix(1.7476186,0,0,1.8929335,1.1861681,-0.60813528)"
style="fill:none;fill-opacity:1;stroke:#91a069;stroke-width:1.35746789;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1">
transform="matrix(19.334486,0,0,20.945696,4.651682,-16.294048)"
style="fill:#59a869;fill-opacity:1;stroke:none;stroke-width:0;stroke-miterlimit:4;stroke-dasharray:none">
<path
d="m 25,17 h -2 c -0.6,0 -1,0.4 -1,1 v 2.5 C 22,20.8 21.8,21 21.5,21 H 4.5 C 4.2,21 4,20.8 4,20.5 V 18 C 4,17.4 3.6,17 3,17 H 1 c -0.6,0 -1,0.4 -1,1 v 6 c 0,0.6 0.4,1 1,1 h 24 c 0.6,0 1,-0.4 1,-1 v -6 c 0,-0.6 -0.4,-1 -1,-1 z"
id="path2"
inkscape:connector-curvature="0"
style="fill:none;fill-opacity:1;stroke:#91a069;stroke-width:1.35746789;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
style="fill:#59a869;fill-opacity:1;stroke:none;stroke-width:0;stroke-miterlimit:4;stroke-dasharray:none" />
<path
d="m 12.3,16.7 c 0.2,0.2 0.5,0.3 0.7,0.3 0.2,0 0.5,-0.1 0.7,-0.3 l 6,-6 C 19.9,10.5 20,10.3 20,10 20,9.7 19.9,9.5 19.7,9.3 L 18.3,7.9 C 18.1,7.7 17.9,7.6 17.6,7.6 c -0.3,0 -0.5,0.1 -0.7,0.3 l -1,1 C 15.6,9.2 15,9 15,8.5 V 2 C 15,1.4 14.6,1 14,1 H 12 C 11.4,1 11,1.4 11,2 V 8.6 C 11,9 10.5,9.3 10.1,9 L 9.1,8 C 8.9,7.8 8.7,7.7 8.4,7.7 8.1,7.7 7.9,7.8 7.7,8 L 6.3,9.4 C 6.1,9.6 6,9.8 6,10.1 c 0,0.3 0.1,0.5 0.3,0.7 z"
id="path4"
inkscape:connector-curvature="0"
style="fill:none;fill-opacity:1;stroke:#91a069;stroke-width:1.35746789;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
style="fill:#59a869;fill-opacity:1;stroke:none;stroke-width:0;stroke-miterlimit:4;stroke-dasharray:none" />
</g>
<g
transform="matrix(3.7795276,0,0,3.7795276,669.63626,-482.15866)"
id="layer1"
inkscape:label="Layer 1" />
</svg>

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

@@ -12,7 +12,7 @@ import requests
from bauh.api.abstract.handler import TaskManager, ProcessWatcher
from bauh.api.http import HttpClient
from bauh.commons import internet
from bauh.commons.internet import InternetChecker
from bauh.gems.appimage import LOCAL_PATH, get_icon_path, INSTALLATION_PATH, SYMLINKS_DIR, util
from bauh.gems.appimage.model import AppImage
from bauh.view.util.translation import I18n
@@ -22,7 +22,9 @@ class DatabaseUpdater(Thread):
URL_DB = 'https://raw.githubusercontent.com/vinifmor/bauh-files/master/appimage/dbs.tar.gz'
COMPRESS_FILE_PATH = LOCAL_PATH + '/db.tar.gz'
def __init__(self, task_man: TaskManager, i18n: I18n, http_client: HttpClient, logger: logging.Logger, db_locks: dict, interval: int):
def __init__(self, task_man: TaskManager, i18n: I18n, http_client: HttpClient,
logger: logging.Logger, db_locks: dict, interval: int,
internet_checker: InternetChecker):
super(DatabaseUpdater, self).__init__(daemon=True)
self.http_client = http_client
self.logger = logger
@@ -31,6 +33,7 @@ class DatabaseUpdater(Thread):
self.i18n = i18n
self.task_man = task_man
self.task_id = 'appim_db'
self.internet_checker = internet_checker
def _finish_task(self):
if self.task_man:
@@ -44,7 +47,7 @@ class DatabaseUpdater(Thread):
self.task_man.update_progress(self.task_id, 10, None)
try:
if not internet.is_available():
if not self.internet_checker.is_available():
self._finish_task()
return
except requests.exceptions.ConnectionError:

View File

@@ -25,7 +25,7 @@ from bauh.api.abstract.view import MessageType, FormComponent, InputOption, Sing
ViewComponent, PanelComponent, MultipleSelectComponent, TextInputComponent, TextInputType, \
FileChooserComponent, TextComponent
from bauh.api.constants import TEMP_DIR
from bauh.commons import user, internet, system
from bauh.commons import user, system
from bauh.commons.category import CategoriesDownloader
from bauh.commons.config import save_config
from bauh.commons.html import bold
@@ -1175,7 +1175,7 @@ class ArchManager(SoftwareManager):
def _uninstall(self, context: TransactionContext, names: Set[str], remove_unneeded: bool = False, disk_loader: Optional[DiskCacheLoader] = None, skip_requirements: bool = False):
self._update_progress(context, 10)
net_available = internet.is_available() if disk_loader else True
net_available = self.context.internet_checker.is_available() if disk_loader else True
hard_requirements = set()
@@ -2830,7 +2830,8 @@ class ArchManager(SoftwareManager):
def upgrade_system(self, root_password: str, watcher: ProcessWatcher) -> bool:
# repo_map = pacman.map_repositories()
installed = self.read_installed(limit=-1, only_apps=False, pkg_types=None, internet_available=internet.is_available(), disk_loader=None).installed
net_available = self.context.internet_checker.is_available()
installed = self.read_installed(limit=-1, only_apps=False, pkg_types=None, internet_available=net_available, disk_loader=None).installed
if not installed:
watcher.show_message(title=self.i18n['arch.custom_action.upgrade_system'],
@@ -3077,7 +3078,7 @@ class ArchManager(SoftwareManager):
confirmation_label=self.i18n['proceed'].capitalize(),
deny_label=self.i18n['cancel'].capitalize()):
pwd, valid_pwd = watcher.request_root_password()
valid_pwd, pwd = watcher.request_root_password()
if valid_pwd:
handler = ProcessHandler(watcher)

View File

@@ -7,12 +7,12 @@
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"
inkscape:version="1.0 (4035a4fb49, 2020-05-01)"
height="23.999998"
width="24.000002"
sodipodi:docname="edit_pkgbuild.svg"
inkscape:version="1.0.1 (3bc2e813f5, 2020-09-07)"
height="512"
width="512"
sodipodi:docname="mark_pkgbuild.svg"
xml:space="preserve"
viewBox="0 0 24.000003 23.999999"
viewBox="0 0 512.00002 512.00002"
y="0px"
x="0px"
id="Capa_1"
@@ -25,9 +25,9 @@
inkscape:window-maximized="1"
inkscape:window-y="0"
inkscape:window-x="0"
inkscape:cy="-9.5853392"
inkscape:cx="75.093443"
inkscape:zoom="3.2847783"
inkscape:cy="176.38591"
inkscape:cx="96.230087"
inkscape:zoom="0.58067225"
fit-margin-bottom="0"
fit-margin-right="0"
fit-margin-left="0"
@@ -43,17 +43,18 @@
objecttolerance="10"
borderopacity="1"
bordercolor="#666666"
pagecolor="#ffffff" />
pagecolor="#ffffff"
inkscape:document-rotation="0" />
<g
style="fill:#91a069;fill-opacity:1;stroke-width:1.00086;stroke-miterlimit:4;stroke-dasharray:none"
transform="matrix(0.06909101,0,0,0.06879136,-0.05230155,-1.8775432e-7)"
style="fill:#59a869;fill-opacity:1;stroke-width:1.00086;stroke-miterlimit:4;stroke-dasharray:none"
transform="matrix(1.4532091,0,0,1.4469064,2.5008013,3.6009241)"
id="g1157">
<path
style="fill:#91a069;fill-opacity:1;stroke-width:1.00086;stroke-miterlimit:4;stroke-dasharray:none"
style="fill:#59a869;fill-opacity:1;stroke-width:1.00086;stroke-miterlimit:4;stroke-dasharray:none"
id="path1153"
d="m 333.988,11.758 -0.42,-0.383 C 325.538,4.04 315.129,0 304.258,0 292.071,0 280.37,5.159 272.154,14.153 L 116.803,184.231 c -1.416,1.55 -2.49,3.379 -3.154,5.37 l -18.267,54.762 c -2.112,6.331 -1.052,13.333 2.835,18.729 3.918,5.438 10.23,8.685 16.886,8.685 0,0 0.001,0 0.001,0 2.879,0 5.693,-0.592 8.362,-1.76 l 52.89,-23.138 c 1.923,-0.841 3.648,-2.076 5.063,-3.626 L 336.771,73.176 C 352.937,55.479 351.69,27.929 333.988,11.758 Z m -203.607,222.489 10.719,-32.134 0.904,-0.99 20.316,18.556 -0.904,0.99 z M 314.621,52.943 182.553,197.53 162.237,178.974 294.305,34.386 c 2.583,-2.828 6.118,-4.386 9.954,-4.386 3.365,0 6.588,1.252 9.082,3.53 l 0.419,0.383 c 5.484,5.009 5.87,13.546 0.861,19.03 z" />
<path
style="fill:#91a069;fill-opacity:1;stroke-width:1.00086;stroke-miterlimit:4;stroke-dasharray:none"
style="fill:#59a869;fill-opacity:1;stroke-width:1.00086;stroke-miterlimit:4;stroke-dasharray:none"
id="path1155"
d="m 303.85,138.388 c -8.284,0 -15,6.716 -15,15 v 127.347 c 0,21.034 -17.113,38.147 -38.147,38.147 H 68.904 c -21.035,0 -38.147,-17.113 -38.147,-38.147 V 100.413 c 0,-21.034 17.113,-38.147 38.147,-38.147 h 131.587 c 8.284,0 15,-6.716 15,-15 0,-8.284 -6.716,-15 -15,-15 H 68.904 c -37.577,0 -68.147,30.571 -68.147,68.147 v 180.321 c 0,37.576 30.571,68.147 68.147,68.147 h 181.798 c 37.576,0 68.147,-30.571 68.147,-68.147 V 153.388 c 0.001,-8.284 -6.715,-15 -14.999,-15 z" />
</g>

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

View File

@@ -11,16 +11,19 @@
id="Capa_1"
x="0px"
y="0px"
viewBox="0 0 24.000003 23.999999"
viewBox="0 0 512.00002 512.00002"
xml:space="preserve"
sodipodi:docname="unmark_pkgbuild.svg"
width="24.000002"
height="23.999998"
inkscape:version="1.0 (4035a4fb49, 2020-05-01)"><metadata
width="512"
height="512"
inkscape:version="1.0.1 (3bc2e813f5, 2020-09-07)"><metadata
id="metadata1194"><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="defs1192" /><sodipodi:namedview
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
id="defs1192">
</defs><sodipodi:namedview
inkscape:document-rotation="0"
pagecolor="#ffffff"
bordercolor="#666666"
@@ -38,26 +41,14 @@
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:zoom="3.2847783"
inkscape:cx="75.093443"
inkscape:cy="-9.5853392"
inkscape:zoom="0.58067225"
inkscape:cx="203.118"
inkscape:cy="164.43767"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="Capa_1" />
<g
id="g1157"
transform="matrix(0.06909101,0,0,0.06879136,-0.05230155,-1.8775432e-7)"
style="fill:#91a069;fill-opacity:1;stroke-width:1.00086;stroke-miterlimit:4;stroke-dasharray:none">
<path
d="m 333.988,11.758 -0.42,-0.383 C 325.538,4.04 315.129,0 304.258,0 292.071,0 280.37,5.159 272.154,14.153 L 116.803,184.231 c -1.416,1.55 -2.49,3.379 -3.154,5.37 l -18.267,54.762 c -2.112,6.331 -1.052,13.333 2.835,18.729 3.918,5.438 10.23,8.685 16.886,8.685 0,0 0.001,0 0.001,0 2.879,0 5.693,-0.592 8.362,-1.76 l 52.89,-23.138 c 1.923,-0.841 3.648,-2.076 5.063,-3.626 L 336.771,73.176 C 352.937,55.479 351.69,27.929 333.988,11.758 Z m -203.607,222.489 10.719,-32.134 0.904,-0.99 20.316,18.556 -0.904,0.99 z M 314.621,52.943 182.553,197.53 162.237,178.974 294.305,34.386 c 2.583,-2.828 6.118,-4.386 9.954,-4.386 3.365,0 6.588,1.252 9.082,3.53 l 0.419,0.383 c 5.484,5.009 5.87,13.546 0.861,19.03 z"
id="path1153"
style="fill:#91a069;fill-opacity:1;stroke-width:1.00086;stroke-miterlimit:4;stroke-dasharray:none" />
<path
d="m 303.85,138.388 c -8.284,0 -15,6.716 -15,15 v 127.347 c 0,21.034 -17.113,38.147 -38.147,38.147 H 68.904 c -21.035,0 -38.147,-17.113 -38.147,-38.147 V 100.413 c 0,-21.034 17.113,-38.147 38.147,-38.147 h 131.587 c 8.284,0 15,-6.716 15,-15 0,-8.284 -6.716,-15 -15,-15 H 68.904 c -37.577,0 -68.147,30.571 -68.147,68.147 v 180.321 c 0,37.576 30.571,68.147 68.147,68.147 h 181.798 c 37.576,0 68.147,-30.571 68.147,-68.147 V 153.388 c 0.001,-8.284 -6.715,-15 -14.999,-15 z"
id="path1155"
style="fill:#91a069;fill-opacity:1;stroke-width:1.00086;stroke-miterlimit:4;stroke-dasharray:none" />
</g>
<g
id="g1159"
transform="translate(-0.757)">
@@ -119,11 +110,13 @@
transform="translate(-0.757)">
</g>
<g
transform="matrix(-0.05511385,0,0,0.05511385,23.757631,0.24239608)"
style="fill:#ff0000"
id="g940"><g
style="fill:#ff0000"
id="g938"><path
style="fill:#ff0000"
id="path936"
d="M 213.333,0 C 95.467,0 0,95.467 0,213.333 0,331.199 95.467,426.666 213.333,426.666 331.199,426.666 426.667,331.2 426.667,213.333 426.667,95.466 331.2,0 213.333,0 Z M 42.667,213.333 c 0,-94.293 76.373,-170.667 170.667,-170.667 39.467,0 75.627,13.547 104.533,35.947 L 78.613,317.867 C 56.213,288.96 42.667,252.8 42.667,213.333 Z M 213.333,384 C 173.866,384 137.706,370.453 108.8,348.053 L 348.053,108.8 C 370.453,137.707 384,173.867 384,213.333 384,307.627 307.627,384 213.333,384 Z" /></g></g></svg>
id="g13014"><path
d="M 488.31349,20.148378 487.7019,19.593117 C 476.0096,8.9590807 460.85324,3.1020243 445.02418,3.1020243 c -17.74526,0 -34.78287,7.4793447 -46.74605,20.5185437 L 172.07443,270.19395 c -2.06182,2.24712 -3.62564,4.89876 -4.59248,7.78522 L 140.8837,357.3713 c -3.07524,9.17847 -1.5318,19.32972 4.12799,27.15267 5.70494,7.88383 14.89571,12.59122 24.5874,12.59122 0,0 0.001,0 0.001,0 4.19206,0 8.28947,-0.85817 12.17575,-2.5516 L 258.788,361.01891 c 2.80004,-1.21918 5.31179,-3.00972 7.37212,-5.25684 L 492.36576,109.19013 C 515.90477,83.533616 514.08904,43.59255 488.31349,20.148378 Z M 191.8451,342.70547 l 15.60774,-46.58681 1.31629,-1.43519 29.58175,26.90185 -1.31633,1.4352 z M 460.11355,79.857008 267.8118,289.47438 238.23004,262.57253 430.5318,52.953692 c 3.76106,-4.099938 8.90831,-6.358676 14.49383,-6.358676 4.89971,0 9.59268,1.815112 13.22415,5.117676 l 0.61012,0.555259 c 7.98514,7.26188 8.54719,19.638537 1.25373,27.589055 z"
id="path1153"
style="fill:#59a869;fill-opacity:1;stroke-width:1.45417;stroke-miterlimit:4;stroke-dasharray:none" /><path
d="m 444.4301,203.7323 c -12.06218,0 -21.84121,9.73663 -21.84121,21.7465 v 184.62339 c 0,30.4944 -24.91794,55.30424 -55.54515,55.30424 H 102.32958 c -30.628676,0 -55.545143,-24.80984 -55.545143,-55.30424 V 148.67742 c 0,-30.49439 24.917923,-55.30424 55.545143,-55.30424 h 191.60139 c 12.06218,0 21.84122,-9.73663 21.84122,-21.746496 0,-12.009866 -9.77904,-21.746497 -21.84122,-21.746497 H 102.32958 c -54.715176,0 -99.227587,44.32081 -99.227587,98.797233 v 261.42332 c 0,54.47644 44.513867,98.79724 99.227587,98.79724 h 264.71271 c 54.71372,0 99.22758,-44.3208 99.22758,-98.79724 V 225.4788 c 10e-4,-12.00987 -9.77759,-21.7465 -21.83977,-21.7465 z"
id="path1155"
style="fill:#59a869;fill-opacity:1;stroke-width:1.45417;stroke-miterlimit:4;stroke-dasharray:none" /><path
style="fill:#db5860;stroke-width:1.16152;fill-opacity:1"
id="path936"
d="m 256.00057,8.2104852 c 136.90315,0 247.78952,110.8863748 247.78952,247.7895248 0,136.90315 -110.88637,247.78952 -247.78952,247.78952 C 119.09742,503.78953 8.2098842,392.90432 8.2098842,256.00001 8.2098842,119.0957 119.09626,8.2104852 256.00057,8.2104852 Z M 454.23172,256.00001 c 0,-109.52276 -88.7084,-198.232317 -198.23231,-198.232317 -45.84152,0 -87.84191,15.735046 -121.41667,41.752987 L 412.4799,377.41784 c 26.01794,-33.57592 41.75182,-75.57631 41.75182,-121.41783 z M 256.00057,454.23232 c 45.84152,0 87.84191,-15.73504 121.41667,-41.75298 l -277.896,-277.896 c -26.01794,33.57592 -41.752987,75.57631 -41.752987,121.41667 0,109.52391 88.708397,198.23231 198.232317,198.23231 z" /></g></svg>

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

View File

@@ -258,4 +258,4 @@ gem.arch.info=Software packages available for distributions based on Arch Linux
gem.arch.label=Arch
gem.arch.type.arch_repo.label=Arch - Repository
gem.arch.type.aur.label=Arch - AUR
gem.aur.install.warning=AUR packages are maintained by an independent user community. There is no warranty that they will work or not harm your system.
gem.aur.install.warning=AUR packages are maintained by an independent user community. There is no warranty they will work or not harm your system.

View File

@@ -15,7 +15,7 @@ from bauh.api.abstract.model import PackageHistory, PackageUpdate, SoftwarePacka
SuggestionPriority, PackageStatus
from bauh.api.abstract.view import MessageType, FormComponent, SingleSelectComponent, InputOption, SelectViewType, \
ViewComponent, PanelComponent
from bauh.commons import user, internet
from bauh.commons import user
from bauh.commons.config import save_config
from bauh.commons.html import strip_html, bold
from bauh.commons.system import ProcessHandler
@@ -364,7 +364,7 @@ class FlatpakManager(SoftwareManager):
if user.is_root():
handler.handle_simple(flatpak.set_default_remotes('system'))
else:
user_password, valid = watcher.request_root_password()
valid, user_password = watcher.request_root_password()
if not valid:
watcher.print('Operation aborted')
return TransactionResult(success=False, installed=[], removed=[])
@@ -424,7 +424,7 @@ class FlatpakManager(SoftwareManager):
if current_installed_by_level and (not installed_by_level or len(current_installed_by_level) > len(installed_by_level) + 1):
pkg_key = '{}:{}:{}'.format(pkg.id, pkg.name, pkg.branch)
net_available = internet.is_available()
net_available = self.context.is_internet_available()
for p in current_installed_by_level:
current_key = '{}:{}:{}'.format(p['id'], p['name'], p['branch'])
if current_key != pkg_key and (not installed_by_level or current_key not in installed_by_level):

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