| @@ -496,19 +496,25 @@ void ProjectContentComponent::updateMainWindowTitle() | |||||
| if (MainWindow* mw = findParentComponentOfClass<MainWindow>()) | if (MainWindow* mw = findParentComponentOfClass<MainWindow>()) | ||||
| { | { | ||||
| String title; | String title; | ||||
| File file; | |||||
| bool edited = false; | bool edited = false; | ||||
| if (currentDocument != nullptr) | if (currentDocument != nullptr) | ||||
| { | { | ||||
| title = currentDocument->getName(); | title = currentDocument->getName(); | ||||
| edited = currentDocument->needsSaving(); | edited = currentDocument->needsSaving(); | ||||
| file = currentDocument->getFile(); | |||||
| } | } | ||||
| if (ComponentPeer* peer = mw->getPeer()) | if (ComponentPeer* peer = mw->getPeer()) | ||||
| { | |||||
| if (! peer->setDocumentEditedStatus (edited)) | if (! peer->setDocumentEditedStatus (edited)) | ||||
| if (edited) | if (edited) | ||||
| title << "*"; | title << "*"; | ||||
| peer->setRepresentedFile (file); | |||||
| } | |||||
| mw->updateTitle (title); | mw->updateTitle (title); | ||||
| } | } | ||||
| } | } | ||||
| @@ -213,6 +213,14 @@ public: | |||||
| return true; | return true; | ||||
| } | } | ||||
| void setRepresentedFile (const File& file) | |||||
| { | |||||
| if (! isSharedWindow) | |||||
| [window setRepresentedFilename: juceStringToNS (file != File::nonexistent | |||||
| ? file.getFullPathName() | |||||
| : String::empty)]; | |||||
| } | |||||
| void setPosition (int x, int y) | void setPosition (int x, int y) | ||||
| { | { | ||||
| setBounds (x, y, component.getWidth(), component.getHeight(), false); | setBounds (x, y, component.getWidth(), component.getHeight(), false); | ||||
| @@ -559,6 +559,10 @@ bool ComponentPeer::setDocumentEditedStatus (bool) | |||||
| return false; | return false; | ||||
| } | } | ||||
| void ComponentPeer::setRepresentedFile (const File&) | |||||
| { | |||||
| } | |||||
| //============================================================================== | //============================================================================== | ||||
| void ComponentPeer::clearMaskedRegion() | void ComponentPeer::clearMaskedRegion() | ||||
| { | { | ||||
| @@ -127,6 +127,13 @@ public: | |||||
| */ | */ | ||||
| virtual bool setDocumentEditedStatus (bool edited); | virtual bool setDocumentEditedStatus (bool edited); | ||||
| /** If this type of window is capable of indicating that it represents a file, then | |||||
| this lets you set the file. | |||||
| E.g. in OSX it'll show an icon for the file in the title bar. | |||||
| */ | |||||
| virtual void setRepresentedFile (const File&); | |||||
| //============================================================================== | //============================================================================== | ||||
| /** Moves the window without changing its size. | /** Moves the window without changing its size. | ||||