WeChatMsg/main_pc.py

67 lines
1.9 KiB
Python
Raw Normal View History

2023-11-16 23:56:36 +08:00
import ctypes
import sys
import time
2023-11-22 21:12:14 +08:00
from PyQt5.QtGui import QIcon, QMovie
2023-11-16 23:56:36 +08:00
from PyQt5.QtWidgets import *
from app.ui_pc import mainview
from app.ui_pc.tool.pc_decrypt import pc_decrypt
ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID("WeChatReport")
class ViewController(QWidget):
def __init__(self):
super().__init__()
self.setWindowTitle('解密')
self.setWindowIcon(QIcon('./app/data/icons/logo.svg'))
2023-11-22 21:12:14 +08:00
self.viewMainWIndow = None
2023-11-16 23:56:36 +08:00
self.viewDecrypt = None
2023-11-22 21:12:14 +08:00
# 创建加载动画
loading_label = QLabel()
movie = QMovie("./app/data/loading.gif") # 替换为你的加载动画文件路径
loading_label.setMovie(movie)
movie.start()
2023-11-16 23:56:36 +08:00
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()
2023-11-22 21:12:14 +08:00
self.viewMainWIndow = mainview.MainWinController(username=username)
self.viewMainWIndow.setWindowTitle("Chat")
2023-11-16 23:56:36 +08:00
# print(username)
2023-11-22 21:12:14 +08:00
self.viewMainWIndow.username = username
2023-11-16 23:56:36 +08:00
# self.viewMainWIn.exitSignal.connect(self.loadDecryptView) # 不需要回到登录界面可以省略
2023-11-22 21:12:14 +08:00
self.viewMainWIndow.show()
2023-11-16 23:56:36 +08:00
end = time.time()
print('ok', end - start)
2023-11-22 21:12:14 +08:00
self.viewMainWIndow.init_ui()
2023-11-16 23:56:36 +08:00
def show_success(self):
QMessageBox.about(self, "解密成功", "数据库文件存储在\napp/DataBase/Msg\n文件夹下")
if __name__ == '__main__':
app = QApplication(sys.argv)
view = ViewController()
# view.loadPCDecryptView()
view.loadMainWinView()
2023-11-22 21:12:14 +08:00
# view.show()
2023-11-16 23:56:36 +08:00
# view.show_success()
sys.exit(app.exec_())