コード例 #1
0
ファイル: servguidialogs.py プロジェクト: leem34/le2m-v2.1
    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())
コード例 #2
0
ファイル: servguidialogs.py プロジェクト: leem34/le2m-v2.1
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()
コード例 #3
0
ファイル: servguidialogs.py プロジェクト: dimdub34/le2m-v2.1
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()
コード例 #4
0
ファイル: servguidialogs.py プロジェクト: dimdub34/le2m-v2.1
    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())