mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-06 22:54:16 +02:00
improvement -> all suported types now display a 'Checking configuration file' task during the initialization process
This commit is contained in:
@@ -13,8 +13,8 @@ from bauh.api.abstract.view import ViewComponent, TabComponent, InputOption, Tex
|
||||
PanelComponent, FormComponent, TabGroupComponent, SingleSelectComponent, SelectViewType, TextInputComponent, \
|
||||
FileChooserComponent, RangeInputComponent
|
||||
from bauh.commons.view_utils import new_select
|
||||
from bauh.view.core import config, timeshift
|
||||
from bauh.view.core.config import read_config
|
||||
from bauh.view.core import timeshift
|
||||
from bauh.view.core.config import CoreConfigManager
|
||||
from bauh.view.core.downloader import AdaptableFileDownloader
|
||||
from bauh.view.util import translation
|
||||
from bauh.view.util.translation import I18n
|
||||
@@ -23,12 +23,13 @@ from bauh.view.util.translation import I18n
|
||||
class GenericSettingsManager:
|
||||
|
||||
def __init__(self, managers: List[SoftwareManager], working_managers: List[SoftwareManager],
|
||||
logger: logging.Logger, i18n: I18n, file_downloader: FileDownloader):
|
||||
logger: logging.Logger, i18n: I18n, file_downloader: FileDownloader, configman: CoreConfigManager):
|
||||
self.i18n = i18n
|
||||
self.managers = managers
|
||||
self.working_managers = working_managers
|
||||
self.logger = logger
|
||||
self.file_downloader = file_downloader
|
||||
self.configman = configman
|
||||
|
||||
def get_settings(self, screen_width: int, screen_height: int) -> ViewComponent:
|
||||
tabs = list()
|
||||
@@ -54,7 +55,7 @@ class GenericSettingsManager:
|
||||
if man.is_enabled() and man in self.working_managers:
|
||||
def_gem_opts.add(opt)
|
||||
|
||||
core_config = read_config()
|
||||
core_config = self.configman.get_config()
|
||||
|
||||
if gem_opts:
|
||||
type_help = TextComponent(html=self.i18n['core.config.types.tip'])
|
||||
@@ -340,7 +341,7 @@ class GenericSettingsManager:
|
||||
ui: PanelComponent,
|
||||
tray: PanelComponent,
|
||||
gems_panel: PanelComponent) -> Tuple[bool, Optional[List[str]]]:
|
||||
core_config = config.read_config()
|
||||
core_config = self.configman.get_config()
|
||||
|
||||
# general
|
||||
general_form = general.components[0]
|
||||
@@ -443,7 +444,7 @@ class GenericSettingsManager:
|
||||
core_config['gems'] = None if core_config['gems'] is None and len(checked_gems) == len(self.managers) else checked_gems
|
||||
|
||||
try:
|
||||
config.save(core_config)
|
||||
self.configman.save_config(core_config)
|
||||
return True, None
|
||||
except:
|
||||
return False, [traceback.format_exc()]
|
||||
|
||||
Reference in New Issue
Block a user