Rivendellaudio/rdlogmanager/svc_rec_dialog.cpp
Deltec Enterprises 4a3106c8dc
Master (#6)
* Fixed bug where wrong ID was used for local maintenance

* Updated ChangeLog

* Added ability to run macros from cart list with "Run Macro" button

* Updated ChangeLog

* Updated translations

* 2018-10-18 Fred Gleason <fredg@paravelsystems.com>
	* Tweaked the position of buttons on the bottom row of the main
	screen of rdlibrary(1).
	* Changed the minimum size of the main screen of rdlibrary to
	850x600.

* 2018-10-18 Fred Gleason <fredg@paravelsystems.com>
	* Fixed a regression in rdmaint(8) that broke cut rehashing.

* 2018-10-19 Fred Gleason <fredg@paravelsystems.com>
	* Added code in the %post and %preun rules in 'rivendell.spec.in'
	to enable and disable the 'rivendell' service.

* 2018-10-19 Fred Gleason <fredg@paravelsystems.com>
	* Modified rdservice(8) to log errors to syslog.
	* Added an rdservice(8) man page.
	* Modified 'systemd/rivendell.service.in' to enable automatic
	start retries.

* 2018-10-19 Fred Gleason <fredg@paravelsystems.com>
	* Fixed a typo that broke generation of the rmlsend(1) man page.

* 2018-10-19 Fred Gleason <fredg@paravelsystems.com>
	* Removed 'build_win32.bat'.
	* Removed all conditional compilation based on 'WIN32'.

* 2018-10-19 Fred Gleason <fredg@paravelsystems.com>
	* Removed check for Win32 installer from 'configure.ac'.
	* Removed win32 clauses from '.pro' files.
2018-10-19 16:52:56 -07:00

133 lines
3.3 KiB
C++

// svc_rec_dialog.cpp
//
// A Services/Reports Management Dialog.
//
// (C) Copyright 2002-2018 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
// published by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public
// License along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
//
#include <qapplication.h>
#include <qwidget.h>
#include <qpushbutton.h>
#include <qrect.h>
#include <qpoint.h>
#include <qpainter.h>
#include <qstring.h>
#include <qmessagebox.h>
#include <qlineedit.h>
#include <qlabel.h>
#include <qsignalmapper.h>
#include <qfile.h>
#include <rdapplication.h>
#include <rddatedecode.h>
#include <rdreport.h>
#include "globals.h"
#include "svc_rec_dialog.h"
//
// Global Classes
//
SvcRecDialog::SvcRecDialog(const QString &svcname,QWidget *parent)
:QDialog(parent)
{
setModal(true);
QFont font;
font=QFont("Helvetica",12,QFont::Bold);
font.setPixelSize(12);
setWindowTitle("RDLogManager - "+svcname+" "+tr("Report Data"));
//
// Datepicker
//
date_picker=new SvcRec(svcname,this);
date_picker->setGeometry(10,10,
date_picker->sizeHint().width(),
date_picker->sizeHint().height());
connect(date_picker,SIGNAL(dateSelected(const QDate &,bool)),
this,SLOT(dateSelectedData(const QDate &,bool)));
//
// Delete Button
//
date_delete_button=new QPushButton(this);
date_delete_button->
setGeometry(10,sizeHint().height()-60,80,50);
date_delete_button->setFont(font);
date_delete_button->setText(tr("&Purge\nData"));
connect(date_delete_button,SIGNAL(clicked()),this,SLOT(deleteData()));
date_delete_button->setEnabled(rda->user()->deleteRec()&&
date_picker->dayActive(date_picker->date().day()));
//
// Close Button
//
QPushButton *button=new QPushButton(this);
button->setGeometry(sizeHint().width()-90,sizeHint().height()-60,80,50);
button->setFont(font);\
button->setText(tr("&Close"));
button->setDefault(true);
connect(button,SIGNAL(clicked()),this,SLOT(closeData()));
}
SvcRecDialog::~SvcRecDialog()
{
}
QSize SvcRecDialog::sizeHint() const
{
return QSize(date_picker->sizeHint().width()+20,
date_picker->sizeHint().height()+85);
}
QSizePolicy SvcRecDialog::sizePolicy() const
{
return QSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed);
}
void SvcRecDialog::dateSelectedData(const QDate &,bool active)
{
date_delete_button->setEnabled(rda->user()->deleteRec()&&
date_picker->dayActive(date_picker->date().day()));
}
void SvcRecDialog::deleteData()
{
if(QMessageBox::question(this,tr("Delete Report Data"),
QString().sprintf("%s %s?",
(const char *)tr("Are you sure you want to delete report data for"),
(const char *)date_picker->date().toString("MM/dd/yyyy")),
QMessageBox::Yes,QMessageBox::No)!=QMessageBox::Yes) {
return;
}
date_picker->deleteDay();
date_delete_button->setDisabled(true);
}
void SvcRecDialog::closeData()
{
done(-1);
}