From 50a9f5cf67368916575d167a5e3535339d5d81a2 Mon Sep 17 00:00:00 2001
From: blastdoor7 <51786421+blastdoor7@users.noreply.github.com>
Date: Sun, 6 Jun 2021 14:45:55 +0000
Subject: [PATCH] extract and delete workers - intro screen minimize / maximize
- partial download / extract cleanup ops
---
src/qt/OSXHideTitleBar.h | 9 +-
src/qt/bitcoin.qrc | 2 +
src/qt/deleteworker.cpp | 25 ++
src/qt/deleteworker.h | 30 ++
src/qt/extractionworker.cpp | 4 +-
src/qt/extractionworker.h | 1 +
src/qt/forms/intro.ui | 459 +++++++++++++++------------
src/qt/intro.cpp | 205 ++++++++++--
src/qt/intro.h | 19 +-
src/qt/iocoingui.cpp | 8 +-
src/qt/res/icons/maximize_white.svg | 11 +
src/qt/res/icons/minimize_white.svg | 10 +
src/quazip/.moc/moc_predefs.h | 374 ----------------------
src/quazip/.moc/moc_quagzipfile.cpp | 90 ------
src/quazip/.moc/moc_quaziodevice.cpp | 90 ------
src/quazip/.moc/moc_quazipfile.cpp | 90 ------
src/quazip/JlCompress.cpp | 6 +-
17 files changed, 556 insertions(+), 877 deletions(-)
create mode 100644 src/qt/deleteworker.cpp
create mode 100644 src/qt/deleteworker.h
create mode 100644 src/qt/res/icons/maximize_white.svg
create mode 100644 src/qt/res/icons/minimize_white.svg
delete mode 100644 src/quazip/.moc/moc_predefs.h
delete mode 100644 src/quazip/.moc/moc_quagzipfile.cpp
delete mode 100644 src/quazip/.moc/moc_quaziodevice.cpp
delete mode 100644 src/quazip/.moc/moc_quazipfile.cpp
diff --git a/src/qt/OSXHideTitleBar.h b/src/qt/OSXHideTitleBar.h
index 298ed88b..ad410c4d 100644
--- a/src/qt/OSXHideTitleBar.h
+++ b/src/qt/OSXHideTitleBar.h
@@ -1,8 +1,15 @@
+#ifndef OSXHIDETITLEBAR_H
+#define OSXHIDETITLEBAR_H
+
#include "iocoingui.h"
+
+class IocoinGUI;
+
class OSXHideTitleBar
{
public:
static void HideTitleBar(long winid);
static void min(IocoinGUI*);
-
};
+
+#endif
diff --git a/src/qt/bitcoin.qrc b/src/qt/bitcoin.qrc
index 86b0320b..b8667988 100644
--- a/src/qt/bitcoin.qrc
+++ b/src/qt/bitcoin.qrc
@@ -59,7 +59,9 @@
res/icons/locked.svg
res/icons/unlocked.svg
res/icons/minimize.svg
+ res/icons/minimize_white.svg
res/icons/maximize.svg
+ res/icons/maximize_white.svg
res/icons/close.svg
res/icons/closesplash.svg
res/images/IOC-QT100PX.svg
diff --git a/src/qt/deleteworker.cpp b/src/qt/deleteworker.cpp
new file mode 100644
index 00000000..bd892c40
--- /dev/null
+++ b/src/qt/deleteworker.cpp
@@ -0,0 +1,25 @@
+#include "deleteworker.h"
+#include "JlCompress.h"
+#include
+#include
+#include
+
+void DeleteWorker::init(QFileInfo& f1)
+{
+ QString path = f1.filePath();
+ this->qfi1_= path + "/blk0001.dat";
+ this->qfi2_= path + "/txleveldb";
+ std::cout << "file " << (this->qfi1_).toStdString() << std::endl;
+ std::cout << "dir " << (this->qfi2_).toStdString() << std::endl;
+}
+void DeleteWorker::removeFiles()
+{
+ QFile::remove(this->qfi1_);
+
+ //QDir txdbDir((this->qfi2_).toStdString().c_str());
+ //txdbDir.removeRecursively();
+
+ boost::filesystem::remove_all((this->qfi2_).toStdString().c_str());
+
+ emit completed();
+}
diff --git a/src/qt/deleteworker.h b/src/qt/deleteworker.h
new file mode 100644
index 00000000..f72ebb09
--- /dev/null
+++ b/src/qt/deleteworker.h
@@ -0,0 +1,30 @@
+#ifndef DELETEWORKER_H
+#define DELETEWORKER_H
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+class DeleteWorker : public QObject
+{
+ Q_OBJECT
+ public:
+ DeleteWorker() = default;
+ ~DeleteWorker() = default;
+
+ void init(QFileInfo&);
+ public slots:
+ void removeFiles();
+ signals:
+ void completed();
+
+ private:
+ QString qfi1_;
+ QString qfi2_;
+};
+
+#endif
diff --git a/src/qt/extractionworker.cpp b/src/qt/extractionworker.cpp
index a06b96d0..78b50bf8 100644
--- a/src/qt/extractionworker.cpp
+++ b/src/qt/extractionworker.cpp
@@ -1,6 +1,7 @@
#include "extractionworker.h"
#include "JlCompress.h"
+extern std::atomic extractionCompleted;
void ExtractionWorker::init(QFileInfo fileDest,QProgressBar* pb)
{
this->qfi_=fileDest;
@@ -8,10 +9,11 @@ void ExtractionWorker::init(QFileInfo fileDest,QProgressBar* pb)
}
void ExtractionWorker::extract()
{
+ extractionCompleted=false;
QStringList zextracted = JlCompress::extractDir(this,this->qfi_.filePath(), this->qfi_.path(),this->pb_);
if(zextracted.isEmpty())
{
-
+ emit extractionempty();
}
emit completed();
diff --git a/src/qt/extractionworker.h b/src/qt/extractionworker.h
index 75c61efd..c58604c7 100644
--- a/src/qt/extractionworker.h
+++ b/src/qt/extractionworker.h
@@ -22,6 +22,7 @@ class ExtractionWorker : public QObject
void progress(int);
void min(int);
void max(int);
+ void extractionempty();
void completed();
private:
diff --git a/src/qt/forms/intro.ui b/src/qt/forms/intro.ui
index 112e02cc..7828b241 100644
--- a/src/qt/forms/intro.ui
+++ b/src/qt/forms/intro.ui
@@ -9,223 +9,284 @@
-
-
-
-
-
-
- Qt::AlignRight
-
-
-
- -
-
-
- Qt::Vertical
-
-
-
- 20
- 00
-
-
-
-
- -
-
-
- Qt::AlignCenter
-
-
- Welcome to your wallet
-
-
-
- -
-
-
- Qt::Vertical
-
-
-
- 20
- 00
-
-
-
-
- -
-
-
-
-
-
-
-
-
- Qt::AlignCenter|Qt::AlignVCenter
-
-
-
- -
-
-
- Qt::AlignCenter
-
-
- I/O Coin
-
-
-
-
-
- -
-
-
-
-
-
- Qt::AlignCenter
-
-
- New / Import wallet
-
-
-
- -
-
-
- Qt::AlignCenter
-
-
- Chosen directory was empty,\n download the bootstrap.dat ?
-
-
-
- -
-
-
- Loaded config initialising core...
-
-
-
- -
-
-
-
- -
-
-
-
-
-
- Qt::Horizontal
-
-
- QSizePolicy::Minimum
-
-
-
- 13
- 20
-
-
-
-
- -
-
-
-
-
+
-
-
+
-
-
+
- Qt::Vertical
+ Qt::Horizontal
+
+
+
+ -
+
+
+ Qt::AlignRight
+
+
+
+ -
+
+
+ Qt::AlignRight
+
+
+
+ -
+
+
+ Qt::AlignRight
-
- QSizePolicy::Expanding
+
+
+
+
+ -
+
+
+ Qt::Vertical
20
- 0
+ 00
-
-
+ -
+
+
+ Qt::AlignCenter
+
+
+ Welcome to your wallet
+
+
+
-
-
-
-
-
-
-
- 0
- 24
-
+
+
+ Qt::Vertical
-
+
- 16777215
- 24
+ 20
+ 00
-
- 24
-
-
- Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop
-
-
-
- -
-
-
-
-
-
-
-
-
- Qt::AlignCenter
-
-
-
- -
-
-
- Qt::AlignCenter
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
- -
-
-
- Qt::Vertical
-
-
-
- 20
- 00
-
-
-
-
-
-
-
-
-
+ -
+
+
-
+
+
-
+
+
+ Qt::AlignCenter|Qt::AlignVCenter
+
+
+
+ -
+
+
+ Qt::AlignCenter
+
+
+ I/O Coin
+
+
+
+
+
+ -
+
+
-
+
+
+ Qt::AlignCenter
+
+
+ New / Import wallet
+
+
+
+ -
+
+
+
-
+
+
+ Qt::AlignLeft
+
+
+ Wallet directory not iniitialzed...
+
+
+
+ -
+
+
+ Qt::AlignLeft
+
+
+ Download bootstrap now ?
+
+
+
+ -
+
+
+ Qt::AlignLeft
+
+
+ or sync from network ?
+
+
+
+
+
+
+ -
+
+
+ Loaded config initialising core...
+
+
+
+ -
+
+
+
+ -
+
+
-
+
+
+ Qt::Horizontal
+
+
+ QSizePolicy::Minimum
+
+
+
+ 13
+ 20
+
+
+
+
+ -
+
+
-
+
+
-
+
+
-
+
+
+ Qt::Vertical
+
+
+ QSizePolicy::Expanding
+
+
+
+ 20
+ 0
+
+
+
+
+
+
+ -
+
+
-
+
+
+
+ 0
+ 24
+
+
+
+
+ 16777215
+ 24
+
+
+
+ 24
+
+
+ Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop
+
+
+
+ -
+
+
-
+
+
+
+
+
+ Qt::AlignCenter
+
+
+
+ -
+
+
+ Qt::AlignCenter
+
+
+ Cancel
+
+
+
+ -
+
+
+ Qt::AlignCenter
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ -
+
+
+ Qt::Vertical
+
+
+
+ 20
+ 00
+
+
+
+
+
+
+
+
+
diff --git a/src/qt/intro.cpp b/src/qt/intro.cpp
index bfddff5f..3f36898d 100644
--- a/src/qt/intro.cpp
+++ b/src/qt/intro.cpp
@@ -1,4 +1,5 @@
#include "intro.h"
+#include "init.h"
#include "downloader.h"
#include "archiveextractor.h"
#include "ui_intro.h"
@@ -7,6 +8,7 @@
#include "guiconstants.h"
#include "initworker.h"
#include "extractionworker.h"
+#include "deleteworker.h"
#include
#include "JlCompress.h"
#include
@@ -26,6 +28,7 @@
const char* BOOTSTRAP_URL =
"https://iobootstrap.s3.amazonaws.com/bootstrap.zip";
+//"http://localhost/bootstrap/bootstrap.zip";
std::string logoSVG1 =
""
@@ -54,13 +57,19 @@ std::string closeSVG =
" "
" ";
+static std::atomic downloadTerminatedOnClose;
+
+extern std::atomic extractionCompleted;
void initialize(IocoinGUI* obj,QString dir)
{
obj->complete_init(dir);
}
-Intro::Intro(QWidget *parent) :
+Intro::Intro(IocoinGUI* i, QWidget *parent) :
QWidget(parent),
+ iocgui_(i),
+ downloaderQuit(false),
+ downloadFinished(true),
url(BOOTSTRAP_URL),
ui(new Ui::Intro)
{
@@ -100,20 +109,50 @@ Intro::Intro(QWidget *parent) :
ui->logoright->setText(importLabelText);
ui->logoright->setCursor(QCursor(Qt::PointingHandCursor));
+
ui->closeicon->setObjectName("closelabel");
QFile qssFile3(":/icons/closesplash");
qssFile3.open(QFile::ReadOnly);
QString svg = QLatin1String(qssFile3.readAll());
QIcon* closeIc = new QIcon(new SVGIconEngine(svg.toStdString()));
- QIcon* tmp1 = new QIcon(new SVGIconEngine(closeSVG));
- QPixmap closePixmap = tmp1->pixmap(tmp1->actualSize(QSize(30,30)));
+ QPixmap closePixmap = closeIc->pixmap(closeIc->actualSize(QSize(30,30)));
ui->closeicon->setPixmap(closePixmap);
ui->closeicon->setCursor(QCursor(Qt::PointingHandCursor));
- ui->bootstrapdialog->setAttribute(Qt::WA_TranslucentBackground, true);
- ui->bootstrapdialog->setStyleSheet("color:white; font-size: 14pt");
- ui->bootstrapdialog->setText("Chosen wallet directory empty,\n download bootstrap.dat now?");
- ui->bootstrapdialog->setCursor(QCursor(Qt::PointingHandCursor));
- ui->bootstrapdialog->hide();
+
+ ui->maximize->setObjectName("maximize");
+ ui->maximize->setAttribute(Qt::WA_TranslucentBackground, true);
+ QFile qssFileMax(":/icons/maximize_white");
+ qssFileMax.open(QFile::ReadOnly);
+ QString svgMax = QLatin1String(qssFileMax.readAll());
+ QIcon* maxIc = new QIcon(new SVGIconEngine(svgMax.toStdString()));
+ QPixmap maxPixmap = maxIc->pixmap(maxIc->actualSize(QSize(30,30)));
+ ui->maximize->setPixmap(maxPixmap);
+ ui->maximize->setCursor(QCursor(Qt::PointingHandCursor));
+
+ ui->minimize->setObjectName("minimize");
+ ui->minimize->setAttribute(Qt::WA_TranslucentBackground, true);
+ QFile qssFileMin(":/icons/minimize_white");
+ qssFileMin.open(QFile::ReadOnly);
+ QString svgMin = QLatin1String(qssFileMin.readAll());
+ QIcon* minIc = new QIcon(new SVGIconEngine(svgMin.toStdString()));
+ QPixmap minPixmap = minIc->pixmap(minIc->actualSize(QSize(30,30)));
+ ui->minimize->setPixmap(minPixmap);
+ ui->minimize->setCursor(QCursor(Qt::PointingHandCursor));
+
+ connect(ui->minimize,SIGNAL(clicked(bool)),this, SLOT(minimizeApp()));
+ connect(ui->maximize,SIGNAL(clicked(bool)),this, SLOT(maximizeApp()));
+
+ ui->directoryempty->setAttribute(Qt::WA_TranslucentBackground, true);
+ ui->directoryempty1->setAttribute(Qt::WA_TranslucentBackground, true);
+ ui->directoryempty2->setAttribute(Qt::WA_TranslucentBackground, true);
+ ui->directoryempty3->setAttribute(Qt::WA_TranslucentBackground, true);
+ ui->directoryempty2->setCursor(QCursor(Qt::PointingHandCursor));
+ ui->directoryempty3->setCursor(QCursor(Qt::PointingHandCursor));
+ ui->directoryempty->setStyleSheet("color:white; font-size: 14pt; min-width:200px");
+ ui->directoryempty1->setStyleSheet("color:white; font-size: 14pt; min-width:150px");
+ ui->directoryempty2->setStyleSheet("color:white; font-size: 14pt; min-width:150px");
+ ui->directoryempty3->setStyleSheet("color:white; font-size: 14pt; min-width:150px");
+ ui->directoryempty->hide();
ui->next->setCursor(QCursor(Qt::PointingHandCursor));
ui->next->hide();
ui->progressbar->setAttribute(Qt::WA_TranslucentBackground, true);
@@ -123,6 +162,10 @@ Intro::Intro(QWidget *parent) :
ui->next->setStyleSheet("color:white; font-size: 12pt");
ui->progressbar->hide();
ui->remaintime->hide();
+ ui->canceldownload->hide();
+ ui->canceldownload->setAttribute(Qt::WA_TranslucentBackground, true);
+ ui->canceldownload->setCursor(QCursor(Qt::PointingHandCursor));
+ ui->canceldownload->setStyleSheet("color:white; font-size: 12pt");
ui->initializing->hide();
ui->comets->hide();
@@ -130,7 +173,9 @@ Intro::Intro(QWidget *parent) :
ui->progressbar->setRange(0,1000000);
ui->progressbar->setFixedWidth(300);
- connect(ui->bootstrapdialog,SIGNAL(clicked(bool)),this, SLOT(downloadbootstrap()));
+ connect(ui->canceldownload,SIGNAL(clicked(bool)),this, SLOT(cancelDownload()));
+ connect(ui->directoryempty2,SIGNAL(clicked(bool)),this, SLOT(downloadbootstrap()));
+ connect(ui->directoryempty3,SIGNAL(clicked(bool)),this, SLOT(next()));
connect(ui->next,SIGNAL(clicked(bool)),this, SLOT(next()));
connect(ui->logoright,SIGNAL(clicked(bool)),this, SLOT(config()));
connect(ui->closeicon,SIGNAL(clicked(bool)),this, SLOT(closesplash()));
@@ -143,12 +188,58 @@ Intro::Intro(QWidget *parent) :
Intro::~Intro()
{
+ if(extractionCompleted == false && downloadTerminatedOnClose == false)
+ {
+ boost::filesystem::remove(((this->fileBase).filePath().toStdString() + "/blk0001.dat").c_str());
+ boost::filesystem::remove_all(((this->fileBase).filePath().toStdString() + "/txleveldb").c_str());
+ }
+
delete ui;
}
+void Intro::closeEvent(QCloseEvent *event)
+{
+ QMessageBox::StandardButton resBtn = QMessageBox::question( this, "I/O Coin",
+ tr("Cancel wallet load, you sure?"),
+ QMessageBox::Cancel | QMessageBox::Yes,
+ QMessageBox::Cancel);
+
+ if (resBtn == QMessageBox::Cancel)
+ {
+ event->ignore();
+ }
+ else
+ {
+ downloaderQuit = true;
+ if (!downloadFinished)
+ {
+ // Clean-up
+ if(!httpRequestAborted)
+ {
+ if(reply)
+ {
+ reply->abort();
+ }
+ httpRequestAborted = true;
+ }
+ downloaderFinished();
+
+ if(!downloadTerminatedOnClose && thread_->isFinished() == false)
+ {
+ //thread_->quit();
+ //thread_->requestInterruption();
+ thread_->requestInterruption();
+ }
+
+ }
+ uiInterface.QueueShutdown();
+ event->accept();
+ }
+}
+
void Intro::closesplash()
{
- qApp->quit();
+ this->close();
}
void Intro::config()
{
@@ -167,10 +258,11 @@ void Intro::config()
if(!boost::filesystem::exists(selected_directory))
{
boost::filesystem::path p(dir_.toStdString());
+ this->setBase(p.string());
p /= "bootstrap.zip";
this->setDest(p.string());
ui->logoright->hide();
- ui->bootstrapdialog->show();
+ ui->directoryempty->show();
}
else
{
@@ -207,7 +299,6 @@ void Intro::hideall()
ui->logoleft->hide();
ui->logoright->hide();
ui->logolefttext->hide();
- ui->bootstrapdialog->hide();
ui->initializing->hide();
ui->progressbar->hide();
ui->remaintime->hide();
@@ -255,11 +346,19 @@ void Intro::next()
ui->movie->show();
}
+void Intro::directoryemptydialog()
+{
+ ui->directoryempty->show();
+}
+
void Intro::downloadbootstrap()
{
- ui->bootstrapdialog->hide();
+ ui->directoryempty1->hide();
+ ui->directoryempty2->hide();
+ ui->directoryempty3->hide();
ui->progressbar->show();
ui->remaintime->show();
+ ui->canceldownload->show();
startDownload();
}
void Intro::startRequest()
@@ -320,6 +419,7 @@ void Intro::httpReadyRead()
}
void Intro::downloaderFinished()
{
+ if(downloadTerminatedOnClose==true) return;
// Finished with timer
if (downloadTimer->isActive())
{
@@ -351,8 +451,10 @@ void Intro::downloaderFinished()
{
file->remove();
{
+ ui->remaintime->setText("The download was terminated");
QMessageBox::information(this, tr("Downloader"),
tr("Download terminated: %1.").arg(reply->errorString()));
+ downloadTerminatedOnClose=true;
}
}
else
@@ -369,6 +471,7 @@ void Intro::downloaderFinished()
}
else
{
+ ui->canceldownload->hide();
ui->remaintime->setText("bootstrap.zip download successful, extracting...");
ExtractionWorker* worker = new ExtractionWorker();
worker->init(fileDest,ui->progressbar);
@@ -379,6 +482,7 @@ void Intro::downloaderFinished()
connect(worker,SIGNAL(max(int)),ui->progressbar,SLOT(setMaximum(int)));
connect(worker,SIGNAL(progress(int)),ui->progressbar,SLOT(setValue(int)));
connect(worker,SIGNAL(completed()),this,SLOT(extractioncomplete()));
+ connect(worker,SIGNAL(extractionempty()),this,SLOT(extractionempty()));
connect(worker,SIGNAL(completed()),worker,SLOT(deleteLater()));
connect(thread_,SIGNAL(finished()),thread_,SLOT(deleteLater()));
thread_->start();
@@ -390,12 +494,12 @@ void Intro::downloaderFinished()
delete file;
file = 0;
manager = 0;
- downloadFinished = true;
}
void Intro::fileUnzipped()
{
ui->remaintime->hide();
+ ui->canceldownload->hide();
ui->next->show();
ui->next->setText(tr("Successfully extracted. Click to continue..."));
}
@@ -422,14 +526,17 @@ void Intro::timerCheckDownloadProgress()
}
}
void Intro::networkError()
-{
+{
QNetworkReply *reply = static_cast(sender());
qDebug()<<__PRETTY_FUNCTION__<<':'<error();
if (!downloaderQuit)
+ {
cancelDownload();
+ }
}
void Intro::cancelDownload()
{
+ downloaderQuit = true;
if (downloadTimer->isActive())
{
downloadTimer->stop();
@@ -437,18 +544,29 @@ void Intro::cancelDownload()
}
if (!reply->errorString().isEmpty())
- {
- //XXXX ui->statusLabel->setText(tr("The download was canceled.\n\n%1").arg(reply->errorString()));
+ {
+ ui->remaintime->setText(tr("Download was canceled.\n\n%1").arg(reply->errorString()));
}
else
- {
- //XXXX ui->statusLabel->setText(tr("The download was canceled."));
+ {
+ ui->remaintime->setText(tr("Download was canceled."));
}
+
if (reply)
{
reply->abort();
}
httpRequestAborted = true;
+ ui->progressbar->hide();
+ ui->remaintime->hide();
+ ui->canceldownload->hide();
+ ui->directoryempty->show();
+ ui->directoryempty1->show();
+ ui->directoryempty2->show();
+ ui->directoryempty3->show();
+ downloaderQuit=false;
+ downloadFinished=true;
+ downloadTerminatedOnClose=false;
}
void Intro::calculateRemainTime()
{
@@ -503,11 +621,20 @@ void Intro::calculateRemainTime()
else
ui->remaintime->setText(tr("%1 %2 downloading, %3 mins remaining").arg(s, 3, 'f', 1).arg(unit).arg(time.toString("mm:ss")));
}
+void Intro::setBase(std::string dest)
+{
+ QString d = QString::fromStdString(dest);
+ this->setBase(d);
+}
void Intro::setDest(std::string dest)
{
QString d = QString::fromStdString(dest);
this->setDest(d);
}
+void Intro::setBase(QString dest)
+{
+ fileBase = QFileInfo(dest);
+}
void Intro::setDest(QString dest)
{
fileDest = QFileInfo(dest);
@@ -558,6 +685,20 @@ void Intro::startDownload()
downloadFinished = true;
ui->progressbar->setMaximum(100);
ui->progressbar->setValue(100);
+ ui->canceldownload->hide();
+ ui->remaintime->setText("extracting existing bootstrap zip archive...");
+ ExtractionWorker* worker = new ExtractionWorker();
+ worker->init(fileDest,ui->progressbar);
+ thread_ = new QThread();
+ worker->moveToThread(thread_);
+ connect(thread_,SIGNAL(started()),worker,SLOT(extract()));
+ connect(worker,SIGNAL(min(int)),ui->progressbar,SLOT(setMinimum(int)));
+ connect(worker,SIGNAL(max(int)),ui->progressbar,SLOT(setMaximum(int)));
+ connect(worker,SIGNAL(progress(int)),ui->progressbar,SLOT(setValue(int)));
+ connect(worker,SIGNAL(completed()),this,SLOT(extractioncomplete()));
+ connect(worker,SIGNAL(completed()),worker,SLOT(deleteLater()));
+ connect(thread_,SIGNAL(finished()),thread_,SLOT(deleteLater()));
+ thread_->start();
return;
}
}
@@ -591,13 +732,29 @@ void Intro::startDownload()
}
void Intro::extractioncomplete()
{
- ui->remaintime->hide();
- ui->next->show();
- ui->next->setText(tr("Successfully extracted. Click to continue..."));
+ ui->remaintime->hide();
+ ui->next->show();
+ ui->next->setText(tr("Successfully extracted. Click to continue..."));
+ extractionCompleted=true;
+}
+void Intro::extractionempty()
+{
+ extractionCompleted=false;
+}
+void Intro::minimizeApp()
+{
+#ifndef __APPLE__
+ iocgui_->showMinimized();
+#else
+ OSXHideTitleBar::min(iocgui_);
+#endif
}
-void Intro::hidewelcome()
+void Intro::maximizeApp()
{
- //ui->movie->hide();
+ if(!iocgui_->isMaximized())
+ iocgui_->showMaximized();
+ else
+ iocgui_->showNormal();
}
//#https://iobootstrap.s3.amazonaws.com/IOC-BOOTSTRAP-3242602.zip
diff --git a/src/qt/intro.h b/src/qt/intro.h
index d1fca517..0cd11650 100644
--- a/src/qt/intro.h
+++ b/src/qt/intro.h
@@ -9,6 +9,9 @@
#include
#include
#include
+#ifdef __APPLE__
+ #include"OSXHideTitleBar.h"
+#endif
class IocoinGUI;
@@ -16,31 +19,37 @@ namespace Ui {
class Intro;
}
+
//class SplashScreen : public QWidget
class Intro : public QWidget
{
Q_OBJECT
public:
- explicit Intro(QWidget* parent=0);
+ explicit Intro(IocoinGUI*,QWidget* parent=0);
void setPixmap(QPixmap& p) { p_=p; }
~Intro();
void callbackobj(IocoinGUI* obj);
public slots:
- void hidewelcome();
void extractioncomplete();
+ void extractionempty();
void next();
void downloadbootstrap();
+ void directoryemptydialog();
void config();
void closesplash();
void fileUnzipped();
void initModel();
+ void minimizeApp();
+ void maximizeApp();
//bootstrap download handling
void hideall();
+ void setBase(std::string);
void setDest(std::string);
+ void setBase(QString);
void setDest(QString);
void startDownload();
void startRequest();
@@ -52,11 +61,16 @@ class Intro : public QWidget
void cancelDownload();
void calculateRemainTime();
+ protected:
+ void closeEvent(QCloseEvent *event);
+
private:
Ui::Intro* ui;
QPixmap p_;
IocoinGUI* obj;
QString dir_;
+ IocoinGUI* iocgui_;
+
QThread* thread_;
bool httpRequestAborted;
@@ -64,6 +78,7 @@ class Intro : public QWidget
bool downloadFinished;
double currentSpeed;
QUrl url;
+ QFileInfo fileBase;
QFileInfo fileDest;
QTimer *downloadTimer;
QTime downloadTime;
diff --git a/src/qt/iocoingui.cpp b/src/qt/iocoingui.cpp
index 1858469b..03b02537 100644
--- a/src/qt/iocoingui.cpp
+++ b/src/qt/iocoingui.cpp
@@ -298,7 +298,7 @@ IocoinGUI::IocoinGUI(QWidget *parent):
centralWidget = new QStackedWidget(this);
centralWidget->setVisible(false);
- intro = new Intro();
+ intro = new Intro(this);
intro->setWindowFlags(Qt::FramelessWindowHint|Qt::WindowStaysOnTopHint);
intro->callbackobj(this);
intro->hide();
@@ -880,7 +880,7 @@ void IocoinGUI::setNumBlocks(int count, int nTotalBlocks)
progressBar->setFormat(tr("~%n block(s) remaining", "", nRemainingBlocks));
progressBar->setMaximum(nTotalBlocks);
progressBar->setValue(count);
- progressBar->setVisible(true);
+ progressBar->setVisible(false);
}
tooltip = tr("Downloaded %1 of %2 blocks of transaction history (%3% done).").arg(count).arg(nTotalBlocks).arg(nPercentageDone, 0, 'f', 2);
@@ -996,8 +996,8 @@ void IocoinGUI::closeEvent(QCloseEvent *event)
{
QMessageBox::StandardButton resBtn = QMessageBox::question( this, "I/O Coin",
tr("Are you sure?"),
- QMessageBox::Cancel | QMessageBox::No | QMessageBox::Yes,
- QMessageBox::No);
+ QMessageBox::Cancel | QMessageBox::Yes,
+ QMessageBox::Cancel);
if (resBtn != QMessageBox::Yes)
{
event->ignore();
diff --git a/src/qt/res/icons/maximize_white.svg b/src/qt/res/icons/maximize_white.svg
new file mode 100644
index 00000000..96763d6b
--- /dev/null
+++ b/src/qt/res/icons/maximize_white.svg
@@ -0,0 +1,11 @@
+
+
+
diff --git a/src/qt/res/icons/minimize_white.svg b/src/qt/res/icons/minimize_white.svg
new file mode 100644
index 00000000..c99c16d5
--- /dev/null
+++ b/src/qt/res/icons/minimize_white.svg
@@ -0,0 +1,10 @@
+
+
+
diff --git a/src/quazip/.moc/moc_predefs.h b/src/quazip/.moc/moc_predefs.h
deleted file mode 100644
index e5140950..00000000
--- a/src/quazip/.moc/moc_predefs.h
+++ /dev/null
@@ -1,374 +0,0 @@
-#define __DBL_MIN_EXP__ (-1021)
-#define __FLT32X_MAX_EXP__ 1024
-#define __cpp_attributes 200809
-#define __UINT_LEAST16_MAX__ 0xffff
-#define __ATOMIC_ACQUIRE 2
-#define __FLT128_MAX_10_EXP__ 4932
-#define __FLT_MIN__ 1.17549435082228750796873653722224568e-38F
-#define __GCC_IEC_559_COMPLEX 2
-#define __UINT_LEAST8_TYPE__ unsigned char
-#define __SIZEOF_FLOAT80__ 16
-#define __INTMAX_C(c) c ## L
-#define __CHAR_BIT__ 8
-#define __UINT8_MAX__ 0xff
-#define __WINT_MAX__ 0xffffffffU
-#define __FLT32_MIN_EXP__ (-125)
-#define __cpp_static_assert 200410
-#define __ORDER_LITTLE_ENDIAN__ 1234
-#define __SIZE_MAX__ 0xffffffffffffffffUL
-#define __WCHAR_MAX__ 0x7fffffff
-#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1
-#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 1
-#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 1
-#define __DBL_DENORM_MIN__ double(4.94065645841246544176568792868221372e-324L)
-#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 1
-#define __GCC_ATOMIC_CHAR_LOCK_FREE 2
-#define __GCC_IEC_559 2
-#define __FLT32X_DECIMAL_DIG__ 17
-#define __FLT_EVAL_METHOD__ 0
-#define __unix__ 1
-#define __cpp_binary_literals 201304
-#define __FLT64_DECIMAL_DIG__ 17
-#define __GCC_ATOMIC_CHAR32_T_LOCK_FREE 2
-#define __x86_64 1
-#define __cpp_variadic_templates 200704
-#define __UINT_FAST64_MAX__ 0xffffffffffffffffUL
-#define __SIG_ATOMIC_TYPE__ int
-#define __DBL_MIN_10_EXP__ (-307)
-#define __FINITE_MATH_ONLY__ 0
-#define __GNUC_PATCHLEVEL__ 0
-#define __FLT32_HAS_DENORM__ 1
-#define __UINT_FAST8_MAX__ 0xff
-#define __has_include(STR) __has_include__(STR)
-#define __DEC64_MAX_EXP__ 385
-#define __INT8_C(c) c
-#define __INT_LEAST8_WIDTH__ 8
-#define __UINT_LEAST64_MAX__ 0xffffffffffffffffUL
-#define __SHRT_MAX__ 0x7fff
-#define __LDBL_MAX__ 1.18973149535723176502126385303097021e+4932L
-#define __FLT64X_MAX_10_EXP__ 4932
-#define __UINT_LEAST8_MAX__ 0xff
-#define __GCC_ATOMIC_BOOL_LOCK_FREE 2
-#define __FLT128_DENORM_MIN__ 6.47517511943802511092443895822764655e-4966F128
-#define __UINTMAX_TYPE__ long unsigned int
-#define __linux 1
-#define __DEC32_EPSILON__ 1E-6DF
-#define __FLT_EVAL_METHOD_TS_18661_3__ 0
-#define __OPTIMIZE__ 1
-#define __unix 1
-#define __UINT32_MAX__ 0xffffffffU
-#define __GXX_EXPERIMENTAL_CXX0X__ 1
-#define __LDBL_MAX_EXP__ 16384
-#define __FLT128_MIN_EXP__ (-16381)
-#define __WINT_MIN__ 0U
-#define __linux__ 1
-#define __FLT128_MIN_10_EXP__ (-4931)
-#define __INT_LEAST16_WIDTH__ 16
-#define __SCHAR_MAX__ 0x7f
-#define __FLT128_MANT_DIG__ 113
-#define __WCHAR_MIN__ (-__WCHAR_MAX__ - 1)
-#define __INT64_C(c) c ## L
-#define __DBL_DIG__ 15
-#define __GCC_ATOMIC_POINTER_LOCK_FREE 2
-#define __FLT64X_MANT_DIG__ 64
-#define __SIZEOF_INT__ 4
-#define __SIZEOF_POINTER__ 8
-#define __GCC_ATOMIC_CHAR16_T_LOCK_FREE 2
-#define __USER_LABEL_PREFIX__
-#define __FLT64X_EPSILON__ 1.08420217248550443400745280086994171e-19F64x
-#define __STDC_HOSTED__ 1
-#define __LDBL_HAS_INFINITY__ 1
-#define __FLT32_DIG__ 6
-#define __FLT_EPSILON__ 1.19209289550781250000000000000000000e-7F
-#define __GXX_WEAK__ 1
-#define __SHRT_WIDTH__ 16
-#define __LDBL_MIN__ 3.36210314311209350626267781732175260e-4932L
-#define __DEC32_MAX__ 9.999999E96DF
-#define __cpp_threadsafe_static_init 200806
-#define __FLT64X_DENORM_MIN__ 3.64519953188247460252840593361941982e-4951F64x
-#define __FLT32X_HAS_INFINITY__ 1
-#define __INT32_MAX__ 0x7fffffff
-#define __INT_WIDTH__ 32
-#define __SIZEOF_LONG__ 8
-#define __STDC_IEC_559__ 1
-#define __STDC_ISO_10646__ 201706L
-#define __UINT16_C(c) c
-#define __PTRDIFF_WIDTH__ 64
-#define __DECIMAL_DIG__ 21
-#define __FLT64_EPSILON__ 2.22044604925031308084726333618164062e-16F64
-#define __gnu_linux__ 1
-#define __INTMAX_WIDTH__ 64
-#define __FLT64_MIN_EXP__ (-1021)
-#define __has_include_next(STR) __has_include_next__(STR)
-#define __FLT64X_MIN_10_EXP__ (-4931)
-#define __LDBL_HAS_QUIET_NAN__ 1
-#define __FLT64_MANT_DIG__ 53
-#define __GNUC__ 8
-#define __GXX_RTTI 1
-#define __MMX__ 1
-#define __cpp_delegating_constructors 200604
-#define __FLT_HAS_DENORM__ 1
-#define __SIZEOF_LONG_DOUBLE__ 16
-#define __BIGGEST_ALIGNMENT__ 16
-#define __STDC_UTF_16__ 1
-#define __FLT64_MAX_10_EXP__ 308
-#define __FLT32_HAS_INFINITY__ 1
-#define __DBL_MAX__ double(1.79769313486231570814527423731704357e+308L)
-#define __cpp_raw_strings 200710
-#define __INT_FAST32_MAX__ 0x7fffffffffffffffL
-#define __DBL_HAS_INFINITY__ 1
-#define __DEC32_MIN_EXP__ (-94)
-#define __INTPTR_WIDTH__ 64
-#define __FLT32X_HAS_DENORM__ 1
-#define __INT_FAST16_TYPE__ long int
-#define __STRICT_ANSI__ 1
-#define __LDBL_HAS_DENORM__ 1
-#define __cplusplus 201103L
-#define __cpp_ref_qualifiers 200710
-#define __DEC128_MAX__ 9.999999999999999999999999999999999E6144DL
-#define __INT_LEAST32_MAX__ 0x7fffffff
-#define __DEC32_MIN__ 1E-95DF
-#define __DEPRECATED 1
-#define __cpp_rvalue_references 200610
-#define __DBL_MAX_EXP__ 1024
-#define __WCHAR_WIDTH__ 32
-#define __FLT32_MAX__ 3.40282346638528859811704183484516925e+38F32
-#define __DEC128_EPSILON__ 1E-33DL
-#define __SSE2_MATH__ 1
-#define __ATOMIC_HLE_RELEASE 131072
-#define __PTRDIFF_MAX__ 0x7fffffffffffffffL
-#define __amd64 1
-#define __ATOMIC_HLE_ACQUIRE 65536
-#define __FLT32_HAS_QUIET_NAN__ 1
-#define __GNUG__ 8
-#define __LONG_LONG_MAX__ 0x7fffffffffffffffLL
-#define __SIZEOF_SIZE_T__ 8
-#define __cpp_rvalue_reference 200610
-#define __cpp_nsdmi 200809
-#define __FLT64X_MIN_EXP__ (-16381)
-#define __SIZEOF_WINT_T__ 4
-#define __LONG_LONG_WIDTH__ 64
-#define __cpp_initializer_lists 200806
-#define __FLT32_MAX_EXP__ 128
-#define __cpp_hex_float 201603
-#define __GCC_HAVE_DWARF2_CFI_ASM 1
-#define __GXX_ABI_VERSION 1013
-#define __FLT128_HAS_INFINITY__ 1
-#define __FLT_MIN_EXP__ (-125)
-#define __cpp_lambdas 200907
-#define __FLT64X_HAS_QUIET_NAN__ 1
-#define __INT_FAST64_TYPE__ long int
-#define __FLT64_DENORM_MIN__ 4.94065645841246544176568792868221372e-324F64
-#define __DBL_MIN__ double(2.22507385850720138309023271733240406e-308L)
-#define __LP64__ 1
-#define __FLT32X_EPSILON__ 2.22044604925031308084726333618164062e-16F32x
-#define __DECIMAL_BID_FORMAT__ 1
-#define __FLT64_MIN_10_EXP__ (-307)
-#define __FLT64X_DECIMAL_DIG__ 21
-#define __DEC128_MIN__ 1E-6143DL
-#define __REGISTER_PREFIX__
-#define __UINT16_MAX__ 0xffff
-#define __DBL_HAS_DENORM__ 1
-#define __FLT32_MIN__ 1.17549435082228750796873653722224568e-38F32
-#define __UINT8_TYPE__ unsigned char
-#define __FLT_MANT_DIG__ 24
-#define __LDBL_DECIMAL_DIG__ 21
-#define __VERSION__ "8.3.0"
-#define __UINT64_C(c) c ## UL
-#define __cpp_unicode_characters 200704
-#define _STDC_PREDEF_H 1
-#define __GCC_ATOMIC_INT_LOCK_FREE 2
-#define __FLT128_MAX_EXP__ 16384
-#define __FLT32_MANT_DIG__ 24
-#define __FLOAT_WORD_ORDER__ __ORDER_LITTLE_ENDIAN__
-#define __STDC_IEC_559_COMPLEX__ 1
-#define __FLT128_HAS_DENORM__ 1
-#define __FLT128_DIG__ 33
-#define __SCHAR_WIDTH__ 8
-#define __INT32_C(c) c
-#define __DEC64_EPSILON__ 1E-15DD
-#define __ORDER_PDP_ENDIAN__ 3412
-#define __DEC128_MIN_EXP__ (-6142)
-#define __FLT32_MAX_10_EXP__ 38
-#define __INT_FAST32_TYPE__ long int
-#define __UINT_LEAST16_TYPE__ short unsigned int
-#define __FLT64X_HAS_INFINITY__ 1
-#define __INT16_MAX__ 0x7fff
-#define __cpp_rtti 199711
-#define __SIZE_TYPE__ long unsigned int
-#define __UINT64_MAX__ 0xffffffffffffffffUL
-#define __FLT64X_DIG__ 18
-#define __INT8_TYPE__ signed char
-#define __ELF__ 1
-#define __GCC_ASM_FLAG_OUTPUTS__ 1
-#define __FLT_RADIX__ 2
-#define __INT_LEAST16_TYPE__ short int
-#define __LDBL_EPSILON__ 1.08420217248550443400745280086994171e-19L
-#define __UINTMAX_C(c) c ## UL
-#define __k8 1
-#define __SIG_ATOMIC_MAX__ 0x7fffffff
-#define __GCC_ATOMIC_WCHAR_T_LOCK_FREE 2
-#define __SIZEOF_PTRDIFF_T__ 8
-#define __FLT32X_MANT_DIG__ 53
-#define __x86_64__ 1
-#define __FLT32X_MIN_EXP__ (-1021)
-#define __DEC32_SUBNORMAL_MIN__ 0.000001E-95DF
-#define __INT_FAST16_MAX__ 0x7fffffffffffffffL
-#define __FLT64_DIG__ 15
-#define __UINT_FAST32_MAX__ 0xffffffffffffffffUL
-#define __UINT_LEAST64_TYPE__ long unsigned int
-#define __FLT_HAS_QUIET_NAN__ 1
-#define __FLT_MAX_10_EXP__ 38
-#define __LONG_MAX__ 0x7fffffffffffffffL
-#define __FLT64X_HAS_DENORM__ 1
-#define __DEC128_SUBNORMAL_MIN__ 0.000000000000000000000000000000001E-6143DL
-#define __FLT_HAS_INFINITY__ 1
-#define __cpp_unicode_literals 200710
-#define __UINT_FAST16_TYPE__ long unsigned int
-#define __DEC64_MAX__ 9.999999999999999E384DD
-#define __INT_FAST32_WIDTH__ 64
-#define __CHAR16_TYPE__ short unsigned int
-#define __PRAGMA_REDEFINE_EXTNAME 1
-#define __SIZE_WIDTH__ 64
-#define __SEG_FS 1
-#define __INT_LEAST16_MAX__ 0x7fff
-#define __DEC64_MANT_DIG__ 16
-#define __INT64_MAX__ 0x7fffffffffffffffL
-#define __UINT_LEAST32_MAX__ 0xffffffffU
-#define __SEG_GS 1
-#define __FLT32_DENORM_MIN__ 1.40129846432481707092372958328991613e-45F32
-#define __GCC_ATOMIC_LONG_LOCK_FREE 2
-#define __SIG_ATOMIC_WIDTH__ 32
-#define __INT_LEAST64_TYPE__ long int
-#define __INT16_TYPE__ short int
-#define __INT_LEAST8_TYPE__ signed char
-#define __DEC32_MAX_EXP__ 97
-#define __INT_FAST8_MAX__ 0x7f
-#define __FLT128_MAX__ 1.18973149535723176508575932662800702e+4932F128
-#define __INTPTR_MAX__ 0x7fffffffffffffffL
-#define __cpp_range_based_for 200907
-#define __FLT64_HAS_QUIET_NAN__ 1
-#define __FLT32_MIN_10_EXP__ (-37)
-#define __SSE2__ 1
-#define __EXCEPTIONS 1
-#define __LDBL_MANT_DIG__ 64
-#define __DBL_HAS_QUIET_NAN__ 1
-#define __FLT64_HAS_INFINITY__ 1
-#define __FLT64X_MAX__ 1.18973149535723176502126385303097021e+4932F64x
-#define __SIG_ATOMIC_MIN__ (-__SIG_ATOMIC_MAX__ - 1)
-#define __code_model_small__ 1
-#define __k8__ 1
-#define __INTPTR_TYPE__ long int
-#define __UINT16_TYPE__ short unsigned int
-#define __WCHAR_TYPE__ int
-#define __SIZEOF_FLOAT__ 4
-#define __pic__ 2
-#define __UINTPTR_MAX__ 0xffffffffffffffffUL
-#define __INT_FAST64_WIDTH__ 64
-#define __DEC64_MIN_EXP__ (-382)
-#define __cpp_decltype 200707
-#define __FLT32_DECIMAL_DIG__ 9
-#define __INT_FAST64_MAX__ 0x7fffffffffffffffL
-#define __GCC_ATOMIC_TEST_AND_SET_TRUEVAL 1
-#define __FLT_DIG__ 6
-#define __FLT64X_MAX_EXP__ 16384
-#define __UINT_FAST64_TYPE__ long unsigned int
-#define __INT_MAX__ 0x7fffffff
-#define __amd64__ 1
-#define __INT64_TYPE__ long int
-#define __FLT_MAX_EXP__ 128
-#define __ORDER_BIG_ENDIAN__ 4321
-#define __DBL_MANT_DIG__ 53
-#define __cpp_inheriting_constructors 201511
-#define __SIZEOF_FLOAT128__ 16
-#define __INT_LEAST64_MAX__ 0x7fffffffffffffffL
-#define __DEC64_MIN__ 1E-383DD
-#define __WINT_TYPE__ unsigned int
-#define __UINT_LEAST32_TYPE__ unsigned int
-#define __SIZEOF_SHORT__ 2
-#define __SSE__ 1
-#define __LDBL_MIN_EXP__ (-16381)
-#define __FLT64_MAX__ 1.79769313486231570814527423731704357e+308F64
-#define __WINT_WIDTH__ 32
-#define __INT_LEAST8_MAX__ 0x7f
-#define __FLT32X_MAX_10_EXP__ 308
-#define __SIZEOF_INT128__ 16
-#define __LDBL_MAX_10_EXP__ 4932
-#define __ATOMIC_RELAXED 0
-#define __DBL_EPSILON__ double(2.22044604925031308084726333618164062e-16L)
-#define __FLT128_MIN__ 3.36210314311209350626267781732175260e-4932F128
-#define _LP64 1
-#define __UINT8_C(c) c
-#define __FLT64_MAX_EXP__ 1024
-#define __INT_LEAST32_TYPE__ int
-#define __SIZEOF_WCHAR_T__ 4
-#define __FLT128_HAS_QUIET_NAN__ 1
-#define __INT_FAST8_TYPE__ signed char
-#define __FLT64X_MIN__ 3.36210314311209350626267781732175260e-4932F64x
-#define __GNUC_STDC_INLINE__ 1
-#define __FLT64_HAS_DENORM__ 1
-#define __FLT32_EPSILON__ 1.19209289550781250000000000000000000e-7F32
-#define __DBL_DECIMAL_DIG__ 17
-#define __STDC_UTF_32__ 1
-#define __INT_FAST8_WIDTH__ 8
-#define __FXSR__ 1
-#define __DEC_EVAL_METHOD__ 2
-#define __FLT32X_MAX__ 1.79769313486231570814527423731704357e+308F32x
-#define __cpp_runtime_arrays 198712
-#define __UINT64_TYPE__ long unsigned int
-#define __UINT32_C(c) c ## U
-#define __INTMAX_MAX__ 0x7fffffffffffffffL
-#define __cpp_alias_templates 200704
-#define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__
-#define __FLT_DENORM_MIN__ 1.40129846432481707092372958328991613e-45F
-#define __INT8_MAX__ 0x7f
-#define __LONG_WIDTH__ 64
-#define __PIC__ 2
-#define __UINT_FAST32_TYPE__ long unsigned int
-#define __CHAR32_TYPE__ unsigned int
-#define __FLT_MAX__ 3.40282346638528859811704183484516925e+38F
-#define __cpp_constexpr 200704
-#define __INT32_TYPE__ int
-#define __SIZEOF_DOUBLE__ 8
-#define __cpp_exceptions 199711
-#define __FLT_MIN_10_EXP__ (-37)
-#define __FLT64_MIN__ 2.22507385850720138309023271733240406e-308F64
-#define __INT_LEAST32_WIDTH__ 32
-#define __INTMAX_TYPE__ long int
-#define __DEC128_MAX_EXP__ 6145
-#define __FLT32X_HAS_QUIET_NAN__ 1
-#define __ATOMIC_CONSUME 1
-#define __GNUC_MINOR__ 3
-#define __INT_FAST16_WIDTH__ 64
-#define __UINTMAX_MAX__ 0xffffffffffffffffUL
-#define __DEC32_MANT_DIG__ 7
-#define __FLT32X_DENORM_MIN__ 4.94065645841246544176568792868221372e-324F32x
-#define __DBL_MAX_10_EXP__ 308
-#define __LDBL_DENORM_MIN__ 3.64519953188247460252840593361941982e-4951L
-#define __INT16_C(c) c
-#define __STDC__ 1
-#define __FLT32X_DIG__ 15
-#define __PTRDIFF_TYPE__ long int
-#define __ATOMIC_SEQ_CST 5
-#define __UINT32_TYPE__ unsigned int
-#define __FLT32X_MIN_10_EXP__ (-307)
-#define __UINTPTR_TYPE__ long unsigned int
-#define __DEC64_SUBNORMAL_MIN__ 0.000000000000001E-383DD
-#define __DEC128_MANT_DIG__ 34
-#define __LDBL_MIN_10_EXP__ (-4931)
-#define __FLT128_EPSILON__ 1.92592994438723585305597794258492732e-34F128
-#define __SSE_MATH__ 1
-#define __SIZEOF_LONG_LONG__ 8
-#define __cpp_user_defined_literals 200809
-#define __FLT128_DECIMAL_DIG__ 36
-#define __GCC_ATOMIC_LLONG_LOCK_FREE 2
-#define __FLT32X_MIN__ 2.22507385850720138309023271733240406e-308F32x
-#define __LDBL_DIG__ 18
-#define __FLT_DECIMAL_DIG__ 9
-#define __UINT_FAST16_MAX__ 0xffffffffffffffffUL
-#define __GCC_ATOMIC_SHORT_LOCK_FREE 2
-#define __INT_LEAST64_WIDTH__ 64
-#define __UINT_FAST8_TYPE__ unsigned char
-#define _GNU_SOURCE 1
-#define __ATOMIC_ACQ_REL 4
-#define __ATOMIC_RELEASE 3
diff --git a/src/quazip/.moc/moc_quagzipfile.cpp b/src/quazip/.moc/moc_quagzipfile.cpp
deleted file mode 100644
index 46edfd3e..00000000
--- a/src/quazip/.moc/moc_quagzipfile.cpp
+++ /dev/null
@@ -1,90 +0,0 @@
-/****************************************************************************
-** Meta object code from reading C++ file 'quagzipfile.h'
-**
-** Created by: The Qt Meta Object Compiler version 67 (Qt 5.11.3)
-**
-** WARNING! All changes made in this file will be lost!
-*****************************************************************************/
-
-#include "../quagzipfile.h"
-#include
-#include
-#if !defined(Q_MOC_OUTPUT_REVISION)
-#error "The header file 'quagzipfile.h' doesn't include ."
-#elif Q_MOC_OUTPUT_REVISION != 67
-#error "This file was generated using the moc from 5.11.3. It"
-#error "cannot be used with the include files from this version of Qt."
-#error "(The moc has changed too much.)"
-#endif
-
-QT_BEGIN_MOC_NAMESPACE
-QT_WARNING_PUSH
-QT_WARNING_DISABLE_DEPRECATED
-struct qt_meta_stringdata_QuaGzipFile_t {
- QByteArrayData data[1];
- char stringdata0[12];
-};
-#define QT_MOC_LITERAL(idx, ofs, len) \
- Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
- qptrdiff(offsetof(qt_meta_stringdata_QuaGzipFile_t, stringdata0) + ofs \
- - idx * sizeof(QByteArrayData)) \
- )
-static const qt_meta_stringdata_QuaGzipFile_t qt_meta_stringdata_QuaGzipFile = {
- {
-QT_MOC_LITERAL(0, 0, 11) // "QuaGzipFile"
-
- },
- "QuaGzipFile"
-};
-#undef QT_MOC_LITERAL
-
-static const uint qt_meta_data_QuaGzipFile[] = {
-
- // content:
- 7, // revision
- 0, // classname
- 0, 0, // classinfo
- 0, 0, // methods
- 0, 0, // properties
- 0, 0, // enums/sets
- 0, 0, // constructors
- 0, // flags
- 0, // signalCount
-
- 0 // eod
-};
-
-void QuaGzipFile::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
-{
- Q_UNUSED(_o);
- Q_UNUSED(_id);
- Q_UNUSED(_c);
- Q_UNUSED(_a);
-}
-
-QT_INIT_METAOBJECT const QMetaObject QuaGzipFile::staticMetaObject = {
- { &QIODevice::staticMetaObject, qt_meta_stringdata_QuaGzipFile.data,
- qt_meta_data_QuaGzipFile, qt_static_metacall, nullptr, nullptr}
-};
-
-
-const QMetaObject *QuaGzipFile::metaObject() const
-{
- return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
-}
-
-void *QuaGzipFile::qt_metacast(const char *_clname)
-{
- if (!_clname) return nullptr;
- if (!strcmp(_clname, qt_meta_stringdata_QuaGzipFile.stringdata0))
- return static_cast(this);
- return QIODevice::qt_metacast(_clname);
-}
-
-int QuaGzipFile::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
-{
- _id = QIODevice::qt_metacall(_c, _id, _a);
- return _id;
-}
-QT_WARNING_POP
-QT_END_MOC_NAMESPACE
diff --git a/src/quazip/.moc/moc_quaziodevice.cpp b/src/quazip/.moc/moc_quaziodevice.cpp
deleted file mode 100644
index ca25d112..00000000
--- a/src/quazip/.moc/moc_quaziodevice.cpp
+++ /dev/null
@@ -1,90 +0,0 @@
-/****************************************************************************
-** Meta object code from reading C++ file 'quaziodevice.h'
-**
-** Created by: The Qt Meta Object Compiler version 67 (Qt 5.11.3)
-**
-** WARNING! All changes made in this file will be lost!
-*****************************************************************************/
-
-#include "../quaziodevice.h"
-#include
-#include
-#if !defined(Q_MOC_OUTPUT_REVISION)
-#error "The header file 'quaziodevice.h' doesn't include ."
-#elif Q_MOC_OUTPUT_REVISION != 67
-#error "This file was generated using the moc from 5.11.3. It"
-#error "cannot be used with the include files from this version of Qt."
-#error "(The moc has changed too much.)"
-#endif
-
-QT_BEGIN_MOC_NAMESPACE
-QT_WARNING_PUSH
-QT_WARNING_DISABLE_DEPRECATED
-struct qt_meta_stringdata_QuaZIODevice_t {
- QByteArrayData data[1];
- char stringdata0[13];
-};
-#define QT_MOC_LITERAL(idx, ofs, len) \
- Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
- qptrdiff(offsetof(qt_meta_stringdata_QuaZIODevice_t, stringdata0) + ofs \
- - idx * sizeof(QByteArrayData)) \
- )
-static const qt_meta_stringdata_QuaZIODevice_t qt_meta_stringdata_QuaZIODevice = {
- {
-QT_MOC_LITERAL(0, 0, 12) // "QuaZIODevice"
-
- },
- "QuaZIODevice"
-};
-#undef QT_MOC_LITERAL
-
-static const uint qt_meta_data_QuaZIODevice[] = {
-
- // content:
- 7, // revision
- 0, // classname
- 0, 0, // classinfo
- 0, 0, // methods
- 0, 0, // properties
- 0, 0, // enums/sets
- 0, 0, // constructors
- 0, // flags
- 0, // signalCount
-
- 0 // eod
-};
-
-void QuaZIODevice::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
-{
- Q_UNUSED(_o);
- Q_UNUSED(_id);
- Q_UNUSED(_c);
- Q_UNUSED(_a);
-}
-
-QT_INIT_METAOBJECT const QMetaObject QuaZIODevice::staticMetaObject = {
- { &QIODevice::staticMetaObject, qt_meta_stringdata_QuaZIODevice.data,
- qt_meta_data_QuaZIODevice, qt_static_metacall, nullptr, nullptr}
-};
-
-
-const QMetaObject *QuaZIODevice::metaObject() const
-{
- return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
-}
-
-void *QuaZIODevice::qt_metacast(const char *_clname)
-{
- if (!_clname) return nullptr;
- if (!strcmp(_clname, qt_meta_stringdata_QuaZIODevice.stringdata0))
- return static_cast(this);
- return QIODevice::qt_metacast(_clname);
-}
-
-int QuaZIODevice::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
-{
- _id = QIODevice::qt_metacall(_c, _id, _a);
- return _id;
-}
-QT_WARNING_POP
-QT_END_MOC_NAMESPACE
diff --git a/src/quazip/.moc/moc_quazipfile.cpp b/src/quazip/.moc/moc_quazipfile.cpp
deleted file mode 100644
index b53ccc56..00000000
--- a/src/quazip/.moc/moc_quazipfile.cpp
+++ /dev/null
@@ -1,90 +0,0 @@
-/****************************************************************************
-** Meta object code from reading C++ file 'quazipfile.h'
-**
-** Created by: The Qt Meta Object Compiler version 67 (Qt 5.11.3)
-**
-** WARNING! All changes made in this file will be lost!
-*****************************************************************************/
-
-#include "../quazipfile.h"
-#include
-#include
-#if !defined(Q_MOC_OUTPUT_REVISION)
-#error "The header file 'quazipfile.h' doesn't include ."
-#elif Q_MOC_OUTPUT_REVISION != 67
-#error "This file was generated using the moc from 5.11.3. It"
-#error "cannot be used with the include files from this version of Qt."
-#error "(The moc has changed too much.)"
-#endif
-
-QT_BEGIN_MOC_NAMESPACE
-QT_WARNING_PUSH
-QT_WARNING_DISABLE_DEPRECATED
-struct qt_meta_stringdata_QuaZipFile_t {
- QByteArrayData data[1];
- char stringdata0[11];
-};
-#define QT_MOC_LITERAL(idx, ofs, len) \
- Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
- qptrdiff(offsetof(qt_meta_stringdata_QuaZipFile_t, stringdata0) + ofs \
- - idx * sizeof(QByteArrayData)) \
- )
-static const qt_meta_stringdata_QuaZipFile_t qt_meta_stringdata_QuaZipFile = {
- {
-QT_MOC_LITERAL(0, 0, 10) // "QuaZipFile"
-
- },
- "QuaZipFile"
-};
-#undef QT_MOC_LITERAL
-
-static const uint qt_meta_data_QuaZipFile[] = {
-
- // content:
- 7, // revision
- 0, // classname
- 0, 0, // classinfo
- 0, 0, // methods
- 0, 0, // properties
- 0, 0, // enums/sets
- 0, 0, // constructors
- 0, // flags
- 0, // signalCount
-
- 0 // eod
-};
-
-void QuaZipFile::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
-{
- Q_UNUSED(_o);
- Q_UNUSED(_id);
- Q_UNUSED(_c);
- Q_UNUSED(_a);
-}
-
-QT_INIT_METAOBJECT const QMetaObject QuaZipFile::staticMetaObject = {
- { &QIODevice::staticMetaObject, qt_meta_stringdata_QuaZipFile.data,
- qt_meta_data_QuaZipFile, qt_static_metacall, nullptr, nullptr}
-};
-
-
-const QMetaObject *QuaZipFile::metaObject() const
-{
- return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
-}
-
-void *QuaZipFile::qt_metacast(const char *_clname)
-{
- if (!_clname) return nullptr;
- if (!strcmp(_clname, qt_meta_stringdata_QuaZipFile.stringdata0))
- return static_cast(this);
- return QIODevice::qt_metacast(_clname);
-}
-
-int QuaZipFile::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
-{
- _id = QIODevice::qt_metacall(_c, _id, _a);
- return _id;
-}
-QT_WARNING_POP
-QT_END_MOC_NAMESPACE
diff --git a/src/quazip/JlCompress.cpp b/src/quazip/JlCompress.cpp
index fa8e2c5e..6c31d44b 100644
--- a/src/quazip/JlCompress.cpp
+++ b/src/quazip/JlCompress.cpp
@@ -401,10 +401,10 @@ QStringList JlCompress::extractDir(QuaZip &zip, const QString &dir)
removeFile(extracted);
return QStringList();
}
+ if(QThread::currentThread()->isInterruptionRequested()) { return QStringList(); }
extracted.append(absFilePath);
} while (zip.goToNextFile());
- // Chiudo il file zip
zip.close();
if(zip.getZipError()!=0) {
removeFile(extracted);
@@ -415,7 +415,6 @@ QStringList JlCompress::extractDir(QuaZip &zip, const QString &dir)
}
QStringList JlCompress::getFileList(QString fileCompressed) {
- // Apro lo zip
QuaZip* zip = new QuaZip(QFileInfo(fileCompressed).absoluteFilePath());
return getFileList(zip);
}
@@ -504,6 +503,9 @@ QStringList JlCompress::extractDir(QObject* obj, QString fileCompressed, QString
QString name = zip.getCurrentFileName();
QString absFilePath = directory.absoluteFilePath(name);
emit ((ExtractionWorker*)obj)->progress(++progress);
+
+ if(QThread::currentThread()->isInterruptionRequested()) { removeFile(extracted); return QStringList(); }
+
if (!extractFile(&zip, "", absFilePath)) {
removeFile(extracted);
return QStringList();