Skip to content

Commit a127e4b

Browse files
committed
Version R2.21-FP-8
1 parent 9212fae commit a127e4b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+194
-174
lines changed
4 Bytes
Binary file not shown.
-39 Bytes
Binary file not shown.

bin/Code/Board/Board.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1393,7 +1393,7 @@ def quita():
13931393
self.update()
13941394

13951395
if ms is None:
1396-
ms = 2000 if tipo == "C" else 500
1396+
ms = 2500 if tipo == "C" else 1500
13971397
QtCore.QTimer.singleShot(ms, quita)
13981398

13991399
def mark_position(self, a1, ms=None):
@@ -1914,6 +1914,12 @@ def reset_arrow_sc(self):
19141914
a1h8 = self.arrow_sc.bloqueDatos.a1h8
19151915
self.put_arrow_sc(a1h8[:2], a1h8[2:])
19161916

1917+
def show_arrow_sc(self):
1918+
if self.arrow_sc:
1919+
self.arrow_sc.show()
1920+
1921+
1922+
19171923
def put_arrow_sc(self, from_a1h8, to_a1h8):
19181924
a1h8 = from_a1h8 + to_a1h8
19191925
if self.arrow_sc is None:
@@ -2103,7 +2109,7 @@ def remove_arrows(self):
21032109
self.xremove_item(arrow)
21042110
arrow.hide()
21052111
del arrow
2106-
self.liFlechas = []
2112+
21072113
self.update()
21082114

21092115
def set_side_bottom(self, is_white_bottom):

bin/Code/Board/BoardElements.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99

1010
class BloqueSC(QtWidgets.QGraphicsItem):
11-
# class BloqueSC(QtWidgets.QGraphicsObject):
1211
def __init__(self, escena, physical_pos):
1312

1413
super(BloqueSC, self).__init__()

bin/Code/Leagues/Leagues.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def set_initialdivision(self, division):
4242
self.initialdivision = division
4343

4444
def name(self):
45-
return _F(self.opponent.name)
45+
return self.opponent.name
4646

4747
def elo(self):
4848
return self.opponent.elo

bin/Code/MainWindow/MainWindow.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -248,10 +248,10 @@ def show_variations(self, titulo):
248248
self.adjust_size()
249249

250250
resp = self.exec_()
251-
try:
252-
self.save_video()
253-
except RuntimeError:
254-
pass
251+
# try:
252+
# self.save_video()
253+
# except RuntimeError:
254+
# pass
255255
return resp
256256

257257
def adjust_size(self):
@@ -263,8 +263,8 @@ def adjust():
263263
if not self.board.is_maximized():
264264
self.board.maximize_size(self.activadoF11)
265265
else:
266-
if not self.activadoF11:
267-
QTUtil.shrink(self)
266+
# if not self.activadoF11:
267+
# QTUtil.shrink(self)
268268
tb_height = self.base.tb.height() if Code.configuration.x_tb_orientation_horizontal else 0
269269
n = 0
270270
while self.height() > self.board.ancho + tb_height + 18:
@@ -509,14 +509,15 @@ def save_video(self, dic_extended=None):
509509

510510
dic["WINFO_WIDTH"] = self.informacionPGN.width_saved
511511
dic["WINFOPARENT_WIDTH"] = self.informacionPGN.parent_width_saved
512-
513512
Code.configuration.save_video(self.key_video, dic)
514513
return dic
515514

516515
def xrestore_video(self):
517516
if self.restore_video():
518517
dic = self.restore_dicvideo()
519518
self.informacionPGN.width_saved = dic.get("WINFO_WIDTH")
519+
if self.informacionPGN.width_saved:
520+
self.informacionPGN.resize(self.informacionPGN.width_saved, self.informacionPGN.height())
520521
self.informacionPGN.parent_width_saved = dic.get("WINFOPARENT_WIDTH")
521522
self.informacionPGN.sp_sizes = dic.get("SP_InformacionPGN")
522523
if self.informacionPGN.sp_sizes:

bin/Code/MainWindow/WAnalysisBar.py

Lines changed: 1 addition & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ def __init__(self, w_parent, board):
1919
self.activated = False
2020
self.value_objective = 0
2121
self.acercando = False
22-
# self.max_range = 10000
2322
self.aeval = AnalysisEval.AnalysisEval()
2423
self.interval = Code.configuration.x_analyzer_mstime_refresh_ab
2524

@@ -37,7 +36,6 @@ def __init__(self, w_parent, board):
3736
QProgressBar::chunk {{background-color: {w};}}"""
3837
self.setStyleSheet(style)
3938

40-
self.cache = {}
4139
self.xpv = None
4240
self.game = None
4341

@@ -48,11 +46,6 @@ def __init__(self, w_parent, board):
4846
layout = Colocacion.V().control(self.lb_value_up).espacio(-6).control(self.progressbar).espacio(-6).control(self.lb_value_down).margen(0)
4947
self.setLayout(layout)
5048

51-
@staticmethod
52-
def with_cache():
53-
return Code.configuration.x_analyzer_depth_ab or Code.configuration.x_analyzer_mstime_ab > 0
54-
# return (Code.configuration.x_analyzer_depth_ab > 0) or (Code.configuration.x_analyzer_mstime_ab > 0)
55-
5649
def set_board_position(self):
5750
if Code.configuration.x_analyzer_autorotate_ab:
5851
new = self.board.is_white_bottom
@@ -93,19 +86,6 @@ def set_game(self, game):
9386
self.timer.stop()
9487
self.game = game
9588
self.xpv = game.xpv()
96-
if self.with_cache() and self.xpv in self.cache:
97-
ev_cache, rm_cache, tooltip_cache = self.cache[self.xpv]
98-
close = False
99-
if 0 < Code.configuration.x_analyzer_depth_ab <= rm_cache.depth:
100-
close = True
101-
if 0 < Code.configuration.x_analyzer_mstime_ab <= rm_cache.time:
102-
close = True
103-
if close:
104-
# Si ya está calculado y está fuera de límites se actualiza pero no se lanza el motor
105-
self.update_value(ev_cache)
106-
self.setToolTip(tooltip_cache)
107-
self.show_score(rm_cache.abbrev_text_base1())
108-
return
10989

11090
self.timer.start(self.interval)
11191

@@ -131,19 +111,13 @@ def control_state(self):
131111

132112
rm = mrm.rm_best()
133113

134-
depth = rm.depth
135114
cp = rm.centipawns_abs()
136115

137116
tooltip = None
138117
if not rm.is_white:
139118
cp = -cp
140119
ev = int(self.aeval.lv(cp) * 100)
141-
if self.with_cache() and self.xpv in self.cache:
142-
ev_cache, rm_cache, tooltip_cache = self.cache[self.xpv]
143-
if rm_cache.depth > depth:
144-
ev = ev_cache
145-
rm = rm_cache
146-
tooltip = tooltip_cache
120+
147121
self.show_score(rm.abbrev_text_base1())
148122
self.update_value(ev)
149123

@@ -165,17 +139,6 @@ def control_state(self):
165139
tooltip = main + "\n" + pgn
166140
self.setToolTip(tooltip)
167141

168-
if self.with_cache():
169-
self.cache[self.xpv] = ev, rm, tooltip
170-
171-
close = False
172-
if 0 < Code.configuration.x_analyzer_depth_ab <= rm.depth:
173-
close = True
174-
if 0 < Code.configuration.x_analyzer_mstime_ab <= rm.time:
175-
close = True
176-
if close:
177-
self.engine_manager.ac_final(0)
178-
self.timer.stop()
179142
else:
180143
self.setToolTip("")
181144
self.show_score("")

bin/Code/MainWindow/WBase.py

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -279,8 +279,8 @@ def ponWhiteBlack(self, white, black):
279279
def creaBloqueInformacion(self):
280280
configuration = self.manager.configuration
281281
width_pgn = configuration.x_pgn_width
282-
width_each_color = (width_pgn - 52 - 25) // 2
283-
n_ancho_labels = width_pgn // 2 - 4
282+
width_each_color = (width_pgn - 52 - 18) // 2
283+
# n_ancho_labels = width_pgn // 2 - 4
284284
# # Pgn
285285
o_columns = Columnas.ListaColumnas()
286286
o_columns.nueva("NUMBER", _("N."), 52, align_center=True)
@@ -296,14 +296,13 @@ def creaBloqueInformacion(self):
296296
self.pgn.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
297297
self.pgn.font_type(puntos=configuration.x_pgn_fontpoints)
298298
self.pgn.set_right_button_without_rows(True)
299-
# self.pgn.setSizePolicy(QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Expanding))
300299

301300
# # Blancas y negras
302301
f = Controles.FontType(puntos=configuration.x_sizefont_players, peso=750)
303-
self.lb_player_white = Controles.LB(self).relative_width(n_ancho_labels).align_center().set_font(f).set_wrap()
302+
self.lb_player_white = Controles.LB(self).align_center().set_font(f).set_wrap()
304303
self.configuration.set_property(self.lb_player_white, "white")
305304

306-
self.lb_player_black = Controles.LB(self).relative_width(n_ancho_labels).align_center().set_font(f).set_wrap()
305+
self.lb_player_black = Controles.LB(self).align_center().set_font(f).set_wrap()
307306
self.configuration.set_property(self.lb_player_black, "black")
308307

309308
# # Capturas
@@ -317,15 +316,22 @@ def creaBloqueInformacion(self):
317316
self.bt_capt = (Controles.PB(self, self.captures_symbol(), self.captures_mouse_pressed)
318317
.set_font_type(puntos=14)).relative_width(10)
319318

320-
n_ancho_capt = ((self.pgn.anchoColumnas() + 20) - self.bt_capt.width() - 2) // 2
319+
width_pgn = self.pgn.anchoColumnas() + 18
320+
n_ancho_capt = (width_pgn - self.bt_capt.width() - 2) // 2
321321
self.lb_capt_white.setFixedWidth(n_ancho_capt)
322322
self.lb_capt_black.setFixedWidth(n_ancho_capt)
323323

324+
n_width_name_players = width_pgn // 2 - 1
325+
326+
self.lb_player_white.setFixedWidth(n_width_name_players)
327+
self.lb_player_black.setFixedWidth(n_width_name_players)
328+
324329
# Relojes
325330
f = Controles.FontType(puntos=26, peso=500)
326331

327332
def lbReloj():
328-
lb = Controles.LB(self, "00:00").set_font(f).align_center().anchoMinimo(n_ancho_labels)
333+
lb = Controles.LB(self, "00:00").set_font(f).align_center()
334+
lb.setFixedWidth(n_width_name_players)
329335
lb.setFrameStyle(QtWidgets.QFrame.Box | QtWidgets.QFrame.Raised)
330336
self.configuration.set_property(lb, "clock")
331337
return lb
@@ -430,6 +436,8 @@ def pon_toolbar(self, li_acciones, separator=False, with_shortcuts=False, with_e
430436
self.tb.update()
431437
self.tb.setEnabled(True)
432438
QTUtil.refresh_gui()
439+
if not self.configuration.x_tb_orientation_horizontal:
440+
Controles.equalize_toolbar_buttons(self.tb)
433441

434442
return self.tb
435443

@@ -505,16 +513,16 @@ def grid_pulsada_cabecera(self, grid, column):
505513
col_white.ancho = new_width
506514
col_black.ancho = new_width
507515
self.pgn.set_widthsColumnas()
508-
n_ancho_pgn = self.pgn.anchoColumnas() + 20
516+
n_ancho_pgn = self.pgn.anchoColumnas() + 18
509517
self.pgn.setMinimumWidth(n_ancho_pgn)
510518
self.manager.configuration.x_pgn_width = n_ancho_pgn
511519
self.manager.configuration.graba()
512-
n_ancho_labels = n_ancho_pgn // 2
513-
self.lb_player_white.setFixedWidth(n_ancho_labels)
514-
self.lb_player_black.setFixedWidth(n_ancho_labels)
515-
n_ancho_labels -= self.bt_capt.width() // 2 + 2
516-
self.lb_capt_white.setFixedWidth(n_ancho_labels)
517-
self.lb_capt_black.setFixedWidth(n_ancho_labels)
520+
n_ancho_labels = n_ancho_pgn // 2 - 1
521+
for lb in (self.lb_player_white, self.lb_player_black, self.lb_clock_white, self.lb_clock_black):
522+
lb.setFixedWidth(n_ancho_labels)
523+
n_ancho_capt = n_ancho_labels - self.bt_capt.width() // 2
524+
self.lb_capt_white.setFixedWidth(n_ancho_capt)
525+
self.lb_capt_black.setFixedWidth(n_ancho_capt)
518526

519527
def grid_tecla_control(self, grid, k, is_shift, is_control, is_alt):
520528
self.key_pressed("G", k)

bin/Code/Manager.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1264,7 +1264,14 @@ def analizar(self):
12641264
self.rutinaAccionDef(TB_EBOARD)
12651265
self.main_window.base.tb.setDisabled(True)
12661266
self.is_analyzing = True
1267+
activate_analisisbar = False
1268+
if self.main_window.is_active_analysisbar:
1269+
activate_analisisbar = True
1270+
self.main_window.activate_analysis_bar(False)
12671271
AnalysisGame.analysis_game(self)
1272+
if activate_analisisbar:
1273+
self.main_window.activate_analysis_bar(True)
1274+
self.put_view()
12681275
self.is_analyzing = False
12691276
self.main_window.base.tb.setDisabled(False)
12701277
self.refresh()

0 commit comments

Comments
 (0)