forked from CastroFidel/winehelper
added ICONS_BUTTON_GUI variable for GUI
This commit is contained in:
@@ -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()
|
||||||
|
|||||||
Reference in New Issue
Block a user