Ejemplo n.º 1
0
    def informacion(self):
        menu = QTVarios.LCMenu(self.main_window)
        f = Controles.TipoLetra(puntos=10, peso=75)
        menu.ponFuente(f)

        siOpening = False
        for key, valor in self.game.li_tags:
            trad = TrListas.pgnLabel(key)
            if trad != key:
                key = trad
            menu.opcion(key, "%s : %s" % (key, valor), Iconos.PuntoAzul())
            if key.upper() == "OPENING":
                siOpening = True

        if not siOpening:
            opening = self.game.opening
            if opening:
                menu.separador()
                nom = opening.trNombre
                ape = _("Opening")
                label = nom if ape.upper() in nom.upper() else ("%s : %s" %
                                                                (ape, nom))
                menu.opcion("opening", label, Iconos.PuntoNaranja())

        menu.separador()
        menu.opcion("pgn", _("Edit PGN labels"), Iconos.PGN())

        resp = menu.lanza()
        if resp:
            self.editEtiquetasPGN()
Ejemplo n.º 2
0
    def __init__(self, procesador):

        titulo = _("Play against a game")
        QTVarios.WDialogo.__init__(self, procesador.main_window, titulo,
                                   Iconos.Law(), "playgame")

        self.procesador = procesador
        self.configuration = procesador.configuration
        self.recno = None

        self.db = DBPlayGame(self.configuration.file_play_game())

        # Historico
        o_columns = Columnas.ListaColumnas()

        def creaCol(key, label, centered=True):
            o_columns.nueva(key, label, 80, centered=centered)

        # # Claves segun orden estandar
        self.li_keys = liBasic = ("EVENT", "SITE", "DATE", "ROUND", "WHITE",
                                  "BLACK", "RESULT", "ECO", "FEN", "WHITEELO",
                                  "BLACKELO")
        for key in liBasic:
            label = TrListas.pgnLabel(key)
            creaCol(key, label, key != "EVENT")
        self.grid = Grid.Grid(self,
                              o_columns,
                              siSelecFilas=True,
                              siSeleccionMultiple=True)
        self.grid.setMinimumWidth(self.grid.anchoColumnas() + 20)

        # Tool bar
        li_acciones = (
            (_("Close"), Iconos.MainMenu(), self.terminar),
            None,
            (_("Play"), Iconos.Empezar(), self.play),
            (_("New"), Iconos.Nuevo(), self.new),
            None,
            (_("Remove"), Iconos.Borrar(), self.remove),
            None,
        )
        self.tb = QTVarios.LCTB(self, li_acciones)

        # Colocamos
        lyTB = Colocacion.H().control(self.tb).margen(0)
        ly = Colocacion.V().otro(lyTB).control(self.grid).margen(3)

        self.setLayout(ly)

        self.register_grid(self.grid)
        self.restore_video(siTam=False)

        self.grid.gotop()