Skip to content

Commit

Permalink
Merge pull request #2057 from zenustech/uioff-zeno
Browse files Browse the repository at this point in the history
restrict mode: cannot create new node by menu.
  • Loading branch information
zhouhang95 authored Nov 18, 2024
2 parents 035fce8 + 6f8bdf2 commit a17182e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
3 changes: 1 addition & 2 deletions ui/zenoedit/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ int main(int argc, char *argv[])
}
}

#ifndef ZENO_HIDE_UI
ZenoMainWindow mainWindow;
zeno::getSession().eventCallbacks->triggerEvent("editorConstructed");
mainWindow.showMaximized();
Expand All @@ -158,6 +157,6 @@ int main(int argc, char *argv[])
if (!zsgPath.isEmpty())
mainWindow.openFileAndUpdateParam(zsgPath, paramsJson);
}
#endif

return a.exec();
}
4 changes: 4 additions & 0 deletions ui/zenoedit/nodesys/zenonode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1641,10 +1641,14 @@ void ZenoNode::contextMenuEvent(QGraphicsSceneContextMenuEvent* event)
else
{
NODE_CATES cates = pGraphsModel->getCates();
#ifdef ZENO_HIDE_UI

#else
ZenoNewnodeMenu *menu = new ZenoNewnodeMenu(m_subGpIndex, cates, event->scenePos());
menu->setEditorFocus();
menu->exec(event->screenPos());
menu->deleteLater();
#endif
}
}

Expand Down
4 changes: 4 additions & 0 deletions ui/zenoedit/uilogic/scenemenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -589,11 +589,15 @@ bool sceneMenuEvent(
}

NODE_CATES cates = zenoApp->graphsManagment()->currentModel()->getCates();
#ifdef ZENO_HIDE_UI
return false;
#else
auto m_menu = new ZenoNewnodeMenu(subgIdx, cates, scenePos);
m_menu->setEditorFocus();
m_menu->exec(QCursor::pos());
m_menu->deleteLater();
return true;
#endif
}
return false;
}

0 comments on commit a17182e

Please sign in to comment.