diff --git a/ChangeLog b/ChangeLog index 0bc073c1..7268ffe9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -19157,3 +19157,6 @@ 2019-10-07 Fred Gleason * Refactored rdmonitor(1) to use the 'RDDialog' and 'RDWidget' base classes. +2019-10-07 Fred Gleason + * Refactored rdpanel(1) to use the 'RDDialog' and 'RDWidget' + base classes. diff --git a/rdpanel/rdpanel.cpp b/rdpanel/rdpanel.cpp index 91ae220f..a489d937 100644 --- a/rdpanel/rdpanel.cpp +++ b/rdpanel/rdpanel.cpp @@ -2,7 +2,7 @@ // // A Dedicated Cart Wall Utility for Rivendell. // -// (C) Copyright 2002-2018 Fred Gleason +// (C) Copyright 2002-2019 Fred Gleason // // 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(); diff --git a/rdpanel/rdpanel.h b/rdpanel/rdpanel.h index ec7b453e..acf25703 100644 --- a/rdpanel/rdpanel.h +++ b/rdpanel/rdpanel.h @@ -2,7 +2,7 @@ // // A Dedicated Cart Wall Utility for Rivendell. // -// (C) Copyright 2002-2018 Fred Gleason +// (C) Copyright 2002-2019 Fred Gleason // // 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 -#include -#include - #include -#include -#include #include #include +#include // // 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;