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

* Refactored rdpanel(1) to use the 'RDDialog' and 'RDWidget'
	base classes.
This commit is contained in:
Fred Gleason 2019-10-07 12:48:05 -04:00
parent ecf328eecf
commit 84d4696160
3 changed files with 15 additions and 23 deletions

View File

@ -19157,3 +19157,6 @@
2019-10-07 Fred Gleason <fredg@paravelsystems.com>
* Refactored rdmonitor(1) to use the 'RDDialog' and 'RDWidget'
base classes.
2019-10-07 Fred Gleason <fredg@paravelsystems.com>
* Refactored rdpanel(1) to use the 'RDDialog' and 'RDWidget'
base classes.

View File

@ -2,7 +2,7 @@
//
// A Dedicated Cart Wall Utility for Rivendell.
//
// (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
@ -50,8 +50,8 @@ RDCartDialog *panel_cart_dialog;
//
#include "../icons/rdpanel-22x22.xpm"
MainWidget::MainWidget(QWidget *parent)
: QWidget(parent)
MainWidget::MainWidget(RDConfig *c,QWidget *parent)
: RDWidget(c,parent)
{
QPixmap panel_skin_pixmap;
QString err_msg;
@ -60,18 +60,10 @@ MainWidget::MainWidget(QWidget *parent)
// Fix the Window Size
//
#ifndef RESIZABLE
setMinimumWidth(sizeHint().width());
setMaximumWidth(sizeHint().width());
setMinimumHeight(sizeHint().height());
setMaximumHeight(sizeHint().height());
setMinimumSize(sizeHint());
setMaximumSize(sizeHint());
#endif // RESIZABLE
//
// Generate Fonts
//
QFont button_font=QFont("Helvetica",16,QFont::Bold);
button_font.setPixelSize(16);
//
// Create Icons
//
@ -396,7 +388,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 Wall Utility for Rivendell.
//
// (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
@ -21,15 +21,10 @@
#ifndef RDPANEL_H
#define RDPANEL_H
#include <qwidget.h>
#include <qtimer.h>
#include <qpixmap.h>
#include <rdemptycart.h>
#include <rdevent_player.h>
#include <rdmacro.h>
#include <rdsound_panel.h>
#include <rdstereometer.h>
#include <rdwidget.h>
//
// Settings
@ -40,11 +35,11 @@
#define RDPANEL_PANEL_BUTTON_COLUMNS 9
#define RDPANEL_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;