-
Notifications
You must be signed in to change notification settings - Fork 0
/
ErrorConstraint.py
36 lines (31 loc) · 1.12 KB
/
ErrorConstraint.py
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
35
36
#-*- coding: utf-8
from PyQt4 import QtGui, QtCore
from PyQt4.QtGui import *
#TODO Crée la fenêtre d'erreur lors de la mauvaise sélection d'un noeud à contraindre
class ErrorConstraint(QDialog):
def __init__(self, parent=None):
super(ErrorConstraint, self).__init__(parent)
self.setWindowTitle('Selection error')
self.icon = QtGui.QIcon("iconeLSN")
self.setWindowIcon(self.icon)
mainBox = QVBoxLayout(self)
boxlayout = QHBoxLayout()
mainBox.addLayout(boxlayout)
m1 = QVBoxLayout()
m1.addWidget(QLabel("Wrong node. Please start again."))
boxlayout.addLayout(m1)
font = QFont('Liberation Sans Narrow')
font.setPointSize(12)
self.setFont(font)
buttons = QDialogButtonBox(QDialogButtonBox.Ok, QtCore.Qt.Horizontal, self)
buttons.accepted.connect(self.accept)
buttons.rejected.connect(self.reject)
mainBox.addWidget(buttons)
def params(self):
return 0
@staticmethod
def get_params():
error = ErrorConstraint()
message = error.exec_()
param = error.params()
return (message, param)