mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-01 03:53:24 +00:00
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>
This commit is contained in:
parent
c89d83611b
commit
ecf483db46
2 changed files with 11 additions and 1 deletions
|
@ -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();
|
||||
|
|
|
@ -25,6 +25,7 @@ private:
|
|||
private slots:
|
||||
void previewClicked();
|
||||
void printClicked();
|
||||
void closeClicked();
|
||||
void onPaintRequested(QPrinter *);
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue