修改部分ui

This commit is contained in:
SiYuan 2024-02-20 20:20:17 +08:00
parent f3ab5975d7
commit 0c8f5ba884
9 changed files with 28 additions and 55 deletions

View File

@ -54,8 +54,8 @@ class ContactQListWidgetItem(QListWidgetItem):
self.avatorLabel = CAvatar(parent=self.widget, shape=CAvatar.Rectangle, size=QSize(30, 30),
url=url, img_bytes=img_bytes)
# 设置布局用来对nameLabel和avatorLabel进行布局
hbox = QHBoxLayout()
self.checkBox = QCheckBox()
hbox = QHBoxLayout(self.widget)
self.checkBox = QCheckBox(self.widget)
self.checkBox.clicked.connect(self.select)
hbox.addWidget(self.checkBox)
hbox.addWidget(self.avatorLabel)
@ -66,6 +66,11 @@ class ContactQListWidgetItem(QListWidgetItem):
self.widget.setStyleSheet(Stylesheet)
# 设置自定义的QListWidgetItem的sizeHint不然无法显示
self.setSizeHint(self.widget.sizeHint())
sizePolicy = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.widget.sizePolicy().hasHeightForWidth())
self.widget.setSizePolicy(sizePolicy)
def select(self):
"""

View File

@ -1,3 +1,5 @@
import os
version = '1.0.2'
contact = '701805520'
github = 'https://github.com/LC044/WeChatMsg'
@ -25,7 +27,9 @@ about = f'''
INFO_FILE_PATH = './app/data/info.json' # 个人信息文件
DB_DIR = './app/Database/Msg'
OUTPUT_DIR = './data/' # 输出文件夹
os.makedirs('./app/data', exist_ok=True)
os.makedirs(DB_DIR, exist_ok=True)
os.makedirs(OUTPUT_DIR, exist_ok=True)
# 全局参数
SEND_LOG_FLAG = True # 是否发送错误日志
SERVER_API_URL = 'http://api.lc044.love' # api接口

View File

@ -470,25 +470,3 @@ class MainWinController(QMainWindow, mainwindow.Ui_MainWindow, QCursorGif):
super().close()
self.exitSignal.emit(True)
class LoadWindowThread(QThread):
okSignal = pyqtSignal(bool)
def __init__(self):
super().__init__()
self.num = 0
def loading(self):
self.num += 1
print('加载一个了')
if self.num == 2:
self.okSignal.emit(True)
def run(self):
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)

View File

@ -9,28 +9,12 @@
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtCore import QUrl
from PyQt5.QtGui import QDesktopServices
from PyQt5.QtWidgets import QLabel
class Avatar(QLabel):
def __init__(self, parent=None):
super().__init__(parent)
def mouseDoubleClickEvent(self, e): # 双击
super().mouseDoubleClickEvent(e)
QDesktopServices.openUrl(QUrl("https://memotrace.cn/"))
def mousePressEvent(self, e): # 单击
super().mousePressEvent(e)
QDesktopServices.openUrl(QUrl("https://memotrace.cn/"))
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.resize(605, 553)
MainWindow.resize(605, 565)
font = QtGui.QFont()
font.setFamily("微软雅黑")
font.setPointSize(12)
@ -40,7 +24,7 @@ class Ui_MainWindow(object):
MainWindow.setMouseTracking(True)
MainWindow.setStyleSheet("")
MainWindow.setIconSize(QtCore.QSize(50, 24))
MainWindow.setDockOptions(QtWidgets.QMainWindow.AllowTabbedDocks | QtWidgets.QMainWindow.AnimatedDocks)
MainWindow.setDockOptions(QtWidgets.QMainWindow.AllowTabbedDocks|QtWidgets.QMainWindow.AnimatedDocks)
self.centralwidget = QtWidgets.QWidget(MainWindow)
self.centralwidget.setMouseTracking(True)
self.centralwidget.setObjectName("centralwidget")
@ -56,7 +40,7 @@ class Ui_MainWindow(object):
self.frame_info.setFrameShadow(QtWidgets.QFrame.Plain)
self.frame_info.setLineWidth(5)
self.frame_info.setObjectName("frame_info")
self.myavatar = Avatar(self.frame_info)
self.myavatar = QtWidgets.QLabel(self.frame_info)
self.myavatar.setGeometry(QtCore.QRect(10, 40, 60, 60))
self.myavatar.setObjectName("myavatar")
self.listWidget = QtWidgets.QListWidget(self.frame_info)
@ -89,7 +73,7 @@ class Ui_MainWindow(object):
self.horizontalLayout.addWidget(self.stackedWidget)
MainWindow.setCentralWidget(self.centralwidget)
self.menubar = QtWidgets.QMenuBar(MainWindow)
self.menubar.setGeometry(QtCore.QRect(0, 0, 605, 27))
self.menubar.setGeometry(QtCore.QRect(0, 0, 605, 33))
font = QtGui.QFont()
font.setFamily("微软雅黑")
font.setPointSize(12)
@ -161,8 +145,9 @@ class Ui_MainWindow(object):
self.menu_2.addAction(self.action_help_decrypt)
self.menu_2.addAction(self.action_help_chat)
self.menu_2.addAction(self.action_help_contact)
self.menu_about.addAction(self.action_desc)
self.menu_about.addAction(self.action_update)
self.menu_about.addSeparator()
self.menu_about.addAction(self.action_desc)
self.menubar.addAction(self.menu_F.menuAction())
self.menubar.addAction(self.menu_data.menuAction())
self.menubar.addAction(self.menu_2.menuAction())
@ -196,7 +181,7 @@ class Ui_MainWindow(object):
self.action_3.setText(_translate("MainWindow", "保存"))
self.action_4.setText(_translate("MainWindow", "退出"))
self.action_help_decrypt.setText(_translate("MainWindow", "解密教程"))
self.action_desc.setText(_translate("MainWindow", "说明"))
self.action_desc.setText(_translate("MainWindow", "关于软件"))
self.action_help_chat.setText(_translate("MainWindow", "聊天相关"))
self.action_help_contact.setText(_translate("MainWindow", "好友相关"))
self.action_output_CSV.setText(_translate("MainWindow", "CSV"))

View File

@ -14,7 +14,7 @@ from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Dialog(object):
def setupUi(self, Dialog):
Dialog.setObjectName("Dialog")
Dialog.resize(639, 599)
Dialog.resize(791, 599)
self.verticalLayout_3 = QtWidgets.QVBoxLayout(Dialog)
self.verticalLayout_3.setObjectName("verticalLayout_3")
self.horizontalLayout = QtWidgets.QHBoxLayout()
@ -42,6 +42,7 @@ class Ui_Dialog(object):
self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
self.verticalLayout = QtWidgets.QVBoxLayout()
self.verticalLayout.setSizeConstraint(QtWidgets.QLayout.SetMinimumSize)
self.verticalLayout.setObjectName("verticalLayout")
self.label = QtWidgets.QLabel(Dialog)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Preferred)
@ -68,6 +69,7 @@ class Ui_Dialog(object):
self.verticalLayout.addItem(spacerItem1)
self.horizontalLayout_2.addLayout(self.verticalLayout)
self.verticalLayout_2 = QtWidgets.QVBoxLayout()
self.verticalLayout_2.setSizeConstraint(QtWidgets.QLayout.SetMinimumSize)
self.verticalLayout_2.setObjectName("verticalLayout_2")
self.label_2 = QtWidgets.QLabel(Dialog)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
@ -79,8 +81,10 @@ class Ui_Dialog(object):
self.verticalLayout_2.addWidget(self.label_2)
self.horizontalLayout_2.addLayout(self.verticalLayout_2)
self.listWidget = QtWidgets.QListWidget(Dialog)
self.listWidget.setMinimumSize(QtCore.QSize(0, 0))
self.listWidget.setObjectName("listWidget")
self.horizontalLayout_2.addWidget(self.listWidget)
self.horizontalLayout_2.setStretch(2, 1)
self.verticalLayout_3.addLayout(self.horizontalLayout_2)
self.textBrowser = QtWidgets.QTextBrowser(Dialog)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
@ -88,7 +92,7 @@ class Ui_Dialog(object):
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.textBrowser.sizePolicy().hasHeightForWidth())
self.textBrowser.setSizePolicy(sizePolicy)
self.textBrowser.setMaximumSize(QtCore.QSize(16777215, 120))
self.textBrowser.setMaximumSize(QtCore.QSize(16777215, 80))
self.textBrowser.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.textBrowser.setTabStopWidth(0)
self.textBrowser.setOpenExternalLinks(False)
@ -117,7 +121,7 @@ class Ui_Dialog(object):
self.btn_start.setStyleSheet("QPushButton{\n"
" background-color: rgb(233,233,233);\n"
" border-radius: 5px;\n"
" padding: 8px;\n"
" padding: 10px;\n"
"}\n"
"QPushButton:hover { \n"
" background-color: lightgray;\n"

View File

@ -186,7 +186,7 @@ class DecryptControl(QWidget, decryptUi.Ui_Dialog, QCursorGif):
}
try:
os.makedirs('./app/data', exist_ok=True)
with open(INFO_FILE_PATH, "w", encoding="utf-8") as f:
json.dump(dic, f, ensure_ascii=False, indent=4)
except:
@ -213,10 +213,7 @@ class DecryptThread(QThread):
pass
def run(self):
misc_db.close()
msg_db.close()
# micro_msg_db.close()
# hard_link_db.close()
close_db()
output_dir = DB_DIR
os.makedirs(output_dir, exist_ok=True)
tasks = []