Add bulk multi-photo upload to the desktop app
Mirror the Android bulk feature in the Qt uploader: choose several photos at once, each a card with its own caption, date, and upload status, and post the batch. - Per-photo cards (PhotoItemWidget) in a scrollable list; retry re-posts only the failures. - One upload per photo with a per-item UUID slug suffix so a batch posted in the same second cannot collide. - Image prep runs off the UI thread via QtConcurrent so the window stays responsive. - A "Simultaneous uploads" setting (1–8, default 3) caps how many photos are prepared/uploaded at once; the rest queue and fill freed slots.
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
#pragma once
|
||||
|
||||
#include <QString>
|
||||
#include <QWidget>
|
||||
|
||||
class QDateEdit;
|
||||
class QLabel;
|
||||
class QLineEdit;
|
||||
class QPushButton;
|
||||
|
||||
// One photo in the batch: thumbnail, caption, date, and its own upload status.
|
||||
// A single-photo post is just a batch of one, so the window runs one code path.
|
||||
class PhotoItemWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
enum class Status { Pending, Preparing, Uploading, Success, Error };
|
||||
|
||||
explicit PhotoItemWidget(QString sourcePath, QWidget *parent = nullptr);
|
||||
|
||||
QString sourcePath() const { return m_sourcePath; }
|
||||
QString caption() const;
|
||||
QString date() const; // yyyy-MM-dd
|
||||
Status status() const { return m_status; }
|
||||
|
||||
void setStatus(Status status, const QString &message = {}, const QString &url = {});
|
||||
|
||||
signals:
|
||||
void removeRequested(PhotoItemWidget *self);
|
||||
|
||||
private:
|
||||
QString m_sourcePath;
|
||||
Status m_status = Status::Pending;
|
||||
|
||||
QLabel *m_thumb = nullptr;
|
||||
QLineEdit *m_caption = nullptr;
|
||||
QDateEdit *m_date = nullptr;
|
||||
QLabel *m_statusLabel = nullptr;
|
||||
QPushButton *m_remove = nullptr;
|
||||
};
|
||||
Reference in New Issue
Block a user