mirror of
https://github.com/LC044/WeChatMsg
synced 2025-02-22 19:02:17 +08:00
优化启动过程
This commit is contained in:
parent
af652a5adf
commit
4bd0e1aac5
@ -4,8 +4,12 @@
|
||||
<option name="autoReloadType" value="SELECTIVE" />
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="84e65474-7da9-466d-baf3-cc88dde3ffdd" name="变更" comment="修复HTML卡顿的问题">
|
||||
<change beforePath="$PROJECT_DIR$/readme.md" beforeDir="false" afterPath="$PROJECT_DIR$/readme.md" afterDir="false" />
|
||||
<list default="true" id="84e65474-7da9-466d-baf3-cc88dde3ffdd" name="变更" comment="update readme">
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/decrypt/dat2pic.py" beforeDir="false" afterPath="$PROJECT_DIR$/app/decrypt/dat2pic.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/ui_pc/chat/chat_info.py" beforeDir="false" afterPath="$PROJECT_DIR$/app/ui_pc/chat/chat_info.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/ui_pc/mainview.py" beforeDir="false" afterPath="$PROJECT_DIR$/app/ui_pc/mainview.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/main_pc.py" beforeDir="false" afterPath="$PROJECT_DIR$/main_pc.py" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
@ -276,13 +280,6 @@
|
||||
<option name="presentableId" value="Default" />
|
||||
<updated>1672848140146</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00040" summary="增加中文路径提示">
|
||||
<created>1699025065814</created>
|
||||
<option name="number" value="00040" />
|
||||
<option name="presentableId" value="LOCAL-00040" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1699025065814</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00041" summary="update readme">
|
||||
<created>1699026207401</created>
|
||||
<option name="number" value="00041" />
|
||||
@ -619,7 +616,14 @@
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1700583772986</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="89" />
|
||||
<task id="LOCAL-00089" summary="update readme">
|
||||
<created>1700583952342</created>
|
||||
<option name="number" value="00089" />
|
||||
<option name="presentableId" value="LOCAL-00089" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1700583952342</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="90" />
|
||||
<servers />
|
||||
</component>
|
||||
<component name="UnknownFeatures">
|
||||
@ -669,7 +673,6 @@
|
||||
<MESSAGE value="聊天记录从后往前显示" />
|
||||
<MESSAGE value="聊天消息自适应" />
|
||||
<MESSAGE value="新版本更新" />
|
||||
<MESSAGE value="update readme" />
|
||||
<MESSAGE value="修复时间插入位置" />
|
||||
<MESSAGE value="修复第一次启动的显示问题" />
|
||||
<MESSAGE value="支持查找功能" />
|
||||
@ -680,7 +683,8 @@
|
||||
<MESSAGE value="支持显示聊天图片" />
|
||||
<MESSAGE value="支持导出HTML" />
|
||||
<MESSAGE value="修复HTML卡顿的问题" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="修复HTML卡顿的问题" />
|
||||
<MESSAGE value="update readme" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="update readme" />
|
||||
<option name="OPTIMIZE_IMPORTS_BEFORE_PROJECT_COMMIT" value="true" />
|
||||
<option name="REFORMAT_BEFORE_PROJECT_COMMIT" value="true" />
|
||||
</component>
|
||||
|
1
app/data/icons/loading.svg
Normal file
1
app/data/icons/loading.svg
Normal file
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 7.5 KiB |
@ -57,6 +57,8 @@ def decode_dat(file_path, out_path):
|
||||
else:
|
||||
pic_name = file_path[:-4] + ".jpg"
|
||||
file_outpath = os.path.join(out_path, pic_name)
|
||||
if os.path.exists(file_outpath):
|
||||
return file_outpath
|
||||
with open(file_path, 'rb') as file_in:
|
||||
data = file_in.read()
|
||||
# 对数据进行异或加密/解密
|
||||
|
@ -74,7 +74,6 @@ class ChatInfo(QWidget):
|
||||
def is_5_min(self, timestamp):
|
||||
if abs(timestamp - self.last_timestamp) > 300:
|
||||
self.last_timestamp = timestamp
|
||||
|
||||
return True
|
||||
return False
|
||||
|
||||
|
@ -63,7 +63,8 @@ HistoryPanel::item:hover {
|
||||
|
||||
|
||||
class MainWinController(QMainWindow, mainwindow.Ui_MainWindow):
|
||||
exitSignal = pyqtSignal()
|
||||
exitSignal = pyqtSignal(bool)
|
||||
okSignal = pyqtSignal(bool)
|
||||
|
||||
# username = ''
|
||||
def __init__(self, username, parent=None):
|
||||
@ -75,8 +76,10 @@ class MainWinController(QMainWindow, mainwindow.Ui_MainWindow):
|
||||
self.resize(QSize(800, 600))
|
||||
self.action_desc.triggered.connect(self.about)
|
||||
self.load_data()
|
||||
self.init_ui()
|
||||
self.load_num = 0
|
||||
self.label = QLabel(self)
|
||||
self.label.setGeometry((self.width() - 300) // 2, (self.height() - 100) // 2, 300, 100)
|
||||
self.label.setPixmap(QPixmap('./app/data/icons/loading.svg'))
|
||||
|
||||
def load_data(self):
|
||||
if os.path.exists('./app/data/info.json'):
|
||||
@ -98,12 +101,8 @@ class MainWinController(QMainWindow, mainwindow.Ui_MainWindow):
|
||||
)
|
||||
|
||||
def init_ui(self):
|
||||
# self.movie = QMovie("./app/data/loading.gif")
|
||||
self.label = QLabel(self)
|
||||
self.label.setGeometry(0, 0, self.width(), self.height())
|
||||
self.label.setVisible(False)
|
||||
# self.label.setMovie(self.movie)
|
||||
# self.movie.start()
|
||||
self.listWidget.setVisible(False)
|
||||
self.stackedWidget.setVisible(False)
|
||||
self.listWidget.currentRowChanged.connect(self.setCurrentIndex)
|
||||
tool_item = QListWidgetItem(Icon.MyInfo_Icon, '工具', self.listWidget)
|
||||
chat_item = QListWidgetItem(Icon.Chat_Icon, '聊天', self.listWidget)
|
||||
@ -116,11 +115,11 @@ class MainWinController(QMainWindow, mainwindow.Ui_MainWindow):
|
||||
self.stackedWidget.addWidget(tool_window)
|
||||
self.listWidget.setCurrentRow(0)
|
||||
self.stackedWidget.setCurrentIndex(0)
|
||||
chat_window = ChatWindow()
|
||||
self.chat_window = ChatWindow()
|
||||
# chat_window = QWidget()
|
||||
self.stackedWidget.addWidget(chat_window)
|
||||
contact_window = ContactWindow()
|
||||
self.stackedWidget.addWidget(contact_window)
|
||||
self.stackedWidget.addWidget(self.chat_window)
|
||||
self.contact_window = ContactWindow()
|
||||
self.stackedWidget.addWidget(self.contact_window)
|
||||
label = QLabel('我是页面')
|
||||
label.setAlignment(Qt.AlignCenter)
|
||||
# 设置label的背景颜色(这里随机)
|
||||
@ -129,11 +128,11 @@ class MainWinController(QMainWindow, mainwindow.Ui_MainWindow):
|
||||
randint(0, 255), randint(0, 255), randint(0, 255)))
|
||||
self.stackedWidget.addWidget(label)
|
||||
tool_window.load_finish_signal.connect(self.loading)
|
||||
contact_window.load_finish_signal.connect(self.loading)
|
||||
# chat_window.load_finish_signal.connect(self.loading)
|
||||
# self.load_window_thread = LoadWindowThread(self.stackedWidget)
|
||||
# self.load_window_thread.okSignal.connect(self.stop_loading)
|
||||
# self.load_window_thread.start()
|
||||
self.contact_window.load_finish_signal.connect(self.loading)
|
||||
self.chat_window.load_finish_signal.connect(self.loading)
|
||||
# self.load_thread = LoadWindowThread()
|
||||
# self.load_thread.okSignal.connect(self.load_window)
|
||||
# self.load_thread.start()
|
||||
|
||||
def setCurrentIndex(self, row):
|
||||
self.stackedWidget.setCurrentIndex(row)
|
||||
@ -170,11 +169,15 @@ class MainWinController(QMainWindow, mainwindow.Ui_MainWindow):
|
||||
|
||||
def loading(self, a0):
|
||||
self.load_num += 1
|
||||
self.label.setVisible(False)
|
||||
# print('加载一个了')
|
||||
# self.label.setVisible(False)
|
||||
print('加载一个了')
|
||||
if self.load_num == 2:
|
||||
# print('ok了')
|
||||
self.label.setVisible(False)
|
||||
print('ok了')
|
||||
self.label.clear()
|
||||
self.label.hide()
|
||||
self.okSignal.emit(True)
|
||||
self.listWidget.setVisible(True)
|
||||
self.stackedWidget.setVisible(True)
|
||||
|
||||
def about(self):
|
||||
"""
|
||||
@ -198,20 +201,20 @@ class LoadWindowThread(QThread):
|
||||
windowSignal = pyqtSignal(QWidget)
|
||||
okSignal = pyqtSignal(bool)
|
||||
|
||||
def __init__(self, stackedWidget):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self.stackedWidget = stackedWidget
|
||||
self.num = 0
|
||||
|
||||
def loading(self):
|
||||
self.num += 1
|
||||
print('加载一个了')
|
||||
if self.num == 2:
|
||||
self.okSignal.emit(True)
|
||||
|
||||
def run(self):
|
||||
chat_window = ChatWindow()
|
||||
self.stackedWidget.addWidget(chat_window)
|
||||
contact_window = ContactWindow()
|
||||
self.stackedWidget.addWidget(contact_window)
|
||||
label = QLabel('我是页面')
|
||||
label.setAlignment(Qt.AlignCenter)
|
||||
# 设置label的背景颜色(这里随机)
|
||||
# 这里加了一个margin边距(方便区分QStackedWidget和QLabel的颜色)
|
||||
label.setStyleSheet('background: rgb(%d, %d, %d);margin: 50px;' % (
|
||||
randint(0, 255), randint(0, 255), randint(0, 255)))
|
||||
self.stackedWidget.addWidget(label)
|
||||
self.chat_window = ChatWindow()
|
||||
self.contact_window = ContactWindow()
|
||||
self.contact_window.load_finish_signal.connect(self.loading)
|
||||
self.chat_window.load_finish_signal.connect(self.loading)
|
||||
print('加载完成')
|
||||
self.okSignal.emit(True)
|
||||
|
20
main_pc.py
20
main_pc.py
@ -2,7 +2,7 @@ import ctypes
|
||||
import sys
|
||||
import time
|
||||
|
||||
from PyQt5.QtGui import QIcon
|
||||
from PyQt5.QtGui import QIcon, QMovie
|
||||
from PyQt5.QtWidgets import *
|
||||
|
||||
from app.ui_pc import mainview
|
||||
@ -16,8 +16,13 @@ class ViewController(QWidget):
|
||||
super().__init__()
|
||||
self.setWindowTitle('解密')
|
||||
self.setWindowIcon(QIcon('./app/data/icons/logo.svg'))
|
||||
self.viewMainWIn = None
|
||||
self.viewMainWIndow = None
|
||||
self.viewDecrypt = None
|
||||
# 创建加载动画
|
||||
loading_label = QLabel()
|
||||
movie = QMovie("./app/data/loading.gif") # 替换为你的加载动画文件路径
|
||||
loading_label.setMovie(movie)
|
||||
movie.start()
|
||||
|
||||
def loadPCDecryptView(self):
|
||||
"""
|
||||
@ -36,14 +41,16 @@ class ViewController(QWidget):
|
||||
"""
|
||||
username = ''
|
||||
start = time.time()
|
||||
self.viewMainWIn = mainview.MainWinController(username=username)
|
||||
self.viewMainWIn.setWindowTitle("Chat")
|
||||
self.viewMainWIndow = mainview.MainWinController(username=username)
|
||||
self.viewMainWIndow.setWindowTitle("Chat")
|
||||
# print(username)
|
||||
self.viewMainWIn.username = username
|
||||
self.viewMainWIndow.username = username
|
||||
# self.viewMainWIn.exitSignal.connect(self.loadDecryptView) # 不需要回到登录界面可以省略
|
||||
self.viewMainWIn.show()
|
||||
|
||||
self.viewMainWIndow.show()
|
||||
end = time.time()
|
||||
print('ok', end - start)
|
||||
self.viewMainWIndow.init_ui()
|
||||
|
||||
def show_success(self):
|
||||
QMessageBox.about(self, "解密成功", "数据库文件存储在\napp/DataBase/Msg\n文件夹下")
|
||||
@ -54,5 +61,6 @@ if __name__ == '__main__':
|
||||
view = ViewController()
|
||||
# view.loadPCDecryptView()
|
||||
view.loadMainWinView()
|
||||
# view.show()
|
||||
# view.show_success()
|
||||
sys.exit(app.exec_())
|
||||
|
Loading…
Reference in New Issue
Block a user