SDRAngel  4.11.5
Developer docs for <a href="https://github.com/f4exb/sdrangel">SDRangel<\a>, an Open Source Qt5 / OpenGL 3.0+ SDR and signal analyzer frontend to various hardware.
Public Member Functions | Private Slots | Private Attributes | List of all members
DSDStatusTextDialog Class Reference

#include <dsdstatustextdialog.h>

Inherits QDialog.

Public Member Functions

 DSDStatusTextDialog (QWidget *parent=0)
 
 ~DSDStatusTextDialog ()
 
void addLine (const QString &line)
 

Private Slots

void on_clear_clicked ()
 
void on_saveLog_clicked ()
 

Private Attributes

Ui::DSDStatusTextDialog * ui
 
QString m_lastLine
 

Detailed Description

Definition at line 28 of file dsdstatustextdialog.h.

Constructor & Destructor Documentation

◆ DSDStatusTextDialog()

DSDStatusTextDialog::DSDStatusTextDialog ( QWidget *  parent = 0)
explicit

Definition at line 28 of file dsdstatustextdialog.cpp.

References ui.

28  :
29  QDialog(parent),
30  ui(new Ui::DSDStatusTextDialog)
31 {
32  ui->setupUi(this);
33 }
Ui::DSDStatusTextDialog * ui

◆ ~DSDStatusTextDialog()

DSDStatusTextDialog::~DSDStatusTextDialog ( )

Definition at line 35 of file dsdstatustextdialog.cpp.

References ui.

36 {
37  delete ui;
38 }
Ui::DSDStatusTextDialog * ui

Member Function Documentation

◆ addLine()

void DSDStatusTextDialog::addLine ( const QString &  line)

Definition at line 40 of file dsdstatustextdialog.cpp.

References arg(), m_lastLine, and ui.

Referenced by DSDDemodGUI::tick().

41 {
42  if ((line.size() > 0) && (line != m_lastLine))
43  {
44  QDateTime dt = QDateTime::currentDateTime();
45  QString dateStr = dt.toString("HH:mm:ss");
46  QTextCursor cursor = ui->logEdit->textCursor();
47  cursor.movePosition(QTextCursor::End, QTextCursor::MoveAnchor);
48  cursor.insertText(tr("%1 %2\n").arg(dateStr).arg(line));
49  if (ui->pinToLastLine->isChecked()) {
50  ui->logEdit->verticalScrollBar()->setValue(ui->logEdit->verticalScrollBar()->maximum());
51  }
52  m_lastLine = line;
53  }
54 }
Ui::DSDStatusTextDialog * ui
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ on_clear_clicked

void DSDStatusTextDialog::on_clear_clicked ( )
privateslot

Definition at line 56 of file dsdstatustextdialog.cpp.

References ui.

57 {
58  ui->logEdit->clear();
59 }
Ui::DSDStatusTextDialog * ui

◆ on_saveLog_clicked

void DSDStatusTextDialog::on_saveLog_clicked ( )
privateslot

Definition at line 61 of file dsdstatustextdialog.cpp.

References ui.

62 {
63  QString fileName = QFileDialog::getSaveFileName(this,
64  tr("Open log file"), ".", tr("Log files (*.log)"), 0, QFileDialog::DontUseNativeDialog);
65 
66  if (fileName != "")
67  {
68  QFileInfo fileInfo(fileName);
69 
70  if (fileInfo.suffix() != "log") {
71  fileName += ".log";
72  }
73 
74  QFile exportFile(fileName);
75 
76  if (exportFile.open(QIODevice::WriteOnly | QIODevice::Text))
77  {
78  QTextStream outstream(&exportFile);
79  outstream << ui->logEdit->toPlainText();
80  exportFile.close();
81  }
82  else
83  {
84  QMessageBox::information(this, tr("Message"), tr("Cannot open file for writing"));
85  }
86  }
87 
88 }
Ui::DSDStatusTextDialog * ui

Member Data Documentation

◆ m_lastLine

QString DSDStatusTextDialog::m_lastLine
private

Definition at line 39 of file dsdstatustextdialog.h.

Referenced by addLine().

◆ ui

Ui::DSDStatusTextDialog* DSDStatusTextDialog::ui
private

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