Adwaita-derived (GNOME Project, LGPL-3-or-CC-BY-SA), recoloured per light/dark skin and laid out in IDM's toolbar positions per docs/03-gui-spec.md §1. Licence and per-file provenance recorded in gui/resources/icons/LICENSE. New IconTheme mirrors ThemeManager's colorSchemeChanged hook so a live light/dark switch swaps every action's glyph, not just the QSS. Toolbar/menu actions, the tray icon and the window icon all now use it instead of the SP_ArrowDown placeholder. Install-path notes for PKG filed as R5 in gui/docs/pkg-qa-requests-m1.md. Also rebases lane/gui onto main (13 commits, no gui/ conflicts). Verified: full build clean, all 13 gui ctest targets pass (including gui_no_download_logic), unhappy-path DoD gate PASS against mockd (--drop-connection). Co-Authored-By: Claude Sonnet 5 <[email protected]>
106 lines
4.4 KiB
CMake
106 lines
4.4 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/widgets/SegmentBarsWidget.cpp
|
|
src/widgets/SpeedGraphWidget.cpp
|
|
src/dialogs/AddUrlDialog.cpp
|
|
src/dialogs/FileInfoDialog.cpp
|
|
src/dialogs/ProgressDialog.cpp
|
|
src/dialogs/OptionsDialog.cpp
|
|
src/dialogs/SchedulerDialog.cpp
|
|
src/dialogs/SpeedLimiterDialog.cpp
|
|
src/dialogs/BatchDialog.cpp
|
|
src/dialogs/GrabberWizard.cpp
|
|
src/tray/TrayIcon.cpp
|
|
src/widgets/DropTargetWidget.cpp
|
|
src/util/ThemeManager.cpp
|
|
src/util/IconTheme.cpp
|
|
src/util/UiThreadWatchdog.cpp
|
|
src/mainwindow/CategoryPanel.cpp
|
|
src/mainwindow/MainWindow.cpp
|
|
)
|
|
|
|
# docs/03-gui-spec.md §7: the two QSS skins ThemeManager picks between, embedded so the
|
|
# app needs no external file at runtime.
|
|
qt_add_resources(velox-gui-lib "theme"
|
|
PREFIX "/qss"
|
|
BASE "resources/qss"
|
|
FILES resources/qss/idm-like.qss resources/qss/dark.qss
|
|
)
|
|
|
|
# gui/resources/icons/LICENSE: Adwaita-derived (GNOME Project), LGPL-3 or CC-BY-SA-3/4.
|
|
# light/dark are the same glyphs recoloured for each toolbar skin (IconTheme picks
|
|
# between them the same way ThemeManager picks QSS); app/ is the fixed full-colour
|
|
# window/tray glyph.
|
|
file(GLOB VELOX_GUI_ICONS_LIGHT resources/icons/light/*.svg)
|
|
file(GLOB VELOX_GUI_ICONS_DARK resources/icons/dark/*.svg)
|
|
qt_add_resources(velox-gui-lib "icons"
|
|
PREFIX "/icons"
|
|
BASE "resources/icons"
|
|
FILES ${VELOX_GUI_ICONS_LIGHT} ${VELOX_GUI_ICONS_DARK} resources/icons/app/velox.svg
|
|
)
|
|
|
|
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
|
|
Threads::Threads
|
|
)
|
|
|
|
# docs/06-risks-and-spikes.md R2's explicit path #2 (a global shortcut via
|
|
# org.freedesktop.portal.GlobalShortcuts) needs Qt6::DBus, which the root CMakeLists.txt
|
|
# does not request yet (gui/docs/pkg-qa-requests-m1.md R4 — PKG/QA's file, not ours).
|
|
# Guarded exactly like the veloxproto check above: compiles in automatically the moment
|
|
# that lands, and MainWindow only wires it up when VELOX_GUI_HAVE_DBUS is defined.
|
|
if(TARGET Qt6::DBus)
|
|
target_sources(velox-gui-lib PRIVATE src/clipboard/GlobalShortcut.cpp)
|
|
target_link_libraries(velox-gui-lib PUBLIC Qt6::DBus)
|
|
target_compile_definitions(velox-gui-lib PUBLIC VELOX_GUI_HAVE_DBUS)
|
|
else()
|
|
message(STATUS "velox-gui: Qt6::DBus not available — the clipboard global-shortcut "
|
|
"path (gui/docs/pkg-qa-requests-m1.md R4) is skipped, not broken.")
|
|
endif()
|
|
|
|
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()
|