-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdialogs.py
More file actions
35 lines (24 loc) · 951 Bytes
/
dialogs.py
File metadata and controls
35 lines (24 loc) · 951 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtWidgets import QMessageBox, QDialog
class Dialog(object):
def msg_dialog(msg):
msgBox = QMessageBox()
msgBox.setIcon(QMessageBox.Information)
msgBox.setText(msg)
msgBox.setWindowTitle("Message Alert")
msgBox.setStandardButtons(QMessageBox.Ok)
msgBox.buttonClicked.connect(msgBox.close)
returnValue = msgBox.exec()
# if returnValue == QMessageBox.Ok:
def confirm_dialog(msg):
msgBox = QMessageBox()
msgBox.setIcon(QMessageBox.Information)
msgBox.setText(msg)
msgBox.setWindowTitle("Message Alert")
msgBox.setStandardButtons(QMessageBox.Ok | QMessageBox.Cancel)
msgBox.buttonClicked.connect(msgBox.close)
return msgBox.exec()
"""
if (Dialog.confirm_dialog("Are You Sure You Want To Save ?") == QMessageBox.Ok):
print("Saved")
"""