Browse Source

Compatibility fixes with python 3.10

Signed-off-by: falkTX <falktx@falktx.com>
tags/v0.9.2
falkTX 2 years ago
parent
commit
e8172cdf3a
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
6 changed files with 15 additions and 16 deletions
  1. +3
    -5
      src/canvaspreviewframe.py
  2. +6
    -5
      src/claudia.py
  3. +1
    -1
      src/jacksettings.py
  4. +3
    -3
      src/patchcanvas.py
  5. +1
    -1
      src/render.py
  6. +1
    -1
      src/shared_canvasjack.py

+ 3
- 5
src/canvaspreviewframe.py View File

@@ -166,6 +166,9 @@ class CanvasPreviewFrame(QFrame):
QFrame.mouseReleaseEvent(self, event)

def paintEvent(self, event):
if not self.fUseCustomPaint:
QFrame.paintEvent(self, event)

painter = QPainter(self)

if self.fUseCustomPaint:
@@ -200,11 +203,6 @@ class CanvasPreviewFrame(QFrame):
painter.setPen(self.fViewPen)
painter.drawRect(QRectF(self.fViewRect[iX], self.fViewRect[iY], maxWidth, maxHeight))

if self.fUseCustomPaint:
event.accept()
else:
QFrame.paintEvent(self, event)

def resizeEvent(self, event):
self.fRenderSource = self.getRenderSource()



+ 6
- 5
src/claudia.py View File

@@ -2160,13 +2160,13 @@ class ClaudiaMainW(AbstractCanvasJackClass):
@pyqtSlot()
def slot_miniCanvasInit(self):
settings = QSettings()
self.ui.graphicsView.horizontalScrollBar().setValue(settings.value("HorizontalScrollBarValue", DEFAULT_CANVAS_WIDTH / 3, type=int))
self.ui.graphicsView.verticalScrollBar().setValue(settings.value("VerticalScrollBarValue", DEFAULT_CANVAS_HEIGHT * 3 / 8, type=int))
self.ui.graphicsView.horizontalScrollBar().setValue(settings.value("HorizontalScrollBarValue", int(DEFAULT_CANVAS_WIDTH / 3), type=int))
self.ui.graphicsView.verticalScrollBar().setValue(settings.value("VerticalScrollBarValue", int(DEFAULT_CANVAS_HEIGHT * 3 / 8), type=int))

@pyqtSlot(float, float)
def slot_miniCanvasMoved(self, xp, yp):
self.ui.graphicsView.horizontalScrollBar().setValue(xp * DEFAULT_CANVAS_WIDTH)
self.ui.graphicsView.verticalScrollBar().setValue(yp * DEFAULT_CANVAS_HEIGHT)
self.ui.graphicsView.horizontalScrollBar().setValue(int(xp * DEFAULT_CANVAS_WIDTH))
self.ui.graphicsView.verticalScrollBar().setValue(int(yp * DEFAULT_CANVAS_HEIGHT))

@pyqtSlot()
def slot_miniCanvasCheckAll(self):
@@ -2176,7 +2176,8 @@ class ClaudiaMainW(AbstractCanvasJackClass):

@pyqtSlot()
def slot_miniCanvasCheckSize(self):
self.ui.miniCanvasPreview.setViewSize(float(self.ui.graphicsView.width()) / DEFAULT_CANVAS_WIDTH, float(self.ui.graphicsView.height()) / DEFAULT_CANVAS_HEIGHT)
self.ui.miniCanvasPreview.setViewSize(float(self.ui.graphicsView.width()) / DEFAULT_CANVAS_WIDTH,
float(self.ui.graphicsView.height()) / DEFAULT_CANVAS_HEIGHT)

@pyqtSlot()
def slot_handleCrash_jack(self):


+ 1
- 1
src/jacksettings.py View File

@@ -406,7 +406,7 @@ class JackSettingsW(QDialog):
elif attribute == "client-timeout":
self.setComboBoxValue(self.ui.obj_server_client_timeout, str(int(value)))
elif attribute == "clock-source":
if len(str(value)) == 1 :
if len(str(value)) == 1 and not isinstance(value, dbus.UInt32):
value = str(value)
if value == "c":
self.ui.obj_server_clock_source_cycle.setChecked(True)


+ 3
- 3
src/patchcanvas.py View File

@@ -2480,16 +2480,16 @@ class CanvasBox(QGraphicsItem):
else:
painter.setBrush(canvas.theme.box_bg_1)

painter.drawRect(0, 0, self.p_width, self.p_height)
painter.drawRect(QRectF(0, 0, self.p_width, self.p_height))

# Draw pixmap header
if canvas.theme.box_header_pixmap:
painter.setPen(Qt.NoPen)
painter.setBrush(canvas.theme.box_bg_2)
painter.drawRect(1, 1, self.p_width-2, canvas.theme.box_header_height)
painter.drawRect(QRectF(1, 1, self.p_width-2, canvas.theme.box_header_height))

headerPos = QPointF(1, 1)
headerRect = QRectF(2, 2, self.p_width-4, canvas.theme.box_header_height-3)
headerRect = QRectF(2, 2, int(self.p_width-4), canvas.theme.box_header_height-3)
painter.drawTiledPixmap(headerRect, canvas.theme.box_header_pixmap, headerPos)

# Draw text


+ 1
- 1
src/render.py View File

@@ -349,7 +349,7 @@ class RenderW(QDialog):

@pyqtSlot()
def slot_updateProgressbar(self):
time = int(jacklib.get_current_transport_frame(self.fJackClient)) / self.fSampleRate
time = int(int(jacklib.get_current_transport_frame(self.fJackClient)) / self.fSampleRate)
self.ui.progressBar.setValue(time)

if time > self.fMaxTime or (self.fLastTime > time and not self.fFreewheel):


+ 1
- 1
src/shared_canvasjack.py View File

@@ -515,7 +515,7 @@ class AbstractCanvasJackClass(QMainWindow):
imgFormat = "PNG"
newPath += ".png"

self.fExportImage = QImage(self.scene.sceneRect().width(), self.scene.sceneRect().height(), QImage.Format_RGB32)
self.fExportImage = QImage(int(self.scene.sceneRect().width()), int(self.scene.sceneRect().height()), QImage.Format_RGB32)
painter = QPainter(self.fExportImage)
painter.save()
painter.setRenderHint(QPainter.Antialiasing, True)


Loading…
Cancel
Save