Version: 9.16.0
LogViewer Class Reference

#include <LogViewer.hxx>

Inheritance diagram for LogViewer:
Collaboration diagram for LogViewer:

Public Member Functions

 LogViewer (std::string label, QWidget *parent=0)
 
virtual ~LogViewer ()
 
void setText (std::string text)
 
virtual void readFile (std::string fileName)
 

Protected Attributes

std::string _label
 

Detailed Description

Definition at line 27 of file LogViewer.hxx.

Constructor & Destructor Documentation

◆ LogViewer()

LogViewer::LogViewer ( std::string  label,
QWidget parent = 0 
)

Definition at line 26 of file LogViewer.cxx.

27{
28 setupUi(this);
29 _label = label;
30 browser->setLineWrapMode(QTextEdit::NoWrap);
31 browser->setReadOnly(1);
32 connect(pushButton,SIGNAL(clicked()),this, SLOT(close()));
33}
std::string _label
Definition: LogViewer.hxx:37

References _label.

◆ ~LogViewer()

LogViewer::~LogViewer ( )
virtual

Definition at line 35 of file LogViewer.cxx.

36{
37}

Member Function Documentation

◆ readFile()

void LogViewer::readFile ( std::string  fileName)
virtual

Reimplemented in ContainerLogViewer.

Definition at line 45 of file LogViewer.cxx.

46{
47 std::ifstream f(fileName.c_str());
48 std::stringstream hfile;
49 hfile << f.rdbuf();
50 string atext = _label + "\n" + fileName + "\n\n";
51 QString qtext = atext.c_str();
52 browser->setText(qtext + hfile.str().c_str());
53 f.close();
54}

References _label, and gui.CONNECTOR::f().

Referenced by YACS::HMI::GenericGui::onGetContainerLog(), and ContainerLogViewer::readFile().

◆ setText()

void LogViewer::setText ( std::string  text)

Definition at line 39 of file LogViewer.cxx.

40{
41 string atext = _label + "\n\n" + text;
42 browser->setText(atext.c_str());
43}

References _label.

Referenced by YACS::HMI::GenericGui::onGetContainerLog(), YACS::HMI::GenericGui::onGetErrorDetails(), and YACS::HMI::GenericGui::onGetErrorReport().

Member Data Documentation

◆ _label

std::string LogViewer::_label
protected

Definition at line 37 of file LogViewer.hxx.

Referenced by LogViewer(), readFile(), and setText().


The documentation for this class was generated from the following files: