2026-08-26 00:28:35 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
2026-09-26 10:17:13 +02:00
|
|
|
#include <QList>
|
2026-08-26 00:28:35 +02:00
|
|
|
#include <QMainWindow>
|
|
|
|
|
|
|
|
|
|
#include "settings.h"
|
|
|
|
|
|
|
|
|
|
class QDateEdit;
|
|
|
|
|
class QLabel;
|
|
|
|
|
class QLineEdit;
|
|
|
|
|
class QPushButton;
|
2026-09-26 10:17:13 +02:00
|
|
|
class QSpinBox;
|
2026-08-26 00:28:35 +02:00
|
|
|
class QStackedWidget;
|
2026-09-26 10:17:13 +02:00
|
|
|
class QVBoxLayout;
|
|
|
|
|
class PhotoItemWidget;
|
2026-08-26 00:28:35 +02:00
|
|
|
|
|
|
|
|
class MainWindow : public QMainWindow
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
public:
|
|
|
|
|
explicit MainWindow(QWidget *parent = nullptr);
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
QWidget *buildSettingsPage();
|
|
|
|
|
QWidget *buildPostPage();
|
|
|
|
|
|
|
|
|
|
void showSettings();
|
|
|
|
|
void showPost();
|
|
|
|
|
|
|
|
|
|
void saveAndTest();
|
2026-09-26 10:17:13 +02:00
|
|
|
void chooseImages();
|
|
|
|
|
void addItem(const QString &path);
|
|
|
|
|
void removeItem(PhotoItemWidget *item);
|
|
|
|
|
void clearItems();
|
2026-08-26 00:28:35 +02:00
|
|
|
void submit();
|
2026-09-26 10:17:13 +02:00
|
|
|
void pumpQueue(); // starts queued items up to the concurrency cap
|
|
|
|
|
void startItem(PhotoItemWidget *item);
|
|
|
|
|
int inFlightCount() const; // items currently preparing or uploading
|
|
|
|
|
void refreshPosting(); // updates the Post button + summary from item states
|
2026-08-26 00:28:35 +02:00
|
|
|
|
|
|
|
|
Settings m_settings;
|
|
|
|
|
|
|
|
|
|
QStackedWidget *m_stack = nullptr;
|
|
|
|
|
|
|
|
|
|
// Settings page
|
|
|
|
|
QLineEdit *m_baseUrl = nullptr;
|
|
|
|
|
QLineEdit *m_username = nullptr;
|
|
|
|
|
QLineEdit *m_password = nullptr;
|
2026-09-26 10:17:13 +02:00
|
|
|
QSpinBox *m_concurrency = nullptr;
|
2026-08-26 00:28:35 +02:00
|
|
|
QPushButton *m_saveButton = nullptr;
|
|
|
|
|
QPushButton *m_settingsBack = nullptr;
|
|
|
|
|
QLabel *m_settingsStatus = nullptr;
|
|
|
|
|
|
|
|
|
|
// Post page
|
2026-09-26 10:17:13 +02:00
|
|
|
QVBoxLayout *m_itemsLayout = nullptr; // holds the PhotoItemWidgets
|
|
|
|
|
QList<PhotoItemWidget *> m_items;
|
|
|
|
|
QLabel *m_emptyHint = nullptr;
|
2026-08-26 00:28:35 +02:00
|
|
|
QPushButton *m_postButton = nullptr;
|
2026-09-26 10:17:13 +02:00
|
|
|
QLabel *m_postSummary = nullptr;
|
2026-08-26 00:28:35 +02:00
|
|
|
QLabel *m_lastPost = nullptr;
|
|
|
|
|
|
2026-09-26 10:17:13 +02:00
|
|
|
// Bulk-post state: items waiting for a free upload slot, plus the batch's
|
|
|
|
|
// credentials captured once at submit time.
|
|
|
|
|
QList<PhotoItemWidget *> m_queue;
|
|
|
|
|
QString m_batchBaseUrl;
|
|
|
|
|
QString m_batchUsername;
|
|
|
|
|
QString m_batchPassword;
|
|
|
|
|
QString m_batchCacheDir;
|
2026-08-26 00:28:35 +02:00
|
|
|
};
|