From ec00863aff826bc63f221136caf54da8b9285201 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Tue, 29 Oct 2019 04:32:59 +0100 Subject: proto/wine: add support for setting WINEPREFIX --- proto-wine/ftnoir_protocol_wine.cpp | 13 ++++++ proto-wine/ftnoir_protocol_wine.h | 6 ++- proto-wine/ftnoir_protocol_wine_dialog.cpp | 1 + proto-wine/ftnoir_winecontrols.ui | 72 +++++++++++++++++++++++++----- proto-wine/lang/nl_NL.ts | 10 +++-- proto-wine/lang/ru_RU.ts | 10 +++-- proto-wine/lang/stub.ts | 10 +++-- proto-wine/lang/zh_CN.ts | 10 +++-- 8 files changed, 108 insertions(+), 24 deletions(-) (limited to 'proto-wine') diff --git a/proto-wine/ftnoir_protocol_wine.cpp b/proto-wine/ftnoir_protocol_wine.cpp index ae7c6c31..bed1fed3 100644 --- a/proto-wine/ftnoir_protocol_wine.cpp +++ b/proto-wine/ftnoir_protocol_wine.cpp @@ -70,6 +70,19 @@ module_status wine::initialize() wine_path = proton_path(s.proton_version); env = make_steam_environ(s.proton_version, s.proton_appid); } + else + { + QString wineprefix = "~/.wine"; + if (!s.wineprefix->isEmpty()) + wineprefix = s.wineprefix; + if (wineprefix[0] == '~') + wineprefix = qgetenv("HOME") + wineprefix.mid(1); + + if (wineprefix[0] != '/') + error(tr("Wine prefix must be an absolute path (given '%1')").arg(wineprefix)); + + env.insert("WINEPREFIX", wineprefix); + } if (s.esync) env.insert("WINEESYNC", "1"); diff --git a/proto-wine/ftnoir_protocol_wine.h b/proto-wine/ftnoir_protocol_wine.h index 9266e455..8175be03 100644 --- a/proto-wine/ftnoir_protocol_wine.h +++ b/proto-wine/ftnoir_protocol_wine.h @@ -22,8 +22,10 @@ struct settings : opts variant_wine{b, "variant-wine", true }, fsync{b, "fsync", true}, esync{b, "esync", true}; - value proton_appid{b, "proton-appid", 0}; - value proton_version{b, "proton-version", {} }; + + value proton_appid{b, "proton-appid", 0}; + value proton_version{b, "proton-version", {} }, + wineprefix{b, "wineprefix", "~/.wine"}; }; class wine : TR, public IProtocol diff --git a/proto-wine/ftnoir_protocol_wine_dialog.cpp b/proto-wine/ftnoir_protocol_wine_dialog.cpp index b63268d0..f1cb01c2 100644 --- a/proto-wine/ftnoir_protocol_wine_dialog.cpp +++ b/proto-wine/ftnoir_protocol_wine_dialog.cpp @@ -19,6 +19,7 @@ FTControls::FTControls() tie_setting(s.esync, ui.esync); tie_setting(s.fsync, ui.fsync); tie_setting(s.proton_appid, ui.proton_appid); + tie_setting(s.wineprefix, ui.wineprefix); connect(ui.buttonBox, &QDialogButtonBox::accepted, this, &FTControls::doOK); connect(ui.buttonBox, &QDialogButtonBox::rejected, this, &FTControls::doCancel); diff --git a/proto-wine/ftnoir_winecontrols.ui b/proto-wine/ftnoir_winecontrols.ui index 12aebd57..a0a1e071 100644 --- a/proto-wine/ftnoir_winecontrols.ui +++ b/proto-wine/ftnoir_winecontrols.ui @@ -9,8 +9,8 @@ 0 0 - 492 - 400 + 544 + 410 @@ -33,10 +33,26 @@ Wine variant + + + + + 0 + 0 + + + + + 120 + 0 + + + + - + 0 0 @@ -46,10 +62,10 @@ - + - + 0 0 @@ -59,17 +75,17 @@ - - + + - + 0 0 - 120 + 286 0 @@ -86,6 +102,12 @@ + + + 0 + 0 + + <html><head/><body><p>When supported.</p></body></html> @@ -96,6 +118,12 @@ + + + 0 + 0 + + <html><head/><body><p>When supported.</p></body></html> @@ -106,16 +134,34 @@ + + + 0 + 0 + + + + + 0 + 0 + + - Steam application id (Proton) + Steam application id + + + 0 + 0 + + 2147483647 @@ -129,6 +175,12 @@ + + + 0 + 0 + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok diff --git a/proto-wine/lang/nl_NL.ts b/proto-wine/lang/nl_NL.ts index e2d594a3..f71d8ad7 100644 --- a/proto-wine/lang/nl_NL.ts +++ b/proto-wine/lang/nl_NL.ts @@ -28,15 +28,15 @@ - Proton (Steam Play) + <html><head/><body><p>When supported.</p></body></html> - <html><head/><body><p>When supported.</p></body></html> + Steam application id - Steam application id (Proton) + Proton (Steam Play) @@ -50,6 +50,10 @@ Must specify application id for Proton (Steam Play) + + Wine prefix must be an absolute path (given '%1') + + wine_metadata diff --git a/proto-wine/lang/ru_RU.ts b/proto-wine/lang/ru_RU.ts index afd33eea..9937083f 100644 --- a/proto-wine/lang/ru_RU.ts +++ b/proto-wine/lang/ru_RU.ts @@ -28,15 +28,15 @@ - Proton (Steam Play) + <html><head/><body><p>When supported.</p></body></html> - <html><head/><body><p>When supported.</p></body></html> + Steam application id - Steam application id (Proton) + Proton (Steam Play) @@ -50,6 +50,10 @@ Must specify application id for Proton (Steam Play) + + Wine prefix must be an absolute path (given '%1') + + wine_metadata diff --git a/proto-wine/lang/stub.ts b/proto-wine/lang/stub.ts index b0ced919..9b74a44d 100644 --- a/proto-wine/lang/stub.ts +++ b/proto-wine/lang/stub.ts @@ -28,15 +28,15 @@ - Proton (Steam Play) + <html><head/><body><p>When supported.</p></body></html> - <html><head/><body><p>When supported.</p></body></html> + Steam application id - Steam application id (Proton) + Proton (Steam Play) @@ -50,6 +50,10 @@ Must specify application id for Proton (Steam Play) + + Wine prefix must be an absolute path (given '%1') + + wine_metadata diff --git a/proto-wine/lang/zh_CN.ts b/proto-wine/lang/zh_CN.ts index b0ced919..9b74a44d 100644 --- a/proto-wine/lang/zh_CN.ts +++ b/proto-wine/lang/zh_CN.ts @@ -28,15 +28,15 @@ - Proton (Steam Play) + <html><head/><body><p>When supported.</p></body></html> - <html><head/><body><p>When supported.</p></body></html> + Steam application id - Steam application id (Proton) + Proton (Steam Play) @@ -50,6 +50,10 @@ Must specify application id for Proton (Steam Play) + + Wine prefix must be an absolute path (given '%1') + + wine_metadata -- cgit v1.2.3