qt: Use util::DlgFilter for the shader picker

Also fix the translation for its filter
This commit is contained in:
Alexander Babikov
2025-04-07 19:50:42 +05:00
parent 8f1fa1e5da
commit c08775becf
25 changed files with 51 additions and 48 deletions

View File

@@ -894,7 +894,7 @@ msgstr ""
msgid "Monitor in sleep mode"
msgstr ""
msgid "OpenGL Shaders"
msgid "GLSL shaders"
msgstr ""
msgid "You are loading an unsupported configuration"

View File

@@ -894,8 +894,8 @@ msgstr "Configuració de Dispositiu %1"
msgid "Monitor in sleep mode"
msgstr "Monitor en mode estalvi"
msgid "OpenGL Shaders"
msgstr "Shaders OpenGL"
msgid "GLSL shaders"
msgstr "Shaders GLSL"
msgid "You are loading an unsupported configuration"
msgstr "S'està carregant una configuració no suportada"

View File

@@ -894,8 +894,8 @@ msgstr "Nastavení zařízení %1"
msgid "Monitor in sleep mode"
msgstr "Monitor je v režimu spánku"
msgid "OpenGL Shaders"
msgstr "Shadery OpenGL"
msgid "GLSL shaders"
msgstr "Shadery GLSL"
msgid "You are loading an unsupported configuration"
msgstr "Pokoušíte se spustit nepodporovanou konfiguraci"

View File

@@ -897,8 +897,8 @@ msgstr "%1-Gerätekonfiguration"
msgid "Monitor in sleep mode"
msgstr "Monitor im Standbymodus"
msgid "OpenGL Shaders"
msgstr "OpenGL-Shader"
msgid "GLSL shaders"
msgstr "GLSL-Shader"
msgid "You are loading an unsupported configuration"
msgstr "Zur Zeit wird eine nicht unterstützte Konfiguration geladen"

View File

@@ -894,8 +894,8 @@ msgstr "%1 Configuración de Dispositivo"
msgid "Monitor in sleep mode"
msgstr "Monitor en modo ahorro"
msgid "OpenGL Shaders"
msgstr "Shaders OpenGL"
msgid "GLSL shaders"
msgstr "Shaders GLSL"
msgid "You are loading an unsupported configuration"
msgstr "Está cargando una configuración no soportada"

View File

@@ -894,8 +894,8 @@ msgstr "%1 - Laitteen määritykset"
msgid "Monitor in sleep mode"
msgstr "Näyttö lepotilassa"
msgid "OpenGL Shaders"
msgstr "OpenGL-varjostinohjelmat"
msgid "GLSL shaders"
msgstr "GLSL-varjostinohjelmat"
msgid "You are loading an unsupported configuration"
msgstr "Olet lataamassa ei-tuettuja määrittelyjä"

View File

@@ -894,8 +894,8 @@ msgstr "Configuration du dispositif %1"
msgid "Monitor in sleep mode"
msgstr "Moniteur en mode veille"
msgid "OpenGL Shaders"
msgstr "Shaders OpenGL"
msgid "GLSL shaders"
msgstr "Shaders GLSL"
msgid "You are loading an unsupported configuration"
msgstr "Vous chargez une configuration non prise en charge"

View File

@@ -894,8 +894,8 @@ msgstr "Konfiguracija uređaja %1"
msgid "Monitor in sleep mode"
msgstr "Ekran u stanju mirovanja"
msgid "OpenGL Shaders"
msgstr "OpenGL shaderi"
msgid "GLSL shaders"
msgstr "GLSL shaderi"
msgid "You are loading an unsupported configuration"
msgstr "Učitavate nepodržanu konfiguraciju"

View File

@@ -894,8 +894,8 @@ msgstr "%1 eszközkonfiguráció"
msgid "Monitor in sleep mode"
msgstr "Képernyő alvó módban"
msgid "OpenGL Shaders"
msgstr "OpenGL Shaderek"
msgid "GLSL shaders"
msgstr "GLSL shaderek"
msgid "You are loading an unsupported configuration"
msgstr "Egy nem támogatott konfigurációt tölt be"

View File

@@ -894,8 +894,8 @@ msgstr "Configurazione del dispositivo %1"
msgid "Monitor in sleep mode"
msgstr "Monitor in modalità riposo"
msgid "OpenGL Shaders"
msgstr "Shader OpenGL"
msgid "GLSL shaders"
msgstr "Shader GLSL"
msgid "You are loading an unsupported configuration"
msgstr "Stai caricando una configurazione non supportata"

View File

@@ -894,8 +894,8 @@ msgstr "%1 のデバイス設定"
msgid "Monitor in sleep mode"
msgstr "モニターのスリープモード"
msgid "OpenGL Shaders"
msgstr "OpenGLシェーダー"
msgid "GLSL shaders"
msgstr "GLSLシェーダー"
msgid "You are loading an unsupported configuration"
msgstr "サポートされていないコンフィグを読み込んでいます"

View File

@@ -894,8 +894,8 @@ msgstr "%1 장치 설정"
msgid "Monitor in sleep mode"
msgstr "모니터 절전 모드"
msgid "OpenGL Shaders"
msgstr "OpenGL 쉐이더"
msgid "GLSL shaders"
msgstr "GLSL 쉐이더"
msgid "You are loading an unsupported configuration"
msgstr "지원하지 않는 설정입니다"

View File

@@ -894,8 +894,8 @@ msgstr "%1 Apparaatconfiguratie"
msgid "Monitor in sleep mode"
msgstr "Monitor in slaapstand"
msgid "OpenGL Shaders"
msgstr "OpenGL Shaders"
msgid "GLSL shaders"
msgstr "GLSL Shaders"
msgid "You are loading an unsupported configuration"
msgstr "U laadt een configuratie die niet wordt ondersteund"

View File

@@ -894,8 +894,8 @@ msgstr "Konfiguracja urządzenia %1"
msgid "Monitor in sleep mode"
msgstr "Monitor w trybie czuwania"
msgid "OpenGL Shaders"
msgstr "Shadery OpenGL"
msgid "GLSL shaders"
msgstr "Shadery GLSL"
msgid "You are loading an unsupported configuration"
msgstr "Ładujesz nieobsługiwaną konfigurację"

View File

@@ -894,8 +894,8 @@ msgstr "Configuração do dispositivo %1"
msgid "Monitor in sleep mode"
msgstr "Monitor em modo de suspensão"
msgid "OpenGL Shaders"
msgstr "Shaders OpenGL"
msgid "GLSL shaders"
msgstr "Shaders GLSL"
msgid "You are loading an unsupported configuration"
msgstr "Você está carregando uma configuração não suportada"

View File

@@ -894,8 +894,8 @@ msgstr "Configuração de dispositivo %1"
msgid "Monitor in sleep mode"
msgstr "Ecrã em modo de sono"
msgid "OpenGL Shaders"
msgstr "Shaders OpenGL"
msgid "GLSL shaders"
msgstr "Shaders GLSL"
msgid "You are loading an unsupported configuration"
msgstr "Está a carregar uma configuração sem suporte!"

View File

@@ -894,8 +894,8 @@ msgstr "Конфигурация устройства %1"
msgid "Monitor in sleep mode"
msgstr "Монитор в спящем режиме"
msgid "OpenGL Shaders"
msgstr "Шейдеры OpenGL"
msgid "GLSL shaders"
msgstr "Шейдеры GLSL"
msgid "You are loading an unsupported configuration"
msgstr "Вы загружаете неподдерживаемую конфигурацию"

View File

@@ -894,8 +894,8 @@ msgstr "Konfigurácia zariadenia %1"
msgid "Monitor in sleep mode"
msgstr "Monitor je v režime spánku"
msgid "OpenGL Shaders"
msgstr "Shadery OpenGL"
msgid "GLSL shaders"
msgstr "Shadery GLSL"
msgid "You are loading an unsupported configuration"
msgstr "Pokúšate sa spustiť nepodporovanú konfiguráciu"

View File

@@ -894,8 +894,8 @@ msgstr "Konfiguracija naprave %1"
msgid "Monitor in sleep mode"
msgstr "Zaslon v načinu spanja"
msgid "OpenGL Shaders"
msgstr "Senčilniki OpenGL"
msgid "GLSL shaders"
msgstr "Senčilniki GLSL"
msgid "You are loading an unsupported configuration"
msgstr "Nalagate nepodprto konfiguracijo"

View File

@@ -894,8 +894,8 @@ msgstr "%1 cihaz konfigürasyonu"
msgid "Monitor in sleep mode"
msgstr "Monitör uyku modunda"
msgid "OpenGL Shaders"
msgstr "OpenGL gölgelendiricileri"
msgid "GLSL shaders"
msgstr "GLSL gölgelendiricileri"
msgid "You are loading an unsupported configuration"
msgstr "Desteklenmeyen bir konfigürasyon kullanıyorsunuz"

View File

@@ -894,8 +894,8 @@ msgstr "Конфігурація пристрою %1"
msgid "Monitor in sleep mode"
msgstr "Монітор у сплячому режимі"
msgid "OpenGL Shaders"
msgstr "Шейдери OpenGL"
msgid "GLSL shaders"
msgstr "Шейдери GLSL"
msgid "You are loading an unsupported configuration"
msgstr "Ви завантажуєте непідтримувану конфігурацію"

View File

@@ -894,8 +894,8 @@ msgstr "Tinh chỉnh thiết bị %1"
msgid "Monitor in sleep mode"
msgstr "Màn hình chế độ chờ/ngủ"
msgid "OpenGL Shaders"
msgstr "Shader OpenGL"
msgid "GLSL shaders"
msgstr "Shader GLSL"
msgid "You are loading an unsupported configuration"
msgstr "Bạn đang load tinh chỉnh không được hỗ trợ."

View File

@@ -894,8 +894,8 @@ msgstr "%1 设备配置"
msgid "Monitor in sleep mode"
msgstr "显示器处在睡眠状态"
msgid "OpenGL Shaders"
msgstr "OpenGL 着色器"
msgid "GLSL shaders"
msgstr "GLSL 着色器"
msgid "You are loading an unsupported configuration"
msgstr "正在载入一个不受支持的配置"

View File

@@ -894,8 +894,8 @@ msgstr "%1 裝置設定"
msgid "Monitor in sleep mode"
msgstr "顯示器處在睡眠狀態"
msgid "OpenGL Shaders"
msgstr "OpenGL 著色器"
msgid "GLSL shaders"
msgstr "GLSL 著色器"
msgid "You are loading an unsupported configuration"
msgstr "正在載入一個不受支援的設定"

View File

@@ -2,6 +2,7 @@
#include "ui_qt_openglshadermanagerdialog.h"
#include "qt_mainwindow.hpp"
#include "qt_util.hpp"
extern MainWindow* main_window;
#include "qt_openglshaderconfig.hpp"
@@ -9,6 +10,7 @@ extern MainWindow* main_window;
#include <QListWidgetItem>
#include <QFileDialog>
#include <QMessageBox>
#include <QStringBuilder>
extern "C" {
#include <86box/86box.h>
@@ -166,7 +168,8 @@ void OpenGLShaderManagerDialog::on_buttonMoveDown_clicked()
void OpenGLShaderManagerDialog::on_buttonAdd_clicked()
{
auto res = QFileDialog::getOpenFileName(this, QString(), QString(), "GLSL Shaders (*.glslp *.glsl);;All files (*.*)");
auto res = QFileDialog::getOpenFileName(this, QString(), QString(),
tr("GLSL shaders") % util::DlgFilter({ "glslp", "glsl" }) % tr("All files") % util::DlgFilter({ "*" }, true));
if (!res.isEmpty()) {
auto glslp_file = res.toUtf8();
glslp_t* shaderfile = glslp_parse(glslp_file.data());