mirror of
https://github.com/GradienceTeam/Gradience.git
synced 2024-08-26 17:32:31 +00:00
feat: add toasts
This commit is contained in:
parent
39762ad205
commit
67cbd55f26
1 changed files with 20 additions and 9 deletions
|
@ -61,12 +61,23 @@ class GradiencePresetRow(Adw.ActionRow):
|
|||
|
||||
@Gtk.Template.Callback()
|
||||
def on_remove_button_clicked(self, *_args):
|
||||
|
||||
try:
|
||||
os.remove(os.path.join(
|
||||
os.environ.get("XDG_CONFIG_HOME",
|
||||
os.environ["HOME"] + "/.config"),
|
||||
"presets",
|
||||
to_slug_case(self.old_name) + ".json",
|
||||
))
|
||||
except Exception:
|
||||
|
||||
self.toast_overlay.add_toast(
|
||||
Adw.Toast(title=_("Scheme could not be removed!"))
|
||||
)
|
||||
else:
|
||||
self.toast_overlay.add_toast(
|
||||
Adw.Toast(title=_("Scheme successfully deleted!"))
|
||||
)
|
||||
|
||||
self.win.reload_pref_group()
|
||||
|
||||
|
|
Loading…
Reference in a new issue