mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-20 11:00:44 -06:00
* Fixed code style * Added last location saving and loading per action type This saves and loads different paths per action type when presenting the native file dialog popup.
55 lines
1.8 KiB
C++
55 lines
1.8 KiB
C++
#ifndef FILEDIALOG_H
|
|
#define FILEDIALOG_H
|
|
|
|
#include <QFileDialog>
|
|
|
|
enum FileDialogTypes {
|
|
NoSpecificType,
|
|
|
|
CreateProjectFile,
|
|
OpenProjectFile,
|
|
|
|
CreateDatabaseFile,
|
|
OpenDatabaseFile,
|
|
|
|
CreateSQLFile,
|
|
OpenSQLFile,
|
|
|
|
OpenCSVFile,
|
|
|
|
CreateDataFile,
|
|
OpenDataFile,
|
|
|
|
OpenExtensionFile,
|
|
OpenCertificateFile,
|
|
|
|
// ImportTable,
|
|
// ExportTable,
|
|
};
|
|
|
|
class FileDialog : public QFileDialog
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
static QString getOpenFileName(const FileDialogTypes dialogType, QWidget* parent = nullptr, const QString& caption = QString(),
|
|
const QString& filter = QString(), QString* selectedFilter = nullptr,
|
|
Options options = 0);
|
|
static QStringList getOpenFileNames(const FileDialogTypes dialogType, QWidget* parent = nullptr, const QString& caption = QString(),
|
|
const QString& filter = QString(), QString* selectedFilter = nullptr,
|
|
Options options = 0);
|
|
static QString getSaveFileName(const FileDialogTypes dialogType, QWidget* parent = nullptr, const QString& caption = QString(),
|
|
const QString& filter = QString(), const QString& defaultFileName = QString(), QString* selectedFilter = nullptr,
|
|
Options options = 0);
|
|
static QString getExistingDirectory(const FileDialogTypes dialogType, QWidget* parent = nullptr, const QString& caption = QString(),
|
|
Options options = 0);
|
|
|
|
static QString getSqlDatabaseFileFilter();
|
|
|
|
private:
|
|
static QString getFileDialogPath(const FileDialogTypes dialogType);
|
|
static void setFileDialogPath(const FileDialogTypes dialogType, const QString& new_path);
|
|
};
|
|
|
|
#endif
|