Skip to content

FinceptTerminal is a modern finance application offering advanced market analytics, investment research, and economic data tools, designed for interactive exploration and data-driven decision-making in a user-friendly environment.

workflow update

tilakpatel22b0b58a9ef2cf
diff --git a/.github/workflows/build-installer.yml b/.github/workflows/build-installer.yml
index 958a159cb..965a4c70b 100644
--- a/.github/workflows/build-installer.yml
+++ b/.github/workflows/build-installer.yml
@@ -87,6 +87,30 @@ jobs:
libxcb-xinerama0 libxcb-xkb1 \
pkg-config zip
+ # ---- OpenSSL (Windows) — runners have it pre-installed; expose the path ----
+ - name: Set OpenSSL root (Windows)
+ if: runner.os == 'Windows'
+ shell: bash
+ run: |
+ # windows-2022 runners ship OpenSSL at one of these locations
+ for d in \
+ "C:/Program Files/OpenSSL" \
+ "C:/Program Files/OpenSSL-Win64" \
+ "C:/hostedtoolcache/windows/openssl" \
+ "C:/Tools/openssl"; do
+ if [ -f "$d/lib/libcrypto.lib" ] || [ -f "$d/lib/VC/x64/MD/libcrypto.lib" ]; then
+ echo "OPENSSL_ROOT_DIR=$d" >> $GITHUB_ENV
+ echo "Found OpenSSL at: $d"
+ break
+ fi
+ done
+ # Fallback: use choco to install if not found
+ if [ -z "$OPENSSL_ROOT_DIR" ]; then
+ echo "OpenSSL not found in standard paths — installing via choco"
+ choco install openssl --no-progress -y
+ echo "OPENSSL_ROOT_DIR=C:/Program Files/OpenSSL-Win64" >> $GITHUB_ENV
+ fi
+
# ---- Qt6 (Windows / macOS) ----
- name: Install Qt6
if: runner.os != 'Linux'
@@ -137,11 +161,17 @@ jobs:
shell: bash
working-directory: fincept-qt
run: |
+ OPENSSL_ARG=""
+ if [ -n "${OPENSSL_ROOT_DIR:-}" ]; then
+ OPENSSL_ARG="-DOPENSSL_ROOT_DIR=${OPENSSL_ROOT_DIR}"
+ fi
+
cmake -B build \
-DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \
-DCMAKE_PREFIX_PATH="${QT_ROOT_DIR}" \
-DDEPLOY_QT=ON \
-DFINCEPT_BUILD_INSTALLER=ON \
+ ${OPENSSL_ARG} \
${{ runner.os == 'macOS' && '-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache' || '' }} \
${{ matrix.cmake_extra }}
diff --git a/fincept-qt/CMakeLists.txt b/fincept-qt/CMakeLists.txt
index a0b8341ff..47b762320 100644
--- a/fincept-qt/CMakeLists.txt
+++ b/fincept-qt/CMakeLists.txt
@@ -1431,22 +1431,38 @@ target_precompile_headers(FinceptTerminal PRIVATE
<span>
)
-# ── OpenSSL (from vcpkg) — needed for Google Sheets JWT signing ───────────────
-# Override via: cmake -DVCPKG_OPENSSL=<path> or set VCPKG_INSTALLED_DIR env var.
-if(NOT DEFINED VCPKG_OPENSSL)
- if(DEFINED ENV{VCPKG_INSTALLED_DIR})
- set(VCPKG_OPENSSL "$ENV{VCPKG_INSTALLED_DIR}/x64-windows")
- elseif(DEFINED ENV{VCPKG_ROOT})
- set(VCPKG_OPENSSL "$ENV{VCPKG_ROOT}/installed/x64-windows")
- else()
- # Developer machine default — override on CI via cmake cache variable
- set(VCPKG_OPENSSL "C:/windowsdisk/fincept-cpp/vcpkg_installed/x64-windows"
- CACHE PATH "Path to vcpkg x64-windows installed directory")
+# ── OpenSSL — needed for Google Sheets JWT signing ────────────────────────────
+# Strategy (all platforms): find_package first (works on CI runners and system installs).
+# On Windows, also search Qt's bundled OpenSSL and vcpkg as fallbacks.
+if(WIN32)
+ # 1. Try Qt-bundled OpenSSL (set by jurplel/install-qt-action via QT_ROOT_DIR)
+ if(DEFINED ENV{QT_ROOT_DIR} AND NOT OPENSSL_ROOT_DIR)
+ set(OPENSSL_ROOT_DIR "$ENV{QT_ROOT_DIR}" CACHE PATH "" FORCE)
+ endif()
+ # 2. Try VCPKG paths (dev machine / vcpkg toolchain)
+ if(NOT OPENSSL_ROOT_DIR)
+ if(DEFINED ENV{VCPKG_INSTALLED_DIR})
+ set(OPENSSL_ROOT_DIR "$ENV{VCPKG_INSTALLED_DIR}/x64-windows" CACHE PATH "" FORCE)
+ elseif(DEFINED ENV{VCPKG_ROOT})
+ set(OPENSSL_ROOT_DIR "$ENV{VCPKG_ROOT}/installed/x64-windows" CACHE PATH "" FORCE)
+ elseif(EXISTS "C:/windowsdisk/fincept-cpp/vcpkg_installed/x64-windows")
+ set(OPENSSL_ROOT_DIR "C:/windowsdisk/fincept-cpp/vcpkg_installed/x64-windows" CACHE PATH "" FORCE)
+ endif()
+ endif()
+ # 3. GitHub Actions runners have OpenSSL pre-installed here
+ if(NOT OPENSSL_ROOT_DIR AND EXISTS "C:/Program Files/OpenSSL")
+ set(OPENSSL_ROOT_DIR "C:/Program Files/OpenSSL" CACHE PATH "" FORCE)
+ endif()
+ if(NOT OPENSSL_ROOT_DIR AND EXISTS "C:/Program Files/OpenSSL-Win64")
+ set(OPENSSL_ROOT_DIR "C:/Program Files/OpenSSL-Win64" CACHE PATH "" FORCE)
endif()
endif()
-message(STATUS "VCPKG_OPENSSL resolved to: ${VCPKG_OPENSSL}")
+
+find_package(OpenSSL REQUIRED)
+message(STATUS "OpenSSL found: ${OPENSSL_VERSION} — include: ${OPENSSL_INCLUDE_DIR}")
+
target_include_directories(FinceptTerminal PRIVATE
- "${VCPKG_OPENSSL}/include"
+ "${OPENSSL_INCLUDE_DIR}"
"${md4c_SOURCE_DIR}/src"
)
target_link_libraries(FinceptTerminal PRIVATE
@@ -1465,39 +1481,58 @@ target_link_libraries(FinceptTerminal PRIVATE
md4c-html
SingleApplication::SingleApplication
qtadvanceddocking-qt6
+ OpenSSL::SSL
+ OpenSSL::Crypto
)
-# OpenSSL — Windows only (from vcpkg). macOS uses system OpenSSL; Linux uses system packages.
-if(WIN32)
- target_link_libraries(FinceptTerminal PRIVATE
- "${VCPKG_OPENSSL}/lib/libcrypto.lib"
- "${VCPKG_OPENSSL}/lib/libssl.lib"
- )
-elseif(APPLE)
- # macOS Security.framework for Keychain in SecureStorage
- target_link_libraries(FinceptTerminal PRIVATE
- "-framework Security"
- )
- find_package(OpenSSL QUIET)
- if(OpenSSL_FOUND)
- target_link_libraries(FinceptTerminal PRIVATE OpenSSL::SSL OpenSSL::Crypto)
- endif()
-elseif(UNIX)
- find_package(OpenSSL REQUIRED)
- target_link_libraries(FinceptTerminal PRIVATE OpenSSL::SSL OpenSSL::Crypto)
+# macOS: also link Security.framework for Keychain in SecureStorage
+if(APPLE)
+ target_link_libraries(FinceptTerminal PRIVATE "-framework Security")
endif()
# Copy OpenSSL DLLs to build output — Windows only
if(WIN32)
- add_custom_command(TARGET FinceptTerminal POST_BUILD
- COMMAND ${CMAKE_COMMAND} -E copy_if_different
- "${VCPKG_OPENSSL}/bin/libcrypto-3-x64.dll"
- "$<TARGET_FILE_DIR:FinceptTerminal>/libcrypto-3-x64.dll"
- COMMAND ${CMAKE_COMMAND} -E copy_if_different
- "${VCPKG_OPENSSL}/bin/libssl-3-x64.dll"
- "$<TARGET_FILE_DIR:FinceptTerminal>/libssl-3-x64.dll"
- COMMENT "Copying OpenSSL DLLs..."
- )
+ get_target_property(OPENSSL_CRYPTO_DLL OpenSSL::Crypto IMPORTED_LOCATION)
+ get_target_property(OPENSSL_SSL_DLL OpenSSL::SSL IMPORTED_LOCATION)
+
+ # IMPORTED_LOCATION may point to the .lib on Windows — find the matching .dll
+ if(OPENSSL_CRYPTO_DLL MATCHES "\\.lib$" OR NOT OPENSSL_CRYPTO_DLL)
+ # Search common locations for the DLL
+ find_file(OPENSSL_CRYPTO_DLL_FILE
+ NAMES libcrypto-3-x64.dll libcrypto-3.dll libcrypto.dll
+ HINTS
+ "${OPENSSL_ROOT_DIR}/bin"
+ "$ENV{QT_ROOT_DIR}/bin"
+ "C:/Program Files/OpenSSL/bin"
+ "C:/Program Files/OpenSSL-Win64/bin"
+ )
+ find_file(OPENSSL_SSL_DLL_FILE
+ NAMES libssl-3-x64.dll libssl-3.dll libssl.dll
+ HINTS
+ "${OPENSSL_ROOT_DIR}/bin"
+ "$ENV{QT_ROOT_DIR}/bin"
+ "C:/Program Files/OpenSSL/bin"
+ "C:/Program Files/OpenSSL-Win64/bin"
+ )
+ else()
+ set(OPENSSL_CRYPTO_DLL_FILE "${OPENSSL_CRYPTO_DLL}")
+ set(OPENSSL_SSL_DLL_FILE "${OPENSSL_SSL_DLL}")
+ endif()
+
+ if(OPENSSL_CRYPTO_DLL_FILE AND OPENSSL_SSL_DLL_FILE)
+ add_custom_command(TARGET FinceptTerminal POST_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different
+ "${OPENSSL_CRYPTO_DLL_FILE}"
+ "$<TARGET_FILE_DIR:FinceptTerminal>"
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different
+ "${OPENSSL_SSL_DLL_FILE}"
+ "$<TARGET_FILE_DIR:FinceptTerminal>"
+ COMMENT "Copying OpenSSL DLLs..."
+ )
+ message(STATUS "OpenSSL DLLs to deploy: ${OPENSSL_CRYPTO_DLL_FILE}, ${OPENSSL_SSL_DLL_FILE}")
+ else()
+ message(WARNING "OpenSSL DLLs not found for POST_BUILD copy — deploy manually")
+ endif()
endif()
if(HAS_WEBSOCKETS)
diff --git a/fincept-qt/src/app/MainWindow.cpp b/fincept-qt/src/app/MainWindow.cpp
index d9e61f36d..5476a40d7 100644
--- a/fincept-qt/src/app/MainWindow.cpp
+++ b/fincept-qt/src/app/MainWindow.cpp
@@ -6,6 +6,10 @@
#include <DockManager.h>
#include <DockWidget.h>
#include <DockAreaWidget.h>
+#include <IconProvider.h>
+#include <ads_globals.h>
+#include <QPainter>
+#include <QPixmap>
#include "screens/chat_mode/ChatModeScreen.h"
#include "screens/auth/LockScreen.h"
@@ -712,6 +716,73 @@ void MainWindow::setup_docking_mode() {
dock_manager_ = new ads::CDockManager(dock_wrapper);
dock_layout->addWidget(dock_manager_);
+ // Register white ADS icons so they're visible on dark backgrounds.
+ // ADS uses QStyle::StandardPixmap (black system icons by default); CSS
+ // `color` has no effect on them — registerCustomIcon() is the only fix.
+ auto make_icon = [](std::function<void(QPainter&, const QRect&)> draw) -> QIcon {
+ QPixmap px(16, 16);
+ px.fill(Qt::transparent);
+ QPainter p(&px);
+ p.setRenderHint(QPainter::Antialiasing);
+ p.setPen(QPen(QColor("#b0b0b0"), 1.5, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin));
+ p.setBrush(Qt::NoBrush);
+ draw(p, QRect(3, 3, 10, 10));
+ p.end();
+ QIcon icon;
+ icon.addPixmap(px, QIcon::Normal);
+ // Hover: bright white version
+ QPixmap px_hover(16, 16);
+ px_hover.fill(Qt::transparent);
+ QPainter ph(&px_hover);
+ ph.setRenderHint(QPainter::Antialiasing);
+ ph.setPen(QPen(QColor("#e5e5e5"), 1.5, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin));
+ ph.setBrush(Qt::NoBrush);
+ draw(ph, QRect(3, 3, 10, 10));
+ ph.end();
+ icon.addPixmap(px_hover, QIcon::Active);
+ return icon;
+ };
+
+ // Close icon: × (two diagonal lines)
+ auto close_icon = make_icon([](QPainter& p, const QRect& r) {
+ p.drawLine(r.topLeft(), r.bottomRight());
+ p.drawLine(r.topRight(), r.bottomLeft());
+ });
+
+ // Menu/tabs icon: three horizontal lines (hamburger)
+ auto menu_icon = make_icon([](QPainter& p, const QRect& r) {
+ int y1 = r.top() + 1, y2 = r.center().y(), y3 = r.bottom() - 1;
+ p.drawLine(r.left(), y1, r.right(), y1);
+ p.drawLine(r.left(), y2, r.right(), y2);
+ p.drawLine(r.left(), y3, r.right(), y3);
+ });
+
+ // Undock/detach icon: arrow pointing out of a box
+ auto undock_icon = make_icon([](QPainter& p, const QRect& r) {
+ // small box bottom-left
+ QRect box(r.left(), r.top() + 4, r.width() - 4, r.height() - 4);
+ p.drawRect(box);
+ // arrow top-right
+ int ax = r.right(), ay = r.top();
+ p.drawLine(ax - 4, ay, ax, ay);
+ p.drawLine(ax, ay, ax, ay + 4);
+ p.drawLine(ax - 4, ay + 4, ax, ay);
+ });
+
+ // Minimize icon: horizontal bar at bottom
+ auto minimize_icon = make_icon([](QPainter& p, const QRect& r) {
+ int y = r.bottom() - 1;
+ p.drawLine(r.left(), y, r.right(), y);
+ });
+
+ auto& ip = ads::CDockManager::iconProvider();
+ ip.registerCustomIcon(ads::TabCloseIcon, close_icon);
+ ip.registerCustomIcon(ads::DockAreaCloseIcon, close_icon);
+ ip.registerCustomIcon(ads::DockAreaMenuIcon, menu_icon);
+ ip.registerCustomIcon(ads::DockAreaUndockIcon, undock_icon);
+ ip.registerCustomIcon(ads::DockAreaMinimizeIcon, minimize_icon);
+ ip.registerCustomIcon(ads::AutoHideIcon, minimize_icon);
+
// ADS styling is handled by ThemeManager's global QSS — no widget-level
// stylesheet needed here. The global QSS has higher priority and won't be
// overridden by theme changes.
diff --git a/fincept-qt/src/screens/equity_trading/EquityTradingScreen.cpp b/fincept-qt/src/screens/equity_trading/EquityTradingScreen.cpp
index 5edc6a927..374566a27 100644
--- a/fincept-qt/src/screens/equity_trading/EquityTradingScreen.cpp
+++ b/fincept-qt/src/screens/equity_trading/EquityTradingScreen.cpp
@@ -1056,19 +1056,23 @@ void EquityTradingScreen::on_mode_toggled() {
}
void EquityTradingScreen::handle_token_expired() {
- // Guard: only show one re-auth prompt at a time
+ // Guard: only update the status label once — do NOT auto-open the dialog.
+ // Polling timers keep firing TOKEN_EXPIRED errors; opening the dialog from here
+ // creates an infinite re-auth loop every time the user closes without connecting.
+ // The user must click "API KEYS" manually to re-authenticate.
bool expected = false;
if (!token_expired_shown_.compare_exchange_strong(expected, true))
return;
- conn_label_->setText("⚠ TOKEN EXPIRED");
+ conn_label_->setText("⚠ TOKEN EXPIRED — click API KEYS");
conn_label_->setStyleSheet(QString("color: %1; font-size: 10px; font-weight: 700;").arg(ui::colors::NEGATIVE));
- LOG_WARN(TAG, QString("Access token expired for broker %1 — prompting re-auth").arg(broker_id_));
+ LOG_WARN(TAG, QString("Access token expired for broker %1 — user must re-authenticate via API KEYS button").arg(broker_id_));
- // Re-open the credentials dialog so the user can paste a new request_token
- on_api_clicked();
-
- token_expired_shown_.store(false);
+ // Stop polling timers to avoid flooding the broker with failing requests
+ if (quote_timer_) quote_timer_->stop();
+ if (watchlist_timer_) watchlist_timer_->stop();
+ if (portfolio_timer_) portfolio_timer_->stop();
+ // token_expired_shown_ stays true until successful auth resets it in on_api_clicked
}
void EquityTradingScreen::on_api_clicked() {
@@ -1127,6 +1131,18 @@ void EquityTradingScreen::on_api_clicked() {
if (dlg_ptr)
dlg_ptr->mark_connected(token_result.additional_data, acct);
+ // Reset token-expired guard and restart polling timers that
+ // were stopped by handle_token_expired()
+ self->token_expired_shown_.store(false);
+ if (self->isVisible()) {
+ const bool use_polling = !self->ws_active();
+ if (use_polling) {
+ if (self->quote_timer_) self->quote_timer_->start();
+ if (self->watchlist_timer_) self->watchlist_timer_->start();
+ }
+ if (self->portfolio_timer_) self->portfolio_timer_->start();
+ }
+
// (Re)start WebSocket with fresh credentials
self->ws_teardown();
self->ws_init();