Welcome to mirror list, hosted at ThFree Co, Russian Federation.

util.py « MosesGUI « mingw - github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: c4947d81cbfe2c92b8ed7ee31edbeed749b9be41 (plain)
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
# -*- 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")