API Documentation
Loading...
Searching...
No Matches
LogView.h
Go to the documentation of this file.
1/*--------------------------------------------------------------------------------------------
2Copyright (c) 2019, NDEVR LLC
3tyler.parke@ndevr.org
4 __ __ ____ _____ __ __ _______
5 | \ | | | __ \ | ___|\ \ / / | __ \
6 | \ | | | | \ \ | |___ \ \ / / | |__) |
7 | . \| | | |__/ / | |___ \ V / | _ /
8 | |\ |_|_____/__|_____|___\_/____| | \ \
9 |__| \__________________________________| \__\
10
11Subject to the terms of the Enterprise+ Agreement, NDEVR hereby grants
12Licensee a limited, non-exclusive, non-transferable, royalty-free license
13(without the right to sublicense) to use the API solely for the purpose of
14Licensee's internal development efforts to develop applications for which
15the API was provided.
16
17The above copyright notice and this permission notice shall be included in all
18copies or substantial portions of the Software.
19
20THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
21INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
22PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
23FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
24OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25DEALINGS IN THE SOFTWARE.
26
27Library: Widgets
28File: LogView
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include "DLLInfo.h"
34#include <NDEVR/LogStream.h>
35#include <QWidget>
36#include <QPointer>
37class QPushButton;
38class QComboBox;
39class QLabel;
40class QProgressBar;
41class QTableView;
42namespace NDEVR
43{
44 class FileChooserDialog;
45 class AsciiFileOutputStream;
46 class LogViewTable;
47 class SortedLogViewTable;
48 class Button;
49 class Toggle;
50 class QCustomLineEdit;
51 class QCustomComboBox;
52 class NDEVR_WIDGETS_API LogView : public QWidget, public LogStream
53 {
54 Q_OBJECT
55 public:
56 LogView(QWidget *parent = nullptr);
57 ~LogView();
58 void showTimes(bool show_times);
59 void showLogConsole(bool show_log_console);
60 QSize sizeHint() const override;
61 QPointer<QProgressBar> createProgressBar(bool auto_hide = true);
62 void attachProgressBar(QPointer<QProgressBar> bar, bool auto_hide = true);
63 void clearLog();
64 void jumpToBottom();
65 void addWidgetToTop(QWidget* widget);
66 bool isAtBottom() const;
67 void changeEvent(QEvent* e) override;
68 void setProgressFormat(const String& format);
69 void resizeEvent(QResizeEvent* size) override;
70 void setDetectNewLines(bool detect);
71 void setProgress(fltp04 progress) final override;
72 void addMessage(const LogMessage& message) final override;
73 void addMessages(const Buffer<LogMessage>& messages) final override;
74 void attach(ProgressInfo* stream) final override;
75 void setMinimumLogLevel(uint01 log_level);
76 signals:
78 private slots:
79 void contextMenu(const QPoint &pos);
80 void updateLog();
81 void setLogFile();
82 void moveSliderToBottom(int, int);
83 void selected();
84 void updateSearch();
85 private:
86 void createMessageTable();
87 void allowCancel(bool) final override {}
88
89 protected:
94 QTableView* m_message_view;
109 };
110}
#define NDEVR_WIDGETS_API
Definition DLLInfo.h:81
A LogStream that attached to a log, writes messages directly to a specified ascii file.
Definition AsciiFileOutputStream.h:45
The equivelent of std::vector but with a bit more control. The basic array unit of the library.
Definition Buffer.hpp:59
Definition Button.h:60
Definition FileChooserDialog.h:68
A class that allows for specific log information to be conveyed to a ProgressInfo object.
Definition LogMessage.h:44
A class that listens to a log object and processes the updates in a specified way....
Definition LogStream.h:46
Definition LogView.h:53
Toggle * m_show_micro_seconds
Definition LogView.h:103
bool m_auto_scroll_to_bottom
Definition LogView.h:108
Buffer< bool > m_progress_auto_hide
Definition LogView.h:98
QTableView * m_message_view
Definition LogView.h:94
void requestUpdateLogSignal()
fltp04 m_progress
Definition LogView.h:104
QCustomLineEdit * m_search_show_span
Definition LogView.h:91
Buffer< LogMessage > m_pending_messages
Definition LogView.h:99
FileChooserDialog * m_file_chooser
Definition LogView.h:100
SortedLogViewTable * m_sorted_table
Definition LogView.h:96
bool m_show_log_console
Definition LogView.h:107
QCustomComboBox * m_log_level
Definition LogView.h:92
Button * m_save_button
Definition LogView.h:90
LogViewTable * m_message_table
Definition LogView.h:95
QCustomLineEdit * m_search_edit
Definition LogView.h:93
Time m_last_scroll_time
Definition LogView.h:102
AsciiFileOutputStream * m_ascii_stream
Definition LogView.h:101
bool m_show_times
Definition LogView.h:106
Buffer< QPointer< QProgressBar > > m_progress_bars
Definition LogView.h:97
bool m_update_messages
Definition LogView.h:105
Definition LogTable.h:41
A light-weight base class for Log that allows processes to update, without the need for.
Definition ProgressInfo.hpp:48
Definition QCustomCombobox.h:47
Definition QCustomLineEdit.h:118
Definition LogTable.h:72
The core String class for the software.
Definition String.h:47
Represents a timestamp with utilities for manipulation and conversion.
Definition Time.h:54
Definition Toggle.h:45
Definition ACIColor.h:37
float fltp04
Defines an alias representing a 4 byte floating-point number.
Definition BaseValues.hpp:152
uint8_t uint01
-Defines an alias representing a 1 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:93