3333#include " projectfile.h"
3434#include " project.h"
3535#include " report.h"
36+ #include " logview.h"
3637#include " ../lib/filelister.h"
3738
3839// HTMLHelp is only available in Windows
@@ -45,12 +46,14 @@ MainWindow::MainWindow() :
4546 mSettings(new QSettings(" Cppcheck" , " Cppcheck-GUI" , this )),
4647 mApplications(new ApplicationList(this )),
4748 mTranslation(new TranslationHandler(this )),
48- mLanguages(new QActionGroup(this ))
49+ mLanguages(new QActionGroup(this )),
50+ mLogView(NULL )
4951{
5052 mUI .setupUi (this );
5153 mUI .mResults ->Initialize (mSettings , mApplications );
5254
5355 mThread = new ThreadHandler (this );
56+ mLogView = new LogView (this );
5457
5558 connect (mUI .mActionQuit , SIGNAL (triggered ()), this , SLOT (close ()));
5659 connect (mUI .mActionCheckFiles , SIGNAL (triggered ()), this , SLOT (CheckFiles ()));
@@ -65,6 +68,7 @@ MainWindow::MainWindow() :
6568 connect (mUI .mActionUncheckAll , SIGNAL (triggered ()), this , SLOT (UncheckAll ()));
6669 connect (mUI .mActionCollapseAll , SIGNAL (triggered ()), mUI .mResults , SLOT (CollapseAllResults ()));
6770 connect (mUI .mActionExpandAll , SIGNAL (triggered ()), mUI .mResults , SLOT (ExpandAllResults ()));
71+ connect (mUI .mActionViewLog , SIGNAL (triggered ()), this , SLOT (ShowLogView ()));
6872
6973 connect (mUI .mActionRecheck , SIGNAL (triggered ()), this , SLOT (ReCheck ()));
7074
@@ -114,6 +118,7 @@ MainWindow::MainWindow() :
114118
115119MainWindow::~MainWindow ()
116120{
121+ delete mLogView ;
117122}
118123
119124void MainWindow::CreateLanguageMenuItems ()
@@ -731,3 +736,21 @@ void MainWindow::NewProjectFile()
731736 prj.Edit ();
732737 }
733738}
739+
740+ void MainWindow::ShowLogView ()
741+ {
742+ if (mLogView == NULL )
743+ mLogView = new LogView (this );
744+
745+ mLogView ->show ();
746+ if (!mLogView ->isActiveWindow ())
747+ mLogView ->activateWindow ();
748+ }
749+
750+ void MainWindow::Log (const QString &logline)
751+ {
752+ if (mLogView )
753+ {
754+ mLogView ->AppendLine (logline);
755+ }
756+ }
0 commit comments