-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwelcome.html
More file actions
41 lines (34 loc) · 1.51 KB
/
welcome.html
File metadata and controls
41 lines (34 loc) · 1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
from PyQt5.QtWidgets import QWidget, QVBoxLayout, QPushButton, QTextBrowser
import json
import os
class WelcomeWindow(QWidget):
def __init__(self, on_continue):
super().__init__()
self.setWindowTitle("مرحبًا بك في DevDaRK Kabo")
self.setFixedSize(800, 600)
layout = QVBoxLayout()
# عرض محتوى README.html داخل QTextBrowser
browser = QTextBrowser()
browser.setStyleSheet("background-color: #0f0f0f; color: #00ffcc; font-size: 16px;")
browser.setOpenExternalLinks(True)
try:
browser.setHtml(open("README.html", encoding="utf-8").read())
except Exception:
browser.setHtml("<h1>مرحبًا بك</h1><p>تعذر تحميل ملف الترحيب.</p>")
layout.addWidget(browser)
# زر متابعة
continue_btn = QPushButton("🚀 متابعة إلى التطبيق")
continue_btn.clicked.connect(lambda: self.continue_and_close(on_continue))
layout.addWidget(continue_btn)
# زر عدم الإظهار مرة أخرى
disable_btn = QPushButton("❌ عدم عرض هذه النافذة مرة أخرى")
disable_btn.clicked.connect(self.disable_welcome)
layout.addWidget(disable_btn)
self.setLayout(layout)
def continue_and_close(self, callback):
self.close()
callback()
def disable_welcome(self):
with open("config.json", "w") as f:
json.dump({"show_welcome": False}, f)
self.close()