Files
vdm/gui/CMakeLists.txt
T
samiandClaude Sonnet 5 51fa1201bd gui: category tree, menus, toolbar, splitter — build-order step 3
- CategoryPanel: the left tree — All Downloads / Unfinished / Finished,
  then Categories and Queues populated from category.list / queue.list,
  with per-node task counts. Selecting a node emits a TaskSelection.
- DownloadFilterProxy: QSortFilterProxyModel keyed off that selection.
  Client-side for M1 (the whole list fits); asTaskFilter() exposes the
  equivalent TaskFilter for a server-side download.list once paging lands.
- MainWindow: menu bar (Tasks / Downloads / View / Help) sharing QAction
  objects with the toolbar; QSplitter [panel | table]; Delete with a
  confirm; Resume/Pause All; View menu toggles the panel. Actions
  disabled while offline.
- Counts are computed off a throttled 400 ms timer, not the 4 Hz progress
  path. Fixed a debounce-vs-throttle bug found in the first screenshot:
  restarting the timer on every progress tick meant it never fired and
  the status bar sat at "0 of 0 downloads".
- First-run column widths that fit the content.
- tst_downloadfilterproxy: nodes filter to their own rows, the
  Finished/Unfinished split is correct, and the filter is dynamic (a row
  that finishes leaves the Unfinished node with no re-list). Verified
  against mockd --tasks 400 (screenshot: tree counts 75/84/89/83/69 sum
  to 400, status bar "400 of 400, 21 active").

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Ne28kx4VreeBWZv82Nksd
2026-09-10 15:41:29 +04:00

56 lines
2.2 KiB
CMake

# velox-gui — the Qt 6 Widgets client. Lane GUI.
#
# CLAUDE.md §3: zero download logic here. This target links libveloxproto (the wire
# types, ADR 0009) and NEVER libveloxcore — enforced by tests/ (see the
# gui_no_download_logic test).
#
# The root CMakeLists.txt add_subdirectory()s this unconditionally once the file exists,
# so it must stay configurable even if veloxproto is ever absent again. Until that target
# exists we announce and bail.
if(NOT TARGET veloxproto)
message(STATUS "velox-gui: libveloxproto target missing — GUI target skipped. "
"It builds automatically once core/ provides the veloxproto target (ADR 0009).")
return()
endif()
set(CMAKE_AUTOMOC ON)
# Everything except main() lives in a static lib so the tests can link the real widgets
# and models rather than a reimplementation.
add_library(velox-gui-lib STATIC
src/rpc/RpcConnection.cpp
src/rpc/RpcClient.cpp
src/models/DownloadTableModel.cpp
src/models/DownloadFilterProxy.cpp
src/widgets/ProgressDelegate.cpp
src/mainwindow/CategoryPanel.cpp
src/mainwindow/MainWindow.cpp
)
target_include_directories(velox-gui-lib PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src)
target_compile_features(velox-gui-lib PUBLIC cxx_std_23)
target_compile_options(velox-gui-lib PRIVATE -Wall -Wextra -Wpedantic -Werror)
target_link_libraries(velox-gui-lib PUBLIC
velox::proto
Qt6::Widgets
Qt6::Svg
Qt6::Network
)
add_executable(velox-gui src/main.cpp)
target_compile_options(velox-gui PRIVATE -Wall -Wextra -Wpedantic -Werror)
target_link_libraries(velox-gui PRIVATE velox-gui-lib)
set_target_properties(velox-gui PROPERTIES WIN32_EXECUTABLE OFF MACOSX_BUNDLE OFF)
# --- i18n -------------------------------------------------------------------------------
# Every string in the GUI goes through tr(); the Arabic stub exists to prove the RTL
# layout survives (GUI DoD), exercised by tests/tst_rtl. lrelease also drops the .qm at
# ${CMAKE_CURRENT_BINARY_DIR}/velox_ar.qm, which the RTL test loads by path.
qt_add_translations(velox-gui TS_FILES i18n/velox_ar.ts)
# --- tests ---------------------------------------------------------------------------
if(VELOX_BUILD_TESTS)
add_subdirectory(tests)
endif()