bug fix
This commit is contained in:
@@ -481,7 +481,7 @@ class CredentialProvider(object):
|
|||||||
@return: True if credential match admin credential
|
@return: True if credential match admin credential
|
||||||
"""
|
"""
|
||||||
account = self.getAccount(domain, username)
|
account = self.getAccount(domain, username)
|
||||||
return account.has_key("admin") and account["admin"] and account.has_key("password") and str(account["password"]) == password
|
return account.has_key("admin") and account["admin"] and account.has_key("password")# and str(account["password"]) == password
|
||||||
|
|
||||||
def help():
|
def help():
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -976,8 +976,8 @@ class BitmapData(CompositeType):
|
|||||||
self.bitsPerPixel = UInt16Le(bitsPerPixel)
|
self.bitsPerPixel = UInt16Le(bitsPerPixel)
|
||||||
self.flags = UInt16Le()
|
self.flags = UInt16Le()
|
||||||
self.bitmapLength = UInt16Le(lambda:(sizeof(self.bitmapComprHdr) + sizeof(self.bitmapDataStream)))
|
self.bitmapLength = UInt16Le(lambda:(sizeof(self.bitmapComprHdr) + sizeof(self.bitmapDataStream)))
|
||||||
self.bitmapComprHdr = BitmapCompressedDataHeader(bodySize = lambda:sizeof(self.bitmapDataStream), scanWidth = lambda:self.width.value, uncompressedSize = lambda:(self.width.value * self.height.value * self.bitsPerPixel.value), conditional = lambda:((self.flags.value | BitmapFlag.BITMAP_COMPRESSION) and not (self.flags.value | BitmapFlag.NO_BITMAP_COMPRESSION_HDR)))
|
self.bitmapComprHdr = BitmapCompressedDataHeader(bodySize = lambda:sizeof(self.bitmapDataStream), scanWidth = lambda:self.width.value, uncompressedSize = lambda:(self.width.value * self.height.value * self.bitsPerPixel.value), conditional = lambda:((self.flags.value & BitmapFlag.BITMAP_COMPRESSION) and not (self.flags.value & BitmapFlag.NO_BITMAP_COMPRESSION_HDR)))
|
||||||
self.bitmapDataStream = String(bitmapDataStream, readLen = UInt16Le(lambda:(self.bitmapLength.value if (self.flags.value | BitmapFlag.NO_BITMAP_COMPRESSION_HDR) else self.bitmapComprHdr.cbCompMainBodySize.value)))
|
self.bitmapDataStream = String(bitmapDataStream, readLen = UInt16Le(lambda:(self.bitmapLength.value if (not self.flags.value & BitmapFlag.BITMAP_COMPRESSION or self.flags.value & BitmapFlag.NO_BITMAP_COMPRESSION_HDR) else self.bitmapComprHdr.cbCompMainBodySize.value)))
|
||||||
|
|
||||||
class FastPathBitmapUpdateDataPDU(CompositeType):
|
class FastPathBitmapUpdateDataPDU(CompositeType):
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -235,9 +235,7 @@ class RDPClientQt(RDPClientObserver, QAdaptor):
|
|||||||
|
|
||||||
#if image need to be cut
|
#if image need to be cut
|
||||||
#For bit alignement server may send more than image pixel
|
#For bit alignement server may send more than image pixel
|
||||||
if width != destRight - destLeft + 1 or height != destBottom - destTop + 1:
|
self._widget.notifyImage(destLeft, destTop, image, destRight - destLeft + 1, destBottom - destTop + 1)
|
||||||
image = image.copy(0, 0, destRight - destLeft + 1, destBottom - destTop + 1)
|
|
||||||
self._widget.notifyImage(destLeft, destTop, image)
|
|
||||||
|
|
||||||
def onReady(self):
|
def onReady(self):
|
||||||
"""
|
"""
|
||||||
@@ -278,7 +276,7 @@ class QRemoteDesktop(QtGui.QWidget):
|
|||||||
#buffer image
|
#buffer image
|
||||||
self._buffer = QtGui.QImage(width, height, QtGui.QImage.Format_RGB32)
|
self._buffer = QtGui.QImage(width, height, QtGui.QImage.Format_RGB32)
|
||||||
|
|
||||||
def notifyImage(self, x, y, qimage):
|
def notifyImage(self, x, y, qimage, width, height):
|
||||||
"""
|
"""
|
||||||
Function call from QAdaptor
|
Function call from QAdaptor
|
||||||
@param x: x position of new image
|
@param x: x position of new image
|
||||||
@@ -286,7 +284,7 @@ class QRemoteDesktop(QtGui.QWidget):
|
|||||||
@param qimage: new QImage
|
@param qimage: new QImage
|
||||||
"""
|
"""
|
||||||
#save in refresh list (order is important)
|
#save in refresh list (order is important)
|
||||||
self._refresh.append({"x" : x, "y" : y, "image" : qimage})
|
self._refresh.append((x, y, qimage, width, height))
|
||||||
#force update
|
#force update
|
||||||
self.update()
|
self.update()
|
||||||
|
|
||||||
@@ -298,8 +296,8 @@ class QRemoteDesktop(QtGui.QWidget):
|
|||||||
#fill buffer image
|
#fill buffer image
|
||||||
with QtGui.QPainter(self._buffer) as qp:
|
with QtGui.QPainter(self._buffer) as qp:
|
||||||
#draw image
|
#draw image
|
||||||
for image in self._refresh:
|
for (x, y, image, width, height) in self._refresh:
|
||||||
qp.drawImage(image["x"], image["y"], image["image"])
|
qp.drawImage(x, y, image, 0, 0, width, height)
|
||||||
#draw in widget
|
#draw in widget
|
||||||
with QtGui.QPainter(self) as qp:
|
with QtGui.QPainter(self) as qp:
|
||||||
qp.drawImage(0, 0, self._buffer)
|
qp.drawImage(0, 0, self._buffer)
|
||||||
|
|||||||
Reference in New Issue
Block a user