diff --git a/UI/KeyAddGui.py b/UI/KeyAddGui.py index 171ad00..45e7d8c 100644 --- a/UI/KeyAddGui.py +++ b/UI/KeyAddGui.py @@ -32,9 +32,9 @@ class Ui_MainWindow(object): self.editButton = QtWidgets.QPushButton(self.centralwidget) self.editButton.setObjectName("editButton") self.horizontalLayout.addWidget(self.editButton) - self.saveButton = QtWidgets.QPushButton(self.centralwidget) - self.saveButton.setObjectName("saveButton") - self.horizontalLayout.addWidget(self.saveButton) + self.delectButton = QtWidgets.QPushButton(self.centralwidget) + self.delectButton.setObjectName("delectButton") + self.horizontalLayout.addWidget(self.delectButton) self.verticalLayout.addLayout(self.horizontalLayout) MainWindow.setCentralWidget(self.centralwidget) self.menuBar = QtWidgets.QMenuBar(MainWindow) @@ -74,7 +74,7 @@ class Ui_MainWindow(object): self.tips.setText(_translate("MainWindow", "

此工具可以用于设置快捷键到 Wine 容器的映射,以便 Wine 程序可以正常的使用快捷键
Deepin/UOS将会使用默认的快捷键服务,其它发行版将使用此运行器提供的快捷键服务
Deepin/UOS将只会提供快捷键添加功能,请在控制中心进行快捷键的修改管理

")) self.addButton.setText(_translate("MainWindow", "添加")) self.editButton.setText(_translate("MainWindow", "编辑")) - self.saveButton.setText(_translate("MainWindow", "保存")) + self.delectButton.setText(_translate("MainWindow", "删除")) self.menu.setTitle(_translate("MainWindow", "设置快捷键服务")) self.action.setText(_translate("MainWindow", "关于")) self.serverTips.setText(_translate("MainWindow", "此内容只支持非Deepin/UOS发行版")) diff --git a/UI/KeyAddGui.ui b/UI/KeyAddGui.ui index c024da2..a0869ec 100644 --- a/UI/KeyAddGui.ui +++ b/UI/KeyAddGui.ui @@ -55,9 +55,9 @@ - + - 保存 + 删除 diff --git a/UI/__pycache__/KeyAddGui.cpython-37.pyc b/UI/__pycache__/KeyAddGui.cpython-37.pyc index 03b5fff..ca13689 100644 Binary files a/UI/__pycache__/KeyAddGui.cpython-37.pyc and b/UI/__pycache__/KeyAddGui.cpython-37.pyc differ diff --git a/key/UI/AutoConfig.py b/key/UI/AutoConfig.py deleted file mode 100755 index 1418666..0000000 --- a/key/UI/AutoConfig.py +++ /dev/null @@ -1,76 +0,0 @@ -# -*- coding: utf-8 -*- - -# Form implementation generated from reading ui file 'AutoConfig.ui' -# -# Created by: PyQt5 UI code generator 5.11.3 -# -# WARNING! All changes made in this file will be lost! - -from PyQt5 import QtCore, QtGui, QtWidgets - -class Ui_MainWindow(object): - def setupUi(self, MainWindow): - MainWindow.setObjectName("MainWindow") - MainWindow.resize(800, 600) - self.centralwidget = QtWidgets.QWidget(MainWindow) - self.centralwidget.setObjectName("centralwidget") - self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.centralwidget) - self.verticalLayout_3.setObjectName("verticalLayout_3") - self.horizontalLayout = QtWidgets.QHBoxLayout() - self.horizontalLayout.setObjectName("horizontalLayout") - self.searchTips = QtWidgets.QLabel(self.centralwidget) - self.searchTips.setObjectName("searchTips") - self.horizontalLayout.addWidget(self.searchTips) - self.searchThings = QtWidgets.QLineEdit(self.centralwidget) - self.searchThings.setObjectName("searchThings") - self.horizontalLayout.addWidget(self.searchThings) - self.saerchBotton = QtWidgets.QPushButton(self.centralwidget) - self.saerchBotton.setObjectName("saerchBotton") - self.horizontalLayout.addWidget(self.saerchBotton) - self.verticalLayout_3.addLayout(self.horizontalLayout) - self.searchList = QtWidgets.QListView(self.centralwidget) - self.searchList.setObjectName("searchList") - self.verticalLayout_3.addWidget(self.searchList) - self.horizontalLayout_2 = QtWidgets.QHBoxLayout() - self.horizontalLayout_2.setObjectName("horizontalLayout_2") - spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) - self.horizontalLayout_2.addItem(spacerItem) - self.runBotton = QtWidgets.QPushButton(self.centralwidget) - self.runBotton.setObjectName("runBotton") - self.horizontalLayout_2.addWidget(self.runBotton) - self.verticalLayout_3.addLayout(self.horizontalLayout_2) - MainWindow.setCentralWidget(self.centralwidget) - self.menubar = QtWidgets.QMenuBar(MainWindow) - self.menubar.setGeometry(QtCore.QRect(0, 0, 800, 36)) - self.menubar.setObjectName("menubar") - self.menu = QtWidgets.QMenu(self.menubar) - self.menu.setObjectName("menu") - MainWindow.setMenuBar(self.menubar) - self.about = QtWidgets.QAction(MainWindow) - self.about.setObjectName("about") - self.exitProgram = QtWidgets.QAction(MainWindow) - self.exitProgram.setObjectName("exitProgram") - self.help = QtWidgets.QAction(MainWindow) - self.help.setObjectName("help") - self.openFile = QtWidgets.QAction(MainWindow) - self.openFile.setObjectName("openFile") - self.menu.addAction(self.openFile) - self.menu.addSeparator() - self.menu.addAction(self.exitProgram) - self.menubar.addAction(self.menu.menuAction()) - - self.retranslateUi(MainWindow) - QtCore.QMetaObject.connectSlotsByName(MainWindow) - - def retranslateUi(self, MainWindow): - _translate = QtCore.QCoreApplication.translate - MainWindow.setWindowTitle(_translate("MainWindow", "自动部署脚本")) - self.searchTips.setText(_translate("MainWindow", "搜索内容(为空代表显示所有内容):")) - self.saerchBotton.setText(_translate("MainWindow", "搜索")) - self.runBotton.setText(_translate("MainWindow", "部署此方案")) - self.menu.setTitle(_translate("MainWindow", "程序")) - self.about.setText(_translate("MainWindow", "关于")) - self.exitProgram.setText(_translate("MainWindow", "退出程序")) - self.help.setText(_translate("MainWindow", "帮助")) - self.openFile.setText(_translate("MainWindow", "打开本地部署脚本")) - diff --git a/key/UI/AutoConfig.ui b/key/UI/AutoConfig.ui deleted file mode 100755 index 7b0ae10..0000000 --- a/key/UI/AutoConfig.ui +++ /dev/null @@ -1,110 +0,0 @@ - - - MainWindow - - - - 0 - 0 - 800 - 600 - - - - 自动部署脚本 - - - - - - - - - 搜索内容(为空代表显示所有内容): - - - - - - - - - - 搜索 - - - - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - 部署此方案 - - - - - - - - - - - 0 - 0 - 800 - 36 - - - - - 程序 - - - - - - - - - - 关于 - - - - - 退出程序 - - - - - 帮助 - - - - - 打开本地部署脚本 - - - - - - diff --git a/key/UI/KeyAddGui.py b/key/UI/KeyAddGui.py deleted file mode 100755 index 171ad00..0000000 --- a/key/UI/KeyAddGui.py +++ /dev/null @@ -1,85 +0,0 @@ -# -*- coding: utf-8 -*- - -# Form implementation generated from reading ui file 'KeyAddGui.ui' -# -# Created by: PyQt5 UI code generator 5.11.3 -# -# WARNING! All changes made in this file will be lost! - -from PyQt5 import QtCore, QtGui, QtWidgets - -class Ui_MainWindow(object): - def setupUi(self, MainWindow): - MainWindow.setObjectName("MainWindow") - MainWindow.resize(692, 314) - self.centralwidget = QtWidgets.QWidget(MainWindow) - self.centralwidget.setObjectName("centralwidget") - self.verticalLayout = QtWidgets.QVBoxLayout(self.centralwidget) - self.verticalLayout.setObjectName("verticalLayout") - self.tips = QtWidgets.QLabel(self.centralwidget) - self.tips.setObjectName("tips") - self.verticalLayout.addWidget(self.tips) - self.keyBoardList = QtWidgets.QListView(self.centralwidget) - self.keyBoardList.setObjectName("keyBoardList") - self.verticalLayout.addWidget(self.keyBoardList) - self.horizontalLayout = QtWidgets.QHBoxLayout() - self.horizontalLayout.setObjectName("horizontalLayout") - spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) - self.horizontalLayout.addItem(spacerItem) - self.addButton = QtWidgets.QPushButton(self.centralwidget) - self.addButton.setObjectName("addButton") - self.horizontalLayout.addWidget(self.addButton) - self.editButton = QtWidgets.QPushButton(self.centralwidget) - self.editButton.setObjectName("editButton") - self.horizontalLayout.addWidget(self.editButton) - self.saveButton = QtWidgets.QPushButton(self.centralwidget) - self.saveButton.setObjectName("saveButton") - self.horizontalLayout.addWidget(self.saveButton) - self.verticalLayout.addLayout(self.horizontalLayout) - MainWindow.setCentralWidget(self.centralwidget) - self.menuBar = QtWidgets.QMenuBar(MainWindow) - self.menuBar.setGeometry(QtCore.QRect(0, 0, 692, 33)) - self.menuBar.setObjectName("menuBar") - self.menu = QtWidgets.QMenu(self.menuBar) - self.menu.setObjectName("menu") - MainWindow.setMenuBar(self.menuBar) - self.action = QtWidgets.QAction(MainWindow) - self.action.setObjectName("action") - self.serverTips = QtWidgets.QAction(MainWindow) - self.serverTips.setEnabled(False) - self.serverTips.setObjectName("serverTips") - self.startServer = QtWidgets.QAction(MainWindow) - self.startServer.setObjectName("startServer") - self.stopServer = QtWidgets.QAction(MainWindow) - self.stopServer.setObjectName("stopServer") - self.setAutoStart = QtWidgets.QAction(MainWindow) - self.setAutoStart.setObjectName("setAutoStart") - self.setUnautoStart = QtWidgets.QAction(MainWindow) - self.setUnautoStart.setObjectName("setUnautoStart") - self.menu.addAction(self.serverTips) - self.menu.addSeparator() - self.menu.addAction(self.startServer) - self.menu.addAction(self.stopServer) - self.menu.addSeparator() - self.menu.addAction(self.setAutoStart) - self.menu.addAction(self.setUnautoStart) - self.menuBar.addAction(self.menu.menuAction()) - - self.retranslateUi(MainWindow) - QtCore.QMetaObject.connectSlotsByName(MainWindow) - - def retranslateUi(self, MainWindow): - _translate = QtCore.QCoreApplication.translate - MainWindow.setWindowTitle(_translate("MainWindow", "编辑快捷键")) - self.tips.setText(_translate("MainWindow", "

此工具可以用于设置快捷键到 Wine 容器的映射,以便 Wine 程序可以正常的使用快捷键
Deepin/UOS将会使用默认的快捷键服务,其它发行版将使用此运行器提供的快捷键服务
Deepin/UOS将只会提供快捷键添加功能,请在控制中心进行快捷键的修改管理

")) - self.addButton.setText(_translate("MainWindow", "添加")) - self.editButton.setText(_translate("MainWindow", "编辑")) - self.saveButton.setText(_translate("MainWindow", "保存")) - self.menu.setTitle(_translate("MainWindow", "设置快捷键服务")) - self.action.setText(_translate("MainWindow", "关于")) - self.serverTips.setText(_translate("MainWindow", "此内容只支持非Deepin/UOS发行版")) - self.startServer.setText(_translate("MainWindow", "启动服务")) - self.stopServer.setText(_translate("MainWindow", "停止服务")) - self.setAutoStart.setText(_translate("MainWindow", "设置开机自启")) - self.setUnautoStart.setText(_translate("MainWindow", "关闭开机自启动")) - diff --git a/key/UI/KeyAddGui.ui b/key/UI/KeyAddGui.ui deleted file mode 100755 index c024da2..0000000 --- a/key/UI/KeyAddGui.ui +++ /dev/null @@ -1,127 +0,0 @@ - - - MainWindow - - - - 0 - 0 - 692 - 314 - - - - 编辑快捷键 - - - - - - - <html><head/><body><p>此工具可以用于设置快捷键到 Wine 容器的映射,以便 Wine 程序可以正常的使用快捷键<br/>Deepin/UOS将会使用默认的快捷键服务,其它发行版将使用此运行器提供的快捷键服务<br>Deepin/UOS将只会提供快捷键添加功能,请在控制中心进行快捷键的修改管理</p></body></html> - - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - 添加 - - - - - - - 编辑 - - - - - - - 保存 - - - - - - - - - - - 0 - 0 - 692 - 33 - - - - - 设置快捷键服务 - - - - - - - - - - - - - - 关于 - - - - - false - - - 此内容只支持非Deepin/UOS发行版 - - - - - 启动服务 - - - - - 停止服务 - - - - - 设置开机自启 - - - - - 关闭开机自启动 - - - - - - diff --git a/key/UI/KeyAddKeyboardGui.py b/key/UI/KeyAddKeyboardGui.py deleted file mode 100755 index 46041e3..0000000 --- a/key/UI/KeyAddKeyboardGui.py +++ /dev/null @@ -1,86 +0,0 @@ -# -*- coding: utf-8 -*- - -# Form implementation generated from reading ui file 'KeyAddKeyboardGui.ui' -# -# Created by: PyQt5 UI code generator 5.11.3 -# -# WARNING! All changes made in this file will be lost! - -from PyQt5 import QtCore, QtGui, QtWidgets - -class Ui_MainWindow(object): - def setupUi(self, MainWindow): - MainWindow.setObjectName("MainWindow") - MainWindow.resize(800, 195) - icon = QtGui.QIcon.fromTheme("..") - MainWindow.setWindowIcon(icon) - self.centralwidget = QtWidgets.QWidget(MainWindow) - self.centralwidget.setObjectName("centralwidget") - self.verticalLayout = QtWidgets.QVBoxLayout(self.centralwidget) - self.verticalLayout.setObjectName("verticalLayout") - self.addTips = QtWidgets.QLabel(self.centralwidget) - self.addTips.setObjectName("addTips") - self.verticalLayout.addWidget(self.addTips) - self.horizontalLayout_3 = QtWidgets.QHBoxLayout() - self.horizontalLayout_3.setObjectName("horizontalLayout_3") - self.exeNameTips = QtWidgets.QLabel(self.centralwidget) - self.exeNameTips.setObjectName("exeNameTips") - self.horizontalLayout_3.addWidget(self.exeNameTips) - self.exeName = QtWidgets.QLineEdit(self.centralwidget) - self.exeName.setObjectName("exeName") - self.horizontalLayout_3.addWidget(self.exeName) - self.verticalLayout.addLayout(self.horizontalLayout_3) - self.horizontalLayout = QtWidgets.QHBoxLayout() - self.horizontalLayout.setObjectName("horizontalLayout") - self.localTips = QtWidgets.QLabel(self.centralwidget) - self.localTips.setObjectName("localTips") - self.horizontalLayout.addWidget(self.localTips) - self.localKeyboardChoose = QtWidgets.QComboBox(self.centralwidget) - self.localKeyboardChoose.setObjectName("localKeyboardChoose") - self.horizontalLayout.addWidget(self.localKeyboardChoose) - self.addTips_2 = QtWidgets.QLabel(self.centralwidget) - self.addTips_2.setObjectName("addTips_2") - self.horizontalLayout.addWidget(self.addTips_2) - self.localKey = QtWidgets.QLineEdit(self.centralwidget) - self.localKey.setObjectName("localKey") - self.horizontalLayout.addWidget(self.localKey) - self.wineTips = QtWidgets.QLabel(self.centralwidget) - self.wineTips.setObjectName("wineTips") - self.horizontalLayout.addWidget(self.wineTips) - self.wineKeyboardChoose = QtWidgets.QComboBox(self.centralwidget) - self.wineKeyboardChoose.setObjectName("wineKeyboardChoose") - self.horizontalLayout.addWidget(self.wineKeyboardChoose) - self.addTipsWine = QtWidgets.QLabel(self.centralwidget) - self.addTipsWine.setObjectName("addTipsWine") - self.horizontalLayout.addWidget(self.addTipsWine) - self.wineKey = QtWidgets.QLineEdit(self.centralwidget) - self.wineKey.setObjectName("wineKey") - self.horizontalLayout.addWidget(self.wineKey) - self.verticalLayout.addLayout(self.horizontalLayout) - spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) - self.verticalLayout.addItem(spacerItem) - self.horizontalLayout_2 = QtWidgets.QHBoxLayout() - self.horizontalLayout_2.setObjectName("horizontalLayout_2") - spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) - self.horizontalLayout_2.addItem(spacerItem1) - self.addButton = QtWidgets.QPushButton(self.centralwidget) - self.addButton.setObjectName("addButton") - self.horizontalLayout_2.addWidget(self.addButton) - self.verticalLayout.addLayout(self.horizontalLayout_2) - MainWindow.setCentralWidget(self.centralwidget) - - self.retranslateUi(MainWindow) - QtCore.QMetaObject.connectSlotsByName(MainWindow) - - def retranslateUi(self, MainWindow): - _translate = QtCore.QCoreApplication.translate - MainWindow.setWindowTitle(_translate("MainWindow", "添加快捷键")) - self.addTips.setText(_translate("MainWindow", "暂时只支持 Ctrl+Alt+? 和 Alt+? 的组合\n" -"文本框内的只能输入单字母")) - self.exeNameTips.setText(_translate("MainWindow", "可这执行文件名称:")) - self.localTips.setText(_translate("MainWindow", "本地映射:")) - self.addTips_2.setText(_translate("MainWindow", "+")) - self.wineTips.setText(_translate("MainWindow", "Wine 容器映射内容:")) - self.addTipsWine.setText(_translate("MainWindow", "+")) - self.addButton.setText(_translate("MainWindow", "添加快捷键")) - diff --git a/key/UI/KeyAddKeyboardGui.ui b/key/UI/KeyAddKeyboardGui.ui deleted file mode 100755 index 847a464..0000000 --- a/key/UI/KeyAddKeyboardGui.ui +++ /dev/null @@ -1,130 +0,0 @@ - - - MainWindow - - - - 0 - 0 - 800 - 195 - - - - 添加快捷键 - - - - ../../../.designer/backup../../../.designer/backup - - - - - - - 暂时只支持 Ctrl+Alt+? 和 Alt+? 的组合 -文本框内的只能输入单字母 - - - - - - - - - 可这执行文件名称: - - - - - - - - - - - - - - 本地映射: - - - - - - - - - - + - - - - - - - - - - Wine 容器映射内容: - - - - - - - - - - + - - - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - 添加快捷键 - - - - - - - - - - - diff --git a/key/UI/__pycache__/AutoConfig.cpython-310.pyc b/key/UI/__pycache__/AutoConfig.cpython-310.pyc deleted file mode 100755 index bbf0dfb..0000000 Binary files a/key/UI/__pycache__/AutoConfig.cpython-310.pyc and /dev/null differ diff --git a/key/UI/__pycache__/AutoConfig.cpython-37.pyc b/key/UI/__pycache__/AutoConfig.cpython-37.pyc deleted file mode 100755 index 8dc37e6..0000000 Binary files a/key/UI/__pycache__/AutoConfig.cpython-37.pyc and /dev/null differ diff --git a/key/UI/__pycache__/KeyAddGui.cpython-37.pyc b/key/UI/__pycache__/KeyAddGui.cpython-37.pyc deleted file mode 100755 index cb9a5ca..0000000 Binary files a/key/UI/__pycache__/KeyAddGui.cpython-37.pyc and /dev/null differ diff --git a/key/UI/__pycache__/KeyAddKeyboardGui.cpython-37.pyc b/key/UI/__pycache__/KeyAddKeyboardGui.cpython-37.pyc deleted file mode 100755 index 2c41e76..0000000 Binary files a/key/UI/__pycache__/KeyAddKeyboardGui.cpython-37.pyc and /dev/null differ diff --git a/key/key-add-gui.py b/key/key-add-gui.py index 2b71aab..6a13395 100755 --- a/key/key-add-gui.py +++ b/key/key-add-gui.py @@ -1,6 +1,7 @@ #!/usr/bin/env python3 import os import sys +import traceback programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string sys.path.append(f"{programPath}/..") @@ -12,12 +13,15 @@ import threading from UI.KeyAddGui import * import PyQt5.QtWidgets as QtWidgets +keyListDebianMap = [[], ["shift"], ["ctrl"], ["alt"], ["ctrl", "alt"], ["ctrl", "shift"], ["alt", "shift"]] +keyList = ["无快捷键", "shift", "ctrl", "alt", "ctrl+alt", "ctrl+shift", "alt+shift"] + class Check: def VersionCheck(): try: bus = dbus.SessionBus() bus.get_object("com.deepin.daemon.Keybinding", "/com/deepin/daemon/Keybinding").List() - int("a") + #int("a") return True except: print("无法检测到 Deepin/UOS 快捷键服务") @@ -30,23 +34,60 @@ class Check: ui.setUnautoStart.setDisabled(True) ui.editButton.setDisabled(True) ui.keyBoardList.setDisabled(True) - ui.saveButton.setDisabled(True) + ui.delectButton.setDisabled(True) def Clear(): - ui.keyBoardList.model().removeRows(0, ui.keyBoardList.model().rowCount()) + #ui.keyBoardList.model().removeRows(0, ui.keyBoardList.model().rowCount()) + model = QtCore.QStringListModel(window) - with open(f"{programPath}/list/KeyList.json", "r") as file: - lists = [] - for i in json.loads(file.read()): - lists.append(f"{i[0]}({'+'.join(i[1: -1])}),{i[-1]}") - model.setStringList(lists) - ui.keyBoardList.setModel(model) - + try: + with open(f"{programPath}/list/KeyList.json", "r") as file: + lists = [] + for i in json.loads(file.read()): + #lists.append(f"{i[0]}({'+'.join(i[0: -1])}),{i[-1]}") + choice = i + #ui.localKeyboardChoose.setCurrentIndex(keyListDebianMap.index(choice[:-2])) + newList = [] + newList.append([keyListDebianMap.index(choice[:-2]), choice[-2]]) + # 解析命令 + command = choice[-1] + # 筛掉路径 + command = command[command[1:].index("'") + 2:].strip() + # 筛出其中一个快捷键 + newList.append([command[command.index(" ") - 1]]) + command = command[command.index(" ") + 2:] + # 读 exe + newList.insert(0, command[:command.index("'")]) + command = command[command.index("'") + 1: ].strip() + # 读最后的快捷键 + newList[2].insert(0, int(command)) + print(newList) + lists.append(f"{newList[0]}({'+'.join(keyListDebianMap[newList[1][0]])}+{newList[1][1]})=>({'+'.join(keyListDebianMap[newList[2][0]])}+{newList[2][1]})") + model.setStringList(lists) + ui.keyBoardList.setModel(model) + except: + traceback.print_exc() class Click: def AddButton(): os.system(f"'{programPath}/keyboard-add-gui.py'") + Clear() + def EditButton(): + os.system(f"'{programPath}/keyboard-add-gui.py' {ui.keyBoardList.currentIndex().row()}") + Clear() + + def DeleteButton(): + try: + with open(f"{programPath}/list/KeyList.json", "r") as file: + lists = json.loads(file.read()) + del lists[ui.keyBoardList.currentIndex().row()] + with open(f"{programPath}/list/KeyList.json", "w") as file: + file.write(json.dumps(lists)) + Clear() + except: + traceback.print_exc() + QtWidgets.QMessageBox.critical(window, "错误", traceback.format_exc()) if __name__ == "__main__": @@ -56,6 +97,8 @@ if __name__ == "__main__": ui.setupUi(window) # 连接槽 ui.addButton.clicked.connect(Click.AddButton) + ui.editButton.clicked.connect(Click.EditButton) + ui.delectButton.clicked.connect(Click.DeleteButton) ui.startServer.triggered.connect(lambda: threading.Thread(target=os.system, args=[f"nohup '{programPath}/key-get.py' &"]).start()) ui.stopServer.triggered.connect(lambda: threading.Thread(target=os.system, args=[f"'{programPath}/stop.sh'"]).start()) ui.setAutoStart.triggered.connect(lambda: threading.Thread(target=os.system, args=[f"'{programPath}/start-auto-server.sh'"]).start()) diff --git a/key/keyboard-add-gui.py b/key/keyboard-add-gui.py index 2510a42..225ddf7 100755 --- a/key/keyboard-add-gui.py +++ b/key/keyboard-add-gui.py @@ -69,7 +69,7 @@ class Click: return print(keyboardList) addList = [] - addList = keyListDebianMap[ui.wineKeyboardChoose.currentIndex()][:] + addList = keyListDebianMap[ui.localKeyboardChoose.currentIndex()][:] print(keyListDebianMap) print(addList) addList.append(ui.localKey.text()[0]) diff --git a/key/list/KeyList.json b/key/list/KeyList.json index fe51488..0637a08 100755 --- a/key/list/KeyList.json +++ b/key/list/KeyList.json @@ -1 +1 @@ -[] +[] \ No newline at end of file diff --git a/mainwindow.py b/mainwindow.py index 806639a..eaa0204 100755 --- a/mainwindow.py +++ b/mainwindow.py @@ -1837,10 +1837,13 @@ exe路径\' 参数 \' N: 鉴于仓库 'https://community-packages.deepin.com/beige beige InRelease' 不支持 'i386' 体系结构,跳过配置文件 'main/binary-i386/Packages' 的获取。''' updateThingsString = '''※1、新增 VB Runtime 组件安装工具 ※2、优化自动配置容器搜索功能,搜索不区分大小写 +※3、新增 Wine 容器快捷键映射功能 +※4、修复在 arm 架构运行 Wine 时提示无法解压资源的问题 +※5、修复右键无法找到 Wine 运行器打开方式的问题 ''' for i in information["Thank"]: thankText += f"{i}\n" -updateTime = "2022年10月02日" +updateTime = "2022年10月22日" about = f'''

关于

一个能让Linux用户更加方便运行Windows应用的程序,内置了对wine图形化的支持和各种Wine工具和自制Wine程序打包器、运行库安装工具等等

同时也内置了基于VirtualBox制作的小白Windows虚拟机安装工具,可以做到只需要用户下载系统镜像并点击安装即可,无需顾及虚拟机安装、创建、虚拟机的分区等等

@@ -2092,6 +2095,7 @@ w2 = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "安装常见字 w3 = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "安装自定义字体")) w4 = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "删除选择的 Wine 容器")) cleanBottonUOS = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "清理 Wine 容器(基于 Wine 适配活动脚本)")) +wineKeyboardLnk = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "Wine 快捷键映射")) w5 = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "打包 wine 应用")) w6 = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "使用官方 Wine 适配活动的脚本进行打包")) getDllOnInternet = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "从互联网获取DLL")) @@ -2107,6 +2111,8 @@ wineOption.addSeparator() wineOption.addAction(w5) wineOption.addAction(w6) wineOption.addSeparator() +wineOption.addAction(wineKeyboardLnk) +wineOption.addSeparator() wineOption.addAction(getDllOnInternet) wineOption.addAction(w7) wineOption.addSeparator() @@ -2196,6 +2202,7 @@ w4.triggered.connect(DeleteWineBotton) cleanBottonUOS.triggered.connect(CleanWineBottonByUOS) w5.triggered.connect(BuildExeDeb) w6.triggered.connect(UOSPackageScript) +wineKeyboardLnk.triggered.connect(lambda: threading.Thread(target=os.system, args=[f"'{programPath}/key/key-add-gui.py'"]).start()) getDllOnInternet.triggered.connect(GetDllFromInternet) w7.triggered.connect(GetDllFromWindowsISO.ShowWindow) updateGeek.triggered.connect(lambda: os.system(f"'{programPath}/launch.sh' deepin-terminal -C '\"{programPath}/UpdateGeek.sh\"' --keep-open")) diff --git a/package-script.zip b/package-script.zip index 1e4ecdd..7147ce2 100755 Binary files a/package-script.zip and b/package-script.zip differ