[studio/applib] Cleanup
This commit is contained in:
parent
dc6605fd48
commit
8dad624b21
@ -116,11 +116,12 @@ void NewMenu::drawLastPageButtons(studio::StudioContext &sctx) noexcept {
|
|||||||
|
|
||||||
void NewMenu::finish(studio::StudioContext &sctx) noexcept {
|
void NewMenu::finish(studio::StudioContext &sctx) noexcept {
|
||||||
if (m_itemName.len() == 0) {
|
if (m_itemName.len() == 0) {
|
||||||
|
oxLogError(OxError(1, "New file error: no file name"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
auto const&typeMaker = *m_types[static_cast<std::size_t>(m_selectedType)];
|
auto const&typeMaker = *m_types[static_cast<std::size_t>(m_selectedType)];
|
||||||
if (sctx.project->exists(typeMaker.itemPath(m_itemName))) {
|
if (sctx.project->exists(typeMaker.itemPath(m_itemName))) {
|
||||||
oxLogError(OxError(1, "New file error: File already exists"));
|
oxLogError(OxError(1, "New file error: file already exists"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
auto const [path, err] = typeMaker.write(sctx, m_itemName);
|
auto const [path, err] = typeMaker.write(sctx, m_itemName);
|
||||||
|
Loading…
Reference in New Issue
Block a user