Merge branch 'array-for-block' of github.com:Htylol/PortWINE into Htylol-array-for-block
This commit is contained in:
commit
235a267d43
@ -576,7 +576,7 @@ try_download () {
|
||||
curl -f -# -A 'Mozilla/5.0 (compatible; Konqueror/2.1.1; X11)' -H 'Cache-Control: no-cache, no-store' \
|
||||
-H 'Pragma: no-cache' -L ${FIRST_URL[@]} -o "$dest" 2>&1 | \
|
||||
tr '\r' '\n' | sed -ur 's|[# ]+||g;s|.*=.*||g;s|.*|#Downloading at &\n&|g' | \
|
||||
"$pw_yad" --progress --text="${translations[Downloading]} $filename" --auto-close --no-escape \
|
||||
"$pw_yad" --progress --pulsate --text="${translations[Downloading]} $filename" --auto-close --no-escape \
|
||||
--auto-kill --text-align="center" --fixed --no-buttons --title "PortProton" --width=500 --height=90 \
|
||||
--window-icon="$PW_GUI_ICON_PATH/portproton.svg" --borders="$PROGRESS_BAR_BORDERS_SIZE"
|
||||
fi
|
||||
@ -587,7 +587,7 @@ try_download () {
|
||||
curl -f -# -A 'Mozilla/5.0 (compatible; Konqueror/2.1.1; X11)' -H 'Cache-Control: no-cache, no-store' \
|
||||
-H 'Pragma: no-cache' -L ${SECOND_URL[@]} -o "$dest" 2>&1 | \
|
||||
tr '\r' '\n' | sed -ur 's|[# ]+||g;s|.*=.*||g;s|.*|#Downloading at &\n&|g' | \
|
||||
"$pw_yad" --progress --text="${translations[Downloading]} $filename" --auto-close --no-escape \
|
||||
"$pw_yad" --progress --pulsate --text="${translations[Downloading]} $filename" --auto-close --no-escape \
|
||||
--auto-kill --text-align="center" --fixed --no-buttons --title "PortProton" --width=500 --height=90 \
|
||||
--window-icon="$PW_GUI_ICON_PATH/portproton.svg" --borders="$PROGRESS_BAR_BORDERS_SIZE"
|
||||
fi
|
||||
@ -833,7 +833,7 @@ unpack () {
|
||||
set -o pipefail
|
||||
pw_start_progress_bar_cover_block "${COVERS_PATH}/unpacking_${LANGUAGE_GIF}.gif"
|
||||
$command "$1" -C "$2" 2>/dev/null
|
||||
pw_stop_progress_bar_cover_block
|
||||
pw_stop_progress_bar
|
||||
[[ "${PIPESTATUS[0]}" != 0 ]] && print_error "File $1 unpacking error." && return 1 || return 0
|
||||
else
|
||||
$command "$1" -C "$2" && return 0 || return 1
|
||||
@ -1439,7 +1439,7 @@ init_wine_ver () {
|
||||
try_remove_dir "${WINEDIR}/share/wine/${mono_gecko_chk}"
|
||||
try_force_link_dir "${PORT_WINE_TMP_PATH}/${mono_gecko_chk}" "${WINEDIR}"/share/wine/
|
||||
print_info "Copy ${WINEDIR}/share/wine/${mono_gecko_chk} to tmp and create symlink to ${WINEDIR}/share/wine/. OK."
|
||||
pw_stop_progress_bar_cover_block
|
||||
pw_stop_progress_bar
|
||||
else
|
||||
try_remove_dir "${WINEDIR}/share/wine/${mono_gecko_chk}"
|
||||
try_force_link_dir "${PORT_WINE_TMP_PATH}/${mono_gecko_chk}" "${WINEDIR}"/share/wine
|
||||
@ -3763,7 +3763,7 @@ start_portwine () {
|
||||
sed -i "/\"Audio\"=/d" "${PORT_WINE_PATH}/data/prefixes/${PW_PREFIX_NAME}/user.reg" &>/dev/null
|
||||
fi
|
||||
|
||||
pw_stop_progress_bar &&
|
||||
pw_stop_progress_bar
|
||||
if ! check_start_from_steam ; then
|
||||
pw_tray_icon
|
||||
sleep 0.5
|
||||
@ -3928,7 +3928,7 @@ pw_run () {
|
||||
print_var "WINEDIR" "WINEPREFIX" "WINEDLLOVERRIDES" "PATH_TO_GAME" "PW_WINE_USE" "PW_VULKAN_USE" "VULKAN_DRIVER_NAME"
|
||||
print_var "VKD3D_CONFIG" "PW_LD_LIBRARY_PATH" "PATH" "WINEESYNC" "WINEFSYNC" "WINEFSYNC_FUTEX2"
|
||||
print_var "WINEDLLPATH" "WINE_CPU_TOPOLOGY" "PW_RUN_GAMESCOPE" "LD_LIBRARY_PATH"
|
||||
kill -s SIGUSR1 "$PW_YAD_PID_PFX_COVER_UI" &>/dev/null
|
||||
pw_stop_progress_bar
|
||||
if [[ "$PW_USE_RUNTIME" == 1 ]] \
|
||||
&& [[ "$PW_WINE_USE" != "USE_SYSTEM_WINE" ]]
|
||||
then
|
||||
@ -4194,14 +4194,14 @@ pw_start_progress_bar_cover () {
|
||||
if check_gamescope_session ; then
|
||||
PW_GIF_FILE="${COVERS_PATH}/loading_deck.gif"
|
||||
"${pw_yad}" --picture --filename="${PW_GIF_FILE}" --close-on-unfocus --no-buttons --undecorated --fullscreen --skip-taskbar > /dev/null 2>&1 &
|
||||
export PW_YAD_PID_PROGRESS_BAR_COVER="$!"
|
||||
PW_YAD_PID_PROGRESS_BAR_BLOCK+=($!)
|
||||
elif ! check_start_from_steam ; then
|
||||
PW_GIF_FILE="$1"
|
||||
PW_GIF_SIZE_X=$(file "${PW_GIF_FILE}" | awk '{print $7 + 8}')
|
||||
PW_GIF_SIZE_Y=$(file "${PW_GIF_FILE}" | awk '{print $9 + 15}')
|
||||
"${pw_yad}" --picture --filename="${PW_GIF_FILE}" --close-on-unfocus --no-buttons --undecorated \
|
||||
--skip-taskbar --width="$PW_GIF_SIZE_X" --height="$PW_GIF_SIZE_Y" --window-icon="$PW_GUI_ICON_PATH/portproton.svg" > /dev/null 2>&1 &
|
||||
export PW_YAD_PID_PROGRESS_BAR_COVER="$!"
|
||||
PW_YAD_PID_PROGRESS_BAR_BLOCK+=($!)
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
@ -4214,7 +4214,7 @@ pw_start_progress_bar_cover_block () {
|
||||
PW_GIF_SIZE_Y=$(file "${PW_GIF_FILE}" | awk '{print $9 + 15}')
|
||||
"${pw_yad}" --picture --filename="${PW_GIF_FILE}" --close-on-unfocus --no-buttons --undecorated \
|
||||
--skip-taskbar --width="$PW_GIF_SIZE_X" --height="$PW_GIF_SIZE_Y" --window-icon="$PW_GUI_ICON_PATH/portproton.svg" > /dev/null 2>&1 &
|
||||
export PW_YAD_PID_PROGRESS_BAR_COVER_BLOCK="$!"
|
||||
PW_YAD_PID_PROGRESS_BAR_BLOCK+=($!)
|
||||
return 0
|
||||
fi
|
||||
}
|
||||
@ -4259,7 +4259,7 @@ pw_update_pfx_cover_gui () {
|
||||
"${pw_yad}" --notebook --key="$PW_KEY_PROGRESS_BAR_UP" $TAB_PLACE --no-buttons \
|
||||
--skip-taskbar --width="$PW_GIF_SIZE_X" --height="$PW_GIF_SIZE_Y" $YAD_UNDECORATED \
|
||||
--window-icon="$PW_GUI_ICON_PATH/portproton.svg" --title "PortProton" --tab-pos="bottom" --expand 2>/dev/null &
|
||||
export PW_YAD_PID_PFX_COVER_UI="$!"
|
||||
PW_YAD_PID_PROGRESS_BAR_BLOCK+=($!)
|
||||
return 0
|
||||
fi
|
||||
}
|
||||
@ -4272,7 +4272,7 @@ pw_start_progress_bar_cs () {
|
||||
--width="$PROGRESS_BAR_WIDTH_SIZE" \
|
||||
--wrap-width="$PROGRESS_BAR_WIDTH_SIZE" \
|
||||
--window-icon="$PW_GUI_ICON_PATH/portproton.svg" &>/dev/null &
|
||||
export PW_YAD_PID_PROGRESS_BAR_CS="$!"
|
||||
PW_YAD_PID_PROGRESS_BAR_BLOCK+=($!)
|
||||
return 0
|
||||
fi
|
||||
}
|
||||
@ -4286,7 +4286,7 @@ pw_start_progress_bar_block () {
|
||||
--width="$PROGRESS_BAR_WIDTH_SIZE" \
|
||||
--wrap-width="$PROGRESS_BAR_WIDTH_SIZE" \
|
||||
--window-icon="$PW_GUI_ICON_PATH/portproton.svg" &>/dev/null &
|
||||
export PW_YAD_PID_PROGRESS_BAR_BLOCK="$!"
|
||||
PW_YAD_PID_PROGRESS_BAR_BLOCK+=($!)
|
||||
return 0
|
||||
fi
|
||||
}
|
||||
@ -4300,26 +4300,26 @@ pw_start_progress_bar_install_game () {
|
||||
--width="$PROGRESS_BAR_WIDTH_SIZE" \
|
||||
--wrap-width="$PROGRESS_BAR_WIDTH_SIZE" \
|
||||
--window-icon="$PW_GUI_ICON_PATH/portproton.svg" &>/dev/null &
|
||||
export PW_YAD_PID_PROGRESS_BAR_BLOCK="$!"
|
||||
PW_YAD_PID_PROGRESS_BAR_BLOCK+=($!)
|
||||
return 0
|
||||
fi
|
||||
}
|
||||
|
||||
pw_stop_progress_bar () {
|
||||
[[ -n $PW_YAD_PID_PROGRESS_BAR_BLOCK ]] && kill -s SIGUSR1 "$PW_YAD_PID_PROGRESS_BAR_BLOCK" &>/dev/null
|
||||
[[ -n $PW_YAD_PID_PROGRESS_BAR_CS ]] && kill -s SIGUSR1 "$PW_YAD_PID_PROGRESS_BAR_CS" &>/dev/null
|
||||
[[ -n $PW_YAD_PID_PFX_COVER_UI ]] && kill -s SIGUSR1 "$PW_YAD_PID_PFX_COVER_UI" &>/dev/null
|
||||
[[ -n $PW_YAD_PID_PROGRESS_BAR_COVER ]] && kill -s SIGUSR1 "$PW_YAD_PID_PROGRESS_BAR_COVER" &>/dev/null
|
||||
unset PW_YAD_PID_PROGRESS_BAR_BLOCK PW_YAD_PID_PROGRESS_BAR_CS
|
||||
unset PW_YAD_PID_PFX_COVER_UI PW_YAD_PID_PROGRESS_BAR_COVER
|
||||
if [[ -n ${PW_YAD_PID_PROGRESS_BAR_BLOCK[0]} ]] ; then
|
||||
local pid
|
||||
for pid in ${PW_YAD_PID_PROGRESS_BAR_BLOCK[@]} ; do
|
||||
# Здесь sleep нужен, потому что pid может уже быть, но kill его не убьет
|
||||
# со sleep 0.01 он делает 2 kill, c 0.02 нормально один
|
||||
while $(sleep 0.02) && [[ -f /proc/$pid/exe ]] ; do
|
||||
kill -s SIGUSR1 "$pid" &>/dev/null
|
||||
done
|
||||
done
|
||||
unset PW_YAD_PID_PROGRESS_BAR_BLOCK
|
||||
fi
|
||||
}
|
||||
export -f pw_stop_progress_bar
|
||||
|
||||
pw_stop_progress_bar_cover_block () {
|
||||
kill -s KILL "$PW_YAD_PID_PROGRESS_BAR_COVER_BLOCK" &>/dev/null
|
||||
}
|
||||
export -f pw_stop_progress_bar_cover_block
|
||||
|
||||
open_changelog () {
|
||||
[[ "$LANGUAGE" == ru ]] && local PW_CHANGELOG_FILE="changelog_ru" || local PW_CHANGELOG_FILE="changelog_en"
|
||||
"${pw_yad}" --title="${translations[CHANGELOG]}" --no-buttons \
|
||||
|
Loading…
Reference in New Issue
Block a user