diff --git a/bauh/api/abstract/view.py b/bauh/api/abstract/view.py index d2b1d8e8..617ce1ab 100644 --- a/bauh/api/abstract/view.py +++ b/bauh/api/abstract/view.py @@ -167,11 +167,12 @@ class FileChooserComponent(ViewComponent): class TabComponent(ViewComponent): - def __init__(self, label: str, content: ViewComponent, icon_path: str = None, id_: str = None): + def __init__(self, label: str, content: ViewComponent, icon_path: str = None, tooltip: str = None, id_: str = None): super(TabComponent, self).__init__(id_=id_) self.label = label self.content = content self.icon_path = icon_path + self.tooltip = tooltip class TabGroupComponent(ViewComponent): diff --git a/bauh/view/core/controller.py b/bauh/view/core/controller.py index 6e6acfb3..fd42eaaa 100755 --- a/bauh/view/core/controller.py +++ b/bauh/view/core/controller.py @@ -609,7 +609,8 @@ class GenericSoftwareManager(SoftwareManager): if man_comp: modname = man.__module__.split('.')[-2] icon_path = "{r}/gems/{n}/resources/img/{n}.svg".format(r=ROOT_DIR, n=modname) - tabs.append(TabComponent(None, man_comp, icon_path, modname)) + tabs.append(TabComponent(label=None, content=man_comp, icon_path=icon_path, + tooltip=modname.capitalize(), id_=modname)) return TabGroupComponent(tabs) diff --git a/bauh/view/qt/settings.py b/bauh/view/qt/settings.py index 26133413..89d53fcd 100644 --- a/bauh/view/qt/settings.py +++ b/bauh/view/qt/settings.py @@ -12,13 +12,14 @@ from bauh.view.util.translation import I18n class SettingsWindow(QWidget): - def __init__(self, manager: SoftwareManager, i18n: I18n, screen_size: QSize, parent: QWidget = None): + def __init__(self, manager: SoftwareManager, i18n: I18n, screen_size: QSize, tray: bool, parent: QWidget = None): super(SettingsWindow, self).__init__(parent=parent) self.setWindowTitle(i18n['settings'].capitalize()) self.setLayout(QVBoxLayout()) self.manager = manager self.i18n = i18n self.setSizePolicy(QSizePolicy.Minimum, QSizePolicy.Preferred) + self.tray = tray self.settings_model = self.manager.get_settings() diff --git a/bauh/view/qt/window.py b/bauh/view/qt/window.py index 46bfb6a3..c8b81685 100755 --- a/bauh/view/qt/window.py +++ b/bauh/view/qt/window.py @@ -316,10 +316,6 @@ class ManageWindow(QWidget): self.toolbar_bottom.addWidget(new_spacer()) - self.combo_styles = StylesComboBox(parent=self, i18n=i18n, show_panel_after_restart=bool(tray_icon)) - self.combo_styles.setStyleSheet('QComboBox {font-size: 12px;}') - self.ref_combo_styles = self.toolbar_bottom.addWidget(self.combo_styles) - bt_settings = IconButton(QIcon(resource.get_path('img/app_settings.svg')), action=self._show_settings_menu, background='#12ABAB', @@ -350,7 +346,7 @@ class ManageWindow(QWidget): def set_tray_icon(self, tray_icon): self.tray_icon = tray_icon - self.combo_styles.show_panel_after_restart = bool(tray_icon) + # self.combo_styles.show_panel_after_restart = bool(tray_icon) def _update_process_progress(self, val: int): if self.progress_controll_enabled: @@ -913,7 +909,6 @@ class ManageWindow(QWidget): self.thread_animate_progress.stop = False self.thread_animate_progress.start() self.ref_progress_bar.setVisible(True) - self.ref_combo_styles.setVisible(False) self.label_status.setText(action_label + "...") self.ref_bt_upgrade.setVisible(False) @@ -943,7 +938,6 @@ class ManageWindow(QWidget): self.combo_filter_type.setEnabled(False) def finish_action(self, keep_filters: bool = False): - self.ref_combo_styles.setVisible(True) self.thread_animate_progress.stop = True self.thread_animate_progress.wait(msecs=1000) self.ref_progress_bar.setVisible(False) @@ -1166,7 +1160,7 @@ class ManageWindow(QWidget): gem_panel.show() def show_settings_window(self): - self.settings_window = SettingsWindow(self.manager, self.i18n, self.screen_size) + self.settings_window = SettingsWindow(self.manager, self.i18n, self.screen_size, bool(self.tray_icon)) self.settings_window.setMinimumWidth(int(self.screen_size.width() / 4)) self.settings_window.resize(self.size()) self.settings_window.adjustSize() @@ -1185,6 +1179,7 @@ class ManageWindow(QWidget): action_settings = QAction(self.i18n['settings'].capitalize()) action_settings.triggered.connect(self.show_settings_window) + action_settings.setIcon(QIcon(resource.get_path('img/tools.svg'))) menu_row.addAction(action_settings) action_about = QAction(self.i18n['manage_window.settings.about']) diff --git a/bauh/view/resources/img/tools.svg b/bauh/view/resources/img/tools.svg new file mode 100644 index 00000000..1f501bae --- /dev/null +++ b/bauh/view/resources/img/tools.svg @@ -0,0 +1,97 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + diff --git a/bauh/view/resources/locale/ca b/bauh/view/resources/locale/ca index 91f3e663..0935f81d 100644 --- a/bauh/view/resources/locale/ca +++ b/bauh/view/resources/locale/ca @@ -122,8 +122,6 @@ change=modifica exit=surt manage_window.settings.gems=Tipus d’aplicacions style=estil -style.change.title=Canvi d’estil -style.change.question=Cal reiniciar el {} per a canviar-ne l’estil. Voleu continuar? manage_window.bt_settings.tooltip=Feu clic aquí per a obrir accions addicionals downloading=S’està baixant console.install_logs.path=Trobareu registres d’instal·lació a {} diff --git a/bauh/view/resources/locale/de b/bauh/view/resources/locale/de index 2e9d6959..7fb62726 100644 --- a/bauh/view/resources/locale/de +++ b/bauh/view/resources/locale/de @@ -122,8 +122,6 @@ change=Verändern exit=Beenden manage_window.settings.gems=Anwendungsarten style=Stil -style.change.title=Stil ändern -style.change.question=Um den aktuellen Stil zu ändern ist ein Neustart von {} nötig. Fortfahren? manage_window.bt_settings.tooltip=Für mehr Optionen hier klicken downloading=Herunterladen console.install_logs.path=Logs der Installationen können unter {} gefunden werden diff --git a/bauh/view/resources/locale/en b/bauh/view/resources/locale/en index 55409951..29c4cd24 100644 --- a/bauh/view/resources/locale/en +++ b/bauh/view/resources/locale/en @@ -122,8 +122,6 @@ change=change exit=exit manage_window.settings.gems=Application types style=style -style.change.title=Style change -style.change.question=To change the current style is necessary to restart {}. Proceed ? manage_window.bt_settings.tooltip=Click here to open extra actions downloading=Downloading console.install_logs.path=Installation logs can be found at {} diff --git a/bauh/view/resources/locale/es b/bauh/view/resources/locale/es index a51f36d5..3f47b248 100644 --- a/bauh/view/resources/locale/es +++ b/bauh/view/resources/locale/es @@ -122,8 +122,6 @@ change=cambiar exit=salir manage_window.settings.gems=Tipos de aplicaciones style=estilo -style.change.title=Cambio de estilo -style.change.question=Para cambiar el estilo actual es necesario reiniciar {}. ¿Quiere proceder? manage_window.bt_settings.tooltip=Pulse aquí para abrir acciones adicionales downloading=Descargando console.install_logs.path=Los registros de instalación pueden encontrarse en {} diff --git a/bauh/view/resources/locale/it b/bauh/view/resources/locale/it index 0e10ce58..d6c6c177 100644 --- a/bauh/view/resources/locale/it +++ b/bauh/view/resources/locale/it @@ -122,8 +122,6 @@ change=Cambia exit=esci manage_window.settings.gems=Tipi di applicazione style=stile -style.change.title=Cambia stile -style.change.question=Per modificare lo stile corrente è necessario riavviare {}. Procedere ? manage_window.bt_settings.tooltip=Fai clic qui per aprire ulteriori azioni downloading=Scaricamento console.install_logs.path=I registri di installazione sono disponibili all'indirizzo {} diff --git a/bauh/view/resources/locale/pt b/bauh/view/resources/locale/pt index 95211183..6344fc01 100644 --- a/bauh/view/resources/locale/pt +++ b/bauh/view/resources/locale/pt @@ -122,8 +122,6 @@ change=alterar exit=sair manage_window.settings.gems=Tipos de aplicativos style=estilo -style.change.title=Mudança de estilo -style.change.question=Para alterar o estilo atual é necessário reiniciar o {}. Continuar ? manage_window.bt_settings.tooltip=Clique aqui para abrir ações adicionais downloading=Baixando console.install_logs.path=Os registros de instalação podem ser encontrados em {}