diff --git a/app/gui/oven_control/configwindow.cpp b/app/gui/oven_control/configwindow.cpp index c05a912..93f077e 100644 --- a/app/gui/oven_control/configwindow.cpp +++ b/app/gui/oven_control/configwindow.cpp @@ -47,7 +47,7 @@ ConfigWindow::ConfigWindow(QWidget *parent) : dlg->setModal(true); dlg->showFullScreen(); dlg->raise(); - connect(dlg, SIGNAL(rejected()), SLOT(close())); + connect(dlg, SIGNAL(rejected()), SLOT(deleteLater())); } } diff --git a/app/gui/oven_control/ovenstatics.cpp b/app/gui/oven_control/ovenstatics.cpp index 85b6603..22dc4f8 100644 --- a/app/gui/oven_control/ovenstatics.cpp +++ b/app/gui/oven_control/ovenstatics.cpp @@ -47,6 +47,7 @@ OvenStatistics::OvenStatistics(QObject* parent) :QObject(parent) realdata.d32 = 0; m_bPopupShow = false; m_nLastPopupidx = MAX_ERROR_TYPE_CNT; + m_wndSrvpassdlg = NULL; for(i=0;ishowFullScreen(); - ServicePassInputDlg *w = new ServicePassInputDlg(pParent, NORMAL_SERVICE_PASS_MODE, (errtype > error_type_clrsplit)); - //w->exec(); - connect(dlg, SIGNAL(destroyed(QObject*)), w, SLOT(showFullScreen())); + if(m_wndSrvpassdlg == NULL){ + m_wndSrvpassdlg = new ServicePassInputDlg(pParent, NORMAL_SERVICE_PASS_MODE, (errtype > error_type_clrsplit)); + connect(dlg, SIGNAL(destroyed(QObject*)), m_wndSrvpassdlg, SLOT(showFullScreen())); + connect(m_wndSrvpassdlg, SIGNAL(destroyed(QObject*)), SLOT(setWndPassInputNull())); + } } break; } diff --git a/app/gui/oven_control/ovenstatics.h b/app/gui/oven_control/ovenstatics.h index a144b5e..f7d18c3 100644 --- a/app/gui/oven_control/ovenstatics.h +++ b/app/gui/oven_control/ovenstatics.h @@ -9,6 +9,7 @@ #include "oven.h" #include "servicedata.h" #include "config.h" +#include "servicepassinputdlg.h" #define MAX_MODEL_COUNT 12 @@ -486,6 +487,7 @@ private: bool bNeedErrorClear; bool bDataRefreshed; realtime_data realdata; + ServicePassInputDlg *m_wndSrvpassdlg; explicit OvenStatistics(QObject* parent); ~OvenStatistics(); @@ -509,6 +511,7 @@ public slots: void onDataChanged(); void oneSecTimerFired(void); void onErrorPopupClosed(int erridx); + void setWndPassInputNull(void){m_wndSrvpassdlg = NULL;} signals: void onErrorFired(int erridx); diff --git a/app/gui/oven_control/servicepassinputdlg.cpp b/app/gui/oven_control/servicepassinputdlg.cpp index d27e0d1..48dceb1 100644 --- a/app/gui/oven_control/servicepassinputdlg.cpp +++ b/app/gui/oven_control/servicepassinputdlg.cpp @@ -4,6 +4,7 @@ #include #include "soundplayer.h" #include "udphandler.h" +#include "mainwindow.h" ServicePassInputDlg::ServicePassInputDlg(QWidget *parent, service_pass_type mode, bool sendClrCmd) : @@ -33,10 +34,12 @@ ServicePassInputDlg::ServicePassInputDlg(QWidget *parent, service_pass_type mode ui->keyboardwidget->focusInKeyboard(); m_nMode = mode; m_bSendClrCmd = sendClrCmd; + qDebug() << __func__; } ServicePassInputDlg::~ServicePassInputDlg() { + qDebug() << __func__; delete ui; } @@ -46,12 +49,23 @@ void ServicePassInputDlg::on_ctrBtnOk_clicked() if( QString(m_strInputPass) == QString(NORMAL_PASS_WORD) && m_nMode == NORMAL_SERVICE_PASS_MODE){ qDebug() << this->parentWidget() <parent(); if(m_bSendClrCmd) UdpHandler::getInstance()->set(TG_ERROR_CLEAR,0xCECE); - EngineerMenuWindow *w = new EngineerMenuWindow(this->parentWidget()); - connect(w,SIGNAL(destroyed(QObject*)),this,SLOT(close())); - w->setWindowModality(Qt::WindowModal); - w->showFullScreen(); - w->raise(); - this->hide(); + if(MainWindow::getEngineerMenuWindow()==NULL){ + EngineerMenuWindow *w = new EngineerMenuWindow(this->parentWidget()); + w->setWindowModality(Qt::WindowModal); + w->showFullScreen(); + w->raise(); + hide(); + deleteLater(); + } + else{ + EngineerMenuWindow *w = MainWindow::getEngineerMenuWindow(); + w->killChild(); + w->raise(); + hide(); + deleteLater(); + } + //connect(w,SIGNAL(destroyed(QObject*)),this,SLOT(close())); + } else if(QString(m_strInputPass) == QString(DEMO_PASS_WORD) && m_nMode == DEMO_SERVICE_PASS_MODE){ accept();