Remember last used folder in save dialogs
BUG: 460166
This commit is contained in:
@@ -62,6 +62,9 @@
|
|||||||
<label>Enable developer tools</label>
|
<label>Enable developer tools</label>
|
||||||
<default>false</default>
|
<default>false</default>
|
||||||
</entry>
|
</entry>
|
||||||
|
<entry name="LastSaveDirectory" type="String">
|
||||||
|
<label>Directory last used for saving a file</label>
|
||||||
|
</entry>
|
||||||
</group>
|
</group>
|
||||||
<group name="Timeline">
|
<group name="Timeline">
|
||||||
<entry name="ShowAvatarInTimeline" type="bool">
|
<entry name="ShowAvatarInTimeline" type="bool">
|
||||||
|
|||||||
@@ -293,8 +293,10 @@ QQC2.Popup {
|
|||||||
id: saveAsDialog
|
id: saveAsDialog
|
||||||
FileDialog {
|
FileDialog {
|
||||||
fileMode: FileDialog.SaveFile
|
fileMode: FileDialog.SaveFile
|
||||||
folder: StandardPaths.writableLocation(StandardPaths.DownloadLocation)
|
folder: Config.lastSaveDirectory.length > 0 ? Config.lastSaveDirectory : StandardPaths.writableLocation(StandardPaths.DownloadLocation)
|
||||||
onAccepted: {
|
onAccepted: {
|
||||||
|
Config.lastSaveDirectory = folder
|
||||||
|
Config.save()
|
||||||
if (!currentFile) {
|
if (!currentFile) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -159,11 +159,15 @@ TimelineContainer {
|
|||||||
|
|
||||||
FileDialog {
|
FileDialog {
|
||||||
fileMode: FileDialog.SaveFile
|
fileMode: FileDialog.SaveFile
|
||||||
folder: StandardPaths.writableLocation(StandardPaths.DownloadLocation)
|
folder: Config.lastSaveDirectory.length > 0 ? Config.lastSaveDirectory : StandardPaths.writableLocation(StandardPaths.DownloadLocation)
|
||||||
onAccepted: if (autoOpenFile) {
|
onAccepted: {
|
||||||
UrlHelper.copyTo(progressInfo.localPath, file)
|
Config.lastSaveDirectory = folder
|
||||||
} else {
|
Config.save()
|
||||||
currentRoom.download(eventId, file);
|
if (autoOpenFile) {
|
||||||
|
UrlHelper.copyTo(progressInfo.localPath, file)
|
||||||
|
} else {
|
||||||
|
currentRoom.download(eventId, file);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -113,11 +113,13 @@ MessageDelegateContextMenu {
|
|||||||
id: saveAsDialog
|
id: saveAsDialog
|
||||||
FileDialog {
|
FileDialog {
|
||||||
fileMode: FileDialog.SaveFile
|
fileMode: FileDialog.SaveFile
|
||||||
folder: StandardPaths.writableLocation(StandardPaths.DownloadLocation)
|
folder: Config.lastSaveDirectory.length > 0 ? Config.lastSaveDirectory : StandardPaths.writableLocation(StandardPaths.DownloadLocation)
|
||||||
onAccepted: {
|
onAccepted: {
|
||||||
if (!currentFile) {
|
if (!currentFile) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Config.lastSaveDirectory = folder
|
||||||
|
Config.save()
|
||||||
currentRoom.downloadFile(eventId, currentFile)
|
currentRoom.downloadFile(eventId, currentFile)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user