修复 QQ、TIM 安装后无法正常生成快捷方式的问题

This commit is contained in:
gfdgd xi 2022-09-10 22:07:58 +08:00
parent 00e0fe5046
commit 1e78584493
4 changed files with 51 additions and 7 deletions

View File

@ -23,7 +23,7 @@
inkscape:version="0.92.4 (5da689c313, 2019-01-14)"><metadata
id="metadata75"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title /></cc:Work></rdf:RDF></metadata><defs
id="defs73"><clipPath
id="clip0"><path
id="path218"
@ -287,7 +287,7 @@
<g
style="overflow:hidden"
id="g352"
transform="matrix(0.59524695,0,0,0.59348352,310.21129,310.80909)"><g
transform="matrix(0.59524695,0,0,0.59348352,310.80653,311.40257)"><g
id="g297"
transform="translate(-858,-199)"
clip-path="url(#clip0)"><g

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 28 KiB

View File

@ -200,7 +200,7 @@
<g
style="overflow:hidden"
id="g279"
transform="matrix(0.59524695,0,0,0.59524695,311.90659,311.27079)">
transform="matrix(0.59524695,0,0,0.59348352,310.80653,311.40257)">
<g
id="g224"
transform="translate(-858,-199)"

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View File

@ -249,7 +249,7 @@
<g
style="overflow:hidden"
id="g294"
transform="matrix(0.59524695,0,0,0.59524695,311.48343,313.84891)">
transform="matrix(0.59524695,0,0,0.59348352,310.80653,311.40257)">
<g
id="g239"
transform="translate(-858,-199)"

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

View File

@ -203,6 +203,24 @@ class Runexebutton_threading(QtCore.QThread):
wineBottonHistory.append(e2.currentText()) # 将记录写进数组
write_txt(get_home() + "/.config/deepin-wine-runner/WineBottonHistory.json", str(json.dumps(ListToDictionary(wineBottonHistory)))) # 将历史记录的数组转换为字典并写入
self.showHistory.emit("")
# 针对 QQ、TIM 安装后不会生成 lnk 的问题,由程序读取以及自动创建
# 判断是否安装了 QQ/TIM
for i in iconListUnBuild:
if os.path.exists(i[1].replace("wineBottonPath", wineBottonPath)):
if not os.path.exists(f"{get_home()}/.local/share/applications/{i[0]}-{os.path.basename(wineBottonPath)}.desktop"):
print("图标不存在,创建图标")
# 图标不存在
# 写入 .desktop 文件
try:
write_txt(f"{get_home()}/.local/share/applications/{i[0]}-{os.path.basename(wineBottonPath)}.desktop", f'''[Desktop Entry]
Name={i[0]}
Exec=env WINEPREFIX='{wineBottonPath}' {option} {wine[o1.currentText()]} '{i[1].replace("wineBottonPath", wineBottonPath)}' {setting["WineOption"]} {wineUsingOption}
Icon={programPath}/Icon/{i[0]}.svg
Type=Application
StartupNotify=true''')
except:
# 写入不进去就别写入了,当什么事情都没发生就行
traceback.print_exc()
DisableButton(False)
@ -274,6 +292,12 @@ def make_desktop_on_launcher():
os.remove(f"{programPath}/dlls-arm.7z")
if o1.currentText() == "基于 exagear 的 deepin-wine6-stable" or o1.currentText() == "基于 box86 的 deepin-wine6-stable":
wineUsingOption = "--disable-gpu"
for i in iconList:
if i[1].replace("wineBottonPath", wineBottonPath) == e2.currentText():
# 如果路径相同,即可以用程序对应的图标
iconPath = f"{programPath}/Icon/{i[0]}.svg"
# 读到了就不需要再读取了
break
write_txt(get_home() + "/.local/share/applications/" + combobox1.currentText() + ".desktop", f'''[Desktop Entry]
Name={combobox1.currentText()}
Exec=env WINEPREFIX='{wineBottonPath}' {option} {wine[o1.currentText()]} '{e2.currentText()}' {setting["WineOption"]} {wineUsingOption}
@ -329,6 +353,12 @@ def make_desktop_on_desktop():
option += f"WINEARCH={setting['Architecture']} "
if not setting["Debug"]:
option += "WINEDEBUG=-all "
for i in iconList:
if i[1].replace("wineBottonPath", wineBottonPath) == e2.currentText():
# 如果路径相同,即可以用程序对应的图标
iconPath = f"{programPath}/Icon/{i[0]}.svg"
# 读到了就不需要再读取了
break
write_txt(get_desktop_path() + "/" + combobox1.currentText() + ".desktop", f'''[Desktop Entry]
Name={combobox1.currentText()}
Exec=env WINEPREFIX='{wineBottonPath}' {option} {wine[o1.currentText()]} '{e2.currentText()}' {setting["WineOption"]} {wineUsingOption}
@ -514,6 +544,8 @@ class RunWinetricksThread(QtCore.QThread):
text = ""
self.signal.emit(text)
print(text, end="")
DisableButton(False)
runWinetricks = None
@ -1586,7 +1618,8 @@ updateThingsString = '''※1、Dll 提取工具支持 NT 6.X 及以上版本的
3DEBUG 模式输出更多信息以方便调试原本只输出 pidErr
4支持安装 msi 文件
5修复无法正常评分的问题
6更新组件安装的离线列表
6修复 QQTIM 安装后无法正常生成快捷方式的问题
7更新组件安装的离线列表
'''
for i in information["Thank"]:
thankText += f"{i}\n"
@ -1624,8 +1657,19 @@ try:
threading.Thread(target=requests.get, args=[parse.unquote(base64.b64decode("aHR0cHM6Ly8zMDQ2MjZwOTI3LmdvaG8uY28vc3BhcmstZGVlcGluLXdpbmUtcnVubmVyL29wZW4vSW5zdGFsbC5waHA=").decode("utf-8")) + "?Version=" + version]).start()
except:
pass
iconListUnBuild = [
["QQ", "wineBottonPath/drive_c/Program Files/Tencent/QQ/Bin/QQ.exe"],
["QQ", "wineBottonPath/drive_c/Program Files (x86)/Tencent/QQ/Bin/QQ.exe"],
["TIM", "wineBottonPath/drive_c/Program Files/Tencent/TIM/Bin/TIM.exe"],
["TIM", "wineBottonPath/drive_c/Program Files (x86)/Tencent/TIM/Bin/TIM.exe"]
]
iconList = [
["微信", "wineBottonPath/drive_c/Program Files/Tencent/WeChat/WeChat.exe"],
["微信", "wineBottonPath/drive_c/Program Files (x86)/Tencent/WeChat/WeChat.exe"]
]
for i in iconListUnBuild:
iconList.append(i)
print(iconList)
###########################
# 窗口创建