mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-02-02 03:20:06 +00:00
Introjucer: avoided problems when closing a GUI comp which is a sub-component of another currently-loaded GUI component.
This commit is contained in:
parent
59b9b0ccaf
commit
8e4825e7bd
11 changed files with 38 additions and 17 deletions
|
|
@ -195,8 +195,14 @@ bool OpenDocumentManager::closeDocument (int index, bool saveIfNeeded)
|
|||
if (saveIfNeededAndUserAgrees (doc) != FileBasedDocument::savedOk)
|
||||
return false;
|
||||
|
||||
bool canClose = true;
|
||||
|
||||
for (int i = listeners.size(); --i >= 0;)
|
||||
listeners.getUnchecked(i)->documentAboutToClose (doc);
|
||||
if (! listeners.getUnchecked(i)->documentAboutToClose (doc))
|
||||
canClose = false;
|
||||
|
||||
if (! canClose)
|
||||
return false;
|
||||
|
||||
documents.remove (index);
|
||||
IntrojucerApp::getCommandManager().commandStatusChanged();
|
||||
|
|
@ -359,13 +365,15 @@ OpenDocumentManager::Document* RecentDocumentList::getClosestPreviousDocOtherTha
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
void RecentDocumentList::documentAboutToClose (OpenDocumentManager::Document* document)
|
||||
bool RecentDocumentList::documentAboutToClose (OpenDocumentManager::Document* document)
|
||||
{
|
||||
previousDocs.removeAllInstancesOf (document);
|
||||
nextDocs.removeAllInstancesOf (document);
|
||||
|
||||
jassert (! previousDocs.contains (document));
|
||||
jassert (! nextDocs.contains (document));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static void restoreDocList (Project& project, Array <OpenDocumentManager::Document*>& list, const XmlElement* xml)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue