12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- #!/usr/bin/env python
- # -*- encoding: utf-8 -*-
- from sys import exit
- from controller.bms_login_ctl import BmsLoginControll
- from utils.globalvar import SD
- from utils.qt import QApplication, QCoreApplication, Qt, QStyleFactory
- import locale
- def bms_start():
- # 主版本号
- SD.MAJOR_VERSION_NUMBER = 1
- # 子版本号
- SD.MINOR_VERSION_NUMBER = 5
- # 修正版本号
- SD.REVISION_NUMBER = "0-build_test"
- local_tuple = locale.getdefaultlocale()
- if local_tuple[0].startswith("zh"):
- SD.SYSTEM_LANGUAGE = 0
- if local_tuple[0].startswith("en"):
- SD.SYSTEM_LANGUAGE = 1
- # 适配分辨率
- if hasattr(Qt, 'AA_EnableHighDpiScaling'):
- QCoreApplication.setAttribute(Qt.AA_EnableHighDpiScaling, True)
- if hasattr(Qt, 'AA_UseHighDpiPixmaps'):
- QCoreApplication.setAttribute(Qt.AA_UseHighDpiPixmaps, True)
- SD.HIGH_DPI = 0
- else:
- SD.HIGH_DPI = 1
- main_connrtoller = BmsLoginControll()
- QApplication.setStyle(QStyleFactory.create("windows"))
- exit(main_connrtoller.run())
- if __name__ == "__main__":
- bms_start()
|