def __init__(self, wParent, procesador):

        icono = Iconos.DatabaseF()
        extparam = "databasepositions"
        titulo = _("Positions Database")
        QTVarios.WDialogo.__init__(self, wParent, titulo, icono, extparam)

        self.procesador = procesador
        self.configuracion = procesador.configuracion

        self.dbGamesFEN = DBgamesFEN.DBgamesFEN(
            self.configuracion.ficheroDBgamesFEN)

        self.wgamesFEN = WBG_GamesFEN.WGamesFEN(procesador, self,
                                                self.dbGamesFEN)

        self.registrarGrid(self.wgamesFEN.grid)

        self.ultFocus = None

        self.infoMove = WBG_InfoMove.WInfomove(self, siMoves=False)

        self.splitter = splitter = QtGui.QSplitter(self)
        splitter.addWidget(self.wgamesFEN)
        splitter.addWidget(self.infoMove)
        self.registrarSplitter(self.splitter, "base")

        layout = Colocacion.H().control(splitter).margen(5)

        self.setLayout(layout)

        self.recuperarVideo(anchoDefecto=1000, altoDefecto=600)

        self.inicializa()
Exemplo n.º 2
0
    def tg_importar_DB(self):
        path = QTVarios.select_ext(self, "lcf")
        if not path:
            return None

        dlTmp = QTVarios.ImportarFicheroDB(self)
        dlTmp.show()

        dbn = DBgamesFEN.DBgamesFEN(path)
        self.dbGamesFEN.appendDB(dbn, range(dbn.all_reccount()), dlTmp)

        self.actualiza(True)
    def tg_importar_DB(self):
        path = QTVarios.select_ext(self, "lcf")
        if path:
            dlTmp = QTVarios.ImportarFicheroDB(self)
            dlTmp.show()

            dbn = DBgamesFEN.DBgamesFEN(path)
            dbn.lee_rowids()
            liRecnos = range(dbn.reccount())
            self.dbGamesFEN.appendDB(dbn, liRecnos, dlTmp)

            self.actualiza(True)
Exemplo n.º 4
0
    def __init__(self, wParent, procesador):

        icono = Iconos.DatabaseF()
        extparam = "databasepositions"
        titulo = _("Positions database")
        QTVarios.WDialogo.__init__(self, wParent, titulo, icono, extparam)

        self.procesador = procesador
        self.configuracion = procesador.configuracion

        self.dbGamesFEN = DBgamesFEN.DBgamesFEN(
            self.configuracion.ficheroDBgamesFEN)

        dicVideo = self.recuperarDicVideo()

        self.wgamesFEN = WBG_GamesFEN.WGamesFEN(procesador, self,
                                                self.dbGamesFEN)

        self.registrarGrid(self.wgamesFEN.grid)

        self.ultFocus = None

        self.tab = Controles.Tab()
        self.tab.nuevaTab(self.wgamesFEN, _("Games"))
        self.tab.ponTipoLetra(puntos=procesador.configuracion.puntosTB)

        self.infoMove = WBG_InfoMove.WInfomove(self, siMoves=False)

        self.splitter = splitter = QtGui.QSplitter(self)
        splitter.addWidget(self.tab)
        splitter.addWidget(self.infoMove)

        layout = Colocacion.H().control(splitter).margen(5)

        self.setLayout(layout)

        self.recuperarVideo(anchoDefecto=1200, altoDefecto=600)
        if not dicVideo:
            dicVideo = {
                'SPLITTER': [800, 380],
                'TREE_1': 25,
                'TREE_2': 25,
                'TREE_3': 50,
                'TREE_4': 661,
            }
        sz = dicVideo.get("SPLITTER", None)
        if sz:
            self.splitter.setSizes(sz)

        self.inicializa()
Exemplo n.º 5
0
    def tg_exportar_DB(self):
        resp = self.tg_exportar("lcf")
        if not resp:
            return
        li, modo, path = resp

        if modo == "w" and Util.existeFichero(path):
            Util.borraFichero(path)
            Util.borraFichero(path+"_s1")

        dlTmp = QTVarios.ImportarFicheroDB(self)
        dlTmp.show()

        dbn = DBgamesFEN.DBgamesFEN(path)
        dbn.appendDB(self.dbGamesFEN, li, dlTmp)
Exemplo n.º 6
0
 def cambiaDBgames(self, fich):
     self.dbGamesFEN.close()
     self.dbGamesFEN = DBgamesFEN.DBgamesFEN(
         self.configuracion.ficheroDBgamesFEN)
     self.setdbGames()
Exemplo n.º 7
0
def conversion_positions(filepath):
    db = DBgamesFEN.DBgamesFEN(filepath)
    conversion(db)