Commit 5c6b863e authored by Vladislav's avatar Vladislav

Updates

parent 9fadcbc8
...@@ -875,6 +875,7 @@ search_desktop_file () { ...@@ -875,6 +875,7 @@ search_desktop_file () {
# Конвертация секунд в дни, часы, минуты # Конвертация секунд в дни, часы, минуты
seconds_to_time () { seconds_to_time () {
[[ ! $DESKTOP_WITH_TIME == enabled ]] && return 0
[[ -z $1 ]] && return 0 [[ -z $1 ]] && return 0
local seconds days hours minutes local seconds days hours minutes
seconds=$1 seconds=$1
...@@ -5434,22 +5435,9 @@ portwine_create_shortcut () { ...@@ -5434,22 +5435,9 @@ portwine_create_shortcut () {
[[ -z "${PW_SHORTCUT_DESKTOP}" ]] && PW_SHORTCUT_DESKTOP="TRUE" [[ -z "${PW_SHORTCUT_DESKTOP}" ]] && PW_SHORTCUT_DESKTOP="TRUE"
[[ -z "${PW_SHORTCUT_STEAM}" ]] && PW_SHORTCUT_STEAM="FALSE" [[ -z "${PW_SHORTCUT_STEAM}" ]] && PW_SHORTCUT_STEAM="FALSE"
unset name_desktop if [[ -n $PW_SHORTCUT_PROXY ]]
search_desktop_file then name_desktop="$PW_SHORTCUT_PROXY"
if [[ -n ${DESKTOP_FILES_ARRAY[0]} ]] ; then else name_desktop="$PORTWINE_DB"
for df in "${DESKTOP_FILES_ARRAY[@]}" ; do
df="${df//"$PORT_WINE_PATH/"/}"
df="${df//.desktop/}"
if [[ ${PORTWINE_DB^^} =~ ${df^^} ]] && [[ ${PORTWINE_DB^^} != ${df^^} ]]
then name_desktop="$df"
fi
done
fi
if [[ -z $name_desktop ]] ; then
if [[ -n $PW_SHORTCUT_PROXY ]]
then name_desktop="$PW_SHORTCUT_PROXY"
else name_desktop="$PORTWINE_DB"
fi
fi fi
export name_desktop export name_desktop
...@@ -5499,11 +5487,12 @@ portwine_create_shortcut () { ...@@ -5499,11 +5487,12 @@ portwine_create_shortcut () {
edit_user_conf_from_gui PW_SHORTCUT_MENU PW_SHORTCUT_DESKTOP PW_SHORTCUT_STEAM edit_user_conf_from_gui PW_SHORTCUT_MENU PW_SHORTCUT_DESKTOP PW_SHORTCUT_STEAM
if [[ -n ${DESKTOP_FILES_ARRAY[0]} ]] && [[ $name_desktop != $df ]] || [[ -n ${DESKTOP_FILES_ARRAY[1]} ]] ; then if [[ -n ${DESKTOP_FILES_ARRAY[0]} ]] && [[ $name_desktop != $DESKTOP_NAME_FILE ]] || [[ -n ${DESKTOP_FILES_ARRAY[1]} ]] ; then
if yad_question "${translations[A higher number of duplicate desktop files were found for this file.\\nShould I delete the extra ones or not?]}" ; then if yad_question "${translations[A higher number of duplicate desktop files were found for this file.\\nShould I delete the extra ones or not?]}" ; then
for rm in "${DESKTOP_FILES_ARRAY[@]}" ; do for rm in "${DESKTOP_FILES_ARRAY[@]}" ; do
rm -f "$rm" rm -f "$rm"
done done
name_desktop="$PW_SHORTCUT_PROXY"
fi fi
else else
try_remove_file "${PORT_WINE_PATH}/${name_desktop}.desktop" try_remove_file "${PORT_WINE_PATH}/${name_desktop}.desktop"
......
...@@ -500,17 +500,30 @@ if [[ -f "${portwine_exe}" ]] ; then ...@@ -500,17 +500,30 @@ if [[ -f "${portwine_exe}" ]] ; then
PW_SHORTCUT="${translations[DELETE SHORTCUT]}!$PW_GUI_ICON_PATH/$BUTTON_SIZE.png!${translations[Delete shortcut for select file...]}:98" PW_SHORTCUT="${translations[DELETE SHORTCUT]}!$PW_GUI_ICON_PATH/$BUTTON_SIZE.png!${translations[Delete shortcut for select file...]}:98"
fi fi
[[ $DESKTOP_WITH_TIME == enabled ]] && search_desktop_file search_desktop_file
unset DESKTOP_NAME_FILE PW_SHORTCUT_PROXY
if [[ -n ${DESKTOP_FILES_ARRAY[0]} ]] ; then
for df in "${DESKTOP_FILES_ARRAY[@]}" ; do
df="${df//"$PORT_WINE_PATH/"/}"
DESKTOP_NAME_FILE="${df//.desktop/}"
done
fi
if [[ -z "${PW_COMMENT_DB}" ]] ; then if [[ -z "${PW_COMMENT_DB}" ]] ; then
unset PW_SHORTCUT_PROXY [[ $FILE_DESCRIPTION != "" ]] && FILE_DESCRIPTION_ABBR=$(make_abbreviation "$FILE_DESCRIPTION")
FILE_DESCRIPTION_ABBR=$(make_abbreviation "$FILE_DESCRIPTION") [[ $PORTPROTON_NAME != "" ]] && PORTPROTON_NAME_ABBR=$(make_abbreviation "$PORTPROTON_NAME")
PORTPROTON_NAME_ABBR=$(make_abbreviation "$PORTPROTON_NAME") if [[ -n $DESKTOP_NAME_FILE ]] && [[ $DESKTOP_NAME_FILE != "" ]] ; then
if [[ ${PORTPROTON_NAME^^} =~ ${PORTWINE_DB^^} ]] && [[ ${PORTPROTON_NAME^^} != "${PORTWINE_DB^^}" ]] \ PW_COMMENT_DB="${translations[Launching]} <b>$(print_wrapped "$DESKTOP_NAME_FILE" "50")</b>$(seconds_to_time "$TIME_CURRENT")"
|| (( ${#PORTPROTON_NAME_ABBR} > 2 )) && [[ ${PORTPROTON_NAME_ABBR^^} =~ ${PORTWINE_DB^^} ]] ; then PW_SHORTCUT_PROXY="$DESKTOP_NAME_FILE"
elif [[ ${PORTPROTON_NAME^^} =~ ${PORTWINE_DB^^} ]] && [[ ${PORTPROTON_NAME^^} != "${PORTWINE_DB^^}" ]] ; then
PW_COMMENT_DB="${translations[Launching]} <b>$(print_wrapped "$PORTPROTON_NAME" "50")</b>$(seconds_to_time "$TIME_CURRENT")"
PW_SHORTCUT_PROXY="$PORTPROTON_NAME"
elif (( ${#PORTPROTON_NAME_ABBR} > 2 )) && [[ ${PORTPROTON_NAME_ABBR^^} =~ ${PORTWINE_DB^^} ]] ; then
PW_COMMENT_DB="${translations[Launching]} <b>$(print_wrapped "$PORTPROTON_NAME" "50")</b>$(seconds_to_time "$TIME_CURRENT")" PW_COMMENT_DB="${translations[Launching]} <b>$(print_wrapped "$PORTPROTON_NAME" "50")</b>$(seconds_to_time "$TIME_CURRENT")"
PW_SHORTCUT_PROXY="$PORTPROTON_NAME" PW_SHORTCUT_PROXY="$PORTPROTON_NAME"
elif [[ ${FILE_DESCRIPTION^^} =~ ${PORTWINE_DB^^} ]] && [[ ${FILE_DESCRIPTION^^} != "${PORTWINE_DB^^}" ]] \ elif [[ ${FILE_DESCRIPTION^^} =~ ${PORTWINE_DB^^} ]] && [[ ${FILE_DESCRIPTION^^} != "${PORTWINE_DB^^}" ]] ; then
|| (( ${#FILE_DESCRIPTION_ABBR} > 2 )) && [[ ${FILE_DESCRIPTION_ABBR^^} =~ ${PORTWINE_DB^^} ]] ; then PW_COMMENT_DB="${translations[Launching]} <b>$(print_wrapped "$FILE_DESCRIPTION" "50")</b>$(seconds_to_time "$TIME_CURRENT")"
PW_SHORTCUT_PROXY="$FILE_DESCRIPTION"
elif (( ${#FILE_DESCRIPTION_ABBR} > 2 )) && [[ ${FILE_DESCRIPTION_ABBR^^} =~ ${PORTWINE_DB^^} ]] ; then
PW_COMMENT_DB="${translations[Launching]} <b>$(print_wrapped "$FILE_DESCRIPTION" "50")</b>$(seconds_to_time "$TIME_CURRENT")" PW_COMMENT_DB="${translations[Launching]} <b>$(print_wrapped "$FILE_DESCRIPTION" "50")</b>$(seconds_to_time "$TIME_CURRENT")"
PW_SHORTCUT_PROXY="$FILE_DESCRIPTION" PW_SHORTCUT_PROXY="$FILE_DESCRIPTION"
else else
...@@ -549,6 +562,7 @@ if [[ -f "${portwine_exe}" ]] ; then ...@@ -549,6 +562,7 @@ if [[ -f "${portwine_exe}" ]] ; then
fi fi
else else
PW_COMMENT_DB="$PW_COMMENT_DB$(seconds_to_time "$TIME_CURRENT")" PW_COMMENT_DB="$PW_COMMENT_DB$(seconds_to_time "$TIME_CURRENT")"
PW_SHORTCUT_PROXY="$DESKTOP_NAME_FILE"
fi fi
export KEY_START="$RANDOM" export KEY_START="$RANDOM"
......
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