48 lines
1.3 KiB
C++
48 lines
1.3 KiB
C++
#pragma once
|
|||
|
|
|
||
|
|
#include <QString>
|
||
|
|
#include <QStringList>
|
||
|
|
#include <QWidget>
|
||
|
|
|
||
|
|
class QImage;
|
||
|
|
class QLabel;
|
||
|
|
class QPushButton;
|
||
|
|
|
||
|
|
// One published post on the Manage page: thumbnail, caption/date/tags summary,
|
||
|
|
// and Edit / Delete buttons. Mirrors a row of the web /manage list and the
|
||
|
|
// Android manage screen.
|
||
|
|
class ManagePostWidget : public QWidget
|
||
|
|
{
|
||
|
|
Q_OBJECT
|
||
|
|
public:
|
||
|
|
ManagePostWidget(const QString &slug, const QString &caption, const QString &date,
|
||
|
|
const QStringList &tags, const QString &url, QWidget *parent = nullptr);
|
||
|
|
|
||
|
|
QString slug() const { return m_slug; }
|
||
|
|
QString caption() const { return m_caption; }
|
||
|
|
QString date() const { return m_date; }
|
||
|
|
QStringList tags() const { return m_tags; }
|
||
|
|
|
||
|
|
void setThumbnail(const QImage &image);
|
||
|
|
void applyEdit(const QString &caption, const QString &date, const QStringList &tags);
|
||
|
|
void setBusy(bool busy); // a save/delete is in flight
|
||
|
|
|
||
|
|
signals:
|
||
|
|
void editRequested(ManagePostWidget *self);
|
||
|
|
void deleteRequested(ManagePostWidget *self);
|
||
|
|
|
||
|
|
private:
|
||
|
|
void refreshSummary();
|
||
|
|
|
||
|
|
QString m_slug;
|
||
|
|
QString m_caption;
|
||
|
|
QString m_date;
|
||
|
|
QStringList m_tags;
|
||
|
|
QString m_url;
|
||
|
|
|
||
|
|
QLabel *m_thumb = nullptr;
|
||
|
|
QLabel *m_captionLabel = nullptr;
|
||
|
|
QLabel *m_metaLabel = nullptr;
|
||
|
|
QPushButton *m_edit = nullptr;
|
||
|
|
QPushButton *m_delete = nullptr;
|
||
|
|
};
|