From df1b3c4275c5904a3f3e9dc92a3bcc84b79c67e9 Mon Sep 17 00:00:00 2001 From: Serein <2075337935@qq.com> Date: Wed, 7 Aug 2024 18:32:49 +0800 Subject: [PATCH] build(deps): remove traypp BREAKING CHANGE: completely delete `SystemTray` --- CMakeLists.txt | 2 -- src/CMakeLists.txt | 1 - src/Infrastructure/Tray/SystemTray.h | 44 ---------------------------- src/main.cc | 5 +--- 4 files changed, 1 insertion(+), 51 deletions(-) delete mode 100644 src/Infrastructure/Tray/SystemTray.h diff --git a/CMakeLists.txt b/CMakeLists.txt index ccd1f45f..50a4750d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -66,8 +66,6 @@ endif() add_subdirectory(src) # sast-link-sdk add_subdirectory(3rdpart/sast-link-cxx-sdk) -# traypp -add_subdirectory(3rdpart/traypp EXCLUDE_FROM_ALL) # credential storage set(BUILD_SHARED_LIBS OFF) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b690db56..ee023205 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -45,7 +45,6 @@ target_link_libraries(${PROJECT_NAME} keychain Slint::Slint version::version - tray ) # On Windows, copy the Slint DLL next to the application binary so that it's found. diff --git a/src/Infrastructure/Tray/SystemTray.h b/src/Infrastructure/Tray/SystemTray.h deleted file mode 100644 index 4ef9aa6d..00000000 --- a/src/Infrastructure/Tray/SystemTray.h +++ /dev/null @@ -1,44 +0,0 @@ -#pragma once - -#include -#include -#include -#include -#include - -namespace evento { - -class SystemTray { -public: - SystemTray(slint::ComponentWeakHandle uiWeak) - : _tray("Evento Tray", "./app.ico") { - std::thread trayThread([&] { - _tray.addEntry(Tray::Button("显示", [&] { - auto ui = *uiWeak.lock(); - ui->show(); - })); - _tray.addEntry(Tray::Button("关于", [&] { - //TODO: switch to about page - })); - _tray.addEntry(Tray::Button("退出", [&] { - spdlog::info("exiting SAST Evento..."); - _tray.exit(); - slint::quit_event_loop(); - _isRunning = false; - })); - _tray.run(); - }); - trayThread.detach(); - } - ~SystemTray() { - if (_isRunning) { - _tray.exit(); - } - } - -private: - Tray::Tray _tray; - bool _isRunning = true; -}; - -} // namespace evento \ No newline at end of file diff --git a/src/main.cc b/src/main.cc index c24d7159..1ee2c574 100644 --- a/src/main.cc +++ b/src/main.cc @@ -1,5 +1,4 @@ #include -#include #include #include #include @@ -17,8 +16,6 @@ int main(int argc, char** argv) { auto uiEntry = App::create(); uiEntry->global().on_link_login(start_sast_link); uiEntry->global().set_version("v" VERSION_FULL); - uiEntry->show(); - evento::SystemTray tray(uiEntry); - slint::run_event_loop(slint::EventLoopMode::RunUntilQuit); + uiEntry->run(); evento::saveConfig(); } \ No newline at end of file