Open documents in one of three ways instead of two bools, and let dialogs know when they take many files

DocumentOpen (open, new, or restored from an autosave) replaces isNew and isRecent and Manager::new_.
The *_OPEN dialogs pick several files without being told.
This commit is contained in:
shweet committed 2026-11-22 18:56:16 -05:00
1 parent 1fc6b064ae
commit 228a15b5b3
13 files changed
+36 -31

No files matched your search

+10 -1
View File
@@ -21,6 +21,15 @@
#include "shader.h"
class Manager;
// How a document comes to be open: read from its file, made new there, or restored from an autosave (kept out of the
// recent files).
enum DocumentOpen
{
DOCUMENT_OPEN,
DOCUMENT_NEW,
DOCUMENT_RESTORE
};
struct Command;
// Ids and labels for a combo box of content items.
@@ -116,7 +125,7 @@ public:
EditTarget editTarget = EditTarget::NONE;
UidIndex index = {};
Document(const std::filesystem::path&, bool = false, std::string* = nullptr);
Document(const std::filesystem::path&, DocumentOpen = DOCUMENT_OPEN, std::string* = nullptr);
Document(const Document&) = delete;
Document& operator=(const Document&) = delete;
Document(Document&&) = default;