mirror of
https://github.com/morgan9e/warehouse
synced 2026-04-14 00:04:08 +09:00
The uninstall app message dialog now hides the trash data response when no data is present
This commit is contained in:
@@ -121,14 +121,18 @@ class FlattoolGuiWindow(Adw.ApplicationWindow):
|
||||
|
||||
def uninstall_flatpak(self, _widget, index):
|
||||
name = self.host_flatpaks[index][0]
|
||||
dialog = Adw.MessageDialog.new(self, _(f"Uninstall {name}?"))
|
||||
dialog.set_body(_("The app will be removed from your system but its user data will be preserved"))
|
||||
id = self.host_flatpaks[index][2]
|
||||
dialog = Adw.MessageDialog.new(self, _(f"Uninstall {name}?"), _("The app will be removed from your system."))
|
||||
dialog.set_close_response("cancel")
|
||||
dialog.add_response("cancel", _("Cancel"))
|
||||
dialog.add_response("continue", _("Uninstall"))
|
||||
dialog.add_response("purge", _("Uninstall and Trash Data"))
|
||||
dialog.set_response_appearance("continue", Adw.ResponseAppearance.DESTRUCTIVE)
|
||||
|
||||
if os.path.exists(f"{self.user_data_path}{id}"):
|
||||
dialog.set_body(_("The app will be removed from your system. Optionally, you can also trash its user data."))
|
||||
dialog.add_response("purge", _("Uninstall and Trash Data"))
|
||||
dialog.set_response_appearance("purge", Adw.ResponseAppearance.DESTRUCTIVE)
|
||||
|
||||
dialog.connect("response", self.uninstall_response, dialog.choose_finish, index)
|
||||
Gtk.Window.present(dialog)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user