From 79d5f9744817c5698792336cb22cc637831d162e Mon Sep 17 00:00:00 2001 From: falkTX Date: Sat, 12 Mar 2016 12:54:52 +0100 Subject: [PATCH] Remove canvas print stuff --- resources/ui/carla_host.ui | 1 - source/carla_host.py | 28 ++++------------------------ 2 files changed, 4 insertions(+), 25 deletions(-) diff --git a/resources/ui/carla_host.ui b/resources/ui/carla_host.ui index 8eefb5796..90b0ca378 100644 --- a/resources/ui/carla_host.ui +++ b/resources/ui/carla_host.ui @@ -218,7 +218,6 @@ - diff --git a/source/carla_host.py b/source/carla_host.py index bac33c025..853b6f54f 100644 --- a/source/carla_host.py +++ b/source/carla_host.py @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- # Carla host code -# Copyright (C) 2011-2014 Filipe Coelho +# Copyright (C) 2011-2016 Filipe Coelho # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as @@ -27,11 +27,11 @@ from carla_config import * if config_UseQt5: from PyQt5.QtCore import qCritical, QFileInfo, QModelIndex, QPointF, QTimer from PyQt5.QtGui import QImage, QPalette - from PyQt5.QtPrintSupport import QPrinter, QPrintDialog from PyQt5.QtWidgets import QAction, QApplication, QFileSystemModel, QListWidgetItem, QMainWindow else: from PyQt4.QtCore import qCritical, QFileInfo, QModelIndex, QPointF, QTimer - from PyQt4.QtGui import QAction, QApplication, QFileSystemModel, QImage, QListWidgetItem, QMainWindow, QPalette, QPrinter, QPrintDialog + from PyQt4.QtGui import QImage, QPalette + from PyQt4.QtGui import QAction, QApplication, QFileSystemModel, QListWidgetItem, QMainWindow # ------------------------------------------------------------------------------------------------------------ # Imports (Custom) @@ -140,8 +140,7 @@ class HostWindow(QMainWindow): # ---------------------------------------------------------------------------------------------------- # Internal stuff (patchbay) - self.fExportImage = QImage() - self.fExportPrinter = None + self.fExportImage = QImage() self.fPeaksCleared = True @@ -216,7 +215,6 @@ class HostWindow(QMainWindow): self.ui.act_canvas_show_internal.setVisible(False) self.ui.act_canvas_show_external.setVisible(False) self.ui.act_canvas_arrange.setVisible(False) - self.ui.act_canvas_print.setVisible(False) self.ui.act_canvas_refresh.setVisible(False) self.ui.act_canvas_save_image.setVisible(False) self.ui.act_canvas_zoom_100.setVisible(False) @@ -374,7 +372,6 @@ class HostWindow(QMainWindow): self.ui.act_canvas_zoom_in.triggered.connect(self.slot_canvasZoomIn) self.ui.act_canvas_zoom_out.triggered.connect(self.slot_canvasZoomOut) self.ui.act_canvas_zoom_100.triggered.connect(self.slot_canvasZoomReset) - self.ui.act_canvas_print.triggered.connect(self.slot_canvasPrint) self.ui.act_canvas_save_image.triggered.connect(self.slot_canvasSaveImage) self.ui.act_canvas_arrange.setEnabled(False) # TODO, later @@ -1119,23 +1116,6 @@ class HostWindow(QMainWindow): def slot_canvasZoomReset(self): self.scene.zoom_reset() - @pyqtSlot() - def slot_canvasPrint(self): - self.scene.clearSelection() - - if self.fExportPrinter is None: - self.fExportPrinter = QPrinter() - - dialog = QPrintDialog(self.fExportPrinter, self) - - if dialog.exec_(): - painter = QPainter(self.fExportPrinter) - painter.save() - painter.setRenderHint(QPainter.Antialiasing) - painter.setRenderHint(QPainter.TextAntialiasing) - self.scene.render(painter) - painter.restore() - @pyqtSlot() def slot_canvasSaveImage(self): newPath = QFileDialog.getSaveFileName(self, self.tr("Save Image"), filter=self.tr("PNG Image (*.png);;JPEG Image (*.jpg)"))