From 937f66237ca608b6177d4ee94e0983d9a72f0319 Mon Sep 17 00:00:00 2001 From: kramo <93832451+kra-mo@users.noreply.github.com> Date: Mon, 3 Apr 2023 09:38:48 +0200 Subject: [PATCH] Add toast notification for launching games --- po/cartridges.pot | 11 ++++++++--- src/main.py | 6 ++++++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/po/cartridges.pot b/po/cartridges.pot index cabed98..8cc0281 100644 --- a/po/cartridges.pot +++ b/po/cartridges.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Cartridges\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-02 17:04+0200\n" +"POT-Creation-Date: 2023-04-03 09:37+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -188,7 +188,7 @@ msgstr "" msgid "Shortcuts" msgstr "" -#: data/gtk/help-overlay.blp:34 src/main.py:206 src/preferences.py:121 +#: data/gtk/help-overlay.blp:34 src/main.py:212 src/preferences.py:121 msgid "Undo" msgstr "" @@ -327,7 +327,12 @@ msgid "translator_credits" msgstr "" #. The variable is the title of the game -#: src/main.py:205 +#: src/main.py:153 +msgid "{} launched" +msgstr "" + +#. The variable is the title of the game +#: src/main.py:211 msgid "{} removed" msgstr "" diff --git a/src/main.py b/src/main.py index 5ab9187..299a1e4 100644 --- a/src/main.py +++ b/src/main.py @@ -148,6 +148,12 @@ class CartridgesApplication(Adw.Application): self.win.games[game_id].launch() + title = self.win.games[game_id].name + # The variable is the title of the game + toast = Adw.Toast.new(_("{} launched").format(title)) + toast.set_priority(Adw.ToastPriority.HIGH) + self.win.toast_overlay.add_toast(toast) + self.win.update_games([game_id]) if self.win.stack.get_visible_child() == self.win.overview: