2020-01-18 05:38:21 -03:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
|
|
|
|
|
*
|
2021-04-22 05:24:48 -03:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-01-18 05:38:21 -03:00
|
|
|
*/
|
|
|
|
|
|
2019-09-02 14:45:55 -03:00
|
|
|
#pragma once
|
|
|
|
|
|
2021-08-29 07:00:50 -03:00
|
|
|
#include <LibCore/Version.h>
|
2020-02-06 16:33:02 -03:00
|
|
|
#include <LibGUI/Dialog.h>
|
2019-09-02 14:45:55 -03:00
|
|
|
|
2020-02-02 11:07:41 -03:00
|
|
|
namespace GUI {
|
|
|
|
|
|
|
|
|
|
class AboutDialog final : public Dialog {
|
|
|
|
|
C_OBJECT(AboutDialog)
|
2019-09-02 14:45:55 -03:00
|
|
|
public:
|
2020-02-02 11:07:41 -03:00
|
|
|
virtual ~AboutDialog() override;
|
2019-09-02 14:45:55 -03:00
|
|
|
|
2021-08-29 07:00:50 -03:00
|
|
|
static void show(const StringView& name, const Gfx::Bitmap* icon = nullptr, Window* parent_window = nullptr, const Gfx::Bitmap* window_icon = nullptr, const StringView& version = Core::Version::SERENITY_VERSION)
|
2019-09-02 14:45:55 -03:00
|
|
|
{
|
2021-08-29 07:00:50 -03:00
|
|
|
auto dialog = AboutDialog::construct(name, icon, parent_window, version);
|
2020-05-24 11:26:33 -03:00
|
|
|
if (window_icon)
|
|
|
|
|
dialog->set_icon(window_icon);
|
2019-09-29 15:37:02 -03:00
|
|
|
dialog->exec();
|
2019-09-02 14:45:55 -03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private:
|
2021-08-29 07:00:50 -03:00
|
|
|
AboutDialog(const StringView& name, const Gfx::Bitmap* icon = nullptr, Window* parent_window = nullptr, const StringView& version = Core::Version::SERENITY_VERSION);
|
2019-09-29 15:37:02 -03:00
|
|
|
|
2019-09-02 14:45:55 -03:00
|
|
|
String m_name;
|
2020-02-06 07:56:38 -03:00
|
|
|
RefPtr<Gfx::Bitmap> m_icon;
|
2021-08-29 07:00:50 -03:00
|
|
|
String m_version_string;
|
2019-09-02 14:45:55 -03:00
|
|
|
};
|
2020-02-02 11:07:41 -03:00
|
|
|
}
|