ScreenMagnifier 1.11.0.post8__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of ScreenMagnifier might be problematic. Click here for more details.
- ScreenMagnifier/__init__.py +68 -0
- ScreenMagnifier/__main__.py +17 -0
- ScreenMagnifier/advancedoverlay.py +593 -0
- ScreenMagnifier/advancedpanel.py +521 -0
- ScreenMagnifier/analysiscontroller.py +533 -0
- ScreenMagnifier/analysisserver.py +404 -0
- ScreenMagnifier/colordetector/__init__.py +28 -0
- ScreenMagnifier/colordetector/colordetector.py +570 -0
- ScreenMagnifier/colordetector/core.py +434 -0
- ScreenMagnifier/colordetector/main.py +23 -0
- ScreenMagnifier/colordetector/mainwindow.py +182 -0
- ScreenMagnifier/colorpanel.py +424 -0
- ScreenMagnifier/colorswatches/__init__.py +16 -0
- ScreenMagnifier/colorswatches/colorswatches.py +316 -0
- ScreenMagnifier/colorswatches/main.py +23 -0
- ScreenMagnifier/colorswatches/mainwindow.py +60 -0
- ScreenMagnifier/controlpanel.py +234 -0
- ScreenMagnifier/detectionpanel.py +790 -0
- ScreenMagnifier/facedetector/__init__.py +24 -0
- ScreenMagnifier/facedetector/core.py +314 -0
- ScreenMagnifier/facedetector/facedetector.py +288 -0
- ScreenMagnifier/facedetector/main.py +23 -0
- ScreenMagnifier/facedetector/mainwindow.py +122 -0
- ScreenMagnifier/facedetector/models/__init__.py +4 -0
- ScreenMagnifier/facepointer.py +1121 -0
- ScreenMagnifier/features.py +50 -0
- ScreenMagnifier/hotkeys/__init__.py +16 -0
- ScreenMagnifier/hotkeys/hotkeys.py +379 -0
- ScreenMagnifier/hotkeys/main.py +23 -0
- ScreenMagnifier/hotkeys/mainwindow.py +56 -0
- ScreenMagnifier/imagefilters/__init__.py +24 -0
- ScreenMagnifier/imagefilters/core.py +172 -0
- ScreenMagnifier/imagefilters/imagefilters.py +220 -0
- ScreenMagnifier/imagefilters/main.py +23 -0
- ScreenMagnifier/imagefilters/mainwindow.py +120 -0
- ScreenMagnifier/magnifierview/__init__.py +16 -0
- ScreenMagnifier/magnifierview/magnifierview.py +1249 -0
- ScreenMagnifier/magnifierview/main.py +23 -0
- ScreenMagnifier/magnifierview/mainwindow.py +91 -0
- ScreenMagnifier/main.py +157 -0
- ScreenMagnifier/mainwindow.py +1368 -0
- ScreenMagnifier/mousecatcher/__init__.py +16 -0
- ScreenMagnifier/mousecatcher/main.py +23 -0
- ScreenMagnifier/mousecatcher/mainwindow.py +78 -0
- ScreenMagnifier/mousecatcher/mousecatcher.py +251 -0
- ScreenMagnifier/mousemove.py +259 -0
- ScreenMagnifier/netprotocol/__init__.py +25 -0
- ScreenMagnifier/netprotocol/main.py +23 -0
- ScreenMagnifier/netprotocol/mainwindow.py +91 -0
- ScreenMagnifier/netprotocol/netprotocol.py +372 -0
- ScreenMagnifier/netprotocol/wire.py +189 -0
- ScreenMagnifier/regionselector/__init__.py +16 -0
- ScreenMagnifier/regionselector/main.py +23 -0
- ScreenMagnifier/regionselector/mainwindow.py +70 -0
- ScreenMagnifier/regionselector/regionselector.py +549 -0
- ScreenMagnifier/remoteclient.py +636 -0
- ScreenMagnifier/resources/icon-128.png +0 -0
- ScreenMagnifier/resources/icon-16.png +0 -0
- ScreenMagnifier/resources/icon-24.png +0 -0
- ScreenMagnifier/resources/icon-256.png +0 -0
- ScreenMagnifier/resources/icon-32.png +0 -0
- ScreenMagnifier/resources/icon-48.png +0 -0
- ScreenMagnifier/resources/icon-512.png +0 -0
- ScreenMagnifier/resources/icon-64.png +0 -0
- ScreenMagnifier/resources/icon.icns +0 -0
- ScreenMagnifier/resources/icon.ico +0 -0
- ScreenMagnifier/screengrabber/__init__.py +16 -0
- ScreenMagnifier/screengrabber/main.py +23 -0
- ScreenMagnifier/screengrabber/mainwindow.py +79 -0
- ScreenMagnifier/screengrabber/screengrabber.py +558 -0
- ScreenMagnifier/server.py +150 -0
- ScreenMagnifier/serverpanel.py +379 -0
- ScreenMagnifier/shortcuteditor/__init__.py +16 -0
- ScreenMagnifier/shortcuteditor/main.py +23 -0
- ScreenMagnifier/shortcuteditor/mainwindow.py +54 -0
- ScreenMagnifier/shortcuteditor/shortcuteditor.py +411 -0
- ScreenMagnifier/shortcuts.py +118 -0
- ScreenMagnifier/shortcutspanel.py +140 -0
- ScreenMagnifier/support.py +127 -0
- ScreenMagnifier/translations/ar.json +387 -0
- ScreenMagnifier/translations/de.json +387 -0
- ScreenMagnifier/translations/es.json +387 -0
- ScreenMagnifier/translations/fr.json +387 -0
- ScreenMagnifier/translations/it.json +387 -0
- ScreenMagnifier/translations/ja.json +387 -0
- ScreenMagnifier/translations/ko.json +387 -0
- ScreenMagnifier/translations/pt_BR.json +387 -0
- ScreenMagnifier/translations/ru.json +387 -0
- ScreenMagnifier/translations/tr.json +387 -0
- ScreenMagnifier/translations/zh_CN.json +387 -0
- ScreenMagnifier/translator/__init__.py +16 -0
- ScreenMagnifier/translator/main.py +23 -0
- ScreenMagnifier/translator/mainwindow.py +62 -0
- ScreenMagnifier/translator/translator.py +284 -0
- ScreenMagnifier/upscaler/__init__.py +24 -0
- ScreenMagnifier/upscaler/core.py +315 -0
- ScreenMagnifier/upscaler/main.py +23 -0
- ScreenMagnifier/upscaler/mainwindow.py +128 -0
- ScreenMagnifier/upscaler/models/FSRCNN-small_x2.pb +0 -0
- ScreenMagnifier/upscaler/models/FSRCNN-small_x3.pb +0 -0
- ScreenMagnifier/upscaler/models/FSRCNN-small_x4.pb +0 -0
- ScreenMagnifier/upscaler/models/FSRCNN_x2.pb +0 -0
- ScreenMagnifier/upscaler/models/FSRCNN_x3.pb +0 -0
- ScreenMagnifier/upscaler/models/FSRCNN_x4.pb +0 -0
- ScreenMagnifier/upscaler/models/LICENSE-FSRCNN +201 -0
- ScreenMagnifier/upscaler/models/__init__.py +4 -0
- ScreenMagnifier/upscaler/upscaler.py +285 -0
- ScreenMagnifier/wincheck.py +65 -0
- ScreenMagnifier/zoomoverlay/__init__.py +16 -0
- ScreenMagnifier/zoomoverlay/main.py +23 -0
- ScreenMagnifier/zoomoverlay/mainwindow.py +99 -0
- ScreenMagnifier/zoomoverlay/zoomoverlay.py +1779 -0
- screenmagnifier-1.11.0.post8.dist-info/METADATA +591 -0
- screenmagnifier-1.11.0.post8.dist-info/RECORD +117 -0
- screenmagnifier-1.11.0.post8.dist-info/WHEEL +5 -0
- screenmagnifier-1.11.0.post8.dist-info/entry_points.txt +5 -0
- screenmagnifier-1.11.0.post8.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
# coding=utf-8
|
|
2
|
+
"""
|
|
3
|
+
Screen Magnifier analysis server - pure Python, no Qt: runs on a desktop or on a phone (Android: Termux, Pydroid).
|
|
4
|
+
Needs NumPy; OpenCV adds the Bicubic / Lanczos / AI upscalers, face detection and JPEG / PNG (Pillow also gives
|
|
5
|
+
JPEG / PNG). Usage:
|
|
6
|
+
ScreenMagnifierServer [--host 0.0.0.0] [--port 8765] [--token SECRET] [--max-clients 4]
|
|
7
|
+
python -m ScreenMagnifier.server ... or python server.py ...
|
|
8
|
+
--download-face-model fetch the YuNet face model (verified) into the user data folder, then exit
|
|
9
|
+
--selftest start on a free port, run a real session over TCP, exit (0 = ok)
|
|
10
|
+
"""
|
|
11
|
+
from sys import path, exit, stdout
|
|
12
|
+
from os.path import dirname, join
|
|
13
|
+
from datetime import datetime
|
|
14
|
+
from os import environ
|
|
15
|
+
import socket
|
|
16
|
+
|
|
17
|
+
if not __package__ and dirname(__file__) not in path:
|
|
18
|
+
path.append(dirname(__file__))
|
|
19
|
+
|
|
20
|
+
try:
|
|
21
|
+
from .netprotocol.wire import DEFAULT_PORT, packMessage, MessageParser, encodeArray, decodeArray
|
|
22
|
+
from .facedetector.core import downloadModel, userDataDir, YUNET_FILE
|
|
23
|
+
from .analysisserver import AnalysisServer
|
|
24
|
+
except:
|
|
25
|
+
from netprotocol.wire import DEFAULT_PORT, packMessage, MessageParser, encodeArray, decodeArray
|
|
26
|
+
from facedetector.core import downloadModel, userDataDir, YUNET_FILE
|
|
27
|
+
from analysisserver import AnalysisServer
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def log(text):
|
|
31
|
+
"""
|
|
32
|
+
:param text: str | unicode | QString
|
|
33
|
+
:return:
|
|
34
|
+
"""
|
|
35
|
+
stdout.write('[{}] {}\n'.format(datetime.now().strftime('%H:%M:%S'), text))
|
|
36
|
+
stdout.flush()
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def parseArguments(argv):
|
|
40
|
+
"""
|
|
41
|
+
:param argv: list[str | unicode | QString]
|
|
42
|
+
:return: argparse.Namespace
|
|
43
|
+
"""
|
|
44
|
+
from argparse import ArgumentParser
|
|
45
|
+
parser = ArgumentParser(
|
|
46
|
+
description=u'Screen Magnifier real-time upscaling / analysis server.') # type: ArgumentParser
|
|
47
|
+
parser.add_argument('--host', default='127.0.0.1',
|
|
48
|
+
help=u'Interface to listen on: 127.0.0.1 (this computer) or 0.0.0.0 (network)')
|
|
49
|
+
parser.add_argument('--port', type=int, default=DEFAULT_PORT, help=u'TCP port (default %(default)s)')
|
|
50
|
+
parser.add_argument('--token', default=environ.get('SCREENMAGNIFIER_TOKEN', ''),
|
|
51
|
+
help=u'Shared secret required from clients (or env SCREENMAGNIFIER_TOKEN)')
|
|
52
|
+
parser.add_argument('--max-clients', type=int, default=4, help=u'Simultaneous clients (default %(default)s)')
|
|
53
|
+
parser.add_argument('--selftest', action='store_true',
|
|
54
|
+
help=u'Start on a free port, upscale one image through a real connection, exit (0 = ok)')
|
|
55
|
+
parser.add_argument('--download-face-model', action='store_true',
|
|
56
|
+
help=u'Download the YuNet face detection model (232 KB) before starting')
|
|
57
|
+
return parser.parse_args(argv)
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
def request(sock, parser, header, payload=b''):
|
|
61
|
+
"""
|
|
62
|
+
Self-test client: send one message and wait for the reply.
|
|
63
|
+
:param sock: socket.socket
|
|
64
|
+
:param parser: MessageParser
|
|
65
|
+
:param header: dict
|
|
66
|
+
:param payload: bytes
|
|
67
|
+
:return: (tuple[dict, bytes]) Reply.
|
|
68
|
+
"""
|
|
69
|
+
sock.sendall(packMessage(header, payload))
|
|
70
|
+
while True:
|
|
71
|
+
data = sock.recv(1 << 16)
|
|
72
|
+
if not data:
|
|
73
|
+
return {'type': 'closed'}, b''
|
|
74
|
+
messages = parser.feed(data)
|
|
75
|
+
if messages:
|
|
76
|
+
return messages[0]
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
def selfTest():
|
|
80
|
+
"""
|
|
81
|
+
A real session over TCP: wrong token refused, upscale, color analysis.
|
|
82
|
+
:return: (bool) Everything worked.
|
|
83
|
+
"""
|
|
84
|
+
from numpy import zeros, uint8
|
|
85
|
+
server = AnalysisServer(host='127.0.0.1', port=0, token='secret', logMessage=lambda t: None) # type: AnalysisServer
|
|
86
|
+
server.start()
|
|
87
|
+
checks = [] # type: list
|
|
88
|
+
try:
|
|
89
|
+
intruder = socket.create_connection(('127.0.0.1', server.getPort()), 10)
|
|
90
|
+
reply = request(intruder, MessageParser(), {'type': 'hello', 'token': 'wrong'})[0]
|
|
91
|
+
checks.append((u'Wrong token refused', reply.get('code') == 'auth'))
|
|
92
|
+
intruder.close()
|
|
93
|
+
sock = socket.create_connection(('127.0.0.1', server.getPort()), 10)
|
|
94
|
+
parser = MessageParser() # type: MessageParser
|
|
95
|
+
welcome = request(sock, parser, {'type': 'hello', 'token': 'secret', 'client': 'selftest'})[0]
|
|
96
|
+
checks.append(('welcome', welcome.get('type') == 'welcome'))
|
|
97
|
+
img = zeros((24, 32, 3), uint8)
|
|
98
|
+
img[:, :] = (46, 74, 46)
|
|
99
|
+
img[6:16, 8:20] = (224, 16, 32)
|
|
100
|
+
reply, data = request(sock, parser, {'type': 'upscale', 'id': 1, 'width': 128, 'height': 96, 'method': 0,
|
|
101
|
+
'format': 'PNG'}, encodeArray(img, 'RAWZ')[0])
|
|
102
|
+
up = decodeArray(data)
|
|
103
|
+
checks.append((u'Upscale 32x24 -> 128x96', up is not None and up.shape[:2] == (96, 128)))
|
|
104
|
+
reply = request(sock, parser, {'type': 'analyze', 'id': 2, 'colors': {
|
|
105
|
+
'enabled': True, 'targets': ['#E01020'], 'minArea': 4, 'mask': True}}, encodeArray(img, 'RAWZ')[0])[0]
|
|
106
|
+
found = (reply.get('result') or {}).get('colors', {}).get('detections', []) # type: list
|
|
107
|
+
checks.append((u'Colour analysis', len(found) == 1 and found[0]['rect'] == [8, 6, 12, 10]))
|
|
108
|
+
sock.close()
|
|
109
|
+
finally:
|
|
110
|
+
server.stop()
|
|
111
|
+
print(u'SELFTEST server (pure Python, no Qt): ' + ', '.join('{} {}'.format(n, 'ok' if v else 'FAILED')
|
|
112
|
+
for n, v in checks))
|
|
113
|
+
return all(v for n, v in checks)
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
def run():
|
|
117
|
+
"""
|
|
118
|
+
Server entry point: the ScreenMagnifierServer command, python -m ScreenMagnifier.server or python server.py.
|
|
119
|
+
:return:
|
|
120
|
+
"""
|
|
121
|
+
from sys import argv
|
|
122
|
+
args = parseArguments(argv[1:])
|
|
123
|
+
if args.selftest:
|
|
124
|
+
exit(0 if selfTest() else 1)
|
|
125
|
+
if args.download_face_model:
|
|
126
|
+
target = join(userDataDir(), 'models', YUNET_FILE) # type: str # searched by the face engine
|
|
127
|
+
log(u'Downloading the YuNet face model to {} ...'.format(target))
|
|
128
|
+
downloadModel(target, lambda p: stdout.write('\r{:3d} %'.format(p)))
|
|
129
|
+
stdout.write('\n')
|
|
130
|
+
log(u'YuNet face model installed (SHA-256 verified)')
|
|
131
|
+
exit(0)
|
|
132
|
+
server = AnalysisServer(host=args.host, port=args.port, token=args.token, maxClients=args.max_clients,
|
|
133
|
+
logMessage=log) # type: AnalysisServer
|
|
134
|
+
try:
|
|
135
|
+
server.start()
|
|
136
|
+
except OSError as e:
|
|
137
|
+
log(u'Cannot listen on {}:{}: {}'.format(args.host, args.port, e))
|
|
138
|
+
exit(1)
|
|
139
|
+
engine = server.getUpscaleEngine()
|
|
140
|
+
log(u'Listening on {}:{} ({}), upscale methods: {}'.format(
|
|
141
|
+
args.host, server.getPort(), 'token required' if args.token else 'NO token',
|
|
142
|
+
', '.join(n for m, n in engine.availableMethods())))
|
|
143
|
+
if not args.token and args.host not in ('127.0.0.1', 'localhost', '::1'):
|
|
144
|
+
log(u'WARNING: listening on the network without a token - use --token SECRET')
|
|
145
|
+
server.serveForever()
|
|
146
|
+
log(u'Stopped')
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
if __name__ == '__main__':
|
|
150
|
+
run()
|
|
@@ -0,0 +1,379 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
"""
|
|
3
|
+
ServerPanel: the Server tab - connect to an analysis server, choose what to offload (upscaling of the magnifier
|
|
4
|
+
and of the zoomer, color / face analysis), transfer quality, live statistics, and a button to start a
|
|
5
|
+
server on this computer. Every setting is saved with QSettings (the token included, in the user's settings).
|
|
6
|
+
"""
|
|
7
|
+
from ManyQt.QtWidgets import QWidget, QVBoxLayout, QGridLayout, QLabel, QComboBox, QCheckBox, QPushButton, QFrame, \
|
|
8
|
+
QScrollArea, QLineEdit, QSpinBox
|
|
9
|
+
from ManyQt.QtCore import Qt, QSettings, QTimer, QProcess, QElapsedTimer, pyqtSignal, pyqtSlot
|
|
10
|
+
from sys import path, executable, platform
|
|
11
|
+
from os.path import dirname, join, isfile
|
|
12
|
+
import sys
|
|
13
|
+
|
|
14
|
+
if not __package__ and dirname(__file__) not in path:
|
|
15
|
+
path.append(dirname(__file__))
|
|
16
|
+
|
|
17
|
+
try:
|
|
18
|
+
from .analysiscontroller import AnalysisController
|
|
19
|
+
from .remoteclient import RemoteClient
|
|
20
|
+
from .netprotocol import DEFAULT_PORT
|
|
21
|
+
except:
|
|
22
|
+
from analysiscontroller import AnalysisController
|
|
23
|
+
from remoteclient import RemoteClient
|
|
24
|
+
from netprotocol import DEFAULT_PORT
|
|
25
|
+
|
|
26
|
+
PANEL_QSS = """
|
|
27
|
+
QWidget#serverContent { background: transparent; }
|
|
28
|
+
QLabel[role="title"] { color: #9AA3B8; font-size: 10px; font-weight: bold; letter-spacing: 1px; padding-top: 10px; }
|
|
29
|
+
QLabel[role="hint"] { color: #7C8498; font-size: 10px; }
|
|
30
|
+
QLabel[role="mono"] { color: #E8EBF2; font-family: monospace; }
|
|
31
|
+
QLineEdit, QSpinBox { background: #2A2E3A; color: #E8EBF2; border: 1px solid #3A3F50; border-radius: 6px;
|
|
32
|
+
padding: 4px 6px; }
|
|
33
|
+
QPushButton[role="primary"] { background: #3A4BD8; border-color: #4F8BFF; font-weight: bold; padding: 7px; }
|
|
34
|
+
""" # type: str
|
|
35
|
+
STATE_TEXT = {'disconnected': ('#7C8498', 'Disconnected'), 'connecting': ('#FFB86B', 'Connecting...'),
|
|
36
|
+
'authenticating': ('#FFB86B', 'Authenticating...'), 'ready': ('#43C16A', 'Connected'),
|
|
37
|
+
'error': ('#FF5A6E', 'Error')} # type: dict
|
|
38
|
+
QUALITY = [('fast', 'Fast (JPEG 85)'), ('balanced', 'Balanced (JPEG 92-95, near lossless)'),
|
|
39
|
+
('lossless', 'Lossless (PNG: exact pixels, slower)')] # type: list
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
class ServerPanel(QScrollArea):
|
|
43
|
+
"""
|
|
44
|
+
ServerPanel class.
|
|
45
|
+
"""
|
|
46
|
+
offloadChanged = pyqtSignal() # type: pyqtSignal
|
|
47
|
+
notify = pyqtSignal('QString') # type: pyqtSignal
|
|
48
|
+
|
|
49
|
+
def __init__(self, *args, **kwargs):
|
|
50
|
+
"""
|
|
51
|
+
:param client: RemoteClient
|
|
52
|
+
:param analysis: AnalysisController
|
|
53
|
+
:param upscaler: (Upscaler) Local upscaler whose method / sharpness the server mirrors by default.
|
|
54
|
+
:param settings: (QSettings | None) None = ScreenMagnifier / Server.
|
|
55
|
+
:param args: any
|
|
56
|
+
:param kwargs: any
|
|
57
|
+
"""
|
|
58
|
+
client = kwargs.pop('client', None) # type: RemoteClient
|
|
59
|
+
analysis = kwargs.pop('analysis', None) # type: AnalysisController
|
|
60
|
+
upscaler = kwargs.pop('upscaler', None)
|
|
61
|
+
settings = kwargs.pop('settings', None) # type: QSettings | None
|
|
62
|
+
super(ServerPanel, self).__init__(*args, **kwargs)
|
|
63
|
+
self.__m_client = client # type: RemoteClient
|
|
64
|
+
self.__m_analysis = analysis # type: AnalysisController
|
|
65
|
+
self.__m_upscaler = upscaler
|
|
66
|
+
self.__m_settings = settings if settings is not None else QSettings('ScreenMagnifier', 'Server')
|
|
67
|
+
self.__m_process = None # type: QProcess | None
|
|
68
|
+
self.__m_lastBytes = (0, 0) # type: tuple
|
|
69
|
+
self.__m_savedMethod = -1 # type: int # Server method chosen by the user (-1 = mirror Settings).
|
|
70
|
+
self.__m_clock = QElapsedTimer() # type: QElapsedTimer
|
|
71
|
+
self.__m_clock.start()
|
|
72
|
+
self.setWidgetResizable(True)
|
|
73
|
+
self.setFrameShape(QFrame.NoFrame)
|
|
74
|
+
self.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
|
|
75
|
+
self.setMinimumWidth(260)
|
|
76
|
+
content = QWidget() # type: QWidget
|
|
77
|
+
content.setObjectName('serverContent')
|
|
78
|
+
content.setStyleSheet(PANEL_QSS)
|
|
79
|
+
self.__m_layout = QVBoxLayout(content) # type: QVBoxLayout
|
|
80
|
+
self.__m_layout.setContentsMargins(14, 6, 14, 14)
|
|
81
|
+
self.__m_layout.setSpacing(6)
|
|
82
|
+
self._build()
|
|
83
|
+
self.__m_layout.addStretch(1)
|
|
84
|
+
self.setWidget(content)
|
|
85
|
+
self._load()
|
|
86
|
+
client.stateChanged.connect(self._onState)
|
|
87
|
+
client.errorOccurred.connect(self._onError)
|
|
88
|
+
if upscaler is not None:
|
|
89
|
+
upscaler.methodChanged.connect(lambda *a: self._syncMethod())
|
|
90
|
+
upscaler.sharpnessChanged.connect(lambda *a: self._syncMethod())
|
|
91
|
+
self.__m_stats = QTimer(self) # type: QTimer
|
|
92
|
+
self.__m_stats.timeout.connect(self._updateStats)
|
|
93
|
+
self.__m_stats.start(1000)
|
|
94
|
+
self._onState(client.getState())
|
|
95
|
+
if self.__m_autoConnect.isChecked():
|
|
96
|
+
QTimer.singleShot(500, self._connect)
|
|
97
|
+
|
|
98
|
+
# ---------- Building ----------
|
|
99
|
+
@staticmethod
|
|
100
|
+
def _label(text, role):
|
|
101
|
+
"""
|
|
102
|
+
:param text: str | unicode | QString
|
|
103
|
+
:param role: str | unicode | QString
|
|
104
|
+
:return: QLabel
|
|
105
|
+
"""
|
|
106
|
+
lbl = QLabel(text) # type: QLabel
|
|
107
|
+
lbl.setProperty('role', role)
|
|
108
|
+
lbl.setWordWrap(role == 'hint')
|
|
109
|
+
return lbl
|
|
110
|
+
|
|
111
|
+
def _build(self):
|
|
112
|
+
"""
|
|
113
|
+
:return:
|
|
114
|
+
"""
|
|
115
|
+
lay = self.__m_layout # type: QVBoxLayout
|
|
116
|
+
lay.addWidget(ServerPanel._label(self.tr(u'CONNECTION'), 'title'))
|
|
117
|
+
grid = QGridLayout() # type: QGridLayout
|
|
118
|
+
self.__m_host = QLineEdit() # type: QLineEdit
|
|
119
|
+
self.__m_host.setPlaceholderText('192.168.1.20')
|
|
120
|
+
self.__m_port = QSpinBox() # type: QSpinBox
|
|
121
|
+
self.__m_port.setRange(1, 65535)
|
|
122
|
+
self.__m_token = QLineEdit() # type: QLineEdit
|
|
123
|
+
self.__m_token.setEchoMode(QLineEdit.Password)
|
|
124
|
+
self.__m_token.setPlaceholderText(self.tr(u'Shared secret (recommended)'))
|
|
125
|
+
for row, (text, w) in enumerate(((self.tr(u'Host'), self.__m_host), (self.tr(u'Port'), self.__m_port),
|
|
126
|
+
(self.tr(u'Token'), self.__m_token))):
|
|
127
|
+
grid.addWidget(QLabel(text), row, 0)
|
|
128
|
+
grid.addWidget(w, row, 1)
|
|
129
|
+
lay.addLayout(grid)
|
|
130
|
+
self.__m_connect = QPushButton() # type: QPushButton
|
|
131
|
+
self.__m_connect.setProperty('role', 'primary')
|
|
132
|
+
self.__m_connect.clicked.connect(self._toggleConnection)
|
|
133
|
+
lay.addWidget(self.__m_connect)
|
|
134
|
+
self.__m_state = QLabel() # type: QLabel
|
|
135
|
+
lay.addWidget(self.__m_state)
|
|
136
|
+
self.__m_autoConnect = QCheckBox(self.tr(u'Connect automatically at startup')) # type: QCheckBox
|
|
137
|
+
self.__m_autoConnect.toggled.connect(lambda *a: self._save())
|
|
138
|
+
lay.addWidget(self.__m_autoConnect)
|
|
139
|
+
lay.addWidget(ServerPanel._label(self.tr(u'OFFLOAD TO THE SERVER'), 'title'))
|
|
140
|
+
self.__m_offView = QCheckBox(self.tr(u'Upscaling of the magnifier')) # type: QCheckBox
|
|
141
|
+
self.__m_offLens = QCheckBox(self.tr(u'Upscaling of the zoomer')) # type: QCheckBox
|
|
142
|
+
self.__m_offAnalysis = QCheckBox(self.tr(u'Color and face analysis')) # type: QCheckBox
|
|
143
|
+
for box in (self.__m_offView, self.__m_offLens, self.__m_offAnalysis):
|
|
144
|
+
box.toggled.connect(self._onOffload)
|
|
145
|
+
lay.addWidget(box)
|
|
146
|
+
lay.addWidget(QLabel(self.tr(u'Server upscaling method')))
|
|
147
|
+
self.__m_method = QComboBox() # type: QComboBox
|
|
148
|
+
self.__m_method.currentIndexChanged.connect(lambda *a: (self._syncMethod(), self._save()))
|
|
149
|
+
lay.addWidget(self.__m_method)
|
|
150
|
+
lay.addWidget(QLabel(self.tr(u'Image quality')))
|
|
151
|
+
self.__m_quality = QComboBox() # type: QComboBox
|
|
152
|
+
for data, text in QUALITY:
|
|
153
|
+
self.__m_quality.addItem(self.tr(text), data)
|
|
154
|
+
self.__m_quality.currentIndexChanged.connect(lambda *a: (self._applyQuality(), self._save()))
|
|
155
|
+
lay.addWidget(self.__m_quality)
|
|
156
|
+
lay.addWidget(ServerPanel._label(self.tr(u'STATISTICS'), 'title'))
|
|
157
|
+
self.__m_statsLabel = ServerPanel._label('-', 'mono') # type: QLabel
|
|
158
|
+
lay.addWidget(self.__m_statsLabel)
|
|
159
|
+
lay.addWidget(ServerPanel._label(self.tr(u'SERVER ON THIS COMPUTER'), 'title'))
|
|
160
|
+
self.__m_local = QPushButton(self.tr(u'Start local server')) # type: QPushButton
|
|
161
|
+
self.__m_local.clicked.connect(self._toggleLocalServer)
|
|
162
|
+
lay.addWidget(self.__m_local)
|
|
163
|
+
self.__m_localState = ServerPanel._label('', 'hint') # type: QLabel
|
|
164
|
+
lay.addWidget(self.__m_localState)
|
|
165
|
+
lay.addWidget(ServerPanel._label(self.tr(
|
|
166
|
+
u'The server pays off on a stronger computer: run "python server.py --host 0.0.0.0 --token SECRET" '
|
|
167
|
+
u'there, then enter its address and the same token here. Use a token whenever the server listens on '
|
|
168
|
+
u'the network.'), 'hint'))
|
|
169
|
+
|
|
170
|
+
# ---------- Settings ----------
|
|
171
|
+
def _load(self):
|
|
172
|
+
"""
|
|
173
|
+
:return:
|
|
174
|
+
"""
|
|
175
|
+
s = self.__m_settings # type: QSettings
|
|
176
|
+
flag = lambda v: u'{}'.format(v).lower() in ('1', 'true', 'yes')
|
|
177
|
+
self.__m_host.setText(u'{}'.format(s.value('host', '127.0.0.1')))
|
|
178
|
+
self.__m_port.setValue(int(s.value('port', DEFAULT_PORT)))
|
|
179
|
+
self.__m_token.setText(u'{}'.format(s.value('token', '') or ''))
|
|
180
|
+
for box, key, default in ((self.__m_autoConnect, 'autoConnect', False), (self.__m_offView, 'offView', True),
|
|
181
|
+
(self.__m_offLens, 'offLens', True), (self.__m_offAnalysis, 'offAnalysis', True)):
|
|
182
|
+
box.blockSignals(True)
|
|
183
|
+
box.setChecked(flag(s.value(key, default)))
|
|
184
|
+
box.blockSignals(False)
|
|
185
|
+
self.__m_quality.blockSignals(True)
|
|
186
|
+
self.__m_quality.setCurrentIndex(max(0, self.__m_quality.findData(u'{}'.format(s.value('quality', 'balanced')))))
|
|
187
|
+
self.__m_quality.blockSignals(False)
|
|
188
|
+
self.__m_savedMethod = int(s.value('method', -1)) # type: int
|
|
189
|
+
self._fillMethods()
|
|
190
|
+
self._applyQuality()
|
|
191
|
+
self.__m_analysis.setUseRemote(self.__m_offAnalysis.isChecked())
|
|
192
|
+
|
|
193
|
+
def _save(self):
|
|
194
|
+
"""
|
|
195
|
+
:return:
|
|
196
|
+
"""
|
|
197
|
+
s = self.__m_settings # type: QSettings
|
|
198
|
+
for key, value in (('host', self.__m_host.text().strip()), ('port', self.__m_port.value()),
|
|
199
|
+
('token', self.__m_token.text()), ('autoConnect', self.__m_autoConnect.isChecked()),
|
|
200
|
+
('offView', self.__m_offView.isChecked()), ('offLens', self.__m_offLens.isChecked()),
|
|
201
|
+
('offAnalysis', self.__m_offAnalysis.isChecked()),
|
|
202
|
+
('quality', self.__m_quality.currentData()),
|
|
203
|
+
('method', self.__m_method.currentData() if self.__m_method.count() else -1)):
|
|
204
|
+
s.setValue(key, value)
|
|
205
|
+
|
|
206
|
+
def _fillMethods(self):
|
|
207
|
+
"""
|
|
208
|
+
Same as the Settings tab, or any method the server offers (it may have AI models this computer has not).
|
|
209
|
+
:return:
|
|
210
|
+
"""
|
|
211
|
+
self.__m_method.blockSignals(True)
|
|
212
|
+
self.__m_method.clear()
|
|
213
|
+
self.__m_method.addItem(self.tr(u'Same as the Settings tab'), -1)
|
|
214
|
+
for m, name in self.__m_client.getServerInfo().get('methods', []):
|
|
215
|
+
self.__m_method.addItem(self.tr(u'Server: {}').format(name), int(m))
|
|
216
|
+
self.__m_method.setCurrentIndex(max(0, self.__m_method.findData(self.__m_savedMethod)))
|
|
217
|
+
self.__m_method.blockSignals(False)
|
|
218
|
+
self._syncMethod()
|
|
219
|
+
|
|
220
|
+
def _syncMethod(self):
|
|
221
|
+
"""
|
|
222
|
+
:return:
|
|
223
|
+
"""
|
|
224
|
+
data = self.__m_method.currentData() # type: int
|
|
225
|
+
if data is None or int(data) < 0:
|
|
226
|
+
if self.__m_upscaler is not None:
|
|
227
|
+
self.__m_client.setMethod(int(self.__m_upscaler.getMethod()))
|
|
228
|
+
self.__m_client.setSharpness(float(self.__m_upscaler.getSharpness()))
|
|
229
|
+
else:
|
|
230
|
+
self.__m_client.setMethod(int(data))
|
|
231
|
+
self.__m_savedMethod = int(data) # type: int
|
|
232
|
+
self.offloadChanged.emit()
|
|
233
|
+
|
|
234
|
+
def _applyQuality(self):
|
|
235
|
+
"""
|
|
236
|
+
:return:
|
|
237
|
+
"""
|
|
238
|
+
q = self.__m_quality.currentData() # type: str
|
|
239
|
+
lossless = q == 'lossless' # type: bool
|
|
240
|
+
self.__m_client.setResultFormat('PNG' if lossless else 'JPG')
|
|
241
|
+
self.__m_client.setUploadFormat('PNG' if lossless else 'JPG')
|
|
242
|
+
self.__m_client.setQuality(85 if q == 'fast' else 92)
|
|
243
|
+
self.__m_client.setUploadQuality(85 if q == 'fast' else 95)
|
|
244
|
+
|
|
245
|
+
# ---------- Slots ----------
|
|
246
|
+
@pyqtSlot()
|
|
247
|
+
def _toggleConnection(self):
|
|
248
|
+
"""
|
|
249
|
+
:return:
|
|
250
|
+
"""
|
|
251
|
+
if self.__m_client.getState() in ('ready', 'connecting', 'authenticating'):
|
|
252
|
+
self.__m_client.disconnectFromServer()
|
|
253
|
+
else:
|
|
254
|
+
self._connect()
|
|
255
|
+
|
|
256
|
+
@pyqtSlot()
|
|
257
|
+
def _connect(self):
|
|
258
|
+
"""
|
|
259
|
+
:return:
|
|
260
|
+
"""
|
|
261
|
+
self._save()
|
|
262
|
+
c = self.__m_client # type: RemoteClient
|
|
263
|
+
c.setHost(self.__m_host.text().strip() or '127.0.0.1')
|
|
264
|
+
c.setPort(self.__m_port.value())
|
|
265
|
+
c.setToken(self.__m_token.text())
|
|
266
|
+
c.connectToServer()
|
|
267
|
+
|
|
268
|
+
@pyqtSlot('QString')
|
|
269
|
+
@pyqtSlot(str)
|
|
270
|
+
def _onState(self, state):
|
|
271
|
+
"""
|
|
272
|
+
:param state: str | unicode | QString
|
|
273
|
+
:return:
|
|
274
|
+
"""
|
|
275
|
+
color, text = STATE_TEXT.get(u'{}'.format(state), ('#7C8498', u'{}'.format(state)))
|
|
276
|
+
info = self.__m_client.getServerInfo() # type: dict
|
|
277
|
+
if u'{}'.format(state) == 'ready' and info:
|
|
278
|
+
text += self.tr(u' to {}').format(info.get('server', '?'))
|
|
279
|
+
self._fillMethods()
|
|
280
|
+
self.__m_state.setText('<span style="color:{}">●</span> {}'.format(color, self.tr(text)))
|
|
281
|
+
busy = u'{}'.format(state) in ('ready', 'connecting', 'authenticating') # type: bool
|
|
282
|
+
self.__m_connect.setText(self.tr(u'Disconnect') if busy else self.tr(u'Connect'))
|
|
283
|
+
for w in (self.__m_host, self.__m_port, self.__m_token):
|
|
284
|
+
w.setEnabled(not busy)
|
|
285
|
+
self.offloadChanged.emit()
|
|
286
|
+
|
|
287
|
+
@pyqtSlot('QString')
|
|
288
|
+
@pyqtSlot(str)
|
|
289
|
+
def _onError(self, message):
|
|
290
|
+
"""
|
|
291
|
+
:param message: str | unicode | QString
|
|
292
|
+
:return:
|
|
293
|
+
"""
|
|
294
|
+
self.__m_state.setToolTip(self.tr(message))
|
|
295
|
+
self.notify.emit(self.tr(message))
|
|
296
|
+
|
|
297
|
+
@pyqtSlot()
|
|
298
|
+
def _onOffload(self):
|
|
299
|
+
"""
|
|
300
|
+
:return:
|
|
301
|
+
"""
|
|
302
|
+
self.__m_analysis.setUseRemote(self.__m_offAnalysis.isChecked())
|
|
303
|
+
self._save()
|
|
304
|
+
self.offloadChanged.emit()
|
|
305
|
+
|
|
306
|
+
@pyqtSlot()
|
|
307
|
+
def _updateStats(self):
|
|
308
|
+
"""
|
|
309
|
+
:return:
|
|
310
|
+
"""
|
|
311
|
+
c = self.__m_client # type: RemoteClient
|
|
312
|
+
secs = max(0.001, self.__m_clock.restart() / 1000.0) # type: float
|
|
313
|
+
counts = c.takeCounts() # type: dict
|
|
314
|
+
sent, received = c.getBytes()
|
|
315
|
+
up = (sent - self.__m_lastBytes[0]) / 1024.0 / secs # type: float
|
|
316
|
+
down = (received - self.__m_lastBytes[1]) / 1024.0 / secs # type: float
|
|
317
|
+
self.__m_lastBytes = (sent, received) # type: tuple
|
|
318
|
+
if not c.isReady():
|
|
319
|
+
self.__m_statsLabel.setText('-')
|
|
320
|
+
return
|
|
321
|
+
self.__m_statsLabel.setText(
|
|
322
|
+
'latency {:.0f} ms\nmagnifier {:.0f} fps\nlens {:.0f} fps\nanalysis {:.0f} / s\n'
|
|
323
|
+
'upload {:.0f} KB/s\ndownload {:.0f} KB/s'.format(
|
|
324
|
+
max(0.0, c.getLatency()), counts.get('view', 0) / secs, counts.get('lens', 0) / secs,
|
|
325
|
+
(counts.get('analysis:view', 0) + counts.get('analysis:lens', 0)) / secs, up,
|
|
326
|
+
down))
|
|
327
|
+
|
|
328
|
+
@pyqtSlot()
|
|
329
|
+
def _toggleLocalServer(self):
|
|
330
|
+
"""
|
|
331
|
+
:return:
|
|
332
|
+
"""
|
|
333
|
+
if self.__m_process is not None and self.__m_process.state() != QProcess.NotRunning:
|
|
334
|
+
self.stopLocalServer()
|
|
335
|
+
return
|
|
336
|
+
self._save()
|
|
337
|
+
proc = QProcess(self) # type: QProcess
|
|
338
|
+
proc.setProcessChannelMode(QProcess.MergedChannels)
|
|
339
|
+
proc.setWorkingDirectory(dirname(__file__))
|
|
340
|
+
proc.readyRead.connect(lambda: self.__m_localState.setText(
|
|
341
|
+
u'{}'.format(bytes(proc.readAll().data()).decode('utf-8', 'replace')).strip().splitlines()[-1][-160:]))
|
|
342
|
+
proc.finished.connect(lambda *a: (self.__m_local.setText(self.tr(u'Start local server')),
|
|
343
|
+
self.__m_localState.setText(self.tr(u'Local server stopped.'))))
|
|
344
|
+
args = ['--port', u'{}'.format(self.__m_port.value())] # type: list
|
|
345
|
+
if self.__m_token.text():
|
|
346
|
+
args += ['--token', self.__m_token.text()]
|
|
347
|
+
bundled = join(dirname(executable), 'ScreenMagnifierServer' + ('.exe' if platform == 'win32' else ''))
|
|
348
|
+
if getattr(sys, 'frozen', False) and isfile(bundled): # Packaged release: the bundled server binary.
|
|
349
|
+
proc.start(bundled, args)
|
|
350
|
+
else:
|
|
351
|
+
proc.start(executable, [join(dirname(__file__), 'server.py')] + args)
|
|
352
|
+
self.__m_process = proc # type: QProcess
|
|
353
|
+
self.__m_local.setText(self.tr(u'Stop local server'))
|
|
354
|
+
self.__m_localState.setText(self.tr(u'Starting...'))
|
|
355
|
+
if self.__m_host.text().strip() in ('', '127.0.0.1', 'localhost'):
|
|
356
|
+
QTimer.singleShot(2500, self._connect)
|
|
357
|
+
|
|
358
|
+
# ---------- Public API ----------
|
|
359
|
+
@pyqtSlot()
|
|
360
|
+
def stopLocalServer(self):
|
|
361
|
+
"""
|
|
362
|
+
:return:
|
|
363
|
+
"""
|
|
364
|
+
if self.__m_process is not None and self.__m_process.state() != QProcess.NotRunning:
|
|
365
|
+
self.__m_process.terminate()
|
|
366
|
+
if not self.__m_process.waitForFinished(2000):
|
|
367
|
+
self.__m_process.kill()
|
|
368
|
+
|
|
369
|
+
def isOffloadView(self):
|
|
370
|
+
"""
|
|
371
|
+
:return: (bool) Upscale the magnifier on the server right now.
|
|
372
|
+
"""
|
|
373
|
+
return self.__m_offView.isChecked() and self.__m_client.isReady()
|
|
374
|
+
|
|
375
|
+
def isOffloadLens(self):
|
|
376
|
+
"""
|
|
377
|
+
:return: (bool) Upscale the zoomer on the server right now.
|
|
378
|
+
"""
|
|
379
|
+
return self.__m_offLens.isChecked() and self.__m_client.isReady()
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# coding=utf-8
|
|
2
|
+
"""
|
|
3
|
+
shortcuteditor package.
|
|
4
|
+
"""
|
|
5
|
+
from os.path import dirname
|
|
6
|
+
from sys import path
|
|
7
|
+
|
|
8
|
+
if not __package__ and dirname(__file__) not in path:
|
|
9
|
+
path.append(dirname(__file__))
|
|
10
|
+
|
|
11
|
+
try:
|
|
12
|
+
from .shortcuteditor import ShortcutEditorWidget
|
|
13
|
+
except:
|
|
14
|
+
from shortcuteditor import ShortcutEditorWidget
|
|
15
|
+
|
|
16
|
+
__all__ = ['ShortcutEditorWidget'] # type: list[str]
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# coding=utf-8
|
|
2
|
+
"""
|
|
3
|
+
Entry point for the ShortcutEditor demo.
|
|
4
|
+
"""
|
|
5
|
+
from os.path import dirname
|
|
6
|
+
from sys import path
|
|
7
|
+
|
|
8
|
+
if not __package__ and dirname(__file__) not in path:
|
|
9
|
+
path.append(dirname(__file__))
|
|
10
|
+
|
|
11
|
+
try:
|
|
12
|
+
from .mainwindow import MainWindow
|
|
13
|
+
except:
|
|
14
|
+
from mainwindow import MainWindow
|
|
15
|
+
|
|
16
|
+
if __name__ == '__main__':
|
|
17
|
+
from ManyQt.QtWidgets import QApplication
|
|
18
|
+
from sys import argv, exit
|
|
19
|
+
|
|
20
|
+
a = QApplication(argv) # type: QApplication
|
|
21
|
+
w = MainWindow() # type: MainWindow
|
|
22
|
+
w.show()
|
|
23
|
+
exit(a.exec_())
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# coding=utf-8
|
|
2
|
+
"""
|
|
3
|
+
Demo window for ShortcutEditorWidget: window shortcuts with an alternate key, global hotkeys, conflicts.
|
|
4
|
+
"""
|
|
5
|
+
from ManyQt.QtWidgets import QMainWindow, QVBoxLayout, QWidget, QLabel, QPushButton, QScrollArea
|
|
6
|
+
from os.path import dirname
|
|
7
|
+
from sys import path
|
|
8
|
+
|
|
9
|
+
if not __package__ and dirname(__file__) not in path:
|
|
10
|
+
path.append(dirname(__file__))
|
|
11
|
+
|
|
12
|
+
try:
|
|
13
|
+
from .shortcuteditor import ShortcutEditorWidget
|
|
14
|
+
except:
|
|
15
|
+
from shortcuteditor import ShortcutEditorWidget
|
|
16
|
+
|
|
17
|
+
DEMO_ACTIONS = [
|
|
18
|
+
{'name': 'open', 'label': 'Open a file', 'group': 'File', 'scope': 'window', 'defaults': ['Ctrl+O', '']},
|
|
19
|
+
{'name': 'save', 'label': 'Save', 'group': 'File', 'scope': 'window', 'defaults': ['Ctrl+S', 'F2']},
|
|
20
|
+
{'name': 'zoomIn', 'label': 'Zoom in', 'group': 'View', 'scope': 'window', 'defaults': ['+', '=']},
|
|
21
|
+
{'name': 'show', 'label': 'Show / hide everywhere', 'group': 'Global', 'scope': 'global',
|
|
22
|
+
'defaults': ['Ctrl+Alt+Z']},
|
|
23
|
+
] # type: list
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class MainWindow(QMainWindow):
|
|
27
|
+
"""
|
|
28
|
+
MainWindow class.
|
|
29
|
+
"""
|
|
30
|
+
|
|
31
|
+
def __init__(self, *args, **kwargs):
|
|
32
|
+
"""
|
|
33
|
+
:param args: any
|
|
34
|
+
:param kwargs: any
|
|
35
|
+
"""
|
|
36
|
+
super(MainWindow, self).__init__(*args, **kwargs)
|
|
37
|
+
self.setWindowTitle(self.tr(u'ShortcutEditor demo'))
|
|
38
|
+
self.resize(560, 460)
|
|
39
|
+
self.__m_info = QLabel(self.tr(u'Record a shortcut - try Ctrl+S on "Open" to see a conflict.'))
|
|
40
|
+
self.__m_editor = ShortcutEditorWidget(
|
|
41
|
+
actions=DEMO_ACTIONS, shortcutChanged=lambda n, s, i, k: self.__m_info.setText(
|
|
42
|
+
u'{} ({}) slot {} -> {}'.format(n, s, i, k or 'none'))) # type: ShortcutEditorWidget
|
|
43
|
+
reset = QPushButton(self.tr(u'Reset all')) # type: QPushButton
|
|
44
|
+
reset.clicked.connect(self.__m_editor.resetAll)
|
|
45
|
+
wdg = QWidget() # type: QWidget
|
|
46
|
+
layout = QVBoxLayout(wdg) # type: QVBoxLayout
|
|
47
|
+
layout.addWidget(self.__m_editor)
|
|
48
|
+
layout.addWidget(reset)
|
|
49
|
+
layout.addWidget(self.__m_info)
|
|
50
|
+
layout.addStretch(1)
|
|
51
|
+
scroll = QScrollArea() # type: QScrollArea
|
|
52
|
+
scroll.setWidgetResizable(True)
|
|
53
|
+
scroll.setWidget(wdg)
|
|
54
|
+
self.setCentralWidget(scroll)
|