diff options
| author | isanae <14251494+isanae@users.noreply.github.com> | 2019-07-02 12:35:33 -0400 |
|---|---|---|
| committer | isanae <14251494+isanae@users.noreply.github.com> | 2019-07-02 12:35:33 -0400 |
| commit | 4aa59cdc7dd779c7e864a1c4e96c6b52c61879ff (patch) | |
| tree | f318d734f2742ac5ebf48de069c227b276318264 /src/modinfodialogfwd.h | |
| parent | 82d985064e5105ded4b20d357eaf7cd1b97fe9da (diff) | |
added modinfodialogfwd.h, mostly for the enum that's used in various places
renamed ETabs to ModInfoTabIDs and changed all ints to use the enum instead
added ModInfoPtr to avoid having to include modinfo.h just to get ModInfo::Ptr
Diffstat (limited to 'src/modinfodialogfwd.h')
| -rw-r--r-- | src/modinfodialogfwd.h | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/src/modinfodialogfwd.h b/src/modinfodialogfwd.h new file mode 100644 index 00000000..9ede766f --- /dev/null +++ b/src/modinfodialogfwd.h @@ -0,0 +1,50 @@ +#ifndef MODINFODIALOGFWD_H +#define MODINFODIALOGFWD_H + +#include "filerenamer.h" + +class ModInfo; +using ModInfoPtr = QSharedPointer<ModInfo>; + +enum class ModInfoTabIDs +{ + None = -1, + TextFiles = 0, + IniFiles, + Images, + Esps, + Conflicts, + Categories, + Nexus, + Notes, + Filetree +}; + +class PluginContainer; + +bool canPreviewFile(PluginContainer& pluginContainer, bool isArchive, const QString& filename); +bool canOpenFile(bool isArchive, const QString& filename); +bool canExploreFile(bool isArchive, const QString& filename); +bool canHideFile(bool isArchive, const QString& filename); +bool canUnhideFile(bool isArchive, const QString& filename); + +FileRenamer::RenameResults hideFile(FileRenamer& renamer, const QString &oldName); +FileRenamer::RenameResults unhideFile(FileRenamer& renamer, const QString &oldName); + +int naturalCompare(const QString& a, const QString& b); + + +class ElideLeftDelegate : public QStyledItemDelegate +{ +public: + using QStyledItemDelegate::QStyledItemDelegate; + +protected: + void initStyleOption(QStyleOptionViewItem* o, const QModelIndex& i) const + { + QStyledItemDelegate::initStyleOption(o, i); + o->textElideMode = Qt::ElideLeft; + } +}; + +#endif // MODINFODIALOGFWD_H |
