refactor: Update Doxyfile and resource paths for improved organization
- Changed the paths for project logo and icon in Doxyfile to point to the new assets directory. - Updated CMake configurations to reflect the new locations of resource files, enhancing clarity and maintainability. - Replaced instances of core utility functions with util functions across various files for consistency in file handling. - Added new resource files for Windows platform support and removed obsolete resource files, streamlining the build process.
This commit is contained in:
@@ -1649,7 +1649,7 @@ void AgentChatWidget::RenderSystemPromptEditor() {
|
||||
// Toolbar
|
||||
if (ImGui::Button(ICON_MD_FOLDER_OPEN " Load V1")) {
|
||||
// Load embedded system_prompt.txt (v1)
|
||||
std::string prompt_v1 = core::LoadFile("assets/agent/system_prompt.txt");
|
||||
std::string prompt_v1 = util::LoadFile("assets/agent/system_prompt.txt");
|
||||
if (!prompt_v1.empty()) {
|
||||
// Find or create system prompt tab
|
||||
bool found = false;
|
||||
@@ -1685,7 +1685,7 @@ void AgentChatWidget::RenderSystemPromptEditor() {
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Button(ICON_MD_FOLDER_OPEN " Load V2")) {
|
||||
// Load embedded system_prompt_v2.txt
|
||||
std::string prompt_v2 = core::LoadFile("assets/agent/system_prompt_v2.txt");
|
||||
std::string prompt_v2 = util::LoadFile("assets/agent/system_prompt_v2.txt");
|
||||
if (!prompt_v2.empty()) {
|
||||
// Find or create system prompt tab
|
||||
bool found = false;
|
||||
@@ -1730,7 +1730,7 @@ void AgentChatWidget::RenderSystemPromptEditor() {
|
||||
if (file.is_open()) {
|
||||
file << tab.editor.GetText();
|
||||
tab.filepath = save_path;
|
||||
tab.filename = core::GetFileName(save_path);
|
||||
tab.filename = util::GetFileName(save_path);
|
||||
tab.modified = false;
|
||||
if (toast_manager_) {
|
||||
toast_manager_->Show(absl::StrFormat("System prompt saved to %s", save_path),
|
||||
@@ -1771,7 +1771,7 @@ void AgentChatWidget::RenderSystemPromptEditor() {
|
||||
buffer << file.rdbuf();
|
||||
tab.editor.SetText(buffer.str());
|
||||
tab.filepath = filepath;
|
||||
tab.filename = core::GetFileName(filepath);
|
||||
tab.filename = util::GetFileName(filepath);
|
||||
tab.modified = false;
|
||||
found = true;
|
||||
break;
|
||||
@@ -1780,7 +1780,7 @@ void AgentChatWidget::RenderSystemPromptEditor() {
|
||||
|
||||
if (!found) {
|
||||
FileEditorTab tab;
|
||||
tab.filename = core::GetFileName(filepath);
|
||||
tab.filename = util::GetFileName(filepath);
|
||||
tab.filepath = filepath;
|
||||
tab.is_system_prompt = true;
|
||||
tab.editor.SetLanguageDefinition(TextEditor::LanguageDefinition::CPlusPlus());
|
||||
@@ -2042,7 +2042,7 @@ void AgentChatWidget::LoadAgentSettingsFromProject(const core::YazeProject& proj
|
||||
buffer << file.rdbuf();
|
||||
tab.editor.SetText(buffer.str());
|
||||
tab.filepath = prompt_path;
|
||||
tab.filename = core::GetFileName(prompt_path);
|
||||
tab.filename = util::GetFileName(prompt_path);
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
@@ -2050,7 +2050,7 @@ void AgentChatWidget::LoadAgentSettingsFromProject(const core::YazeProject& proj
|
||||
|
||||
if (!found) {
|
||||
FileEditorTab tab;
|
||||
tab.filename = core::GetFileName(prompt_path);
|
||||
tab.filename = util::GetFileName(prompt_path);
|
||||
tab.filepath = prompt_path;
|
||||
tab.is_system_prompt = true;
|
||||
tab.editor.SetLanguageDefinition(TextEditor::LanguageDefinition::CPlusPlus());
|
||||
|
||||
@@ -76,7 +76,7 @@ std::string GetEditorName(EditorType type) {
|
||||
// Settings + preset helpers
|
||||
void EditorManager::LoadUserSettings() {
|
||||
try {
|
||||
auto data = core::LoadConfigFile(settings_filename_);
|
||||
auto data = util::LoadConfigFile(settings_filename_);
|
||||
if (!data.empty()) {
|
||||
std::istringstream ss(data);
|
||||
std::string line;
|
||||
@@ -103,7 +103,7 @@ void EditorManager::SaveUserSettings() {
|
||||
ss << "font_global_scale=" << font_global_scale_ << "\n";
|
||||
ss << "autosave_enabled=" << (autosave_enabled_ ? 1 : 0) << "\n";
|
||||
ss << "autosave_interval_secs=" << autosave_interval_secs_ << "\n";
|
||||
core::SaveFile(settings_filename_, ss.str());
|
||||
util::SaveFile(settings_filename_, ss.str());
|
||||
}
|
||||
|
||||
void EditorManager::RefreshWorkspacePresets() {
|
||||
@@ -114,7 +114,7 @@ void EditorManager::RefreshWorkspacePresets() {
|
||||
|
||||
// Try to read a simple index file of presets
|
||||
try {
|
||||
auto data = core::LoadConfigFile("workspace_presets.txt");
|
||||
auto data = util::LoadConfigFile("workspace_presets.txt");
|
||||
if (!data.empty()) {
|
||||
std::istringstream ss(data);
|
||||
std::string name;
|
||||
@@ -164,7 +164,7 @@ void EditorManager::SaveWorkspacePreset(const std::string& name) {
|
||||
std::ostringstream ss;
|
||||
for (const auto& n : workspace_presets_)
|
||||
ss << n << "\n";
|
||||
core::SaveFile("workspace_presets.txt", ss.str());
|
||||
util::SaveFile("workspace_presets.txt", ss.str());
|
||||
} catch (const std::exception& e) {
|
||||
LOG_WARN("EditorManager", "Failed to save workspace presets: %s", e.what());
|
||||
}
|
||||
@@ -1454,7 +1454,7 @@ void EditorManager::DrawMenuBar() {
|
||||
|
||||
ImGui::TableNextRow();
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::Text("%s", core::GetFileName(file).c_str());
|
||||
ImGui::Text("%s", util::GetFileName(file).c_str());
|
||||
|
||||
ImGui::TableNextColumn();
|
||||
std::string ext = core::GetFileExtension(file);
|
||||
|
||||
@@ -263,7 +263,7 @@ absl::Status ThemeManager::LoadThemeFromFile(const std::string& filepath) {
|
||||
filepath, // Absolute path
|
||||
"assets/themes/" + filepath, // Relative from build dir
|
||||
"../assets/themes/" + filepath, // Relative from bin dir
|
||||
core::GetResourcePath("assets/themes/" + filepath), // Platform-specific resource path
|
||||
util::GetResourcePath("assets/themes/" + filepath), // Platform-specific resource path
|
||||
};
|
||||
|
||||
std::ifstream file;
|
||||
@@ -1898,13 +1898,13 @@ std::vector<std::string> ThemeManager::GetThemeSearchPaths() const {
|
||||
// Platform-specific resource paths
|
||||
#ifdef __APPLE__
|
||||
// macOS bundle resource path (this should be the primary path for bundled apps)
|
||||
std::string bundle_themes = core::GetResourcePath("assets/themes/");
|
||||
std::string bundle_themes = util::GetResourcePath("assets/themes/");
|
||||
if (!bundle_themes.empty()) {
|
||||
search_paths.push_back(bundle_themes);
|
||||
}
|
||||
|
||||
// Alternative bundle locations
|
||||
std::string bundle_root = core::GetBundleResourcePath();
|
||||
std::string bundle_root = util::GetBundleResourcePath();
|
||||
|
||||
search_paths.push_back(bundle_root + "Contents/Resources/themes/");
|
||||
search_paths.push_back(bundle_root + "Contents/Resources/assets/themes/");
|
||||
@@ -1917,7 +1917,7 @@ std::vector<std::string> ThemeManager::GetThemeSearchPaths() const {
|
||||
#endif
|
||||
|
||||
// User config directory
|
||||
std::string config_themes = core::GetConfigDirectory() + "/themes/";
|
||||
std::string config_themes = util::GetConfigDirectory() + "/themes/";
|
||||
search_paths.push_back(config_themes);
|
||||
|
||||
return search_paths;
|
||||
|
||||
1
src/app/platform/win32/yaze.rc
Normal file
1
src/app/platform/win32/yaze.rc
Normal file
@@ -0,0 +1 @@
|
||||
IDI_ICON1 ICON DISCARDABLE "yaze.ico"
|
||||
Reference in New Issue
Block a user