mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-09 17:54:14 +02:00
[ui] icons, buttons and colors changes
This commit is contained in:
@@ -8,8 +8,9 @@ from bauh.api.abstract.controller import SoftwareManager, SearchResult, Applicat
|
||||
from bauh.api.abstract.disk import DiskCacheLoader
|
||||
from bauh.api.abstract.handler import ProcessWatcher, TaskManager
|
||||
from bauh.api.abstract.model import SoftwarePackage, PackageHistory, PackageUpdate, PackageSuggestion, \
|
||||
SuggestionPriority
|
||||
SuggestionPriority, CustomSoftwareAction
|
||||
from bauh.api.abstract.view import SingleSelectComponent, SelectViewType, InputOption
|
||||
from bauh.commons import resource
|
||||
from bauh.commons.category import CategoriesDownloader
|
||||
from bauh.commons.html import bold
|
||||
from bauh.commons.system import SystemProcess, ProcessHandler, new_root_subprocess
|
||||
@@ -36,6 +37,13 @@ class SnapManager(SoftwareManager):
|
||||
self.categories = {}
|
||||
self.suggestions_cache = context.cache_factory.new()
|
||||
self.info_path = None
|
||||
self.custom_actions = [
|
||||
CustomSoftwareAction(i18n_status_key='snap.action.refresh.status',
|
||||
i18_label_key='snap.action.refresh.label',
|
||||
icon_path=resource.get_path('img/refresh.svg', context.get_view_path()),
|
||||
manager_method='refresh',
|
||||
requires_root=True)
|
||||
]
|
||||
|
||||
def get_info_path(self) -> str:
|
||||
if self.info_path is None:
|
||||
@@ -53,7 +61,8 @@ class SnapManager(SoftwareManager):
|
||||
version=app_json.get('version'),
|
||||
latest_version=app_json.get('version'),
|
||||
description=app_json.get('description', app_json.get('summary')),
|
||||
verified_publisher=app_json.get('developer_validation', '') == 'verified')
|
||||
verified_publisher=app_json.get('developer_validation', '') == 'verified',
|
||||
extra_actions=self.custom_actions)
|
||||
|
||||
if app.publisher and app.publisher.endswith('*'):
|
||||
app.verified_publisher = True
|
||||
|
||||
@@ -4,14 +4,6 @@ from bauh.api.abstract.model import SoftwarePackage, CustomSoftwareAction
|
||||
from bauh.commons import resource
|
||||
from bauh.gems.snap import ROOT_DIR
|
||||
|
||||
EXTRA_INSTALLED_ACTIONS = [
|
||||
CustomSoftwareAction(i18n_status_key='snap.action.refresh.status',
|
||||
i18_label_key='snap.action.refresh.label',
|
||||
icon_path=resource.get_path('img/refresh.svg', ROOT_DIR),
|
||||
manager_method='refresh',
|
||||
requires_root=True)
|
||||
]
|
||||
|
||||
KNOWN_RUNTIME_NAMES = {'snapd', 'snapcraft', 'multipass'}
|
||||
|
||||
|
||||
@@ -19,7 +11,7 @@ class SnapApplication(SoftwarePackage):
|
||||
|
||||
def __init__(self, id: str = None, name: str = None, version: str = None, latest_version: str = None,
|
||||
description: str = None, publisher: str = None, rev: str = None, notes: str = None,
|
||||
confinement: str = None, has_apps_field: bool = None, verified_publisher: bool = False):
|
||||
confinement: str = None, has_apps_field: bool = None, verified_publisher: bool = False, extra_actions: List[CustomSoftwareAction] = None):
|
||||
super(SnapApplication, self).__init__(id=id, name=name, version=version,
|
||||
latest_version=latest_version, description=description)
|
||||
self.publisher = publisher
|
||||
@@ -28,6 +20,7 @@ class SnapApplication(SoftwarePackage):
|
||||
self.confinement = confinement
|
||||
self.has_apps_field = has_apps_field
|
||||
self.verified_publisher = verified_publisher
|
||||
self.extra_actions = extra_actions
|
||||
|
||||
def supports_disk_cache(self):
|
||||
return self.installed
|
||||
@@ -81,7 +74,7 @@ class SnapApplication(SoftwarePackage):
|
||||
|
||||
def get_custom_supported_actions(self) -> List[CustomSoftwareAction]:
|
||||
if self.installed:
|
||||
return EXTRA_INSTALLED_ACTIONS
|
||||
return self.extra_actions
|
||||
|
||||
def supports_backup(self) -> bool:
|
||||
return True
|
||||
|
||||
@@ -1,146 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
|
||||
<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"
|
||||
version="1.1"
|
||||
id="Capa_1"
|
||||
x="0px"
|
||||
y="0px"
|
||||
width="48"
|
||||
height="48"
|
||||
viewBox="0 0 47.999999 47.999999"
|
||||
xml:space="preserve"
|
||||
sodipodi:docname="refresh_2.svg"
|
||||
inkscape:version="0.92.3 (2405546, 2018-03-11)"><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></dc:title></cc:Work></rdf:RDF></metadata><defs
|
||||
id="defs43"><linearGradient
|
||||
inkscape:collect="always"
|
||||
id="linearGradient540"><stop
|
||||
style="stop-color:#0088aa;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop536" /><stop
|
||||
style="stop-color:#0088aa;stop-opacity:0;"
|
||||
offset="1"
|
||||
id="stop538" /></linearGradient><linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient540"
|
||||
id="linearGradient542"
|
||||
x1="-130.74721"
|
||||
y1="-214.80638"
|
||||
x2="-556.49438"
|
||||
y2="110.01643"
|
||||
gradientUnits="userSpaceOnUse" /></defs><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="703"
|
||||
id="namedview41"
|
||||
showgrid="false"
|
||||
showborder="false"
|
||||
inkscape:zoom="1.9374833"
|
||||
inkscape:cx="165.58246"
|
||||
inkscape:cy="-10.288149"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="260"
|
||||
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" />
|
||||
<g
|
||||
id="g8"
|
||||
transform="matrix(0.10547014,0,0,0.0985161,-1.6940777,0)"
|
||||
style="fill:url(#linearGradient542);fill-opacity:1">
|
||||
<g
|
||||
id="g6"
|
||||
style="fill:url(#linearGradient542);fill-opacity:1">
|
||||
<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:url(#linearGradient542);fill-opacity:1" />
|
||||
<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:url(#linearGradient542);fill-opacity:1" />
|
||||
</g>
|
||||
</g>
|
||||
<g
|
||||
id="g10"
|
||||
transform="translate(-16.062155,-439.23)">
|
||||
</g>
|
||||
<g
|
||||
id="g12"
|
||||
transform="translate(-16.062155,-439.23)">
|
||||
</g>
|
||||
<g
|
||||
id="g14"
|
||||
transform="translate(-16.062155,-439.23)">
|
||||
</g>
|
||||
<g
|
||||
id="g16"
|
||||
transform="translate(-16.062155,-439.23)">
|
||||
</g>
|
||||
<g
|
||||
id="g18"
|
||||
transform="translate(-16.062155,-439.23)">
|
||||
</g>
|
||||
<g
|
||||
id="g20"
|
||||
transform="translate(-16.062155,-439.23)">
|
||||
</g>
|
||||
<g
|
||||
id="g22"
|
||||
transform="translate(-16.062155,-439.23)">
|
||||
</g>
|
||||
<g
|
||||
id="g24"
|
||||
transform="translate(-16.062155,-439.23)">
|
||||
</g>
|
||||
<g
|
||||
id="g26"
|
||||
transform="translate(-16.062155,-439.23)">
|
||||
</g>
|
||||
<g
|
||||
id="g28"
|
||||
transform="translate(-16.062155,-439.23)">
|
||||
</g>
|
||||
<g
|
||||
id="g30"
|
||||
transform="translate(-16.062155,-439.23)">
|
||||
</g>
|
||||
<g
|
||||
id="g32"
|
||||
transform="translate(-16.062155,-439.23)">
|
||||
</g>
|
||||
<g
|
||||
id="g34"
|
||||
transform="translate(-16.062155,-439.23)">
|
||||
</g>
|
||||
<g
|
||||
id="g36"
|
||||
transform="translate(-16.062155,-439.23)">
|
||||
</g>
|
||||
<g
|
||||
id="g38"
|
||||
transform="translate(-16.062155,-439.23)">
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 4.8 KiB |
Reference in New Issue
Block a user