summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Lubomir I. Ivanov <neolit123@gmail.com>2013-12-04 14:14:04 +0200
committerGravatar Lubomir I. Ivanov <neolit123@gmail.com>2013-12-04 14:14:04 +0200
commitecf483db460e78d8dc08e5f1eb6b57ccbe7aa6ba (patch)
tree7e6bfc6a9e72c67dd99a901824004f1593cd9b1a
parentc89d83611be9725d718c34de171862658be0f8b3 (diff)
downloadsubsurface-ecf483db460e78d8dc08e5f1eb6b57ccbe7aa6ba.tar.gz
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 <neolit123@gmail.com>
-rw-r--r--qt-ui/printdialog.cpp11
-rw-r--r--qt-ui/printdialog.h1
2 files changed, 11 insertions, 1 deletions
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 *);
};