def Adjournments(self):
        menu = QTVarios.LCMenu(self.main_window)
        li_Adjournments = Adjournments.Adjournments().list_menu()
        for key, label, tp in li_Adjournments:
            menu.opcion((True, key, tp), label, Iconos.PuntoMagenta())
            menu.addSeparator()
        menu.addSeparator()
        mr = menu.submenu(_("Remove"), Iconos.Borrar())
        for key, label, tp in li_Adjournments:
            mr.opcion((False, key, tp), label, Iconos.Delete())

        resp = menu.lanza()
        if resp:
            si_run, key, tp = resp
            if si_run:
                dic = Adjournments.Adjournments().get(key)

                Adjournments.Adjournments().remove(key)
                if tp == GT_AGAINST_ENGINE:
                    self.manager = ManagerPlayAgainstEngine.ManagerPlayAgainstEngine(
                        self)
                elif tp == GT_ALBUM:
                    self.manager = ManagerAlbum.ManagerAlbum(self)
                elif tp == GT_AGAINST_CHILD_ENGINE:
                    self.manager = ManagerPerson.ManagerPerson(self)
                elif tp == GT_MICELO:
                    self.manager = ManagerMicElo.ManagerMicElo(self)
                elif tp == GT_COMPETITION_WITH_TUTOR:
                    self.manager = ManagerCompeticion.ManagerCompeticion(self)
                elif tp == GT_ELO:
                    self.manager = ManagerElo.ManagerElo(self)
                elif tp == GT_AGAINST_GM:
                    self.manager = ManagerGM.ManagerGM(self)
                elif tp in (GT_FIDE, GT_FICS, GT_LICHESS):
                    self.manager = ManagerFideFics.ManagerFideFics(self)
                    self.manager.selecciona(tp)
                else:
                    return
                self.manager.run_adjourn(dic)
                return

            else:
                Adjournments.Adjournments().remove(key)

            self.test_opcion_Adjournments()
            self.main_window.pon_toolbar(self.li_opciones_inicio, atajos=True)
 def test_opcion_Adjournments(self):
     must_adjourn = len(Adjournments.Adjournments()) > 0
     if TB_Adjournments in self.li_opciones_inicio:
         if not must_adjourn:
             pos = self.li_opciones_inicio.index(TB_Adjournments)
             del self.li_opciones_inicio[pos]
     else:
         if must_adjourn:
             self.li_opciones_inicio.insert(1, TB_Adjournments)
Exemple #3
0
    def adjourn(self):
        if QTUtil2.pregunta(self.main_window,
                            _("Do you want to adjourn the game?")):
            dic = self.save_state()

            label_menu = "%s %s/%s" % (_("Album"), _F(
                self.album.name), _F(self.cromo.name))
            self.state = ST_ENDGAME

            with Adjournments.Adjournments() as adj:
                adj.add(self.game_type, dic, label_menu)
                adj.si_seguimos(self)
Exemple #4
0
    def adjourn(self):
        if QTUtil2.pregunta(self.main_window,
                            _("Do you want to adjourn the game?")):
            dic = self.save_state()

            label_menu = "%s %s" % (_("Play like a Grandmaster"),
                                    self.nombreGM)
            self.state = ST_ENDGAME

            with Adjournments.Adjournments() as adj:
                adj.add(self.game_type, dic, label_menu)
                adj.si_seguimos(self)
Exemple #5
0
    def adjourn(self):
        if QTUtil2.pregunta(self.main_window, _("Do you want to adjourn the game?")):
            dic = self.save_state()

            # se guarda en una bd Adjournments dic key = fecha y hora y tipo
            label_menu = _("Tourney-Elo") + ". " + self.engine_rival.name

            self.state = ST_ENDGAME

            with Adjournments.Adjournments() as adj:
                adj.add(self.game_type, dic, label_menu)
                adj.si_seguimos(self)
    def adjourn(self):
        if len(self.game) > 0 and QTUtil2.pregunta(
                self.main_window, _("Do you want to adjourn the game?")):
            dic = {
                "IDGAME": self.id_game,
                "POSJUGADAOBJ": self.posJugadaObj,
                "GAME_SAVE": self.game.save(),
                "PUNTOS": self.puntos,
            }

            with Adjournments.Adjournments() as adj:
                adj.add(self.game_type, dic, self._titulo)
                self.analizaTerminar()
                adj.si_seguimos(self)
Exemple #7
0
    def adjourn(self):
        if QTUtil2.pregunta(self.main_window, _("Do you want to adjourn the game?")):
            dic = self.save_state()

            # se guarda en una bd Adjournments dic key = fecha y hora y tipo
            label_menu = _("Play against an engine") + ". " + self.xrival.name

            self.state = ST_ENDGAME

            self.finalizar()
            if self.is_analyzing:
                self.is_analyzing = False
                self.xtutor.ac_final(-1)

            with Adjournments.Adjournments() as adj:
                adj.add(self.game_type, dic, label_menu)
                adj.si_seguimos(self)
Exemple #8
0
    def adjourn(self):
        if len(self.game) > 0 and QTUtil2.pregunta(self.main_window, _("Do you want to adjourn the game?")):
            self.state = ST_ENDGAME
            dic = {
                "ISWHITE": self.human_side,
                "GAME_SAVE": self.game.save(),
                "CLAVE": self.datosMotor.key,
                "DEPTH": self.datosMotor.depth,
                "PGANA": self.datosMotor.pgana,
                "PPIERDE": self.datosMotor.ppierde,
                "PTABLAS": self.datosMotor.ptablas,
            }

            label_menu = "%s. %s" % (_("Lucas-Elo"), self.datosMotor.name)
            if self.datosMotor.depth:
                label_menu += " - %d" % self.datosMotor.depth
            with Adjournments.Adjournments() as adj:
                adj.add(self.game_type, dic, label_menu)
                adj.si_seguimos(self)
Exemple #9
0
    def adjourn(self):
        if len(self.game) and QTUtil2.pregunta(
                self.main_window, _("Do you want to adjourn the game?")):

            label_menu = _("Competition with tutor") + ". " + self.xrival.name

            dic = {
                "ISWHITE": self.human_side,
                "GAME_SAVE": self.game.save(),
                "SITUTOR": self.is_tutor_enabled,
                "HINTS": self.hints,
                "CATEGORIA": self.categoria.key,
                "LEVEL": self.nivelJugado,
                "PUNTOS": self.puntos,
                "RIVAL_KEY": self.dbm.get_current_rival_key(),
            }

            with Adjournments.Adjournments() as adj:
                adj.add(self.game_type, dic, label_menu)
                adj.si_seguimos(self)