| 1 | // For license of this file, see <project-root-folder>/LICENSE.md. |
| 2 | |
| 3 | #ifndef FILEDIALOG_H |
| 4 | #define FILEDIALOG_H |
| 5 | |
| 6 | #include <QFileDialog> |
| 7 | #include <QString> |
| 8 | |
| 9 | #define GENERAL_REMEMBERED_PATH QSL("general") |
| 10 | |
| 11 | class QWidget; |
| 12 | |
| 13 | class RSSGUARD_DLLSPEC FileDialog { |
| 14 | public: |
| 15 | static QString storedFolder(const QString& id, const QString& dir = QString()); |
| 16 | |
| 17 | static QString saveFileName(QWidget* parent = nullptr, |
| 18 | const QString& caption = QString(), |
| 19 | const QString& dir = QString(), |
| 20 | const QString& filter = QString(), |
| 21 | QString* selected_filter = nullptr, |
| 22 | const QString& id = QString(), |
| 23 | QFileDialog::Options options = QFileDialog::Options()); |
| 24 | |
| 25 | static QString existingDirectory(QWidget* parent = nullptr, |
| 26 | const QString& caption = QString(), |
| 27 | const QString& dir = QString(), |
| 28 | const QString& id = QString(), |
| 29 | QFileDialog::Options options = QFileDialog::Option::ShowDirsOnly); |
| 30 | |
| 31 | static QString openFileName(QWidget* parent = nullptr, |
| 32 | const QString& caption = QString(), |
| 33 | const QString& dir = QString(), |
| 34 | const QString& filter = QString(), |
| 35 | QString* selected_filter = nullptr, |
| 36 | const QString& id = QString(), |
| 37 | QFileDialog::Options options = QFileDialog::Options()); |
| 38 | |
| 39 | private: |
| 40 | FileDialog() {} |
| 41 | }; |
| 42 | |
| 43 | #endif // FILEDIALOG_H |