def __init__(self, parent): super(DHeadtail, self).__init__(parent) layout = QtGui.QVBoxLayout(self) self._widheadtail = WHeadtail(parent=self) layout.addWidget(self._widheadtail) 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"Head and Tail")) self.adjustSize() self.setFixedSize(self.size())
class DHeadtail(QtGui.QDialog): def __init__(self, parent): super(DHeadtail, self).__init__(parent) layout = QtGui.QVBoxLayout(self) self._widheadtail = WHeadtail(parent=self) layout.addWidget(self._widheadtail) 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"Head and Tail")) self.adjustSize() self.setFixedSize(self.size()) def _accept(self): if self._widheadtail.ui.pushButton_start.isEnabled(): QtGui.QMessageBox.warning(self, le2mtrans(u"Warning"), le2mtrans(u"You must play")) return self.accept() def get_value(self): return self._widheadtail.get_value()
class DHeadtail(QtGui.QDialog): def __init__(self, parent): super(DHeadtail, self).__init__(parent) layout = QtGui.QVBoxLayout(self) self._widheadtail = WHeadtail(parent=self) layout.addWidget(self._widheadtail) 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"Head and Tail")) self.adjustSize() self.setFixedSize(self.size()) def _accept(self): if self._widheadtail.ui.pushButton_start.isEnabled(): QtGui.QMessageBox.warning( self, le2mtrans(u"Warning"), le2mtrans(u"You must play")) return self.accept() def get_value(self): return self._widheadtail.get_value()
def __init__(self, parent): super(DHeadtail, self).__init__(parent) layout = QtGui.QVBoxLayout(self) self._widheadtail = WHeadtail(parent=self) layout.addWidget(self._widheadtail) 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"Head and Tail")) self.adjustSize() self.setFixedSize(self.size())