Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gui: Add about image for dev version #18599

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/Gui/DlgAbout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@
#include "DlgAbout.h"
#include "MainWindow.h"
#include "SplashScreen.h"
#include "ui_AboutApplication.h"

Check failure on line 58 in src/Gui/DlgAbout.cpp

View workflow job for this annotation

GitHub Actions / Lint / Lint

'ui_AboutApplication.h' file not found [clang-diagnostic-error]

using namespace Gui;

Check warning on line 60 in src/Gui/DlgAbout.cpp

View workflow job for this annotation

GitHub Actions / Lint / Lint

Do not use namespace using-directives. Use using-declarations instead. [build/namespaces] [5]
using namespace Gui::Dialog;

Check warning on line 61 in src/Gui/DlgAbout.cpp

View workflow job for this annotation

GitHub Actions / Lint / Lint

Do not use namespace using-directives. Use using-declarations instead. [build/namespaces] [5]
namespace fs = boost::filesystem;

static QString prettyProductInfoWrapper()
Expand Down Expand Up @@ -180,7 +180,7 @@
float scale = static_cast<float>(image.width()) / static_cast<float>(image.height());
int width = std::min(image.width(), rect.width() / denom);
int height = std::min(image.height(), rect.height() / denom);
height = std::min(height, static_cast<int>(width / scale));

Check warning on line 183 in src/Gui/DlgAbout.cpp

View workflow job for this annotation

GitHub Actions / Lint / Lint

Add #include <algorithm> for min [build/include_what_you_use] [4]
width = static_cast<int>(scale * height);

image = image.scaled(width, height);
Expand Down Expand Up @@ -215,7 +215,11 @@
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()) {
Expand Down Expand Up @@ -539,7 +543,7 @@
QString data;
QTextStream str(&data);
std::map<std::string, std::string>& config = App::Application::Config();
std::map<std::string, std::string>::iterator it;

Check warning on line 546 in src/Gui/DlgAbout.cpp

View workflow job for this annotation

GitHub Actions / Lint / Lint

Add #include <map> for map<> [build/include_what_you_use] [4]
QString exe = QString::fromStdString(App::Application::getExecutableName());

QString major = QString::fromStdString(config["BuildVersionMajor"]);
Expand Down Expand Up @@ -688,7 +692,7 @@
firstMod = false;
str << "Installed mods: \n";
}
str << " * " << QString::fromStdString(mod.path().filename().string());

Check warning on line 695 in src/Gui/DlgAbout.cpp

View workflow job for this annotation

GitHub Actions / Lint / Lint

Add #include <string> for string [build/include_what_you_use] [4]
auto metadataFile = mod.path() / "package.xml";
if (fs::exists(metadataFile)) {
App::Metadata metadata(metadataFile);
Expand Down Expand Up @@ -736,4 +740,4 @@
browser->setSource(url);
}

#include "moc_DlgAbout.cpp"

Check warning on line 743 in src/Gui/DlgAbout.cpp

View workflow job for this annotation

GitHub Actions / Lint / Lint

Do not include .cpp files from other packages [build/include] [4]
Binary file added src/Gui/Icons/freecadaboutdev.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/Gui/Icons/resource.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
<file>freecadsplash11_2x.png</file>
<file>freecadsplash12_2x.png</file>
<file>freecadabout.png</file>
<file>freecadaboutdev.png</file>
<file>background.png</file>
<file>mouse_pointer.svg</file>
<file>Document.svg</file>
Expand Down
1 change: 1 addition & 0 deletions src/Main/MainGui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
class Redirection
{
public:
Redirection(FILE* f)

Check warning on line 74 in src/Main/MainGui.cpp

View workflow job for this annotation

GitHub Actions / Lint / Lint

Single-parameter constructors should be marked explicit. [runtime/explicit] [4]
: fi(Base::FileInfo::getTempFileName())
, file(f)
{
Expand Down Expand Up @@ -166,6 +166,7 @@
App::Application::Config()["AppIcon"] = "freecad";
App::Application::Config()["SplashScreen"] = "freecadsplash";
App::Application::Config()["AboutImage"] = "freecadabout";
App::Application::Config()["AboutImageDev"] = "freecadaboutdev";
App::Application::Config()["StartWorkbench"] = "PartDesignWorkbench";
// App::Application::Config()["HiddenDockWindow"] = "Property editor";
App::Application::Config()["SplashAlignment"] = "Bottom|Left";
Expand Down Expand Up @@ -316,7 +317,7 @@

std::cout.rdbuf(oldcout);
std::clog.rdbuf(oldclog);
std::cerr.rdbuf(oldcerr);

Check warning on line 320 in src/Main/MainGui.cpp

View workflow job for this annotation

GitHub Actions / Lint / Lint

Add #include <iostream> for cerr [build/include_what_you_use] [4]

// Destruction phase ===========================================================
Base::Console().Log("%s terminating...\n", App::Application::Config()["ExeName"].c_str());
Expand Down Expand Up @@ -432,7 +433,7 @@
return EXCEPTION_CONTINUE_SEARCH; // this will trigger the "normal" OS error-dialog
}

void InitMiniDumpWriter(const std::string& filename)

Check warning on line 436 in src/Main/MainGui.cpp

View workflow job for this annotation

GitHub Actions / Lint / Lint

Add #include <string> for string [build/include_what_you_use] [4]
{
if (s_hDbgHelpMod != NULL) {
return;
Expand Down
Loading