Skip to content

Commit

Permalink
修改打开路径的初始位置,修复打开404图片闪退问题
Browse files Browse the repository at this point in the history
  • Loading branch information
LC044 committed Nov 29, 2023
1 parent 94e5064 commit a4987a0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
7 changes: 5 additions & 2 deletions app/components/bubble_message.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import os.path

from PIL import Image
from PyQt5 import QtGui
from PyQt5.QtCore import QSize, pyqtSignal, Qt, QThread
Expand Down Expand Up @@ -100,8 +102,9 @@ def __init__(self, image_path):
self.image_path = image_path

def run(self) -> None:
image = Image.open(self.image_path)
image.show()
if os.path.exists(self.image_path):
image = Image.open(self.image_path)
image.show()


class ImageMessage(QLabel):
Expand Down
1 change: 1 addition & 0 deletions app/ui_pc/mainview.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ def init_ui(self):
label.setAlignment(Qt.AlignCenter)
self.stackedWidget.addWidget(label)
tool_window.load_finish_signal.connect(self.loading)
self.statusbar.showMessage('聊天窗口上划到顶部会加载新的聊天记录\n一次不行那就多来几次')
self.contact_window.load_finish_signal.connect(self.loading)
self.chat_window.load_finish_signal.connect(self.loading)

Expand Down
5 changes: 3 additions & 2 deletions app/ui_pc/tool/pc_decrypt/pc_decrypt.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,9 @@ def set_wxid(self):

def select_db_dir(self):
directory = QFileDialog.getExistingDirectory(
self, "选取微信安装目录——能看到Msg文件夹",
"C:/") # 起始路径
self, "选取微信文件保存目录——能看到Msg文件夹",
os.path.expanduser('~\Documents')
) # 起始路径
db_dir = os.path.join(directory, 'Msg')
if not os.path.exists(db_dir):
QMessageBox.critical(self, "错误", "文件夹选择错误\n一般以wxid_xxx结尾")
Expand Down

0 comments on commit a4987a0

Please sign in to comment.