diff options
| author | fiaxh <git@lightrise.org> | 2026-08-14 11:45:08 +0200 |
|---|---|---|
| committer | fiaxh <git@lightrise.org> | 2026-08-21 18:18:03 +0200 |
| commit | 8d49d83b3b45ab22d7b9d945c4b32296b07cb49e (patch) | |
| tree | 5a0bf3d777c4efd806388163fc9dc74c87edd07b /main/src/ui/conversation_view.vala | |
| parent | 6d0706bcaa6d54354e416174e3d2654a2bff81fe (diff) | |
Add initial support for multi-file transfers
Diffstat (limited to 'main/src/ui/conversation_view.vala')
| -rw-r--r-- | main/src/ui/conversation_view.vala | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/main/src/ui/conversation_view.vala b/main/src/ui/conversation_view.vala index 26043666..4bb1f537 100644 --- a/main/src/ui/conversation_view.vala +++ b/main/src/ui/conversation_view.vala @@ -17,6 +17,27 @@ public class ConversationView : Widget { construct { this.layout_manager = new BinLayout(); } + + public void open_save_file_dialog(FileTransfer file_transfer) { + var save_dialog = new FileChooserNative(_("Save as…"), (Gtk.Window) this.get_root(), FileChooserAction.SAVE, null, null); + save_dialog.set_modal(true); + save_dialog.set_current_name(file_transfer.file_name); + + save_dialog.response.connect(() => { + File? target_file = save_dialog.get_file(); + if (target_file == null) { + warning("No file returned from save dialog."); + return; + } + try { + file_transfer.get_file().copy(save_dialog.get_file(), GLib.FileCopyFlags.OVERWRITE, null); + } catch (Error err) { + warning("Failed copy file %s - %s", file_transfer.get_file().get_uri(), err.message); + } + }); + + save_dialog.show(); + } } } |
