diff --git a/src/pages/appintopage.cpp b/src/pages/appintopage.cpp index 010cc90..eebf953 100644 --- a/src/pages/appintopage.cpp +++ b/src/pages/appintopage.cpp @@ -196,30 +196,28 @@ void AppIntoPage::openUrl(QUrl url) void AppIntoPage::isDownloading(QUrl url) { - if(dw->getUrlList().lastIndexOf(url) == -1) - { + if (dw->getUrlList().lastIndexOf(url) == -1) { ui->downloadButton->setEnabled(true); return; - }else{ + } else { ui->downloadButton->setEnabled(false); } - if(dw->getDIList()[dw->getUrlList().lastIndexOf(url)]->download == 2) - { + + ui->pushButton_3->hide(); + if (dw->getDIList()[dw->getUrlList().lastIndexOf(url)]->download == 2) { ui->downloadButton->setEnabled(true); ui->downloadButton->setText(tr("Download")); } - if(dw->getDIList()[dw->getUrlList().lastIndexOf(url)]->download == 1) - { + if (dw->getDIList()[dw->getUrlList().lastIndexOf(url)]->download == 1) { ui->downloadButton->setEnabled(true); ui->downloadButton->setText(tr("Install")); } - if(dw->getDIList()[dw->getUrlList().lastIndexOf(url)]->isInstall) - { + if (dw->getDIList()[dw->getUrlList().lastIndexOf(url)]->isInstall) { ui->downloadButton->setEnabled(false); ui->downloadButton->setText(tr("Installing")); + return; } - if(dw->getDIList()[dw->getUrlList().lastIndexOf(url)]->download == 3) - { + if (dw->getDIList()[dw->getUrlList().lastIndexOf(url)]->download == 3) { ui->downloadButton->setEnabled(true); ui->downloadButton->setText(tr("Reinstall")); ui->downloadButton->show(); diff --git a/src/widgets/common/downloaditem.cpp b/src/widgets/common/downloaditem.cpp index 996b144..bff0095 100644 --- a/src/widgets/common/downloaditem.cpp +++ b/src/widgets/common/downloaditem.cpp @@ -164,11 +164,11 @@ void DownloadItem::install(int t) ui->widget_spinner->hide(); DownloadItem::isInstall = false; + emit finished(); }); - emit finished(); + // emit finished(); qDebug()<label_filename->text().toUtf8(); } - } void DownloadItem::on_pushButton_install_clicked()