Closing or quitting while text is edited applies it first (12.14a)
This commit is contained in:
1 parent
5ee5aee07b
commit
94b884a2ef
7 files changed
+247
-2
No files matched your search
@@ -210,9 +210,19 @@ std::vector<std::shared_ptr<ProjectTab>> ProjectWorkspace::quitOrder() const
|
||||
return order;
|
||||
}
|
||||
|
||||
// Swift's finishTextEditing: open text is applied before asking.
|
||||
bool ProjectWorkspace::finishTextEditing()
|
||||
{
|
||||
for (const std::shared_ptr<ProjectTab> &each : quitOrder()) {
|
||||
if (each->session.textDraft() && !each->session.finishText())
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void ProjectWorkspace::confirmQuit(std::function<void(bool)> done)
|
||||
{
|
||||
if (!canSwitch()) {
|
||||
if (!finishTextEditing() || !canSwitch()) {
|
||||
finish(done, false);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -70,6 +70,7 @@ signals:
|
||||
void changed();
|
||||
|
||||
private:
|
||||
bool finishTextEditing();
|
||||
struct Baked {
|
||||
EditorSession::BakedImages images;
|
||||
std::optional<QString> failure;
|
||||
|
||||
Reference in new issue
Block a user