Skip to content

Commit 5c03aa8

Browse files
author
mahaotian
committed
[DeviceShare] V1.1
2 parents c81fe26 + 5433fb9 commit 5c03aa8

35 files changed

+661
-732
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@
77
**/*.key
88
**/*.pyc
99
**/*.db
10-
.DS_Store
10+
.DS_Store
11+
/temp/

cliptest.py

Lines changed: 0 additions & 4 deletions
This file was deleted.

deviceShare.py

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
import sys
2-
3-
4-
from PyQt5.QtWidgets import QApplication, QDialog, QVBoxLayout, QPushButton, QLabel
2+
from PyQt5.QtWidgets import QApplication, QDialog, QVBoxLayout, QPushButton
53
import qt_material
6-
from src.sharer.client import Client
7-
from src.sharer.server import Server
4+
from src.client import Client
5+
from src.server import Server
86

97

108
class RoleSelectionDialog(QDialog):
@@ -15,7 +13,10 @@ def __init__(self):
1513

1614
self.setWindowTitle("身份选择")
1715
self.layout = QVBoxLayout()
18-
16+
qr = self.frameGeometry() # 获取对话框的几何框架
17+
cp = QApplication.primaryScreen().availableGeometry().center() # 获取屏幕中心点
18+
qr.moveCenter(cp) # 将对话框几何框架的中心移动到屏幕中心
19+
self.move(qr.topLeft()) # 将对话框的左上角移动到新的位置
1920
self.server_button = QPushButton("主控机")
2021
self.client_button = QPushButton("被控机")
2122

@@ -40,17 +41,20 @@ def select_client(self):
4041

4142
def main():
4243
app = QApplication(sys.argv)
43-
qt_material.apply_stylesheet(app, theme='dark_blue.xml')
44+
qt_material.apply_stylesheet(app, theme='light_blue.xml')
4445
selected_role = 'client'
4546
# 显示身份选择弹窗
4647
role_dialog = RoleSelectionDialog()
4748
if role_dialog.exec_() == QDialog.Accepted:
4849
selected_role = role_dialog.selected_role
49-
if selected_role == 'server':
50-
Server(app)
51-
elif selected_role == 'client':
52-
Client(app)
53-
app.exec_()
54-
50+
try:
51+
if selected_role == 'server':
52+
Server(app).run()
53+
elif selected_role == 'client':
54+
Client(app).run()
55+
except Exception as e:
56+
print(e)
57+
finally:
58+
app.quit()
5559
if __name__ == "__main__":
5660
main()

keyboard_controller.py

Lines changed: 0 additions & 98 deletions
This file was deleted.

mouse_controller.py

Lines changed: 0 additions & 124 deletions
This file was deleted.

requirements.txt

-6 Bytes
Binary file not shown.

resources/GenJyuuGothic-Normal.ttf

10 MB
Binary file not shown.

resources/Host.jpg

2.58 KB
Loading

run_client.py

Lines changed: 0 additions & 2 deletions
This file was deleted.

run_server.py

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)