mirror of
https://github.com/LC044/WeChatMsg
synced 2025-02-22 10:52:18 +08:00
解密后自动加载联系人页面
This commit is contained in:
parent
cc97628902
commit
e180e58d0f
@ -4,8 +4,10 @@
|
||||
<option name="autoReloadType" value="SELECTIVE" />
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="84e65474-7da9-466d-baf3-cc88dde3ffdd" name="变更" comment="修复db文件空格路径的bug">
|
||||
<list default="true" id="84e65474-7da9-466d-baf3-cc88dde3ffdd" name="变更" comment="修复情感分析数值显示过长的bug">
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/ui_pc/contact/contact_window.py" beforeDir="false" afterPath="$PROJECT_DIR$/app/ui_pc/contact/contact_window.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/ui_pc/mainview.py" beforeDir="false" afterPath="$PROJECT_DIR$/app/ui_pc/mainview.py" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
@ -101,7 +103,7 @@
|
||||
<recent name="D:\Project\PythonProject\WeChatMsg\app\Ui" />
|
||||
</key>
|
||||
</component>
|
||||
<component name="RunManager" selected="Python.main">
|
||||
<component name="RunManager" selected="Python.decrypt_window">
|
||||
<configuration name="CAvatar" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true">
|
||||
<module name="WeChatMsg" />
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
@ -230,8 +232,8 @@
|
||||
</configuration>
|
||||
<recent_temporary>
|
||||
<list>
|
||||
<item itemvalue="Python.main" />
|
||||
<item itemvalue="Python.decrypt_window" />
|
||||
<item itemvalue="Python.main" />
|
||||
<item itemvalue="Python.misc" />
|
||||
<item itemvalue="Python.CAvatar" />
|
||||
<item itemvalue="Python.contact_info_ui" />
|
||||
@ -250,13 +252,6 @@
|
||||
<option name="presentableId" value="Default" />
|
||||
<updated>1672848140146</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00015" summary="烂了">
|
||||
<created>1680624068689</created>
|
||||
<option name="number" value="00015" />
|
||||
<option name="presentableId" value="LOCAL-00015" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1680624068689</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00016" summary="窗口切换,使用stackedWidget">
|
||||
<created>1680630659802</created>
|
||||
<option name="number" value="00016" />
|
||||
@ -593,7 +588,14 @@
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1700063620952</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="64" />
|
||||
<task id="LOCAL-00064" summary="修复情感分析数值显示过长的bug">
|
||||
<created>1700064404522</created>
|
||||
<option name="number" value="00064" />
|
||||
<option name="presentableId" value="LOCAL-00064" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1700064404522</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="65" />
|
||||
<servers />
|
||||
</component>
|
||||
<component name="UnknownFeatures">
|
||||
@ -629,7 +631,6 @@
|
||||
</option>
|
||||
</component>
|
||||
<component name="VcsManagerConfiguration">
|
||||
<MESSAGE value="重构一些class,删除一些不必要的文件" />
|
||||
<MESSAGE value="用stackedWidget实现导航栏" />
|
||||
<MESSAGE value="修复部分bug" />
|
||||
<MESSAGE value="替换chat里的contact" />
|
||||
@ -654,7 +655,8 @@
|
||||
<MESSAGE value="头像支持显示二进制" />
|
||||
<MESSAGE value="显示联系人信息" />
|
||||
<MESSAGE value="修复db文件空格路径的bug" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="修复db文件空格路径的bug" />
|
||||
<MESSAGE value="修复情感分析数值显示过长的bug" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="修复情感分析数值显示过长的bug" />
|
||||
<option name="OPTIMIZE_IMPORTS_BEFORE_PROJECT_COMMIT" value="true" />
|
||||
<option name="REFORMAT_BEFORE_PROJECT_COMMIT" value="true" />
|
||||
</component>
|
||||
|
@ -10,6 +10,16 @@ if os.path.exists(micromsg_path):
|
||||
cursor = DB.cursor()
|
||||
|
||||
|
||||
def init_database():
|
||||
global DB
|
||||
global cursor
|
||||
if not DB:
|
||||
if os.path.exists(micromsg_path):
|
||||
DB = sqlite3.connect(micromsg_path, check_same_thread=False)
|
||||
# '''创建游标'''
|
||||
cursor = DB.cursor()
|
||||
|
||||
|
||||
def is_database_exist():
|
||||
return os.path.exists(micromsg_path)
|
||||
|
||||
|
@ -49,6 +49,7 @@ class ContactWindow(QWidget, Ui_Form):
|
||||
super().__init__(parent)
|
||||
self.show_thread = None
|
||||
self.setupUi(self)
|
||||
self.ok_flag = False
|
||||
self.setStyleSheet(Stylesheet)
|
||||
self.init_ui()
|
||||
self.show_contacts()
|
||||
@ -60,12 +61,16 @@ class ContactWindow(QWidget, Ui_Form):
|
||||
self.stackedWidget.setCurrentIndex(0)
|
||||
|
||||
def show_contacts(self):
|
||||
if self.ok_flag:
|
||||
return
|
||||
micro_msg.init_database()
|
||||
if not micro_msg.is_database_exist():
|
||||
QMessageBox.critical(self, "错误", "数据库不存在\n请先解密数据库")
|
||||
return
|
||||
self.show_thread = ShowContactThread()
|
||||
self.show_thread.showSingal.connect(self.show_contact)
|
||||
self.show_thread.start()
|
||||
self.ok_flag = True
|
||||
|
||||
def show_contact(self, contact):
|
||||
contact_item = ContactQListWidgetItem(contact.nickName, contact.smallHeadImgUrl, contact.smallHeadImgBLOG)
|
||||
|
@ -85,8 +85,8 @@ class MainWinController(QMainWindow, mainwindow.Ui_MainWindow):
|
||||
label.setStyleSheet('background: rgb(%d, %d, %d);margin: 50px;' % (
|
||||
randint(0, 255), randint(0, 255), randint(0, 255)))
|
||||
self.stackedWidget.addWidget(label)
|
||||
contact_window = ContactWindow()
|
||||
self.stackedWidget.addWidget(contact_window)
|
||||
self.contact_window = ContactWindow()
|
||||
self.stackedWidget.addWidget(self.contact_window)
|
||||
label = QLabel('我是页面', self)
|
||||
label.setAlignment(Qt.AlignCenter)
|
||||
# 设置label的背景颜色(这里随机)
|
||||
@ -99,7 +99,8 @@ class MainWinController(QMainWindow, mainwindow.Ui_MainWindow):
|
||||
self.stackedWidget.setCurrentIndex(3)
|
||||
|
||||
def setCurrentIndex(self, row):
|
||||
print(row)
|
||||
if row == 1:
|
||||
self.contact_window.show_contacts()
|
||||
self.stackedWidget.setCurrentIndex(row)
|
||||
|
||||
def about(self):
|
||||
|
Loading…
Reference in New Issue
Block a user