AppStorage (Modules) names an application's persistent folder, ~/<name>, with images/ and sessions/ subfolders. WindowHost::persistentAppStorage() is pure virtual, so every WidgetApplication must say where its data lives; widgets reach it through ui()->windowHost(). MarkdownEditor without an explicit image store now saves a pasted image into <application>/images/pasted-N.<ext> and links it by absolute path, instead of ignoring it with "nowhere to save it". saveClipboardImage is the one writer of pasted image files; the gallery's own store uses it too. Session recordings default to <application>/sessions instead of ~/<application>-sessions; MODULES_SESSION_DIR still overrides it. AppStorage::adoptLegacyDirectory moves an older folder in once, by rename.
29 lines
579 B
C++
29 lines
579 B
C++
#include "WidgetApplication.hpp"
|
|
|
|
#include "Sketch3D.hpp"
|
|
#include "SketchGUI.hpp"
|
|
|
|
using namespace tp;
|
|
|
|
class Sketch3DApplication : public ui::WidgetApplication {
|
|
public:
|
|
Sketch3DApplication() :
|
|
mGui(canvas(), { 2560, 1440 }) {
|
|
mGui.setProject(&mSketch);
|
|
setRoot(mGui);
|
|
}
|
|
|
|
~Sketch3DApplication() override { ui().setRoot(nullptr); }
|
|
|
|
[[nodiscard]] AppStorage persistentAppStorage() const override { return AppStorage::inHome("sketch3d"); }
|
|
|
|
private:
|
|
Project mSketch;
|
|
SketchGUI mGui;
|
|
};
|
|
|
|
int main() {
|
|
Sketch3DApplication application;
|
|
application.run();
|
|
return 0;
|
|
}
|