diff --git a/ports/RGSX/__main__.py b/ports/RGSX/__main__.py index d11202e..8cf411a 100644 --- a/ports/RGSX/__main__.py +++ b/ports/RGSX/__main__.py @@ -928,7 +928,12 @@ async def main(): config.download_result_error = not success config.download_progress.clear() config.pending_download = None - config.menu_state = "history" + # Afficher un toast au lieu de changer de page + if success: + toast_msg = f"[OK] {game_name}\n{_('download_completed') if _ else 'Download completed'}" + else: + toast_msg = f"[ERROR] {game_name}\n{_('download_failed') if _ else 'Download failed'}" + show_toast(toast_msg, 3000) config.needs_redraw = True del config.download_tasks[task_id] except Exception as e: @@ -948,7 +953,9 @@ async def main(): config.download_result_error = True config.download_progress.clear() config.pending_download = None - config.menu_state = "history" + # Afficher un toast au lieu de changer de page + toast_msg = f"[ERROR] {game_name}\n{_('download_failed') if _ else 'Download failed'}" + show_toast(toast_msg, 3000) config.needs_redraw = True del config.download_tasks[task_id] else: @@ -982,9 +989,14 @@ async def main(): config.download_result_error = not success config.download_progress.clear() config.pending_download = None - config.menu_state = "history" + # Afficher un toast au lieu de changer de page + if success: + toast_msg = f"[OK] {game_name}\n{_('download_completed') if _ else 'Download completed'}" + else: + toast_msg = f"[ERROR] {game_name}\n{_('download_failed') if _ else 'Download failed'}" + show_toast(toast_msg, 3000) config.needs_redraw = True - logger.debug(f"[DOWNLOAD_TASK] Menu state changed to history after completion, task_id={task_id}") + logger.debug(f"[DOWNLOAD_TASK] Toast displayed after completion, task_id={task_id}") del config.download_tasks[task_id] else: downloaded, total_size = data[1], data[2] diff --git a/ports/RGSX/config.py b/ports/RGSX/config.py index a53988d..6f9e966 100644 --- a/ports/RGSX/config.py +++ b/ports/RGSX/config.py @@ -13,7 +13,7 @@ except Exception: pygame = None # type: ignore # Version actuelle de l'application -app_version = "2.3.0.1" +app_version = "2.3.0.2" def get_application_root(): diff --git a/ports/RGSX/display.py b/ports/RGSX/display.py index d37163d..05d3cff 100644 --- a/ports/RGSX/display.py +++ b/ports/RGSX/display.py @@ -2670,7 +2670,7 @@ def draw_popup(screen): def draw_toast(screen): - """Affiche une notification toast dans le coin inférieur droit (2s max). + """Affiche une notification toast dans le coin supérieur droit (2s max). Utilise config.toast_message pour le contenu. Utilise config.toast_duration (par défaut 2000ms) pour la durée. @@ -2716,10 +2716,10 @@ def draw_toast(screen): toast_width = max_width toast_height = len(wrapped_lines) * line_height + 2 * toast_padding - # Position: coin inférieur droit + # Position: coin supérieur droit margin = 20 toast_x = config.screen_width - toast_width - margin - toast_y = config.screen_height - toast_height - margin + toast_y = margin # Créer une surface avec transparence toast_surface = pygame.Surface((toast_width, toast_height), pygame.SRCALPHA)