forked from mirror/openmw-tes3mp
Merge remote-tracking branch 'dteviot/master'
This commit is contained in:
commit
e9af9b991d
4 changed files with 22 additions and 16 deletions
|
@ -6,13 +6,12 @@
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QTextCodec>
|
#include <QTextCodec>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QBrush>
|
|
||||||
#include <QIcon>
|
|
||||||
|
|
||||||
#include "components/esm/esmreader.hpp"
|
#include "components/esm/esmreader.hpp"
|
||||||
|
|
||||||
ContentSelectorModel::ContentModel::ContentModel(QObject *parent) :
|
ContentSelectorModel::ContentModel::ContentModel(QObject *parent, QIcon warningIcon) :
|
||||||
QAbstractTableModel(parent),
|
QAbstractTableModel(parent),
|
||||||
|
mWarningIcon(warningIcon),
|
||||||
mMimeType ("application/omwcontent"),
|
mMimeType ("application/omwcontent"),
|
||||||
mMimeTypes (QStringList() << mMimeType),
|
mMimeTypes (QStringList() << mMimeType),
|
||||||
mColumnCount (1),
|
mColumnCount (1),
|
||||||
|
@ -180,7 +179,7 @@ QVariant ContentSelectorModel::ContentModel::data(const QModelIndex &index, int
|
||||||
{
|
{
|
||||||
case Qt::DecorationRole:
|
case Qt::DecorationRole:
|
||||||
{
|
{
|
||||||
return isLoadOrderError(file) ? QIcon::fromTheme("edit-delete") : QVariant();
|
return isLoadOrderError(file) ? mWarningIcon : QVariant();
|
||||||
}
|
}
|
||||||
|
|
||||||
case Qt::EditRole:
|
case Qt::EditRole:
|
||||||
|
@ -598,13 +597,16 @@ QList<ContentSelectorModel::LoadOrderError> ContentSelectorModel::ContentModel::
|
||||||
{
|
{
|
||||||
errors.append(LoadOrderError(LoadOrderError::ErrorCode_MissingDependency, dependentfileName));
|
errors.append(LoadOrderError(LoadOrderError::ErrorCode_MissingDependency, dependentfileName));
|
||||||
}
|
}
|
||||||
if (!isChecked(dependentFile->filePath()))
|
else
|
||||||
{
|
{
|
||||||
errors.append(LoadOrderError(LoadOrderError::ErrorCode_InactiveDependency, dependentfileName));
|
if (!isChecked(dependentFile->filePath()))
|
||||||
}
|
{
|
||||||
if (row < indexFromItem(dependentFile).row())
|
errors.append(LoadOrderError(LoadOrderError::ErrorCode_InactiveDependency, dependentfileName));
|
||||||
{
|
}
|
||||||
errors.append(LoadOrderError(LoadOrderError::ErrorCode_LoadOrder, dependentfileName));
|
if (row < indexFromItem(dependentFile).row())
|
||||||
|
{
|
||||||
|
errors.append(LoadOrderError(LoadOrderError::ErrorCode_LoadOrder, dependentfileName));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return errors;
|
return errors;
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
#include <QAbstractTableModel>
|
#include <QAbstractTableModel>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
#include <QSet>
|
#include <QSet>
|
||||||
|
#include <QIcon>
|
||||||
#include "loadordererror.hpp"
|
#include "loadordererror.hpp"
|
||||||
|
|
||||||
namespace ContentSelectorModel
|
namespace ContentSelectorModel
|
||||||
|
@ -23,7 +23,7 @@ namespace ContentSelectorModel
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit ContentModel(QObject *parent = 0);
|
explicit ContentModel(QObject *parent, QIcon warningIcon);
|
||||||
~ContentModel();
|
~ContentModel();
|
||||||
|
|
||||||
void setEncoding(const QString &encoding);
|
void setEncoding(const QString &encoding);
|
||||||
|
@ -57,6 +57,9 @@ namespace ContentSelectorModel
|
||||||
|
|
||||||
void refreshModel();
|
void refreshModel();
|
||||||
|
|
||||||
|
/// Checks all plug-ins for load order errors and updates mPluginsWithLoadOrderError with plug-ins with issues
|
||||||
|
void checkForLoadOrderErrors();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
void addFile(EsmFile *file);
|
void addFile(EsmFile *file);
|
||||||
|
@ -65,9 +68,6 @@ namespace ContentSelectorModel
|
||||||
|
|
||||||
void sortFiles();
|
void sortFiles();
|
||||||
|
|
||||||
/// Checks all plug-ins for load order errors and updates mPluginsWithLoadOrderError with plug-ins with issues
|
|
||||||
void checkForLoadOrderErrors();
|
|
||||||
|
|
||||||
/// Checks a specific plug-in for load order errors
|
/// Checks a specific plug-in for load order errors
|
||||||
/// \return all errors found for specific plug-in
|
/// \return all errors found for specific plug-in
|
||||||
QList<LoadOrderError> checkForLoadOrderErrors(const EsmFile *file, int row) const;
|
QList<LoadOrderError> checkForLoadOrderErrors(const EsmFile *file, int row) const;
|
||||||
|
@ -82,6 +82,7 @@ namespace ContentSelectorModel
|
||||||
QSet<QString> mPluginsWithLoadOrderError;
|
QSet<QString> mPluginsWithLoadOrderError;
|
||||||
QTextCodec *mCodec;
|
QTextCodec *mCodec;
|
||||||
QString mEncoding;
|
QString mEncoding;
|
||||||
|
QIcon mWarningIcon;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,8 @@ ContentSelectorView::ContentSelector::ContentSelector(QWidget *parent) :
|
||||||
|
|
||||||
void ContentSelectorView::ContentSelector::buildContentModel()
|
void ContentSelectorView::ContentSelector::buildContentModel()
|
||||||
{
|
{
|
||||||
mContentModel = new ContentSelectorModel::ContentModel(this);
|
QIcon warningIcon(ui.addonView->style()->standardIcon(QStyle::SP_MessageBoxWarning).pixmap(QSize(16, 15)));
|
||||||
|
mContentModel = new ContentSelectorModel::ContentModel(this, warningIcon);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ContentSelectorView::ContentSelector::buildGameFileView()
|
void ContentSelectorView::ContentSelector::buildGameFileView()
|
||||||
|
@ -161,6 +162,7 @@ void ContentSelectorView::ContentSelector::slotCurrentGameFileIndexChanged(int i
|
||||||
oldIndex = index;
|
oldIndex = index;
|
||||||
|
|
||||||
model->setData(model->index(index, 0), true, Qt::UserRole + 1);
|
model->setData(model->index(index, 0), true, Qt::UserRole + 1);
|
||||||
|
mContentModel->checkForLoadOrderErrors();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (proxy)
|
if (proxy)
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
#include <OgreTexture.h>
|
#include <OgreTexture.h>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue