1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-22 15:53:54 +00:00
openmw/apps/opencs/view/doc/filedialog.hpp

80 lines
1.7 KiB
C++
Raw Normal View History

#ifndef FILEDIALOG_HPP
#define FILEDIALOG_HPP
#include <QDialog>
#ifndef Q_MOC_RUN
#include "adjusterwidget.hpp"
2013-10-27 03:55:44 +00:00
#ifndef CS_QT_STD_FILESYSTEM_PATH_DECLARED
#define CS_QT_STD_FILESYSTEM_PATH_DECLARED
2022-09-22 18:26:05 +00:00
Q_DECLARE_METATYPE(std::filesystem::path)
2013-10-27 03:55:44 +00:00
#endif
#endif
#include "ui_filedialog.h"
2022-10-19 17:02:00 +00:00
#include <filesystem>
#include <vector>
class QModelIndex;
namespace ContentSelectorView
2013-08-18 22:11:23 +00:00
{
class ContentSelector;
2013-08-18 22:11:23 +00:00
}
namespace CSVDoc
{
class FileWidget;
class FileDialog : public QDialog
{
Q_OBJECT
private:
2022-09-22 18:26:05 +00:00
ContentSelectorView::ContentSelector* mSelector;
Ui::FileDialog ui;
ContentAction mAction;
2022-09-22 18:26:05 +00:00
FileWidget* mFileWidget;
AdjusterWidget* mAdjusterWidget;
bool mDialogBuilt;
public:
2022-09-22 18:26:05 +00:00
explicit FileDialog(QWidget* parent = nullptr);
void showDialog(ContentAction action);
void addFiles(const std::vector<std::filesystem::path>& dataDirs);
2022-09-22 18:26:05 +00:00
void setEncoding(const QString& encoding);
void clearFiles();
QString filename() const;
QStringList selectedFilePaths();
2022-09-22 18:26:05 +00:00
void setLocalData(const std::filesystem::path& localData);
2013-10-27 03:55:44 +00:00
private:
void buildNewFileView();
void buildOpenFileView();
signals:
2022-09-22 18:26:05 +00:00
void signalOpenFiles(const std::filesystem::path& path);
void signalCreateNewFile(const std::filesystem::path& path);
2022-09-22 18:26:05 +00:00
void signalUpdateAcceptButton(bool, int);
private slots:
2013-10-27 03:55:44 +00:00
void slotNewFile();
void slotOpenFile();
2022-09-22 18:26:05 +00:00
void slotUpdateAcceptButton(int);
void slotUpdateAcceptButton(const QString&, bool);
void slotRejected();
void slotAddonDataChanged(const QModelIndex& topleft, const QModelIndex& bottomright);
};
}
#endif // FILEDIALOG_HPP