summaryrefslogtreecommitdiffstats
path: root/qt-ui/printdialog.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2014-08-05 10:01:38 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-08-05 10:01:38 -0700
commit4fd0dfcabb44e9d1d83ba727f83d30f04efaae80 (patch)
tree5b814a8b0f075398dd9cdd25bbdd0bd39c4d3613 /qt-ui/printdialog.cpp
parent095e8081ca5f6714e1364bdb7da711d146362eeb (diff)
downloadsubsurface-4fd0dfcabb44e9d1d83ba727f83d30f04efaae80.tar.gz
Printing: only give up if no size is available
Checking for available printers appears to sometimes fail, even if there is a valid PDF or PS printer. Instead we bail if we can't get a valid size for the printer. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/printdialog.cpp')
-rw-r--r--qt-ui/printdialog.cpp18
1 files changed, 0 insertions, 18 deletions
diff --git a/qt-ui/printdialog.cpp b/qt-ui/printdialog.cpp
index e8a323e03..f8f06aead 100644
--- a/qt-ui/printdialog.cpp
+++ b/qt-ui/printdialog.cpp
@@ -66,24 +66,8 @@ PrintDialog::PrintDialog(QWidget *parent, Qt::WindowFlags f) : QDialog(parent, f
connect(quit, SIGNAL(activated()), parent, SLOT(close()));
}
-bool PrintDialog::checkForAvailablePrinters(void)
-{
- QList<QPrinterInfo> list = QPrinterInfo::availablePrinters();
- if (!list.length()) {
- QMessageBox msgBox;
- msgBox.setIcon(QMessageBox::Critical);
- msgBox.setText(tr("Subsurface cannot find installed printers on this system!"));
- msgBox.setWindowIcon(QIcon(":subsurface-icon"));
- msgBox.exec();
- return false;
- }
- return true;
-}
-
void PrintDialog::previewClicked(void)
{
- if (!checkForAvailablePrinters())
- return;
QPrintPreviewDialog previewDialog(&printer, this);
connect(&previewDialog, SIGNAL(paintRequested(QPrinter *)), this, SLOT(onPaintRequested(QPrinter *)));
previewDialog.exec();
@@ -91,8 +75,6 @@ void PrintDialog::previewClicked(void)
void PrintDialog::printClicked(void)
{
- if (!checkForAvailablePrinters())
- return;
QPrintDialog printDialog(&printer, this);
if (printDialog.exec() == QDialog::Accepted){
printLayout->print();