def __init__(self, defered, automatique, parent, text, expec_before=None):
        QtGui.QDialog.__init__(self, parent)

        self._defered = defered
        self._automatique = automatique

        layout = QtGui.QVBoxLayout()
        self.setLayout(layout)

        explanation = WExplication(text=text[0])
        layout.addWidget(explanation)

        self._spin_expectation = WSpinbox(parent=self,
                                          minimum=pms.DECISION_MIN,
                                          maximum=pms.DECISION_MAX,
                                          interval=pms.DECISION_STEP,
                                          label=text[1],
                                          automatique=self._automatique)
        if expec_before is not None:
            self._spin_expectation.spinBox.setValue(expec_before)
        layout.addWidget(self._spin_expectation)

        button = QtGui.QDialogButtonBox(QtGui.QDialogButtonBox.Ok)
        button.accepted.connect(self._accept)
        layout.addWidget(button)

        self.setWindowTitle(trans_PGGS(u"Expectation"))
        self.adjustSize()
        self.setFixedSize(self.size())

        if self._automatique:
            self._timer = QtCore.QTimer()
            self._timer.timeout.connect(self._accept)
            self._timer.start(7000)
    def __init__(self, defered, automatique, parent, periode, historique,
                 max_decision):
        super(GuiDecision, self).__init__(parent)

        # variables
        self._defered = defered
        self._automatique = automatique
        self._historique = GuiHistorique(self,
                                         historique,
                                         size=(HISTO_WIDTH, 500))
        self._max_decision = max_decision

        layout = QtGui.QVBoxLayout(self)

        # period and history button
        wperiod = WPeriod(period=periode,
                          ecran_historique=self._historique,
                          parent=self)
        layout.addWidget(wperiod)

        wexplanation = WExplication(text=texts_PGGS.get_text_explanation(),
                                    parent=self,
                                    size=(500, 60))
        layout.addWidget(wexplanation)

        self._wcontrib = WSpinbox(minimum=0,
                                  maximum=self._max_decision,
                                  automatique=self._automatique,
                                  parent=self,
                                  label=trans_PGGS(
                                      u"How much do you invest in "
                                      u"the public account?"))
        layout.addWidget(self._wcontrib)

        buttons = QtGui.QDialogButtonBox(QtGui.QDialogButtonBox.Ok)
        buttons.accepted.connect(self._accept)
        layout.addWidget(buttons)

        self.setWindowTitle(le2mtrans(u"Decision"))
        self.adjustSize()
        self.setFixedSize(self.size())

        if self._automatique:
            self._timer_automatique = QtCore.QTimer()
            self._timer_automatique.timeout.connect(
                buttons.button(QtGui.QDialogButtonBox.Ok).click)
            self._timer_automatique.start(7000)
Esempio n. 3
0
    def __init__(self, defered, automatique, parent, period, historique):
        super(GuiDecision, self).__init__(parent)

        # variables
        self._defered = defered
        self._automatique = automatique
        self._historique = GuiHistorique(self, historique)

        layout = QtGui.QVBoxLayout(self)

        # should be removed if one-shot game
        wperiod = WPeriod(period=period, ecran_historique=self._historique)
        layout.addWidget(wperiod)

        wexplanation = WExplication(
            text=texts_EXPERIENCE_NOM_COURT.get_text_explanation(),
            size=(450, 80),
            parent=self)
        layout.addWidget(wexplanation)

        self._wdecision = WSpinbox(
            label=texts_EXPERIENCE_NOM_COURT.get_text_label_decision(),
            minimum=pms.DECISION_MIN,
            maximum=pms.DECISION_MAX,
            interval=pms.DECISION_STEP,
            automatique=self._automatique,
            parent=self)
        layout.addWidget(self._wdecision)

        buttons = QtGui.QDialogButtonBox(QtGui.QDialogButtonBox.Ok)
        buttons.accepted.connect(self._accept)
        layout.addWidget(buttons)

        self.setWindowTitle(trans_EXPERIENCE_NOM_COURT(u"Décision"))
        self.adjustSize()
        self.setFixedSize(self.size())

        if self._automatique:
            self._timer_automatique = QtCore.QTimer()
            self._timer_automatique.timeout.connect(
                buttons.button(QtGui.QDialogButtonBox.Ok).click)
            self._timer_automatique.start(7000)
    def __init__(self, nb_played_seq, parent):
        super(DSequenceChoice, self).__init__(parent)

        layout = QtGui.QVBoxLayout(self)

        self._choice = WSpinbox(
            minimum=1,
            maximum=nb_played_seq,
            automatique=False,
            parent=self,
            label=texts_PGGS.trans_PGGS(u"Choose the sequence to display"))
        layout.addWidget(self._choice)

        buttons = QtGui.QDialogButtonBox(QtGui.QDialogButtonBox.Cancel
                                         | QtGui.QDialogButtonBox.Ok)
        buttons.accepted.connect(self.accept)
        buttons.rejected.connect(self.reject)
        layout.addWidget(buttons)

        self.setWindowTitle(le2mtrans(u"Sequence choice"))
        self.adjustSize()
        self.setFixedSize(self.size())
Esempio n. 5
0
    def __init__(self, defered, automatique, parent, periode, historique):
        super(GuiDecision, self).__init__(parent)

        self._defered = defered
        self._automatique = automatique

        layout = QtGui.QVBoxLayout(self)

        self._widexplication = WExplication(
            text=texts_GP.get_text_explanation(), size=(500, 70), parent=self)
        layout.addWidget(self._widexplication)

        self._widdecision = WSpinbox(label=trans_GP(
            u"Choose the amount you want to invest in the "
            u"risky option"),
                                     minimum=pms.DECISION_MIN,
                                     maximum=pms.DECISION_MAX,
                                     interval=pms.DECISION_STEP,
                                     parent=self,
                                     automatique=self._automatique)
        layout.addWidget(self._widdecision)

        # bouton box
        buttons = QtGui.QDialogButtonBox(QtGui.QDialogButtonBox.Ok,
                                         QtCore.Qt.Horizontal, self)
        buttons.accepted.connect(self._accept)
        layout.addWidget(buttons)

        if self._automatique:
            self._timer_automatique = QtCore.QTimer()
            self._timer_automatique.timeout.connect(
                buttons.button(QtGui.QDialogButtonBox.Ok).click)
            self._timer_automatique.start(7000)

        # title and size
        self.setWindowTitle(le2mtrans(u"Decision"))
        self.adjustSize()
        self.setFixedSize(self.size())
Esempio n. 6
0
    def __init__(self, defered, automatique, parent, periode, historique):
        super(GuiDecision, self).__init__(parent)

        self._defered = defered
        self._automatique = automatique
        self._historique = GuiHistorique(self, historique)

        layout = QtGui.QVBoxLayout(self)

        self._widperiod = WPeriod(
            period=periode, ecran_historique=self._historique, parent=self)
        layout.addWidget(self._widperiod)

        self._widexplication = WExplication(
            text=texts_CPR.DECISION_explication, parent=self)
        layout.addWidget(self._widexplication)

        self._widdecision = WSpinbox(
            label=texts_CPR.DECISION_label, minimum=pms.DECISION_MIN,
            maximum=pms.DECISION_MAX, interval=pms.DECISION_STEP,
            automatique=self._automatique, parent=self)
        layout.addWidget(self._widdecision)

        buttons = QtGui.QDialogButtonBox(QtGui.QDialogButtonBox.Ok)
        buttons.accepted.connect(self._accept)
        layout.addWidget(buttons)

        if self._automatique:
            self._timer_automatique = QtCore.QTimer()
            self._timer_automatique.timeout.connect(
                buttons.button(QtGui.QDialogButtonBox.Ok).click)
            self._timer_automatique.start(7000)

        # title and size
        self.setWindowTitle(texts_CPR.DECISION_titre)
        self.adjustSize()
        self.setFixedSize(self.size())
Esempio n. 7
0
    def __init__(self, defered, automatique, parent, periode, historique):
        super(GuiDecision, self).__init__(parent)

        # variables
        self._defered = defered
        self._automatique = automatique

        layout = QtGui.QVBoxLayout(self)

        self._widexplication = WExplication(text=textes.DECISION_explication,
                                            parent=self,
                                            size=(520, 60))
        layout.addWidget(self._widexplication)

        self._widdecision = WSpinbox(label=textes.DECISION_label,
                                     minimum=pms.DECISION_MIN,
                                     maximum=pms.DECISION_MAX,
                                     parent=self,
                                     automatique=self._automatique)
        layout.addWidget(self._widdecision)

        buttons = QtGui.QDialogButtonBox(QtGui.QDialogButtonBox.Ok,
                                         QtCore.Qt.Horizontal, self)
        buttons.accepted.connect(self._accept)
        layout.addWidget(buttons)

        # title and size
        self.setWindowTitle(textes.DECISION_titre)
        self.adjustSize()
        self.setFixedSize(self.size())

        # automatic
        if self._automatique:
            self._timer_automatique = QtCore.QTimer()
            self._timer_automatique.timeout.connect(
                buttons.button(QtGui.QDialogButtonBox.Ok).click)
            self._timer_automatique.start(7000)