From ecf328eecf30ca77db178237d98358f91a5ac06a Mon Sep 17 00:00:00 2001 From: Fred Gleason Date: Mon, 7 Oct 2019 12:18:47 -0400 Subject: [PATCH] 2019-10-07 Fred Gleason * Refactored rdmonitor(1) to use the 'RDDialog' and 'RDWidget' base classes. --- ChangeLog | 3 +++ rdmonitor/rdmonitor.cpp | 30 +++++++++--------------------- rdmonitor/rdmonitor.h | 16 ++++------------ 3 files changed, 16 insertions(+), 33 deletions(-) diff --git a/ChangeLog b/ChangeLog index dd2a5509..0bc073c1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -19154,3 +19154,6 @@ 2019-10-04 Fred Gleason * Refactored rdlogmanager(1) to use the 'RDDialog' and 'RDWidget' base classes. +2019-10-07 Fred Gleason + * Refactored rdmonitor(1) to use the 'RDDialog' and 'RDWidget' + base classes. diff --git a/rdmonitor/rdmonitor.cpp b/rdmonitor/rdmonitor.cpp index 99628a7c..86c1f796 100644 --- a/rdmonitor/rdmonitor.cpp +++ b/rdmonitor/rdmonitor.cpp @@ -2,7 +2,7 @@ // // System Monitor for Rivendell // -// (C) Copyright 2012-2018 Fred Gleason +// (C) Copyright 2012-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 @@ -19,26 +19,15 @@ // #include -#include -#include #include #include -#include -#include #include #include #include -#include -#include #include #include -#include -#include -#include -#include -#include #include #include "rdmonitor.h" @@ -60,9 +49,8 @@ void SigHandler(int signo) } } -MainWidget::MainWidget(QWidget *parent) - : QWidget(parent,(Qt::WindowFlags)(Qt::WStyle_Customize|Qt::WStyle_NoBorder|Qt::WStyle_StaysOnTop)) - // : QWidget(parent,"",(Qt::WindowFlags)(Qt::WStyle_Customize|Qt::WStyle_NoBorder|Qt::WStyle_StaysOnTop|Qt::WX11BypassWM|Qt::WA_AlwaysShowToolTips)) +MainWidget::MainWidget(RDConfig *c,QWidget *parent) + : RDWidget(c,parent,(Qt::WindowFlags)(Qt::WStyle_Customize|Qt::WStyle_NoBorder|Qt::WStyle_StaysOnTop)) { QString str; mon_dialog_x=0; @@ -82,11 +70,9 @@ MainWidget::MainWidget(QWidget *parent) setGeometry(0,0,0,0); // - // Generate Fonts + // Process Fonts // - QFont font=QFont("Helvetica",12,QFont::Bold); - font.setPixelSize(12); - mon_metrics=new QFontMetrics(font); + mon_metrics=new QFontMetrics(font()); // // Create And Set Icon @@ -111,7 +97,7 @@ MainWidget::MainWidget(QWidget *parent) // Name Label // mon_name_label=new QLabel(this); - mon_name_label->setFont(font); + mon_name_label->setFont(labelFont()); // // Status Icons @@ -516,7 +502,9 @@ int main(int argc,char *argv[]) // // Start Event Loop // - MainWidget *w=new MainWidget(); + RDConfig *config=new RDConfig(); + config->load(); + MainWidget *w=new MainWidget(config); a.setMainWidget(w); w->show(); return a.exec(); diff --git a/rdmonitor/rdmonitor.h b/rdmonitor/rdmonitor.h index 694df1c2..bd070e09 100644 --- a/rdmonitor/rdmonitor.h +++ b/rdmonitor/rdmonitor.h @@ -2,7 +2,7 @@ // // System Monitor Applet for Rivendell // -// (C) Copyright 2012-2018 Fred Gleason +// (C) Copyright 2012-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 @@ -22,31 +22,23 @@ #ifndef RDMONITOR_H #define RDMONITOR_H -#include - -#include -#include -#include -#include #include -#include -#include #include #include #include +#include #include "positiondialog.h" -//#include "status_tip.h" #define RDSELECT_WIDTH 400 #define RDSELECT_HEIGHT 300 -class MainWidget : public QWidget +class MainWidget : public RDWidget { Q_OBJECT public: - MainWidget(QWidget *parent=0); + MainWidget(RDConfig *c,QWidget *parent=0); QSizePolicy sizePolicy() const; private slots: