diff options
author | Petr Mrázek <peterix@gmail.com> | 2014-02-25 01:52:58 +0100 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2014-02-25 01:52:58 +0100 |
commit | acff15562431d5d9e9f091ed7cf912f5fe34a61a (patch) | |
tree | e78502e7eda84696632be9b6539d386b829053b2 /logic/screenshots/ScreenshotList.h | |
parent | 49dc9695f5204bb80a91214c411bcb1b868ee0db (diff) | |
parent | 9d4e840a6e1a7169a2863fa1ff1812f8fe19e615 (diff) | |
download | MultiMC-acff15562431d5d9e9f091ed7cf912f5fe34a61a.tar MultiMC-acff15562431d5d9e9f091ed7cf912f5fe34a61a.tar.gz MultiMC-acff15562431d5d9e9f091ed7cf912f5fe34a61a.tar.lz MultiMC-acff15562431d5d9e9f091ed7cf912f5fe34a61a.tar.xz MultiMC-acff15562431d5d9e9f091ed7cf912f5fe34a61a.zip |
Merge branch 'feature_screenshots' into integration_json_and_tools
Conflicts:
logic/net/URLConstants.h
Resolve issues with multiple definitions of URL constants by moving them to their own object file.
Diffstat (limited to 'logic/screenshots/ScreenshotList.h')
-rw-r--r-- | logic/screenshots/ScreenshotList.h | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/logic/screenshots/ScreenshotList.h b/logic/screenshots/ScreenshotList.h new file mode 100644 index 00000000..ca6314e9 --- /dev/null +++ b/logic/screenshots/ScreenshotList.h @@ -0,0 +1,70 @@ +#pragma once + +#include <QAbstractListModel> +#include "logic/BaseInstance.h" +#include "logic/tasks/Task.h" + +#include "Screenshot.h" + +class ScreenshotList : public QAbstractListModel +{ + Q_OBJECT +public: + ScreenshotList(BaseInstance *instance, QObject *parent = 0); + + QVariant data(const QModelIndex &index, int role) const; + QVariant headerData(int section, Qt::Orientation orientation, int role) const; + + int rowCount(const QModelIndex &parent) const; + + Qt::ItemFlags flags(const QModelIndex &index) const; + + Task *load(); + + void loadShots(QList<ScreenshotPtr> shots) + { + m_screenshots = shots; + } + + QList<ScreenshotPtr> screenshots() const + { + return m_screenshots; + } + + BaseInstance *instance() const + { + return m_instance; + } + + void deleteSelected(class ScreenshotDialog *dialog); + +signals: + +public +slots: + +private: + QList<ScreenshotPtr> m_screenshots; + BaseInstance *m_instance; +}; + +class ScreenshotLoadTask : public Task +{ + Q_OBJECT + +public: + explicit ScreenshotLoadTask(ScreenshotList *list); + ~ScreenshotLoadTask(); + + QList<ScreenshotPtr> screenShots() const + { + return m_results; + } + +protected: + virtual void executeTask(); + +private: + ScreenshotList *m_list; + QList<ScreenshotPtr> m_results; +}; |