Compare commits

...
15 changed files with 197 additions and 114 deletions
+21 -5
View File
@@ -36,17 +36,33 @@ body:
validations:
required: true
- type: input
attributes:
label: Installation method
description: Describe how WiVRn and OpenComposite/xrizer were installed
placeholder: flatpak --user, flatpak, AUR, Gentoo/Guru, built from sources...
- type: textarea
attributes:
label: Server Config
description: Provide the content of `config.json` for the server.
placeholder: Add the content of config.json here...
description: |
Provide the content of `config.json` for the server.
Located in `${XDG_CONFIG_HOME-${HOME}/.config}/wivrn/config.json`
or `~/.var/app/io.github.wivrn.wivrn/config/wivrn/config.json` for the flatpak version
placeholder: |
{
"encoders": [
{"codec": "h264"}
]
}
- type: textarea
attributes:
label: Server Logs
description: Provide the `wivrn-server` output.
placeholder: Add the output of the wivrn-server here...
placeholder: |
Add the output of the wivrn-server here.
If more than a few lines, prefer file attachment.
- type: dropdown
id: gpu
@@ -64,7 +80,7 @@ body:
attributes:
label: Vulkan Info
description: Provide the output of `vulkaninfo --summary` command.
placeholder: Add the output of vulkaninfo command here...
placeholder: Attach the output as a file here.
- type: dropdown
id: hmd
@@ -90,4 +106,4 @@ body:
attributes:
label: ADB Logs
description: Provide the output of `adb logcat` command.
placeholder: Add the output of adb logcat command here...
placeholder: Attach the output of adb logcat as a file.
+8 -4
View File
@@ -9,10 +9,14 @@ jobs:
- uses: actions/checkout@v4
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install gettext qt6-base-dev qt6-tools-dev qt6-l10n-tools qtchooser python3-polib
run: |
sudo apt-get update && sudo apt-get install gettext
pip install polib PyGithub
- name: Check that .po files are up to date
run: |
qtchooser -install qt6 $(which qmake6)
export QT_SELECT=qt6
tools/check_messages.sh
if [[ "${{github.ref}}" == 'refs/heads/master' ]] ; then
tools/check_po.py --manage-issues --github-repository "${{ github.repository }}" --github-token "${{ github.token }}"
else
tools/check_po.py
fi
+2 -2
View File
@@ -185,8 +185,8 @@ endif()
if (WIVRN_BUILD_DASHBOARD OR WIVRN_BUILD_SERVER)
pkg_check_modules(librsvg-2.0 REQUIRED IMPORTED_TARGET librsvg-2.0)
find_package(LibArchive)
find_package(PNG)
find_package(LibArchive REQUIRED)
find_package(PNG REQUIRED)
endif()
if (WIVRN_BUILD_DASHBOARD)
+4
View File
@@ -214,6 +214,9 @@ configuration::configuration(xr::system & system)
if (auto val = root["resolution_scale"]; val.is_double())
resolution_scale = val.get_double();
if (auto val = root["enable_stream_gui"]; val.is_bool())
enable_stream_gui = val.get_bool();
if (auto val = root["sgsr"]; val.is_object())
parse_sgsr_options(val.get_object());
@@ -365,6 +368,7 @@ void configuration::save()
json << ",\"mic_unprocessed_audio\":" << std::boolalpha << mic_unprocessed_audio;
json << ",\"fb_lower_body\":" << std::boolalpha << fb_lower_body;
json << ",\"fb_hip\":" << std::boolalpha << fb_hip;
json << ",\"enable_stream_gui\":" << std::boolalpha << enable_stream_gui;
for (auto & [key, value]: features)
json << "," << key << ":" << std::boolalpha << value;
json << ",\"virtual_keyboard_layout\":" << json_string(virtual_keyboard_layout);
+2
View File
@@ -56,6 +56,8 @@ public:
bool fb_lower_body = false;
bool fb_hip = true;
bool enable_stream_gui = true;
// Snapdragon Game Super Resolution
struct sgsr_settings
{
+7
View File
@@ -990,6 +990,13 @@ void scenes::lobby::gui_settings()
imgui_ctx->tooltip(_("This feature is not supported by your headset"));
ImGui::EndDisabled();
{
ImGui::Checkbox(_S("Enable in-stream window"), &config.enable_stream_gui);
imgui_ctx->vibrate_on_hover();
if (ImGui::IsItemHovered())
imgui_ctx->tooltip(_("Enables the configuration window to be shown while the game is streaming.\nIf enabled, the window is activated by pressing both thumbsticks."));
}
ImGui::PopStyleVar(); // ImGuiStyleVar_ItemSpacing
}
+5 -2
View File
@@ -465,8 +465,11 @@ void scenes::stream::on_focused()
swapchain_imgui,
std::vector{vp});
plots_toggle_1 = get_action("plots_toggle_1").first;
plots_toggle_2 = get_action("plots_toggle_2").first;
if (application::get_config().enable_stream_gui)
{
plots_toggle_1 = get_action("plots_toggle_1").first;
plots_toggle_2 = get_action("plots_toggle_2").first;
}
recenter_left = get_action("recenter_left").first;
recenter_right = get_action("recenter_right").first;
foveation_pitch = get_action("foveation_pitch").first;
+2
View File
@@ -615,6 +615,8 @@ static glm::vec4 compute_ray_limits(const XrPosef & pose, float margin = 0)
void scenes::stream::draw_gui(XrTime predicted_display_time, XrDuration predicted_display_period)
{
if (not(plots_toggle_1 and plots_toggle_2))
return;
bool interactable = true;
XrSpace world_space = application::space(xr::spaces::world);
auto views = session.locate_views(viewconfig, predicted_display_time, world_space).second;
+1
View File
@@ -13,6 +13,7 @@ execute_process(
if (GIT_DESC)
string(STRIP ${GIT_DESC} GIT_DESC)
string(REGEX REPLACE "^v([0-9])" "\\1" GIT_DESC ${GIT_DESC})
message(STATUS "Setting version to ${GIT_DESC} from git")
else()
set(GIT_DESC v${CMAKE_PROJECT_VERSION})
+1
View File
@@ -7,6 +7,7 @@ else()
endif()
if (GIT_DESC)
string(REGEX REPLACE "^v([0-9])" "\\1" GIT_DESC ${GIT_DESC})
configure_file(version.cpp.in version.cpp)
else ()
add_custom_target(wivrn-version ALL
+3 -3
View File
@@ -6,7 +6,7 @@ msgstr ""
"Project-Id-Version: WiVRn 0.15\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-08-04 15:49+0200\n"
"PO-Revision-Date: 2025-08-02 00:41+0200\n"
"PO-Revision-Date: 2025-08-10 17:11+0200\n"
"Last-Translator: Álvaro De Quinta <blackcherry@danwin1210.de>\n"
"Language-Team: Spanish\n"
"Language: es\n"
@@ -470,7 +470,7 @@ msgid ""
"Press the grip button or put your palm up\n"
"to move the main window"
msgstr ""
"Pulsa el botón de agarre o pon tu palma apuntando hacia arriba\n"
"Pulsa el botón de agarre o pon tu palma hacia arriba\n"
"para mover la ventana principal"
#: client/scenes/lobby_gui.cpp:2005
@@ -591,7 +591,7 @@ msgstr "Estadísticas"
#: client/scenes/stream_gui.cpp:802
msgid "Statistics overlay"
msgstr "Superposición de las estadísticas"
msgstr "Superponer estadísticas"
#: client/scenes/stream_gui.cpp:805
msgid "Compact view"
+8 -1
View File
@@ -425,7 +425,7 @@ gboolean headset_connected_success(void *)
}
catch (std::exception & e)
{
std::cerr << "Failed to start application: " << e.what();
std::cerr << "Failed to start application: " << e.what() << std::endl;
}
delay_next_try = default_delay_next_try;
@@ -969,6 +969,7 @@ int main(int argc, char * argv[])
std::string config_file;
app.add_option("-f", config_file, "configuration file")->option_text("FILE")->check(CLI::ExistingFile);
auto version_flag = app.add_flag("--version")->description("print version and exit");
auto no_active_runtime = app.add_flag("--no-manage-active-runtime")->description("don't set the active runtime on connection");
auto early_active_runtime = app.add_flag("--early-active-runtime")->description("forcibly manages the active runtime even if no headset present");
auto no_instructions = app.add_flag("--no-instructions")->group("");
@@ -981,6 +982,12 @@ int main(int argc, char * argv[])
CLI11_PARSE(app, argc, argv);
if (*version_flag)
{
std::cout << "WiVRn version " << wivrn::git_version << std::endl;
return 0;
}
if (not config_file.empty())
configuration::set_config_file(config_file);
+16 -5
View File
@@ -19,6 +19,7 @@
#include "start_systemd_unit.h"
#include "systemd_manager.h"
#include "systemd_unit.h"
#include "utils/strings.h"
#include <gio/gio.h>
#include <glib-object.h>
#include <iostream>
@@ -211,11 +212,10 @@ void systemd_units_manager::start_application(const std::vector<std::string> & a
variant_builder argv(G_VARIANT_TYPE("as"));
for (const auto & arg: args)
g_variant_builder_add(&argv, "s", arg.c_str());
auto exec_start =
g_variant_new("(s@asb)",
args.front().c_str(),
g_variant_new("as", &argv),
false);
auto exec_start = g_variant_new("(s@asb)",
args.front().c_str(),
g_variant_new("as", &argv),
false);
g_variant_builder_add(&b,
"(sv)",
"ExecStart",
@@ -224,6 +224,17 @@ void systemd_units_manager::start_application(const std::vector<std::string> & a
&exec_start,
1));
if (auto path = std::getenv("PATH"))
{
variant_builder pathv(G_VARIANT_TYPE("as"));
for (auto item: utils::split(path, ":"))
g_variant_builder_add(&pathv, "s", item.c_str());
g_variant_builder_add(&b,
"(sv)",
"ExecSearchPath",
g_variant_new("as", &pathv));
}
auto properties = b.end();
auto aux = g_variant_new_array(G_VARIANT_TYPE("(sa(sv))"), nullptr, 0);
-56
View File
@@ -1,56 +0,0 @@
#!/bin/bash
cd $(dirname $0)/..
WIVRN_CLIENT_POT=$(mktemp)
WIVRN_DASHBOARD_POT=$(mktemp)
xgettext \
--c++ --from-code=UTF-8 \
--keyword=_:1,1t \
--keyword=_S:1,1t \
--keyword=_cS:1c,2,2t \
--keyword=_F:1,1t \
--output=$WIVRN_CLIENT_POT \
--package-name=WiVRn \
$(find client/ -name "*.cpp" | sort)
xgettext \
--c++ --kde --from-code=UTF-8 \
--keyword=i18n:1 \
--keyword=i18nc:1c,2 \
--keyword=i18np:1,2 \
--keyword=i18ncp:1c,2,3 \
--output=$WIVRN_DASHBOARD_POT \
--package-name=WiVRn-dashboard \
$(find dashboard/ -name "*.qml" -o -name "*.cpp" | sort)
sed -i 's/charset=CHARSET/charset=UTF-8/g' $WIVRN_CLIENT_POT $WIVRN_DASHBOARD_POT
RC=0
for i in locale/*
do
if [ -f $i/wivrn.po ]
then
tools/check_po.py $WIVRN_CLIENT_POT $i/wivrn.po $(basename $i)
if [ $? != 0 ]
then
RC=1
fi
fi
if [ -f $i/wivrn-dashboard.po ]
then
tools/check_po.py $WIVRN_DASHBOARD_POT $i/wivrn-dashboard.po $(basename $i)
if [ $? != 0 ]
then
RC=1
fi
fi
done
rm $WIVRN_CLIENT_POT $WIVRN_DASHBOARD_POT
exit $RC
+117 -36
View File
@@ -1,51 +1,132 @@
#!/usr/bin/env python
import sys
import polib
import argparse
import os
import pathlib
import subprocess
import tempfile
parser = argparse.ArgumentParser(
prog='check_po.py',
description='Check that all strings are translated in a .po file')
def list_files(base: str, exts: str|list[str]):
if type(exts) == str:
exts = [exts]
for root, dirs, files in os.walk(base):
for f in files:
for ext in exts:
if f.endswith(ext):
yield os.path.join(root, f)
parser.add_argument('ref', type=pathlib.Path)
parser.add_argument('file', type=pathlib.Path)
parser.add_argument('lang', type=str)
def flag(lang: str):
# Map language code to a country flag
countries = {
'es': 'es',
'fr': 'fr',
'it': 'it',
'ja': 'jp',
'zh_TW': 'tw',
'pt_BR': 'br'
}
args = parser.parse_args()
country = countries.get(lang, lang)
po_ref = polib.pofile(args.ref)
res = ''
for i in country.upper():
res += chr(ord(i) + ord('🇦') - ord('A'))
return res
po_file = polib.pofile(args.file)
entries = [i.msgid for i in po_file.translated_entries()]
ISSUE_LABEL="localisation"
ISSUE_TITLE="[{lang}] Missing translations"
# Map language code to a country flag
countries = {
'es': 'es',
'fr': 'fr',
'it': 'it',
'ja': 'jp',
'zh_TW': 'tw',
'pt_BR': 'br'
}
if __name__ == "__main__":
root = os.path.dirname(os.path.dirname(__file__))
locale_dir = os.path.join(root, "locale")
cwd = os.getcwd()
if args.lang in countries:
country = countries[args.lang]
else:
country = args.lang
parser = argparse.ArgumentParser(
prog='check_po.py',
description='Check that all strings are translated in a .po file')
flag = ''
for i in country.upper():
flag += chr(ord(i) + ord('🇦') - ord('A'))
parser.add_argument('lang', type=str, nargs="*")
parser.add_argument('--github-repository')
parser.add_argument('--github-token')
parser.add_argument('--manage-issues', action="store_true")
missing = 0
for i in po_ref:
if not i.obsolete:
if not i.msgid in entries:
missing = missing + 1
print(f"::notice file={args.file}::{flag} Translation for {repr(i.msgid)} is missing")
args = parser.parse_args()
if missing > 0:
print(f"::warning file={args.file}::{flag} {missing} translations missing")
sys.exit(1)
if len(args.lang) == 0:
for d in sorted(os.listdir(locale_dir)):
if os.path.isdir(os.path.join(locale_dir, d)):
args.lang.append(d)
if args.manage_issues:
from github import Github, Auth
gh = Github(auth=Auth.Token(args.github_token))
repo = gh.get_repo(args.github_repository)
with tempfile.TemporaryDirectory() as tmpdir:
client_pot = os.path.join(tmpdir, "client.pot")
dashboard_pot = os.path.join(tmpdir, "dashboard.pot")
subprocess.check_call(
["xgettext",
"--c++", "--from-code=UTF-8",
"--keyword=_:1,1t",
"--keyword=_S:1,1t",
"--keyword=_cS:1c,2,2t",
"--keyword=_F:1,1t",
"--output", client_pot,
"--package-name=WiVRn",
] + sorted(list_files(os.path.join(root, "client"), ".cpp"))
)
subprocess.check_call(
["xgettext",
"--c++", "--kde", "--from-code=UTF-8",
"--keyword=i18n:1",
"--keyword=i18nc:1c,2",
"--keyword=i18np:1,2",
"--keyword=i18ncp:1c,2,3",
"--output", dashboard_pot,
"--package-name=WiVRn-dashboard",
] + sorted(list_files(os.path.join(root, "dashboard"), [".cpp", ".qml"]))
)
client_ref = polib.pofile(client_pot)
dashboard_ref = polib.pofile(dashboard_pot)
for lang in args.lang:
lang_issues = 0
for po_ref, po in ((client_ref, os.path.join(locale_dir, lang, "wivrn.po")),
(dashboard_ref, os.path.join(locale_dir, lang, "wivrn-dashboard.po"))):
if not os.path.exists(po):
continue
po_file = polib.pofile(po)
po = os.path.relpath(po, cwd)
entries = [i.msgid for i in po_file.translated_entries()]
missing = 0
for i in po_ref:
if not i.obsolete:
if not i.msgid in entries:
missing = missing + 1
print(f"::notice file={po}::{flag(lang)} Translation for {repr(i.msgid)} is missing")
lang_issues += missing
if missing > 0:
print(f"::warning file={po}::{flag(lang)} {missing} translations missing")
if args.manage_issues:
issues = [i for i in repo.get_issues(state="all", labels = [ISSUE_LABEL]) if i.title == ISSUE_TITLE.format(lang=lang)]
if lang_issues > 0:
if issues:
for issue in issues:
if issue.state != "open":
issue.edit(state="open")
else:
issue = repo.create_issue(
title=ISSUE_TITLE.format(lang=lang),
labels=[ISSUE_LABEL]
)
else:
for issue in issues:
issue.edit(state="closed")