Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 21068 → Rev 21067

/trunk/Scribus/scribus/ui/resourcemanager.cpp
26,7 → 26,6
#include <QDomDocument>
#include <QFile>
#include <QFileInfo>
#include <QLabel>
#include <QList>
#include <QMessageBox>
#include <QString>
53,7 → 52,6
downloadButton->setEnabled(false);
downloadProgressBar->setValue(0);
downloadProgressBar->setVisible(false);
dataReceivedLabel->setVisible(false);
languageChange();
 
connect(categoryComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(categoryChanged()));
687,7 → 685,6
downloadButton->setEnabled(false);
downloadProgressBar->setValue(0);
downloadProgressBar->setVisible(true);
dataReceivedLabel->setVisible(true);
downloadProgressBar->setRange(0, dataFiles.count());
foreach(QString f, dataFiles)
ScQApp->dlManager()->addURL("http://services.scribus.net/"+f, true, ScPaths::downloadDir(), ScPaths::downloadDir());
696,8 → 693,6
connect(ScQApp->dlManager(), SIGNAL(finished()), this, SLOT(downloadListFinished()));
connect(ScQApp->dlManager(), SIGNAL(fileReceived(const QString&)), this, SLOT(updateProgressBar()));
connect(ScQApp->dlManager(), SIGNAL(fileFailed(const QString&)), this, SLOT(updateProgressBar()));
connect(ScQApp->dlManager(), SIGNAL(fileFailed(const QString&)), this, SLOT(updateProgressBar()));
connect(ScQApp->dlManager(), SIGNAL(fileDownloadProgress(qint64, qint64)), this, SLOT(updateProgressData(qint64, qint64)));
ScQApp->dlManager()->startDownloads();
}
 
706,7 → 701,6
disconnect(ScQApp->dlManager(), SIGNAL(finished()), this, SLOT(downloadListFinished()));
disconnect(ScQApp->dlManager(), SIGNAL(fileReceived(const QString&)), this, SLOT(updateProgressBar()));
disconnect(ScQApp->dlManager(), SIGNAL(fileFailed(const QString&)), this, SLOT(updateProgressBar()));
disconnect(ScQApp->dlManager(), SIGNAL(fileDownloadProgress(qint64, qint64)), this, SLOT(updateProgressData(qint64, qint64)));
 
int category = categoryComboBox->currentData().toInt();
switch (category)
740,7 → 734,6
downloadButton->setEnabled(true);
downloadProgressBar->setValue(0);
downloadProgressBar->setVisible(false);
dataReceivedLabel->setVisible(false);
}
 
void ResourceManager::downloadFilesFinished()
748,11 → 741,9
disconnect(ScQApp->dlManager(), SIGNAL(finished()), this, SLOT(downloadFilesFinished()));
disconnect(ScQApp->dlManager(), SIGNAL(fileReceived(const QString&)), this, SLOT(updateProgressBar()));
disconnect(ScQApp->dlManager(), SIGNAL(fileFailed(const QString&)), this, SLOT(updateProgressBar()));
disconnect(ScQApp->dlManager(), SIGNAL(fileDownloadProgress(qint64, qint64)), this, SLOT(updateProgressData(qint64, qint64)));
categoryChanged();
downloadProgressBar->setValue(0);
downloadProgressBar->setVisible(false);
dataReceivedLabel->setVisible(false);
downloadButton->setEnabled(true);
 
int category = categoryComboBox->currentData().toInt();
932,20 → 923,6
downloadProgressBar->setValue(downloadProgressBar->value() + 1);
}
 
void ResourceManager::updateProgressData(qint64 bytesReceived, qint64 bytesTotal)
{
QString totalText;
if (bytesTotal == -1)
totalText = QString("%1 bytes").arg(bytesReceived);
else
{
totalText = QString("%1 / %2 bytes").arg(bytesReceived).arg(bytesTotal);
QString totalTextWidth = QString("%1 / %2 bytes").arg(bytesTotal).arg(bytesTotal);
dataReceivedLabel->setMinimumWidth(QWidget::fontMetrics().width(totalTextWidth));
}
dataReceivedLabel->setText(totalText);
}
 
void ResourceManager::startDownload()
{
int rows = availableTableWidget->rowCount();
964,7 → 941,6
downloadList.clear();
downloadProgressBar->setValue(0);
downloadProgressBar->setVisible(true);
dataReceivedLabel->setVisible(true);
// dlLabel->setVisible(true);
int dlCount=0;
 
1069,7 → 1045,6
connect(ScQApp->dlManager(), SIGNAL(finished()), this, SLOT(downloadFilesFinished()));
connect(ScQApp->dlManager(), SIGNAL(fileReceived(const QString&)), this, SLOT(updateProgressBar()));
connect(ScQApp->dlManager(), SIGNAL(fileFailed(const QString&)), this, SLOT(updateProgressBar()));
connect(ScQApp->dlManager(), SIGNAL(fileDownloadProgress(qint64, qint64)), this, SLOT(updateProgressData(qint64, qint64)));
ScQApp->dlManager()->startDownloads();
}
}
/trunk/Scribus/scribus/ui/resourcemanager.h
99,7 → 99,6
void downloadLicenseFileFinished(const QString &);
void downloadLicenseFileFailed(const QString &);
void updateProgressBar();
void updateProgressData(qint64 bytesReceived, qint64 bytesTotal);
void startDownload();
void showLicense();
 
/trunk/Scribus/scribus/ui/resourcemanagerbase.ui
Cannot display: file marked as a binary type.
svn:mime-type = application/xml
/trunk/Scribus/scribus/downloadmanager/scdlthread.cpp
128,7 → 128,6
m_currentDownload = m_manager.get(request);
connect(m_currentDownload, SIGNAL(finished()), this, SLOT(downloadFinished()));
connect(m_currentDownload, SIGNAL(readyRead()), this, SLOT(downloadReadyRead()));
connect(m_currentDownload, SIGNAL(downloadProgress(qint64, qint64)), this, SIGNAL(fileDownloadProgress(qint64, qint64)));
 
//qDebug()<<"Downloading:"<<urlPair.first.toEncoded().constData();
}
/trunk/Scribus/scribus/downloadmanager/scdlmgr.cpp
19,7 → 19,6
connect(m_thread, SIGNAL(fileReceived(const QString &)), this, SLOT(dlReceived(const QString&)));
connect(m_thread, SIGNAL(fileFailed(const QString &)), this, SLOT(dlFailed(const QString&)));
connect(m_thread, SIGNAL(fileStarted(const QString &)), this, SLOT(dlStarted(const QString &)));
connect(m_thread, SIGNAL(fileDownloadProgress(qint64, qint64)), this, SIGNAL(fileDownloadProgress(qint64, qint64)));
//connect(thread, SIGNAL(finished()), this, SIGNAL(finished()));
connect(m_thread, SIGNAL(finished()), this, SLOT(moveFinishedDownloads()));
}
/trunk/Scribus/scribus/downloadmanager/scdlmgr.h
40,7 → 40,6
void finished();
void fileReceived(const QString& t);
void fileFailed(const QString& t);
void fileDownloadProgress(qint64 bytesReceived, qint64 bytesTotal);
 
private:
ScDLThread *m_thread;
/trunk/Scribus/scribus/downloadmanager/scdlthread.h
29,7 → 29,6
void fileStarted(const QString &);
void fileReceived(const QString &);
void fileFailed(const QString &);
void fileDownloadProgress(qint64 bytesReceived, qint64 bytesTotal);
 
private slots:
void startNextDownload();