| 648 | } |
| 649 | |
| 650 | void |
| 651 | ProgressTaskInfo::createCellWidgets() |
| 652 | { |
| 653 | _imp->progressBar = new QProgressBar; |
| 654 | _imp->progressBar->setValue(_imp->progressPercent); |
| 655 | //We must call this otherwise this is never called by Qt for custom widgets (this is a Qt bug) |
| 656 | { |
| 657 | QSize s = _imp->progressBar->minimumSizeHint(); |
| 658 | Q_UNUSED(s); |
| 659 | } |
| 660 | _imp->controlsButtonsContainer = new QWidget; |
| 661 | QHBoxLayout* layout = new QHBoxLayout(_imp->controlsButtonsContainer); |
| 662 | layout->setContentsMargins(0, 0, 0, 0); |
| 663 | layout->setSpacing(0); |
| 664 | |
| 665 | int medSizeIcon = TO_DPIX(NATRON_MEDIUM_BUTTON_ICON_SIZE); |
| 666 | QPixmap restartPix, pauseOnPix, pauseOffPix, clearTasksPix; |
| 667 | appPTR->getIcon(NATRON_PIXMAP_PLAYER_PLAY_DISABLED, medSizeIcon, &restartPix); |
| 668 | appPTR->getIcon(NATRON_PIXMAP_PLAYER_STOP_DISABLED, medSizeIcon, &clearTasksPix); |
| 669 | appPTR->getIcon(NATRON_PIXMAP_PLAYER_PAUSE_ENABLED, medSizeIcon, &pauseOnPix); |
| 670 | appPTR->getIcon(NATRON_PIXMAP_PLAYER_PAUSE_DISABLED, medSizeIcon, &pauseOffPix); |
| 671 | |
| 672 | const QSize medButtonIconSize( TO_DPIX(NATRON_MEDIUM_BUTTON_ICON_SIZE), TO_DPIY(NATRON_MEDIUM_BUTTON_ICON_SIZE) ); |
| 673 | const QSize medButtonSize( TO_DPIX(NATRON_MEDIUM_BUTTON_SIZE), TO_DPIY(NATRON_MEDIUM_BUTTON_SIZE) ); |
| 674 | QIcon pauseIc; |
| 675 | pauseIc.addPixmap(pauseOnPix, QIcon::Normal, QIcon::On); |
| 676 | pauseIc.addPixmap(pauseOffPix, QIcon::Normal, QIcon::Off); |
| 677 | _imp->pauseTasksButton = new Button(pauseIc, QString(), _imp->controlsButtonsContainer); |
| 678 | _imp->pauseTasksButton->setFixedSize(medButtonSize); |
| 679 | _imp->pauseTasksButton->setIconSize(medButtonIconSize); |
| 680 | _imp->pauseTasksButton->setFocusPolicy(Qt::NoFocus); |
| 681 | _imp->pauseTasksButton->setToolTip( NATRON_NAMESPACE::convertFromPlainText(tr("Pause the task. Tasks that can be paused " |
| 682 | "may be restarted with the restart button."), NATRON_NAMESPACE::WhiteSpaceNormal) ); |
| 683 | QObject::connect( _imp->pauseTasksButton, SIGNAL(clicked(bool)), this, SLOT(onPauseTriggered()) ); |
| 684 | _imp->pauseTasksButton->setEnabled(_imp->canBePaused); |
| 685 | layout->addWidget(_imp->pauseTasksButton); |
| 686 | |
| 687 | _imp->restartTasksButton = new Button(QIcon(restartPix), QString(), _imp->controlsButtonsContainer); |
| 688 | _imp->restartTasksButton->setFixedSize(medButtonSize); |
| 689 | _imp->restartTasksButton->setIconSize(medButtonIconSize); |
| 690 | _imp->restartTasksButton->setFocusPolicy(Qt::NoFocus); |
| 691 | _imp->restartTasksButton->setToolTip( NATRON_NAMESPACE::convertFromPlainText(tr("Restart task"), NATRON_NAMESPACE::WhiteSpaceNormal) ); |
| 692 | QObject::connect( _imp->restartTasksButton, SIGNAL(clicked(bool)), this, SLOT(onRestartTriggered()) ); |
| 693 | _imp->restartTasksButton->setEnabled(false); |
| 694 | layout->addWidget(_imp->restartTasksButton); |
| 695 | |
| 696 | |
| 697 | _imp->cancelTasksButton = new Button(QIcon(clearTasksPix), QString(), _imp->controlsButtonsContainer); |
| 698 | _imp->cancelTasksButton->setFixedSize(medButtonSize); |
| 699 | _imp->cancelTasksButton->setIconSize(medButtonIconSize); |
| 700 | _imp->cancelTasksButton->setFocusPolicy(Qt::NoFocus); |
| 701 | _imp->cancelTasksButton->setToolTip( NATRON_NAMESPACE::convertFromPlainText(tr("Cancel and remove the task from the list"), NATRON_NAMESPACE::WhiteSpaceNormal) ); |
| 702 | QObject::connect( _imp->cancelTasksButton, SIGNAL(clicked(bool)), this, SLOT(onCancelTriggered()) ); |
| 703 | layout->addWidget(_imp->cancelTasksButton); |
| 704 | |
| 705 | _imp->refreshButtons(); |
| 706 | } // ProgressTaskInfo::createCellWidgets |
| 707 |
no test coverage detected