mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-30 14:17:45 +00:00
Fix choose folder for Export on macOS.
This commit is contained in:
@@ -323,9 +323,12 @@ bool GetDefault(
|
|||||||
}
|
}
|
||||||
QString file;
|
QString file;
|
||||||
|
|
||||||
|
const auto resolvedParent = (parent && parent->window()->isVisible())
|
||||||
|
? parent->window()
|
||||||
|
: Core::App().getFileDialogParent();
|
||||||
Core::App().notifyFileDialogShown(true);
|
Core::App().notifyFileDialogShown(true);
|
||||||
if (type == Type::ReadFiles) {
|
if (type == Type::ReadFiles) {
|
||||||
files = QFileDialog::getOpenFileNames(Core::App().getFileDialogParent(), caption, startFile, filter);
|
files = QFileDialog::getOpenFileNames(resolvedParent, caption, startFile, filter);
|
||||||
QString path = files.isEmpty() ? QString() : QFileInfo(files.back()).absoluteDir().absolutePath();
|
QString path = files.isEmpty() ? QString() : QFileInfo(files.back()).absoluteDir().absolutePath();
|
||||||
if (!path.isEmpty() && path != cDialogLastPath()) {
|
if (!path.isEmpty() && path != cDialogLastPath()) {
|
||||||
cSetDialogLastPath(path);
|
cSetDialogLastPath(path);
|
||||||
@@ -333,11 +336,11 @@ bool GetDefault(
|
|||||||
}
|
}
|
||||||
return !files.isEmpty();
|
return !files.isEmpty();
|
||||||
} else if (type == Type::ReadFolder) {
|
} else if (type == Type::ReadFolder) {
|
||||||
file = QFileDialog::getExistingDirectory(Core::App().getFileDialogParent(), caption, startFile);
|
file = QFileDialog::getExistingDirectory(resolvedParent, caption, startFile);
|
||||||
} else if (type == Type::WriteFile) {
|
} else if (type == Type::WriteFile) {
|
||||||
file = QFileDialog::getSaveFileName(Core::App().getFileDialogParent(), caption, startFile, filter);
|
file = QFileDialog::getSaveFileName(resolvedParent, caption, startFile, filter);
|
||||||
} else {
|
} else {
|
||||||
file = QFileDialog::getOpenFileName(Core::App().getFileDialogParent(), caption, startFile, filter);
|
file = QFileDialog::getOpenFileName(resolvedParent, caption, startFile, filter);
|
||||||
}
|
}
|
||||||
Core::App().notifyFileDialogShown(false);
|
Core::App().notifyFileDialogShown(false);
|
||||||
|
|
||||||
|
Submodule Telegram/lib_ui updated: 7224c6a191...730816ef52
Reference in New Issue
Block a user