diff --git a/juci/notebook.cc b/juci/notebook.cc index 3590d49..6992658 100644 --- a/juci/notebook.cc +++ b/juci/notebook.cc @@ -719,7 +719,6 @@ bool Notebook::Controller::LegalExtension(std::string e) { std::transform(e.begin(), e.end(),e.begin(), ::tolower); std::vector extensions = source_config().extensiontable(); - std::cout << e << std::endl; if (find(extensions.begin(), extensions.end(), e) != extensions.end()) { DEBUG("Legal extension"); return true; diff --git a/juci/terminal.cc b/juci/terminal.cc index 98971c2..beab086 100644 --- a/juci/terminal.cc +++ b/juci/terminal.cc @@ -4,6 +4,18 @@ #include "logging.h" +Terminal::Config::Config() { +} +Terminal::Config::Config(Terminal::Config& original) { + for (auto it = 0; original.compile_commands().size(); ++it) { + InsertCompileCommand(original.compile_commands().at(it)); + } +} + +void Terminal::Config::InsertCompileCommand(std::string command){ + compile_commands_.push_back(command); +} + Terminal::View::View(){ scrolledwindow_.add(textview_); scrolledwindow_.set_size_request(-1,150); @@ -27,13 +39,18 @@ void Terminal::Controller::Compile(){ INFO("Terminal: Compile"); Terminal().get_buffer()->set_text(""); DEBUG("Terminal: Compile: running cmake command"); - ExecuteCommand("rm -rf ./build", "r"); - ExecuteCommand("mkdir ./build", "r"); - ExecuteCommand("cmake -B./build -H.", "r"); - if (ExistInConsole(cmake_sucsess)){ - DEBUG("Terminal: Compile: running make command"); - ExecuteCommand("cd ./build/; make", "r"); + std::vector commands = config().compile_commands(); + for (auto it = 0; it < commands.size(); ++it) { + ExecuteCommand(commands.at(it), "r"); + } + // ExecuteCommand("rm -rf ./.build", "r"); + // ExecuteCommand("mkdir ./.build", "r"); + // ExecuteCommand("cmake -B./build -H.", "r"); + // if (ExistInConsole(cmake_sucsess)){ + // DEBUG("Terminal: Compile: running make command"); + // ExecuteCommand("cd ./.build/; make", "r"); + // } PrintMessage("\n"); DEBUG("Terminal: Compile: compile done"); } diff --git a/juci/terminal.h b/juci/terminal.h index a3fa6a6..4caa429 100644 --- a/juci/terminal.h +++ b/juci/terminal.h @@ -7,6 +7,16 @@ namespace Terminal { + class Config { + public: + Config (); + Config(Terminal::Config& original); + std::vector& compile_commands() {return &compile_commands_;} + void InsertCompileCommand(std::string command); + private: + std::vector compile_commands_; + }; + class View { public: View();