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

* Refactored rdcartslots(1) to use the 'RDDialog' and 'RDWidget'
	base classes.
This commit is contained in:
Fred Gleason 2019-10-07 16:52:13 -04:00
parent 912f54bf2c
commit e81256bf43
5 changed files with 20 additions and 69 deletions

View File

@ -19184,3 +19184,6 @@
2019-10-07 Fred Gleason <fredg@paravelsystems.com>
* Replaced references to 'helvetica' fonts to use font engine
values in 'lib/'.
2019-10-07 Fred Gleason <fredg@paravelsystems.com>
* Refactored rdcartslots(1) to use the 'RDDialog' and 'RDWidget'
base classes.

View File

@ -2,7 +2,7 @@
//
// Hour Selector widget for RDAirPlay
//
// (C) Copyright 2012-2018 Fred Gleason <fredg@paravelsystems.com>
// (C) Copyright 2012-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
@ -18,19 +18,11 @@
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
//
#include <qsignalmapper.h>
#include "hourselector.h"
HourSelector::HourSelector(QWidget *parent)
: QWidget(parent)
: RDWidget(parent)
{
//
// Fonts
//
QFont font("helvetica",16,QFont::Bold);
font.setPixelSize(16);
//
// Palettes
//
@ -44,7 +36,7 @@ HourSelector::HourSelector(QWidget *parent)
connect(mapper,SIGNAL(mapped(int)),this,SLOT(hourClicked(int)));
for(unsigned i=0;i<24;i++) {
hour_button[i]=new QPushButton(this);
hour_button[i]->setFont(font);
hour_button[i]->setFont(bigButtonFont());
hour_button[i]->setDisabled(true);
mapper->setMapping(hour_button[i],i);
connect(hour_button[i],SIGNAL(clicked()),mapper,SLOT(map()));

View File

@ -2,7 +2,7 @@
//
// Hour Selector widget for RDAirPlay
//
// (C) Copyright 2012-2018 Fred Gleason <fredg@paravelsystems.com>
// (C) Copyright 2012-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
@ -21,16 +21,10 @@
#ifndef HOURSELECTOR_H
#define HOURSELECTOR_H
#include <qwidget.h>
#include <qpushbutton.h>
#include <qtimer.h>
#include <rdairplay_conf.h>
#include <rdlistview.h>
#include <rdlistviewitem.h>
#include <rdlogplay.h>
#include <rdwidget.h>
class HourSelector : public QWidget
class HourSelector : public RDWidget
{
Q_OBJECT
public:

View File

@ -2,7 +2,7 @@
//
// A Dedicated Cart Slot Utility for Rivendell.
//
// (C) Copyright 2012-2018 Fred Gleason <fredg@paravelsystems.com>
// (C) Copyright 2012-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
@ -18,27 +18,10 @@
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
//
#include <stdlib.h>
#include <math.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <signal.h>
#include <qmessagebox.h>
#include <qapplication.h>
#include <qwindowsstyle.h>
#include <qmessagebox.h>
#include <qtranslator.h>
#include <qtextcodec.h>
#include <qpainter.h>
#include <qpixmap.h>
//Added by qt3to4:
#include <QCloseEvent>
#include <QPaintEvent>
#include <dbversion.h>
#include <rd.h>
#include <rdapplication.h>
#include <rddbheartbeat.h>
#include <rdescape_string.h>
#include "rdcartslots.h"
@ -48,18 +31,11 @@
//
#include "../icons/rdcartslots-22x22.xpm"
MainWidget::MainWidget(QWidget *parent)
: QWidget(parent)
MainWidget::MainWidget(RDConfig *c,QWidget *parent)
: RDWidget(c,parent)
{
QString err_msg;
//
// Force a reasonable default font.
//
QFont mfont("helvetica",12,QFont::Normal);
mfont.setPixelSize(12);
qApp->setFont(mfont);
//
// Open the Database
//
@ -261,7 +237,9 @@ int main(int argc,char *argv[])
QTextCodec::locale(),".");
a.installTranslator(&tr);
MainWidget *w=new MainWidget();
RDConfig *config=new RDConfig();
config->load();
MainWidget *w=new MainWidget(config);
a.setMainWidget(w);
w->setGeometry(QRect(QPoint(0,0),w->sizeHint()));
w->show();

View File

@ -2,7 +2,7 @@
//
// A Dedicated Cart Slot Utility for Rivendell.
//
// (C) Copyright 2012-2018 Fred Gleason <fredg@paravelsystems.com>
// (C) Copyright 2012-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
@ -21,24 +21,8 @@
#ifndef RDCARTSLOTS_H
#define RDCARTSLOTS_H
#include <vector>
#include <qwidget.h>
#include <qtimer.h>
#include <qpixmap.h>
#include <rdstereometer.h>
#include <rdcae.h>
#include <rdsystem.h>
#include <rdmacro.h>
#include <rdconfig.h>
#include <rdevent_player.h>
#include <rdcartslot.h>
#include <rdcart_dialog.h>
#include <rdslotdialog.h>
#include <rdcueeditdialog.h>
#include <rdlistsvcs.h>
#include <rdairplay_conf.h>
#include <rdwidget.h>
//
// Settings
@ -47,11 +31,11 @@
#define METER_INTERVAL 50
#define RDCARTSLOTS_USAGE "\n"
class MainWidget : public QWidget
class MainWidget : public RDWidget
{
Q_OBJECT
public:
MainWidget(QWidget *parent=0);
MainWidget(RDConfig *c,QWidget *parent=0);
QSize sizeHint() const;
QSizePolicy sizePolicy() const;