mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-05 10:40:42 +00:00
Shut down GraphView tabs a little more cleanly
This commit is contained in:
parent
924a988769
commit
7eea8ca365
@ -396,15 +396,12 @@ Daily::Daily(QWidget *parent,gGraphView * shared)
|
||||
previous_date=QDate();
|
||||
}
|
||||
|
||||
|
||||
Daily::~Daily()
|
||||
{
|
||||
GraphView->SaveSettings("Daily");
|
||||
// disconnect(sessbar, SIGNAL(toggledSession(Session*)), this, SLOT(doToggleSession(Session*)));
|
||||
|
||||
disconnect(webView,SIGNAL(linkClicked(QUrl)),this,SLOT(Link_clicked(QUrl)));
|
||||
// Save any last minute changes..
|
||||
if (previous_date.isValid())
|
||||
Unload(previous_date);
|
||||
|
||||
// delete splitter;
|
||||
delete ui;
|
||||
@ -412,6 +409,17 @@ Daily::~Daily()
|
||||
delete icon_off;
|
||||
}
|
||||
|
||||
void Daily::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
disconnect(webView,SIGNAL(linkClicked(QUrl)),this,SLOT(Link_clicked(QUrl)));
|
||||
|
||||
if (previous_date.isValid())
|
||||
Unload(previous_date);
|
||||
GraphView->SaveSettings("Daily");
|
||||
QWidget::closeEvent(event);
|
||||
}
|
||||
|
||||
|
||||
void Daily::doToggleSession(Session * sess)
|
||||
{
|
||||
Q_UNUSED(sess)
|
||||
|
@ -79,6 +79,8 @@ public:
|
||||
*/
|
||||
explicit Daily(QWidget *parent, gGraphView *shared);
|
||||
~Daily();
|
||||
void closeEvent(QCloseEvent *);
|
||||
|
||||
/*! \fn ReloadGraphs()
|
||||
\brief Reload all graph information from disk and updates the view.
|
||||
*/
|
||||
|
@ -242,17 +242,20 @@ void MainWindow::closeEvent(QCloseEvent * event)
|
||||
{
|
||||
if (daily) {
|
||||
daily->close();
|
||||
delete daily;
|
||||
daily->deleteLater();
|
||||
// delete daily;
|
||||
}
|
||||
|
||||
if (overview) {
|
||||
overview->close();
|
||||
delete overview;
|
||||
overview->deleteLater();
|
||||
// delete overview;
|
||||
}
|
||||
|
||||
if (oximetry) {
|
||||
oximetry->close();
|
||||
delete oximetry;
|
||||
oximetry->deleteLater();
|
||||
// delete oximetry;
|
||||
}
|
||||
|
||||
// Shutdown and Save the current User profile
|
||||
|
@ -299,13 +299,19 @@ Overview::Overview(QWidget *parent, gGraphView *shared) :
|
||||
}
|
||||
Overview::~Overview()
|
||||
{
|
||||
GraphView->SaveSettings("Overview");//no trans
|
||||
disconnect(this, SLOT(dateStart_currentPageChanged(int, int)));
|
||||
disconnect(this, SLOT(dateEnd_currentPageChanged(int, int)));
|
||||
delete ui;
|
||||
delete icon_on;
|
||||
delete icon_off;
|
||||
}
|
||||
|
||||
void Overview::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
GraphView->SaveSettings("Overview");//no trans
|
||||
disconnect(this, SLOT(dateStart_currentPageChanged(int, int)));
|
||||
disconnect(this, SLOT(dateEnd_currentPageChanged(int, int)));
|
||||
QWidget::closeEvent(event);
|
||||
}
|
||||
|
||||
gGraph *Overview::createGraph(QString name, QString units, YTickerType yttype)
|
||||
{
|
||||
int default_height = PROFILE.appearance->graphHeight();
|
||||
|
@ -39,6 +39,7 @@ class Overview : public QWidget
|
||||
public:
|
||||
explicit Overview(QWidget *parent, gGraphView *shared = nullptr);
|
||||
~Overview();
|
||||
void closeEvent(QCloseEvent *);
|
||||
|
||||
//! \brief Returns Overview gGraphView object containing it's graphs
|
||||
gGraphView *graphView() { return GraphView; }
|
||||
|
@ -1248,10 +1248,16 @@ Oximetry::Oximetry(QWidget *parent, gGraphView *shared) :
|
||||
}
|
||||
|
||||
Oximetry::~Oximetry()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void Oximetry::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
delete oximeter;
|
||||
GraphView->SaveSettings("Oximetry");
|
||||
delete ui;
|
||||
|
||||
QWidget::closeEvent(event);
|
||||
}
|
||||
|
||||
void Oximetry::on_RefreshPortsButton_clicked()
|
||||
|
@ -306,6 +306,7 @@ class Oximetry : public QWidget
|
||||
public:
|
||||
explicit Oximetry(QWidget *parent, gGraphView *shared = nullptr);
|
||||
~Oximetry();
|
||||
void closeEvent(QCloseEvent *);
|
||||
|
||||
//! \brief Calls updateGL to redraw the graphs
|
||||
void RedrawGraphs();
|
||||
|
Loading…
Reference in New Issue
Block a user