comparison framework/MainWindowBase.cpp @ 601:021d42e6c8cb

Avoid setting the session file path when loading an incomplete document, so that the default-file save-on-exit and File->Save are not activated (to avoid losing references to unfound audio files)
author Chris Cannam
date Mon, 18 Jun 2018 14:16:06 +0100
parents a558a3fb44fc
children d767bdf4879b
comparison
equal deleted inserted replaced
600:ca96a514fbbb 601:021d42e6c8cb
667 emit canWinnowInstants(haveCurrentTimeInstantsLayer && haveSelection); 667 emit canWinnowInstants(haveCurrentTimeInstantsLayer && haveSelection);
668 emit canPlaySelection(haveMainModel && havePlayTarget && haveSelection); 668 emit canPlaySelection(haveMainModel && havePlayTarget && haveSelection);
669 emit canClearSelection(haveSelection); 669 emit canClearSelection(haveSelection);
670 emit canEditSelection(haveSelection && haveCurrentEditableLayer); 670 emit canEditSelection(haveSelection && haveCurrentEditableLayer);
671 emit canSave(m_sessionFile != "" && m_documentModified); 671 emit canSave(m_sessionFile != "" && m_documentModified);
672 emit canSaveAs(haveMainModel); 672 emit canSaveAs(haveMainModel); // possibly used only in Tony, not SV
673 emit canSelectPreviousPane(havePrevPane); 673 emit canSelectPreviousPane(havePrevPane);
674 emit canSelectNextPane(haveNextPane); 674 emit canSelectNextPane(haveNextPane);
675 emit canSelectPreviousLayer(havePrevLayer); 675 emit canSelectPreviousLayer(havePrevLayer);
676 emit canSelectNextLayer(haveNextLayer); 676 emit canSelectNextLayer(haveNextLayer);
677 677
2094 2094
2095 setWindowTitle(tr("%1: %2") 2095 setWindowTitle(tr("%1: %2")
2096 .arg(QApplication::applicationName()) 2096 .arg(QApplication::applicationName())
2097 .arg(source.getLocation())); 2097 .arg(source.getLocation()));
2098 2098
2099 if (!source.isRemote()) m_sessionFile = source.getLocalFilename(); 2099 if (!source.isRemote() && !m_document->isIncomplete()) {
2100 // Setting the session file path enables the Save (as
2101 // opposed to Save As...) option. We can't do this if we
2102 // don't have a local path to save to, but we also don't
2103 // want to do it if we failed to find an audio file or
2104 // similar on load, as the audio reference would then end
2105 // up being lost from any saved or auto-saved-on-exit copy
2106 m_sessionFile = source.getLocalFilename();
2107 }
2100 2108
2101 setupMenus(); 2109 setupMenus();
2102 findTimeRulerLayer(); 2110 findTimeRulerLayer();
2103 2111
2104 CommandHistory::getInstance()->clear(); 2112 CommandHistory::getInstance()->clear();