V2.5.1 — Dialogue licence custom + fix recadrage + style
- Dialogue de licence custom (remplace QInputDialog moche) - Logo CopyDev, champ stylise, bouton Activer cyan - Messages erreur/succes en dialogues custom colores - Fix recadrage : reference au dialogue preservee avant destruction - Splash screen sans bordure carree - Style coherent gris/cyan sur tous les dialogues Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
49
main.py
49
main.py
@@ -19,7 +19,7 @@ else:
|
||||
|
||||
sys.path.insert(0, BUNDLE_DIR)
|
||||
|
||||
from PyQt6.QtWidgets import QApplication, QInputDialog, QMessageBox, QLineEdit
|
||||
from PyQt6.QtWidgets import QApplication, QMessageBox
|
||||
|
||||
import hashlib
|
||||
import platform
|
||||
@@ -131,57 +131,48 @@ def _check_license():
|
||||
return True
|
||||
|
||||
if result is False:
|
||||
QMessageBox.critical(
|
||||
None, "Licence invalide",
|
||||
from app.license_dialog import LicenseMessageDialog
|
||||
LicenseMessageDialog("Licence invalide",
|
||||
f"Votre licence a ete refusee :\n{msg}\n\n"
|
||||
"Contactez CopyDev : contact@copydev.fr"
|
||||
)
|
||||
"Contactez CopyDev : contact@copydev.fr", "error").exec()
|
||||
return False
|
||||
|
||||
# Hors-ligne et cache expire
|
||||
QMessageBox.critical(
|
||||
None, "Licence expiree hors-ligne",
|
||||
from app.license_dialog import LicenseMessageDialog
|
||||
LicenseMessageDialog("Licence expiree hors-ligne",
|
||||
f"Impossible de verifier votre licence depuis {int(elapsed_hours)}h.\n"
|
||||
f"Le delai hors-ligne autorise est de {timeout_hours}h.\n\n"
|
||||
"Connectez-vous a internet ou contactez CopyDev :\n"
|
||||
"contact@copydev.fr"
|
||||
)
|
||||
"contact@copydev.fr", "error").exec()
|
||||
return False
|
||||
|
||||
# Pas de cache — demander la cle de licence
|
||||
key, ok = QInputDialog.getText(
|
||||
None,
|
||||
"Copydev Imposing Tool — Activation",
|
||||
"Entrez votre cle de licence :",
|
||||
QLineEdit.EchoMode.Normal,
|
||||
)
|
||||
if not ok or not key.strip():
|
||||
from app.license_dialog import LicenseDialog, LicenseMessageDialog
|
||||
dlg = LicenseDialog()
|
||||
if dlg.exec() != LicenseDialog.DialogCode.Accepted:
|
||||
return False
|
||||
|
||||
key = dlg.get_key()
|
||||
if not key:
|
||||
return False
|
||||
|
||||
key = key.strip()
|
||||
result, msg = _check_license_online(key)
|
||||
|
||||
if result is True:
|
||||
QMessageBox.information(
|
||||
None, "Licence activee",
|
||||
f"Bienvenue, {msg} !\nVotre licence est activee."
|
||||
)
|
||||
LicenseMessageDialog("Licence activee",
|
||||
f"Bienvenue, {msg} !\nVotre licence est activee.", "success").exec()
|
||||
return True
|
||||
|
||||
if result is False:
|
||||
QMessageBox.critical(
|
||||
None, "Licence invalide",
|
||||
f"{msg}\n\nContactez CopyDev : contact@copydev.fr"
|
||||
)
|
||||
LicenseMessageDialog("Licence invalide",
|
||||
f"{msg}\n\nContactez CopyDev : contact@copydev.fr", "error").exec()
|
||||
return False
|
||||
|
||||
# Hors-ligne a la premiere activation
|
||||
QMessageBox.critical(
|
||||
None, "Connexion requise",
|
||||
LicenseMessageDialog("Connexion requise",
|
||||
"Impossible de contacter le serveur de licences.\n"
|
||||
"Une connexion internet est necessaire pour la premiere activation.\n\n"
|
||||
"Contactez CopyDev : contact@copydev.fr"
|
||||
)
|
||||
"Contactez CopyDev : contact@copydev.fr", "error").exec()
|
||||
return False
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user