diff options
author | Robert Bieber <robby@bieberphoto.com> | 2010-07-25 21:59:35 +0000 |
---|---|---|
committer | Robert Bieber <robby@bieberphoto.com> | 2010-07-25 21:59:35 +0000 |
commit | d92f8174a1f838684645267e87b3afebfc48143f (patch) | |
tree | fe705adf4815eb38f7646ea7a0cb0a0841c74b43 /utils/themeeditor/gui/fontdownloader.cpp | |
parent | e1e51f99949f2a2967210342fcea6e8ae8495e0b (diff) | |
download | rockbox-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.cpp | 15 |
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 @@ | |||
34 | 34 | ||
35 | FontDownloader::FontDownloader(QWidget *parent, QString path) : | 35 | FontDownloader::FontDownloader(QWidget *parent, QString path) : |
36 | QDialog(parent), | 36 | QDialog(parent), |
37 | ui(new Ui::FontDownloader), dir(path), reply(0) | 37 | ui(new Ui::FontDownloader), dir(path), reply(0), cancelled(false) |
38 | { | 38 | { |
39 | ui->setupUi(this); | 39 | ui->setupUi(this); |
40 | 40 | ||
41 | QObject::connect(ui->cancelButton, SIGNAL(clicked()), | ||
42 | this, SLOT(cancel())); | ||
43 | |||
41 | manager = new QNetworkAccessManager(); | 44 | manager = new QNetworkAccessManager(); |
42 | 45 | ||
43 | if(!dir.exists()) | 46 | if(!dir.exists()) |
@@ -91,12 +94,18 @@ FontDownloader::~FontDownloader() | |||
91 | 94 | ||
92 | void FontDownloader::cancel() | 95 | void FontDownloader::cancel() |
93 | { | 96 | { |
97 | cancelled = true; | ||
98 | |||
94 | if(reply) | 99 | if(reply) |
95 | { | 100 | { |
96 | reply->abort(); | 101 | reply->abort(); |
97 | reply->deleteLater(); | 102 | reply->deleteLater(); |
98 | reply = 0; | 103 | reply = 0; |
99 | } | 104 | } |
105 | fout.close(); | ||
106 | fout.remove(); | ||
107 | |||
108 | close(); | ||
100 | } | 109 | } |
101 | 110 | ||
102 | void FontDownloader::dataReceived() | 111 | void FontDownloader::dataReceived() |
@@ -115,7 +124,11 @@ void FontDownloader::progress(qint64 bytes, qint64 available) | |||
115 | 124 | ||
116 | void FontDownloader::finished() | 125 | void FontDownloader::finished() |
117 | { | 126 | { |
127 | if(cancelled) | ||
128 | return; | ||
129 | |||
118 | fout.close(); | 130 | fout.close(); |
131 | |||
119 | reply->deleteLater(); | 132 | reply->deleteLater(); |
120 | reply = 0; | 133 | reply = 0; |
121 | ui->label->setText(tr("Download complete")); | 134 | ui->label->setText(tr("Download complete")); |