2021-03-25 05:00:19 -07:00
|
|
|
#ifndef ALERT_H
|
|
|
|
#define ALERT_H
|
|
|
|
|
|
|
|
#include <QWidget>
|
|
|
|
#include <iostream>
|
|
|
|
#include <fstream>
|
2021-04-02 10:42:00 -07:00
|
|
|
#include <QFile>
|
|
|
|
#include <QTextStream>
|
2021-03-25 05:00:19 -07:00
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
class alert;
|
|
|
|
}
|
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
class alert : public QWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit alert(QWidget *parent = nullptr);
|
|
|
|
~alert();
|
|
|
|
void string_writeconfig(string file, string config_option) {
|
|
|
|
ofstream fhandler;
|
|
|
|
fhandler.open(file);
|
|
|
|
fhandler << config_option;
|
|
|
|
fhandler.close();
|
|
|
|
}
|
2021-04-02 10:42:00 -07:00
|
|
|
bool checkconfig(QString file) {
|
|
|
|
QFile config(file);
|
|
|
|
config.open(QIODevice::ReadOnly);
|
|
|
|
QTextStream in (&config);
|
|
|
|
const QString content = in.readAll();
|
|
|
|
string contentstr = content.toStdString();
|
|
|
|
if(contentstr.find("true") != std::string::npos) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
config.close();
|
|
|
|
};
|
2021-03-25 05:00:19 -07:00
|
|
|
|
|
|
|
private slots:
|
|
|
|
void on_continueBtn_clicked();
|
|
|
|
|
|
|
|
void on_resetBtn_clicked();
|
|
|
|
|
2021-04-02 10:42:00 -07:00
|
|
|
void on_continue2Btn_clicked();
|
|
|
|
|
2021-03-25 05:00:19 -07:00
|
|
|
private:
|
|
|
|
Ui::alert *ui;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // ALERT_H
|