Gui: Add about image for dev version

Co-authored-by: ein-shved <yury.shvedov@kaspersky.com>
Co-authored-by: Ladislav Michl <ladis@triops.cz>
Co-authored-by: qewer33 <qewer33@proton.me>
Co-authored-by: 3x380V <i58604845+3x380V@users.noreply.github.com>
This commit is contained in:
qewer33
2024-10-04 16:14:49 +03:00
committed by Chris Hennes
parent 377ccbdf54
commit a4d4a8e7d6
6 changed files with 17 additions and 2 deletions

View File

@@ -1132,6 +1132,14 @@ std::string Application::getNameWithVersion()
return fmt::format("{} {}.{}.{}{}", appname, major, minor, point, suffix);
}
bool Application::isDevelopmentVersion()
{
static std::string suffix = []() constexpr {
return FCVersionSuffix;
}();
return suffix == "dev";
}
std::string Application::getTempPath()
{
return mConfig["AppTempPath"];

View File

@@ -422,6 +422,7 @@ public:
static std::string getHomePath();
static std::string getExecutableName();
static std::string getNameWithVersion();
static bool isDevelopmentVersion();
/*!
Returns the temporary directory. By default, this is set to the
system's temporary directory but can be customized by the user.

View File

@@ -164,7 +164,11 @@ QPixmap AboutDialog::aboutImage() const
about_image.load(fi.filePath(), "PNG");
}
std::string about_path = App::Application::Config()["AboutImage"];
// Use dev or generic version of image depending on current build version.
const auto& suffix = App::Application::Config()["BuildVersionSuffix"];
const auto about_path_key = (suffix == "dev") ? "AboutImageDev" : "AboutImage";
const auto& about_path = App::Application::Config()[about_path_key];
if (!about_path.empty() && about_image.isNull()) {
QString path = QString::fromStdString(about_path);
if (QDir(path).isRelative()) {

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

View File

@@ -89,6 +89,7 @@
<file>freecad-doc.svg</file>
<file>freecad.svg</file>
<file>freecadabout.png</file>
<file>freecadaboutdev.png</file>
<file>freecadsplash_2x.png</file>
<file>freecadsplash.png</file>
<file>freecadsplash0_2x.png</file>

View File

@@ -196,7 +196,8 @@ int main(int argc, char** argv)
App::Application::Config()["CopyrightInfo"] = sBanner;
App::Application::Config()["AppIcon"] = "freecad";
App::Application::Config()["SplashScreen"] = "freecadsplash";
App::Application::Config()["AboutImage"] = "freecadabout";
App::Application::Config()["AboutImage"] =
App::Application::isDevelopmentVersion() ? "freecadaboutdev" : "freecadabout";
App::Application::Config()["StartWorkbench"] = "PartDesignWorkbench";
// App::Application::Config()["HiddenDockWindow"] = "Property editor";
App::Application::Config()["SplashAlignment"] = "Bottom|Left";