mirror of
https://github.com/Snigdha-OS/snigdhaos-blackbox.git
synced 2025-09-21 12:05:02 +02:00
🔨 refactor(og): ongoing building
This commit is contained in:
@@ -3,4 +3,5 @@
|
|||||||
# Github credential config
|
# Github credential config
|
||||||
|
|
||||||
git config --global user.email "m.eshanized@gmail.com"
|
git config --global user.email "m.eshanized@gmail.com"
|
||||||
git config --global user.name "Eshan Roy"
|
git config --global user.name "Eshan Roy"
|
||||||
|
|
||||||
|
@@ -9,10 +9,37 @@ SnigdhaOSBlackBox::SnigdhaOSBlackBox(QWidget *parent, Qstring state)
|
|||||||
{
|
{
|
||||||
this->setWindowIcon(QIcon("/usr/share/pixmaps/snigdhaos-blackbox.svg"));
|
this->setWindowIcon(QIcon("/usr/share/pixmaps/snigdhaos-blackbox.svg"));
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
this->setWindowFlags(this->WindowFlags() & -Qt::WindowCloseButtonHint)
|
this->setWindowFlags(this->WindowFlags() & -Qt::WindowCloseButtonHint);
|
||||||
|
executable_modify_date = QFileInfo(QCoreApplication::applicationFilePath()).lastModified();
|
||||||
|
updateState(state);
|
||||||
}
|
}
|
||||||
|
//destructor for Snigdha OS Blackbox class
|
||||||
|
|
||||||
SnigdhaOSBlackBox::~SnigdhaOSBlackBox()
|
SnigdhaOSBlackBox::~SnigdhaOSBlackBox()
|
||||||
{
|
{
|
||||||
delete ui;
|
delete ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SnigdhaOSBlackbox::doInternetUpRequest(){
|
||||||
|
QNetworkAccessManager* = network_manager = new QNetworkAccessManager();
|
||||||
|
auto network_reply = network_manager->head(QNetworkRequest(QString(INTERNET_CHECK_URL)));
|
||||||
|
|
||||||
|
QTimer* timer = new QTimer(this);
|
||||||
|
timer->setSingleShot(true);
|
||||||
|
timer->start(5000); //5 sec
|
||||||
|
|
||||||
|
// if the time is out we will try again
|
||||||
|
connect(timer, QTimer::timeout, this, [this, timer, network_reply, network_manager](){
|
||||||
|
timer->stop();
|
||||||
|
timer->deleteLayer();
|
||||||
|
network_reply->deleteLater();
|
||||||
|
network_manager->deleteLater();
|
||||||
|
|
||||||
|
if (network_reply->error() == network_reply->NoError){
|
||||||
|
updateState(state::UPDATE);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
doInternetUpRequest();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
Reference in New Issue
Block a user