From ecf483db460e78d8dc08e5f1eb6b57ccbe7aa6ba Mon Sep 17 00:00:00 2001 From: "Lubomir I. Ivanov" Date: Wed, 4 Dec 2013 14:14:04 +0200 Subject: PrintDialog: add a 'Close' button The dialog was missing a 'Close' button so we add it. Also change the mnemonic of the 'Preview' button, as it was the same as the one for print 'Print'. Signed-off-by: Lubomir I. Ivanov --- qt-ui/printdialog.cpp | 11 ++++++++++- qt-ui/printdialog.h | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/qt-ui/printdialog.cpp b/qt-ui/printdialog.cpp index b6481372a..683d584ad 100644 --- a/qt-ui/printdialog.cpp +++ b/qt-ui/printdialog.cpp @@ -38,10 +38,14 @@ PrintDialog::PrintDialog(QWidget *parent, Qt::WindowFlags f) connect(previewButton, SIGNAL(clicked(bool)), this, SLOT(previewClicked())); hLayout->addWidget(previewButton); - QPushButton *printButton = new QPushButton(tr("&Print")); + QPushButton *printButton = new QPushButton(tr("P&rint")); connect(printButton, SIGNAL(clicked(bool)), this, SLOT(printClicked())); hLayout->addWidget(printButton); + QPushButton *closeButton = new QPushButton(tr("&Close")); + connect(closeButton, SIGNAL(clicked(bool)), this, SLOT(closeClicked())); + hLayout->addWidget(closeButton); + QProgressBar *progressBar = new QProgressBar(); connect(printLayout, SIGNAL(signalProgress(int)), progressBar, SLOT(setValue(int))); progressBar->setMinimum(0); @@ -75,6 +79,11 @@ void PrintDialog::printClicked(void) printLayout->print(); } +void PrintDialog::closeClicked(void) +{ + close(); +} + void PrintDialog::onPaintRequested(QPrinter *printerPtr) { printLayout->print(); diff --git a/qt-ui/printdialog.h b/qt-ui/printdialog.h index 5c5c1fbf6..924f21acc 100644 --- a/qt-ui/printdialog.h +++ b/qt-ui/printdialog.h @@ -25,6 +25,7 @@ private: private slots: void previewClicked(); void printClicked(); + void closeClicked(); void onPaintRequested(QPrinter *); }; -- cgit v1.2.3-70-g09d2