Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 21067 → Rev 21068

/trunk/Scribus/scribus/downloadmanager/scdlmgr.cpp
19,6 → 19,7
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,6 → 40,7
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.cpp
128,6 → 128,7
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/scdlthread.h
29,6 → 29,7
void fileStarted(const QString &);
void fileReceived(const QString &);
void fileFailed(const QString &);
void fileDownloadProgress(qint64 bytesReceived, qint64 bytesTotal);
 
private slots:
void startNextDownload();
/trunk/Scribus/scribus/ui/resourcemanager.cpp
26,6 → 26,7
#include <QDomDocument>
#include <QFile>
#include <QFileInfo>
#include <QLabel>
#include <QList>
#include <QMessageBox>
#include <QString>
52,6 → 53,7
downloadButton->setEnabled(false);
downloadProgressBar->setValue(0);
downloadProgressBar->setVisible(false);
dataReceivedLabel->setVisible(false);
languageChange();
 
connect(categoryComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(categoryChanged()));
685,6 → 687,7
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());
693,6 → 696,8
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();
}
 
701,6 → 706,7
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)
734,6 → 740,7
downloadButton->setEnabled(true);
downloadProgressBar->setValue(0);
downloadProgressBar->setVisible(false);
dataReceivedLabel->setVisible(false);
}
 
void ResourceManager::downloadFilesFinished()
741,9 → 748,11
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();
923,6 → 932,20
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();
941,6 → 964,7
downloadList.clear();
downloadProgressBar->setValue(0);
downloadProgressBar->setVisible(true);
dataReceivedLabel->setVisible(true);
// dlLabel->setVisible(true);
int dlCount=0;
 
1045,6 → 1069,7
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,6 → 99,7
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