Commit baced5ca authored by Hans-Christian Ebke's avatar Hans-Christian Ebke

Merge branch 'master' of roosevelt.informatik.rwth-aachen.de:OpenFlipper-Free/OpenFlipper-Free

parents 0fe01d2e 926ad668
......@@ -86,9 +86,13 @@ void OptionsWidget::startDownload( QString _url ) {
statusLabel->setText(tr("Getting Versions file from Server"));
progressDialog->setWindowTitle(tr("HTTP"));
progressDialog->setLabelText(tr("Downloading %1.").arg(fileName));
progressDialog->show();
if ( ! progressDialog_ ) {
progressDialog_ = new QProgressDialog(this);
connect(progressDialog_, SIGNAL(canceled()), this, SLOT(cancelDownload()));
}
progressDialog_->setWindowTitle(tr("HTTP"));
progressDialog_->setLabelText(tr("Downloading %1.").arg(fileName));
progressDialog_->show();
downloadRep_ = networkMan_->get(req);
......@@ -126,14 +130,17 @@ void OptionsWidget::httpRequestFinished(QNetworkReply* _qnr)
file = 0;
}
progressDialog->hide();
progressDialog_->hide();
checkUpdateButton->setEnabled(true);
return;
}
progressDialog->hide();
progressDialog_->hide();
file->close();
delete(progressDialog_);
progressDialog_ = 0;
if (error != QNetworkReply::NoError) {
file->remove();
} else {
......@@ -167,8 +174,10 @@ void OptionsWidget::updateDataReadProgress(qint64 _bytesReceived, qint64 _bytesT
if (httpRequestAborted)
return;
progressDialog->setMaximum(_bytesTotal);
progressDialog->setValue(_bytesReceived);
if (progressDialog_) {
progressDialog_->setMaximum(_bytesTotal);
progressDialog_->setValue(_bytesReceived);
}
}
void OptionsWidget::showError(QNetworkReply::NetworkError _error)
......
......@@ -62,6 +62,7 @@ OptionsWidget::OptionsWidget(std::vector<PluginInfo>& _plugins, std::vector<KeyB
plugins_(_plugins),
coreKeys_(_core),
keys_(_invKeys),
progressDialog_(NULL),
restartRequired_(false),
exitOnClose_(false)
{
......@@ -135,10 +136,6 @@ OptionsWidget::OptionsWidget(std::vector<PluginInfo>& _plugins, std::vector<KeyB
connect(networkMan_,SIGNAL(authenticationRequired(QNetworkReply* , QAuthenticator *)),
this,SLOT(authentication(QNetworkReply *, QAuthenticator*)));
progressDialog = new QProgressDialog(this);
connect(progressDialog, SIGNAL(canceled()), this, SLOT(cancelDownload()));
//colordialog
connect(backgroundButton, SIGNAL(clicked()), this, SLOT(getBackgroundColor()) );
connect(defaultColorButton, SIGNAL(clicked()), this, SLOT(getDefaultColor()) );
......
......@@ -177,7 +177,7 @@ private:
QFile *file;
// ProgressDialog for Downloads
QProgressDialog *progressDialog;
QProgressDialog *progressDialog_;
// What type of download is currently active
enum DOWNLOAD {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment