forked from CastroFidel/winehelper
		
	the notification window for canceling the installation of dependencies has been changed
This commit is contained in:
		| @@ -368,30 +368,25 @@ class DependencyManager: | ||||
|         def dialog_close_handler(event): | ||||
|             """Обрабатывает закрытие окна во время установки зависимостей.""" | ||||
|             if process.state() == QProcess.Running: | ||||
|                 msg_box = QMessageBox(dialog) | ||||
|                 msg_box.setMinimumWidth(900) | ||||
|                 msg_box.setIcon(QMessageBox.Question) | ||||
|                 msg_box.setWindowTitle("Прервать установку?") | ||||
|                 msg_box.setText( | ||||
|                     "<p style='white-space: pre;'>Установка зависимостей еще не завершена.</p>" | ||||
|                     "<p style='white-space: pre;'>Вы действительно хотите прервать процесс?</p>" | ||||
|                     "<p style='white-space: pre;'>Это закроет только окно программы.<br>" | ||||
|                     "Процесс установки зависимостей будет продолжен.<p>" | ||||
|                 # QMessageBox без кнопок может некорректно обрабатывать закрытие. | ||||
|                 # Используем простой QDialog для надежности. | ||||
|                 info_dialog = QDialog(dialog) | ||||
|                 info_dialog.setWindowTitle("Идет установка") | ||||
|                 info_dialog.setModal(True) | ||||
|                 info_dialog.setFixedSize(450, 150) | ||||
|  | ||||
|                 layout = QVBoxLayout(info_dialog) | ||||
|                 label = QLabel( | ||||
|                     "<h3>Установка зависимостей еще не завершена.</h3>" | ||||
|                     "<p>Пожалуйста, дождитесь окончания процесса.</p>" | ||||
|                     "<p>Закрыть основное окно можно будет после завершения установки.</p>" | ||||
|                 ) | ||||
|                 label.setTextFormat(Qt.RichText) | ||||
|                 label.setAlignment(Qt.AlignCenter) | ||||
|                 layout.addWidget(label) | ||||
|  | ||||
|                 yes_button = msg_box.addButton("Да, прервать", QMessageBox.YesRole) | ||||
|                 no_button = msg_box.addButton("Нет", QMessageBox.NoRole) | ||||
|                 msg_box.setDefaultButton(no_button) | ||||
|  | ||||
|                 msg_box.exec_() | ||||
|  | ||||
|                 if msg_box.clickedButton() == yes_button: | ||||
|                     process.readyRead.disconnect() | ||||
|                     process.finished.disconnect() | ||||
|                     process.terminate() | ||||
|                     event.accept() | ||||
|                 else: | ||||
|                     event.ignore() | ||||
|                 info_dialog.exec_() | ||||
|                 event.ignore() | ||||
|             else: | ||||
|                 event.accept() | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user