-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOMEGA_BETA.py
More file actions
149 lines (119 loc) · 4.07 KB
/
Copy pathOMEGA_BETA.py
File metadata and controls
149 lines (119 loc) · 4.07 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
import sys
import time
from PySide6.QtCore import Qt, QTimer, QPropertyAnimation, QEasingCurve
from PySide6.QtGui import QPixmap, QColor
from PySide6.QtWidgets import (
QApplication, QWidget, QLabel, QVBoxLayout, QProgressBar, QGraphicsOpacityEffect
)
from omega_protocol.ui.app import run
from omega_protocol.runtime import packaged_resource
class OmegaSplash(QWidget):
def __init__(self):
super().__init__()
self.setFixedSize(500, 300)
self.setWindowFlags(Qt.FramelessWindowHint | Qt.WindowStaysOnTopHint)
self.setStyleSheet("""
QWidget {
background-color: #0a0a0a;
border-radius: 12px;
}
""")
layout = QVBoxLayout(self)
layout.setAlignment(Qt.AlignCenter)
# 🔵 ICON (FIX)
self.icon = QLabel()
icon_path = packaged_resource("omega_protocol.ui", "omega.png")
if icon_path and icon_path.exists():
pixmap = QPixmap(str(icon_path)).scaled(
80, 80, Qt.KeepAspectRatio, Qt.SmoothTransformation
)
self.icon.setPixmap(pixmap)
else:
self.icon.setText("Ω")
self.icon.setStyleSheet("color: white; font-size: 40px;")
self.icon.setAlignment(Qt.AlignCenter)
# 🔵 TITLE
self.title = QLabel("OMEGA PROTOCOL")
self.title.setStyleSheet("""
color: white;
font-size: 18px;
letter-spacing: 2px;
""")
self.title.setAlignment(Qt.AlignCenter)
# 🔵 STATUS TEXT
self.status = QLabel("Initializing...")
self.status.setStyleSheet("color: #888; font-size: 12px;")
self.status.setAlignment(Qt.AlignCenter)
# 🔵 PROGRESS BAR (DOXBIN STYLE)
self.progress = QProgressBar()
self.progress.setFixedHeight(6)
self.progress.setTextVisible(False)
self.progress.setRange(0, 100)
self.progress.setStyleSheet("""
QProgressBar {
background-color: #111;
border-radius: 3px;
}
QProgressBar::chunk {
background-color: #00ffcc;
border-radius: 3px;
}
""")
layout.addWidget(self.icon)
layout.addSpacing(10)
layout.addWidget(self.title)
layout.addSpacing(5)
layout.addWidget(self.status)
layout.addSpacing(15)
layout.addWidget(self.progress)
self._center()
# 🔵 FADE IN
self.opacity = QGraphicsOpacityEffect()
self.setGraphicsEffect(self.opacity)
self.fade = QPropertyAnimation(self.opacity, b"opacity")
self.fade.setDuration(800)
self.fade.setStartValue(0)
self.fade.setEndValue(1)
self.fade.setEasingCurve(QEasingCurve.OutCubic)
# 🔵 PROGRESS TIMER
self.timer = QTimer()
self.timer.timeout.connect(self._update)
self.value = 0
def _center(self):
screen = QApplication.primaryScreen().geometry()
self.move(
(screen.width() - self.width()) // 2,
(screen.height() - self.height()) // 2,
)
def start(self):
self.fade.start()
self.timer.start(35)
def _update(self):
self.value += 1.5
self.progress.setValue(int(self.value))
messages = [
"Initializing core...",
"Loading modules...",
"Securing runtime...",
"Injecting subsystems...",
"Finalizing..."
]
index = min(len(messages) - 1, int(self.value // 20))
self.status.setText(messages[index])
if self.value >= 100:
self.timer.stop()
QTimer.singleShot(300, self.close)
if __name__ == "__main__":
app = QApplication(sys.argv)
splash = OmegaSplash()
splash.show()
splash.start()
# wait until splash closes
while splash.isVisible():
app.processEvents()
time.sleep(0.01)
try:
raise SystemExit(run())
except Exception as e:
print(f"Application error: {e}")
raise