2014-02-24 02:44:24 +05:30
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <QAbstractListModel>
|
|
|
|
#include "logic/BaseInstance.h"
|
|
|
|
#include "logic/tasks/Task.h"
|
|
|
|
|
|
|
|
class ScreenShot
|
|
|
|
{
|
|
|
|
public:
|
2014-02-24 15:04:51 +05:30
|
|
|
QDateTime timestamp;
|
2014-02-24 06:15:59 +05:30
|
|
|
QString file;
|
2014-02-24 02:44:24 +05:30
|
|
|
QString url;
|
2014-02-24 16:00:27 +05:30
|
|
|
QString imgurId;
|
2014-02-24 02:44:24 +05:30
|
|
|
};
|
|
|
|
|
|
|
|
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<ScreenShot *> shots)
|
|
|
|
{
|
|
|
|
m_screenshots = shots;
|
|
|
|
}
|
|
|
|
|
|
|
|
QList<ScreenShot *> screenshots() const
|
|
|
|
{
|
|
|
|
return m_screenshots;
|
|
|
|
}
|
|
|
|
|
|
|
|
BaseInstance *instance() const
|
|
|
|
{
|
|
|
|
return m_instance;
|
|
|
|
}
|
|
|
|
|
2014-02-25 04:10:05 +05:30
|
|
|
void deleteSelected(class ScreenshotDialog *dialog);
|
|
|
|
|
2014-02-24 02:44:24 +05:30
|
|
|
signals:
|
|
|
|
|
|
|
|
public
|
|
|
|
slots:
|
|
|
|
|
|
|
|
private:
|
|
|
|
QList<ScreenShot *> m_screenshots;
|
|
|
|
BaseInstance *m_instance;
|
|
|
|
};
|
|
|
|
|
|
|
|
class ScreenshotLoadTask : public Task
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit ScreenshotLoadTask(ScreenshotList *list);
|
|
|
|
~ScreenshotLoadTask();
|
|
|
|
|
|
|
|
QList<ScreenShot *> screenShots() const
|
|
|
|
{
|
|
|
|
return m_results;
|
|
|
|
}
|
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual void executeTask();
|
|
|
|
|
|
|
|
private:
|
|
|
|
ScreenshotList *m_list;
|
|
|
|
QList<ScreenShot *> m_results;
|
|
|
|
};
|