-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
59 lines (48 loc) · 1.98 KB
/
Copy pathmain.py
File metadata and controls
59 lines (48 loc) · 1.98 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
import subprocess
import sys
from PySide6.QtCore import Qt
from PySide6.QtGui import QColor, QPalette
from PySide6.QtWidgets import QApplication, QMessageBox
def _check_ffmpeg() -> bool:
try:
subprocess.run(["ffprobe", "-version"], capture_output=True, check=True)
return True
except (FileNotFoundError, subprocess.CalledProcessError):
return False
def _dark_palette(app: QApplication):
app.setStyle("Fusion")
pal = QPalette()
pal.setColor(QPalette.Window, QColor(28, 28, 28))
pal.setColor(QPalette.WindowText, QColor(220, 220, 220))
pal.setColor(QPalette.Base, QColor(18, 18, 18))
pal.setColor(QPalette.AlternateBase, QColor(38, 38, 38))
pal.setColor(QPalette.ToolTipBase, QColor(42, 42, 42))
pal.setColor(QPalette.ToolTipText, QColor(220, 220, 220))
pal.setColor(QPalette.Text, QColor(220, 220, 220))
pal.setColor(QPalette.Button, QColor(42, 42, 42))
pal.setColor(QPalette.ButtonText, QColor(220, 220, 220))
pal.setColor(QPalette.BrightText, Qt.red)
pal.setColor(QPalette.Highlight, QColor(0, 120, 215))
pal.setColor(QPalette.HighlightedText, Qt.white)
pal.setColor(QPalette.Disabled, QPalette.Text, QColor(100, 100, 100))
pal.setColor(QPalette.Disabled, QPalette.ButtonText, QColor(100, 100, 100))
app.setPalette(pal)
def main():
app = QApplication(sys.argv)
app.setApplicationName("ProyectoEditor")
_dark_palette(app)
if not _check_ffmpeg():
QMessageBox.critical(
None,
"FFmpeg no encontrado",
"FFmpeg no está instalado o no está en el PATH.\n\n"
"Descárgalo desde: https://ffmpeg.org/download.html\n"
"Luego agrega la carpeta bin/ al PATH de Windows y reinicia la app.",
)
sys.exit(1)
from ui.main_window import MainWindow
win = MainWindow()
win.show()
sys.exit(app.exec())
if __name__ == "__main__":
main()