forked from len0rd/rockbox
Theme Editor: Added targetdb download to preferences dialog, fixed Cancel button on FontDownloader
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27565 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
e1e51f9994
commit
d92f8174a1
9 changed files with 319 additions and 7 deletions
|
|
@ -34,10 +34,13 @@
|
|||
|
||||
FontDownloader::FontDownloader(QWidget *parent, QString path) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::FontDownloader), dir(path), reply(0)
|
||||
ui(new Ui::FontDownloader), dir(path), reply(0), cancelled(false)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
QObject::connect(ui->cancelButton, SIGNAL(clicked()),
|
||||
this, SLOT(cancel()));
|
||||
|
||||
manager = new QNetworkAccessManager();
|
||||
|
||||
if(!dir.exists())
|
||||
|
|
@ -91,12 +94,18 @@ FontDownloader::~FontDownloader()
|
|||
|
||||
void FontDownloader::cancel()
|
||||
{
|
||||
cancelled = true;
|
||||
|
||||
if(reply)
|
||||
{
|
||||
reply->abort();
|
||||
reply->deleteLater();
|
||||
reply = 0;
|
||||
}
|
||||
fout.close();
|
||||
fout.remove();
|
||||
|
||||
close();
|
||||
}
|
||||
|
||||
void FontDownloader::dataReceived()
|
||||
|
|
@ -115,7 +124,11 @@ void FontDownloader::progress(qint64 bytes, qint64 available)
|
|||
|
||||
void FontDownloader::finished()
|
||||
{
|
||||
if(cancelled)
|
||||
return;
|
||||
|
||||
fout.close();
|
||||
|
||||
reply->deleteLater();
|
||||
reply = 0;
|
||||
ui->label->setText(tr("Download complete"));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue