mirror of
https://github.com/AlexandreRouma/SDRPlusPlus.git
synced 2025-06-25 12:07:49 +02:00
Added persistant config for file source
This commit is contained in:
@ -45,10 +45,11 @@ bool FileSelect::render(std::string id) {
|
||||
return _pathChanged;
|
||||
}
|
||||
|
||||
void FileSelect::setPath(std::string path) {
|
||||
void FileSelect::setPath(std::string path, bool markChanged) {
|
||||
this->path = path;
|
||||
std::string expandedPath = expandString(path);
|
||||
pathValid = std::filesystem::is_regular_file(expandedPath);
|
||||
if (markChanged) { pathChanged = true; }
|
||||
strcpy(strPath, path.c_str());
|
||||
}
|
||||
|
||||
|
@ -10,7 +10,7 @@ class FileSelect {
|
||||
public:
|
||||
FileSelect(std::string defaultPath, std::vector<std::string> filter = {"All Files", "*"});
|
||||
bool render(std::string id);
|
||||
void setPath(std::string path);
|
||||
void setPath(std::string path, bool markChanged = false);
|
||||
bool pathIsValid();
|
||||
|
||||
std::string expandString(std::string input);
|
||||
|
@ -44,10 +44,11 @@ bool FolderSelect::render(std::string id) {
|
||||
return _pathChanged;
|
||||
}
|
||||
|
||||
void FolderSelect::setPath(std::string path) {
|
||||
void FolderSelect::setPath(std::string path, bool markChanged) {
|
||||
this->path = path;
|
||||
std::string expandedPath = expandString(path);
|
||||
pathValid = std::filesystem::is_directory(expandedPath);
|
||||
if (markChanged) { pathChanged = true; }
|
||||
strcpy(strPath, path.c_str());
|
||||
}
|
||||
|
||||
|
@ -9,7 +9,7 @@ class FolderSelect {
|
||||
public:
|
||||
FolderSelect(std::string defaultPath);
|
||||
bool render(std::string id);
|
||||
void setPath(std::string path);
|
||||
void setPath(std::string path, bool markChanged = false);
|
||||
bool pathIsValid();
|
||||
|
||||
std::string expandString(std::string input);
|
||||
|
Reference in New Issue
Block a user