mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-10-10 16:43:35 +02:00
2018-03-25 Fred Gleason <fredg@paravelsystems.com>
* Added support for notifications to rdclilogedit(1).
This commit is contained in:
@@ -16745,3 +16745,5 @@
|
||||
'make dist' target.
|
||||
2018-03-25 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Added support for notifications to rdlogmanager(1).
|
||||
2018-03-25 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Added support for notifications to rdclilogedit(1).
|
||||
|
@@ -113,7 +113,10 @@ void MainObject::Deletelog(QString logname)
|
||||
RDLog *log=new RDLog(logname);
|
||||
if(log->exists()) {
|
||||
if(TryLock(log_lock,logname)) {
|
||||
if(!log->remove(rda->station(),rda->user(),rda->config())) {
|
||||
if(log->remove(rda->station(),rda->user(),rda->config())) {
|
||||
SendNotification(RDNotification::DeleteAction,log->name());
|
||||
}
|
||||
else {
|
||||
fprintf(stderr,
|
||||
"deletelog: audio deletion error, log not deleted\n");
|
||||
}
|
||||
@@ -406,6 +409,7 @@ void MainObject::Save()
|
||||
edit_log->
|
||||
setModifiedDatetime(QDateTime(QDate::currentDate(),QTime::currentTime()));
|
||||
edit_modified=false;
|
||||
SendNotification(RDNotification::ModifyAction,edit_log->name());
|
||||
}
|
||||
|
||||
|
||||
@@ -437,6 +441,7 @@ void MainObject::Saveas(const QString &logname)
|
||||
delete edit_log;
|
||||
edit_log=log;
|
||||
edit_modified=false;
|
||||
SendNotification(RDNotification::AddAction,edit_log->name());
|
||||
}
|
||||
else {
|
||||
fprintf(stderr,"saveas: log already exists\n");
|
||||
|
@@ -167,6 +167,17 @@ void MainObject::PrintPrompt() const
|
||||
}
|
||||
|
||||
|
||||
void MainObject::SendNotification(RDNotification::Action action,
|
||||
const QString &logname)
|
||||
{
|
||||
RDNotification *notify=new RDNotification(RDNotification::LogType,
|
||||
action,QVariant(logname));
|
||||
rda->ripc()->sendNotification(*notify);
|
||||
qApp->processEvents();
|
||||
delete notify;
|
||||
}
|
||||
|
||||
|
||||
int main(int argc,char *argv[])
|
||||
{
|
||||
QApplication a(argc,argv,false);
|
||||
|
@@ -28,6 +28,7 @@
|
||||
#include <rdlog.h>
|
||||
#include <rdlog_event.h>
|
||||
#include <rdloglock.h>
|
||||
#include <rdnotification.h>
|
||||
|
||||
#define RDCLILOGEDIT_USAGE "[options]\n"
|
||||
|
||||
@@ -73,6 +74,7 @@ class MainObject : public QObject
|
||||
void DispatchCommand(QString cmd);
|
||||
QString ListLine(RDLogEvent *evt,int line) const;
|
||||
void PrintPrompt() const;
|
||||
void SendNotification(RDNotification::Action action,const QString &logname);
|
||||
bool edit_quiet_option;
|
||||
QString edit_accum;
|
||||
bool edit_modified;
|
||||
|
Reference in New Issue
Block a user