mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-12-27 22:14:57 +03:00
32 lines
599 B
Python
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")
|