From 003971acb6ccd8d9bc2b05eccf006ef8c9aa15ed Mon Sep 17 00:00:00 2001 From: byloveletter Date: Fri, 27 Oct 2017 17:47:53 +0900 Subject: [PATCH] =?UTF-8?q?=EC=97=90=EB=9F=AC=20=EB=B0=9C=EC=83=9D?= =?UTF-8?q?=EC=8B=9C=20=ED=8C=A8=EC=8A=A4=EC=9B=8C=EB=93=9C=20=EC=9D=B8?= =?UTF-8?q?=ED=92=8B=20=EC=9C=88=EB=8F=84=EC=9A=B0=20=EB=B0=8F=20=EC=97=94?= =?UTF-8?q?=EC=A7=80=EB=8B=88=EC=96=B4=EB=A7=81=20=EC=9C=88=EB=8F=84?= =?UTF-8?q?=EC=9A=B0=20=EC=A4=91=EB=B3=B5=20=EC=8B=A4=ED=96=89=20=EB=B0=A9?= =?UTF-8?q?=EC=A7=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/gui/oven_control/configwindow.cpp | 2 +- app/gui/oven_control/ovenstatics.cpp | 9 ++++++--- app/gui/oven_control/ovenstatics.h | 3 +++ app/gui/oven_control/servicepassinputdlg.cpp | 26 ++++++++++++++++++++------ 4 files changed, 30 insertions(+), 10 deletions(-) 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(); -- 2.1.4