GH-2971 Brand mod model for resource/texture pack pages

This commit is contained in:
Jamie Mansfield
2021-06-19 00:59:48 +01:00
parent c92b44e6d6
commit b246fc171e
8 changed files with 84 additions and 3 deletions

View File

@ -0,0 +1,23 @@
#include "ResourcePackFolderModel.h"
ResourcePackFolderModel::ResourcePackFolderModel(const QString &dir) : ModFolderModel(dir) {
}
QVariant ResourcePackFolderModel::headerData(int section, Qt::Orientation orientation, int role) const {
if (role == Qt::ToolTipRole) {
switch (section) {
case ActiveColumn:
return tr("Is the resource pack enabled?");
case NameColumn:
return tr("The name of the resource pack.");
case VersionColumn:
return tr("The version of the resource pack.");
case DateColumn:
return tr("The date and time this resource pack was last changed (or added).");
default:
return QVariant();
}
}
return ModFolderModel::headerData(section, orientation, role);
}

View File

@ -0,0 +1,13 @@
#pragma once
#include "ModFolderModel.h"
class MULTIMC_LOGIC_EXPORT ResourcePackFolderModel : public ModFolderModel
{
Q_OBJECT
public:
explicit ResourcePackFolderModel(const QString &dir);
QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
};

View File

@ -0,0 +1,23 @@
#include "TexturePackFolderModel.h"
TexturePackFolderModel::TexturePackFolderModel(const QString &dir) : ModFolderModel(dir) {
}
QVariant TexturePackFolderModel::headerData(int section, Qt::Orientation orientation, int role) const {
if (role == Qt::ToolTipRole) {
switch (section) {
case ActiveColumn:
return tr("Is the texture pack enabled?");
case NameColumn:
return tr("The name of the texture pack.");
case VersionColumn:
return tr("The version of the texture pack.");
case DateColumn:
return tr("The date and time this texture pack was last changed (or added).");
default:
return QVariant();
}
}
return ModFolderModel::headerData(section, orientation, role);
}

View File

@ -0,0 +1,13 @@
#pragma once
#include "ModFolderModel.h"
class MULTIMC_LOGIC_EXPORT TexturePackFolderModel : public ModFolderModel
{
Q_OBJECT
public:
explicit TexturePackFolderModel(const QString &dir);
QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
};