diff --git a/extras/Introjucer/Source/Application/jucer_Application.h b/extras/Introjucer/Source/Application/jucer_Application.h index 5682f9cdab..bc430231cf 100644 --- a/extras/Introjucer/Source/Application/jucer_Application.h +++ b/extras/Introjucer/Source/Application/jucer_Application.h @@ -487,10 +487,7 @@ public: ScopedPointer menuModel; -private: - OwnedArray mainWindows; - - MainWindow* createNewMainWindow() + virtual MainWindow* createNewMainWindow() { MainWindow* mw = new MainWindow(); mainWindows.add (mw); @@ -499,6 +496,9 @@ private: return mw; } +private: + OwnedArray mainWindows; + MainWindow* getOrCreateFrontmostWindow() { if (mainWindows.size() == 0) diff --git a/extras/Introjucer/Source/Application/jucer_OpenDocumentManager.cpp b/extras/Introjucer/Source/Application/jucer_OpenDocumentManager.cpp index c14a1276d7..bc33b1a1d9 100644 --- a/extras/Introjucer/Source/Application/jucer_OpenDocumentManager.cpp +++ b/extras/Introjucer/Source/Application/jucer_OpenDocumentManager.cpp @@ -49,12 +49,13 @@ public: //============================================================================== bool loadedOk() const { return true; } - bool isForFile (const File& file) const { return modDetector.getFile() == file; } + bool isForFile (const File& file) const { return getFile() == file; } bool isForNode (const ValueTree& node) const { return false; } bool refersToProject (Project& project) const { return false; } bool canSaveAs() const { return true; } - String getName() const { return modDetector.getFile().getFileName(); } - String getType() const { return modDetector.getFile().getFileExtension() + " file"; } + String getName() const { return getFile().getFileName(); } + String getType() const { return getFile().getFileExtension() + " file"; } + File getFile() const { return modDetector.getFile(); } bool needsSaving() const { return codeDoc != nullptr && codeDoc->hasChangedSinceSavePoint(); } bool hasFileBeenModifiedExternally() { return modDetector.hasBeenModified(); } void fileHasBeenRenamed (const File& newFile) { modDetector.fileHasBeenRenamed (newFile); } @@ -138,6 +139,7 @@ public: bool hasFileBeenModifiedExternally() { return fileModificationTime != file.getLastModificationTime(); } void reloadFromFile() { fileModificationTime = file.getLastModificationTime(); } String getName() const { return file.getFileName(); } + File getFile() const { return file; } Component* createEditor() { return new ItemPreviewComponent (file); } Component* createViewer() { return createEditor(); } void fileHasBeenRenamed (const File& newFile) { file = newFile; } diff --git a/extras/Introjucer/Source/Application/jucer_OpenDocumentManager.h b/extras/Introjucer/Source/Application/jucer_OpenDocumentManager.h index 5d6dfa0a6f..e7dfec668d 100644 --- a/extras/Introjucer/Source/Application/jucer_OpenDocumentManager.h +++ b/extras/Introjucer/Source/Application/jucer_OpenDocumentManager.h @@ -54,6 +54,7 @@ public: virtual bool refersToProject (Project& project) const = 0; virtual String getName() const = 0; virtual String getType() const = 0; + virtual File getFile() const = 0; virtual bool needsSaving() const = 0; virtual bool save() = 0; virtual bool canSaveAs() const = 0; diff --git a/extras/Introjucer/Source/Project/jucer_ProjectContentComponent.h b/extras/Introjucer/Source/Project/jucer_ProjectContentComponent.h index adee257c2a..f294e9e913 100644 --- a/extras/Introjucer/Source/Project/jucer_ProjectContentComponent.h +++ b/extras/Introjucer/Source/Project/jucer_ProjectContentComponent.h @@ -51,6 +51,7 @@ public: bool showDocument (OpenDocumentManager::Document* doc); void hideDocument (OpenDocumentManager::Document* doc); bool setEditorComponent (Component* editor, OpenDocumentManager::Document* doc); + OpenDocumentManager::Document* getCurrentDocument() const { return currentDocument; } void updateMissingFileStatuses();