2022-03-09 Fred Gleason <fredg@paravelsystems.com>

* Refactored the 'RDAddLog' dialog to allow for instance reuse.

Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
Fred Gleason
2022-03-09 15:42:55 -05:00
parent 0c8acd502a
commit 3a41e13afd
25 changed files with 166 additions and 167 deletions

View File

@@ -175,7 +175,6 @@ EditLog::EditLog(QString *filter,QString *group,QString *schedcode,
connect(edit_startdate_edit,SIGNAL(dateChanged(const QDate &)),
this,SLOT(dateValueChangedData(const QDate &)));
//
// End Date
//
@@ -431,7 +430,6 @@ QSize EditLog::sizeHint() const
}
//int EditLog::exec()
int EditLog::exec(const QString &logname,QStringList *new_logs)
{
QString sql;
@@ -980,9 +978,8 @@ void EditLog::saveasData()
QString err_msg;
if(rda->user()->createLog()) {
log=new RDAddLog(&logname,&svcname,RDLogFilter::UserFilter,
tr("Add Log"),this);
if(log->exec()<0) {
log=new RDAddLog(RDLogFilter::UserFilter,"RDLogEdit",this);
if(log->exec(&logname,&svcname)<0) {
return;
}
if(!RDLog::create(logname,svcname,QDate(),rda->ripc()->user(),&err_msg,
@@ -1073,6 +1070,8 @@ void EditLog::okData()
void EditLog::cancelData()
{
bool ret=false;
if(edit_changed) {
switch(QMessageBox::question(this,
tr("RDLogEdit"),
@@ -1086,6 +1085,7 @@ void EditLog::cancelData()
return;
}
SaveLog();
ret=true;
break;
case QMessageBox::Cancel:
@@ -1100,7 +1100,7 @@ void EditLog::cancelData()
}
delete edit_log_lock;
edit_log_lock=NULL;
done(false);
done(ret);
}