mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-08 09:44:15 +02:00
[ui][settings] sketch
This commit is contained in:
@@ -15,7 +15,8 @@ from bauh.api.abstract.disk import DiskCacheLoader
|
||||
from bauh.api.abstract.handler import ProcessWatcher
|
||||
from bauh.api.abstract.model import PackageUpdate, PackageHistory, SoftwarePackage, PackageSuggestion, PackageStatus, \
|
||||
SuggestionPriority
|
||||
from bauh.api.abstract.view import MessageType
|
||||
from bauh.api.abstract.view import MessageType, FormComponent, InputOption, SingleSelectComponent, SelectViewType, \
|
||||
ViewComponent
|
||||
from bauh.commons.category import CategoriesDownloader
|
||||
from bauh.commons.html import bold
|
||||
from bauh.commons.system import SystemProcess, ProcessHandler, new_subprocess, run_cmd, new_root_subprocess, \
|
||||
@@ -883,3 +884,26 @@ class ArchManager(SoftwareManager):
|
||||
|
||||
def get_screenshots(self, pkg: SoftwarePackage) -> List[str]:
|
||||
pass
|
||||
|
||||
def get_settings(self) -> ViewComponent:
|
||||
config = read_config()
|
||||
|
||||
optz_opts = [InputOption(label='on'.capitalize(), value=True),
|
||||
InputOption(label='off'.capitalize(), value=False)]
|
||||
|
||||
trans_check_opts = [InputOption(label='on'.capitalize(), value=True),
|
||||
InputOption(label='off'.capitalize(), value=False)]
|
||||
|
||||
fields = [
|
||||
SingleSelectComponent(label='Optimizations',
|
||||
options=optz_opts,
|
||||
default_option=[o for o in optz_opts if o.value == config['optimize']][0],
|
||||
max_per_line=len(optz_opts),
|
||||
type_=SelectViewType.RADIO),
|
||||
SingleSelectComponent(label='Transitive dependency checking',
|
||||
options=trans_check_opts,
|
||||
default_option=[o for o in trans_check_opts if o.value == config['optimize']][0],
|
||||
max_per_line=len(trans_check_opts),
|
||||
type_=SelectViewType.RADIO)]
|
||||
|
||||
return FormComponent([FormComponent(fields, label='Installation')])
|
||||
|
||||
@@ -8,7 +8,8 @@ from bauh.api.abstract.disk import DiskCacheLoader
|
||||
from bauh.api.abstract.handler import ProcessWatcher
|
||||
from bauh.api.abstract.model import PackageHistory, PackageUpdate, SoftwarePackage, PackageSuggestion, \
|
||||
SuggestionPriority
|
||||
from bauh.api.abstract.view import MessageType
|
||||
from bauh.api.abstract.view import MessageType, FormComponent, SingleSelectComponent, InputOption, SelectViewType, \
|
||||
ViewComponent
|
||||
from bauh.commons import user
|
||||
from bauh.commons.html import strip_html, bold
|
||||
from bauh.commons.system import SystemProcess, ProcessHandler, SimpleProcess
|
||||
@@ -415,3 +416,19 @@ class FlatpakManager(SoftwareManager):
|
||||
traceback.print_exc()
|
||||
|
||||
return urls
|
||||
|
||||
def get_settings(self) -> ViewComponent:
|
||||
fields = []
|
||||
|
||||
config = read_config()
|
||||
|
||||
install_opts = [InputOption(label='system'.capitalize(), value='system'),
|
||||
InputOption(label='user'.capitalize(), value='user'),
|
||||
InputOption(label='ask'.capitalize(), value=None)]
|
||||
fields.append(SingleSelectComponent(label='Level',
|
||||
options=install_opts,
|
||||
default_option=[o for o in install_opts if o.value == config['installation_level']][0],
|
||||
max_per_line=len(install_opts),
|
||||
type_=SelectViewType.RADIO))
|
||||
|
||||
return FormComponent([FormComponent(fields, 'Installation')])
|
||||
|
||||
Reference in New Issue
Block a user