mirror of
https://github.com/vale981/rmview
synced 2025-03-06 01:31:39 -05:00
Error signals
This commit is contained in:
parent
dbf23d2439
commit
5af509dd19
1 changed files with 15 additions and 11 deletions
|
@ -45,6 +45,8 @@ class RFBTest(RFBClient):
|
||||||
RAW_ENCODING ])
|
RAW_ENCODING ])
|
||||||
self.framebufferUpdateRequest()
|
self.framebufferUpdateRequest()
|
||||||
|
|
||||||
|
def sendPassword(self, password):
|
||||||
|
self.signals.onFatalError.emit(Exception("Unsupported password request."))
|
||||||
|
|
||||||
def commitUpdate(self, rectangles=None):
|
def commitUpdate(self, rectangles=None):
|
||||||
self.signals.onNewFrame.emit(self.img)
|
self.signals.onNewFrame.emit(self.img)
|
||||||
|
@ -69,11 +71,11 @@ class RFBTestFactory(RFBFactory):
|
||||||
self.signals = signals
|
self.signals = signals
|
||||||
|
|
||||||
def clientConnectionLost(self, connector, reason):
|
def clientConnectionLost(self, connector, reason):
|
||||||
print(reason)
|
log.warning("Connection lost: %s", reason.getErrorMessage())
|
||||||
# connector.connect()
|
connector.connect()
|
||||||
|
|
||||||
def clientConnectionFailed(self, connector, reason):
|
def clientConnectionFailed(self, connector, reason):
|
||||||
print("connection failed:", reason)
|
self.signals.onFatalError.emit(Exception("Connection failed: " + str(reason)))
|
||||||
reactor.callFromThread(reactor.stop)
|
reactor.callFromThread(reactor.stop)
|
||||||
|
|
||||||
|
|
||||||
|
@ -102,6 +104,7 @@ class FrameBufferWorker(QRunnable):
|
||||||
|
|
||||||
@pyqtSlot()
|
@pyqtSlot()
|
||||||
def run(self):
|
def run(self):
|
||||||
|
try:
|
||||||
_,out,_ = self.ssh.exec_command("insmod mxc_epdc_fb_damage.ko")
|
_,out,_ = self.ssh.exec_command("insmod mxc_epdc_fb_damage.ko")
|
||||||
out.channel.recv_exit_status()
|
out.channel.recv_exit_status()
|
||||||
_,_,out = self.ssh.exec_command("$HOME/rM-vnc-server")
|
_,_,out = self.ssh.exec_command("$HOME/rM-vnc-server")
|
||||||
|
@ -109,7 +112,8 @@ class FrameBufferWorker(QRunnable):
|
||||||
self.vncClient = internet.TCPClient(self.ssh.hostname, 5900, RFBTestFactory(self.signals))
|
self.vncClient = internet.TCPClient(self.ssh.hostname, 5900, RFBTestFactory(self.signals))
|
||||||
self.vncClient.startService()
|
self.vncClient.startService()
|
||||||
reactor.run(installSignalHandlers=0)
|
reactor.run(installSignalHandlers=0)
|
||||||
|
except Exception as e:
|
||||||
|
self.signals.onFatalError.emit(e)
|
||||||
|
|
||||||
class PWSignals(QObject):
|
class PWSignals(QObject):
|
||||||
onFatalError = pyqtSignal(Exception)
|
onFatalError = pyqtSignal(Exception)
|
||||||
|
|
Loading…
Add table
Reference in a new issue