Version: 8.3.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 ( 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 }
LogViewer::~LogViewer ( )
virtual

Definition at line 35 of file LogViewer.cxx.

36 {
37 }

Member Function Documentation

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

Reimplemented in ContainerLogViewer.

Definition at line 45 of file LogViewer.cxx.

References gui.CONNECTOR::f().

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

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 }
void LogViewer::setText ( std::string  text)

Definition at line 39 of file LogViewer.cxx.

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

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

Member Data Documentation

std::string LogViewer::_label
protected

Definition at line 37 of file LogViewer.hxx.


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