blob: 8725ea09594b3d2d790cd9fa34988a2c3ecde258 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
#ifndef MODINFODIALOGTEXTFILES_H
#define MODINFODIALOGTEXTFILES_H
#include "modinfodialog.h"
#include <QSplitter>
#include <QListWidget>
class FileListItem;
class TextEditor;
class GenericFilesTab : public ModInfoDialogTab
{
public:
GenericFilesTab(QListWidget* list, QSplitter* splitter, TextEditor* editor);
void clear() override;
bool canClose() override;
bool feedFile(const QString& rootPath, const QString& fullPath) override;
protected:
QListWidget* m_list;
TextEditor* m_editor;
virtual bool wantsFile(const QString& rootPath, const QString& fullPath) const = 0;
private:
void onSelection(QListWidgetItem* current, QListWidgetItem* previous);
void select(FileListItem* item);
};
class TextFilesTab : public GenericFilesTab
{
public:
TextFilesTab(Ui::ModInfoDialog* ui);
protected:
bool wantsFile(const QString& rootPath, const QString& fullPath) const override;
};
class IniFilesTab : public GenericFilesTab
{
public:
IniFilesTab(Ui::ModInfoDialog* ui);
protected:
bool wantsFile(const QString& rootPath, const QString& fullPath) const override;
};
#endif // MODINFODIALOGTEXTFILES_H
|