| @@ -159,8 +159,6 @@ public: | |||||
| } | } | ||||
| virtual void doExtraInitialisation() {} | virtual void doExtraInitialisation() {} | ||||
| virtual void projectOpened (Project*) {} | |||||
| virtual void projectClosed (Project*) {} | |||||
| static JucerApplication* getApp() | static JucerApplication* getApp() | ||||
| { | { | ||||
| @@ -487,7 +485,7 @@ public: | |||||
| ScopedPointer<MainMenuModel> menuModel; | ScopedPointer<MainMenuModel> menuModel; | ||||
| virtual MainWindow* createNewMainWindow() | |||||
| MainWindow* createNewMainWindow() | |||||
| { | { | ||||
| MainWindow* mw = new MainWindow(); | MainWindow* mw = new MainWindow(); | ||||
| mainWindows.add (mw); | mainWindows.add (mw); | ||||
| @@ -496,6 +494,11 @@ public: | |||||
| return mw; | return mw; | ||||
| } | } | ||||
| virtual Component* createProjectContentComponent() const | |||||
| { | |||||
| return new ProjectContentComponent(); | |||||
| } | |||||
| private: | private: | ||||
| OwnedArray <MainWindow> mainWindows; | OwnedArray <MainWindow> mainWindows; | ||||
| @@ -94,7 +94,7 @@ void MainWindow::createProjectContentCompIfNeeded() | |||||
| if (getProjectContentComponent() == nullptr) | if (getProjectContentComponent() == nullptr) | ||||
| { | { | ||||
| clearContentComponent(); | clearContentComponent(); | ||||
| setContentOwned (new ProjectContentComponent(), false); | |||||
| setContentOwned (JucerApplication::getApp()->createProjectContentComponent(), false); | |||||
| } | } | ||||
| } | } | ||||
| @@ -63,14 +63,10 @@ Project::Project (const File& file_) | |||||
| mainProjectIcon.setImage (ImageCache::getFromMemory (BinaryData::juce_icon_png, BinaryData::juce_icon_pngSize)); | mainProjectIcon.setImage (ImageCache::getFromMemory (BinaryData::juce_icon_png, BinaryData::juce_icon_pngSize)); | ||||
| projectRoot.addListener (this); | projectRoot.addListener (this); | ||||
| JucerApplication::getApp()->projectOpened (this); | |||||
| } | } | ||||
| Project::~Project() | Project::~Project() | ||||
| { | { | ||||
| JucerApplication::getApp()->projectClosed (this); | |||||
| projectRoot.removeListener (this); | projectRoot.removeListener (this); | ||||
| OpenDocumentManager::getInstance()->closeAllDocumentsUsingProject (*this, false); | OpenDocumentManager::getInstance()->closeAllDocumentsUsingProject (*this, false); | ||||
| } | } | ||||
| @@ -233,9 +229,7 @@ Result Project::loadDocument (const File& file) | |||||
| return Result::fail ("The document contains errors and couldn't be parsed!"); | return Result::fail ("The document contains errors and couldn't be parsed!"); | ||||
| registerRecentFile (file); | registerRecentFile (file); | ||||
| JucerApplication::getApp()->projectClosed (this); | |||||
| projectRoot = newTree; | projectRoot = newTree; | ||||
| JucerApplication::getApp()->projectOpened (this); | |||||
| removeDefunctExporters(); | removeDefunctExporters(); | ||||
| setMissingDefaultValues(); | setMissingDefaultValues(); | ||||
| @@ -44,7 +44,8 @@ public: | |||||
| void paint (Graphics& g); | void paint (Graphics& g); | ||||
| void setProject (Project* project); | |||||
| Project* getProject() const noexcept { return project; } | |||||
| virtual void setProject (Project* project); | |||||
| void saveTreeViewState(); | void saveTreeViewState(); | ||||
| bool showEditorForFile (const File& f); | bool showEditorForFile (const File& f); | ||||