show_message refactoring | showing warnings as a unique string

This commit is contained in:
Vinicius Moreira
2019-08-23 16:36:50 -03:00
parent 18c044e27b
commit 0ce710575e
4 changed files with 28 additions and 31 deletions

View File

@@ -3,8 +3,9 @@ import os
import subprocess
from PyQt5.QtWidgets import QInputDialog, QLineEdit
from bauh_api.abstract.view import MessageType
from bauh.view.qt.dialog import show_error
from bauh.view.qt.dialog import show_message
def is_root():
@@ -25,8 +26,9 @@ def ask_root_password(locale_keys: dict):
if ok:
if not validate_password(dialog_pwd.textValue()):
show_error(title=locale_keys['popup.root.bad_password.title'],
body=locale_keys['popup.root.bad_password.body'])
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