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

* Added an 'RDDialog' class.
	* Added an 'RDWidget' class.
	* Refactored rdadmin(1) to use 'RDDialog' and 'RDWidget' base
	classes.
This commit is contained in:
Fred Gleason
2019-10-01 11:17:23 -04:00
parent bfee1c8440
commit f18dacf408
170 changed files with 2949 additions and 3121 deletions

View File

@@ -2,7 +2,7 @@
//
// Edit a Rivendell Replicator
//
// (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
@@ -20,16 +20,6 @@
#include <math.h>
#include <qpushbutton.h>
#include <qpainter.h>
#include <qevent.h>
#include <qmessagebox.h>
#include <qpainter.h>
#include <qdatetime.h>
#include <q3url.h>
//Added by qt3to4:
#include <QLabel>
#include <rdapplication.h>
#include <rdescape_string.h>
#include <rdexport_settings_dialog.h>
@@ -38,7 +28,7 @@
#include "globals.h"
EditReplicator::EditReplicator(const QString &repl_name,QWidget *parent)
: QDialog(parent)
: RDDialog(parent)
{
setModal(true);
@@ -48,24 +38,14 @@ EditReplicator::EditReplicator(const QString &repl_name,QWidget *parent)
//
// Fix the Window Size
//
setMinimumWidth(sizeHint().width());
setMaximumWidth(sizeHint().width());
setMinimumHeight(sizeHint().height());
setMaximumHeight(sizeHint().height());
setMinimumSize(sizeHint());
setMaximumSize(sizeHint());
repl_replicator=new RDReplicator(repl_name);
repl_settings=new RDSettings();
setWindowTitle("RDAdmin - "+tr("Replicator: ")+repl_name);
//
// Create Fonts
//
QFont font=QFont("Helvetica",12,QFont::Bold);
font.setPixelSize(12);
QFont small_font=QFont("Helvetica",12,QFont::Normal);
small_font.setPixelSize(12);
//
// Replicator Name
//
@@ -74,8 +54,8 @@ EditReplicator::EditReplicator(const QString &repl_name,QWidget *parent)
repl_name_edit->setMaxLength(32);
repl_name_edit->setReadOnly(true);
QLabel *repl_name_label=new QLabel(repl_name_edit,tr("Name:"),this);
repl_name_label->setFont(labelFont());
repl_name_label->setGeometry(10,11,90,19);
repl_name_label->setFont(font);
repl_name_label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
//
@@ -86,8 +66,8 @@ EditReplicator::EditReplicator(const QString &repl_name,QWidget *parent)
repl_description_edit->setMaxLength(64);
QLabel *repl_description_label=
new QLabel(repl_description_edit,tr("Description:"),this);
repl_description_label->setFont(labelFont());
repl_description_label->setGeometry(10,33,90,19);
repl_description_label->setFont(font);
repl_description_label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
//
@@ -102,8 +82,8 @@ EditReplicator::EditReplicator(const QString &repl_name,QWidget *parent)
}
}
QLabel *repl_type_label=new QLabel(repl_type_box,tr("Type:"),this);
repl_type_label->setFont(labelFont());
repl_type_label->setGeometry(10,55,90,19);
repl_type_label->setFont(font);
repl_type_label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
//
@@ -122,8 +102,8 @@ EditReplicator::EditReplicator(const QString &repl_name,QWidget *parent)
delete q;
QLabel *repl_station_label=
new QLabel(repl_station_box,tr("Host System:"),this);
repl_station_label->setFont(labelFont());
repl_station_label->setGeometry(10,77,140,19);
repl_station_label->setFont(font);
repl_station_label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
//
@@ -133,8 +113,8 @@ EditReplicator::EditReplicator(const QString &repl_name,QWidget *parent)
repl_url_edit->setGeometry(155,99,335,19);
repl_url_edit->setMaxLength(255);
repl_url_label=new QLabel(repl_url_edit,tr("Audio Upload URL:"),this);
repl_url_label->setFont(labelFont());
repl_url_label->setGeometry(20,99,130,19);
repl_url_label->setFont(font);
repl_url_label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
//
@@ -144,8 +124,8 @@ EditReplicator::EditReplicator(const QString &repl_name,QWidget *parent)
repl_username_edit->setGeometry(225,121,95,19);
repl_username_edit->setMaxLength(64);
repl_username_label=new QLabel(repl_username_edit,tr("Username:"),this);
repl_username_label->setFont(labelFont());
repl_username_label->setGeometry(40,121,180,19);
repl_username_label->setFont(font);
repl_username_label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
//
@@ -156,8 +136,8 @@ EditReplicator::EditReplicator(const QString &repl_name,QWidget *parent)
repl_password_edit->setMaxLength(64);
repl_password_edit->setEchoMode(QLineEdit::Password);
repl_password_label=new QLabel(repl_password_edit,tr("Password:"),this);
repl_password_label->setFont(labelFont());
repl_password_label->setGeometry(320,121,70,19);
repl_password_label->setFont(font);
repl_password_label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
//
@@ -167,12 +147,12 @@ EditReplicator::EditReplicator(const QString &repl_name,QWidget *parent)
repl_format_edit->setGeometry(155,143,285,20);
repl_format_edit->setReadOnly(true);
repl_format_label=new QLabel(repl_format_edit,tr("Upload Format:"),this);
repl_format_label->setFont(labelFont());
repl_format_label->setGeometry(5,143,145,20);
repl_format_label->setFont(font);
repl_format_label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
repl_format_button=new QPushButton(this);
repl_format_button->setGeometry(450,142,40,24);
repl_format_button->setFont(small_font);
repl_format_button->setFont(subButtonFont());
repl_format_button->setText(tr("S&et"));
connect(repl_format_button,SIGNAL(clicked()),this,SLOT(setFormatData()));
@@ -184,8 +164,8 @@ EditReplicator::EditReplicator(const QString &repl_name,QWidget *parent)
repl_normalize_box->setChecked(true);
repl_normalize_check_label=
new QLabel(repl_normalize_box,tr("Normalize"),this);
repl_normalize_check_label->setFont(labelFont());
repl_normalize_check_label->setGeometry(175,165,83,20);
repl_normalize_check_label->setFont(font);
repl_normalize_check_label->setAlignment(Qt::AlignLeft|Qt::AlignVCenter);
connect(repl_normalize_box,SIGNAL(toggled(bool)),
this,SLOT(normalizeCheckData(bool)));
@@ -197,12 +177,12 @@ EditReplicator::EditReplicator(const QString &repl_name,QWidget *parent)
repl_normalize_spin->setGeometry(295,165,40,20);
repl_normalize_spin->setRange(-30,-1);
repl_normalize_label=new QLabel(repl_normalize_spin,tr("Level:"),this);
repl_normalize_label->setFont(labelFont());
repl_normalize_label->setGeometry(245,165,45,20);
repl_normalize_label->setFont(font);
repl_normalize_label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
repl_normalize_unit_label=new QLabel(tr("dBFS"),this);
repl_normalize_unit_label->setFont(labelFont());
repl_normalize_unit_label->setGeometry(340,165,40,20);
repl_normalize_unit_label->setFont(font);
repl_normalize_unit_label->setAlignment(Qt::AlignLeft|Qt::AlignVCenter);
//
@@ -219,7 +199,7 @@ EditReplicator::EditReplicator(const QString &repl_name,QWidget *parent)
QPushButton *ok_button=new QPushButton(this);
ok_button->setGeometry(sizeHint().width()-180,sizeHint().height()-60,80,50);
ok_button->setDefault(true);
ok_button->setFont(font);
ok_button->setFont(buttonFont());
ok_button->setText(tr("&OK"));
connect(ok_button,SIGNAL(clicked()),this,SLOT(okData()));
@@ -229,7 +209,7 @@ EditReplicator::EditReplicator(const QString &repl_name,QWidget *parent)
QPushButton *cancel_button=new QPushButton(this);
cancel_button->setGeometry(sizeHint().width()-90,sizeHint().height()-60,
80,50);
cancel_button->setFont(font);
cancel_button->setFont(buttonFont());
cancel_button->setText(tr("&Cancel"));
connect(cancel_button,SIGNAL(clicked()),this,SLOT(cancelData()));