mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-06 22:54:16 +02:00
[flatpak] improvement: not displaying the installation target option when bauh is launched by the root user (settings)
This commit is contained in:
@@ -32,6 +32,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|||||||
- AppImage
|
- AppImage
|
||||||
- faster reading of installed applications (subprocess call replaced by Python call)
|
- faster reading of installed applications (subprocess call replaced by Python call)
|
||||||
|
|
||||||
|
- Flatpak
|
||||||
|
- settings: not displaying the installation target option when bauh is launched by the root user
|
||||||
|
|
||||||
- Web
|
- Web
|
||||||
- the Electron builds cache directory has been moved to the environment directory `~/.local/share/bauh/web/env/electron`
|
- the Electron builds cache directory has been moved to the environment directory `~/.local/share/bauh/web/env/electron`
|
||||||
- letting the Electron client to download the Electron build file instead of bauh (to avoid wrong caching paths)
|
- letting the Electron client to download the Electron build file instead of bauh (to avoid wrong caching paths)
|
||||||
|
|||||||
@@ -592,27 +592,28 @@ class FlatpakManager(SoftwareManager):
|
|||||||
return urls
|
return urls
|
||||||
|
|
||||||
def get_settings(self, screen_width: int, screen_height: int) -> Optional[ViewComponent]:
|
def get_settings(self, screen_width: int, screen_height: int) -> Optional[ViewComponent]:
|
||||||
fields = []
|
if not self.context.root_user:
|
||||||
|
fields = []
|
||||||
|
|
||||||
flatpak_config = self.configman.get_config()
|
flatpak_config = self.configman.get_config()
|
||||||
|
|
||||||
install_opts = [InputOption(label=self.i18n['flatpak.config.install_level.system'].capitalize(),
|
install_opts = [InputOption(label=self.i18n['flatpak.config.install_level.system'].capitalize(),
|
||||||
value='system',
|
value='system',
|
||||||
tooltip=self.i18n['flatpak.config.install_level.system.tip']),
|
tooltip=self.i18n['flatpak.config.install_level.system.tip']),
|
||||||
InputOption(label=self.i18n['flatpak.config.install_level.user'].capitalize(),
|
InputOption(label=self.i18n['flatpak.config.install_level.user'].capitalize(),
|
||||||
value='user',
|
value='user',
|
||||||
tooltip=self.i18n['flatpak.config.install_level.user.tip']),
|
tooltip=self.i18n['flatpak.config.install_level.user.tip']),
|
||||||
InputOption(label=self.i18n['ask'].capitalize(),
|
InputOption(label=self.i18n['ask'].capitalize(),
|
||||||
value=None,
|
value=None,
|
||||||
tooltip=self.i18n['flatpak.config.install_level.ask.tip'].format(app=self.context.app_name))]
|
tooltip=self.i18n['flatpak.config.install_level.ask.tip'].format(app=self.context.app_name))]
|
||||||
fields.append(SingleSelectComponent(label=self.i18n['flatpak.config.install_level'],
|
fields.append(SingleSelectComponent(label=self.i18n['flatpak.config.install_level'],
|
||||||
options=install_opts,
|
options=install_opts,
|
||||||
default_option=[o for o in install_opts if o.value == flatpak_config['installation_level']][0],
|
default_option=[o for o in install_opts if o.value == flatpak_config['installation_level']][0],
|
||||||
max_per_line=len(install_opts),
|
max_per_line=len(install_opts),
|
||||||
max_width=floor(screen_width * 0.22),
|
max_width=floor(screen_width * 0.22),
|
||||||
type_=SelectViewType.RADIO))
|
type_=SelectViewType.RADIO))
|
||||||
|
|
||||||
return PanelComponent([FormComponent(fields, self.i18n['installation'].capitalize())])
|
return PanelComponent([FormComponent(fields, self.i18n['installation'].capitalize())])
|
||||||
|
|
||||||
def save_settings(self, component: PanelComponent) -> Tuple[bool, Optional[List[str]]]:
|
def save_settings(self, component: PanelComponent) -> Tuple[bool, Optional[List[str]]]:
|
||||||
flatpak_config = self.configman.get_config()
|
flatpak_config = self.configman.get_config()
|
||||||
|
|||||||
Reference in New Issue
Block a user