Refactoring

Removed PrintReport and PrintPreview slots from mainwindow. Print
actions will instead be directly connected to reultsview.
This commit is contained in:
Blubbz0r 2015-04-18 17:37:13 +02:00
parent 2eb0832ac2
commit 2ffffdfdd8
3 changed files with 16 additions and 27 deletions

View File

@ -77,8 +77,8 @@ MainWindow::MainWindow(TranslationHandler* th, QSettings* settings) :
connect(mLineEditFilter, SIGNAL(textChanged(const QString&)), mFilterTimer, SLOT(start()));
connect(mLineEditFilter, SIGNAL(returnPressed()), this, SLOT(FilterResults()));
connect(mUI.mActionPrint, SIGNAL(triggered()), this, SLOT(PrintReport()));
connect(mUI.mActionPrintPreview, SIGNAL(triggered()), this, SLOT(PrintPreview()));
connect(mUI.mActionPrint, SIGNAL(triggered()), mUI.mResults, SLOT(Print()));
connect(mUI.mActionPrintPreview, SIGNAL(triggered()), mUI.mResults, SLOT(PrintPreview()));
connect(mUI.mActionQuit, SIGNAL(triggered()), this, SLOT(close()));
connect(mUI.mActionCheckFiles, SIGNAL(triggered()), this, SLOT(CheckFiles()));
connect(mUI.mActionCheckDirectory, SIGNAL(triggered()), this, SLOT(CheckDirectory()));
@ -439,16 +439,6 @@ QStringList MainWindow::SelectFilesToCheck(QFileDialog::FileMode mode)
return selected;
}
void MainWindow::PrintReport()
{
mUI.mResults->Print();
}
void MainWindow::PrintPreview()
{
mUI.mResults->PrintPreview();
}
void MainWindow::CheckFiles()
{
DoCheckFiles(SelectFilesToCheck(QFileDialog::ExistingFiles));

View File

@ -72,18 +72,6 @@ public:
public slots:
/**
* @brief Slot opening a print dialog to print the current report
*
*/
void PrintReport();
/**
* @brief Slot opening a print preview dialogPrintPreview
*
*/
void PrintPreview();
/**
* @brief Slot for check files menu item
*

View File

@ -76,9 +76,6 @@ public:
*/
void Save(const QString &filename, Report::Type type) const;
void Print();
void PrintPreview();
/**
* @brief Update tree settings
*
@ -226,8 +223,22 @@ public slots:
*/
void UpdateDetails(const QModelIndex &index);
/**
* @brief Slot opening a print dialog to print the current report
*/
void Print();
/**
* @brief Slot printing the current report to the printer.
* @param printer The printer used for printing the report.
*/
void Print(QPrinter* printer);
/**
* @brief Slot opening a print preview dialog
*/
void PrintPreview();
protected:
/**
* @brief Have any errors been found