增加中文路径提示

This commit is contained in:
shuaikangzhou 2023-11-03 23:24:23 +08:00
parent 091e814170
commit fa2399d27e
4 changed files with 32 additions and 18 deletions

1
.gitignore vendored
View File

@ -1,4 +1,5 @@
.vscode
.idea
build
data
sqlcipher-3.0.1

View File

@ -4,12 +4,11 @@
<option name="autoReloadType" value="SELECTIVE" />
</component>
<component name="ChangeListManager">
<list default="true" id="84e65474-7da9-466d-baf3-cc88dde3ffdd" name="变更" comment="修复部分bug">
<list default="true" id="84e65474-7da9-466d-baf3-cc88dde3ffdd" name="变更" comment="替换chat里的contact">
<change beforePath="$PROJECT_DIR$/.gitignore" beforeDir="false" afterPath="$PROJECT_DIR$/.gitignore" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/DataBase/data.py" beforeDir="false" afterPath="$PROJECT_DIR$/app/DataBase/data.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/Ui/chat/chat.py" beforeDir="false" afterPath="$PROJECT_DIR$/app/Ui/chat/chat.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/Ui/contact/contact.py" beforeDir="false" afterPath="$PROJECT_DIR$/app/Ui/contact/contact.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/Ui/mainview.py" beforeDir="false" afterPath="$PROJECT_DIR$/app/Ui/mainview.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/Ui/decrypt/decrypt.py" beforeDir="false" afterPath="$PROJECT_DIR$/app/Ui/decrypt/decrypt.py" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -466,7 +465,14 @@
<option name="project" value="LOCAL" />
<updated>1698853140384</updated>
</task>
<option name="localTasksCounter" value="39" />
<task id="LOCAL-00039" summary="替换chat里的contact">
<created>1698940208580</created>
<option name="number" value="00039" />
<option name="presentableId" value="LOCAL-00039" />
<option name="project" value="LOCAL" />
<updated>1698940208580</updated>
</task>
<option name="localTasksCounter" value="40" />
<servers />
</component>
<component name="UnknownFeatures">
@ -523,23 +529,24 @@
<MESSAGE value="重构一些class删除一些不必要的文件" />
<MESSAGE value="用stackedWidget实现导航栏" />
<MESSAGE value="修复部分bug" />
<option name="LAST_COMMIT_MESSAGE" value="修复部分bug" />
<MESSAGE value="替换chat里的contact" />
<option name="LAST_COMMIT_MESSAGE" value="替换chat里的contact" />
<option name="OPTIMIZE_IMPORTS_BEFORE_PROJECT_COMMIT" value="true" />
<option name="REFORMAT_BEFORE_PROJECT_COMMIT" value="true" />
</component>
<component name="XDebuggerManager">
<breakpoint-manager>
<breakpoints>
<line-breakpoint enabled="true" suspend="THREAD" type="python-line">
<url>file://$PROJECT_DIR$/app/DataBase/output.py</url>
<line>42</line>
<option name="timeStamp" value="3" />
</line-breakpoint>
<line-breakpoint enabled="true" suspend="THREAD" type="python-line">
<url>file://$PROJECT_DIR$/app/DataBase/output.py</url>
<line>412</line>
<option name="timeStamp" value="7" />
</line-breakpoint>
<line-breakpoint enabled="true" suspend="THREAD" type="python-line">
<url>file://$PROJECT_DIR$/main.py</url>
<line>18</line>
<option name="timeStamp" value="8" />
</line-breakpoint>
</breakpoints>
<default-breakpoints>
<breakpoint type="python-exception">

View File

@ -129,7 +129,7 @@ def decrypt(db, key):
if not db:
print('没有数据库文件')
return False
if os.path.exists('./app/DataBase/Msg.db'):
if is_db_exist():
print('/app/DataBase/Msg.db 已经存在')
return True
cmd = './sqlcipher-3.0.1/bin/sqlcipher-shell32.exe'

View File

@ -8,7 +8,6 @@
@comment : ··· 解密数据库导出原始数据库文件
"""
import hashlib
import os
import time
import xml.etree.ElementTree as ET
@ -32,11 +31,11 @@ class DecryptControl(QWidget, decryptUi.Ui_Dialog):
self.btn_db.clicked.connect(self.get_db)
self.btn_xml.clicked.connect(self.get_xml)
self.pushButton_3.clicked.connect(self.decrypt)
self.xml_path = None
self.db_path = None
self.xml_path: str = None
self.db_path: str = None
def db_exist(self):
if os.path.exists('./app/DataBase/Msg.db'):
if data.is_db_exist():
self.btnEnterClicked()
self.close()
@ -52,8 +51,13 @@ class DecryptControl(QWidget, decryptUi.Ui_Dialog):
def get_db(self):
self.db_path, _ = QFileDialog.getOpenFileName(self, 'Open file', r'..', "Database files (*.db)")
if self.db_path:
self.label_db.setText('数据库已就绪')
return self.db_path
if self.db_path.isascii():
self.label_db.setText('数据库已就绪')
return self.db_path
else:
self.label_db.setText('数据库未就绪')
QMessageBox.critical(self, "错误", "db文件请不要带有中文路径\n可以放在D:\\\\data 目录下")
self.db_path = ''
return False
def decrypt(self):
@ -107,6 +111,8 @@ class DecryptControl(QWidget, decryptUi.Ui_Dialog):
:return: None
"""
self.progressBar.setProperty('value', value)
if value == '99':
QMessageBox.information(self, "温馨提示", "我知道你很急\n但你先别急")
if value == '100':
QMessageBox.information(self, "解密成功", "请退出该界面",
QMessageBox.Yes)