-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
130 lines (118 loc) · 3.34 KB
/
main.py
File metadata and controls
130 lines (118 loc) · 3.34 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
#!/usr/bin/env python3
"""Main entry point for Volleyball Action Annotator application."""
import sys
from PyQt6.QtWidgets import QApplication
from loguru import logger
from ui.main_window import VideoAnnotationApp
def setup_logging():
"""Configure logging."""
logger.remove() # Remove default handler
logger.add(
sys.stderr,
format="<green>{time:YYYY-MM-DD HH:mm:ss}</green> | <level>{level: <8}</level> | <cyan>{name}</cyan>:<cyan>{function}</cyan>:<cyan>{line}</cyan> - <level>{message}</level>",
level="INFO"
)
logger.add(
"vaa.log",
rotation="10 MB",
retention="7 days",
level="DEBUG"
)
def main():
"""Main application entry point."""
# Setup logging
setup_logging()
logger.info("Starting Volleyball Action Annotator")
# Create Qt application
app = QApplication(sys.argv)
app.setApplicationName("Volleyball Action Annotator")
app.setOrganizationName("VAA")
# Set dark theme stylesheet
app.setStyleSheet("""
QMainWindow {
background-color: #2b2b2b;
color: #ffffff;
}
QWidget {
background-color: #2b2b2b;
color: #ffffff;
}
QPushButton {
background-color: #3c3c3c;
color: #ffffff;
border: 1px solid #555555;
padding: 5px;
border-radius: 3px;
}
QPushButton:hover {
background-color: #4c4c4c;
}
QPushButton:pressed {
background-color: #1c1c1c;
}
QPushButton:disabled {
background-color: #2b2b2b;
color: #666666;
}
QLabel {
color: #ffffff;
}
QTableWidget {
background-color: #3c3c3c;
alternate-background-color: #2b2b2b;
selection-background-color: #007bff;
gridline-color: #555555;
}
QHeaderView::section {
background-color: #4c4c4c;
color: #ffffff;
padding: 4px;
border: 1px solid #555555;
}
QComboBox {
background-color: #3c3c3c;
color: #ffffff;
border: 1px solid #555555;
padding: 3px;
}
QComboBox::drop-down {
border: none;
}
QComboBox::down-arrow {
image: none;
border-left: 5px solid transparent;
border-right: 5px solid transparent;
border-top: 5px solid #ffffff;
}
QCheckBox {
color: #ffffff;
}
QMenuBar {
background-color: #3c3c3c;
color: #ffffff;
}
QMenuBar::item:selected {
background-color: #007bff;
}
QMenu {
background-color: #3c3c3c;
color: #ffffff;
border: 1px solid #555555;
}
QMenu::item:selected {
background-color: #007bff;
}
QStatusBar {
background-color: #3c3c3c;
color: #ffffff;
}
""")
# Create and show main window
window = VideoAnnotationApp()
window.show()
# Run application event loop
exit_code = app.exec()
logger.info(f"Application exiting with code {exit_code}")
sys.exit(exit_code)
if __name__ == "__main__":
main()