From b851b12a62dbe28ee6acd49582c02159c629cddd Mon Sep 17 00:00:00 2001 From: gfdgd xi <3025613752@qq.com> Date: Sat, 18 Jun 2022 23:01:23 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=88=E5=8A=A0=E4=BA=86=E4=B8=80=E7=82=B9?= =?UTF-8?q?=E7=82=B9=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Language.json | 14 ++++++++++++-- main.py | 14 +++++++------- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/Language.json b/Language.json index d2de56c..cc6f332 100644 --- a/Language.json +++ b/Language.json @@ -20,7 +20,12 @@ "ChooseApkError": "你没有选择 apk 文件", "SaveApkIconError": "本程序不支持保存该 apk 的图标", "PathError": "路径不存在,请重试!", - "SettingReadError": "读取设置错误!无法打开设置窗口!" + "SettingReadError": "读取设置错误!无法打开设置窗口!", + "SettingSaveError": "保存设置错误!", + "ConnectServerError": "无法连接服务器!", + "ConnectServerStarError": "无法连接服务器!无法进行评分!", + "ApkFileError": "该应用安装包异常,无法查询相关数据!", + "InputDataError": "你输入的数值不正确!" }, "Menu": [ { @@ -167,7 +172,12 @@ "ChooseApkError": "You don't choose any APK file.", "SaveApkIconError": "This APK file isn't allow to save the icon file.", "PathError": "Path not found, please try again", - "SettingReadError": "Read user setting error! Can't to continue to set!" + "SettingReadError": "Read user setting error! Can't to continue to set!", + "SettingSaveError": "Setting can't save", + "ConnectServerError": "Can't connect the cloud server!", + "ConnectServerStarError": "Can't connect the cloud server! So can't give star for the app!", + "ApkFileError": "This apk file is error and can't find any data about the apk file!", + "InputDataError": "Your input error data!" }, "Menu": [ { diff --git a/main.py b/main.py index 2e5864d..4cf0c89 100755 --- a/main.py +++ b/main.py @@ -690,7 +690,7 @@ class SettingWindow(): write_txt(get_home() + "/.config/uengine-runner/setting.json", json.dumps({"SaveApk": bool(SettingWindow.saveApkOption.get())})) except: traceback.print_exc() - messagebox.showerror(title="错误", message="保存设置错误!") + messagebox.showerror(title="错误", message=langFile[lang]["Main"]["MainWindow"]["Error"]["SettingSaveError"]) return messagebox.showinfo(title="提示", message="设置保存完毕!") @@ -716,8 +716,7 @@ class UpdateWindow(): updateText.insert("0.0", UpdateWindow.data["New"].replace("\\n", "\n")) except: traceback.print_exc() - messagebox.showerror(title="错误", message="无法连接服务器!") - + messagebox.showerror(title="错误", message=langFile[lang]["Main"]["MainWindow"]["Error"]["ConnectServerError"]) updateText.configure(state=tk.DISABLED) versionLabel.pack(anchor=tk.W) updateText.pack() @@ -757,7 +756,7 @@ class ApkInformation(): path = ComboInstallPath.get() package = GetApkPackageName(path) if package == None or package == "": - messagebox.showerror(title="错误", message="该应用安装包异常,无法查询相关数据!") + messagebox.showerror(title="错误", message=langFile[lang]["Main"]["MainWindow"]["Error"]["ApkFileError"]) return message = tk.Toplevel() message.title("“{}“的Apk信息".format(GetApkChineseLabel(path))) @@ -822,12 +821,13 @@ Activity:{} try: messagebox.showinfo(title="提示", message=requests.post("http://120.25.153.144/uengine-runner/app/check/add.php", {"Package": GetApkPackageName(path), "Type": choose}).text) except: - messagebox.showerror(title="错误", message="无法连接服务器!无法进行评分!") + messagebox.showerror(title="错误", message=langFile[lang]["Main"]["MainWindow"]["Error"]["ConnectServerStarError"]) + def ShowMap(): package = GetApkPackageName(path) if package == None or package == "": - messagebox.showerror(title="错误", message="该应用安装包异常,无法查询相关数据!") + messagebox.showerror(title="错误", message=langFile[lang]["Main"]["MainWindow"]["Error"]["ApkFileError"]) return try: data = json.loads(requests.get("http://120.25.153.144/uengine-runner/app/check/" + package +"/data.json").text) @@ -905,7 +905,7 @@ class AdbChangeUengineDisplaySize(): int(displayX.get()) int(displayY.get()) except: - messagebox.showerror(title="错误", message="你输入的数值不正确!") + messagebox.showerror(title="错误", message=langFile[lang]["Main"]["MainWindow"]["Error"]["InputDataError"]) return os.system("adb -s '192.168.250.2:5555' shell wm size {}x{}".format(displayX.get(), displayY.get())) AdbChangeUengineDisplaySize.GetUengineDisplaySize()