39 lines
968 B
Python
39 lines
968 B
Python
from PySide6.QtWidgets import QApplication
|
|
import ctypes
|
|
from gui import AutoPercentyGUI
|
|
import sys
|
|
from sleep_control import prevent_sleep_mode, restore_sleep_mode
|
|
|
|
# Windows DPI Awareness Constants
|
|
DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2 = -4
|
|
|
|
def set_dpi_awareness():
|
|
"""Windows DPI Awareness 설정"""
|
|
try:
|
|
ctypes.windll.user32.SetProcessDpiAwarenessContext(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2)
|
|
except Exception as e:
|
|
print(f"DPI Awareness 설정 실패: {e}")
|
|
|
|
def main():
|
|
# DPI 관련 경고 제거 (Qt 기본값 설정)
|
|
set_dpi_awareness()
|
|
|
|
"""프로그램 시작점"""
|
|
app = QApplication([])
|
|
|
|
# 슬립 방지 활성화
|
|
prevent_sleep_mode()
|
|
|
|
# 메인윈도우 실행
|
|
mainWindow = AutoPercentyGUI()
|
|
|
|
# 메인 윈도우가 닫힐 때 슬립 복원
|
|
mainWindow.destroyed.connect(restore_sleep_mode)
|
|
|
|
mainWindow.show()
|
|
sys.exit(app.exec())
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|