forked from CastroFidel/winehelper
added blocking of license agreement confirmation
This commit is contained in:
@ -1256,6 +1256,8 @@ class WineHelperGUI(QMainWindow):
|
|||||||
license_page = QWidget()
|
license_page = QWidget()
|
||||||
license_layout = QVBoxLayout(license_page)
|
license_layout = QVBoxLayout(license_page)
|
||||||
|
|
||||||
|
license_found = False
|
||||||
|
|
||||||
license_text = QTextBrowser()
|
license_text = QTextBrowser()
|
||||||
|
|
||||||
# Получаем текст лицензионного соглашения из файла
|
# Получаем текст лицензионного соглашения из файла
|
||||||
@ -1272,6 +1274,7 @@ class WineHelperGUI(QMainWindow):
|
|||||||
license_text.setHtml(f"""
|
license_text.setHtml(f"""
|
||||||
<pre style="font-family: sans-serif; font-size: 10pt; white-space: pre-wrap; word-wrap: break-word;">{escaped_license_content}</pre>
|
<pre style="font-family: sans-serif; font-size: 10pt; white-space: pre-wrap; word-wrap: break-word;">{escaped_license_content}</pre>
|
||||||
""")
|
""")
|
||||||
|
license_found = True
|
||||||
except (FileNotFoundError, TypeError):
|
except (FileNotFoundError, TypeError):
|
||||||
license_text.setHtml(f'<h3>Лицензионные соглашения</h3><p>Не удалось загрузить файл лицензионного соглашения по пути:<br>{Var.LICENSE_AGREEMENT_FILE}</p>')
|
license_text.setHtml(f'<h3>Лицензионные соглашения</h3><p>Не удалось загрузить файл лицензионного соглашения по пути:<br>{Var.LICENSE_AGREEMENT_FILE}</p>')
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
@ -1325,6 +1328,9 @@ class WineHelperGUI(QMainWindow):
|
|||||||
lambda state: self.btn_continue.setEnabled(state == Qt.Checked)
|
lambda state: self.btn_continue.setEnabled(state == Qt.Checked)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if not license_found:
|
||||||
|
self.license_checkbox.setEnabled(False)
|
||||||
|
|
||||||
self.install_dialog.show()
|
self.install_dialog.show()
|
||||||
|
|
||||||
def _prepare_installation(self):
|
def _prepare_installation(self):
|
||||||
|
Reference in New Issue
Block a user