diff --git a/bauh/gems/arch/controller.py b/bauh/gems/arch/controller.py index f754fe41..8cfa123d 100644 --- a/bauh/gems/arch/controller.py +++ b/bauh/gems/arch/controller.py @@ -428,7 +428,7 @@ class ArchManager(SoftwareManager): self._update_progress(handler.watcher, 70, change_progress) if check_install_output and 'conflict' in check_install_output[-1]: conflicting_apps = [w[0] for w in re.findall(r'((\w|\-|\.)+)\s(and|are)', check_install_output[-1])] - conflict_msg = ' {} '.format(self.i18n['and']).join(conflicting_apps) + conflict_msg = ' {} '.format(self.i18n['and']).join([bold(c) for c in conflicting_apps]) if not handler.watcher.request_confirmation(title=self.i18n['arch.install.conflict.popup.title'], body=self.i18n['arch.install.conflict.popup.body'].format(conflict_msg)): handler.watcher.print(self.i18n['action.cancelled']) diff --git a/bauh/resources/img/lock.svg b/bauh/resources/img/lock.svg new file mode 100755 index 00000000..232acfb4 --- /dev/null +++ b/bauh/resources/img/lock.svg @@ -0,0 +1,138 @@ + + + +image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/bauh/view/qt/apps_table.py b/bauh/view/qt/apps_table.py index a9842968..f4859797 100644 --- a/bauh/view/qt/apps_table.py +++ b/bauh/view/qt/apps_table.py @@ -7,9 +7,9 @@ from PyQt5.QtGui import QPixmap, QIcon, QCursor from PyQt5.QtNetwork import QNetworkAccessManager, QNetworkRequest from PyQt5.QtWidgets import QTableWidget, QTableView, QMenu, QAction, QTableWidgetItem, QToolButton, QWidget, \ QHeaderView, QLabel, QHBoxLayout, QPushButton, QToolBar + from bauh.api.abstract.cache import MemoryCache from bauh.api.abstract.model import PackageStatus - from bauh.util import resource from bauh.util.html import strip_html from bauh.view.qt import dialog diff --git a/bauh/view/qt/root.py b/bauh/view/qt/root.py index 3dffb749..133049cf 100644 --- a/bauh/view/qt/root.py +++ b/bauh/view/qt/root.py @@ -2,9 +2,12 @@ import io import os import subprocess +from PyQt5.QtGui import QIcon from PyQt5.QtWidgets import QInputDialog, QLineEdit -from bauh.api.abstract.view import MessageType +from bauh import ROOT_DIR +from bauh.api.abstract.view import MessageType +from bauh.commons import resource from bauh.view.qt.dialog import show_message @@ -14,24 +17,25 @@ def is_root(): def ask_root_password(locale_keys: dict): - dialog_pwd = QInputDialog() - dialog_pwd.setInputMode(QInputDialog.TextInput) - dialog_pwd.setTextEchoMode(QLineEdit.Password) - dialog_pwd.setWindowTitle(locale_keys['popup.root.title']) - dialog_pwd.setLabelText(locale_keys['popup.root.password'] + ':') - dialog_pwd.setCancelButtonText(locale_keys['popup.button.cancel']) - dialog_pwd.resize(400, 200) + diag = QInputDialog() + diag.setInputMode(QInputDialog.TextInput) + diag.setTextEchoMode(QLineEdit.Password) + diag.setWindowIcon(QIcon(resource.get_path('img/lock.svg', ROOT_DIR))) + diag.setWindowTitle(locale_keys['popup.root.title']) + diag.setLabelText(locale_keys['popup.root.password'] + ':') + diag.setCancelButtonText(locale_keys['popup.button.cancel']) + diag.resize(400, 200) - ok = dialog_pwd.exec_() + ok = diag.exec_() if ok: - if not validate_password(dialog_pwd.textValue()): + if not validate_password(diag.textValue()): show_message(title=locale_keys['popup.root.bad_password.title'], body=locale_keys['popup.root.bad_password.body'], type_=MessageType.ERROR) ok = False - return dialog_pwd.textValue(), ok + return diag.textValue(), ok def validate_password(password: str) -> bool: