void onExecute(Context* context) override { Workspace* workspace = App::instance()->getMainWindow()->getWorkspace(); std::vector<DocumentView*> docViews; for (auto view : *workspace) { DocumentView* docView = dynamic_cast<DocumentView*>(view); if (docView) docViews.push_back(docView); } for (auto docView : docViews) { if (!workspace->closeView(docView)) break; } }
void onExecute(Context* context) override { Workspace* workspace = App::instance()->getMainWindow()->getWorkspace(); WorkspaceView* view = workspace->activeView(); if (view) workspace->closeView(view); }