From 179a5c469638d777de36cdfd787c079152936c8f Mon Sep 17 00:00:00 2001 From: Fred Gleason Date: Mon, 21 Jun 2021 11:08:40 -0400 Subject: [PATCH] 2021-06-21 Fred Gleason * Added 'RDMainWindow' to rdlogmanager(1). Signed-off-by: Fred Gleason --- ChangeLog | 2 ++ rdlogmanager/rdlogmanager.cpp | 13 ++++++++++--- rdlogmanager/rdlogmanager.h | 8 ++++++-- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2f0993a7..5be82565 100644 --- a/ChangeLog +++ b/ChangeLog @@ -21942,3 +21942,5 @@ * Added 'RDMainWindow' to rdcartslots(1). 2021-06-21 Fred Gleason * Added 'RDMainWindow' to rdlogin(1). +2021-06-21 Fred Gleason + * Added 'RDMainWindow' to rdlogmanager(1). diff --git a/rdlogmanager/rdlogmanager.cpp b/rdlogmanager/rdlogmanager.cpp index 3dcbeefa..385075cd 100644 --- a/rdlogmanager/rdlogmanager.cpp +++ b/rdlogmanager/rdlogmanager.cpp @@ -39,7 +39,7 @@ QString *clock_filter; bool skip_db_check=false; MainWidget::MainWidget(RDConfig *c,QWidget *parent) - : RDWidget(c,parent) + : RDMainWindow("rdlogmanager",c) { QString err_msg; @@ -146,6 +146,8 @@ MainWidget::MainWidget(RDConfig *c,QWidget *parent) log_close_button->setText(tr("Close")); log_close_button->setDefault(true); connect(log_close_button,SIGNAL(clicked()),this,SLOT(quitMainWidget())); + + loadSettings(true); } @@ -161,6 +163,12 @@ QSizePolicy MainWidget::sizePolicy() const } +void MainWidget::closeEvent(QCloseEvent *e) +{ + quitMainWidget(); +} + + void MainWidget::userData() { // @@ -219,6 +227,7 @@ void MainWidget::reportsData() void MainWidget::quitMainWidget() { + saveSettings(); exit(RDApplication::ExitOk); } @@ -261,8 +270,6 @@ int gui_main(int argc,char *argv[]) RDConfig *config=new RDConfig(); config->load(); MainWidget *w=new MainWidget(config); - w->setGeometry(QRect(QPoint(w->geometry().x(),w->geometry().y()), - w->sizeHint())); w->show(); return a.exec(); } diff --git a/rdlogmanager/rdlogmanager.h b/rdlogmanager/rdlogmanager.h index 5879ed47..7f0349f1 100644 --- a/rdlogmanager/rdlogmanager.h +++ b/rdlogmanager/rdlogmanager.h @@ -25,6 +25,7 @@ #include #include +#include #include #define RDLOGMANAGER_USAGE "[OPTIONS]\n" @@ -39,14 +40,17 @@ extern int RunReportOperation(int argc,char *argv[],const QString &rptname, bool protect_existing,int start_offset, int end_offset); -class MainWidget : public RDWidget +class MainWidget : public RDMainWindow { Q_OBJECT public: MainWidget(RDConfig *c,QWidget *parent=0); QSize sizeHint() const; QSizePolicy sizePolicy() const; - + +protected: + void closeEvent(QCloseEvent *e); + private slots: void userData(); void eventsData();