Skip to content

Truly independent web browser

Base+LibCore+LibWebView+UI/Qt: Call release builds Ladybird Alpha

Jelle Raaijmakersbaad56f238c3
diff --git a/Base/res/ladybird/about-pages/version.html b/Base/res/ladybird/about-pages/version.html
index 7da6a6d220e..ccc82134ef9 100644
--- a/Base/res/ladybird/about-pages/version.html
+++ b/Base/res/ladybird/about-pages/version.html
@@ -140,7 +140,7 @@
</svg>
<div class="name">
<h1 id="browser-name">Ladybird</h1>
- <span class="badge">Pre-Alpha</span>
+ <span class="badge" id="release-stage" hidden></span>
</div>
<p class="tagline">A truly independent web browser.</p>
<div class="details">
@@ -171,15 +171,17 @@
let detailsText = "";
function renderVersionInfo(versionInfo) {
- document.title = `About ${versionInfo.browserName}`;
+ document.title = `About ${versionInfo.productName}`;
document.querySelector("#browser-name").innerText = versionInfo.browserName;
+ document.querySelector("#release-stage").innerText = versionInfo.releaseStage || "Development";
+ document.querySelector("#release-stage").hidden = false;
document.querySelector("#browser-version").innerText = versionInfo.browserVersion;
document.querySelector("#browser-commit").innerText = `from ${versionInfo.browserCommit.slice(0, 10)}`;
document.querySelector("#platform").innerText = `${versionInfo.platformName}, ${versionInfo.arch}`;
// What is copied includes the details a bug report needs beyond what the page shows.
detailsText = [
- `${versionInfo.browserName} ${versionInfo.browserVersion} (${versionInfo.browserCommit})`,
+ `${versionInfo.productName} ${versionInfo.browserVersion} (${versionInfo.browserCommit})`,
`Platform: ${versionInfo.platformName}, ${versionInfo.arch}`,
`User agent: ${navigator.userAgent}`,
`Command line: ${versionInfo.commandLine}`,
diff --git a/Libraries/LibCore/BrowserVersion.h.in b/Libraries/LibCore/BrowserVersion.h.in
index 05ebb8661ed..f3d56a74e42 100644
--- a/Libraries/LibCore/BrowserVersion.h.in
+++ b/Libraries/LibCore/BrowserVersion.h.in
@@ -7,3 +7,5 @@
#pragma once
#define BROWSER_VERSION "@LADYBIRD_BROWSER_VERSION@"
+#define BROWSER_RELEASE_STAGE "@browser_release_stage@"
+#define BROWSER_PRODUCT_NAME "@browser_product_name@"
diff --git a/Libraries/LibCore/CMakeLists.txt b/Libraries/LibCore/CMakeLists.txt
index 81b21f72748..f4cb48ff809 100644
--- a/Libraries/LibCore/CMakeLists.txt
+++ b/Libraries/LibCore/CMakeLists.txt
@@ -115,6 +115,11 @@ endif()
ladybird_lib(LibCore core EXPLICIT_SYMBOL_EXPORT)
target_link_libraries(LibCore PRIVATE Threads::Threads LibUnicode LibTextCodec mimalloc)
+# Development builds are in no stage of development, and leave it out of their product name.
+if (NOT LADYBIRD_VERSION STREQUAL "")
+ set(browser_release_stage "${LADYBIRD_RELEASE_STAGE}")
+endif()
+string(JOIN " " browser_product_name "Ladybird" ${browser_release_stage})
configure_file(BrowserVersion.h.in BrowserVersion.h @ONLY)
if (ENABLE_INSTALL_HEADERS)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/BrowserVersion.h" COMPONENT Lagom_Development
diff --git a/Libraries/LibWebView/WebUI/VersionUI.cpp b/Libraries/LibWebView/WebUI/VersionUI.cpp
index 2bdea345731..156c7bc284d 100644
--- a/Libraries/LibWebView/WebUI/VersionUI.cpp
+++ b/Libraries/LibWebView/WebUI/VersionUI.cpp
@@ -27,6 +27,8 @@ void VersionUI::load_version_info()
{
static NeverDestroyed<String> browser_name = String::from_utf8_without_validation({ BROWSER_NAME, __builtin_strlen(BROWSER_NAME) });
static NeverDestroyed<String> browser_version = String::from_utf8_without_validation({ BROWSER_VERSION, __builtin_strlen(BROWSER_VERSION) });
+ static NeverDestroyed<String> release_stage = String::from_utf8_without_validation({ BROWSER_RELEASE_STAGE, __builtin_strlen(BROWSER_RELEASE_STAGE) });
+ static NeverDestroyed<String> product_name = String::from_utf8_without_validation({ BROWSER_PRODUCT_NAME, __builtin_strlen(BROWSER_PRODUCT_NAME) });
static NeverDestroyed<String> browser_commit = String::from_utf8_without_validation(LADYBIRD_COMMIT.bytes());
static NeverDestroyed<String> arch = String::from_utf8_without_validation({ CPU_STRING, __builtin_strlen(CPU_STRING) });
static NeverDestroyed<String> platform_name = String::from_utf8_without_validation({ OS_STRING, __builtin_strlen(OS_STRING) });
@@ -36,6 +38,8 @@ void VersionUI::load_version_info()
JsonObject version_info;
version_info.set("browserName"_string, *browser_name);
version_info.set("browserVersion"_string, *browser_version);
+ version_info.set("releaseStage"_string, *release_stage);
+ version_info.set("productName"_string, *product_name);
version_info.set("browserCommit"_string, *browser_commit);
version_info.set("arch"_string, *arch);
version_info.set("platformName"_string, *platform_name);
diff --git a/UI/Qt/BrowserWindow.cpp b/UI/Qt/BrowserWindow.cpp
index 827b827c3b6..03e4c508ada 100644
--- a/UI/Qt/BrowserWindow.cpp
+++ b/UI/Qt/BrowserWindow.cpp
@@ -12,6 +12,7 @@
#include <AK/Platform.h>
#include <AK/StdLibExtras.h>
#include <AK/TypeCasts.h>
+#include <LibCore/BrowserVersion.h>
#include <LibWebView/Application.h>
#include <LibWebView/HistoryStore.h>
#include <LibWebView/SessionStore.h>
@@ -1222,8 +1223,8 @@ int BrowserWindow::tab_index(Tab* tab)
void BrowserWindow::update_window_title(QString const& title)
{
char const* format = is_private() == WebView::IsPrivate::Yes
- ? "%1 - Ladybird (Private)"
- : "%1 - Ladybird";
+ ? "%1 - " BROWSER_PRODUCT_NAME " (Private)"
+ : "%1 - " BROWSER_PRODUCT_NAME;
setWindowTitle(QString(format).arg(title));
}
diff --git a/UI/Qt/main.cpp b/UI/Qt/main.cpp
index ee20bf082bf..772f7ece48a 100644
--- a/UI/Qt/main.cpp
+++ b/UI/Qt/main.cpp
@@ -4,6 +4,7 @@
* SPDX-License-Identifier: BSD-2-Clause
*/
+#include <LibCore/BrowserVersion.h>
#include <LibCore/GeolocationProvider.h>
#include <LibMain/Main.h>
#include <LibWebView/Application.h>
@@ -125,7 +126,7 @@ ErrorOr<int> ladybird_main(Main::Arguments arguments)
app->offer_to_restore_unexpectedly_closed_tabs(*restored_window);
} else {
auto& window = app->new_window(browser_options.urls, configuration);
- window.setWindowTitle("Ladybird");
+ window.setWindowTitle(BROWSER_PRODUCT_NAME);
app->offer_to_restore_unexpectedly_closed_tabs(window);
}