diff --git a/extension/_locales/en/messages.json b/extension/_locales/en/messages.json --- a/extension/_locales/en/messages.json +++ b/extension/_locales/en/messages.json @@ -98,6 +98,15 @@ "message": "This may interfere with the appearance of websites that already apply a custom styling to their scroll bars." }, + "options_about_host_version": { + "description": "Version of extension native host", + "message": "Host version: $1" + }, + "options_about_extension_version": { + "description": "Version of browser extension", + "message": "Extension version: $1" + }, + "options_about_copyright": { "message": "© 2017-2019 Kai Uwe Broulik and David Edmundson" }, diff --git a/extension/extension.js b/extension/extension.js --- a/extension/extension.js +++ b/extension/extension.js @@ -222,6 +222,10 @@ return sendPortMessageWithReply("settings", "getSubsystemStatus"); }); +addRuntimeCallback("settings", "getVersion", () => { + return sendPortMessageWithReply("settings", "getVersion"); +}); + addRuntimeCallback("browserAction", "getStatus", (message) => { let info = { portStatus, diff --git a/extension/options.html b/extension/options.html --- a/extension/options.html +++ b/extension/options.html @@ -92,6 +92,12 @@
+ I18N
+ I18N
+
I18N
I18N
diff --git a/extension/options.js b/extension/options.js
--- a/extension/options.js
+++ b/extension/options.js
@@ -241,6 +241,20 @@
console.warn("Failed to determine subsystem status", e);
document.body.classList.add("startup-failure");
});
+
+ Promise.all([
+ sendMessage("settings", "getVersion"),
+ chrome.runtime.getManifest()
+ ]).then((results) => {
+ const versionInfo = results[0];
+ const manifest = results[1];
+
+ document.getElementById("version-info-host").innerText = chrome.i18n.getMessage("options_about_host_version",
+versionInfo.host);
+ document.getElementById("version-info-extension").innerText = chrome.i18n.getMessage("options_about_extension_version", manifest.version);
+
+ document.getElementById("version-info").classList.remove("not-supported");
+ });
});
document.getElementById("open-krunner-settings").addEventListener("click", function (event) {
diff --git a/host/CMakeLists.txt b/host/CMakeLists.txt
--- a/host/CMakeLists.txt
+++ b/host/CMakeLists.txt
@@ -1,5 +1,7 @@
add_definitions(-DTRANSLATION_DOMAIN=\"plasma-browser-integration-host\")
+configure_file(config-host.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-host.h)
+
set(HOST_SOURCES main.cpp
connection.cpp
pluginmanager.cpp
diff --git a/host/config-host.h.cmake b/host/config-host.h.cmake
new file mode 100644
--- /dev/null
+++ b/host/config-host.h.cmake
@@ -0,0 +1 @@
+#define HOST_VERSION_STRING "${PROJECT_VERSION}"
diff --git a/host/settings.cpp b/host/settings.cpp
--- a/host/settings.cpp
+++ b/host/settings.cpp
@@ -30,6 +30,8 @@
#include "pluginmanager.h"
#include "settingsadaptor.h"
+#include