Skip to content

Commit

Permalink
Version R2.17f
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasmonk committed Nov 29, 2024
1 parent a060734 commit caf090c
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 12 deletions.
Binary file added Resources/Locale/hy/LC_MESSAGES/lcopenings.mo
Binary file not shown.
38 changes: 28 additions & 10 deletions bin/Code/MainWindow/WInformation.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,9 +394,11 @@ def analyze_move(self, num_move, num_variation, num_move_variation):
)

def remove_line(self):
if QTUtil2.pregunta(self, _("Are you sure you want to delete this line?")):
li_variation_move = self.selected_link.split("|")
num_line = int(li_variation_move[-2])
li_variation_move = self.selected_link.split("|")
num_line = int(li_variation_move[-2])
game: Game.Game = self.move.variations.li_variations[num_line]
pgn = game.pgn_base_raw(translated=True)
if QTUtil2.pregunta(self, pgn + "<br><br>" + _("Are you sure you want to delete this line?")):

li_variation_move = li_variation_move[:-2]
selected_link = "|".join(li_variation_move)
Expand Down Expand Up @@ -493,17 +495,21 @@ def mostrar(self):
num_variation = int(self.selected_link.split("|")[1])
self.em.ensure_visible(num_variation)

def select(self):
def select(self, with_all):
li_variations = self.li_variations()
n_variations = len(li_variations)
if n_variations == 0:
return None
if n_variations == 1:
return 0
menu = QTVarios.LCMenuRondo(self)
menu.opcion(None, _("Remove"))
for num, variante in enumerate(li_variations):
move = variante.move(0)
menu.opcion(num, move.pgn_translated())
if with_all:
menu.separador()
menu.opcion(-1, _("All variations"))
return menu.lanza()

def edit(self, number, with_engine_active=False):
Expand Down Expand Up @@ -544,13 +550,25 @@ def tb_mas_variation_r(self):
self.edit(-1, True)

def tb_edit_variation(self):
num = self.select()
num = self.select(False)
if num is not None:
self.edit(num)

def tb_remove_variation(self):
num = self.select()
if num is not None:
self.move.variations.remove(num)
self.mostrar()
self.get_manager().refresh_pgn()
num = self.select(True)
if num is None:
return
elif num == -1:
pregunta = _("Remove") + ":<br><br>&nbsp;&nbsp;&nbsp;&nbsp;" + _("All variations") + "<br><br>" + _("Are you sure?")
if QTUtil2.pregunta(self, pregunta):
self.move.variations.clear()
self.mostrar()
self.get_manager().refresh_pgn()

else:
game: Game.Game = self.move.variations.li_variations[num]
pgn = game.pgn_base_raw(translated=True)
if QTUtil2.pregunta(self, pgn + "<br><br>" + _("Are you sure you want to delete this line?")):
self.move.variations.remove(num)
self.mostrar()
self.get_manager().refresh_pgn()
2 changes: 1 addition & 1 deletion bin/Code/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def relative_root(path):


BASE_VERSION = "B" # Para el control de updates que necesitan reinstalar entero
VERSION = "R 2.17e"
VERSION = "R 2.17f"
DEBUG = False
DEBUG_ENGINES = False

Expand Down
2 changes: 1 addition & 1 deletion bin/bug.log
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Version R 2.17e
Version R 2.17f

0 comments on commit caf090c

Please sign in to comment.