[fix][ui][settings] not displaying all available gems

This commit is contained in:
Vinícius Moreira
2020-01-28 15:06:59 -03:00
parent b6ba643d9e
commit e859cfd06d
13 changed files with 20 additions and 9 deletions

View File

@@ -929,7 +929,7 @@ class WebApplicationManager(SoftwareManager):
system_nativefier = form_env.get_component('nativefier').get_selected() system_nativefier = form_env.get_component('nativefier').get_selected()
if system_nativefier and not nativefier.is_available(): if system_nativefier and not nativefier.is_available():
return False, ['Nativefier seems not to be installed on your system'] return False, [self.i18n['web.settings.env.nativefier.system.not_installed'].format('Nativefier')]
config['environment']['system'] = system_nativefier config['environment']['system'] = system_nativefier

View File

@@ -66,3 +66,4 @@ web.settings.nativefier.system=system
web.settings.nativefier.env.tooltip=The Nativefier version installed on the isolated {app} environment will be used to install applications web.settings.nativefier.env.tooltip=The Nativefier version installed on the isolated {app} environment will be used to install applications
web.settings.nativefier.system.tooltip=The Nativefier version installed on your system will be used to install applications web.settings.nativefier.system.tooltip=The Nativefier version installed on your system will be used to install applications
web.settings.nativefier.tip=Defines which Nativefier version should be used to generate the Web applications web.settings.nativefier.tip=Defines which Nativefier version should be used to generate the Web applications
web.settings.env.nativefier.system.not_installed={} seems not to be installed on your system

View File

@@ -66,3 +66,4 @@ web.settings.nativefier.system=sistema
web.settings.nativefier.env.tooltip=Se utilizará la versión de Nativefier instalada en el ambiente aislado de {app} para instalar aplicaciones web.settings.nativefier.env.tooltip=Se utilizará la versión de Nativefier instalada en el ambiente aislado de {app} para instalar aplicaciones
web.settings.nativefier.system.tooltip=Se utilizará la versión de Nativefier instalada en su sistema para instalar aplicaciones web.settings.nativefier.system.tooltip=Se utilizará la versión de Nativefier instalada en su sistema para instalar aplicaciones
web.settings.nativefier.tip=Define qué versión de Nativefier debe usarse para generar las aplicaciones Web web.settings.nativefier.tip=Define qué versión de Nativefier debe usarse para generar las aplicaciones Web
web.settings.env.nativefier.system.not_installed={} parece no estar instalado en su sistema

View File

@@ -66,3 +66,4 @@ web.settings.nativefier.system=sistema
web.settings.nativefier.env.tooltip=A versão do Nativefier instalada no ambiente isolado do {app} será utilizada para instalar aplicativos web.settings.nativefier.env.tooltip=A versão do Nativefier instalada no ambiente isolado do {app} será utilizada para instalar aplicativos
web.settings.nativefier.system.tooltip=A versão do Nativefier instalada no seu sistema será utilizada para instalar aplicativos web.settings.nativefier.system.tooltip=A versão do Nativefier instalada no seu sistema será utilizada para instalar aplicativos
web.settings.nativefier.tip=Define qual versão do Nativefier será utilizada para gerar os aplicativos Web web.settings.nativefier.tip=Define qual versão do Nativefier será utilizada para gerar os aplicativos Web
web.settings.env.nativefier.system.not_installed={} não parece estar instalado no seu sistema

View File

@@ -615,7 +615,7 @@ class GenericSoftwareManager(SoftwareManager):
gem_opts, def_gem_opts, gem_tabs = [], set(), [] gem_opts, def_gem_opts, gem_tabs = [], set(), []
for man in self.managers: for man in self.managers:
if self._can_work(man): if man.can_work():
man_comp = man.get_settings() man_comp = man.get_settings()
modname = man.__module__.split('.')[-2] modname = man.__module__.split('.')[-2]
icon_path = "{r}/gems/{n}/resources/img/{n}.svg".format(r=ROOT_DIR, n=modname) icon_path = "{r}/gems/{n}/resources/img/{n}.svg".format(r=ROOT_DIR, n=modname)
@@ -637,6 +637,7 @@ class GenericSoftwareManager(SoftwareManager):
if gem_opts: if gem_opts:
type_help = TextComponent(html=self.i18n['core.config.types.tip']) type_help = TextComponent(html=self.i18n['core.config.types.tip'])
gem_opts.sort(key=lambda o: o.value)
gem_selector = MultipleSelectComponent(label=None, gem_selector = MultipleSelectComponent(label=None,
tooltip=None, tooltip=None,
options=gem_opts, options=gem_opts,

View File

@@ -579,6 +579,8 @@ def to_widget(comp: ViewComponent, i18n: I18n, parent: QWidget = None) -> QWidge
elif isinstance(comp, TwoStateButtonComponent): elif isinstance(comp, TwoStateButtonComponent):
return TwoStateButtonQt(comp) return TwoStateButtonQt(comp)
elif isinstance(comp, TextComponent): elif isinstance(comp, TextComponent):
return QLabel(comp.value) label = QLabel(comp.value)
label.setSizePolicy(QSizePolicy.Minimum, QSizePolicy.Fixed)
return label
else: else:
raise Exception("Cannot render instances of " + comp.__class__.__name__) raise Exception("Cannot render instances of " + comp.__class__.__name__)

View File

@@ -56,7 +56,7 @@ class SettingsWindow(QWidget):
if success: if success:
if dialog.ask_confirmation(title=self.i18n['warning'].capitalize(), if dialog.ask_confirmation(title=self.i18n['warning'].capitalize(),
body="<p>{}</p><p>{}</p>".format(self.i18n['settings.changed.success.warning'], body="<p>{}</p><p>{}</p>".format(self.i18n['settings.changed.success.warning'],
self.i18n['settings.changed.success.reboot']), self.i18n['settings.changed.success.reboot']),
i18n=self.i18n): i18n=self.i18n):
util.restart_app(self.tray) util.restart_app(self.tray)
else: else:
@@ -70,11 +70,10 @@ class SettingsWindow(QWidget):
self.close() self.close()
else: else:
msg = StringIO() msg = StringIO()
msg.write("<p>It was not possible to properly save the settings</p>") msg.write("<p>{}</p>".format(self.i18n['settings.error']))
for w in warnings: for w in warnings:
msg.write('<p style="font-weight: bold">* ' + w + '</p><br/>') msg.write('<p style="font-weight: bold">* ' + w + '</p><br/>')
msg.seek(0) msg.seek(0)
dialog.show_message(title="Warning", body=msg.read(), type_=MessageType.WARNING) dialog.show_message(title="Warning", body=msg.read(), type_=MessageType.WARNING)

View File

@@ -254,6 +254,7 @@ core.config.suggestions.by_type.tip=Maximum number of suggestions that should be
core.config.types.tip=Check the application types you want to manage core.config.types.tip=Check the application types you want to manage
settings.changed.success.warning=Settings successfully changed. Some of them will only take effect after the restart. settings.changed.success.warning=Settings successfully changed. Some of them will only take effect after the restart.
settings.changed.success.reboot=Restart now ? settings.changed.success.reboot=Restart now ?
settings.error=It was not possible to properly change all the settings
locale.en=anglès locale.en=anglès
locale.es=castellà locale.es=castellà
locale.pt=portuguès locale.pt=portuguès

View File

@@ -209,6 +209,7 @@ core.config.suggestions.by_type.tip=Maximum number of suggestions that should be
core.config.types.tip=Check the application types you want to manage core.config.types.tip=Check the application types you want to manage
settings.changed.success.warning=Settings successfully changed. Some of them will only take effect after the restart. settings.changed.success.warning=Settings successfully changed. Some of them will only take effect after the restart.
settings.changed.success.reboot=Restart now ? settings.changed.success.reboot=Restart now ?
settings.error=It was not possible to properly change all the settings
locale.en=englisch locale.en=englisch
locale.es=spanisch locale.es=spanisch
locale.pt=portugiesisch locale.pt=portugiesisch

View File

@@ -216,6 +216,7 @@ core.config.suggestions.by_type.tip=Maximum number of suggestions that should be
core.config.types.tip=Check the application types you want to manage core.config.types.tip=Check the application types you want to manage
settings.changed.success.warning=Settings successfully changed. Some of them will only take effect after the restart. settings.changed.success.warning=Settings successfully changed. Some of them will only take effect after the restart.
settings.changed.success.reboot=Restart now ? settings.changed.success.reboot=Restart now ?
settings.error=It was not possible to properly change all the settings
locale.en=english locale.en=english
locale.es=spanish locale.es=spanish
locale.pt=portuguese locale.pt=portuguese

View File

@@ -257,6 +257,7 @@ core.config.suggestions.by_type.tip=Número máximo de sugerencias que deberían
core.config.types.tip=Marque los tipos de aplicaciones que desea administrar core.config.types.tip=Marque los tipos de aplicaciones que desea administrar
settings.changed.success.warning=Las configuraciones se cambiaron con éxito. Algunas solo tendrán efecto después del reinicio. settings.changed.success.warning=Las configuraciones se cambiaron con éxito. Algunas solo tendrán efecto después del reinicio.
settings.changed.success.reboot=¿Reiniciar ahora? settings.changed.success.reboot=¿Reiniciar ahora?
settings.error=No fue posible cambiar correctamente todas las configuraciones
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

@@ -209,6 +209,7 @@ core.config.suggestions.by_type.tip=Maximum number of suggestions that should be
core.config.types.tip=Check the application types you want to manage core.config.types.tip=Check the application types you want to manage
settings.changed.success.warning=Settings successfully changed. Some of them will only take effect after the restart. settings.changed.success.warning=Settings successfully changed. Some of them will only take effect after the restart.
settings.changed.success.reboot=Restart now ? settings.changed.success.reboot=Restart now ?
settings.error=It was not possible to properly change all the settings
locale.en=inglese locale.en=inglese
locale.es=spagnolo locale.es=spagnolo
locale.pt=portoghese locale.pt=portoghese

View File

@@ -260,6 +260,7 @@ core.config.suggestions.by_type.tip=Número máximo de sugestões que devem ser
core.config.types.tip=Marque os tipos de aplicativo que você quer gerenciar core.config.types.tip=Marque os tipos de aplicativo que você quer gerenciar
settings.changed.success.warning=Configurações alteradas com sucesso ! Algumas delas só surtirão após a reinicialização. settings.changed.success.warning=Configurações alteradas com sucesso ! Algumas delas só surtirão após a reinicialização.
settings.changed.success.reboot=Reiniciar agora ? settings.changed.success.reboot=Reiniciar agora ?
settings.error=Não foi possível alterar todas as configurações adequadamente
locale.en=inglês locale.en=inglês
locale.es=espanhol locale.es=espanhol
locale.pt=português locale.pt=português