spark-store/downloadlist.cpp
2020-06-18 19:04:16 +08:00

64 lines
1.2 KiB
C++

#include "downloadlist.h"
#include "ui_downloadlist.h"
#include <QDebug>
downloadlist::downloadlist(QWidget *parent) :
QWidget(parent),
ui(new Ui::downloadlist)
{
ui->setupUi(this);
ui->pushButton->setEnabled(false);
ui->progressBar->setValue(0);
ui->label_filename->hide();
}
downloadlist::~downloadlist()
{
delete ui;
}
void downloadlist::setValue(long long value)
{
ui->progressBar->setValue(value);
}
void downloadlist::setMax(long long max)
{
ui->progressBar->setMaximum(max);
}
void downloadlist::setName(QString name)
{
ui->label->setText(name);
}
QString downloadlist::getName()
{
return ui->label->text();
}
void downloadlist::readyInstall()
{
ui->progressBar->hide();
ui->pushButton->setEnabled(true);
}
void downloadlist::choose(bool isChoosed)
{
if(isChoosed){
ui->label->setStyleSheet("color:#FFFFFF");
}else {
ui->label->setStyleSheet("color:#000000");
}
}
void downloadlist::setFileName(QString fileName)
{
ui->label_filename->setText(fileName);
}
void downloadlist::on_pushButton_clicked()
{
system("deepin-deb-installer "+ui->label_filename->text().toUtf8()+"&");
qDebug()<<ui->label_filename->text().toUtf8();
}