Public Members
| std::string | orgName |
| std::string | appName { "Vortex App" } |
| std::string | windowTitle { "Vortex App" } |
| std::string | windowIconName |
| std::string | desktopFileName |
| std::string | appVersion |
| std::string | updateManifestUrl |
| std::string | updatePlatformKey |
| int | updateCheckHours { 24 } |
| std::string | defaultTheme { "Dark (huntrsoftwarellc)" } |
| std::string | frameworkAssetDir |
| std::vector<std::string> | appStyleDirs |
| std::vector<std::string> | appIconDirs |
| std::vector<std::string> | appMediaDirs |
| std::function<void (VApp &)> | build |
Detailed Description
Settings that a desktop app passes to
run_desktop() to start up.
Every Vortex desktop app starts the same way, so run_desktop() does
the shared work (opening the window, saving settings, connecting HTTP
and other platform services), and this struct carries what differs
between apps: their names, version, asset folders, and the function
that builds the UI. An app's main() fills one in and hands it over,
like the demo app does:
int main(int argc, char** argv)
{
Vortex::DesktopAppConfig config;
config.appName = "Vortex";
config.windowIconName = "logo_vortex_badge";
config.desktopFileName = "vortexdemo";
config.appVersion = VORTEX_DEMO_VERSION;
config.frameworkAssetDir = VORTEX_FRAMEWORK_DIR;
config.appStyleDirs = { VORTEX_APP_DIR "/styles" };
return Vortex::run_desktop(argc, argv, config);
}
VORTEX_DEMO_VERSION, VORTEX_FRAMEWORK_DIR, and VORTEX_APP_DIR are
compile definitions that the demo's CMakeLists.txt sets to its
project() version and source folders, so a build run from the source
tree finds its assets in place. An empty string or list turns its
feature off or keeps the system default, as each member describes.
Setting updateManifestUrl turns on update checks, and
updatePlatformKey and updateCheckHours only apply with it. See
vupdate.h for the manifest's format.
Each app's settings persist between runs in Qt's settings storage (the
registry on Windows, a file elsewhere), filed under orgName and
appName. They hold the active theme, the user's custom theme folders,
and the values that VApp::store() writes, so each
app needs its own pair of names to keep its settings apart.
A packaged build carries its assets in an assets folder beside the
executable, since the source folders that the config names don't exist
on other machines. When assets/vortex/styles exists, run_desktop()
replaces the config's asset folders with these:
| Member | Packaged folder |
|---|---|
frameworkAssetDir |
assets/vortex |
appStyleDirs |
assets/app/styles |
appIconDirs |
assets/app/icons |
appMediaDirs |
assets/app, or none without assets/app/media |
Member Variable Documentation
std::string orgName
Organization name for saved settings. Leaving this empty falls back
to appName.
std::string appName { "Vortex App" }
App name for saved settings
std::string windowTitle { "Vortex App" }
Title that the OS shows for the window
std::string windowIconName
Icon that the OS shows for the window, like "logo_vortex_badge",
found the same way as an Icon node's Source. A name that ends
in .png loads that file instead, for a logo whose .svg is
animated or themed. GNOME under Wayland ignores it and uses
desktopFileName.
std::string desktopFileName
Linux only: Name of the app's installed desktop entry, like "vortexdemo", which GNOME uses to find the window's icon.
std::string appVersion
Like "2.0.0"; empty means a development build
std::string updateManifestUrl
URL of latest.json; empty turns updates off
std::string updatePlatformKey
Like "linux-x86_64"; empty detects it
int updateCheckHours { 24 }
Hours between checks; 0 checks at launch only
std::string defaultTheme { "Dark (huntrsoftwarellc)" }
Default theme to apply if the user hasn't made their own selection.
std::string frameworkAssetDir
Folder with styles, themes, icons
std::vector<std::string> appStyleDirs
Loaded after the framework's styles
std::vector<std::string> appIconDirs
Searched before the framework's icons
std::vector<std::string> appMediaDirs
Folders that an Image or Video node's Source is joined to:
with "/home/user/notes", Source: "media/art.png" loads
"/home/user/notes/media/art.png".
std::function<void (VApp &)> build
Builds the UI; empty calls build_app()