Refakturiert die Anwendung und modernisiert das Build-System
Diese umfangreiche Überarbeitung verbessert die Architektur, den Build-Prozess und die Benutzeroberfläche der Toolbox. Wesentliche Änderungen: - **Build-System:** Umfassende Modernisierung des CMake-Builds für verbesserte Stabilität und Wartbarkeit. Die Konfiguration wurde auf zielbasierte Befehle umgestellt, `c_tray` stabilisiert und `saucer-desktop` entfernt. - **Modulare Architektur:** Die Kernlogik von `ToolboxWindow` wurde in dedizierte Helferklassen ausgelagert, darunter `LuaRunner` für die Skriptausführung, `ToolRegistry` für die Tool-Erkennung, `ResourceLoader` für UI-Ressourcen, `ToolboxJsBridge` für JavaScript-Bindungen und `WindowPlacement` für die Fensterverwaltung. Dies reduziert die Komplexität und fördert die Wiederverwendbarkeit. - **Benutzeroberfläche (UI):** Die HTML-Templates (`einstellungen_custom.html`, `index.html`) und Stylesheets (`styles.css`) wurden zentralisiert und überarbeitet, um eine kohärentere Benutzeroberfläche mit benutzerdefinierten Fensterdekorationen zu bieten. Neue Funktionen wie das Öffnen der Kommandozeile und eine "Tool hinzufügen"-Karte wurden integriert. - **Tray-Verwaltung:** Die Tray-Icon-Logik wurde in `TrayController` gekapselt, um eine robustere und zentralisierte Steuerung zu ermöglichen, insbesondere im Umgang mit Explorer-Neustarts.
This commit is contained in:
@@ -2,14 +2,15 @@
|
||||
|
||||
#include <saucer/smartview.hpp>
|
||||
#include "modules/hwnd_module.h"
|
||||
#include <saucer/embedded/all.hpp>
|
||||
#include <sol/sol.hpp>
|
||||
#include <saucer/webview.hpp>
|
||||
#include <unordered_map>
|
||||
#include <mutex>
|
||||
#include <chrono>
|
||||
#include "luaRunner.h"
|
||||
#include "optionWindow.h"
|
||||
#include "resourceLoader.h"
|
||||
#include "toolConfig.h"
|
||||
#include "toolboxJsBridge.h"
|
||||
#include "toolRegistry.h"
|
||||
#include "windowPlacement.h"
|
||||
|
||||
class ToolboxWindow {
|
||||
public:
|
||||
@@ -30,20 +31,6 @@ public:
|
||||
|
||||
std::atomic_bool isIndex = true;
|
||||
|
||||
struct ToolboxItem{
|
||||
std::string id;
|
||||
std::string name;
|
||||
std::string path;
|
||||
std::string icon;
|
||||
std::string lua_script_path_string;
|
||||
std::string description;
|
||||
std::string category;
|
||||
std::string version;
|
||||
std::string author;
|
||||
std::string url;
|
||||
std::string license;
|
||||
};
|
||||
|
||||
std::vector<ToolboxItem> m_toolboxItems;
|
||||
|
||||
saucer::smartview m_webview;
|
||||
@@ -60,8 +47,6 @@ private:
|
||||
|
||||
std::string jsonString;
|
||||
|
||||
int size_x,size_y;
|
||||
|
||||
#ifdef _WIN32
|
||||
std::filesystem::path userPath = std::getenv("USERPROFILE"); // Windows
|
||||
#else
|
||||
@@ -75,7 +60,6 @@ private:
|
||||
void configureWindow();
|
||||
void moveWindowTo(int x, int y);
|
||||
void loadResources();
|
||||
void runLuaScript();
|
||||
|
||||
void ExposeToJs();
|
||||
|
||||
@@ -92,6 +76,8 @@ private:
|
||||
|
||||
void open_file_system();
|
||||
|
||||
void open_cmd();
|
||||
|
||||
void SetJsonItems();
|
||||
|
||||
void openEinst();
|
||||
@@ -107,14 +93,8 @@ private:
|
||||
void setLuaTimeoutSeconds(int seconds);
|
||||
std::string getActiveToolName();
|
||||
|
||||
struct LuaTask {
|
||||
std::shared_ptr<std::atomic_bool> cancel;
|
||||
};
|
||||
|
||||
std::mutex m_luaTasksMutex;
|
||||
std::unordered_map<int, LuaTask> m_luaTasks;
|
||||
|
||||
int m_activeToolId = -1;
|
||||
LuaRunner m_luaRunner;
|
||||
ToolConfigStore m_configStore;
|
||||
|
||||
std::filesystem::path getToolConfigPath(int id) const;
|
||||
|
||||
Reference in New Issue
Block a user