diff options
| author | Silarn <jrim@rimpo.org> | 2019-07-22 01:00:42 -0500 |
|---|---|---|
| committer | Silarn <jrim@rimpo.org> | 2019-07-22 01:00:42 -0500 |
| commit | dcd6d624672019727d7effd17aac86f72bff438b (patch) | |
| tree | 1e8d3856f657d898c5992631599cf272d785f973 /src/modinfodialogtextfiles.h | |
| parent | 179a73857125ee604f42b0d5c2d765183c86d2c7 (diff) | |
| parent | e73c309f08eff98f0dbd2590f594a83b67431eac (diff) | |
Merge branch 'Develop'
Diffstat (limited to 'src/modinfodialogtextfiles.h')
| -rw-r--r-- | src/modinfodialogtextfiles.h | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/src/modinfodialogtextfiles.h b/src/modinfodialogtextfiles.h new file mode 100644 index 00000000..725ac999 --- /dev/null +++ b/src/modinfodialogtextfiles.h @@ -0,0 +1,64 @@ +#ifndef MODINFODIALOGTEXTFILES_H +#define MODINFODIALOGTEXTFILES_H + +#include "modinfodialogtab.h" +#include "filterwidget.h" +#include <QSplitter> +#include <QListView> + +class FileListItem; +class FileListModel; +class TextEditor; + +class GenericFilesTab : public ModInfoDialogTab +{ + Q_OBJECT; + +public: + void clear() override; + bool canClose() override; + bool feedFile(const QString& rootPath, const QString& fullPath) override; + void update() override; + void saveState(Settings& s) override; + void restoreState(const Settings& s) override; + +protected: + QListView* m_list; + TextEditor* m_editor; + QSplitter* m_splitter; + FileListModel* m_model; + FilterWidget m_filter; + + GenericFilesTab( + ModInfoDialogTabContext cx, + QListView* list, QSplitter* splitter, + TextEditor* editor, QLineEdit* filter); + + virtual bool wantsFile(const QString& rootPath, const QString& fullPath) const = 0; + +private: + void onSelection(const QModelIndex& current, const QModelIndex& previous); + void select(const QModelIndex& index); +}; + + +class TextFilesTab : public GenericFilesTab +{ +public: + TextFilesTab(ModInfoDialogTabContext cx); + +protected: + bool wantsFile(const QString& rootPath, const QString& fullPath) const override; +}; + + +class IniFilesTab : public GenericFilesTab +{ +public: + IniFilesTab(ModInfoDialogTabContext cx); + +protected: + bool wantsFile(const QString& rootPath, const QString& fullPath) const override; +}; + +#endif // MODINFODIALOGTEXTFILES_H |
