mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-07-20 22:48:06 +02:00
2016-07-21 Fred Gleason <fredg@paravelsystems.com>
* Added a 'setcomment' command to rdclilogedit(1). * Added a 'setlabel' command to rdclilogedit(1).
This commit is contained in:
parent
e0f1b180d6
commit
933b318eb1
@ -15346,3 +15346,6 @@
|
||||
* Added a 'addchain' command to rdclilogedit(1).
|
||||
* Added a 'addmarker' command to rdclilogedit(1).
|
||||
* Added a 'addtrack' command to rdclilogedit(1).
|
||||
2016-07-21 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Added a 'setcomment' command to rdclilogedit(1).
|
||||
* Added a 'setlabel' command to rdclilogedit(1).
|
||||
|
@ -28,7 +28,8 @@ void MainObject::Help(const QStringList &cmds) const
|
||||
printf("\n");
|
||||
printf("The following commands are available:\n");
|
||||
printf("?, addcart, addchain, addmarker, addtrack, bye, exit, help, list, listlogs,\n");
|
||||
printf("load, quit, remove, save, saveas, setcart, settime, settrans, unload\n");
|
||||
printf("load, quit, remove, save, saveas, setcart, setcomment, setlabel, settime\n");
|
||||
printf("settrans, unload\n");
|
||||
printf("\n");
|
||||
printf("Enter \"? <cmd-name>\" for specific help.\n");
|
||||
printf("\n");
|
||||
@ -132,6 +133,22 @@ void MainObject::Help(const QStringList &cmds) const
|
||||
printf("\n");
|
||||
processed=true;
|
||||
}
|
||||
if(verb=="setcomment") {
|
||||
printf("\n");
|
||||
printf(" setcomment <line> <str>\n");
|
||||
printf("\n");
|
||||
printf("Set the marker or track event's \"Comment\" field at line <line> to <str>.\n");
|
||||
printf("\n");
|
||||
processed=true;
|
||||
}
|
||||
if(verb=="setlabel") {
|
||||
printf("\n");
|
||||
printf(" setlabel <line> <str>\n");
|
||||
printf("\n");
|
||||
printf("Set the chain-to or marker event's \"Label\" field at line <line> to <str>.\n");
|
||||
printf("\n");
|
||||
processed=true;
|
||||
}
|
||||
if(verb=="settime") {
|
||||
printf("\n");
|
||||
printf(" settime <line> hard|none <time>\n");
|
||||
|
@ -236,6 +236,56 @@ void MainObject::Setcart(int line,unsigned cartnum)
|
||||
}
|
||||
|
||||
|
||||
void MainObject::Setcomment(int line,const QString &str)
|
||||
{
|
||||
if(edit_user->arrangeLog()) {
|
||||
RDLogLine *logline=edit_log_event->logLine(line);
|
||||
if(logline!=NULL) {
|
||||
if((logline->type()==RDLogLine::Marker)||
|
||||
(logline->type()==RDLogLine::Track)) {
|
||||
logline->setMarkerComment(str);
|
||||
edit_log_event->refresh(line);
|
||||
edit_modified=true;
|
||||
}
|
||||
else {
|
||||
fprintf(stderr,"setcomment: incompatible event type\n");
|
||||
}
|
||||
}
|
||||
else {
|
||||
fprintf(stderr,"setcomment: no such line\n");
|
||||
}
|
||||
}
|
||||
else {
|
||||
fprintf(stderr,"setcomment: insufficient privileges [Rearrange Log Items]\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void MainObject::Setlabel(int line,const QString &str)
|
||||
{
|
||||
if(edit_user->arrangeLog()) {
|
||||
RDLogLine *logline=edit_log_event->logLine(line);
|
||||
if(logline!=NULL) {
|
||||
if((logline->type()==RDLogLine::Chain)||
|
||||
(logline->type()==RDLogLine::Marker)) {
|
||||
logline->setMarkerLabel(str);
|
||||
edit_log_event->refresh(line);
|
||||
edit_modified=true;
|
||||
}
|
||||
else {
|
||||
fprintf(stderr,"setlabel: incompatible event type\n");
|
||||
}
|
||||
}
|
||||
else {
|
||||
fprintf(stderr,"setlabel: no such line\n");
|
||||
}
|
||||
}
|
||||
else {
|
||||
fprintf(stderr,"setlabel: insufficient privileges [Rearrange Log Items]\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void MainObject::Settime(int line,RDLogLine::TimeType type,const QTime &time)
|
||||
{
|
||||
edit_log_event->logLine(line)->setTimeType(type);
|
||||
|
@ -339,6 +339,40 @@ void MainObject::DispatchCommand(QString cmd)
|
||||
processed=true;
|
||||
}
|
||||
|
||||
if(verb=="setcomment") {
|
||||
if(cmds.size()>=3) {
|
||||
line=cmds[1].toInt(&ok);
|
||||
if(ok&&(line>=0)&&(line<edit_log_event->size())) {
|
||||
cmds.remove(cmds.begin());
|
||||
cmds.remove(cmds.begin());
|
||||
Setcomment(line,cmds.join(" "));
|
||||
}
|
||||
else {
|
||||
fprintf(stderr,"setcomment: invalid line number\n");
|
||||
}
|
||||
}
|
||||
else {
|
||||
fprintf(stderr,"setcomment: invalid command arguments\n");
|
||||
}
|
||||
processed=true;
|
||||
}
|
||||
|
||||
if(verb=="setlabel") {
|
||||
if(cmds.size()==3) {
|
||||
line=cmds[1].toInt(&ok);
|
||||
if(ok&&(line>=0)&&(line<edit_log_event->size())) {
|
||||
Setlabel(line,cmds[2]);
|
||||
}
|
||||
else {
|
||||
fprintf(stderr,"setlabel: invalid line number\n");
|
||||
}
|
||||
}
|
||||
else {
|
||||
fprintf(stderr,"setlabel: invalid command arguments\n");
|
||||
}
|
||||
processed=true;
|
||||
}
|
||||
|
||||
if(verb=="settime") {
|
||||
if(cmds.size()>=3) {
|
||||
line=cmds[1].toInt(&ok);
|
||||
|
@ -58,6 +58,8 @@ class MainObject : public QObject
|
||||
void Save();
|
||||
void Saveas(const QString &logname);
|
||||
void Setcart(int line,unsigned cartnum);
|
||||
void Setcomment(int line,const QString &str);
|
||||
void Setlabel(int line,const QString &str);
|
||||
void Settime(int line,RDLogLine::TimeType type,const QTime &time=QTime());
|
||||
void Settrans(int line,RDLogLine::TransType type);
|
||||
void Unload();
|
||||
|
Loading…
x
Reference in New Issue
Block a user