2021-06-21 Fred Gleason <fredg@paravelsystems.com>

* Added 'RDMainWindow' to rdlogmanager(1).

Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
Fred Gleason
2021-06-21 11:08:40 -04:00
parent d0fc2313f0
commit 179a5c4696
3 changed files with 18 additions and 5 deletions

View File

@@ -21942,3 +21942,5 @@
* Added 'RDMainWindow' to rdcartslots(1). * Added 'RDMainWindow' to rdcartslots(1).
2021-06-21 Fred Gleason <fredg@paravelsystems.com> 2021-06-21 Fred Gleason <fredg@paravelsystems.com>
* Added 'RDMainWindow' to rdlogin(1). * Added 'RDMainWindow' to rdlogin(1).
2021-06-21 Fred Gleason <fredg@paravelsystems.com>
* Added 'RDMainWindow' to rdlogmanager(1).

View File

@@ -39,7 +39,7 @@ QString *clock_filter;
bool skip_db_check=false; bool skip_db_check=false;
MainWidget::MainWidget(RDConfig *c,QWidget *parent) MainWidget::MainWidget(RDConfig *c,QWidget *parent)
: RDWidget(c,parent) : RDMainWindow("rdlogmanager",c)
{ {
QString err_msg; QString err_msg;
@@ -146,6 +146,8 @@ MainWidget::MainWidget(RDConfig *c,QWidget *parent)
log_close_button->setText(tr("Close")); log_close_button->setText(tr("Close"));
log_close_button->setDefault(true); log_close_button->setDefault(true);
connect(log_close_button,SIGNAL(clicked()),this,SLOT(quitMainWidget())); 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() void MainWidget::userData()
{ {
// //
@@ -219,6 +227,7 @@ void MainWidget::reportsData()
void MainWidget::quitMainWidget() void MainWidget::quitMainWidget()
{ {
saveSettings();
exit(RDApplication::ExitOk); exit(RDApplication::ExitOk);
} }
@@ -261,8 +270,6 @@ int gui_main(int argc,char *argv[])
RDConfig *config=new RDConfig(); RDConfig *config=new RDConfig();
config->load(); config->load();
MainWidget *w=new MainWidget(config); MainWidget *w=new MainWidget(config);
w->setGeometry(QRect(QPoint(w->geometry().x(),w->geometry().y()),
w->sizeHint()));
w->show(); w->show();
return a.exec(); return a.exec();
} }

View File

@@ -25,6 +25,7 @@
#include <qpushbutton.h> #include <qpushbutton.h>
#include <rdlog_line.h> #include <rdlog_line.h>
#include <rdmainwindow.h>
#include <rdwidget.h> #include <rdwidget.h>
#define RDLOGMANAGER_USAGE "[OPTIONS]\n" #define RDLOGMANAGER_USAGE "[OPTIONS]\n"
@@ -39,7 +40,7 @@ extern int RunReportOperation(int argc,char *argv[],const QString &rptname,
bool protect_existing,int start_offset, bool protect_existing,int start_offset,
int end_offset); int end_offset);
class MainWidget : public RDWidget class MainWidget : public RDMainWindow
{ {
Q_OBJECT Q_OBJECT
public: public:
@@ -47,6 +48,9 @@ class MainWidget : public RDWidget
QSize sizeHint() const; QSize sizeHint() const;
QSizePolicy sizePolicy() const; QSizePolicy sizePolicy() const;
protected:
void closeEvent(QCloseEvent *e);
private slots: private slots:
void userData(); void userData();
void eventsData(); void eventsData();