Skip to content

Commit

Permalink
feat: reimplement old wins
Browse files Browse the repository at this point in the history
  • Loading branch information
diegomrno committed Oct 11, 2024
1 parent 0f18271 commit 48471e1
Show file tree
Hide file tree
Showing 40 changed files with 5,754 additions and 5,122 deletions.
257 changes: 0 additions & 257 deletions bootstrapp.cpp

This file was deleted.

4 changes: 4 additions & 0 deletions build/handle_crash.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,15 @@ EXIT_CODE=$?

if [ $EXIT_CODE -ne 0 ]; then
CORE_FILE=$(ls /tmp/core.vortex.* 2>/dev/null | head -n 1)

if [ -f "$CORE_FILE" ]; then
echo "Vortex Fatal error handling found a core dump: $CORE_FILE"
echo "==== COREDUMP BEGIN ===="
gdb -batch -ex "bt" -ex "info registers" -ex "list" "$1" "$CORE_FILE" > "$OUTPUT_FILE"
echo "==== COREDUMP END ===="

rm -f "$CORE_FILE"
echo "Core dump $CORE_FILE has been removed."
else
echo "Vortex Fatal error handling found nothing :("
fi
Expand Down
28 changes: 22 additions & 6 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <fstream>

// UI instances
#include "./ui/editor/app/include/editor.h"
#include "./ui/editor/app/src/editor.hpp"
#include "./ui/crash_handler/crash_handler.hpp"

#include "./main/include/vortex.h"
Expand All @@ -14,6 +14,25 @@

static std::string session_id = "unknow";

/*
TODO : Parent process for vortex executables regitered in /usr/local/bin/Vortex/VERSION/vortex
This command can detect the version of a project and execute the correspondant project.
Usage :
vortex -e --version=1.1 -> Execute a project editor 1.1 in the directory of a project
vortex -e --version=1.1 --contained=docker -> Execute a project editor 1.1 in the directory of a project in a docker container
vortex -e --version=1.1 --templates_path=PATH -> With a template path preset
vortex -e --version=1.1 --projects_path=PATH -> With a project path preset
vortex -l --version=1.1 -> Execute a launcher with vortex 1.1
Before lauching everything, this process can detect all version registered in the system by checking /usr/local/bin and run healthy command
*/
void PrintInfinite()
{
std::cout << R"(
Expand Down Expand Up @@ -127,18 +146,15 @@ VxContext *InitRuntime(bool logger)
VortexMaker::LoadSystemTemplates(ctx->IO.sys_templates);

std::ifstream file("vortex.config");
std::cout << "Qsd" << std::endl;

if (file)
{
nlohmann::json jsonContenu;
file >> jsonContenu;
VortexMaker::InitProject(jsonContenu);
}
else
{
//
}


return ctx;
}
// Project sys size== 0
Expand Down
1 change: 1 addition & 0 deletions main/include/vortex.h
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ namespace VortexMaker

VORTEX_API void CreateProject(const std::string &name, const std::string &path);
VORTEX_API void CreateProject(const std::string &name, const std::string &author, const std::string &version, const std::string &description, const std::string &path, const std::string& logo_path, const std::string &template_name);
VORTEX_API void RefreshEnvironmentVortexVersionsPools();

VORTEX_API void DeleteProject(const std::string &path, const std::string& project_name);
VORTEX_API void RemoveSystemProjectEntry(const std::string& project_name);
Expand Down
7 changes: 7 additions & 0 deletions main/include/vortex_internals.h
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,13 @@ struct VxIO
std::vector<std::shared_ptr<TemplateInterface>> templates;
std::vector<std::shared_ptr<TemplateInterface>> sys_templates;

// Pools
std::vector<std::string> sys_projects_pools;
std::vector<std::string> sys_vortex_versions_pools;
std::vector<std::string> sys_modules_pools;
std::vector<std::string> sys_templates_pools;
std::vector<std::string> sys_plugins_pools;

// Content browser items
std::vector<std::shared_ptr<ContenBrowserItem>> contentbrowser_items;
std::vector<std::shared_ptr<ContentBrowserCustomFolder>> contentbrowser_customfolders;
Expand Down
29 changes: 29 additions & 0 deletions main/src/vortex/environment/environment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,35 @@ VORTEX_API void VortexMaker::RefreshEnvironmentProjects()
}
}

VORTEX_API void VortexMaker::RefreshEnvironmentVortexVersionsPools()
{
// Get reference to the Vortex context
VxContext &ctx = *CVortexMaker;

std::string path = VortexMaker::getHomeDirectory() + "/.vx/configs/";

std::string json_file = path + "/vortex_versions_pools.json";

// Clear project list
ctx.IO.sys_vortex_versions_pools.clear();

// Verify if the project is valid
try
{
// Load JSON data from the project configuration file
auto json_data = VortexMaker::DumpJSON(json_file);
for (auto pool : json_data["vortex_versions_pools"])
{
ctx.IO.sys_vortex_versions_pools.push_back(pool);
}
}
catch (const std::exception &e)
{
// Print error if an exception occurs
VortexMaker::LogError("Error: ", e.what());
}
}

VORTEX_API void VortexMaker::UpdateEnvironmentProject(const std::string &name, const std::string &author, const std::string &version, const std::string &compatibleWith, const std::string &description, const std::string &path, const std::string &logo_path, const std::string &template_name)
{ // Get reference to the Vortex context
VxContext &ctx = *CVortexMaker;
Expand Down
Loading

0 comments on commit 48471e1

Please sign in to comment.