diff --git a/app/gui/oven_control/config.cpp b/app/gui/oven_control/config.cpp index 3cc9c43..32ebd25 100644 --- a/app/gui/oven_control/config.cpp +++ b/app/gui/oven_control/config.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include "config.h" #include "configdatetimedlg.h" #include "configlanguagedlg.h" @@ -466,6 +467,20 @@ void Config::applyCurrentConfigLanguage() } } +void Config::allProgramInit() +{ + QProcess process(this); + QStringList args; + process.start("sh -c \"rm -rf /prime/*\""); + if(process.waitForFinished(30000)==true){ + qDebug()<< "All Program Delete Success:"; + sync(); + QProcess reboot; + reboot.start("reboot"); + reboot.waitForFinished(); + } +} + void Config::execConfigWindow(QWidget *parent, Define::ConfigType idx){ QDialog *dlg; QString usbPath = ""; @@ -562,6 +577,7 @@ void Config::execConfigWindow(QWidget *parent, Define::ConfigType idx){ qDebug() << "Process Sound Config Reset"; } else if(idx==config_program_initialize){ + allProgramInit(); qDebug() << "All Program Reset"; } } diff --git a/app/gui/oven_control/config.h b/app/gui/oven_control/config.h index c8d0847..1a5ea63 100644 --- a/app/gui/oven_control/config.h +++ b/app/gui/oven_control/config.h @@ -446,6 +446,7 @@ public: void removeFavorite(Define::ConfigType idx); QString getProductSerial(); void applyCurrentConfigLanguage(); + void allProgramInit(void);