Commit 383807a6 authored by Mikhail Tergoev's avatar Mikhail Tergoev

Merge branch 'hardmode-2' of github.com:Htylol/PortWINE into Htylol-hardmode-2

parents 7fc4ea3a f29808f4
......@@ -7,7 +7,7 @@
msgid ""
msgstr "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-10-24 12:43+0500\n"
"POT-Creation-Date: 2024-10-26 06:41+0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
......@@ -59,10 +59,13 @@ msgstr ""
msgid "Create shortcut for select file..."
msgstr ""
msgid "DELETE SHORTCUT"
msgid "CHANGE SHORTCUT"
msgstr ""
msgid "Delete shortcut for select file..."
msgid "Change shortcut for select file..."
msgstr ""
msgid "Launching"
msgstr ""
msgid "Base settings"
......@@ -227,9 +230,6 @@ msgstr ""
msgid "Downloading"
msgstr ""
msgid "Launching"
msgstr ""
msgid "day"
msgstr ""
......@@ -1426,6 +1426,9 @@ msgstr ""
msgid "The shortcut will be created in the PortProton directory."
msgstr ""
msgid "Name"
msgstr ""
msgid "Add shortcut to MENU -> GAMES"
msgstr ""
......@@ -1435,17 +1438,16 @@ msgstr ""
msgid "Add shortcut to STEAM library"
msgstr ""
msgid "Name"
msgid "For adding shortcut to STEAM, needed restart.\\n\\nRestart STEAM now?"
msgstr ""
msgid "A higher number of duplicate desktop files were found for this file."
"\\nShould I delete the extra ones or not?"
msgid "Restarting STEAM... Please wait."
msgstr ""
msgid "For adding shortcut to STEAM, needed restart.\\n\\nRestart STEAM now?"
msgid "The shortcut will be changed in the PortProton directory."
msgstr ""
msgid "Restarting STEAM... Please wait."
msgid "REMOVE SHORTCUT"
msgstr ""
msgid "Could not find the file:"
......@@ -1455,6 +1457,9 @@ msgid "ATTENTION:\\nIf you forgot to mount the disk with the running "
"application, click CANCEL!"
msgstr ""
msgid "DELETE SHORTCUT"
msgstr ""
msgid "Starting prefix manager:"
msgstr ""
......
......@@ -8,15 +8,15 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-10-24 13:48+0500\n"
"PO-Revision-Date: 2024-10-24 13:51+0500\n"
"POT-Creation-Date: 2024-10-26 06:41+0500\n"
"PO-Revision-Date: 2024-10-26 13:58+0500\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: es_ES\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 3.4.2\n"
"X-Generator: Poedit 3.4.4\n"
msgid ""
"A running PortProton session was detected.\\nDo you want to end the previous "
......@@ -64,11 +64,14 @@ msgstr "CREAR ACCESO DIRECTO"
msgid "Create shortcut for select file..."
msgstr "Crear un acceso directo para el archivo seleccionado..."
msgid "DELETE SHORTCUT"
msgstr "ELIMINAR ACCESO DIRECTO"
msgid "CHANGE SHORTCUT"
msgstr "CAMBIAR ACCESO DIRECTO"
msgid "Delete shortcut for select file..."
msgstr "Eliminar el acceso directo del archivo seleccionado..."
msgid "Change shortcut for select file..."
msgstr "Cambiar un acceso directo para el archivo seleccionado..."
msgid "Launching"
msgstr "Lanzamiento"
msgid "Base settings"
msgstr "Configuración básica"
......@@ -247,9 +250,6 @@ msgstr ""
msgid "Downloading"
msgstr "Descargando"
msgid "Launching"
msgstr "Lanzamiento"
msgid "day"
msgstr "día"
......@@ -1858,6 +1858,9 @@ msgstr "¿Realmente deseas restablecer la configuración de"
msgid "The shortcut will be created in the PortProton directory."
msgstr "El acceso directo se creará en el directorio de PortProton."
msgid "Name"
msgstr "Nombre"
msgid "Add shortcut to MENU -> GAMES"
msgstr "Agregar acceso directo a MENU -> JUEGOS"
......@@ -1867,16 +1870,6 @@ msgstr "Agregar acceso directo al escritorio"
msgid "Add shortcut to STEAM library"
msgstr "Agregar acceso directo a la biblioteca de STEAM"
msgid "Name"
msgstr "Nombre"
msgid ""
"A higher number of duplicate desktop files were found for this file."
"\\nShould I delete the extra ones or not?"
msgstr ""
"Se encontraron un mayor número de archivos de escritorio duplicados para "
"este archivo.\\n¿Debería eliminar los adicionales o no?"
msgid "For adding shortcut to STEAM, needed restart.\\n\\nRestart STEAM now?"
msgstr ""
"Para agregar el acceso directo a STEAM, es necesario reiniciar.\\n\\¿Quieres "
......@@ -1885,6 +1878,12 @@ msgstr ""
msgid "Restarting STEAM... Please wait."
msgstr "Restarting STEAM... Please wait."
msgid "The shortcut will be changed in the PortProton directory."
msgstr "El acceso directo se cambiará en el directorio de PortProton."
msgid "REMOVE SHORTCUT"
msgstr "ELIMINAR ACCESO DIRECTO"
msgid "Could not find the file:"
msgstr "No se pudo encontrar el archivo:"
......@@ -1896,6 +1895,9 @@ msgstr ""
"Si olvidaste montar el disco con la aplicación en ejecución, ¡haz clic en "
"CANCELAR!"
msgid "DELETE SHORTCUT"
msgstr "ELIMINAR ACCESO DIRECTO"
msgid "Starting prefix manager:"
msgstr "Iniciando el administrador de prefijos:"
......@@ -2173,6 +2175,16 @@ msgstr ""
msgid "Please wait. downloading covers for"
msgstr "Por favor, espera. Descargando portadas para"
#~ msgid ""
#~ "A higher number of duplicate desktop files were found for this file."
#~ "\\nShould I delete the extra ones or not?"
#~ msgstr ""
#~ "Se encontraron un mayor número de archivos de escritorio duplicados para "
#~ "este archivo.\\n¿Debería eliminar los adicionales o no?"
#~ msgid "Delete shortcut for select file..."
#~ msgstr "Eliminar el acceso directo del archivo seleccionado..."
#~ msgid "Forced activation of vertical sync"
#~ msgstr "Activación forzada de la sincronización vertical"
......
......@@ -7,8 +7,8 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-10-24 12:43+0500\n"
"PO-Revision-Date: 2024-10-24 12:45+0500\n"
"POT-Creation-Date: 2024-10-26 06:41+0500\n"
"PO-Revision-Date: 2024-10-26 06:43+0500\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: ru_RU\n"
......@@ -17,7 +17,7 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && "
"n%10<=4 && (n%100<12 || n%100>14) ? 1 : 2);\n"
"X-Generator: Poedit 3.4.2\n"
"X-Generator: Poedit 3.4.4\n"
msgid ""
"A running PortProton session was detected.\\nDo you want to end the previous "
......@@ -64,11 +64,14 @@ msgstr "СОЗДАТЬ ЯРЛЫК"
msgid "Create shortcut for select file..."
msgstr "Создать ярлык для выбранного файла..."
msgid "DELETE SHORTCUT"
msgstr "УДАЛИТЬ ЯРЛЫК"
msgid "CHANGE SHORTCUT"
msgstr "ИЗМЕНИТЬ ЯРЛЫК"
msgid "Delete shortcut for select file..."
msgstr "Удалить ярлык для выбранного файла..."
msgid "Change shortcut for select file..."
msgstr "Изменить ярлык для выбранного файла..."
msgid "Launching"
msgstr "Запуск"
msgid "Base settings"
msgstr "Основные настройки"
......@@ -249,9 +252,6 @@ msgstr ""
msgid "Downloading"
msgstr "Загружается"
msgid "Launching"
msgstr "Запуск"
msgid "day"
msgstr "день"
......@@ -1836,6 +1836,9 @@ msgstr "Вы действительно хотите сбросить настр
msgid "The shortcut will be created in the PortProton directory."
msgstr "Ярлык будет создан в каталоге PortProton."
msgid "Name"
msgstr "Имя"
msgid "Add shortcut to MENU -> GAMES"
msgstr "Добавить ярлык в МЕНЮ -> ИГРЫ"
......@@ -1845,14 +1848,6 @@ msgstr "Добавить ярлык на рабочий стол"
msgid "Add shortcut to STEAM library"
msgstr "Добавить ярлык в библиотеку STEAM"
msgid "Name"
msgstr "Имя"
msgid ""
"A higher number of duplicate desktop files were found for this file."
"\\nShould I delete the extra ones or not?"
msgstr "Найдены дубликаты создаваемого ярлыка.\\nУдалить лишние ярлыки?"
msgid "For adding shortcut to STEAM, needed restart.\\n\\nRestart STEAM now?"
msgstr ""
"Для добавления ярлыка в STEAM требуется перезапуск.\\n\\nПерезапустить STEAM "
......@@ -1861,6 +1856,12 @@ msgstr ""
msgid "Restarting STEAM... Please wait."
msgstr "Перезапускаем STEAM... Пожалуйста, подождите."
msgid "The shortcut will be changed in the PortProton directory."
msgstr "Ярлык будет изменён в каталоге PortProton."
msgid "REMOVE SHORTCUT"
msgstr "УДАЛИТЬ ЯРЛЫК"
msgid "Could not find the file:"
msgstr "Не удалось найти файл:"
......@@ -1871,6 +1872,9 @@ msgstr ""
"ВНИМАНИЕ:\\nЕсли вы забыли примонтировать диск с запускаемым приложением, "
"нажмите ОТМЕНИТЬ!"
msgid "DELETE SHORTCUT"
msgstr "УДАЛИТЬ ЯРЛЫК"
msgid "Starting prefix manager:"
msgstr "Запуск менеджера префиксов:"
......@@ -2157,6 +2161,14 @@ msgstr "SteamGridDB не отвечает, принудительно отклю
msgid "Please wait. downloading covers for"
msgstr "Пожалуйста, подождите. Загрузка обложек для"
#~ msgid ""
#~ "A higher number of duplicate desktop files were found for this file."
#~ "\\nShould I delete the extra ones or not?"
#~ msgstr "Найдены дубликаты создаваемого ярлыка.\\nУдалить лишние ярлыки?"
#~ msgid "Delete shortcut for select file..."
#~ msgstr "Удалить ярлык для выбранного файла..."
#~ msgid "Forced activation of vertical sync"
#~ msgstr "Принудительное включение вертикальной синхронизации"
......
......@@ -151,6 +151,7 @@ source "${PORT_SCRIPTS_PATH}/var"
export STEAM_SCRIPTS="${PORT_WINE_PATH}/steam_scripts"
export PW_PLUGINS_PATH="${PORT_WINE_TMP_PATH}/plugins${PW_PLUGINS_VER}"
export PW_CACHE_LANG_PATH="${PORT_WINE_TMP_PATH}/cache_lang/"
export PW_DATABASE_PATH="${PORT_WINE_TMP_PATH}/pw_database/"
export PW_GUI_ICON_PATH="${PORT_WINE_PATH}/data/img/gui"
export PW_GUI_THEMES_PATH="${PORT_WINE_PATH}/data/themes"
export pw_yad="${PW_GUI_THEMES_PATH}/gui/yad_gui_pp"
......@@ -178,9 +179,11 @@ try_remove_file "${PW_TMPFS_PATH}/update_pfx_log"
# shellcheck source=/dev/null
source "${USER_CONF}"
if [[ ! -f "${PW_CACHE_LANG_PATH}/$LANGUAGE" ]] ; then
create_translations
if [[ ! -f $PW_DATABASE_PATH/database ]] ; then
create_new_dir "$PW_DATABASE_PATH"
touch "$PW_DATABASE_PATH/database"
fi
[[ ! -f "${PW_CACHE_LANG_PATH}/$LANGUAGE" ]] && create_translations
unset translations
# shellcheck source=/dev/null
......@@ -491,10 +494,10 @@ if [[ -f "${portwine_exe}" ]] ; then
fi
if [[ "${PW_GUI_DISABLED_CS}" != 1 ]] ; then
pw_create_gui_png
if ! grep -il "${portwine_exe}" "${HOME}/.local/share/applications"/*.desktop &>/dev/null ; then
if ! grep -il "${portwine_exe}" "$PORT_WINE_PATH"/*.desktop &>/dev/null ; then
PW_SHORTCUT="${translations[CREATE SHORTCUT]}!$PW_GUI_ICON_PATH/$BUTTON_SIZE.png!${translations[Create shortcut for select file...]}:100"
else
PW_SHORTCUT="${translations[DELETE SHORTCUT]}!$PW_GUI_ICON_PATH/$BUTTON_SIZE.png!${translations[Delete shortcut for select file...]}:98"
PW_SHORTCUT="${translations[CHANGE SHORTCUT]}!$PW_GUI_ICON_PATH/$BUTTON_SIZE.png!${translations[Change shortcut for select file...]}:98"
fi
create_name_desktop
......@@ -616,49 +619,43 @@ else
desktop_file_new="${desktop_file//"$PORT_WINE_PATH/"/}"
if [[ $desktop_file_new =~ .desktop$ ]] ; then
if [[ ! $desktop_file_new =~ (PortProton|readme) ]] ; then
while IFS= read -r line ; do
if [[ $line =~ ^Exec= ]] ; then
while IFS= read -r line1 ; do
if [[ $line1 =~ ^Exec= ]] ; then
if check_flatpak ; then
PW_NAME_D_ICON["$AMOUNT_GENERATE_BUTTONS"]=${line//Exec=flatpak run ru.linux_gaming.PortProton /}
PW_NAME_D_ICON["$AMOUNT_GENERATE_BUTTONS"]=${line1//Exec=flatpak run ru.linux_gaming.PortProton /}
else
PW_NAME_D_ICON["$AMOUNT_GENERATE_BUTTONS"]=${line//Exec=env \"$PORT_SCRIPTS_PATH\/start.sh\" /}
PW_NAME_D_ICON["$AMOUNT_GENERATE_BUTTONS"]=${line1//Exec=env \"$PORT_SCRIPTS_PATH\/start.sh\" /}
fi
fi
[[ $line =~ ^Icon= ]] && PW_ICON_PATH["$AMOUNT_GENERATE_BUTTONS"]="${line//Icon=/}"
[[ $line =~ ^#Time= ]] && PW_GAME_TIME["$AMOUNT_GENERATE_BUTTONS"]="${line//#Time=/}"
[[ $line =~ ^#NEW_DESKTOP ]] && NEW_DESKTOP=1
[[ $line1 =~ ^Icon= ]] && PW_ICON_PATH["$AMOUNT_GENERATE_BUTTONS"]=${line1//Icon=/}
done < "$desktop_file"
PW_ALL_DF["$AMOUNT_GENERATE_BUTTONS"]="$desktop_file_new"
if [[ $SORT_WITH_TIME == enabled ]] && [[ $NEW_DESKTOP == 1 ]] ; then
unset NEW_DESKTOP
sed -i '/^#NEW_DESKTOP/d' "$desktop_file"
PW_AMOUNT_NEW_DESKTOP+=($AMOUNT_GENERATE_BUTTONS)
else
PW_AMOUNT_OLD_DESKTOP+=($AMOUNT_GENERATE_BUTTONS)
fi
# Для конвертация .desktop файлов flatpak в натив и наоборот
# Для конвертации существующих .desktop файлов flatpak в натив и наоборот
if [[ ${PW_NAME_D_ICON["$AMOUNT_GENERATE_BUTTONS"]} =~ ^"Exec=flatpak run ru.linux_gaming.PortProton " ]] ; then
PW_NAME_D_ICON["$AMOUNT_GENERATE_BUTTONS"]=${PW_NAME_D_ICON["$AMOUNT_GENERATE_BUTTONS"]//Exec=flatpak run ru.linux_gaming.PortProton /}
NEED_FIXES_DESKTOP=1
sed -i "s|Exec=flatpak run ru.linux_gaming.PortProton|Exec=env \"$PORT_SCRIPTS_PATH/start.sh\"|" "$desktop_file"
elif [[ ${PW_NAME_D_ICON["$AMOUNT_GENERATE_BUTTONS"]} =~ ^"Exec=env \"$PORT_SCRIPTS_PATH/start.sh\" " ]] ; then
PW_NAME_D_ICON["$AMOUNT_GENERATE_BUTTONS"]=${PW_NAME_D_ICON["$AMOUNT_GENERATE_BUTTONS"]//Exec=env \"$PORT_SCRIPTS_PATH\/start.sh\" /}
NEED_FIXES_DESKTOP=1
sed -i "s|Exec=env \"$PORT_SCRIPTS_PATH/start.sh\"|Exec=flatpak run ru.linux_gaming.PortProton|" "$desktop_file"
fi
# Для фикса битых #Time=
if [[ ! ${PW_GAME_TIME["$AMOUNT_GENERATE_BUTTONS"]} =~ [0-9]+ ]] \
|| (( ${PW_GAME_TIME["$AMOUNT_GENERATE_BUTTONS"]} >= 999999999 )) \
|| [[ $NEED_FIXES_DESKTOP == 1 ]]
then
portwine_exe=${PW_NAME_D_ICON["$AMOUNT_GENERATE_BUTTONS"]//\"/}
search_desktop_file
unset portwine_exe NEED_FIXES_DESKTOP
PW_GAME_TIME["$AMOUNT_GENERATE_BUTTONS"]=$TIME_CURRENT
while IFS=" " read -r -a line2 ; do
if [[ \"${line2[0]//#@_@#/ }\" == "${PW_NAME_D_ICON["$AMOUNT_GENERATE_BUTTONS"]}" ]] ; then
PW_GAME_TIME["$AMOUNT_GENERATE_BUTTONS"]=${line2[2]}
break
else
PW_GAME_TIME["$AMOUNT_GENERATE_BUTTONS"]=0
fi
done < "$PW_DATABASE_PATH/database"
if [[ $SORT_WITH_TIME == enabled ]] && [[ ${line2[3]} == NEW_DESKTOP ]] ; then
sed -i "s/${line2[1]} ${line2[2]} NEW_DESKTOP/${line2[1]} ${line2[2]} OLD_DESKTOP/" "$PW_DATABASE_PATH/database"
PW_AMOUNT_NEW_DESKTOP+=($AMOUNT_GENERATE_BUTTONS)
else
PW_AMOUNT_OLD_DESKTOP+=($AMOUNT_GENERATE_BUTTONS)
fi
(( AMOUNT_GENERATE_BUTTONS++ ))
fi
fi
done
# Переопределение элементов в массивах в зависимости от PW_GAME_TIME, от большего значения к меньшему.
# 10 миллисекунд на 40 .desktop файлов, работает быстро
if [[ $SORT_WITH_TIME == enabled ]] && [[ -n ${PW_GAME_TIME[1]} ]] ; then
......@@ -683,7 +680,6 @@ else
done
done
fi
# Генерация .desktop баттанов для главного меню
IFS=$'\n'
PW_GENERATE_BUTTONS="--field= ${translations[Create shortcut...]}!${PW_GUI_ICON_PATH}/find_48.svg!:FBTNR%@bash -c \"button_click --normal pw_find_exe\"%"
......@@ -903,7 +899,7 @@ case "$PW_YAD_SET" in
esac
case "$PW_YAD_SET" in
98) portwine_delete_shortcut ;;
98) portwine_change_shortcut ;;
100) portwine_create_shortcut ;;
DEBUG|102) portwine_start_debug ;;
106) portwine_launch ;;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment