更新快捷键功能

This commit is contained in:
gfdgd xi 2022-10-22 20:03:27 +08:00
parent db1acefe26
commit 9cca4f2def
18 changed files with 69 additions and 633 deletions

View File

@ -32,9 +32,9 @@ class Ui_MainWindow(object):
self.editButton = QtWidgets.QPushButton(self.centralwidget) self.editButton = QtWidgets.QPushButton(self.centralwidget)
self.editButton.setObjectName("editButton") self.editButton.setObjectName("editButton")
self.horizontalLayout.addWidget(self.editButton) self.horizontalLayout.addWidget(self.editButton)
self.saveButton = QtWidgets.QPushButton(self.centralwidget) self.delectButton = QtWidgets.QPushButton(self.centralwidget)
self.saveButton.setObjectName("saveButton") self.delectButton.setObjectName("delectButton")
self.horizontalLayout.addWidget(self.saveButton) self.horizontalLayout.addWidget(self.delectButton)
self.verticalLayout.addLayout(self.horizontalLayout) self.verticalLayout.addLayout(self.horizontalLayout)
MainWindow.setCentralWidget(self.centralwidget) MainWindow.setCentralWidget(self.centralwidget)
self.menuBar = QtWidgets.QMenuBar(MainWindow) self.menuBar = QtWidgets.QMenuBar(MainWindow)
@ -74,7 +74,7 @@ class Ui_MainWindow(object):
self.tips.setText(_translate("MainWindow", "<html><head/><body><p>此工具可以用于设置快捷键到 Wine 容器的映射,以便 Wine 程序可以正常的使用快捷键<br/>Deepin/UOS将会使用默认的快捷键服务其它发行版将使用此运行器提供的快捷键服务<br>Deepin/UOS将只会提供快捷键添加功能请在控制中心进行快捷键的修改管理</p></body></html>")) self.tips.setText(_translate("MainWindow", "<html><head/><body><p>此工具可以用于设置快捷键到 Wine 容器的映射,以便 Wine 程序可以正常的使用快捷键<br/>Deepin/UOS将会使用默认的快捷键服务其它发行版将使用此运行器提供的快捷键服务<br>Deepin/UOS将只会提供快捷键添加功能请在控制中心进行快捷键的修改管理</p></body></html>"))
self.addButton.setText(_translate("MainWindow", "添加")) self.addButton.setText(_translate("MainWindow", "添加"))
self.editButton.setText(_translate("MainWindow", "编辑")) self.editButton.setText(_translate("MainWindow", "编辑"))
self.saveButton.setText(_translate("MainWindow", "保存")) self.delectButton.setText(_translate("MainWindow", "删除"))
self.menu.setTitle(_translate("MainWindow", "设置快捷键服务")) self.menu.setTitle(_translate("MainWindow", "设置快捷键服务"))
self.action.setText(_translate("MainWindow", "关于")) self.action.setText(_translate("MainWindow", "关于"))
self.serverTips.setText(_translate("MainWindow", "此内容只支持非Deepin/UOS发行版")) self.serverTips.setText(_translate("MainWindow", "此内容只支持非Deepin/UOS发行版"))

View File

@ -55,9 +55,9 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QPushButton" name="saveButton"> <widget class="QPushButton" name="delectButton">
<property name="text"> <property name="text">
<string>保存</string> <string>删除</string>
</property> </property>
</widget> </widget>
</item> </item>

View File

@ -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", "打开本地部署脚本"))

View File

@ -1,110 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MainWindow</class>
<widget class="QMainWindow" name="MainWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>800</width>
<height>600</height>
</rect>
</property>
<property name="windowTitle">
<string>自动部署脚本</string>
</property>
<widget class="QWidget" name="centralwidget">
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="searchTips">
<property name="text">
<string>搜索内容(为空代表显示所有内容):</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="searchThings"/>
</item>
<item>
<widget class="QPushButton" name="saerchBotton">
<property name="text">
<string>搜索</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QListView" name="searchList"/>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="runBotton">
<property name="text">
<string>部署此方案</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<widget class="QMenuBar" name="menubar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>800</width>
<height>36</height>
</rect>
</property>
<widget class="QMenu" name="menu">
<property name="title">
<string>程序</string>
</property>
<addaction name="openFile"/>
<addaction name="separator"/>
<addaction name="exitProgram"/>
</widget>
<addaction name="menu"/>
</widget>
<action name="about">
<property name="text">
<string>关于</string>
</property>
</action>
<action name="exitProgram">
<property name="text">
<string>退出程序</string>
</property>
</action>
<action name="help">
<property name="text">
<string>帮助</string>
</property>
</action>
<action name="openFile">
<property name="text">
<string>打开本地部署脚本</string>
</property>
</action>
</widget>
<resources/>
<connections/>
</ui>

View File

@ -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", "<html><head/><body><p>此工具可以用于设置快捷键到 Wine 容器的映射,以便 Wine 程序可以正常的使用快捷键<br/>Deepin/UOS将会使用默认的快捷键服务其它发行版将使用此运行器提供的快捷键服务<br>Deepin/UOS将只会提供快捷键添加功能请在控制中心进行快捷键的修改管理</p></body></html>"))
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", "关闭开机自启动"))

View File

@ -1,127 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MainWindow</class>
<widget class="QMainWindow" name="MainWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>692</width>
<height>314</height>
</rect>
</property>
<property name="windowTitle">
<string>编辑快捷键</string>
</property>
<widget class="QWidget" name="centralwidget">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="tips">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;此工具可以用于设置快捷键到 Wine 容器的映射,以便 Wine 程序可以正常的使用快捷键&lt;br/&gt;Deepin/UOS将会使用默认的快捷键服务其它发行版将使用此运行器提供的快捷键服务&lt;br&gt;Deepin/UOS将只会提供快捷键添加功能请在控制中心进行快捷键的修改管理&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item>
<widget class="QListView" name="keyBoardList"/>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="addButton">
<property name="text">
<string>添加</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="editButton">
<property name="text">
<string>编辑</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="saveButton">
<property name="text">
<string>保存</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<widget class="QMenuBar" name="menuBar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>692</width>
<height>33</height>
</rect>
</property>
<widget class="QMenu" name="menu">
<property name="title">
<string>设置快捷键服务</string>
</property>
<addaction name="serverTips"/>
<addaction name="separator"/>
<addaction name="startServer"/>
<addaction name="stopServer"/>
<addaction name="separator"/>
<addaction name="setAutoStart"/>
<addaction name="setUnautoStart"/>
</widget>
<addaction name="menu"/>
</widget>
<action name="action">
<property name="text">
<string>关于</string>
</property>
</action>
<action name="serverTips">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>此内容只支持非Deepin/UOS发行版</string>
</property>
</action>
<action name="startServer">
<property name="text">
<string>启动服务</string>
</property>
</action>
<action name="stopServer">
<property name="text">
<string>停止服务</string>
</property>
</action>
<action name="setAutoStart">
<property name="text">
<string>设置开机自启</string>
</property>
</action>
<action name="setUnautoStart">
<property name="text">
<string>关闭开机自启动</string>
</property>
</action>
</widget>
<resources/>
<connections/>
</ui>

View File

@ -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", "添加快捷键"))

View File

@ -1,130 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MainWindow</class>
<widget class="QMainWindow" name="MainWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>800</width>
<height>195</height>
</rect>
</property>
<property name="windowTitle">
<string>添加快捷键</string>
</property>
<property name="windowIcon">
<iconset theme="..">
<normaloff>../../../.designer/backup</normaloff>../../../.designer/backup</iconset>
</property>
<widget class="QWidget" name="centralwidget">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="addTips">
<property name="text">
<string>暂时只支持 Ctrl+Alt+? 和 Alt+? 的组合
文本框内的只能输入单字母</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QLabel" name="exeNameTips">
<property name="text">
<string>可这执行文件名称:</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="exeName"/>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="localTips">
<property name="text">
<string>本地映射:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="localKeyboardChoose"/>
</item>
<item>
<widget class="QLabel" name="addTips_2">
<property name="text">
<string>+</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="localKey"/>
</item>
<item>
<widget class="QLabel" name="wineTips">
<property name="text">
<string>Wine 容器映射内容:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="wineKeyboardChoose"/>
</item>
<item>
<widget class="QLabel" name="addTipsWine">
<property name="text">
<string>+</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="wineKey"/>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="addButton">
<property name="text">
<string>添加快捷键</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</widget>
<resources/>
<connections/>
</ui>

View File

@ -1,6 +1,7 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import os import os
import sys import sys
import traceback
programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string
sys.path.append(f"{programPath}/..") sys.path.append(f"{programPath}/..")
@ -12,12 +13,15 @@ import threading
from UI.KeyAddGui import * from UI.KeyAddGui import *
import PyQt5.QtWidgets as QtWidgets 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: class Check:
def VersionCheck(): def VersionCheck():
try: try:
bus = dbus.SessionBus() bus = dbus.SessionBus()
bus.get_object("com.deepin.daemon.Keybinding", "/com/deepin/daemon/Keybinding").List() bus.get_object("com.deepin.daemon.Keybinding", "/com/deepin/daemon/Keybinding").List()
int("a") #int("a")
return True return True
except: except:
print("无法检测到 Deepin/UOS 快捷键服务") print("无法检测到 Deepin/UOS 快捷键服务")
@ -30,23 +34,60 @@ class Check:
ui.setUnautoStart.setDisabled(True) ui.setUnautoStart.setDisabled(True)
ui.editButton.setDisabled(True) ui.editButton.setDisabled(True)
ui.keyBoardList.setDisabled(True) ui.keyBoardList.setDisabled(True)
ui.saveButton.setDisabled(True) ui.delectButton.setDisabled(True)
def Clear(): def Clear():
ui.keyBoardList.model().removeRows(0, ui.keyBoardList.model().rowCount()) #ui.keyBoardList.model().removeRows(0, ui.keyBoardList.model().rowCount())
model = QtCore.QStringListModel(window) model = QtCore.QStringListModel(window)
try:
with open(f"{programPath}/list/KeyList.json", "r") as file: with open(f"{programPath}/list/KeyList.json", "r") as file:
lists = [] lists = []
for i in json.loads(file.read()): for i in json.loads(file.read()):
lists.append(f"{i[0]}{'+'.join(i[1: -1])}{i[-1]}") #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) model.setStringList(lists)
ui.keyBoardList.setModel(model) ui.keyBoardList.setModel(model)
except:
traceback.print_exc()
class Click: class Click:
def AddButton(): def AddButton():
os.system(f"'{programPath}/keyboard-add-gui.py'") 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__": if __name__ == "__main__":
@ -56,6 +97,8 @@ if __name__ == "__main__":
ui.setupUi(window) ui.setupUi(window)
# 连接槽 # 连接槽
ui.addButton.clicked.connect(Click.AddButton) 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.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.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()) ui.setAutoStart.triggered.connect(lambda: threading.Thread(target=os.system, args=[f"'{programPath}/start-auto-server.sh'"]).start())

View File

@ -69,7 +69,7 @@ class Click:
return return
print(keyboardList) print(keyboardList)
addList = [] addList = []
addList = keyListDebianMap[ui.wineKeyboardChoose.currentIndex()][:] addList = keyListDebianMap[ui.localKeyboardChoose.currentIndex()][:]
print(keyListDebianMap) print(keyListDebianMap)
print(addList) print(addList)
addList.append(ui.localKey.text()[0]) addList.append(ui.localKey.text()[0])

View File

@ -1837,10 +1837,13 @@ exe路径\' 参数 \'
<code>N: 鉴于仓库 'https://community-packages.deepin.com/beige beige InRelease' 不支持 'i386' 体系结构跳过配置文件 'main/binary-i386/Packages' 的获取</code>''' <code>N: 鉴于仓库 'https://community-packages.deepin.com/beige beige InRelease' 不支持 'i386' 体系结构跳过配置文件 'main/binary-i386/Packages' 的获取</code>'''
updateThingsString = '''※1、新增 VB Runtime 组件安装工具 updateThingsString = '''※1、新增 VB Runtime 组件安装工具
2优化自动配置容器搜索功能搜索不区分大小写 2优化自动配置容器搜索功能搜索不区分大小写
3新增 Wine 容器快捷键映射功能
4修复在 arm 架构运行 Wine 时提示无法解压资源的问题
5修复右键无法找到 Wine 运行器打开方式的问题
''' '''
for i in information["Thank"]: for i in information["Thank"]:
thankText += f"{i}\n" thankText += f"{i}\n"
updateTime = "2022年10月02日" updateTime = "2022年10月22日"
about = f'''<h1>关于</h1> about = f'''<h1>关于</h1>
<p>一个能让Linux用户更加方便运行Windows应用的程序内置了对wine图形化的支持和各种Wine工具和自制Wine程序打包器运行库安装工具等等</p> <p>一个能让Linux用户更加方便运行Windows应用的程序内置了对wine图形化的支持和各种Wine工具和自制Wine程序打包器运行库安装工具等等</p>
<p>同时也内置了基于VirtualBox制作的小白Windows虚拟机安装工具可以做到只需要用户下载系统镜像并点击安装即可无需顾及虚拟机安装创建虚拟机的分区等等</p> <p>同时也内置了基于VirtualBox制作的小白Windows虚拟机安装工具可以做到只需要用户下载系统镜像并点击安装即可无需顾及虚拟机安装创建虚拟机的分区等等</p>
@ -2092,6 +2095,7 @@ w2 = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "安装常见字
w3 = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "安装自定义字体")) w3 = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "安装自定义字体"))
w4 = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "删除选择的 Wine 容器")) w4 = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "删除选择的 Wine 容器"))
cleanBottonUOS = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "清理 Wine 容器(基于 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 应用")) w5 = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "打包 wine 应用"))
w6 = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "使用官方 Wine 适配活动的脚本进行打包")) w6 = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "使用官方 Wine 适配活动的脚本进行打包"))
getDllOnInternet = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "从互联网获取DLL")) getDllOnInternet = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "从互联网获取DLL"))
@ -2107,6 +2111,8 @@ wineOption.addSeparator()
wineOption.addAction(w5) wineOption.addAction(w5)
wineOption.addAction(w6) wineOption.addAction(w6)
wineOption.addSeparator() wineOption.addSeparator()
wineOption.addAction(wineKeyboardLnk)
wineOption.addSeparator()
wineOption.addAction(getDllOnInternet) wineOption.addAction(getDllOnInternet)
wineOption.addAction(w7) wineOption.addAction(w7)
wineOption.addSeparator() wineOption.addSeparator()
@ -2196,6 +2202,7 @@ w4.triggered.connect(DeleteWineBotton)
cleanBottonUOS.triggered.connect(CleanWineBottonByUOS) cleanBottonUOS.triggered.connect(CleanWineBottonByUOS)
w5.triggered.connect(BuildExeDeb) w5.triggered.connect(BuildExeDeb)
w6.triggered.connect(UOSPackageScript) 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) getDllOnInternet.triggered.connect(GetDllFromInternet)
w7.triggered.connect(GetDllFromWindowsISO.ShowWindow) w7.triggered.connect(GetDllFromWindowsISO.ShowWindow)
updateGeek.triggered.connect(lambda: os.system(f"'{programPath}/launch.sh' deepin-terminal -C '\"{programPath}/UpdateGeek.sh\"' --keep-open")) updateGeek.triggered.connect(lambda: os.system(f"'{programPath}/launch.sh' deepin-terminal -C '\"{programPath}/UpdateGeek.sh\"' --keep-open"))

Binary file not shown.