added switching colors for different uploads

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1431 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
defnax 2009-07-25 23:54:56 +00:00
parent 9f9773caba
commit dacdc90c4b

View File

@ -24,6 +24,7 @@
#include <QStyleOptionProgressBarV2>
#include <QProgressBar>
#include <QApplication>
#include <QtGui>
#include "ULListDelegate.h"
@ -125,7 +126,18 @@ void ULListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti
{
progress = index.data().toDouble();
// create a xProgressBar
xProgressBar progressBar(option.rect, painter, 8); // the 3rd param is the color schema (0 is the default value)
xProgressBar progressBar(option.rect, painter );// the 3rd param is the color schema (0 is the default value)
QString ext = QFileInfo(QString::fromStdString(index.sibling(index.row(), UNAME).data().toString().toStdString())).suffix();;
if (ext == "rsfc" || ext == "dist" )
{
progressBar.setColorSchema( 9);
}
else
{
progressBar.setColorSchema( 8);
}
progressBar.setDisplayText(false); // should display % text?
progressBar.setValue(progress); // set the progress value
progressBar.setVerticalSpan(1);