Skip to content
Snippets Groups Projects
Commit 3f0e4962 authored by Nicolas Pope's avatar Nicolas Pope
Browse files

Fixes to restore locations and gui refresh

parent 72737e56
No related branches found
No related tags found
1 merge request!316Resolves #343 GUI and Frame Refactor
Pipeline #28161 passed
......@@ -27,7 +27,9 @@ AddSourceWindow::AddSourceWindow(nanogui::Widget* parent, AddCtrl *ctrl) :
rebuild();
new_source_handle_ = ctrl_->feed()->onNewSources([this](int a) {
while(childCount() > 0) { removeChild(childCount()-1); }
UNIQUE_LOCK(mutex_, lk);
// Note the 1, first widget is the title bar buttons
while(childCount() > 1) { removeChild(childCount()-1); }
rebuild();
screen()->performLayout();
return true;
......
......@@ -2,6 +2,7 @@
#include <nanogui/window.h>
#include <ftl/handle.hpp>
#include <ftl/threads.hpp>
namespace ftl {
......@@ -25,6 +26,7 @@ private:
void rebuild();
ftl::Handle new_source_handle_;
MUTEX mutex_;
public:
// EIGEN_MAKE_ALIGNED_OPERATOR_NEW
......
......@@ -242,6 +242,7 @@ static std::map<std::string, ftl::Configurable*> config_instance;
static std::map<std::string, ftl::Configurable*> config_alias;
static std::map<std::string, std::vector<ftl::Configurable*>> tag_index;
static std::string cfg_root_str;
static nlohmann::json config_restore;
static nlohmann::json config_defaults;
......@@ -667,7 +668,7 @@ void ftl::config::cleanup() {
}
config_instance.clear();
ftl::saveJSON(FTL_LOCAL_CONFIG_ROOT "/session.json", config_restore);
ftl::saveJSON(std::string(FTL_LOCAL_CONFIG_ROOT "/")+cfg_root_str+std::string("_session.json"), config_restore);
doing_cleanup = false;
}
......@@ -839,11 +840,12 @@ Configurable *ftl::config::configure(int argc, char **argv, const std::string &r
}
string root_str = (options.find("root") != options.end()) ? nlohmann::json::parse(options["root"]).get<string>() : root;
cfg_root_str = root_str;
if (options.find("id") != options.end()) config["$id"] = nlohmann::json::parse(options["id"]).get<string>();
_indexConfig(config);
config_restore = std::move(ftl::loadJSON(FTL_LOCAL_CONFIG_ROOT "/session.json"));
config_restore = std::move(ftl::loadJSON(std::string(FTL_LOCAL_CONFIG_ROOT "/")+cfg_root_str+std::string("_session.json")));
Configurable *rootcfg = create<Configurable>(config);
if (root_str.size() > 0) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment