gui: Options, Scheduler, Speed Limiter, Batch, Grabber, and the tray icon
Continues the build order past the Add-URL/File-Info/Progress dialog flow.
- OptionsDialog: General/Save To/Connection/Downloads/Proxy/Sounds tabs, every
control bound to a real settings.* key (contracts/schema/types/Settings.
schema.json). The spec's File Types and Site Logins tabs have no settings.*
backing (categories go through category.upsert, credentials through the
Secret Service) so they don't exist here — a tab either binds to a real key
or isn't shipped. diffChanged() sends only what actually changed, matching
settings.set's "changed[] names exactly what took effect" contract.
- SchedulerDialog: per-queue schedule (schedule.get/set) plus maxConcurrent/
onComplete (queue.upsert), Start Now/Stop. Queue.schema.json already carries
the schedule so queue.list alone seeds the window.
- SpeedLimiterDialog: the live global limiter (limiter.get/set) — a different
thing from Options' downloads.speedLimit* default. buildParams() enforces
the schema's "0 with enabled true must not be offered".
- BatchDialog: clipboard-blob and {start..end}-wildcard tabs sharing one
category/queue/start-mode footer into download.addBatch.
- GrabberWizard: 4-step QWizard (project label -> start URL/depth/filters ->
file-type filter -> review), grabber.start feeding a poll+event.grabber.
progress-driven review page, Finish = grabber.harvest for the checked files.
- TrayIcon: active-count tooltip, Show/Add URL/Pause All/Resume All/Speed
Limiter submenu/Quit. Quit only closes the GUI — there is no RPC to stop
veloxd itself, filed as a new gap in daemon-requests-m1.md. MainWindow now
also hides to tray instead of closing when general.minimizeToTray is set.
Every dialog's non-widget logic (diffChanged, buildSchedule, buildParams,
parseUrlBlob/expandWildcard/buildAddBatchParams, buildFileTypes/
buildStartParams/buildHarvestParams) is a static pure function with its own
test, same shape as FileInfoDialog::buildSpec from the previous round.
Verified end-to-end against a running mockd under ASan+UBSan: all five
surfaces render real data (settings.get values, queue.list's two seeded
queues, limiter.get, a live grabber.start/status crawl returning 3 files) with
no sanitizer reports. gui-check (non-ASan) and dev (ASan+UBSan) presets both
build the whole repo clean; all gui-labeled ctest targets pass.
Co-Authored-By: Claude Sonnet 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NSCdCWFXBTSBBK3MzWtJiC
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
// The main window. Lane GUI.
|
||||
//
|
||||
// M1 slice: the tray and the Options/Scheduler/Speed-Limiter/Batch/Grabber dialogs still
|
||||
// come later. This is the menus + toolbar + splitter (category tree | table), the table
|
||||
// driven by mockd, a status-bar connection dot, an offline banner instead of a modal, the
|
||||
// Add URL -> File Info flow, and a per-task progress dialog.
|
||||
// M1 slice: menus + toolbar + splitter (category tree | table), the table driven by
|
||||
// mockd, a status-bar connection dot, an offline banner instead of a modal, the Add URL ->
|
||||
// File Info flow, a per-task progress dialog, Options/Scheduler/Speed Limiter/Batch/
|
||||
// Grabber, and the tray icon. The floating drop target and clipboard capture are still to
|
||||
// come.
|
||||
|
||||
#pragma once
|
||||
|
||||
@@ -24,6 +25,7 @@ namespace velox::gui {
|
||||
|
||||
class DownloadTableModel;
|
||||
class CategoryPanel;
|
||||
class TrayIcon;
|
||||
namespace rpc {
|
||||
class RpcClient;
|
||||
} // namespace rpc
|
||||
@@ -55,12 +57,21 @@ class MainWindow : public QMainWindow {
|
||||
void openAddUrlDialog();
|
||||
void openPropertiesForSelection();
|
||||
void showTableContextMenu(const QPoint &pos);
|
||||
void openOptionsDialog();
|
||||
void openSchedulerDialog();
|
||||
void openSpeedLimiterDialog();
|
||||
void openBatchDialog();
|
||||
void openGrabberWizard();
|
||||
void showAndRaise();
|
||||
void onSettingsChanged(const QJsonObject ¶ms);
|
||||
|
||||
private:
|
||||
void buildActions();
|
||||
void buildMenus();
|
||||
void buildToolBar();
|
||||
void buildTray();
|
||||
void fetchTree();
|
||||
void fetchMinimizeToTraySetting();
|
||||
QStringList selectedTaskIds() const;
|
||||
QStringList allTaskIds() const;
|
||||
void actOnTasks(const char *methodName, const QStringList &ids);
|
||||
@@ -81,9 +92,17 @@ class MainWindow : public QMainWindow {
|
||||
QAction *actResumeAll_ = nullptr;
|
||||
QAction *actPauseAll_ = nullptr;
|
||||
QAction *actProperties_ = nullptr;
|
||||
QAction *actOptions_ = nullptr;
|
||||
QAction *actScheduler_ = nullptr;
|
||||
QAction *actSpeedLimiter_ = nullptr;
|
||||
QAction *actBatch_ = nullptr;
|
||||
QAction *actGrabber_ = nullptr;
|
||||
QAction *actShow_ = nullptr;
|
||||
|
||||
QJsonArray categoriesCache_;
|
||||
QJsonArray queuesCache_;
|
||||
TrayIcon *trayIcon_ = nullptr;
|
||||
bool minimizeToTrayEnabled_ = false;
|
||||
|
||||
QLabel *connDot_;
|
||||
QLabel *connText_;
|
||||
|
||||
Reference in New Issue
Block a user