forked from CastroFidel/winehelper
Compare commits
6 Commits
33bba61891
...
devel
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e3adf19624 | ||
|
|
dc7a996060 | ||
|
|
eca1905c62 | ||
|
|
371b2b7484 | ||
|
|
ded62bd9ac | ||
|
|
15b6fdd216 |
BIN
image/wh_default.png
Normal file
BIN
image/wh_default.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.2 KiB |
@@ -2,7 +2,7 @@
|
|||||||
# info_ru: Ручная установка дополнений для T-FLEX CAD 17 или 18
|
# info_ru: Ручная установка дополнений для T-FLEX CAD 17 или 18
|
||||||
########################################################################
|
########################################################################
|
||||||
export PROG_NAME="T-FLEX CAD 17/18"
|
export PROG_NAME="T-FLEX CAD 17/18"
|
||||||
export PROG_ICON="tflexcad"
|
export ICONS_BUTTON_GUI="tflexcad17 tflexcad18"
|
||||||
export WH_WINE_USE="wine-10.18.1-tflex-alt2-wow64"
|
export WH_WINE_USE="wine-10.18.1-tflex-alt2-wow64"
|
||||||
export BASE_PFX="tflex_pfx_x64_v03"
|
export BASE_PFX="tflex_pfx_x64_v03"
|
||||||
export WINEARCH="win64"
|
export WINEARCH="win64"
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
# info_ru: Ручная установка дополнений для T-FLEX DOCS 17 или 18
|
# info_ru: Ручная установка дополнений для T-FLEX DOCS 17 или 18
|
||||||
########################################################################
|
########################################################################
|
||||||
export PROG_NAME="T-FLEX DOCS 17/18"
|
export PROG_NAME="T-FLEX DOCS 17/18"
|
||||||
export PROG_ICON="tflexcad"
|
export PROG_ICON="tflexdoc17"
|
||||||
export WH_WINE_USE="wine-10.18.1-tflex-alt2-wow64"
|
export WH_WINE_USE="wine-10.18.1-tflex-alt2-wow64"
|
||||||
export BASE_PFX="tflex_pfx_x64_v03"
|
export BASE_PFX="tflex_pfx_x64_v03"
|
||||||
export WINEARCH="win64"
|
export WINEARCH="win64"
|
||||||
|
|||||||
47
winehelper
47
winehelper
@@ -610,7 +610,7 @@ create_desktop () {
|
|||||||
print_ok "Иконка успешно извлечена и сохранена: $icon_file"
|
print_ok "Иконка успешно извлечена и сохранена: $icon_file"
|
||||||
else
|
else
|
||||||
print_warning "Не удалось извлечь иконку из $exe_file. Используется иконка по умолчанию."
|
print_warning "Не удалось извлечь иконку из $exe_file. Используется иконка по умолчанию."
|
||||||
icon_file="wine" # Запасной вариант
|
icon_file="$WH_IMAGE_PATH/wh_default.png" # Запасной вариант
|
||||||
fi
|
fi
|
||||||
try_remove_dir "$tmp_ico_dir"
|
try_remove_dir "$tmp_ico_dir"
|
||||||
fi
|
fi
|
||||||
@@ -620,7 +620,7 @@ create_desktop () {
|
|||||||
# Случай 4: Запасной вариант по умолчанию
|
# Случай 4: Запасной вариант по умолчанию
|
||||||
else
|
else
|
||||||
print_info "Иконка '$icon_arg' не найдена. Используется иконка по умолчанию."
|
print_info "Иконка '$icon_arg' не найдена. Используется иконка по умолчанию."
|
||||||
icon_file="wine"
|
icon_file="$WH_IMAGE_PATH/wh_default.png"
|
||||||
fi
|
fi
|
||||||
# --- Конец логики обработки иконки ---
|
# --- Конец логики обработки иконки ---
|
||||||
|
|
||||||
@@ -1865,46 +1865,49 @@ select_prepared_prefix() {
|
|||||||
|
|
||||||
local in_prefix_section=false
|
local in_prefix_section=false
|
||||||
local current_description=""
|
local current_description=""
|
||||||
|
local current_prefix_name=""
|
||||||
while IFS= read -r line; do
|
while IFS= read -r line; do
|
||||||
if [[ "$line" =~ ^#####[[:space:]]PREFIX[[:space:]]#####$ ]]; then
|
if [[ "$line" =~ ^#####[[:space:]]PREFIX[[:space:]]#####$ ]] ; then
|
||||||
in_prefix_section=true
|
in_prefix_section=true
|
||||||
continue
|
continue
|
||||||
elif [[ "$line" =~ ^#####.* ]]; then
|
elif [[ "$line" =~ ^#####.* ]] ; then
|
||||||
if [[ "$in_prefix_section" == true ]] && [[ -n "$current_description" ]]; then
|
|
||||||
descriptions+=("$(echo -e "$current_description" | sed 's/\\n$//')")
|
|
||||||
current_description=""
|
|
||||||
fi
|
|
||||||
in_prefix_section=false
|
in_prefix_section=false
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$in_prefix_section" == true ]]; then
|
if [[ "$in_prefix_section" == true ]] ; then
|
||||||
if [[ "$line" =~ ^[a-f0-9]{64} ]]; then
|
if [[ "$line" =~ ^[a-f0-9]{64} ]] ; then
|
||||||
[[ -n "$current_description" ]] && descriptions+=("$(echo -e "$current_description" | sed 's/\\n$//')")
|
# Если у нас есть имя предыдущего префикса, добавляем его описание
|
||||||
|
if [[ -n "$current_prefix_name" ]] ; then
|
||||||
|
descriptions+=("$(echo -e "${current_description}" | sed 's/\\n$//')")
|
||||||
|
fi
|
||||||
current_description=""
|
current_description=""
|
||||||
|
|
||||||
local filename
|
local filename
|
||||||
filename=$(echo "$line" | awk '{print $2}')
|
filename=$(echo "$line" | awk '{print $2}')
|
||||||
local prefix_name=${filename%.tar.xz}
|
current_prefix_name=${filename%.tar.xz}
|
||||||
|
|
||||||
if [[ "$arch" == "win32" ]]; then
|
if [[ "$arch" == "win32" ]] && ([[ "$current_prefix_name" == *"_x86_"* ]] || [[ "$current_prefix_name" == *"_i586_"* ]]) ; then
|
||||||
if [[ "$prefix_name" == *"_x86_"* ]] || [[ "$prefix_name" == *"_i586_"* ]]; then
|
options+=("$current_prefix_name")
|
||||||
options+=("$prefix_name")
|
elif [[ "$arch" == "win64" ]] && ([[ "$current_prefix_name" == *"_x64_"* ]] || [[ "$current_prefix_name" == *"_amd64_"* ]]) ; then
|
||||||
fi
|
options+=("$current_prefix_name")
|
||||||
elif [[ "$arch" == "win64" ]]; then
|
else
|
||||||
if [[ "$prefix_name" == *"_x64_"* ]] || [[ "$prefix_name" == *"_amd64_"* ]]; then
|
# Если архитектура не совпадает, сбрасываем имя, чтобы не добавлять описание
|
||||||
options+=("$prefix_name")
|
current_prefix_name=""
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
elif [[ "$line" =~ ^#[[:space:]] ]]; then
|
elif [[ "$line" =~ ^#[[:space:]] ]] ; then
|
||||||
local comment_line=${line:2} # Удаляем '# '
|
local comment_line=${line:2} # Удаляем '# '
|
||||||
current_description+="$comment_line\n"
|
current_description+="$comment_line\n"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done < "$sha256_file"
|
done < "$sha256_file"
|
||||||
|
# Добавляем описание для самого последнего префикса в файле
|
||||||
|
if [[ -n "$current_prefix_name" ]] ; then
|
||||||
|
descriptions+=("$(echo -e "${current_description}" | sed 's/\\n$//')")
|
||||||
|
fi
|
||||||
|
|
||||||
echo
|
echo
|
||||||
print_info "Выберите тип создаваемого префикса:"
|
print_info "Выберите тип создаваемого префикса:"
|
||||||
for i in "${!options[@]}"; do
|
for i in "${!options[@]}" ; do
|
||||||
printf "\n\E[36m %s) %s \e[0m\n" "$((i+1))" "${options[$i]}"
|
printf "\n\E[36m %s) %s \e[0m\n" "$((i+1))" "${options[$i]}"
|
||||||
[[ -n "${descriptions[$i]}" ]] && printf " \E[33m%s\e[0m\n" "$(echo -e "${descriptions[$i]}" | sed 's/^/ /g')"
|
[[ -n "${descriptions[$i]}" ]] && printf " \E[33m%s\e[0m\n" "$(echo -e "${descriptions[$i]}" | sed 's/^/ /g')"
|
||||||
done
|
done
|
||||||
|
|||||||
@@ -1034,14 +1034,21 @@ class ScriptParser:
|
|||||||
with open(script_path, 'r', encoding='utf-8') as f:
|
with open(script_path, 'r', encoding='utf-8') as f:
|
||||||
lines = f.readlines()
|
lines = f.readlines()
|
||||||
|
|
||||||
# 1. Приоритет у PROG_ICON
|
# 1. Приоритет у переменной ICONS_BUTTON_GUI для GUI
|
||||||
|
for line in lines:
|
||||||
|
if line.strip().startswith('export ICONS_BUTTON_GUI='):
|
||||||
|
icon_names_str = line.split('=', 1)[1].strip().strip('"\'')
|
||||||
|
if icon_names_str:
|
||||||
|
return icon_names_str.split()
|
||||||
|
|
||||||
|
# 2. Если ICONS_BUTTON_GUI не найдена, ищем PROG_ICON (для обратной совместимости)
|
||||||
for line in lines:
|
for line in lines:
|
||||||
if line.strip().startswith('export PROG_ICON='):
|
if line.strip().startswith('export PROG_ICON='):
|
||||||
icon_name = line.split('=', 1)[1].strip().strip('"\'')
|
icon_names_str = line.split('=', 1)[1].strip().strip('"\'')
|
||||||
if icon_name:
|
if icon_names_str:
|
||||||
return [icon_name]
|
return icon_names_str.split()
|
||||||
|
|
||||||
# 2. Если PROG_ICON не найден, ищем все вызовы create_desktop
|
# 3. Если ничего не найдено, ищем все вызовы create_desktop
|
||||||
icon_names = []
|
icon_names = []
|
||||||
for line in lines:
|
for line in lines:
|
||||||
line = line.strip()
|
line = line.strip()
|
||||||
@@ -1503,23 +1510,39 @@ class CreatePrefixDialog(QDialog):
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
if re.match(r'^[a-f0-9]{64}', line):
|
if re.match(r'^[a-f0-9]{64}', line):
|
||||||
current_prefix_name = line.split(maxsplit=1)[1].replace('.tar.xz', '')
|
# Если у нас есть имя и описание для предыдущего префикса, добавляем его
|
||||||
|
if current_prefix_name and current_description:
|
||||||
|
arch_for_prev_prefix = None
|
||||||
|
if "_x86_" in current_prefix_name or "_i586_" in current_prefix_name:
|
||||||
|
arch_for_prev_prefix = 'win32'
|
||||||
|
elif "_x64_" in current_prefix_name or "_amd64_" in current_prefix_name:
|
||||||
|
arch_for_prev_prefix = 'win64'
|
||||||
|
|
||||||
arch = None
|
if arch_for_prev_prefix:
|
||||||
if "_x86_" in current_prefix_name or "_i586_" in current_prefix_name:
|
description_to_add = current_description.strip().replace('\\n', '\n')
|
||||||
arch = 'win32'
|
self.prepared_prefixes[arch_for_prev_prefix].append((current_prefix_name, description_to_add))
|
||||||
elif "_x64_" in current_prefix_name or "_amd64_" in current_prefix_name:
|
|
||||||
arch = 'win64'
|
|
||||||
|
|
||||||
if arch:
|
|
||||||
description = current_description.strip().replace('\\n', '\n') if current_description else "Рекомендуемый набор библиотек"
|
|
||||||
self.prepared_prefixes[arch].append((current_prefix_name, description))
|
|
||||||
|
|
||||||
|
# Сбрасываем описание для нового префикса
|
||||||
current_description = ""
|
current_description = ""
|
||||||
current_prefix_name = None
|
|
||||||
|
# Получаем имя нового префикса
|
||||||
|
current_prefix_name = line.split(maxsplit=1)[1].replace('.tar.xz', '') if len(line.split(maxsplit=1)) > 1 else None
|
||||||
|
|
||||||
elif line.startswith('# '):
|
elif line.startswith('# '):
|
||||||
current_description += line[2:] + "\\n"
|
# Накапливаем описание
|
||||||
|
comment_line = line[2:].strip()
|
||||||
|
if current_description:
|
||||||
|
current_description += "\n" + comment_line
|
||||||
|
else:
|
||||||
|
current_description = comment_line
|
||||||
|
|
||||||
|
# После цикла добавляем описание для самого последнего префикса, если оно есть
|
||||||
|
if current_prefix_name and current_description:
|
||||||
|
arch = None
|
||||||
|
if "_x86_" in current_prefix_name or "_i586_" in current_prefix_name: arch = 'win32'
|
||||||
|
elif "_x64_" in current_prefix_name or "_amd64_" in current_prefix_name: arch = 'win64'
|
||||||
|
if arch:
|
||||||
|
self.prepared_prefixes[arch].append((current_prefix_name, current_description.strip().replace('\\n', '\n')))
|
||||||
|
|
||||||
except IOError as e:
|
except IOError as e:
|
||||||
QMessageBox.warning(self, "Ошибка", f"Не удалось прочитать файл с описаниями префиксов: {e}")
|
QMessageBox.warning(self, "Ошибка", f"Не удалось прочитать файл с описаниями префиксов: {e}")
|
||||||
@@ -5101,6 +5124,7 @@ class WineHelperGUI(QMainWindow):
|
|||||||
if exit_code == 0:
|
if exit_code == 0:
|
||||||
self.command_log_output.append(f"\n=== Восстановление успешно завершено ===")
|
self.command_log_output.append(f"\n=== Восстановление успешно завершено ===")
|
||||||
self.update_installed_apps()
|
self.update_installed_apps()
|
||||||
|
self._load_created_prefixes()
|
||||||
self.filter_installed_buttons()
|
self.filter_installed_buttons()
|
||||||
else:
|
else:
|
||||||
self.command_log_output.append(f"\n=== Ошибка выполнения (код: {exit_code}) ===")
|
self.command_log_output.append(f"\n=== Ошибка выполнения (код: {exit_code}) ===")
|
||||||
@@ -5123,6 +5147,13 @@ class WineHelperGUI(QMainWindow):
|
|||||||
|
|
||||||
def main():
|
def main():
|
||||||
"""Основная точка входа в приложение."""
|
"""Основная точка входа в приложение."""
|
||||||
|
# Включаем поддержку HiDPI до создания QApplication для надежного и предсказуемого масштабирования.
|
||||||
|
# AA_EnableHighDpiScaling включает автоматическое масштабирование на основе DPI дисплея.
|
||||||
|
if hasattr(Qt, 'AA_EnableHighDpiScaling'):
|
||||||
|
QApplication.setAttribute(Qt.AA_EnableHighDpiScaling, True)
|
||||||
|
# AA_UseHighDpiPixmaps позволяет использовать высококачественные иконки (например, @2x).
|
||||||
|
if hasattr(Qt, 'AA_UseHighDpiPixmaps'):
|
||||||
|
QApplication.setAttribute(Qt.AA_UseHighDpiPixmaps, True)
|
||||||
# QApplication должен быть создан до использования любых других частей Qt
|
# QApplication должен быть создан до использования любых других частей Qt
|
||||||
app = QApplication(sys.argv)
|
app = QApplication(sys.argv)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user