summaryrefslogtreecommitdiffstats
path: root/utils/themeeditor/gui/fontdownloader.cpp
diff options
context:
space:
mode:
authorRobert Bieber <robby@bieberphoto.com>2010-07-25 21:59:35 +0000
committerRobert Bieber <robby@bieberphoto.com>2010-07-25 21:59:35 +0000
commitd92f8174a1f838684645267e87b3afebfc48143f (patch)
treefe705adf4815eb38f7646ea7a0cb0a0841c74b43 /utils/themeeditor/gui/fontdownloader.cpp
parente1e51f99949f2a2967210342fcea6e8ae8495e0b (diff)
downloadrockbox-d92f8174a1f838684645267e87b3afebfc48143f.tar.gz
rockbox-d92f8174a1f838684645267e87b3afebfc48143f.zip
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
Diffstat (limited to 'utils/themeeditor/gui/fontdownloader.cpp')
-rw-r--r--utils/themeeditor/gui/fontdownloader.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/utils/themeeditor/gui/fontdownloader.cpp b/utils/themeeditor/gui/fontdownloader.cpp
index 693f4a5b20..adc2e98ab3 100644
--- a/utils/themeeditor/gui/fontdownloader.cpp
+++ b/utils/themeeditor/gui/fontdownloader.cpp
@@ -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"));