コード例 #1
0
ファイル: WCountsCaptures.py プロジェクト: xaizek/lucaschessR
 def new(self):
     menu = QTVarios.LCMenu(self)
     menu.opcion("random", _("Random"), Iconos.SQL_RAW())
     menu.separador()
     if not QTVarios.lista_db(Code.configuracion, True).is_empty():
         menu.opcion("db", _("Game in a database"), Iconos.Database())
         menu.separador()
     menu.opcion("pgn", _("Game in a pgn"), Iconos.Filtrar())
     menu.separador()
     resp = menu.lanza()
     game = None
     if resp == "random":
         game = DBgames.get_random_game()
     elif resp == "pgn":
         game = Code.procesador.select_1_pgn(self)
     elif resp == "db":
         db = QTVarios.select_db(self, Code.configuracion, True, False)
         if db:
             w = PantallaDatabase.WBDatabase(self, Code.procesador, db, False, True)
             resp = w.exec_()
             if resp:
                 game = w.game
     if game is None:
         return
     capture = CountsCaptures.CountCapture()
     capture.game = game
     self.db.new_count_capture(capture)
     self.glista.refresh()
コード例 #2
0
 def new(self):
     menu = QTVarios.LCMenu(self)
     if not QTVarios.lista_db(self.configuration, True).is_empty():
         menu.opcion("db", _("Game in a database"), Iconos.Database())
         menu.separador()
     menu.opcion("pgn", _("Game in a pgn"), Iconos.Filtrar())
     menu.separador()
     resp = menu.lanza()
     game = None
     if resp == "pgn":
         game = self.procesador.select_1_pgn(self)
     elif resp == "db":
         db = QTVarios.select_db(self, self.configuration, True, False)
         if db:
             w = WindowDatabase.WBDatabase(self, self.procesador, db, False, True)
             resp = w.exec_()
             if resp:
                 game = w.game
     if game and len(game) > 0:
         reg = {"GAME": game.save()}
         self.db.append(reg)
         self.grid.refresh()
         self.grid.gotop()