]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt2/QPrint.C
Some Qt graphics dialog improvements. Yet more work needed :/
[lyx.git] / src / frontends / qt2 / QPrint.C
index 0a0ad259cd279c3c4850cca450d64b9ebb3e35e0..7f6af2bb649ec358b1bd2d2edff1d51bbe8787f3 100644 (file)
 #pragma implementation
 #endif
 
+#include "LyXView.h"
+#include "ControlPrint.h"
+#include "support/lstrings.h"
+#include "gettext.h"
+
+#include "QPrint.h"
+#include "QPrintDialog.h"
+#include "Qt2BC.h"
+
 #include <qlineedit.h>
 #include <qcheckbox.h>
 #include <qradiobutton.h>
 #include <qspinbox.h>
 #include <qpushbutton.h>
-#include "QPrintDialog.h"
-#include "QPrint.h"
-#include "Qt2BC.h"
-#include "gettext.h"
-#include "QtLyXView.h"
-#include "ControlPrint.h"
 
-#include "support/lstrings.h"
+// FIXME FIXME QPrintDialog is getting destructed twice !!!!
  
 typedef Qt2CB<ControlPrint, Qt2DB<QPrintDialog> > base_class;
 
-QPrint::QPrint(ControlPrint & c)
-       : base_class(c, _("Print"))
+QPrint::QPrint()
+       : base_class(_("Print"))
 {
 }
 
@@ -41,7 +42,7 @@ void QPrint::build_dialog()
 {
        dialog_.reset(new QPrintDialog(this));
 
-       bc().setOK(dialog_->printPB); 
+       bc().setOK(dialog_->printPB);
        bc().setCancel(dialog_->closePB);
 }
 
@@ -52,11 +53,11 @@ void QPrint::update_contents()
 
        dialog_->printerED->setText(pp.printer_name.c_str());
        dialog_->fileED->setText(pp.file_name.c_str());
+
        dialog_->printerRB->setChecked(true);
        if (pp.target == PrinterParams::FILE)
                dialog_->fileRB->setChecked(true);
+
        dialog_->reverseCB->setChecked(pp.reverse_order);
 
        QRadioButton * button;
@@ -66,7 +67,7 @@ void QPrint::update_contents()
                case PrinterParams::EVEN: button = dialog_->evenRB; break;
        }
        button->setChecked(true);
+
        // hmmm... maybe a bit weird but maybe not
        // we might just be remembering the last
        // time this was printed.
@@ -74,7 +75,7 @@ void QPrint::update_contents()
                dialog_->fromED->setText(pp.from_page.c_str());
 
                dialog_->toED->setText("");
-               if (pp.to_page) 
+               if (pp.to_page)
                        dialog_->toED->setText(tostr(pp.to_page).c_str());
        } else {
                dialog_->fromED->setText("");
@@ -116,6 +117,6 @@ void QPrint::apply()
                dialog_->reverseCB->isChecked(),
                !dialog_->collateCB->isChecked(),
                strToInt(dialog_->copiesSB->text().latin1()));
+
        controller().params() = pp;
 }