mirror of
https://github.com/AlexandreRouma/SDRPlusPlus.git
synced 2025-06-28 21:37:50 +02:00
Switched to new cleaner argument system
This commit is contained in:
@ -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("//"), "/");
|
||||
}
|
||||
|
||||
|
@ -22,6 +22,7 @@ private:
|
||||
void worker();
|
||||
std::thread workerThread;
|
||||
std::vector<std::string> _filter;
|
||||
std::string root = "";
|
||||
|
||||
bool pathValid = false;
|
||||
bool dialogOpen = false;
|
||||
|
@ -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("//"), "/");
|
||||
}
|
||||
|
||||
|
@ -20,6 +20,7 @@ public:
|
||||
private:
|
||||
void worker();
|
||||
std::thread workerThread;
|
||||
std::string root = "";
|
||||
|
||||
bool pathValid = false;
|
||||
bool dialogOpen = false;
|
||||
|
Reference in New Issue
Block a user