Added file preview before sending message

This commit is contained in:
jeffser
2024-07-08 13:08:10 -06:00
parent 5420bcb92d
commit 9ccf46663d
3 changed files with 32 additions and 15 deletions

View File

@@ -150,11 +150,12 @@ def delete_model(self, model_name):
# REMOVE IMAGE | WORKS
def remove_attached_file_response(self, dialog, task, button):
def remove_attached_file_response(self, dialog, task, name):
if dialog.choose_finish(task) == 'remove':
self.remove_attached_file(button)
self.remove_attached_file(name)
def remove_attached_file(self, button):
def remove_attached_file(self, name):
self.file_preview_dialog.close()
dialog = Adw.AlertDialog(
heading=_("Remove Attachment?"),
body=_("Are you sure you want to remove attachment?"),
@@ -166,7 +167,7 @@ def remove_attached_file(self, button):
dialog.choose(
parent = self,
cancellable = None,
callback = lambda dialog, task, button=button: remove_attached_file_response(self, dialog, task, button)
callback = lambda dialog, task, name=name: remove_attached_file_response(self, dialog, task, name)
)
# RECONNECT REMOTE | WORKS