forked from Boria138/PortProtonQt
feat(settings): added proton, 3d_api and prefixes settings
Signed-off-by: Boris Yumankulov <boria138@altlinux.org>
This commit is contained in:
@@ -1695,6 +1695,17 @@ class ExeSettingsDialog(QDialog):
|
|||||||
base_path = os.path.join(self.portproton_path, "data")
|
base_path = os.path.join(self.portproton_path, "data")
|
||||||
self.start_sh = [os.path.join(base_path, "scripts", "start.sh")]
|
self.start_sh = [os.path.join(base_path, "scripts", "start.sh")]
|
||||||
|
|
||||||
|
self.dist_options = []
|
||||||
|
self.prefix_options = []
|
||||||
|
if self.portproton_path:
|
||||||
|
dist_dir = os.path.join(self.portproton_path, 'dist')
|
||||||
|
if os.path.exists(dist_dir):
|
||||||
|
self.dist_options = [f for f in os.listdir(dist_dir) if os.path.isdir(os.path.join(dist_dir, f))]
|
||||||
|
|
||||||
|
prefixes_dir = os.path.join(self.portproton_path, 'prefixes')
|
||||||
|
if os.path.exists(prefixes_dir):
|
||||||
|
self.prefix_options = [f for f in os.listdir(prefixes_dir) if os.path.isdir(os.path.join(prefixes_dir, f))]
|
||||||
|
|
||||||
self.current_settings = {}
|
self.current_settings = {}
|
||||||
self.value_widgets = {}
|
self.value_widgets = {}
|
||||||
self.original_values = {}
|
self.original_values = {}
|
||||||
@@ -1961,7 +1972,9 @@ class ExeSettingsDialog(QDialog):
|
|||||||
locale_options=self.locale_options,
|
locale_options=self.locale_options,
|
||||||
amd_vulkan_drivers=self.amd_vulkan_drivers,
|
amd_vulkan_drivers=self.amd_vulkan_drivers,
|
||||||
is_amd=self.is_amd,
|
is_amd=self.is_amd,
|
||||||
numa_nodes=self.numa_nodes
|
numa_nodes=self.numa_nodes,
|
||||||
|
dist_options=self.dist_options,
|
||||||
|
prefix_options=self.prefix_options
|
||||||
)
|
)
|
||||||
|
|
||||||
# Populate table
|
# Populate table
|
||||||
|
|||||||
@@ -46,14 +46,47 @@ def get_toggle_settings():
|
|||||||
|
|
||||||
|
|
||||||
def get_advanced_settings(disabled_text, logical_core_options, locale_options,
|
def get_advanced_settings(disabled_text, logical_core_options, locale_options,
|
||||||
amd_vulkan_drivers, is_amd, numa_nodes):
|
amd_vulkan_drivers, is_amd, numa_nodes, dist_options=None, prefix_options=None):
|
||||||
"""Get advanced settings configuration."""
|
"""Get advanced settings configuration."""
|
||||||
from portprotonqt.localization import _
|
from portprotonqt.localization import _
|
||||||
|
|
||||||
|
|
||||||
advanced_settings = []
|
advanced_settings = []
|
||||||
|
if dist_options is None:
|
||||||
|
dist_options = []
|
||||||
|
if prefix_options is None:
|
||||||
|
prefix_options = []
|
||||||
|
|
||||||
# 1. Windows version
|
# 1. Wine Version
|
||||||
|
advanced_settings.append({
|
||||||
|
'key': 'PW_WINE_USE',
|
||||||
|
'name': _("Wine Version"),
|
||||||
|
'description': _("Select the Wine or Proton version to use for this executable."),
|
||||||
|
'type': 'combo',
|
||||||
|
'options': dist_options,
|
||||||
|
'default': ''
|
||||||
|
})
|
||||||
|
|
||||||
|
# 2. Prefix Name
|
||||||
|
advanced_settings.append({
|
||||||
|
'key': 'PW_PREFIX_NAME',
|
||||||
|
'name': _("Prefix Name"),
|
||||||
|
'description': _("Select the Wine prefix to use."),
|
||||||
|
'type': 'combo',
|
||||||
|
'options': prefix_options,
|
||||||
|
'default': 'DEFAULT'
|
||||||
|
})
|
||||||
|
|
||||||
|
# 3. Vulkan Backend
|
||||||
|
advanced_settings.append({
|
||||||
|
'key': 'PW_VULKAN_USE',
|
||||||
|
'name': _("Vulkan Backend"),
|
||||||
|
'description': _("Select Vulkan rendering backend:\n0 - WINED3D OpenGL\n1 - DXVK-Sarek and VKD3D\n2 - Stable DXVK and VKD3D\n6 - Newest DXVK and VKD3D"),
|
||||||
|
'type': 'combo',
|
||||||
|
'options': [ '0', '1', '2', '6'],
|
||||||
|
'default': '6'
|
||||||
|
})
|
||||||
|
|
||||||
|
# 4. Windows version
|
||||||
advanced_settings.append({
|
advanced_settings.append({
|
||||||
'key': 'PW_WINDOWS_VER',
|
'key': 'PW_WINDOWS_VER',
|
||||||
'name': _("Windows version"),
|
'name': _("Windows version"),
|
||||||
@@ -63,7 +96,7 @@ def get_advanced_settings(disabled_text, logical_core_options, locale_options,
|
|||||||
'default': '10'
|
'default': '10'
|
||||||
})
|
})
|
||||||
|
|
||||||
# 2. DLL Overrides
|
# 5. DLL Overrides
|
||||||
advanced_settings.append({
|
advanced_settings.append({
|
||||||
'key': 'WINEDLLOVERRIDES',
|
'key': 'WINEDLLOVERRIDES',
|
||||||
'name': _("DLL Overrides"),
|
'name': _("DLL Overrides"),
|
||||||
@@ -72,7 +105,7 @@ def get_advanced_settings(disabled_text, logical_core_options, locale_options,
|
|||||||
'default': ''
|
'default': ''
|
||||||
})
|
})
|
||||||
|
|
||||||
# 3. Launch arguments
|
# 6. Launch arguments
|
||||||
advanced_settings.append({
|
advanced_settings.append({
|
||||||
'key': 'LAUNCH_PARAMETERS',
|
'key': 'LAUNCH_PARAMETERS',
|
||||||
'name': _("Launch Arguments"),
|
'name': _("Launch Arguments"),
|
||||||
@@ -81,7 +114,7 @@ def get_advanced_settings(disabled_text, logical_core_options, locale_options,
|
|||||||
'default': ''
|
'default': ''
|
||||||
})
|
})
|
||||||
|
|
||||||
# 4. CPU cores limit
|
# 7. CPU cores limit
|
||||||
advanced_settings.append({
|
advanced_settings.append({
|
||||||
'key': 'PW_WINE_CPU_TOPOLOGY',
|
'key': 'PW_WINE_CPU_TOPOLOGY',
|
||||||
'name': _("CPU Cores Limit"),
|
'name': _("CPU Cores Limit"),
|
||||||
@@ -91,7 +124,7 @@ def get_advanced_settings(disabled_text, logical_core_options, locale_options,
|
|||||||
'default': disabled_text
|
'default': disabled_text
|
||||||
})
|
})
|
||||||
|
|
||||||
# 5. OpenGL version
|
# 8. OpenGL version
|
||||||
advanced_settings.append({
|
advanced_settings.append({
|
||||||
'key': 'PW_MESA_GL_VERSION_OVERRIDE',
|
'key': 'PW_MESA_GL_VERSION_OVERRIDE',
|
||||||
'name': _("OpenGL Version"),
|
'name': _("OpenGL Version"),
|
||||||
@@ -101,7 +134,7 @@ def get_advanced_settings(disabled_text, logical_core_options, locale_options,
|
|||||||
'default': disabled_text
|
'default': disabled_text
|
||||||
})
|
})
|
||||||
|
|
||||||
# 6. VKD3D feature level
|
# 9. VKD3D feature level
|
||||||
advanced_settings.append({
|
advanced_settings.append({
|
||||||
'key': 'PW_VKD3D_FEATURE_LEVEL',
|
'key': 'PW_VKD3D_FEATURE_LEVEL',
|
||||||
'name': _("VKD3D Feature Level"),
|
'name': _("VKD3D Feature Level"),
|
||||||
@@ -111,7 +144,7 @@ def get_advanced_settings(disabled_text, logical_core_options, locale_options,
|
|||||||
'default': disabled_text
|
'default': disabled_text
|
||||||
})
|
})
|
||||||
|
|
||||||
# 7. Locale
|
# 10. Locale
|
||||||
advanced_settings.append({
|
advanced_settings.append({
|
||||||
'key': 'PW_LOCALE_SELECT',
|
'key': 'PW_LOCALE_SELECT',
|
||||||
'name': _("Locale"),
|
'name': _("Locale"),
|
||||||
@@ -121,7 +154,7 @@ def get_advanced_settings(disabled_text, logical_core_options, locale_options,
|
|||||||
'default': disabled_text
|
'default': disabled_text
|
||||||
})
|
})
|
||||||
|
|
||||||
# 8. Present mode
|
# 11. Present mode
|
||||||
advanced_settings.append({
|
advanced_settings.append({
|
||||||
'key': 'PW_MESA_VK_WSI_PRESENT_MODE',
|
'key': 'PW_MESA_VK_WSI_PRESENT_MODE',
|
||||||
'name': _("Window Mode"),
|
'name': _("Window Mode"),
|
||||||
@@ -131,7 +164,7 @@ def get_advanced_settings(disabled_text, logical_core_options, locale_options,
|
|||||||
'default': disabled_text
|
'default': disabled_text
|
||||||
})
|
})
|
||||||
|
|
||||||
# 9. AMD Vulkan driver
|
# 12. AMD Vulkan driver
|
||||||
amd_options = [disabled_text] + amd_vulkan_drivers if is_amd and amd_vulkan_drivers else [disabled_text]
|
amd_options = [disabled_text] + amd_vulkan_drivers if is_amd and amd_vulkan_drivers else [disabled_text]
|
||||||
advanced_settings.append({
|
advanced_settings.append({
|
||||||
'key': 'PW_AMD_VULKAN_USE',
|
'key': 'PW_AMD_VULKAN_USE',
|
||||||
@@ -142,7 +175,7 @@ def get_advanced_settings(disabled_text, logical_core_options, locale_options,
|
|||||||
'default': disabled_text
|
'default': disabled_text
|
||||||
})
|
})
|
||||||
|
|
||||||
# 10. NUMA node
|
# 13. NUMA node
|
||||||
numa_ids = sorted(numa_nodes.keys())
|
numa_ids = sorted(numa_nodes.keys())
|
||||||
numa_options = [disabled_text] + numa_ids if len(numa_ids) > 1 else [disabled_text]
|
numa_options = [disabled_text] + numa_ids if len(numa_ids) > 1 else [disabled_text]
|
||||||
advanced_settings.append({
|
advanced_settings.append({
|
||||||
@@ -159,6 +192,9 @@ def get_advanced_settings(disabled_text, logical_core_options, locale_options,
|
|||||||
|
|
||||||
# Keys that should be recognized as advanced settings
|
# Keys that should be recognized as advanced settings
|
||||||
ADVANCED_SETTING_KEYS = [
|
ADVANCED_SETTING_KEYS = [
|
||||||
|
'PW_WINE_USE',
|
||||||
|
'PW_PREFIX_NAME',
|
||||||
|
'PW_VULKAN_USE',
|
||||||
'PW_WINDOWS_VER',
|
'PW_WINDOWS_VER',
|
||||||
'WINEDLLOVERRIDES',
|
'WINEDLLOVERRIDES',
|
||||||
'LAUNCH_PARAMETERS',
|
'LAUNCH_PARAMETERS',
|
||||||
|
|||||||
Reference in New Issue
Block a user