diff options
| author | luigi1111 <luigi1111w@gmail.com> | 2020-04-13 15:38:06 -0500 |
|---|---|---|
| committer | luigi1111 <luigi1111w@gmail.com> | 2020-04-13 15:38:06 -0500 |
| commit | d582fd338d1003e1fb46d7a704c4162e282ea312 (patch) | |
| tree | ae4807b4466506640c18658b773883c72cc1d352 /src/main/oshelper.cpp | |
| parent | eed51e3ffa4a6a20dd6392e07a3d7afde99b088e (diff) | |
| parent | 6ed7fcec67109602a6b1dbe390b4274b9467931e (diff) | |
| download | monzero-gui-d582fd338d1003e1fb46d7a704c4162e282ea312.tar.gz monzero-gui-d582fd338d1003e1fb46d7a704c4162e282ea312.tar.xz monzero-gui-d582fd338d1003e1fb46d7a704c4162e282ea312.zip | |
Merge pull request #2819
6ed7fce UpdateDialog: implement update download functionality (xiphon)
Diffstat (limited to 'src/main/oshelper.cpp')
| -rw-r--r-- | src/main/oshelper.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/main/oshelper.cpp b/src/main/oshelper.cpp index 4402db6d..75c668f5 100644 --- a/src/main/oshelper.cpp +++ b/src/main/oshelper.cpp @@ -27,6 +27,8 @@ // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "oshelper.h" +#include <QFileDialog> +#include <QStandardPaths> #include <QTemporaryFile> #include <QDir> #include <QDebug> @@ -82,6 +84,11 @@ OSHelper::OSHelper(QObject *parent) : QObject(parent) } +QString OSHelper::downloadLocation() const +{ + return QStandardPaths::writableLocation(QStandardPaths::DownloadLocation); +} + bool OSHelper::openContainingFolder(const QString &filePath) const { #if defined(Q_OS_WIN) @@ -105,6 +112,12 @@ bool OSHelper::openContainingFolder(const QString &filePath) const return QDesktopServices::openUrl(url); } +QString OSHelper::openSaveFileDialog(const QString &title, const QString &folder, const QString &filename) const +{ + const QString hint = (folder.isEmpty() ? "" : folder + QDir::separator()) + filename; + return QFileDialog::getSaveFileName(nullptr, title, hint); +} + QString OSHelper::temporaryFilename() const { QString tempFileName; |
