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:
@@ -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"];
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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()) {
|
||||
|
||||
BIN
src/Gui/Icons/freecadaboutdev.png
Normal file
BIN
src/Gui/Icons/freecadaboutdev.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 64 KiB |
@@ -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>
|
||||
|
||||
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user