added quotes in the install button
This commit is contained in:
		| @@ -64,6 +64,7 @@ class WineHelperGUI(QMainWindow): | ||||
|         self.process = None | ||||
|         self.current_script = None | ||||
|         self.install_process = None | ||||
|         self.current_display_name = None | ||||
|         self.install_dialog = None | ||||
|         self.current_active_button = None | ||||
|         self.installed_buttons = [] | ||||
| @@ -162,7 +163,7 @@ class WineHelperGUI(QMainWindow): | ||||
|  | ||||
|         # Заголовок | ||||
|         self.script_title = QLabel("Выберите программу") | ||||
|         self.script_title.setFont(QFont('Arial', 14, QFont.Bold))  # Шрифт и размер шрифта в заголовке инф. панели | ||||
|         self.script_title.setFont(QFont('Arial', 12, QFont.Bold))  # Шрифт и размер шрифта в заголовке инф. панели | ||||
|         self.script_title.setAlignment(Qt.AlignCenter) | ||||
|         self.info_panel_layout.addWidget(self.script_title) | ||||
|  | ||||
| @@ -198,7 +199,7 @@ class WineHelperGUI(QMainWindow): | ||||
|         install_action_layout = QVBoxLayout() | ||||
|         install_action_layout.setContentsMargins(0, 0, 0, 0) | ||||
|         self.install_button = QPushButton("Установить") | ||||
|         self.install_button.setFont(QFont('Arial', 13, QFont.Bold)) | ||||
|         self.install_button.setFont(QFont('Arial', 12, QFont.Bold))  # Шрифт и размер шрифта в кнопке Установить | ||||
|         self.install_button.setStyleSheet("background-color: #4CAF50; color: white;") | ||||
|         self.install_button.clicked.connect(self.install_current_script) | ||||
|         install_action_layout.addWidget(self.install_button) | ||||
| @@ -833,6 +834,11 @@ class WineHelperGUI(QMainWindow): | ||||
|                 print(f"Error getting prefix name from {desktop_file}: {e}") | ||||
|         return None | ||||
|  | ||||
|     def _get_current_app_title(self): | ||||
|         """Возвращает отображаемое имя для текущей выбранной программы.""" | ||||
|         # Если display_name не установлено (например, при ошибке), используем имя скрипта | ||||
|         return self.current_display_name or self.current_script | ||||
|  | ||||
|     def backup_prefix_for_app(self): | ||||
|         """Создает резервную копию префикса для выбранного приложения.""" | ||||
|         prefix_name = self._get_prefix_name_for_selected_app() | ||||
| @@ -1206,6 +1212,7 @@ class WineHelperGUI(QMainWindow): | ||||
|         prog_name = self.extract_prog_name_from_script(script_path) | ||||
|         prog_url = self.extract_prog_url_from_script(script_path) | ||||
|         display_name = prog_name if prog_name else script_name | ||||
|         self.current_display_name = display_name | ||||
|  | ||||
|         if icon_names: | ||||
|             # Для заголовка используем первую иконку из списка | ||||
| @@ -1228,7 +1235,7 @@ class WineHelperGUI(QMainWindow): | ||||
|         self.install_action_widget.setVisible(True) | ||||
|         self.installed_action_widget.setVisible(False) | ||||
|         self.installed_global_action_widget.setVisible(False) | ||||
|         self.install_button.setText(f"Установить {display_name}") | ||||
|         self.install_button.setText(f"Установить «{display_name}»") | ||||
|  | ||||
|     def install_current_script(self): | ||||
|         """Устанавливает текущий выбранный скрипт""" | ||||
| @@ -1242,7 +1249,8 @@ class WineHelperGUI(QMainWindow): | ||||
|  | ||||
|         # Создаем диалоговое окно установки | ||||
|         self.install_dialog = QDialog(self) | ||||
|         self.install_dialog.setWindowTitle(f"Установка {self.current_script}") | ||||
|         title_name = self._get_current_app_title() | ||||
|         self.install_dialog.setWindowTitle(f"Установка «{title_name}»") | ||||
|         self.install_dialog.setMinimumSize(750, 400) | ||||
|         self.install_dialog.setWindowModality(Qt.WindowModal) | ||||
|  | ||||
| @@ -1377,7 +1385,8 @@ class WineHelperGUI(QMainWindow): | ||||
|         if install_file: | ||||
|             args.append(install_file) | ||||
|  | ||||
|         self.append_log(f"=== Начало установки {self.current_script} ===") | ||||
|         title_name = self._get_current_app_title() | ||||
|         self.append_log(f"=== Начало установки «{title_name}» ===") | ||||
|         self.append_log(f"Исполняемый файл: {winehelper_path}") | ||||
|         self.append_log(f"Аргументы: {' '.join(shlex.quote(a) for a in args)}") | ||||
|  | ||||
| @@ -1418,7 +1427,8 @@ class WineHelperGUI(QMainWindow): | ||||
|             # Создаем кастомный диалог, чтобы кнопка была на русском | ||||
|             success_box = QMessageBox(self.install_dialog) | ||||
|             success_box.setWindowTitle("Успех") | ||||
|             success_box.setText(f"Программа {self.current_script} установлена успешно!") | ||||
|             title_name = self._get_current_app_title() | ||||
|             success_box.setText(f"Программа «{title_name}» установлена успешно!") | ||||
|             success_box.setIcon(QMessageBox.Information) | ||||
|             success_box.addButton("Готово", QMessageBox.AcceptRole) | ||||
|             success_box.exec_() | ||||
|   | ||||
		Reference in New Issue
	
	Block a user