class ComputerDialog(QDialog):
    def __init__(self):
        QDialog.__init__(self)
        self.ui = Ui_ComputerDialog()
        self.ui.setupUi(self)
        self.valid = QIntValidator(0, 1000000, self)
        self.ui.speed.setValidator(self.valid)
        self.ui.ram.setValidator(self.valid)
        
    def Load(self, v):
        self.ui.id.setText(v.id)
        self.ui.speed.setText(str(v.speed))
        self.ui.ram.setText(str(v.ram))
        
    def SetResult(self, v):
        v.id = self.ui.id.text()
        v.speed = int(self.ui.speed.text())
        v.ram = int(self.ui.ram.text())
class ComputerDialog(QDialog):
    def __init__(self):
        QDialog.__init__(self)
        self.ui = Ui_ComputerDialog()
        self.ui.setupUi(self)
        self.valid = QIntValidator(0, 1000000, self)
        self.ui.speed.setValidator(self.valid)
        self.ui.ram.setValidator(self.valid)

    def Load(self, v):
        self.ui.id.setText(v.id)
        self.ui.speed.setText(str(v.speed))
        self.ui.ram.setText(str(v.ram))

    def SetResult(self, v):
        v.id = self.ui.id.text()
        v.speed = int(self.ui.speed.text())
        v.ram = int(self.ui.ram.text())
Exemple #3
0
class VMDialog(QDialog):
    def __init__(self):
        QDialog.__init__(self)
        self.ui = Ui_ComputerDialog()
        self.ui.setupUi(self)
        self.valid = QIntValidator(0, 1000000, self)
        self.ui.speed.setValidator(self.valid)
        self.ui.ram.setValidator(self.valid)
        self.setWindowTitle(self.tr("Edit VM")) #we use the same dialog for resources and demands
        
    def Load(self, v):
        self.ui.id.setText(v.id)
        self.ui.speed.setText(str(v.speed))
        self.ui.ram.setText(str(v.ram))
        
    def SetResult(self, v):
        v.id = self.ui.id.text()
        v.speed = int(self.ui.speed.text())
        v.ram = int(self.ui.ram.text())
class VMDialog(QDialog):
    def __init__(self):
        QDialog.__init__(self)
        self.ui = Ui_ComputerDialog()
        self.ui.setupUi(self)
        self.valid = QIntValidator(0, 1000000, self)
        self.ui.speed.setValidator(self.valid)
        self.ui.ram.setValidator(self.valid)
        self.setWindowTitle(self.tr("Edit VM"))  # we use the same dialog for resources and demands

    def Load(self, v):
        self.ui.id.setText(v.id)
        self.ui.speed.setText(str(v.speed))
        self.ui.ram.setText(str(v.ram))

    def SetResult(self, v):
        v.id = self.ui.id.text()
        v.speed = int(self.ui.speed.text())
        v.ram = int(self.ui.ram.text())