Better image overlay handling when downloading
- hides the overlay when prompting for download location - cancel re-shows the dialog - success closes the overlay - would be nice to have a return code from the download fn in mtxclient. Closes #140
This commit is contained in:
parent
b41e2e6f18
commit
d0a1e81f43
3 changed files with 20 additions and 6 deletions
|
|
@ -175,9 +175,20 @@ TimelineViewManager::openImageOverlay(QString mxcUrl, QString eventId) const
|
|||
|
||||
auto imgDialog = new dialogs::ImageOverlay(pixmap);
|
||||
imgDialog->showFullScreen();
|
||||
connect(imgDialog, &dialogs::ImageOverlay::saving, timeline_, [this, eventId]() {
|
||||
timeline_->saveMedia(eventId);
|
||||
});
|
||||
connect(imgDialog,
|
||||
&dialogs::ImageOverlay::saving,
|
||||
timeline_,
|
||||
[this, eventId, imgDialog]() {
|
||||
// hide the overlay while presenting the save dialog for better
|
||||
// cross platform support.
|
||||
imgDialog->hide();
|
||||
|
||||
if (!timeline_->saveMedia(eventId)) {
|
||||
imgDialog->show();
|
||||
} else {
|
||||
imgDialog->close();
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue