1 Star 0 Fork 0

镜像库/WeChatMsg

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
main.py 2.22 KB
一键复制 编辑 原始数据 按行查看 历史
司小远 提交于 2023-12-26 23:49 . 修复txt导出问题 #236
import ctypes
import sys
import time
import traceback
from PyQt5.QtGui import QFont
from PyQt5.QtWidgets import *
from PyQt5.QtCore import Qt
from app.DataBase import close_db
from app.log import logger
from app.ui import mainview
from app.ui.tool.pc_decrypt import pc_decrypt
from app.config import version
ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID("WeChatReport")
QApplication.setAttribute(Qt.AA_EnableHighDpiScaling, True)
QApplication.setAttribute(Qt.AA_UseHighDpiPixmaps, True)
class ViewController(QWidget):
def __init__(self):
super().__init__()
self.viewMainWindow = None
self.viewDecrypt = None
def loadPCDecryptView(self):
"""
登录界面
:return:
"""
self.viewDecrypt = pc_decrypt.DecryptControl()
self.viewDecrypt.DecryptSignal.connect(self.show_success)
self.viewDecrypt.show()
def loadMainWinView(self, username=None):
"""
聊天界面
:param username: 账号
:return:
"""
username = ''
start = time.time()
self.viewMainWindow = mainview.MainWinController(username=username)
self.viewMainWindow.exitSignal.connect(self.close)
try:
self.viewMainWindow.setWindowTitle(f"留痕-{version}")
self.viewMainWindow.show()
end = time.time()
print('ok', '本次加载用了', end - start, 's')
self.viewMainWindow.init_ui()
except Exception as e:
print(f"Exception: {e}")
logger.error(traceback.print_exc())
def show_success(self):
QMessageBox.about(self, "解密成功", "数据库文件存储在\napp/DataBase/Msg\n文件夹下")
def close(self) -> bool:
close_db()
super().close()
if __name__ == '__main__':
app = QApplication(sys.argv)
font = QFont('微软雅黑', 12) # 使用 Times New Roman 字体,字体大小为 14
app.setFont(font)
view = ViewController()
try:
# view.loadPCDecryptView()
view.loadMainWinView()
# view.show()
# view.show_success()
sys.exit(app.exec_())
except Exception as e:
print(f"Exception: {e}")
logger.error(traceback.print_exc())
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/dlcmirrors/WeChatMsg.git
git@gitee.com:dlcmirrors/WeChatMsg.git
dlcmirrors
WeChatMsg
WeChatMsg
master

搜索帮助

D67c1975 1850385 1daf7b77 1850385