Qt desktop: add manage (edit/delete) and tag autocomplete

Brings the Qt uploader to parity with the web /manage page and the Android
app. Adds a stacked Manage page (reached from the post page) that lists
posts via GET /api/photos with thumbnails from GET /api/thumb/<slug>, edits
caption/date/tags in a QDialog via POST /api/edit, and deletes to trash via
POST /api/delete with a QMessageBox confirm. As a non-browser client it sends
no Origin and so passes the server's same-origin CSRF check.

Tag autocomplete now backs every tags field (post cards and the edit dialog)
via a per-token TagCompleter (QCompleter subclass, MatchContains) fed from
the unguarded GET /api/tags.json.

New files: managepostwidget.{h,cpp}, tagcompleter.{h,cpp}; network methods
and a RemotePhoto struct added to uploadclient. Built and linked clean; not
yet runtime-tested on a real display.
This commit is contained in:
puttaalu committed 2026-11-04 22:04:06 +01:00
1 parent bb8c7109fa
commit 504b96ed31
12 files changed
+677 -2

No files matched your search

+9
View File
@@ -1,5 +1,7 @@
#include "photoitemwidget.h"
#include "tagcompleter.h"
#include <QDate>
#include <QDateEdit>
#include <QHBoxLayout>
@@ -49,6 +51,8 @@ PhotoItemWidget::PhotoItemWidget(QString sourcePath, QWidget *parent)
m_tags = new QLineEdit;
m_tags->setPlaceholderText(QStringLiteral("tags (comma-separated)"));
m_tagCompleter = new TagCompleter(this);
m_tags->setCompleter(m_tagCompleter);
fields->addWidget(m_tags);
m_statusLabel = new QLabel;
@@ -79,6 +83,11 @@ QString PhotoItemWidget::tags() const
return m_tags->text();
}
void PhotoItemWidget::setTagSuggestions(const QStringList &tags)
{
m_tagCompleter->setSuggestions(tags);
}
void PhotoItemWidget::setStatus(Status status, const QString &message, const QString &url)
{
m_status = status;