- if (proxy > 0) {
- proxyText = QString::number(proxy) + "% ";
- proxyText.append(i18n("Generating proxy ..."));
- brush = option.palette.highlight();
- color = option.palette.color(QPalette::HighlightedText);
-
- }
- else if (proxy == PROXYDONE) {
- proxyText = i18n("Proxy");
- brush = option.palette.mid();
- color = option.palette.color(QPalette::WindowText);
- }
- else {
- switch (proxy) {
- case CREATINGPROXY:
- proxyText = i18n("Generating proxy ...");
- break;
- case PROXYWAITING:
- proxyText = i18n("Waiting proxy ...");
- break;
- case PROXYCRASHED:
- default:
- proxyText = i18n("Proxy crashed");
+ if (proxy != JOBCRASHED) {
+ // Draw proxy progress bar
+ color = option.palette.alternateBase().color();
+ painter->setPen(Qt::NoPen);
+ color.setAlpha(180);
+ painter->setBrush(QBrush(color));
+ QRect progress(pixmapPoint.x() + 1, pixmapPoint.y() + pixmap.height() - 5, pixmap.width() - 2, 4);
+ painter->drawRect(progress);
+ painter->setBrush(option.palette.text());
+ if (proxy > 0) {
+ progress.adjust(1, 1, 0, -1);
+ progress.setWidth((pixmap.width() - 4) * proxy / 100);
+ painter->drawRect(progress);
+ }
+ else if (proxy == JOBWAITING) {
+ // Draw kind of a pause icon
+ progress.adjust(1, 1, 0, -1);
+ progress.setWidth(2);
+ painter->drawRect(progress);
+ progress.moveLeft(progress.right() + 2);
+ painter->drawRect(progress);