mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
Userland+LibCore: Remove legacy SERENITY_VERSION from Core::Version
This was being used as a default version argument in a couple of APIs, so those need to change signature and the caller always needs to provide a version.
This commit is contained in:
parent
38bb189772
commit
cb0b82ec46
Notes:
sideshowbarker
2024-07-17 05:49:06 +09:00
Author: https://github.com/kleinesfilmroellchen Commit: https://github.com/SerenityOS/serenity/commit/cb0b82ec46 Pull-request: https://github.com/SerenityOS/serenity/pull/15068 Issue: https://github.com/SerenityOS/serenity/issues/15071 Reviewed-by: https://github.com/ADKaster Reviewed-by: https://github.com/Hendiadyoin1 Reviewed-by: https://github.com/gmta Reviewed-by: https://github.com/linusg
7 changed files with 10 additions and 10 deletions
|
@ -21,6 +21,6 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||||
TRY(Core::System::unveil(nullptr, nullptr));
|
TRY(Core::System::unveil(nullptr, nullptr));
|
||||||
|
|
||||||
auto app_icon = TRY(GUI::Icon::try_create_default_icon("ladyball"sv));
|
auto app_icon = TRY(GUI::Icon::try_create_default_icon("ladyball"sv));
|
||||||
GUI::AboutDialog::show("SerenityOS"sv, app_icon.bitmap_for_size(32), nullptr, app_icon.bitmap_for_size(16), Core::Version::read_long_version_string());
|
GUI::AboutDialog::show("SerenityOS"sv, Core::Version::read_long_version_string(), app_icon.bitmap_for_size(32), nullptr, app_icon.bitmap_for_size(16));
|
||||||
return app->exec();
|
return app->exec();
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
#include <LibConfig/Client.h>
|
#include <LibConfig/Client.h>
|
||||||
#include <LibCore/StandardPaths.h>
|
#include <LibCore/StandardPaths.h>
|
||||||
#include <LibCore/Stream.h>
|
#include <LibCore/Stream.h>
|
||||||
|
#include <LibCore/Version.h>
|
||||||
#include <LibGUI/AboutDialog.h>
|
#include <LibGUI/AboutDialog.h>
|
||||||
#include <LibGUI/Application.h>
|
#include <LibGUI/Application.h>
|
||||||
#include <LibGUI/Clipboard.h>
|
#include <LibGUI/Clipboard.h>
|
||||||
|
@ -128,7 +129,7 @@ BrowserWindow::BrowserWindow(CookieJar& cookie_jar, URL url)
|
||||||
|
|
||||||
m_window_actions.on_about = [this] {
|
m_window_actions.on_about = [this] {
|
||||||
auto app_icon = GUI::Icon::default_icon("app-browser"sv);
|
auto app_icon = GUI::Icon::default_icon("app-browser"sv);
|
||||||
GUI::AboutDialog::show("Browser"sv, app_icon.bitmap_for_size(32), this);
|
GUI::AboutDialog::show("Browser"sv, Core::Version::read_long_version_string(), app_icon.bitmap_for_size(32), this);
|
||||||
};
|
};
|
||||||
|
|
||||||
m_window_actions.on_show_bookmarks_bar = [](auto& action) {
|
m_window_actions.on_show_bookmarks_bar = [](auto& action) {
|
||||||
|
|
|
@ -367,7 +367,7 @@ void ArgsParser::print_usage_markdown(FILE* file, char const* argv0)
|
||||||
|
|
||||||
void ArgsParser::print_version(FILE* file)
|
void ArgsParser::print_version(FILE* file)
|
||||||
{
|
{
|
||||||
outln(file, Core::Version::SERENITY_VERSION);
|
outln(file, Core::Version::read_long_version_string());
|
||||||
}
|
}
|
||||||
|
|
||||||
void ArgsParser::add_option(Option&& option)
|
void ArgsParser::add_option(Option&& option)
|
||||||
|
|
|
@ -10,8 +10,6 @@
|
||||||
|
|
||||||
namespace Core::Version {
|
namespace Core::Version {
|
||||||
|
|
||||||
constexpr StringView SERENITY_VERSION = "Version 1.0"sv;
|
|
||||||
|
|
||||||
String read_long_version_string();
|
String read_long_version_string();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
namespace GUI {
|
namespace GUI {
|
||||||
|
|
||||||
AboutDialog::AboutDialog(StringView name, Gfx::Bitmap const* icon, Window* parent_window, StringView version)
|
AboutDialog::AboutDialog(StringView name, StringView version, Gfx::Bitmap const* icon, Window* parent_window)
|
||||||
: Dialog(parent_window)
|
: Dialog(parent_window)
|
||||||
, m_name(name)
|
, m_name(name)
|
||||||
, m_icon(icon)
|
, m_icon(icon)
|
||||||
|
|
|
@ -17,16 +17,16 @@ class AboutDialog final : public Dialog {
|
||||||
public:
|
public:
|
||||||
virtual ~AboutDialog() override = default;
|
virtual ~AboutDialog() override = default;
|
||||||
|
|
||||||
static void show(StringView name, Gfx::Bitmap const* icon = nullptr, Window* parent_window = nullptr, Gfx::Bitmap const* window_icon = nullptr, StringView version = Core::Version::SERENITY_VERSION)
|
static void show(StringView name, StringView version, Gfx::Bitmap const* icon = nullptr, Window* parent_window = nullptr, Gfx::Bitmap const* window_icon = nullptr)
|
||||||
{
|
{
|
||||||
auto dialog = AboutDialog::construct(name, icon, parent_window, version);
|
auto dialog = AboutDialog::construct(name, version, icon, parent_window);
|
||||||
if (window_icon)
|
if (window_icon)
|
||||||
dialog->set_icon(window_icon);
|
dialog->set_icon(window_icon);
|
||||||
dialog->exec();
|
dialog->exec();
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
AboutDialog(StringView name, Gfx::Bitmap const* icon = nullptr, Window* parent_window = nullptr, StringView version = Core::Version::SERENITY_VERSION);
|
AboutDialog(StringView name, StringView version, Gfx::Bitmap const* icon = nullptr, Window* parent_window = nullptr);
|
||||||
|
|
||||||
String m_name;
|
String m_name;
|
||||||
RefPtr<Gfx::Bitmap> m_icon;
|
RefPtr<Gfx::Bitmap> m_icon;
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
#include <AK/Function.h>
|
#include <AK/Function.h>
|
||||||
#include <AK/String.h>
|
#include <AK/String.h>
|
||||||
#include <AK/WeakPtr.h>
|
#include <AK/WeakPtr.h>
|
||||||
|
#include <LibCore/Version.h>
|
||||||
#include <LibGUI/AboutDialog.h>
|
#include <LibGUI/AboutDialog.h>
|
||||||
#include <LibGUI/Action.h>
|
#include <LibGUI/Action.h>
|
||||||
#include <LibGUI/Icon.h>
|
#include <LibGUI/Icon.h>
|
||||||
|
@ -19,7 +20,7 @@ NonnullRefPtr<Action> make_about_action(String const& app_name, Icon const& app_
|
||||||
{
|
{
|
||||||
auto weak_parent = AK::make_weak_ptr_if_nonnull<Window>(parent);
|
auto weak_parent = AK::make_weak_ptr_if_nonnull<Window>(parent);
|
||||||
auto action = Action::create(String::formatted("&About {}", app_name), app_icon.bitmap_for_size(16), [=](auto&) {
|
auto action = Action::create(String::formatted("&About {}", app_name), app_icon.bitmap_for_size(16), [=](auto&) {
|
||||||
AboutDialog::show(app_name, app_icon.bitmap_for_size(32), weak_parent.ptr());
|
AboutDialog::show(app_name, Core::Version::read_long_version_string(), app_icon.bitmap_for_size(32), weak_parent.ptr());
|
||||||
});
|
});
|
||||||
action->set_status_tip("Show application about box");
|
action->set_status_tip("Show application about box");
|
||||||
return action;
|
return action;
|
||||||
|
|
Loading…
Reference in a new issue