summaryrefslogtreecommitdiff
path: root/src/modlist.h
diff options
context:
space:
mode:
authorTannin <devnull@localhost>2015-03-09 12:34:34 +0100
committerTannin <devnull@localhost>2015-03-09 12:34:34 +0100
commit7a1ae9b0f1560c9eda32e032796fbb3fd56ff236 (patch)
treedea71435ac1042cb008fcd9f7b1ec57e6ea91227 /src/modlist.h
parentd45ebf134819e1559718681becca9c4139fb7151 (diff)
parentdb2954e8eb41da715b9e7d79a72e225797401413 (diff)
Merge with branch1.2
Diffstat (limited to 'src/modlist.h')
-rw-r--r--src/modlist.h24
1 files changed, 20 insertions, 4 deletions
diff --git a/src/modlist.h b/src/modlist.h
index 38d08c2d..6a10cb3e 100644
--- a/src/modlist.h
+++ b/src/modlist.h
@@ -40,6 +40,8 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
#include <QVector>
+class QSortFilterProxyModel;
+
/**
* Model presenting an overview of the installed mod
* This is used in a view in the main window of MO. It combines general information about
@@ -54,6 +56,7 @@ public:
enum EColumn {
COL_NAME,
COL_FLAGS,
+ COL_CONTENT,
COL_CATEGORY,
COL_MODID,
COL_VERSION,
@@ -72,7 +75,7 @@ public:
* @brief constructor
* @todo ensure this view works without a profile set, otherwise there are intransparent dependencies on the initialisation order
**/
- ModList(QObject *parent = NULL);
+ ModList(QObject *parent = nullptr);
~ModList();
@@ -94,13 +97,15 @@ public:
* @brief remove the specified mod without asking for confirmation
* @param row the row to remove
*/
- void removeRowForce(int row);
+ void removeRowForce(int row, const QModelIndex &parent);
void notifyChange(int rowStart, int rowEnd = -1);
static QString getColumnName(int column);
void changeModPriority(int sourceIndex, int newPriority);
+ void setOverwriteMarkers(const std::set<unsigned int> &overwrite, const std::set<unsigned int> &overwritten);
+
bool modInfoAboutToChange(ModInfo::Ptr info);
void modInfoChanged(ModInfo::Ptr info);
@@ -138,7 +143,7 @@ public: // implementation of virtual functions of QAbstractItemModel
virtual Qt::DropActions supportedDropActions() const { return Qt::MoveAction | Qt::CopyAction; }
virtual QStringList mimeTypes() const;
virtual bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent);
- virtual void removeRow(int row, const QModelIndex &parent);
+ virtual bool removeRows(int row, int count, const QModelIndex &parent);
virtual QModelIndex index(int row, int column,
const QModelIndex &parent = QModelIndex()) const;
@@ -245,6 +250,8 @@ private:
QString contentsToToolTip(const std::vector<ModInfo::EContent> &contents) const;
+ ModList::EColumn getEnabledColumn(int index) const;
+
QVariant categoryData(int categoryID, int column, int role) const;
QVariant modData(int modID, int modelColumn, int role) const;
@@ -256,6 +263,12 @@ private:
ModStates state(unsigned int modIndex) const;
+ bool moveSelection(QAbstractItemView *itemView, int direction);
+
+ bool deleteSelection(QAbstractItemView *itemView);
+
+ bool toggleSelection(QAbstractItemView *itemView);
+
private slots:
private:
@@ -288,12 +301,15 @@ private:
bool m_DropOnItems;
+ std::set<unsigned int> m_Overwrite;
+ std::set<unsigned int> m_Overwritten;
+
TModInfoChange m_ChangeInfo;
SignalModStateChanged m_ModStateChanged;
SignalModMoved m_ModMoved;
- std::map<ModInfo::EContent, std::tuple<QIcon, QString, QString> > m_ContentIcons;
+ std::map<ModInfo::EContent, std::tuple<QString, QString> > m_ContentIcons;
};