1 from DialogEdit import *
5 class EditCenterDialog(DialogEdit):
6 def __init__(self, helpFile, controller, widgetDialogBox, model, oldCenter):
9 # Initializing parent widget
10 DialogEdit.__init__(self, helpFile, controller, widgetDialogBox)
14 # Reading oldX and oldY
18 while oldCenter[i] != ":":
22 for j in range(i + 1, len(oldCenter)):
25 self.entryX.setText(oldX)
26 self.entryY.setText(oldY)
29 def addSpecialWidgets(self):
30 floatValidator = QDoubleValidator(self)
32 lX = QLabel("X", self)
33 self.v11.addWidget(lX)
34 lY = QLabel("Y", self)
35 self.v11.addWidget(lY)
37 self.entryX = QLineEdit(self)
38 self.entryX.setValidator(floatValidator)
39 self.v12.addWidget(self.entryX)
40 self.entryY = QLineEdit(self)
41 self.entryY.setValidator(floatValidator)
42 self.v12.addWidget(self.entryY)
46 newX = float(self.newX)
47 newY = float(self.newY)
48 newCenter = newX, newY
49 self.getController().editCenter(self._model, newCenter)
52 def retrieveUserEntries(self):
53 self.newX = str(self.entryX.text())
54 self.newY = str(self.entryY.text())
57 def checkUserEntries(self):
58 if self.newX == "" or self.newY == "":
59 self.errMessage = "All attributes must be filled"