@@ -77,6 +77,8 @@ MainWindow::MainWindow(TranslationHandler* th, QSettings* settings) :
7777 connect (mLineEditFilter , SIGNAL (textChanged (const QString&)), mFilterTimer , SLOT (start ()));
7878 connect (mLineEditFilter , SIGNAL (returnPressed ()), this , SLOT (FilterResults ()));
7979
80+ connect (mUI .mActionPrint , SIGNAL (triggered ()), this , SLOT (PrintReport ()));
81+ connect (mUI .mActionPrintPreview , SIGNAL (triggered ()), this , SLOT (PrintPreview ()));
8082 connect (mUI .mActionQuit , SIGNAL (triggered ()), this , SLOT (close ()));
8183 connect (mUI .mActionCheckFiles , SIGNAL (triggered ()), this , SLOT (CheckFiles ()));
8284 connect (mUI .mActionCheckDirectory , SIGNAL (triggered ()), this , SLOT (CheckDirectory ()));
@@ -134,6 +136,9 @@ MainWindow::MainWindow(TranslationHandler* th, QSettings* settings) :
134136
135137 EnableCheckButtons (true );
136138
139+ mUI .mActionPrint ->setShortcut (QKeySequence::Print);
140+ mUI .mActionPrint ->setEnabled (false );
141+ mUI .mActionPrintPreview ->setEnabled (false );
137142 mUI .mActionClearResults ->setEnabled (false );
138143 mUI .mActionSave ->setEnabled (false );
139144 mUI .mActionRecheck ->setEnabled (false );
@@ -434,6 +439,16 @@ QStringList MainWindow::SelectFilesToCheck(QFileDialog::FileMode mode)
434439 return selected;
435440}
436441
442+ void MainWindow::PrintReport ()
443+ {
444+ mUI .mResults ->Print ();
445+ }
446+
447+ void MainWindow::PrintPreview ()
448+ {
449+ mUI .mResults ->PrintPreview ();
450+ }
451+
437452void MainWindow::CheckFiles ()
438453{
439454 DoCheckFiles (SelectFilesToCheck (QFileDialog::ExistingFiles));
@@ -695,6 +710,8 @@ void MainWindow::CheckDone()
695710 if (mUI .mResults ->HasResults ()) {
696711 mUI .mActionClearResults ->setEnabled (true );
697712 mUI .mActionSave ->setEnabled (true );
713+ mUI .mActionPrint ->setEnabled (true );
714+ mUI .mActionPrintPreview ->setEnabled (true );
698715 }
699716
700717 for (int i = 0 ; i < MaxRecentProjects + 1 ; i++) {
@@ -768,6 +785,8 @@ void MainWindow::ClearResults()
768785 mUI .mResults ->Clear (true );
769786 mUI .mActionClearResults ->setEnabled (false );
770787 mUI .mActionSave ->setEnabled (false );
788+ mUI .mActionPrint ->setEnabled (false );
789+ mUI .mActionPrintPreview ->setEnabled (false );
771790}
772791
773792void MainWindow::OpenResults ()
0 commit comments