From 5ac5d8e60ced79a81502fd993fcf766bfc389e41 Mon Sep 17 00:00:00 2001 From: Fred Gleason Date: Thu, 21 Jul 2016 17:46:55 -0400 Subject: [PATCH] 2016-07-21 Fred Gleason * Added a 'header' command to rdclilogedit(1). --- ChangeLog | 2 ++ utils/rdclilogedit/operations.cpp | 36 +++++++++++++++++++++++++++++-- utils/rdclilogedit/parser.cpp | 5 +++++ utils/rdclilogedit/rdclilogedit.h | 1 + 4 files changed, 42 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index a8fde241..74328dbf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -15360,3 +15360,5 @@ * Refactored rdclilogedit(1) to use synchronous input. 2016-07-21 Fred Gleason * Added a 'new' command to rdclilogedit(1). +2016-07-21 Fred Gleason + * Added a 'header' command to rdclilogedit(1). diff --git a/utils/rdclilogedit/operations.cpp b/utils/rdclilogedit/operations.cpp index a06e8666..750351f6 100644 --- a/utils/rdclilogedit/operations.cpp +++ b/utils/rdclilogedit/operations.cpp @@ -86,6 +86,40 @@ void MainObject::Addtrack(int line) } +void MainObject::Header() const +{ + printf(" Description: %s\n",(const char *)edit_log->description()); + printf(" Service: %s\n",(const char *)edit_log->service()); + if(edit_log->autoRefresh()) { + printf("Auto Refresh: Yes\n"); + } + else { + printf("Auto Refresh: No\n"); + } + if(edit_log->startDate().isNull()) { + printf(" Start Date: None\n"); + } + else { + printf(" Start Date: %s\n", + (const char *)edit_log->startDate().toString("yyyy-MM-dd")); + } + if(edit_log->endDate().isNull()) { + printf(" End Date: None\n"); + } + else { + printf(" End Date: %s\n", + (const char *)edit_log->endDate().toString("yyyy-MM-dd")); + } + if(edit_log->purgeDate().isNull()) { + printf(" Purge Date: None\n"); + } + else { + printf(" Purge Date: %s\n", + (const char *)edit_log->purgeDate().toString("yyyy-MM-dd")); + } +} + + void MainObject::ListLogs() const { QString sql; @@ -102,7 +136,6 @@ void MainObject::ListLogs() const void MainObject::Load(const QString &logname) { - printf("LOAD\n"); if(edit_log!=NULL) { delete edit_log; edit_log=NULL; @@ -382,7 +415,6 @@ void MainObject::Settrans(int line,RDLogLine::TransType type) void MainObject::Unload() { - printf("UNLOAD\n"); if(edit_log!=NULL) { delete edit_log; edit_log=NULL; diff --git a/utils/rdclilogedit/parser.cpp b/utils/rdclilogedit/parser.cpp index 9eb09e85..890f8afa 100644 --- a/utils/rdclilogedit/parser.cpp +++ b/utils/rdclilogedit/parser.cpp @@ -189,6 +189,11 @@ void MainObject::DispatchCommand(QString cmd) processed=true; } + if(verb=="header") { + Header(); + processed=true; + } + if(verb=="list") { List(); processed=true; diff --git a/utils/rdclilogedit/rdclilogedit.h b/utils/rdclilogedit/rdclilogedit.h index 10b84910..850f48e9 100644 --- a/utils/rdclilogedit/rdclilogedit.h +++ b/utils/rdclilogedit/rdclilogedit.h @@ -48,6 +48,7 @@ class MainObject : public QObject void Addchain(int line,const QString &logname); void Addmarker(int line); void Addtrack(int line); + void Header() const; void Help(const QStringList &cmds) const; void ListLogs() const; void Load(const QString &logname);