2020-12-15 Fred Gleason <fredg@paravelsystems.com>

* Modified rdcastmanager(1) to use the standard log model.

Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
Fred Gleason
2020-12-15 14:06:25 -05:00
parent 355cad9d23
commit 15b4517f55
20 changed files with 54 additions and 711 deletions

View File

@@ -27,7 +27,7 @@
#include "rdlogmodel.h"
RDLogModel::RDLogModel(const QString &logname,QObject *parent)
RDLogModel::RDLogModel(const QString &logname,bool read_only,QObject *parent)
: QAbstractTableModel(parent)
{
d_fms=NULL;
@@ -36,6 +36,7 @@ RDLogModel::RDLogModel(const QString &logname,QObject *parent)
d_start_time_style=RDLogModel::Scheduled;
d_log_name=logname;
d_read_only=read_only;
d_max_id=0;
//
@@ -140,6 +141,9 @@ int RDLogModel::columnCount(const QModelIndex &parent) const
int RDLogModel::rowCount(const QModelIndex &parent) const
{
if(d_read_only) {
return lineCount();
}
return 1+lineCount();
}

View File

@@ -36,7 +36,7 @@ class RDLogModel : public QAbstractTableModel
Q_OBJECT
public:
enum StartTimeStyle {Estimated=0,Scheduled=1};
RDLogModel(const QString &logname,QObject *parent=0);
RDLogModel(const QString &logname,bool read_only,QObject *parent=0);
~RDLogModel();
QPalette palette();
void setPalette(const QPalette &pal);
@@ -46,10 +46,6 @@ class RDLogModel : public QAbstractTableModel
QVariant headerData(int section,Qt::Orientation orient,
int role=Qt::DisplayRole) const;
QVariant data(const QModelIndex &index,int role=Qt::DisplayRole) const;
//
// From RDLogEvent
//
bool exists();
bool exists(int line);
bool exists(const QTime &hard_time,int except_line=-1);
@@ -113,6 +109,7 @@ class RDLogModel : public QAbstractTableModel
QString d_log_name;
QString d_service_name;
int d_max_id;
bool d_read_only;
QList<RDLogLine *> d_log_lines;
};