aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--qt-ui/mainwindow.cpp4
-rw-r--r--qt-ui/printdialog.cpp14
-rw-r--r--qt-ui/printdialog.h4
3 files changed, 5 insertions, 17 deletions
diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp
index 73191dacf..0cafa08cf 100644
--- a/qt-ui/mainwindow.cpp
+++ b/qt-ui/mainwindow.cpp
@@ -211,7 +211,9 @@ void MainWindow::on_actionExportUDDF_triggered()
void MainWindow::on_actionPrint_triggered()
{
- PrintDialog::instance()->runDialog();
+ PrintDialog dlg(this);
+
+ dlg.exec();
}
void MainWindow::disableDcShortcuts()
diff --git a/qt-ui/printdialog.cpp b/qt-ui/printdialog.cpp
index e029ff09b..ba96ccccd 100644
--- a/qt-ui/printdialog.cpp
+++ b/qt-ui/printdialog.cpp
@@ -11,13 +11,6 @@
#include <QPrintPreviewDialog>
#include <QPrintDialog>
-PrintDialog *PrintDialog::instance()
-{
- static PrintDialog *self = new PrintDialog(mainWindow());
- self->setAttribute(Qt::WA_QuitOnClose, false);
- return self;
-}
-
PrintDialog::PrintDialog(QWidget *parent, Qt::WindowFlags f)
{
// options template (are we storing these in the settings?)
@@ -52,6 +45,7 @@ PrintDialog::PrintDialog(QWidget *parent, Qt::WindowFlags f)
connect(printLayout, SIGNAL(signalProgress(int)), progressBar, SLOT(setValue(int)));
progressBar->setMinimum(0);
progressBar->setMaximum(100);
+ progressBar->setValue(0);
progressBar->setTextVisible(false);
layout->addWidget(progressBar);
@@ -62,12 +56,6 @@ PrintDialog::PrintDialog(QWidget *parent, Qt::WindowFlags f)
setWindowIcon(QIcon(":subsurface-icon"));
}
-void PrintDialog::runDialog()
-{
- progressBar->setValue(0);
- exec();
-}
-
void PrintDialog::previewClicked(void)
{
QPrintPreviewDialog previewDialog(&printer, this);
diff --git a/qt-ui/printdialog.h b/qt-ui/printdialog.h
index 44bb94669..8f5edec72 100644
--- a/qt-ui/printdialog.h
+++ b/qt-ui/printdialog.h
@@ -14,12 +14,10 @@ class PrintDialog : public QDialog {
Q_OBJECT
public:
- static PrintDialog *instance();
- void runDialog();
struct options printOptions;
+ explicit PrintDialog(QWidget *parent = 0, Qt::WindowFlags f = 0);
private:
- explicit PrintDialog(QWidget *parent = 0, Qt::WindowFlags f = 0);
PrintOptions *optionsWidget;
PrintLayout *printLayout;
QProgressBar *progressBar;