Skip to content

Commit 6a087fb

Browse files
committed
Version R2.15a
1 parent a27ceab commit 6a087fb

34 files changed

+247
-111
lines changed
-11 Bytes
Binary file not shown.
700 Bytes
Binary file not shown.

Resources/Locale/hu/lang.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
NAME=Magyar
22
AUTHOR=József Oláh
3-
%=99
3+
%=100
638 Bytes
Binary file not shown.

Resources/Locale/zh/lang.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
NAME=简体中文
22
AUTHOR=Zoushen
33
PREVIOUS=Kevin Sicong Jiang,Stephen Yang
4-
%=99
4+
%=100

bin/Code/Analysis/AI.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def launch_prompt(main_window, oprompt: Prompt, game: Game.Game):
9494
prompt = prompt.strip() + f"\nThe game is:\n{game.pgn()}"
9595
QTUtil.set_clipboard(prompt)
9696

97-
QTUtil2.temporary_message(main_window, _("The prompt is on the clipboard, to paste into the AI chat."), 1.2)
97+
QTUtil2.temporary_message(main_window, _("The prompt is on the clipboard, to paste into the AI chat."), 2.2)
9898

9999

100100
def maintenance(mainwindow, game: Game.Game):

bin/Code/Analysis/Histogram.py

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ def setColor(self):
9090
return QtCore.Qt.white, QtCore.Qt.black
9191
return QtCore.Qt.black, QtCore.Qt.black
9292

93-
def setGridPos(self, gridPos):
94-
self.gridPos = gridPos
93+
def setGridPos(self, grid_pos):
94+
self.gridPos = grid_pos
9595

9696
def minmax_rvalue(self, minimum, maximum):
9797
if minimum > self.value:
@@ -253,22 +253,21 @@ def __init__(self, owner, hserie, grid, ancho, si_values, elo_medio=None):
253253
scene.addItem(self.tooltip)
254254
self.tooltip.hide()
255255

256-
self.scale(0.90, 0.8)
257-
# self.scale(0.45, 0.4)
258-
self.setMinimumSize(sz_width + 26, sz_height + 26)
256+
# self.scale(0.9, 0.8)
257+
259258
self.setPointActive(0)
260259

261-
def dispatch(self, gridPos):
262-
self.grid.goto(gridPos, 0)
260+
def dispatch(self, grid_pos):
261+
self.grid.goto(grid_pos, 0)
263262
self.grid.setFocus()
264263

265264
def setPointActive(self, num):
266265
self.pointActive = num
267266
self.scene.invalidate()
268267

269-
def dispatch_enter(self, gridPos):
268+
def dispatch_enter(self, grid_pos):
270269
self.grid.setFocus()
271-
self.owner.grid_doble_click(self.grid, gridPos, 0)
270+
self.owner.grid_doble_click(self.grid, grid_pos, 0)
272271

273272
def show_tooltip(self, txt, x, y, dr):
274273
self.tooltip.set_textPos(txt, x, y, dr)
@@ -277,7 +276,7 @@ def hide_tooltip(self):
277276
self.tooltip.hide()
278277

279278
def drawBackground(self, painter, rect):
280-
sr = sceneRect = self.sceneRect()
279+
sr = scene_rect = self.sceneRect()
281280
width = sr.width()
282281
height = sr.height()
283282
left = sr.left()
@@ -290,7 +289,7 @@ def drawBackground(self, painter, rect):
290289

291290
painter.setBrush(QtCore.Qt.NoBrush)
292291

293-
textRect = QtCore.QRectF(left - 2, bottom + 4, width + 2, height)
292+
text_rect = QtCore.QRectF(left - 2, bottom + 4, width + 2, height)
294293
font = painter.font()
295294
font.setPointSize(8)
296295
painter.setFont(font)
@@ -302,11 +301,11 @@ def drawBackground(self, painter, rect):
302301
num = firstmove + x
303302
decimal = num // 10
304303
if decimal:
305-
painter.drawText(textRect.translated(x * step, 0), str(decimal))
304+
painter.drawText(text_rect.translated(x * step, 0), str(decimal))
306305
for x in range(njg - 1):
307306
num = firstmove + x
308307
ent = num % 10
309-
painter.drawText(textRect.translated(x * step, 12), str(ent))
308+
painter.drawText(text_rect.translated(x * step, 12), str(ent))
310309

311310
# Lineas verticales de referencia
312311
painter.setPen(QtGui.QColor("#D9D9D9"))
@@ -405,7 +404,7 @@ def drawBackground(self, painter, rect):
405404
pen.setWidth(1)
406405
pen.setColor(QtGui.QColor("#545454"))
407406
painter.setPen(pen)
408-
painter.drawRect(sceneRect)
407+
painter.drawRect(scene_rect)
409408

410409
# Linea roja de la position actual
411410
pen = painter.pen()

bin/Code/Analysis/WindowAnalysisGraph.py

Lines changed: 96 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,14 @@ def xcol():
6969

7070
self.dicLiJG = {"A": self.alm.lijg, "W": self.alm.lijgW, "B": self.alm.lijgB}
7171
grid_all = Grid.Grid(self, xcol(), siSelecFilas=True, xid="A", siCabeceraMovible=False)
72-
ancho_grid = grid_all.fixMinWidth()
72+
ancho_grid = grid_all.anchoColumnas()
7373
self.register_grid(grid_all)
7474
grid_w = Grid.Grid(self, xcol(), siSelecFilas=True, xid="W", siCabeceraMovible=False)
75-
ancho_grid = max(grid_w.fixMinWidth(), ancho_grid)
75+
ancho_grid = max(grid_w.anchoColumnas(), ancho_grid)
7676
self.register_grid(grid_w)
77-
gridB = Grid.Grid(self, xcol(), siSelecFilas=True, xid="B", siCabeceraMovible=False)
78-
ancho_grid = max(gridB.fixMinWidth(), ancho_grid)
79-
self.register_grid(gridB)
77+
grid_b = Grid.Grid(self, xcol(), siSelecFilas=True, xid="B", siCabeceraMovible=False)
78+
ancho_grid = max(grid_b.anchoColumnas(), ancho_grid) + 24
79+
self.register_grid(grid_b)
8080

8181
font = Controles.FontType(puntos=Code.configuration.x_sizefont_infolabels)
8282

@@ -98,25 +98,20 @@ def xcol():
9898
w_moves = QtWidgets.QWidget()
9999
w_moves.setLayout(ly)
100100

101-
self.tabGrid = tabGrid = Controles.Tab()
102-
tabGrid.new_tab(grid_all, _("All moves"))
103-
tabGrid.new_tab(grid_w, _("White"))
104-
tabGrid.new_tab(gridB, _("Black"))
105-
tabGrid.new_tab(w_idx, _("Indexes"))
106-
tabGrid.new_tab(w_elo, _("Elo"))
107-
tabGrid.new_tab(w_moves, _("Moves"))
108-
tabGrid.dispatchChange(self.tabChanged)
101+
self.tab_grid = tab_grid = Controles.Tab()
102+
tab_grid.new_tab(grid_all, _("All moves"))
103+
tab_grid.new_tab(grid_w, _("White"))
104+
tab_grid.new_tab(grid_b, _("Black"))
105+
tab_grid.new_tab(w_idx, _("Indexes"))
106+
tab_grid.new_tab(w_elo, _("Elo"))
107+
tab_grid.new_tab(w_moves, _("Moves"))
108+
tab_grid.dispatchChange(self.tabChanged)
109109
self.tabActive = 0
110110

111-
config_board = Code.configuration.config_board("ANALISISGRAPH", 48)
111+
config_board = Code.configuration.config_board("ANALISISGRAPH", 60)
112112
self.board = Board.Board(self, config_board)
113113
self.board.crea()
114114
self.board.set_side_bottom(alm.is_white_bottom)
115-
self.board.dispatchSize(self.boardSizeChanged)
116-
117-
# self.capturas = WCapturas.CapturaLista(self, self.board)
118-
ly_tc = Colocacion.H().control(self.board)
119-
# .control(self.capturas)
120115

121116
self.rbShowValues = Controles.RB(self, _("Values"), rutina=self.cambiadoShow).activa(True)
122117
self.rbShowElo = Controles.RB(self, _("Elo average"), rutina=self.cambiadoShow)
@@ -133,41 +128,61 @@ def xcol():
133128
.control(self.chbShowLostPoints)
134129
.relleno(1)
135130
)
136-
137-
layout = Colocacion.G()
138-
layout.controlc(tabGrid, 0, 0)
139-
layout.otroc(ly_rb, 1, 0)
140-
layout.otroc(ly_tc, 0, 1, numFilas=2)
131+
ly_left = Colocacion.V().control(tab_grid).otro(ly_rb).margen(0)
132+
ly_up = Colocacion.H().otro(ly_left).control(self.board)
141133

142134
Controles.Tab().set_position("W")
143135
ancho = self.board.width() + ancho_grid
144136
self.htotal = [
145137
Histogram.Histogram(self, alm.hgame, grid_all, ancho, True),
146138
Histogram.Histogram(self, alm.hwhite, grid_w, ancho, True),
147-
Histogram.Histogram(self, alm.hblack, gridB, ancho, True),
139+
Histogram.Histogram(self, alm.hblack, grid_b, ancho, True),
148140
Histogram.Histogram(self, alm.hgame, grid_all, ancho, False, alm.eloT),
149141
Histogram.Histogram(self, alm.hwhite, grid_w, ancho, False, alm.eloW),
150-
Histogram.Histogram(self, alm.hblack, gridB, ancho, False, alm.eloB),
142+
Histogram.Histogram(self, alm.hblack, grid_b, ancho, False, alm.eloB),
151143
]
152144
lh = Colocacion.V()
145+
146+
f = Controles.FontType(puntos=8)
147+
bt_left = Controles.PB(self, "←", rutina=self.scale_left).set_font(f)
148+
bt_down = Controles.PB(self, "↓", rutina=self.scale_down).set_font(f)
149+
bt_reset = Controles.PB(self, "=", rutina=self.scale_reset).set_font(f)
150+
bt_up = Controles.PB(self, "↑", rutina=self.scale_up).set_font(f)
151+
bt_right = Controles.PB(self, "→", rutina=self.scale_right).set_font(f)
152+
ly_bt = Colocacion.H().relleno().control(bt_left).control(bt_down).control(bt_reset)
153+
ly_bt.control(bt_up).control(bt_right).margen(0)
154+
153155
for x in range(6):
154156
lh.control(self.htotal[x])
155157
if x:
156158
self.htotal[x].hide()
159+
lh.espacio(-7).otro(ly_bt)
160+
161+
w_up = QtWidgets.QWidget(self)
162+
w_up.setLayout(ly_up.margen(3))
163+
164+
w_down = QtWidgets.QWidget(self)
165+
w_down.setLayout(lh.margen(3))
166+
167+
splitter = QtWidgets.QSplitter()
168+
splitter.setOrientation(QtCore.Qt.Vertical)
169+
splitter.addWidget(w_up)
170+
splitter.addWidget(w_down)
171+
self.register_splitter(splitter, "all")
172+
173+
layout = Colocacion.V().margen(3).control(splitter)
157174

158-
layout.otroc(lh, 2, 0, 1, 3)
159175
self.setLayout(layout)
160176

161-
self.restore_video()
177+
dic_def = {'_SIZE_': '1064,900', 'SP_all': [536, 354]}
178+
self.restore_video(dicDef=dic_def)
162179

163180
grid_all.gotop()
164-
gridB.gotop()
181+
grid_b.gotop()
165182
grid_w.gotop()
166183
self.grid_left_button(grid_all, 0, None)
167-
th = self.board.height()
168-
self.tabGrid.setFixedHeight(th)
169-
self.adjustSize()
170-
self.emIndexes.setFixedHeight(th - 72)
184+
185+
self.scale_init()
171186

172187
def valorShowLostPoints(self):
173188
# Llamada from_sq histogram
@@ -183,14 +198,14 @@ def getShowLostPoints(self):
183198
return dic.get("SHOWLOSTPOINTS", True) if dic else True
184199

185200
def cambiadoShow(self):
186-
self.tabChanged(self.tabGrid.currentIndex())
201+
self.tabChanged(self.tab_grid.currentIndex())
187202

188-
def boardSizeChanged(self):
189-
th = self.board.height()
190-
self.tabGrid.setFixedHeight(th)
191-
self.emIndexes.setFixedHeight(th - 72)
192-
self.adjustSize()
193-
self.cambiadoShow()
203+
# def boardSizeChanged(self):
204+
# th = self.board.height()
205+
# self.tab_grid.setFixedHeight(th)
206+
# self.emIndexes.setFixedHeight(th - 72)
207+
# self.adjustSize()
208+
# self.cambiadoShow()
194209

195210
def tabChanged(self, ntab):
196211
QtWidgets.QApplication.processEvents()
@@ -200,7 +215,7 @@ def tabChanged(self, ntab):
200215
for n in range(6):
201216
self.htotal[n].setVisible(False)
202217
self.htotal[tab_vis].setVisible(True)
203-
self.adjustSize()
218+
# self.adjustSize()
204219
self.tabActive = ntab
205220

206221
def grid_cambiado_registro(self, grid, row, column):
@@ -333,7 +348,46 @@ def grid_dato(self, grid, row, o_column):
333348
def closeEvent(self, event):
334349
self.save_video()
335350

351+
def hscale(self, p_width, p_height):
352+
key = "HISTOGRAM"
353+
dic = Code.configuration.read_variables(key)
354+
scale_width = p_width * dic.get("P_WIDTH", 0.90)
355+
scale_height = p_height * dic.get("P_HEIGHT", 0.80)
356+
dic["P_WIDTH"] = scale_width
357+
dic["P_HEIGHT"] = scale_height
358+
Code.configuration.write_variables(key, dic)
359+
360+
for i in range(6):
361+
self.htotal[i].resetMatrix()
362+
self.htotal[i].scale(scale_width, scale_height)
363+
364+
def scale_reset(self):
365+
key = "HISTOGRAM"
366+
dic = Code.configuration.read_variables(key)
367+
dic["P_WIDTH"] = scale_width = 0.90
368+
dic["P_HEIGHT"] = scale_height = 0.80
369+
Code.configuration.write_variables(key, dic)
370+
371+
for i in range(6):
372+
self.htotal[i].resetMatrix()
373+
self.htotal[i].scale(scale_width, scale_height)
374+
375+
def scale_left(self):
376+
self.hscale(0.95, 1.0)
377+
378+
def scale_right(self):
379+
self.hscale(1.05, 1.0)
380+
381+
def scale_up(self):
382+
self.hscale(1.0, 1.05)
383+
384+
def scale_down(self):
385+
self.hscale(1.0, 0.95)
386+
387+
def scale_init(self):
388+
self.hscale(1.0, 1.0)
389+
336390

337-
def showGraph(wowner, manager, alm, show_analysis):
391+
def show_graph(wowner, manager, alm, show_analysis):
338392
w = WAnalisisGraph(wowner, manager, alm, show_analysis)
339393
w.exec_()

bin/Code/Engines/EngineResponse.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,25 @@ def abbrev_text_base(self):
230230
pts = -pts
231231
return "%+0.2f" % (pts / 100.0)
232232

233+
def abbrev_text_base1(self):
234+
if self.mate != 0:
235+
mt = self.mate
236+
if mt == 1:
237+
return ""
238+
if not self.is_white:
239+
mt = -mt
240+
if (mt > 1) and self.is_white:
241+
mt -= 1
242+
elif (mt < -1) and not self.is_white:
243+
mt += 1
244+
245+
return "M%+d" % mt
246+
else:
247+
pts = self.puntos
248+
if not self.is_white:
249+
pts = -pts
250+
return "%+0.1f" % (pts / 100.0)
251+
233252
def copia(self):
234253
rm = EngineResponse(self.name, self.is_white)
235254
rm.restore(self.save())

bin/Code/Engines/WConfEngines.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,9 @@ def __init__(self, owner):
8787
self.cambiada_tab(0)
8888

8989
def cambiada_tab(self, num):
90+
if self.w_current:
91+
self.w_current.save()
92+
9093
if num == 0:
9194
w = self.wexternals
9295
elif num == 1:
@@ -676,8 +679,7 @@ def save(self):
676679
Code.procesador.cambiaXTutor()
677680

678681
def activate_this(self):
679-
valor = self.cb_engine.valor()
680-
self.cb_engine.rehacer(self.configuration.help_multipv_engines(True), valor)
682+
self.cb_engine.rehacer(self.configuration.help_multipv_engines(True), self.engine.key)
681683
self.owner.set_engine(self.engine, False)
682684

683685

@@ -737,7 +739,7 @@ def __init__(self, owner):
737739
self.setLayout(lyh)
738740

739741
for control in (
740-
self.cb_priority, self.ed_multipv, self.ed_depth, self.ed_time, self.ed_depth_ab, self.ed_time_ab):
742+
self.cb_priority, self.ed_multipv, self.ed_depth, self.ed_time, self.ed_depth_ab, self.ed_time_ab):
741743
control.capture_changes(self.set_changed)
742744

743745
def config_analysis_parameters(self):

0 commit comments

Comments
 (0)