2019-10-04 Fred Gleason <fredg@paravelsystems.com>

* Refactored rdlogmanager(1) to use the 'RDDialog' and 'RDWidget'
	base classes.
This commit is contained in:
Fred Gleason
2019-10-04 19:49:15 -04:00
parent 36b8e0020e
commit 6f0fb28c27
50 changed files with 936 additions and 1202 deletions

View File

@@ -2,7 +2,7 @@
//
// Select a Set of Dates for a Rivendell Report
//
// (C) Copyright 2002-2018 Fred Gleason <fredg@paravelsystems.com>
// (C) Copyright 2002-2019 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
@@ -19,12 +19,9 @@
//
#include <qpushbutton.h>
#include <qlabel.h>
#include <qmessagebox.h>
#include <qfile.h>
#include <rddb.h>
#include <rdapplication.h>
#include <rddatedialog.h>
#include <rddatedecode.h>
#include <rdescape_string.h>
@@ -34,32 +31,20 @@
#include "pick_report_dates.h"
PickReportDates::PickReportDates(const QString &svcname,QWidget *parent)
: QDialog(parent)
: RDDialog(parent)
{
setModal(true);
QString sql;
RDSqlQuery *q;
QDate yesterday_date=QDate::currentDate().addDays(-1);
edit_svcname=svcname;
setWindowTitle("RDLogManager - "+tr("Select Report Dates"));
//
// Fix the Window Size
//
setMaximumWidth(sizeHint().width());
setMaximumHeight(sizeHint().height());
setMinimumWidth(sizeHint().width());
setMinimumHeight(sizeHint().height());
//
// Create Fonts
//
QFont bold_font=QFont("Helvetica",12,QFont::Bold);
bold_font.setPixelSize(12);
QFont font=QFont("Helvetica",12,QFont::Normal);
font.setPixelSize(12);
setMaximumSize(sizeHint());
setMinimumSize(sizeHint());
//
// Report List
@@ -68,7 +53,7 @@ PickReportDates::PickReportDates(const QString &svcname,QWidget *parent)
edit_report_box->setGeometry(75,11,sizeHint().width()-85,19);
QLabel *label=new QLabel(edit_report_box,tr("&Report:"),this);
label->setGeometry(10,11,60,19);
label->setFont(bold_font);
label->setFont(labelFont());
label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
sql=QString("select REPORT_NAME from REPORT_SERVICES where ")+
"SERVICE_NAME=\""+RDEscapeString(svcname)+"\" "+
@@ -82,32 +67,34 @@ PickReportDates::PickReportDates(const QString &svcname,QWidget *parent)
//
// Start Date
//
edit_startdate_edit=new Q3DateEdit(this);
edit_startdate_edit=new QDateEdit(this);
edit_startdate_edit->setGeometry(150,35,100,22);
edit_startdate_edit->setDisplayFormat("MM/dd/yyyy");
edit_startdate_edit->setDate(yesterday_date);
label=new QLabel(edit_startdate_edit,tr("&Start Date:"),this);
label->setGeometry(75,36,70,19);
label->setFont(bold_font);
label->setFont(labelFont());
label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
QPushButton *button=new QPushButton(this);
button->setGeometry(260,33,50,27);
button->setFont(font);
button->setFont(subButtonFont());
button->setText(tr("&Select"));
connect(button,SIGNAL(clicked()),this,SLOT(selectStartDateData()));
//
// End Date
//
edit_enddate_edit=new Q3DateEdit(this);
edit_enddate_edit=new QDateEdit(this);
edit_enddate_edit->setGeometry(150,65,100,22);
edit_enddate_edit->setDisplayFormat("MM/dd/yyyy");
edit_enddate_edit->setDate(yesterday_date);
label=new QLabel(edit_enddate_edit,tr("&End Date:"),this);
label->setGeometry(75,66,70,19);
label->setFont(bold_font);
label->setFont(labelFont());
label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
button=new QPushButton(this);
button->setGeometry(260,63,50,27);
button->setFont(font);
button->setFont(subButtonFont());
button->setText(tr("&Select"));
connect(button,SIGNAL(clicked()),this,SLOT(selectEndDateData()));
@@ -116,7 +103,7 @@ PickReportDates::PickReportDates(const QString &svcname,QWidget *parent)
//
button=new QPushButton(this);
button->setGeometry(10,sizeHint().height()-60,80,50);
button->setFont(bold_font);
button->setFont(buttonFont());
button->setText(tr("&Generate\nReport"));
connect(button,SIGNAL(clicked()),this,SLOT(generateData()));
@@ -126,7 +113,7 @@ PickReportDates::PickReportDates(const QString &svcname,QWidget *parent)
button=new QPushButton(this);
button->setGeometry(sizeHint().width()-90,sizeHint().height()-60,80,50);
button->setDefault(true);
button->setFont(bold_font);
button->setFont(buttonFont());
button->setText(tr("C&lose"));
connect(button,SIGNAL(clicked()),this,SLOT(closeData()));
}