Compare commits

...

18 Commits

Author SHA1 Message Date
Sergey Palcheh
5e4d94bb57 temporarily disable the display of the tray icon 2025-10-23 14:02:50 +06:00
Sergey Palcheh
5b572ff540 added a change in the color of the tray icon depending on the theme 2025-10-23 14:00:20 +06:00
Sergey Palcheh
c68bcc9abf added a method to change the color of the tray icon 2025-10-23 12:38:10 +06:00
Sergey Palcheh
1ad2c6cfa8 The Manual sub-tab has been renamed to General 2025-10-23 11:31:43 +06:00
Sergey Palcheh
16a686dc37 added a new file with general information 2025-10-23 11:30:37 +06:00
Sergey Palcheh
eb9bef83e2 improved display of test versions 2025-10-22 11:13:55 +06:00
Sergey Palcheh
c7eddb8b53 tray icon changed to winehelper-symbolic.svg 2025-10-22 09:25:19 +06:00
Mikhail Tergoev
dfc6c1c836 added var WH_ICON_TRAY path to winehelper-symbolic.svg 2025-10-21 15:09:46 +03:00
Mikhail Tergoev
04187e9463 GUI: updated compatibility links and certificates 2025-10-21 15:00:53 +03:00
Mikhail Tergoev
5f915ab58d Merge branch 'minergenon-devel' 2025-10-21 14:11:22 +03:00
Sergey Palcheh
0e8ee7788a fixed: the Delete all WineHelper data button is active by default 2025-10-21 14:45:27 +06:00
Sergey Palcheh
49c1ac6846 fixed the text color change after an error in the log 2025-10-21 14:36:47 +06:00
Mikhail Tergoev
971bcd0f5a wine_run: added automatic detection of .reg and .dll 2025-10-21 11:30:48 +03:00
Sergey Palcheh
5b21015aee added compatibility links and certificates 2025-10-21 12:25:53 +06:00
Mikhail Tergoev
7dee08bcfb updated changelog to 0.7.0 2025-10-20 15:30:47 +03:00
Mikhail Tergoev
633deaf1c1 hided abc-*, ais and commfort-* scripts 2025-10-20 15:28:21 +03:00
Mikhail Tergoev
4df9508547 Merge branch 'minergenon-devel' 2025-10-20 15:07:30 +03:00
Sergey Palcheh
989f04cdd8 added a test list to the auto-installation 2025-10-20 17:59:40 +06:00
16 changed files with 244 additions and 43 deletions

View File

@@ -1,5 +1,16 @@
История изменений:
0.7.0
* обновлен графический режим Qt5
- добавлена кнопка открытия каталога с резервными копиями и логами
- добавлена кнопка открытия каталога с префиксом
- добавлена блокировка кнопок для установленного приложения, если оно уже запущено
- добавлено отображения процесса установки сторонних компонентов с помощью winetricks
- добавлена возможность отображения и установки тестовых скриптов (выключено по умолчанию)
* добавлены скрипты установки для t-flex версии 18
* добавлен список тестовых скриптов установки ПО
* добавлена возможность ассоциации файлов для передачи в приложения запускаемых в WineHelper
0.6.0
* обновлен графический режим Qt5
* добавлен иконка в трее для графического режима Qt5

7
GENERAL Normal file
View File

@@ -0,0 +1,7 @@
# Руководство пользователя
Подробное и актуальное руководство по использованию WineHelper смотрите на сайте: https://www.altlinux.org/Winehelper
# Совместимость ПО и сертификаты
С полным списком совместимого ПО и сертификатами можно ознакомиться по следующим ссылкам:
Для 10 платформы: https://www.basealt.ru/fileadmin/user_upload/compatibility/P10-view2.html
Для 11 платформы: https://www.basealt.ru/fileadmin/user_upload/compatibility/P11-view2.html

View File

@@ -7,7 +7,7 @@ if [[ $(id -u) -eq 0 ]] ; then
fi
##### DEFAULT PATH #####
export SCRIPT_NAME USER_WORK_PATH RUN_SCRIPT DATA_PATH CHANGELOG_FILE WH_ICON_PATH LICENSE_FILE AGREEMENT THIRD_PARTY_FILE
export SCRIPT_NAME USER_WORK_PATH RUN_SCRIPT DATA_PATH CHANGELOG_FILE WH_ICON_PATH LICENSE_FILE AGREEMENT THIRD_PARTY_FILE WH_ICON_TRAY GENERAL
SCRIPT_NAME="$(basename "$0")"
if [[ "$(realpath "$0")" == "/usr/bin/$SCRIPT_NAME" ]] ; then
@@ -17,10 +17,12 @@ if [[ "$(realpath "$0")" == "/usr/bin/$SCRIPT_NAME" ]] ; then
RUN_SCRIPT="/usr/bin/$SCRIPT_NAME"
DATA_PATH="/usr/share/$SCRIPT_NAME"
WH_ICON_PATH="/usr/share/icons/hicolor/scalable/apps/winehelper.svg"
WH_ICON_TRAY="/usr/share/icons/hicolor/symbolic/apps/winehelper-symbolic.svg"
CHANGELOG_FILE="/usr/share/doc/winehelper-$WH_VERSION/CHANGELOG"
LICENSE_FILE="/usr/share/doc/winehelper-$WH_VERSION/LICENSE"
AGREEMENT="/usr/share/doc/winehelper-$WH_VERSION/LICENSE_AGREEMENT"
THIRD_PARTY_FILE="/usr/share/doc/winehelper-$WH_VERSION/THIRD-PARTY"
GENERAL="/usr/share/doc/winehelper-$WH_VERSION/GENERAL"
else
# переменные для тестового запуска WineHelper из репозитория
USER_WORK_PATH="$HOME/test-$SCRIPT_NAME"
@@ -28,9 +30,11 @@ else
DATA_PATH="$(dirname "$RUN_SCRIPT")"
CHANGELOG_FILE="$DATA_PATH/CHANGELOG"
WH_ICON_PATH="$DATA_PATH/image/gui/winehelper-devel.svg"
WH_ICON_TRAY="$DATA_PATH/image/gui/winehelper-symbolic.svg"
LICENSE_FILE="$DATA_PATH/LICENSE"
AGREEMENT="$DATA_PATH/LICENSE_AGREEMENT"
THIRD_PARTY_FILE="$DATA_PATH/THIRD-PARTY"
GENERAL="$DATA_PATH/GENERAL"
WH_DEVEL="1"
# минимальная проверка синтаксиса скриптов
@@ -1387,6 +1391,20 @@ prepair_wine () {
[[ "$MANGOHUD" == 1 ]] && MANGOHUD_RUN="mangohud"
}
wine_regfile () {
print_info "Запускаем команду: $WINELOADER $@"
"$WINELOADER" "$@" && print_ok "Выполнено." || fatal "Не выполнено: $WINELOADER $@"
wait_wineserver
if [[ "$WINEARCH" == "win64" ]] \
&& [[ -f "${WINELOADER}64" ]]
then
print_info "Запускаем команду: ${WINELOADER}64 $@"
"${WINELOADER}64" "$@" && print_ok "Выполнено." || fatal "Не выполнено: ${WINELOADER}64 $@"
wait_wineserver
fi
}
wine_run () {
local wh_add_args win_file_exec win_file_path win_file_name
@@ -1395,6 +1413,9 @@ wine_run () {
win_file_name="$win_file_exec"
win_file_path="$DRIVE_C"
wh_add_args=""
elif [[ $1 =~ \.dll$ ]] ; then
wine_regfile regsvr32 /s "$@"
return 0
elif [[ -f "$1" ]] ; then
win_file_exec="$(readlink -f "$1")"
win_file_path="$(dirname "$win_file_exec")"
@@ -1404,6 +1425,7 @@ wine_run () {
*.exe) wh_add_args="$WINE_WIN_START" ;;
*.msi) wh_add_args="msiexec /i" ;;
*.bat|*.cmd) wh_add_args="" ;;
*.reg) wine_regfile regedit "$@" ; return 0 ;;
*) fatal "Не удалось запустить файл $1. Проверьте расширение файла." ;;
esac

View File

@@ -13,8 +13,8 @@ from functools import partial
from PyQt5.QtWidgets import (QApplication, QMainWindow, QWidget, QVBoxLayout, QHBoxLayout, QPushButton, QLabel, QTabWidget, QTabBar,
QTextEdit, QFileDialog, QMessageBox, QLineEdit, QCheckBox, QStackedWidget, QScrollArea, QFormLayout, QGroupBox, QRadioButton, QComboBox,
QListWidget, QListWidgetItem, QGridLayout, QFrame, QDialog, QTextBrowser, QInputDialog, QDialogButtonBox, QSystemTrayIcon, QMenu)
from PyQt5.QtCore import Qt, QProcess, QSize, QTimer, QProcessEnvironment, QPropertyAnimation, QEasingCurve, pyqtSignal
from PyQt5.QtGui import QIcon, QFont, QTextCursor, QPixmap, QPainter, QCursor
from PyQt5.QtCore import Qt, QProcess, QSize, QTimer, QProcessEnvironment, QPropertyAnimation, QEasingCurve, pyqtSignal, QRect
from PyQt5.QtGui import QIcon, QFont, QTextCursor, QPixmap, QPainter, QCursor, QTextCharFormat, QColor, QPalette
from PyQt5.QtNetwork import QLocalServer, QLocalSocket
@@ -26,9 +26,11 @@ class Var:
DATA_PATH = os.environ.get("DATA_PATH")
CHANGELOG_FILE = os.environ.get("CHANGELOG_FILE")
WH_ICON_PATH = os.environ.get("WH_ICON_PATH")
WH_ICON_TRAY = os.environ.get("WH_ICON_TRAY")
LICENSE_FILE = os.environ.get("LICENSE_FILE")
LICENSE_AGREEMENT_FILE = os.environ.get("AGREEMENT")
THIRD_PARTY_FILE = os.environ.get("THIRD_PARTY_FILE")
GENERAL = os.environ.get("GENERAL")
class DependencyManager:
"""Класс для управления проверкой и установкой системных зависимостей."""
@@ -870,6 +872,9 @@ class WinetricksManagerDialog(QDialog):
"Подробности смотрите в логе.",
QMessageBox.Warning,
{"buttons": {"OK": QMessageBox.AcceptRole}})
# Сбрасываем формат символов к значению по умолчанию.
# Это гарантирует, что следующий вызов append() не унаследует красный цвет.
self.log_output.setCurrentCharFormat(QTextCharFormat())
self.apply_button.setEnabled(True)
self.close_button.setEnabled(True)
return
@@ -1622,6 +1627,19 @@ class WineHelperGUI(QMainWindow):
"padding-left: 10px;", "padding-left: 15px;"
)
# Стиль для кнопок тестовых программ
self.TEST_BUTTON_LIST_STYLE = """
QPushButton {
background-color: #ffdc64; /* Более темный желтый фон */
color: black; /* Черный цвет текста для контраста */
text-align: left;
padding-left: 10px;
padding-right: 10px;
height: 42px; min-height: 42px; max-height: 42px;
}
QPushButton::icon { padding-left: 10px; }
"""
# Стили для оберток кнопок (для рамки выделения)
self.FRAME_STYLE_DEFAULT = "QFrame { border: 2px solid transparent; border-radius: 8px; padding: 0px; }"
self.FRAME_STYLE_SELECTED = "QFrame { border: 2px solid #0078d7; border-radius: 8px; padding: 0px; }"
@@ -1721,6 +1739,18 @@ class WineHelperGUI(QMainWindow):
self.raise_()
self.activateWindow()
def create_colorized_icon(self, icon_path, color):
"""Загружает иконку (SVG) и применяет к ней указанный цвет."""
target_pixmap = QPixmap(icon_path)
if target_pixmap.isNull():
return QIcon()
painter = QPainter(target_pixmap)
painter.setCompositionMode(QPainter.CompositionMode_SourceIn)
painter.fillRect(target_pixmap.rect(), QColor(color))
painter.end()
return QIcon(target_pixmap)
def create_tray_icon(self):
"""Создает и настраивает иконку в системном трее."""
if not QSystemTrayIcon.isSystemTrayAvailable():
@@ -1729,11 +1759,23 @@ class WineHelperGUI(QMainWindow):
self.tray_icon = QSystemTrayIcon(self)
icon_path = Var.WH_ICON_PATH
if icon_path and os.path.exists(icon_path):
pixmap = QPixmap(icon_path)
if not pixmap.isNull():
self.tray_icon.setIcon(QIcon(pixmap))
# --- Определение цвета иконки в зависимости от темы ---
if Var.WH_ICON_TRAY and os.path.exists(Var.WH_ICON_TRAY):
# Получаем цвет текста окна из палитры приложения.
# Это хороший индикатор для определения контрастного цвета.
window_text_color = self.palette().color(QPalette.WindowText)
# Если цвет текста светлый (высокая яркость), значит, тема темная.
# И наоборот: если цвет текста темный, тема светлая.
# Яркость > 127 обычно указывает на светлый цвет.
is_dark_theme = window_text_color.lightness() > 127
if is_dark_theme:
# Для темных тем используем белую иконку
self.tray_icon.setIcon(self.create_colorized_icon(Var.WH_ICON_TRAY, Qt.white))
else:
# Для светлых тем используем черную иконку
self.tray_icon.setIcon(self.create_colorized_icon(Var.WH_ICON_TRAY, Qt.black))
# Создаем и сохраняем меню как атрибут класса, чтобы оно не удалялось
self.tray_menu = QMenu(self)
@@ -1775,8 +1817,8 @@ class WineHelperGUI(QMainWindow):
if tab_name == "Автоматическая установка":
title = "Автоматическая установка"
html_content = ("<h3>Автоматическая установка</h3>"
"<p>Скрипты из этого списка скачают, установят и настроят приложение за вас.</p>"
"<p>Просто выберите программу и нажмите «Установить».</p>")
"<p>Скрипты из этого списка скачают, установят и настроят приложение за вас. Просто выберите программу и нажмите «Установить».</p>"
"<p>Для доступа к экспериментальным скриптам установки отметьте опцию <b>«Показать тестовые версии»</b> внизу списка.</p>")
show_global = False
elif tab_name == "Ручная установка":
title = "Ручная установка"
@@ -2064,14 +2106,14 @@ class WineHelperGUI(QMainWindow):
return btn
def _populate_install_grid(self, grid_layout, scripts_list, script_folder, button_list):
def _populate_install_grid(self, grid_layout, scripts_list, script_folder, button_list, start_index=None):
"""
Заполняет QGridLayout кнопками установщиков.
Кнопки создаются только для скриптов, в которых найдена переменная PROG_NAME.
:param grid_layout: QGridLayout для заполнения.
:param scripts_list: Список имен скриптов.
:param script_folder: Имя папки со скриптами ('autoinstall' или 'manualinstall').
:param script_folder: Имя папки со скриптами ('autoinstall', 'manualinstall' или 'testinstall').
:param button_list: Список для хранения созданных кнопок.
"""
button_index = 0
@@ -2085,7 +2127,13 @@ class WineHelperGUI(QMainWindow):
icon_names = ScriptParser.extract_icons_from_script(script_path)
icon_paths = [os.path.join(Var.DATA_PATH, "image", f"{name}.png") for name in icon_names]
btn = self._create_app_button(prog_name, icon_paths, self.BUTTON_LIST_STYLE)
# Выбираем стиль в зависимости от папки
if script_folder == 'testinstall':
style_sheet = self.TEST_BUTTON_LIST_STYLE
else:
style_sheet = self.BUTTON_LIST_STYLE
btn = self._create_app_button(prog_name, icon_paths, style_sheet)
# Обертка для рамки выделения
frame = QFrame()
@@ -2095,12 +2143,12 @@ class WineHelperGUI(QMainWindow):
layout.addWidget(btn)
btn.clicked.connect(lambda _, s=script, b=btn: self.show_script_info(s, b))
row, column = divmod(button_index, 2)
row, column = divmod(len(button_list), 2)
grid_layout.addWidget(frame, row, column)
button_list.append(btn)
button_index += 1
def _create_searchable_grid_tab(self, placeholder_text, filter_slot):
def _create_searchable_grid_tab(self, placeholder_text, filter_slot, add_stretch=True):
"""
Создает стандартную вкладку с полем поиска и сеточным макетом с прокруткой.
Возвращает кортеж (главный виджет вкладки, сеточный макет, поле поиска, область прокрутки).
@@ -2134,11 +2182,12 @@ class WineHelperGUI(QMainWindow):
grid_layout.setColumnStretch(1, 1)
v_scroll_layout.addLayout(grid_layout)
v_scroll_layout.addStretch(1)
if add_stretch:
v_scroll_layout.addStretch(1)
return tab_widget, grid_layout, search_edit, scroll_area
def _create_and_populate_install_tab(self, tab_title, script_folder, search_placeholder, filter_slot):
def _create_and_populate_install_tab(self, tab_title, script_folders, search_placeholder, filter_slot):
"""
Создает и заполняет вкладку для установки (автоматической или ручной).
Возвращает кортеж со скриптами, кнопками и виджетами.
@@ -2148,15 +2197,16 @@ class WineHelperGUI(QMainWindow):
)
scripts = []
script_path = os.path.join(Var.DATA_PATH, script_folder)
if os.path.isdir(script_path):
try:
scripts = sorted(os.listdir(script_path))
except OSError as e:
print(f"Не удалось прочитать директорию {script_path}: {e}")
buttons_list = []
self._populate_install_grid(grid_layout, scripts, script_folder, buttons_list)
for folder in script_folders:
script_path = os.path.join(Var.DATA_PATH, folder)
if os.path.isdir(script_path):
try:
folder_scripts = sorted(os.listdir(script_path))
scripts.extend(folder_scripts)
self._populate_install_grid(grid_layout, folder_scripts, folder, buttons_list)
except OSError as e:
print(f"Не удалось прочитать директорию {script_path}: {e}")
self.add_tab(tab_widget, tab_title)
@@ -2168,12 +2218,28 @@ class WineHelperGUI(QMainWindow):
scripts, buttons, layout,
search_edit, scroll_area
) = self._create_and_populate_install_tab(
"Автоматическая установка", "autoinstall", "Поиск скрипта автоматической установки...", partial(self.filter_buttons, 'auto')
"Автоматическая установка", ["autoinstall"], "Поиск скрипта автоматической установки...", partial(self.filter_buttons, 'auto')
)
self.autoinstall_scripts = scripts
self.install_tabs_data['auto'] = {
'buttons': buttons, 'layout': layout, 'search_edit': search_edit, 'scroll_area': scroll_area
}
self.install_tabs_data['auto']['test_buttons'] = []
# Добавляем чекбокс для тестовых версий
test_checkbox = QCheckBox("Показать тестовые версии")
test_checkbox.setToolTip("Показать/скрыть экспериментальные скрипты установки")
# Находим layout вкладки, чтобы добавить чекбокс
tab_widget = self.stacked_widget.widget(self.stacked_widget.count() - 1)
if tab_widget and tab_widget.layout():
tab_widget.layout().addWidget(test_checkbox)
# Подключаем сигнал к слоту обновления
test_checkbox.stateChanged.connect(self.update_auto_install_list)
# Сохраняем чекбокс для доступа в будущем
self.install_tabs_data['auto']['test_checkbox'] = test_checkbox
def create_manual_install_tab(self):
"""Создает вкладку для ручной установки программ"""
@@ -2181,17 +2247,81 @@ class WineHelperGUI(QMainWindow):
scripts, buttons, layout,
search_edit, scroll_area
) = self._create_and_populate_install_tab(
"Ручная установка", "manualinstall", "Поиск скрипта ручной установки...", partial(self.filter_buttons, 'manual')
"Ручная установка", ["manualinstall"], "Поиск скрипта ручной установки...", partial(self.filter_buttons, 'manual')
)
self.manualinstall_scripts = scripts
self.install_tabs_data['manual'] = {
'buttons': buttons, 'layout': layout, 'search_edit': search_edit, 'scroll_area': scroll_area
}
def update_auto_install_list(self):
"""Обновляет список на вкладке 'Автоматическая установка' при изменении чекбокса."""
data = self.install_tabs_data.get('auto')
if not data:
return
is_checked = data['test_checkbox'].isChecked()
test_buttons = data.get('test_buttons', [])
# Если нужно показать тестовые версии и они еще не добавлены
if is_checked and not test_buttons:
test_script_folder = "testinstall"
script_path = os.path.join(Var.DATA_PATH, test_script_folder)
if os.path.isdir(script_path):
try:
folder_scripts = sorted(os.listdir(script_path))
# Запоминаем, какие кнопки являются тестовыми
new_test_buttons = []
self._populate_install_grid(data['layout'], folder_scripts, test_script_folder, new_test_buttons)
data['test_buttons'] = new_test_buttons
data['buttons'].extend(new_test_buttons)
self.autoinstall_scripts.extend(folder_scripts)
# Применяем фильтр и прокручиваем к первому новому элементу
self.filter_buttons('auto')
if new_test_buttons:
first_new_button = new_test_buttons[0]
frame = first_new_button.parent()
if isinstance(frame, QFrame):
# Даем время на отрисовку перед прокруткой
QTimer.singleShot(100, lambda: data['scroll_area'].ensureWidgetVisible(frame, 50, 50))
except OSError as e:
print(f"Не удалось прочитать директорию {test_script_folder}: {e}")
# Если нужно скрыть тестовые версии и они были добавлены
elif not is_checked and test_buttons:
# Останавливаем анимацию и удаляем виджеты тестовых кнопок
for btn in test_buttons:
if btn in self.icon_animators:
anim_data = self.icon_animators.pop(btn)
if 'main_timer' in anim_data:
anim_data['main_timer'].stop()
if 'animation' in anim_data and anim_data['animation']:
anim_data['animation'].stop()
# Удаляем кнопку из основного списка
if btn in data['buttons']:
data['buttons'].remove(btn)
# Удаляем фрейм кнопки из layout
frame = btn.parent()
if frame:
frame.deleteLater()
# Очищаем список тестовых кнопок
data['test_buttons'].clear()
# Обновляем список скриптов
self.autoinstall_scripts = [s for s in self.autoinstall_scripts if not os.path.exists(os.path.join(Var.DATA_PATH, "testinstall", s))]
# В любом случае применяем фильтр, чтобы скрыть/показать кнопки в соответствии с поиском
if data['test_checkbox'].isChecked():
self.filter_buttons('auto')
def create_installed_tab(self):
"""Создает вкладку для отображения установленных программ в виде кнопок"""
installed_tab, self.installed_scroll_layout, self.installed_search_edit, self.installed_scroll_area = self._create_searchable_grid_tab(
"Поиск установленной программы...", self.filter_installed_buttons
"Поиск установленной программы...", self.filter_installed_buttons, add_stretch=True
)
self.add_tab(installed_tab, "Установленные")
@@ -2433,7 +2563,7 @@ class WineHelperGUI(QMainWindow):
prefix_names = []
self.created_prefix_selector.blockSignals(True)
self.remove_all_button.setEnabled(bool(prefix_names))
self.remove_all_button.setEnabled(True)
self.created_prefix_selector.clear()
if prefix_names:
self.created_prefix_selector.addItems(prefix_names)
@@ -2449,7 +2579,7 @@ class WineHelperGUI(QMainWindow):
self.current_managed_prefix_name = None
self._setup_prefix_management_panel(None)
self.delete_prefix_button.setEnabled(False)
self.remove_all_button.setEnabled(False)
self.remove_all_button.setEnabled(True)
self.create_base_pfx_button.setEnabled(False)
self.open_prefix_folder_button.setEnabled(False)
else:
@@ -3148,17 +3278,44 @@ class WineHelperGUI(QMainWindow):
help_subtabs = QTabWidget()
help_layout.addWidget(help_subtabs)
# Подвкладка "Руководство"
guide_tab = QWidget()
guide_layout = QVBoxLayout(guide_tab)
guide_text = QTextBrowser()
guide_text.setOpenExternalLinks(True)
guide_text.setHtml("""
<h2>Руководство пользователя</h2>
<p>Подробное и актуальное руководство по использованию WineHelper смотрите на <a href="https://www.altlinux.org/Winehelper">https://www.altlinux.org/Winehelper</a></p>
""")
guide_layout.addWidget(guide_text)
help_subtabs.addTab(guide_tab, "Руководство")
# Подвкладка "Общее"
general_tab = QWidget()
general_layout = QVBoxLayout(general_tab)
general_text = QTextBrowser()
general_text.setOpenExternalLinks(True)
try:
if not Var.GENERAL or not os.path.exists(Var.GENERAL):
raise FileNotFoundError
with open(Var.GENERAL, 'r', encoding='utf-8') as f:
general_content = f.read()
html_content = ""
url_re = re.compile(r'(https?://[^\s]+)')
for line in general_content.splitlines():
line = line.strip()
if not line:
html_content += "<br>"
continue
line = html.escape(line)
line = url_re.sub(r'<a href="\1">\1</a>', line)
if line.startswith('# '):
html_content += f'<h2>{line[2:]}</h2>'
elif line.startswith('Для '):
html_content += f'<p style="margin-left: 10px;">&bull; {line}</p>'
else:
html_content += f'<p>{line}</p>'
general_text.setHtml(html_content)
except (FileNotFoundError, TypeError):
general_text.setHtml(f'<h2>Ошибка</h2><p>Не удалось загрузить файл с общей информацией по пути:<br>{Var.GENERAL}</p>')
general_layout.addWidget(general_text)
help_subtabs.addTab(general_tab, "Общее")
# Подвкладка "Авторы"
authors_tab = QWidget()
@@ -4239,6 +4396,8 @@ class WineHelperGUI(QMainWindow):
if script_name in self.autoinstall_scripts:
script_path = os.path.join(Var.DATA_PATH, "autoinstall", script_name)
tab_type = 'auto'
if not os.path.exists(script_path): # Проверяем в testinstall, если не нашли в autoinstall
script_path = os.path.join(Var.DATA_PATH, "testinstall", script_name)
self.manual_install_path_widget.setVisible(False)
else:
script_path = os.path.join(Var.DATA_PATH, "manualinstall", script_name)
@@ -4404,7 +4563,9 @@ class WineHelperGUI(QMainWindow):
winehelper_path = self.winehelper_path
script_path = os.path.join(Var.DATA_PATH,
"autoinstall" if self.current_script in self.autoinstall_scripts else "manualinstall",
"autoinstall" if os.path.exists(os.path.join(Var.DATA_PATH, "autoinstall", self.current_script))
else "testinstall" if os.path.exists(os.path.join(Var.DATA_PATH, "testinstall", self.current_script))
else "manualinstall",
self.current_script)
if not os.path.exists(winehelper_path):
@@ -4813,7 +4974,7 @@ def main():
window.server = server
window.show()
# Создаем иконку в системном трее после создания окна
window.create_tray_icon()
# window.create_tray_icon() # Временно отключено
return app.exec_()
return 1