完成提取图标

This commit is contained in:
2022-07-24 23:12:34 +08:00
parent 27c39d96a9
commit 88ca313779

10
main.py
View File

@@ -470,19 +470,19 @@ def SaveIconToOtherPath():
if apkPath == "": if apkPath == "":
QtWidgets.QMessageBox.critical(widget, "错误", langFile[lang]["Main"]["MainWindow"]["Error"]["ChooseApkError"]) QtWidgets.QMessageBox.critical(widget, "错误", langFile[lang]["Main"]["MainWindow"]["Error"]["ChooseApkError"])
return return
path = filedialog.asksaveasfilename(title="保存图标", filetypes=[("PNG 图片", "*.png"), ("所有文件", "*.*")], initialdir=json.loads(readtxt(get_home() + "/.config/uengine-runner/SaveApkIcon.json"))["path"])[0] path = QtWidgets.QFileDialog.getSaveFileName(widget, "保存图标", "icon.png", "PNG 图片(*.png);;所有文件(*.*)", json.loads(readtxt(get_home() + "/.config/uengine-runner/SaveApkIcon.json"))["path"])[0]
if not path == "": if not path == "":
try: try:
SaveApkIcon(apkPath, path) SaveApkIcon(apkPath, path)
except: except:
traceback.print_exc() traceback.print_exc()
messagebox.showerror(title="错误", message=langFile[lang]["Main"]["MainWindow"]["Error"]["SaveApkIconError"]) QtWidgets.QMessageBox.critical(widget, "错误", langFile[lang]["Main"]["MainWindow"]["Error"]["SaveApkIconError"])
return return
write_txt(get_home() + "/.config/uengine-runner/SaveApkIcon.json", json.dumps({"path": os.path.dirname(path)})) # 写入配置文件 write_txt(get_home() + "/.config/uengine-runner/SaveApkIcon.json", json.dumps({"path": os.path.dirname(path)})) # 写入配置文件
findApkHistory.append(ComboInstallPath.get()) findApkHistory.append(ComboInstallPath.currentText())
ComboInstallPath['value'] = findApkHistory UpdateCombobox(0)
write_txt(get_home() + "/.config/uengine-runner/FindApkHistory.json", str(json.dumps(ListToDictionary(findApkHistory)))) # 将历史记录的数组转换为字典并写入 write_txt(get_home() + "/.config/uengine-runner/FindApkHistory.json", str(json.dumps(ListToDictionary(findApkHistory)))) # 将历史记录的数组转换为字典并写入
messagebox.showinfo(title="提示", message="保存成功!") QtWidgets.QMessageBox.information(widget, "提示", "保存成功!")
# 清空 uengine 数据 # 清空 uengine 数据
def BackUengineClean()->"清空 uengine 数据": def BackUengineClean()->"清空 uengine 数据":