def __init__(self, parent): super(DRandint, self).__init__(parent) layout = QtGui.QVBoxLayout(self) self._widrandint = WRandint(parent=self) layout.addWidget(self._widrandint) buttons = QtGui.QDialogButtonBox(QtGui.QDialogButtonBox.Cancel | QtGui.QDialogButtonBox.Ok) buttons.rejected.connect(self.reject) buttons.accepted.connect(self._accept) layout.addWidget(buttons) self.setWindowTitle(le2mtrans(u"Random number")) self.adjustSize() self.setFixedSize(self.size())
class DRandint(QtGui.QDialog): def __init__(self, parent): super(DRandint, self).__init__(parent) layout = QtGui.QVBoxLayout(self) self._widrandint = WRandint(parent=self) layout.addWidget(self._widrandint) buttons = QtGui.QDialogButtonBox(QtGui.QDialogButtonBox.Cancel | QtGui.QDialogButtonBox.Ok) buttons.rejected.connect(self.reject) buttons.accepted.connect(self._accept) layout.addWidget(buttons) self.setWindowTitle(le2mtrans(u"Random number")) self.adjustSize() self.setFixedSize(self.size()) def _accept(self): if self._widrandint.ui.pushButton_start.isEnabled(): QtGui.QMessageBox.warning( self, le2mtrans(u"Warning"), le2mtrans(u"You must drawn a random number")) return self.accept() def get_value(self): return self._widrandint.get_value()
class DRandint(QtGui.QDialog): def __init__(self, parent): super(DRandint, self).__init__(parent) layout = QtGui.QVBoxLayout(self) self._widrandint = WRandint(parent=self) layout.addWidget(self._widrandint) buttons = QtGui.QDialogButtonBox( QtGui.QDialogButtonBox.Cancel | QtGui.QDialogButtonBox.Ok) buttons.rejected.connect(self.reject) buttons.accepted.connect(self._accept) layout.addWidget(buttons) self.setWindowTitle(le2mtrans(u"Random number")) self.adjustSize() self.setFixedSize(self.size()) def _accept(self): if self._widrandint.ui.pushButton_start.isEnabled(): QtGui.QMessageBox.warning( self, le2mtrans(u"Warning"), le2mtrans(u"You must drawn a random number")) return self.accept() def get_value(self): return self._widrandint.get_value()
def __init__(self, parent): super(DRandint, self).__init__(parent) layout = QtGui.QVBoxLayout(self) self._widrandint = WRandint(parent=self) layout.addWidget(self._widrandint) buttons = QtGui.QDialogButtonBox( QtGui.QDialogButtonBox.Cancel | QtGui.QDialogButtonBox.Ok) buttons.rejected.connect(self.reject) buttons.accepted.connect(self._accept) layout.addWidget(buttons) self.setWindowTitle(le2mtrans(u"Random number")) self.adjustSize() self.setFixedSize(self.size())