Пример #1
0
    def __init__(self, parent):
        super(DDice, self).__init__(parent)

        layout = QtGui.QVBoxLayout(self)
        self._widdice = WDice(parent=self)
        layout.addWidget(self._widdice)

        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"Dice roller"))
        self.adjustSize()
        self.setFixedSize(self.size())
Пример #2
0
class DDice(QtGui.QDialog):
    def __init__(self, parent):
        super(DDice, self).__init__(parent)

        layout = QtGui.QVBoxLayout(self)
        self._widdice = WDice(parent=self)
        layout.addWidget(self._widdice)

        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"Dice roller"))
        self.adjustSize()
        self.setFixedSize(self.size())

    def _accept(self):
        if self._widdice.ui.pushButton_start.isEnabled():
            QtGui.QMessageBox.warning(self, le2mtrans(u"Warning"),
                                      le2mtrans(u"You must roll the dice"))
            return
        self.accept()

    def get_dicevalue(self):
        return self._widdice.get_dicevalue()
Пример #3
0
class DDice(QtGui.QDialog):
    def __init__(self, parent):
        super(DDice, self).__init__(parent)

        layout = QtGui.QVBoxLayout(self)
        self._widdice = WDice(parent=self)
        layout.addWidget(self._widdice)

        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"Dice roller"))
        self.adjustSize()
        self.setFixedSize(self.size())

    def _accept(self):
        if self._widdice.ui.pushButton_start.isEnabled():
            QtGui.QMessageBox.warning(
                self, le2mtrans(u"Warning"),
                le2mtrans(u"You must roll the dice"))
            return
        self.accept()

    def get_dicevalue(self):
        return self._widdice.get_dicevalue()
Пример #4
0
    def __init__(self, parent):
        super(DDice, self).__init__(parent)

        layout = QtGui.QVBoxLayout(self)
        self._widdice = WDice(parent=self)
        layout.addWidget(self._widdice)

        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"Dice roller"))
        self.adjustSize()
        self.setFixedSize(self.size())