Index: uml.cpp
===================================================================
--- uml.cpp	(revision 1266327)
+++ uml.cpp	(working copy)
@@ -79,6 +79,7 @@
 #include <QtCore/QRegExp>
 #include <QtCore/QTimer>
 #include <QtGui/QClipboard>
+#include <QtGui/QDialogButtonBox>
 #include <QtGui/QSlider>
 #include <QtGui/QToolButton>
 #include <QtGui/QKeyEvent>
@@ -138,6 +139,9 @@
     m_doc = new UMLDoc();
     m_doc->init();
     m_hasBegunMacro = false;
+    m_printSettings = 0;
+    m_printer = new QPrinter;
+    m_printer->setFullPage(true);
 
     readOptionState();
     initActions();
@@ -192,6 +196,7 @@
     delete m_copyTimer;
     delete m_refactoringAssist;
     delete m_pUndoStack;
+    delete m_printer;
 }
 
 /**
@@ -1263,19 +1268,48 @@
     slotFileNew();
 }
 
+bool UMLApp::slotPrintSettings()
+{
+    if (m_printSettings)
+        delete m_printSettings;
+    m_printSettings = new DiagramPrintPage(0, m_doc);
+
+    QDialog *d = new QDialog;
+    QVBoxLayout *layout = new QVBoxLayout; 
+    layout->addWidget(m_printSettings);
+
+    QDialogButtonBox *b = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
+    connect(b, SIGNAL(accepted()), d, SLOT(accept()));
+    connect(b, SIGNAL(rejected()), d, SLOT(reject()));
+    layout->addWidget(b);
+    d->setLayout(layout);
+
+    bool result = d->exec() == QDialog::Accepted;
+
+    // keep settings
+    layout->removeWidget(m_printSettings);
+    m_printSettings->setParent(0);
+
+    delete d;
+    return result;
+}
+
 /**
  * Print preview
  */
 void UMLApp::slotPrintPreview()
 {
-    QPrinter printer;
-    printer.setFullPage(true);
-
     slotStatusMsg(i18n("Print Preview..."));
 
-    QPrintPreviewDialog *preview = new QPrintPreviewDialog(&printer,this);
-    connect(preview, SIGNAL(paintRequested(QPrinter *)), this, SLOT(slotPrintPreviewPaintRequested(QPrinter *)));
-    preview->exec();
+    if(!slotPrintSettings())
+        return;
+
+    QPrintPreviewDialog *preview = new QPrintPreviewDialog(m_printer,this);
+    connect(preview, SIGNAL(paintRequested(QPrinter *)), this, SLOT(slotPrintPreviewPaintRequested(QPrinter *)));
+    preview->exec();
+    delete m_printSettings;
+    m_printSettings = 0;
+    resetStatusMsg();
 }
 
 /**
@@ -1283,9 +1317,7 @@
  */
 void UMLApp::slotPrintPreviewPaintRequested(QPrinter *printer)
 {
-    DiagramPrintPage * selectPage = new DiagramPrintPage(0, m_doc);
-    m_doc->print(printer, selectPage);
-    delete selectPage;
+    m_doc->print(printer, m_printSettings);
 }
 
 /**
@@ -1295,17 +1327,18 @@
 {
     slotStatusMsg(i18n("Printing..."));
 
-    QPrinter printer;
-    printer.setFullPage(true);
+    if(!slotPrintSettings())
+        return;
 
-    DiagramPrintPage * selectPage = new DiagramPrintPage(0, m_doc);
     QPrintDialog *printDialog =
-                  KdePrint::createPrintDialog(&printer, QList<QWidget*>() << selectPage, this);
+                  KdePrint::createPrintDialog(m_printer, QList<QWidget*>() << m_printSettings, this);
     printDialog->setWindowTitle(i18n("Print %1", m_doc->url().prettyUrl()));
 
     if (printDialog->exec()) {
-        m_doc->print(&printer, selectPage);
+        m_doc->print(m_printer, m_printSettings);
     }
+    delete m_printSettings;
+    m_printSettings = 0;
     delete printDialog;
     resetStatusMsg();
 }
Index: uml.h
===================================================================
--- uml.h	(revision 1266327)
+++ uml.h	(working copy)
@@ -33,6 +33,8 @@
 class RefactoringAssistant;
 class XhtmlGenerator;
 class StatusBarToolButton;
+class DiagramPrintPage;
+class QPrinter;
 
 // KDE forward declarations
 class KActionMenu;
@@ -196,6 +198,7 @@
     void slotFileSave();
     bool slotFileSaveAs();
     void slotFileClose();
+    bool slotPrintSettings();
     void slotPrintPreview();
     void slotPrintPreviewPaintRequested(QPrinter *printer);
     void slotFilePrint();
@@ -414,7 +417,8 @@
     StatusBarToolButton* m_pZoomFullSBTB;
     QSlider* m_pZoomSlider;
     QLabel* m_statusBarMessage;
-
+    DiagramPrintPage *m_printSettings;
+    QPrinter *m_printer;
     /**
      * The running XHTML documentation generator. Null when no generation is running.
      */
