mosesdecoder/mingw/MosesGUI/util.py
2015-05-17 18:27:13 +07:00

32 lines
599 B
Python

# -*- coding: utf-8 -*-
import sys
from PyQt4.QtGui import (
QApplication,
QMessageBox,
)
def doAlert(text):
msgBox = QMessageBox()
msgBox.setText(text)
msgBox.setWindowTitle("Message")
msgBox.setIcon(QMessageBox.Warning)
msgBox.exec_()
def doQuestion(text):
reply = QMessageBox.question(
None, 'Message', text, QMessageBox.Yes, QMessageBox.No)
if reply == QMessageBox.Yes:
return True
else:
return False
if __name__ == '__main__':
app = QApplication(sys.argv)
doAlert("doAlert")
print doQuestion("doQuestion")