showing a warning dialog when the application starts and **snapd** is unavailable

This commit is contained in:
Vinicius Moreira
2019-07-27 21:48:28 -03:00
parent 8f9f8d04db
commit 6b8ee68463
10 changed files with 67 additions and 14 deletions

View File

@@ -1,5 +1,5 @@
from PyQt5.QtGui import QIcon
from PyQt5.QtWidgets import QMessageBox, QSizePolicy
from PyQt5.QtWidgets import QMessageBox
from fpakman.core import resource
@@ -16,6 +16,18 @@ def show_error(title: str, body: str, icon: QIcon = QIcon(resource.get_path('img
error_msg.exec_()
def show_warning(title: str, body: str, icon: QIcon = QIcon(resource.get_path('img/logo.svg'))):
msg = QMessageBox()
msg.setIcon(QMessageBox.Warning)
msg.setWindowTitle(title)
msg.setText(body)
if icon:
msg.setWindowIcon(icon)
msg.exec_()
def ask_confirmation(title: str, body: str, locale_keys: dict, icon: QIcon = QIcon(resource.get_path('img/logo.svg'))):
dialog_confirmation = QMessageBox()
dialog_confirmation.setIcon(QMessageBox.Question)