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

@@ -2,7 +2,7 @@
//
// Select a Rivendell Log
//
// (C) Copyright 2002-2021 Fred Gleason <fredg@paravelsystems.com>
// (C) Copyright 2002-2022 Fred Gleason <fredg@paravelsystems.com>
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2 as
@@ -38,6 +38,9 @@ ListLogs::ListLogs(RDLogPlay *log,QWidget *parent)
list_log=log;
setWindowTitle("RDAirPlay - "+tr("Select Log"));
list_addlog_dialog=new RDAddLog(RDLogFilter::StationFilter,
"RDAirPlay - "+tr("Rename Log"),this);
//
// Filter Widget
//
@@ -181,14 +184,9 @@ void ListLogs::saveAsButtonData()
{
QString logname;
QString svcname=*list_svcname;
RDAddLog *log;
log=new RDAddLog(&logname,&svcname,RDLogFilter::StationFilter,
tr("Rename Log"),this);
if(log->exec()<0) {
delete log;
if(list_addlog_dialog->exec(&logname,&svcname)<0) {
return;
}
delete log;
*list_logname=logname;
*list_svcname=svcname;
done(ListLogs::SaveAs);

View File

@@ -2,7 +2,7 @@
//
// Select a Rivendell Log
//
// (C) Copyright 2002-2021 Fred Gleason <fredg@paravelsystems.com>
// (C) Copyright 2002-2022 Fred Gleason <fredg@paravelsystems.com>
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2 as
@@ -23,6 +23,7 @@
#include <QPushButton>
#include <rdadd_log.h>
#include <rddialog.h>
#include <rdlogfilter.h>
#include <rdloglistmodel.h>
@@ -70,6 +71,7 @@ class ListLogs : public RDDialog
QPushButton *list_cancel_button;
RDLogPlay *list_log;
RDLogLock **list_log_lock;
RDAddLog *list_addlog_dialog;
};