[ui][settings] more improvements and settings

This commit is contained in:
Vinícius Moreira
2020-01-27 13:30:32 -03:00
parent c23911290c
commit ce673dda5d
8 changed files with 78 additions and 2 deletions

View File

@@ -454,7 +454,31 @@ class GenericSoftwareManager(SoftwareManager):
form_download = FormComponent(label=self.i18n['download'].capitalize(), components=[select_dicons, select_dmthread], id_='form_download') form_download = FormComponent(label=self.i18n['download'].capitalize(), components=[select_dicons, select_dmthread], id_='form_download')
sub_comps = [form_general, form_download] select_sugs = self._gen_bool_component(label=self.i18n['core.config.suggestions.activated'].capitalize(),
tooltip=self.i18n['core.config.suggestions.activated.tip'].format(app=self.context.app_name),
id_="sugs_enabled",
value=bool(core_config['suggestions']['enabled']))
form_sugs = FormComponent(label=self.i18n['core.config.suggestions'].capitalize(),
components=[select_sugs], id_='form_sugs')
input_data_exp = TextInputComponent(label=self.i18n['core.config.mem_cache.data_exp'],
tooltip=self.i18n['core.config.mem_cache.data_exp.tip'],
value=str(core_config['memory_cache']['data_expiration']),
only_int=True,
id_="data_exp")
input_icon_exp = TextInputComponent(label=self.i18n['core.config.mem_cache.icon_exp'],
tooltip=self.i18n['core.config.mem_cache.icon_exp.tip'],
value=str(core_config['memory_cache']['icon_expiration']),
only_int=True,
id_="icon_exp")
form_cache = FormComponent(label=self.i18n['core.config.mem_cache'].capitalize(),
components=[input_data_exp, input_icon_exp],
id_='form_memcache')
sub_comps = [form_general, form_download, form_sugs, form_cache]
return TabComponent(self.i18n['core.config.tab_label'].capitalize(), PanelComponent([FormComponent(sub_comps)]), None, 'core') return TabComponent(self.i18n['core.config.tab_label'].capitalize(), PanelComponent([FormComponent(sub_comps)]), None, 'core')
def _save_settings(self, panel: PanelComponent) -> Tuple[bool, List[str]]: def _save_settings(self, panel: PanelComponent) -> Tuple[bool, List[str]]:
@@ -475,6 +499,15 @@ class GenericSoftwareManager(SoftwareManager):
download_mthreaded = main_form.get_component('form_download').get_component('down_mthread').get_selected() download_mthreaded = main_form.get_component('form_download').get_component('down_mthread').get_selected()
core_config['download']['multithreaded'] = download_mthreaded core_config['download']['multithreaded'] = download_mthreaded
data_exp = main_form.get_component('form_memcache').get_component('data_exp').get_int_value()
core_config['memory_cache']['data_expiration'] = data_exp
icon_exp = main_form.get_component('form_memcache').get_component('icon_exp').get_int_value()
core_config['memory_cache']['icon_expiration'] = icon_exp
sugs_enabled = main_form.get_component('form_sugs').get_component('sugs_enabled').get_value()
core_config['suggestions']['enabled'] = sugs_enabled
try: try:
config.save(core_config) config.save(core_config)
return True, None return True, None

View File

@@ -4,7 +4,8 @@ from typing import Tuple
from PyQt5.QtCore import Qt, QSize from PyQt5.QtCore import Qt, QSize
from PyQt5.QtGui import QIcon, QPixmap, QIntValidator from PyQt5.QtGui import QIcon, QPixmap, QIntValidator
from PyQt5.QtWidgets import QRadioButton, QGroupBox, QCheckBox, QComboBox, QGridLayout, QWidget, \ from PyQt5.QtWidgets import QRadioButton, QGroupBox, QCheckBox, QComboBox, QGridLayout, QWidget, \
QLabel, QSizePolicy, QLineEdit, QToolButton, QHBoxLayout, QFormLayout, QFileDialog, QTabWidget, QVBoxLayout, QSlider QLabel, QSizePolicy, QLineEdit, QToolButton, QHBoxLayout, QFormLayout, QFileDialog, QTabWidget, QVBoxLayout, \
QSlider, QScrollArea, QFrame
from bauh.api.abstract.view import SingleSelectComponent, InputOption, MultipleSelectComponent, SelectViewType, \ from bauh.api.abstract.view import SingleSelectComponent, InputOption, MultipleSelectComponent, SelectViewType, \
TextInputComponent, FormComponent, FileChooserComponent, ViewComponent, TabGroupComponent, PanelComponent, \ TextInputComponent, FormComponent, FileChooserComponent, ViewComponent, TabGroupComponent, PanelComponent, \

View File

@@ -232,6 +232,12 @@ core.config.download.icons=Icons
core.config.download.icons.tip=If the application icons should be downloaded and displayed on the table core.config.download.icons.tip=If the application icons should be downloaded and displayed on the table
core.config.download.multithreaded=Parallelism core.config.download.multithreaded=Parallelism
core.config.download.multithreaded.tip=Whether applications, packages and files should be downloaded with a tool that works with parallelism / multi-thread (faster). At the moment only the aria2 application is supported core.config.download.multithreaded.tip=Whether applications, packages and files should be downloaded with a tool that works with parallelism / multi-thread (faster). At the moment only the aria2 application is supported
core.config.mem_cache=Memory storage
core.config.mem_cache.data_exp=Data expiration
core.config.mem_cache.data_exp.tip=Defines the in-memory data lifetime ( in SECONDS )
core.config.suggestions=Suggestions
core.config.suggestions.activated=Activated
core.config.suggestions.activated.tip=If {app} can suggest applications to install
locale.en=anglès locale.en=anglès
locale.es=castellà locale.es=castellà
locale.pt=portuguès locale.pt=portuguès

View File

@@ -187,6 +187,12 @@ core.config.download.icons=Icons
core.config.download.icons.tip=If the application icons should be downloaded and displayed on the table core.config.download.icons.tip=If the application icons should be downloaded and displayed on the table
core.config.download.multithreaded=Parallelism core.config.download.multithreaded=Parallelism
core.config.download.multithreaded.tip=Whether applications, packages and files should be downloaded with a tool that works with parallelism / multi-thread (faster). At the moment only the aria2 application is supported core.config.download.multithreaded.tip=Whether applications, packages and files should be downloaded with a tool that works with parallelism / multi-thread (faster). At the moment only the aria2 application is supported
core.config.mem_cache=Memory storage
core.config.mem_cache.data_exp=Data expiration
core.config.mem_cache.data_exp.tip=Defines the in-memory data lifetime ( in SECONDS )
core.config.suggestions=Suggestions
core.config.suggestions.activated=Activated
core.config.suggestions.activated.tip=If {app} can suggest applications to install
locale.en=englisch locale.en=englisch
locale.es=spanisch locale.es=spanisch
locale.pt=portugiesisch locale.pt=portugiesisch

View File

@@ -190,6 +190,14 @@ core.config.download.icons=Icons
core.config.download.icons.tip=If the application icons should be downloaded and displayed on the table core.config.download.icons.tip=If the application icons should be downloaded and displayed on the table
core.config.download.multithreaded=Parallelism core.config.download.multithreaded=Parallelism
core.config.download.multithreaded.tip=Whether applications, packages and files should be downloaded with a tool that works with parallelism / multi-thread ( faster ). At the moment only the aria2 application is supported core.config.download.multithreaded.tip=Whether applications, packages and files should be downloaded with a tool that works with parallelism / multi-thread ( faster ). At the moment only the aria2 application is supported
core.config.mem_cache=Memory storage
core.config.mem_cache.data_exp=Data expiration
core.config.mem_cache.data_exp.tip=Defines the in-memory data lifetime ( in SECONDS )
core.config.mem_cache.icon_exp=Icons expiration
core.config.mem_cache.icon_exp.tip=Defines the in-memory icons lifetime ( in SECONDS )
core.config.suggestions=Suggestions
core.config.suggestions.activated=Activated
core.config.suggestions.activated.tip=If {app} can suggest applications to install
locale.en=english locale.en=english
locale.es=spanish locale.es=spanish
locale.pt=portuguese locale.pt=portuguese

View File

@@ -231,6 +231,14 @@ core.config.download.icons=Iconos
core.config.download.icons.tip=Si los íconos de las aplicaciones se deben descargar y mostrar en la tabla core.config.download.icons.tip=Si los íconos de las aplicaciones se deben descargar y mostrar en la tabla
core.config.download.multithreaded=Paralelismo core.config.download.multithreaded=Paralelismo
core.config.download.multithreaded.tip=Si las aplicaciones, paquetes y archivos deben descargarse con una herramienta que funcione con paralelismo / multi-thread ( más rápido ). Por el momento solo se admite la aplicación aria2 core.config.download.multithreaded.tip=Si las aplicaciones, paquetes y archivos deben descargarse con una herramienta que funcione con paralelismo / multi-thread ( más rápido ). Por el momento solo se admite la aplicación aria2
core.config.mem_cache=Almacenamiento de memoria
core.config.mem_cache.data_exp=Expiración de datos
core.config.mem_cache.data_exp.tip=Define la vida útil de los datos en memoria ( en SEGUNDOS )
core.config.mem_cache.icon_exp=Expiración de íconos
core.config.mem_cache.icon_exp.tip=Define la vida útil de los íconos en memoria ( en SEGUNDOS )
core.config.suggestions=Sugerencias
core.config.suggestions.activated=Activadas
core.config.suggestions.activated.tip=Si {app} puede sugerir aplicaciones para instalar
locale.es=inglés locale.es=inglés
locale.es=español locale.es=español
locale.pt=portugués locale.pt=portugués

View File

@@ -188,6 +188,12 @@ core.config.download.icons=Icons
core.config.download.icons.tip=If the application icons should be downloaded and displayed on the table core.config.download.icons.tip=If the application icons should be downloaded and displayed on the table
core.config.download.multithreaded=Parallelism core.config.download.multithreaded=Parallelism
core.config.download.multithreaded.tip=Whether applications, packages and files should be downloaded with a tool that works with parallelism / multi-thread (faster). At the moment only the aria2 application is supported core.config.download.multithreaded.tip=Whether applications, packages and files should be downloaded with a tool that works with parallelism / multi-thread (faster). At the moment only the aria2 application is supported
core.config.mem_cache=Memory storage
core.config.mem_cache.data_exp=Data expiration
core.config.mem_cache.data_exp.tip=Defines the in-memory data lifetime ( in SECONDS )
core.config.suggestions=Suggestions
core.config.suggestions.activated=Activated
core.config.suggestions.activated.tip=If {app} can suggest applications to install
locale.en=inglese locale.en=inglese
locale.es=spagnolo locale.es=spagnolo
locale.pt=portoghese locale.pt=portoghese

View File

@@ -234,6 +234,14 @@ core.config.download.icons=Ícones
core.config.download.icons.tip=Se os ícones dos aplicativos devem ser baixados e exibidos na tabela core.config.download.icons.tip=Se os ícones dos aplicativos devem ser baixados e exibidos na tabela
core.config.download.multithreaded=Paralelismo core.config.download.multithreaded=Paralelismo
core.config.download.multithreaded.tip=Se os aplicativos, pacotes e arquivos devem ser baixados através de uma ferramenta que trabalha com paralelismo / multi-thread ( mais rápido ). No momento somente o aplicativo aria2 é suportado. core.config.download.multithreaded.tip=Se os aplicativos, pacotes e arquivos devem ser baixados através de uma ferramenta que trabalha com paralelismo / multi-thread ( mais rápido ). No momento somente o aplicativo aria2 é suportado.
core.config.mem_cache=Armazenamento em memória
core.config.mem_cache.data_exp=Expiração dos dados
core.config.mem_cache.data_exp.tip=Define o tempo de vida dos dados em memória ( em SEGUNDOS )
core.config.mem_cache.icon_exp=Expiração de ícones
core.config.mem_cache.icon_exp.tip=Define o tempo de vida dos ícones em memória ( em SEGUNDOS )
core.config.suggestions=Sugestões
core.config.suggestions.activated=Ativadas
core.config.suggestions.activated.tip=Se o {app} pode sugerir aplicativos para a instalação
locale.en=inglês locale.en=inglês
locale.es=espanhol locale.es=espanhol
locale.pt=português locale.pt=português