diff options
| author | frosty <frostinator33@airmail.cc> | 2026-10-26 10:21:57 -0400 |
|---|---|---|
| committer | frosty <frostinator33@airmail.cc> | 2026-10-26 10:21:57 -0400 |
| commit | 74aecd8b0986d07b50b7ce310d64e645b8b54e38 (patch) | |
| tree | 560e6434f183eb54cd779936f3a4c9575146a066 /main/src/ui/conversation_view.vala | |
| parent | 3d7e90d401da02d430a87db0ec7e1db3a6f1a68f (diff) | |
| parent | 4436001bb361ad4f9e4e05819214ecf0ea77c063 (diff) | |
Merge 'upstream/master'
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(); + } } } |
