Open new tab for new Tool automatically
parent
a0d4a3ac90
commit
8ba77d3b39
|
@ -2,3 +2,4 @@
|
|||
/build/
|
||||
/sir/
|
||||
/builds/
|
||||
/_build
|
||||
|
|
|
@ -111,9 +111,11 @@ namespace sirEdit::data {
|
|||
return this->serializer;
|
||||
}
|
||||
|
||||
void addTool(Tool tool) {
|
||||
this->serializer.addTool(new Tool(std::move(tool)));
|
||||
const Tool* addTool(Tool tool) {
|
||||
Tool* tmp = new Tool(std::move(tool));
|
||||
this->serializer.addTool(tmp);
|
||||
updateCall(this->change_callback);
|
||||
return tmp;
|
||||
}
|
||||
void setFieldStatus(const Tool& tool, const Type& type, const Field& field, FIELD_STATE state, const std::function<void(const Type&, const Field&, FIELD_STATE, FIELD_STATE)>& callback_field, const std::function<void(const Type&, TYPE_STATE, TYPE_STATE)>& callback_type) {
|
||||
// Set state
|
||||
|
|
|
@ -270,8 +270,8 @@ class MainWindow {
|
|||
// Dialog finished
|
||||
toolFinish->signal_clicked().connect([this, newToolDialog, toolName, toolDescription, toolCommand]() -> void {
|
||||
newToolDialog->hide();
|
||||
this->__transitions.addTool({toolName->get_text(), toolDescription->get_buffer()->get_text(), toolCommand->get_buffer()->get_text()});
|
||||
// TODO: Open new tool view
|
||||
const Tool* tool = this->__transitions.addTool({toolName->get_text(), toolDescription->get_buffer()->get_text(), toolCommand->get_buffer()->get_text()});
|
||||
this->__create_tab(*const_cast<Tool*>(tool));
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue