Switched to new cleaner argument system

This commit is contained in:
AlexandreRouma
2022-02-24 20:49:53 +01:00
parent 5c138aa4a5
commit 2779516378
50 changed files with 777 additions and 205 deletions

View File

@ -1,11 +1,12 @@
#include <gui/widgets/file_select.h>
#include <regex>
#include <options.h>
#include <filesystem>
#include <gui/file_dialogs.h>
#include <core.h>
FileSelect::FileSelect(std::string defaultPath, std::vector<std::string> filter) {
_filter = filter;
root = core::args["root"];
setPath(defaultPath);
}
@ -54,7 +55,7 @@ void FileSelect::setPath(std::string path, bool markChanged) {
}
std::string FileSelect::expandString(std::string input) {
input = std::regex_replace(input, std::regex("%ROOT%"), options::opts.root);
input = std::regex_replace(input, std::regex("%ROOT%"), root);
return std::regex_replace(input, std::regex("//"), "/");
}

View File

@ -22,6 +22,7 @@ private:
void worker();
std::thread workerThread;
std::vector<std::string> _filter;
std::string root = "";
bool pathValid = false;
bool dialogOpen = false;

View File

@ -1,10 +1,11 @@
#include <gui/widgets/folder_select.h>
#include <regex>
#include <options.h>
#include <filesystem>
#include <gui/file_dialogs.h>
#include <core.h>
FolderSelect::FolderSelect(std::string defaultPath) {
root = core::args["root"];
setPath(defaultPath);
}
@ -53,7 +54,7 @@ void FolderSelect::setPath(std::string path, bool markChanged) {
}
std::string FolderSelect::expandString(std::string input) {
input = std::regex_replace(input, std::regex("%ROOT%"), options::opts.root);
input = std::regex_replace(input, std::regex("%ROOT%"), root);
return std::regex_replace(input, std::regex("//"), "/");
}

View File

@ -20,6 +20,7 @@ public:
private:
void worker();
std::thread workerThread;
std::string root = "";
bool pathValid = false;
bool dialogOpen = false;