From 474babff8742f0c830946c572382255c9bbc1020 Mon Sep 17 00:00:00 2001 From: gfdgd_xi <3025613752@qq.com> Date: Sat, 10 Sep 2022 18:29:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D'=E6=B7=BB=E5=8A=A0UEngine?= =?UTF-8?q?=E5=BA=94=E7=94=A8=E5=BF=AB=E6=8D=B7=E6=96=B9=E5=BC=8F=E5=87=BA?= =?UTF-8?q?=E7=8E=B0=E9=97=AE=E9=A2=98'=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mainwindow.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/mainwindow.py b/mainwindow.py index c9848d8..787b628 100755 --- a/mainwindow.py +++ b/mainwindow.py @@ -1386,18 +1386,18 @@ class AddNewUengineDesktopLink(): # 添加快捷方式 def SaveDesktopLink(): try: - if os.path.exists("{}/.local/share/applications/uengine/{}.desktop".format(get_home(), packageName.get())): + if os.path.exists("{}/.local/share/applications/uengine/{}.desktop".format(get_home(), packageName.text())): if QtWidgets.QMessageBox.question(widget, "提示", "文件已存在,是否要覆盖?") == QtWidgets.QMessageBox.No: return if not os.path.exists("{}/.local/share/icons/hicolor/256x256/apps/".format(get_home())): os.makedirs("{}/.local/share/icons/hicolor/256x256/apps/".format(get_home())) global activityName - iconSavePath = "{}/.local/share/icons/hicolor/256x256/apps/{}.png".format(get_home(), packageName.get()) + iconSavePath = "{}/.local/share/icons/hicolor/256x256/apps/{}.png".format(get_home(), packageName.text()) shutil.copy(programPath + "/defult.png", iconSavePath) - BuildUengineDesktop(packageName.get(), activityName, packageName.get(), iconSavePath, - "{}/.local/share/applications/uengine/{}.desktop".format(get_home(), packageName.get())) - BuildUengineDesktop(packageName.get(), activityName, packageName.get(), iconSavePath, - "{}/{}.desktop".format(get_desktop_path(), packageName.get())) + BuildUengineDesktop(packageName.text(), activityName, packageName.text(), iconSavePath, + "{}/.local/share/applications/uengine/{}.desktop".format(get_home(), packageName.text())) + BuildUengineDesktop(packageName.text(), activityName, packageName.text(), iconSavePath, + "{}/{}.desktop".format(get_desktop_path(), packageName.text())) AddNewUengineDesktopLink.SaveHistory() QtWidgets.QMessageBox.information(widget, "提示", "创建完毕!") except: @@ -1409,13 +1409,13 @@ class AddNewUengineDesktopLink(): def DelDesktopLink(): try: global packageName - if not os.path.exists("{}/.local/share/applications/uengine/{}.desktop".format(get_home(), packageName.get())): + if not os.path.exists("{}/.local/share/applications/uengine/{}.desktop".format(get_home(), packageName.text())): QtWidgets.QMessageBox.critical(widget, "错误", "此包名对应的 UEngine 桌面快捷方式不存在!") return if QtWidgets.QMessageBox.warning(widget, "警告", "你确定要删除吗?删除后将无法恢复!", QtWidgets.QMessageBox.Ok | QtWidgets.QMessageBox.Cancel, QtWidgets.QMessageBox.Cancel) == QtWidgets.QMessageBox.Cancel: return try: - os.remove("{}/.local/share/applications/uengine/{}.desktop".format(get_home(), packageName.get())) + os.remove("{}/.local/share/applications/uengine/{}.desktop".format(get_home(), packageName.text())) AddNewUengineDesktopLink.SaveHistory() QtWidgets.QMessageBox.information(widget, "提示", "已删除") except: